diff options
Diffstat (limited to 'include')
108 files changed, 1820 insertions, 1101 deletions
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 3795590e152a..0574add2a1e3 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -127,7 +127,7 @@ struct acpi_processor_performance { | |||
127 | unsigned int state_count; | 127 | unsigned int state_count; |
128 | struct acpi_processor_px *states; | 128 | struct acpi_processor_px *states; |
129 | struct acpi_psd_package domain_info; | 129 | struct acpi_psd_package domain_info; |
130 | cpumask_t shared_cpu_map; | 130 | cpumask_var_t shared_cpu_map; |
131 | unsigned int shared_type; | 131 | unsigned int shared_type; |
132 | }; | 132 | }; |
133 | 133 | ||
@@ -172,7 +172,7 @@ struct acpi_processor_throttling { | |||
172 | unsigned int state_count; | 172 | unsigned int state_count; |
173 | struct acpi_processor_tx_tss *states_tss; | 173 | struct acpi_processor_tx_tss *states_tss; |
174 | struct acpi_tsd_package domain_info; | 174 | struct acpi_tsd_package domain_info; |
175 | cpumask_t shared_cpu_map; | 175 | cpumask_var_t shared_cpu_map; |
176 | int (*acpi_processor_get_throttling) (struct acpi_processor * pr); | 176 | int (*acpi_processor_get_throttling) (struct acpi_processor * pr); |
177 | int (*acpi_processor_set_throttling) (struct acpi_processor * pr, | 177 | int (*acpi_processor_set_throttling) (struct acpi_processor * pr, |
178 | int state); | 178 | int state); |
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h index 39456ba0ec17..287f6f697ce2 100644 --- a/include/asm-frv/bitops.h +++ b/include/asm-frv/bitops.h | |||
@@ -339,6 +339,19 @@ int __ffs(unsigned long x) | |||
339 | return 31 - bit; | 339 | return 31 - bit; |
340 | } | 340 | } |
341 | 341 | ||
342 | /** | ||
343 | * __fls - find last (most-significant) set bit in a long word | ||
344 | * @word: the word to search | ||
345 | * | ||
346 | * Undefined if no set bit exists, so code should check against 0 first. | ||
347 | */ | ||
348 | static inline unsigned long __fls(unsigned long word) | ||
349 | { | ||
350 | unsigned long bit; | ||
351 | asm("scan %1,gr0,%0" : "=r"(bit) : "r"(word)); | ||
352 | return bit; | ||
353 | } | ||
354 | |||
342 | /* | 355 | /* |
343 | * special slimline version of fls() for calculating ilog2_u32() | 356 | * special slimline version of fls() for calculating ilog2_u32() |
344 | * - note: no protection against n == 0 | 357 | * - note: no protection against n == 0 |
diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index 54bbf6e04ee8..0e9e2bc0ee96 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h | |||
@@ -40,6 +40,9 @@ | |||
40 | #ifndef node_to_cpumask | 40 | #ifndef node_to_cpumask |
41 | #define node_to_cpumask(node) ((void)node, cpu_online_map) | 41 | #define node_to_cpumask(node) ((void)node, cpu_online_map) |
42 | #endif | 42 | #endif |
43 | #ifndef cpumask_of_node | ||
44 | #define cpumask_of_node(node) ((void)node, cpu_online_mask) | ||
45 | #endif | ||
43 | #ifndef node_to_first_cpu | 46 | #ifndef node_to_first_cpu |
44 | #define node_to_first_cpu(node) ((void)(node),0) | 47 | #define node_to_first_cpu(node) ((void)(node),0) |
45 | #endif | 48 | #endif |
@@ -54,9 +57,18 @@ | |||
54 | ) | 57 | ) |
55 | #endif | 58 | #endif |
56 | 59 | ||
60 | #ifndef cpumask_of_pcibus | ||
61 | #define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \ | ||
62 | cpu_all_mask : \ | ||
63 | cpumask_of_node(pcibus_to_node(bus))) | ||
64 | #endif | ||
65 | |||
57 | #endif /* CONFIG_NUMA */ | 66 | #endif /* CONFIG_NUMA */ |
58 | 67 | ||
59 | /* returns pointer to cpumask for specified node */ | 68 | /* |
69 | * returns pointer to cpumask for specified node | ||
70 | * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)" | ||
71 | */ | ||
60 | #ifndef node_to_cpumask_ptr | 72 | #ifndef node_to_cpumask_ptr |
61 | 73 | ||
62 | #define node_to_cpumask_ptr(v, node) \ | 74 | #define node_to_cpumask_ptr(v, node) \ |
diff --git a/include/asm-m32r/bitops.h b/include/asm-m32r/bitops.h index 6dc9b81bf9f3..aaddf0d57603 100644 --- a/include/asm-m32r/bitops.h +++ b/include/asm-m32r/bitops.h | |||
@@ -251,6 +251,7 @@ static __inline__ int test_and_change_bit(int nr, volatile void * addr) | |||
251 | #include <asm-generic/bitops/ffz.h> | 251 | #include <asm-generic/bitops/ffz.h> |
252 | #include <asm-generic/bitops/__ffs.h> | 252 | #include <asm-generic/bitops/__ffs.h> |
253 | #include <asm-generic/bitops/fls.h> | 253 | #include <asm-generic/bitops/fls.h> |
254 | #include <asm-generic/bitops/__fls.h> | ||
254 | #include <asm-generic/bitops/fls64.h> | 255 | #include <asm-generic/bitops/fls64.h> |
255 | 256 | ||
256 | #ifdef __KERNEL__ | 257 | #ifdef __KERNEL__ |
diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h index c5dd66916692..b96a6d2ffbc3 100644 --- a/include/asm-m32r/smp.h +++ b/include/asm-m32r/smp.h | |||
@@ -63,8 +63,6 @@ extern volatile int cpu_2_physid[NR_CPUS]; | |||
63 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 63 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
64 | 64 | ||
65 | extern cpumask_t cpu_callout_map; | 65 | extern cpumask_t cpu_callout_map; |
66 | extern cpumask_t cpu_possible_map; | ||
67 | extern cpumask_t cpu_present_map; | ||
68 | 66 | ||
69 | static __inline__ int hard_smp_processor_id(void) | 67 | static __inline__ int hard_smp_processor_id(void) |
70 | { | 68 | { |
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h index 3e8106442d5a..9bde784e7bad 100644 --- a/include/asm-m68k/bitops.h +++ b/include/asm-m68k/bitops.h | |||
@@ -315,6 +315,11 @@ static inline int fls(int x) | |||
315 | return 32 - cnt; | 315 | return 32 - cnt; |
316 | } | 316 | } |
317 | 317 | ||
318 | static inline int __fls(int x) | ||
319 | { | ||
320 | return fls(x) - 1; | ||
321 | } | ||
322 | |||
318 | #include <asm-generic/bitops/fls64.h> | 323 | #include <asm-generic/bitops/fls64.h> |
319 | #include <asm-generic/bitops/sched.h> | 324 | #include <asm-generic/bitops/sched.h> |
320 | #include <asm-generic/bitops/hweight.h> | 325 | #include <asm-generic/bitops/hweight.h> |
diff --git a/include/asm-mn10300/bitops.h b/include/asm-mn10300/bitops.h index cc6d40c05cf3..0b610f482abb 100644 --- a/include/asm-mn10300/bitops.h +++ b/include/asm-mn10300/bitops.h | |||
@@ -196,6 +196,17 @@ int fls(int x) | |||
196 | } | 196 | } |
197 | 197 | ||
198 | /** | 198 | /** |
199 | * __fls - find last (most-significant) set bit in a long word | ||
200 | * @word: the word to search | ||
201 | * | ||
202 | * Undefined if no set bit exists, so code should check against 0 first. | ||
203 | */ | ||
204 | static inline unsigned long __fls(unsigned long word) | ||
205 | { | ||
206 | return __ilog2_u32(word); | ||
207 | } | ||
208 | |||
209 | /** | ||
199 | * ffs - find first bit set | 210 | * ffs - find first bit set |
200 | * @x: the word to search | 211 | * @x: the word to search |
201 | * | 212 | * |
diff --git a/include/asm-xtensa/bitops.h b/include/asm-xtensa/bitops.h index 23261e8f2e5a..6c3930397bd3 100644 --- a/include/asm-xtensa/bitops.h +++ b/include/asm-xtensa/bitops.h | |||
@@ -82,6 +82,16 @@ static inline int fls (unsigned int x) | |||
82 | return 32 - __cntlz(x); | 82 | return 32 - __cntlz(x); |
83 | } | 83 | } |
84 | 84 | ||
85 | /** | ||
86 | * __fls - find last (most-significant) set bit in a long word | ||
87 | * @word: the word to search | ||
88 | * | ||
89 | * Undefined if no set bit exists, so code should check against 0 first. | ||
90 | */ | ||
91 | static inline unsigned long __fls(unsigned long word) | ||
92 | { | ||
93 | return 31 - __cntlz(word); | ||
94 | } | ||
85 | #else | 95 | #else |
86 | 96 | ||
87 | /* Use the generic implementation if we don't have the nsa/nsau instructions. */ | 97 | /* Use the generic implementation if we don't have the nsa/nsau instructions. */ |
@@ -90,6 +100,7 @@ static inline int fls (unsigned int x) | |||
90 | # include <asm-generic/bitops/__ffs.h> | 100 | # include <asm-generic/bitops/__ffs.h> |
91 | # include <asm-generic/bitops/ffz.h> | 101 | # include <asm-generic/bitops/ffz.h> |
92 | # include <asm-generic/bitops/fls.h> | 102 | # include <asm-generic/bitops/fls.h> |
103 | # include <asm-generic/bitops/__fls.h> | ||
93 | 104 | ||
94 | #endif | 105 | #endif |
95 | 106 | ||
diff --git a/include/linux/8250_pci.h b/include/linux/8250_pci.h index 3209dd46ea7d..b24ff086a662 100644 --- a/include/linux/8250_pci.h +++ b/include/linux/8250_pci.h | |||
@@ -31,7 +31,7 @@ struct pciserial_board { | |||
31 | struct serial_private; | 31 | struct serial_private; |
32 | 32 | ||
33 | struct serial_private * | 33 | struct serial_private * |
34 | pciserial_init_ports(struct pci_dev *dev, struct pciserial_board *board); | 34 | pciserial_init_ports(struct pci_dev *dev, const struct pciserial_board *board); |
35 | void pciserial_remove_ports(struct serial_private *priv); | 35 | void pciserial_remove_ports(struct serial_private *priv); |
36 | void pciserial_suspend_ports(struct serial_private *priv); | 36 | void pciserial_suspend_ports(struct serial_private *priv); |
37 | void pciserial_resume_ports(struct serial_private *priv); | 37 | void pciserial_resume_ports(struct serial_private *priv); |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 95ac82340c3b..39da666067b9 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -56,8 +56,6 @@ header-y += dlm_device.h | |||
56 | header-y += dlm_netlink.h | 56 | header-y += dlm_netlink.h |
57 | header-y += dm-ioctl.h | 57 | header-y += dm-ioctl.h |
58 | header-y += dn.h | 58 | header-y += dn.h |
59 | header-y += dqblk_v1.h | ||
60 | header-y += dqblk_v2.h | ||
61 | header-y += dqblk_xfs.h | 59 | header-y += dqblk_xfs.h |
62 | header-y += efs_fs_sb.h | 60 | header-y += efs_fs_sb.h |
63 | header-y += elf-fdpic.h | 61 | header-y += elf-fdpic.h |
@@ -134,8 +132,6 @@ header-y += posix_types.h | |||
134 | header-y += ppdev.h | 132 | header-y += ppdev.h |
135 | header-y += prctl.h | 133 | header-y += prctl.h |
136 | header-y += qnxtypes.h | 134 | header-y += qnxtypes.h |
137 | header-y += quotaio_v1.h | ||
138 | header-y += quotaio_v2.h | ||
139 | header-y += radeonfb.h | 135 | header-y += radeonfb.h |
140 | header-y += raw.h | 136 | header-y += raw.h |
141 | header-y += resource.h | 137 | header-y += resource.h |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 26c4f6f65a46..67e5dbfc2961 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -247,6 +247,18 @@ | |||
247 | #define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) | 247 | #define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) |
248 | #define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK) | 248 | #define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL|AUDIT_BIT_MASK) |
249 | 249 | ||
250 | enum { | ||
251 | Audit_equal, | ||
252 | Audit_not_equal, | ||
253 | Audit_bitmask, | ||
254 | Audit_bittest, | ||
255 | Audit_lt, | ||
256 | Audit_gt, | ||
257 | Audit_le, | ||
258 | Audit_ge, | ||
259 | Audit_bad | ||
260 | }; | ||
261 | |||
250 | /* Status symbols */ | 262 | /* Status symbols */ |
251 | /* Mask values */ | 263 | /* Mask values */ |
252 | #define AUDIT_STATUS_ENABLED 0x0001 | 264 | #define AUDIT_STATUS_ENABLED 0x0001 |
@@ -373,6 +385,8 @@ struct audit_krule { | |||
373 | struct audit_watch *watch; /* associated watch */ | 385 | struct audit_watch *watch; /* associated watch */ |
374 | struct audit_tree *tree; /* associated watched tree */ | 386 | struct audit_tree *tree; /* associated watched tree */ |
375 | struct list_head rlist; /* entry in audit_{watch,tree}.rules list */ | 387 | struct list_head rlist; /* entry in audit_{watch,tree}.rules list */ |
388 | struct list_head list; /* for AUDIT_LIST* purposes only */ | ||
389 | u64 prio; | ||
376 | }; | 390 | }; |
377 | 391 | ||
378 | struct audit_field { | 392 | struct audit_field { |
@@ -443,70 +457,56 @@ extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | |||
443 | #define audit_get_loginuid(t) ((t)->loginuid) | 457 | #define audit_get_loginuid(t) ((t)->loginuid) |
444 | #define audit_get_sessionid(t) ((t)->sessionid) | 458 | #define audit_get_sessionid(t) ((t)->sessionid) |
445 | extern void audit_log_task_context(struct audit_buffer *ab); | 459 | extern void audit_log_task_context(struct audit_buffer *ab); |
446 | extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp); | 460 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); |
447 | extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); | 461 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); |
448 | extern int audit_bprm(struct linux_binprm *bprm); | 462 | extern int audit_bprm(struct linux_binprm *bprm); |
449 | extern int audit_socketcall(int nargs, unsigned long *args); | 463 | extern void audit_socketcall(int nargs, unsigned long *args); |
450 | extern int audit_sockaddr(int len, void *addr); | 464 | extern int audit_sockaddr(int len, void *addr); |
451 | extern int __audit_fd_pair(int fd1, int fd2); | 465 | extern void __audit_fd_pair(int fd1, int fd2); |
452 | extern int audit_set_macxattr(const char *name); | 466 | extern int audit_set_macxattr(const char *name); |
453 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); | 467 | extern void __audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr); |
454 | extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout); | 468 | extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); |
455 | extern int __audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout); | 469 | extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); |
456 | extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification); | 470 | extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); |
457 | extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); | ||
458 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, | 471 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, |
459 | const struct cred *new, | 472 | const struct cred *new, |
460 | const struct cred *old); | 473 | const struct cred *old); |
461 | extern int __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); | 474 | extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); |
462 | 475 | ||
463 | static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) | 476 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) |
464 | { | 477 | { |
465 | if (unlikely(!audit_dummy_context())) | 478 | if (unlikely(!audit_dummy_context())) |
466 | return __audit_ipc_obj(ipcp); | 479 | __audit_ipc_obj(ipcp); |
467 | return 0; | ||
468 | } | ||
469 | static inline int audit_fd_pair(int fd1, int fd2) | ||
470 | { | ||
471 | if (unlikely(!audit_dummy_context())) | ||
472 | return __audit_fd_pair(fd1, fd2); | ||
473 | return 0; | ||
474 | } | 480 | } |
475 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) | 481 | static inline void audit_fd_pair(int fd1, int fd2) |
476 | { | 482 | { |
477 | if (unlikely(!audit_dummy_context())) | 483 | if (unlikely(!audit_dummy_context())) |
478 | return __audit_ipc_set_perm(qbytes, uid, gid, mode); | 484 | __audit_fd_pair(fd1, fd2); |
479 | return 0; | ||
480 | } | 485 | } |
481 | static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr) | 486 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) |
482 | { | 487 | { |
483 | if (unlikely(!audit_dummy_context())) | 488 | if (unlikely(!audit_dummy_context())) |
484 | return __audit_mq_open(oflag, mode, u_attr); | 489 | __audit_ipc_set_perm(qbytes, uid, gid, mode); |
485 | return 0; | ||
486 | } | 490 | } |
487 | static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout) | 491 | static inline void audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr) |
488 | { | 492 | { |
489 | if (unlikely(!audit_dummy_context())) | 493 | if (unlikely(!audit_dummy_context())) |
490 | return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout); | 494 | __audit_mq_open(oflag, mode, attr); |
491 | return 0; | ||
492 | } | 495 | } |
493 | static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout) | 496 | static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout) |
494 | { | 497 | { |
495 | if (unlikely(!audit_dummy_context())) | 498 | if (unlikely(!audit_dummy_context())) |
496 | return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout); | 499 | __audit_mq_sendrecv(mqdes, msg_len, msg_prio, abs_timeout); |
497 | return 0; | ||
498 | } | 500 | } |
499 | static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) | 501 | static inline void audit_mq_notify(mqd_t mqdes, const struct sigevent *notification) |
500 | { | 502 | { |
501 | if (unlikely(!audit_dummy_context())) | 503 | if (unlikely(!audit_dummy_context())) |
502 | return __audit_mq_notify(mqdes, u_notification); | 504 | __audit_mq_notify(mqdes, notification); |
503 | return 0; | ||
504 | } | 505 | } |
505 | static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) | 506 | static inline void audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) |
506 | { | 507 | { |
507 | if (unlikely(!audit_dummy_context())) | 508 | if (unlikely(!audit_dummy_context())) |
508 | return __audit_mq_getsetattr(mqdes, mqstat); | 509 | __audit_mq_getsetattr(mqdes, mqstat); |
509 | return 0; | ||
510 | } | 510 | } |
511 | 511 | ||
512 | static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, | 512 | static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, |
@@ -518,12 +518,11 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, | |||
518 | return 0; | 518 | return 0; |
519 | } | 519 | } |
520 | 520 | ||
521 | static inline int audit_log_capset(pid_t pid, const struct cred *new, | 521 | static inline void audit_log_capset(pid_t pid, const struct cred *new, |
522 | const struct cred *old) | 522 | const struct cred *old) |
523 | { | 523 | { |
524 | if (unlikely(!audit_dummy_context())) | 524 | if (unlikely(!audit_dummy_context())) |
525 | return __audit_log_capset(pid, new, old); | 525 | __audit_log_capset(pid, new, old); |
526 | return 0; | ||
527 | } | 526 | } |
528 | 527 | ||
529 | extern int audit_n_rules; | 528 | extern int audit_n_rules; |
@@ -546,20 +545,19 @@ extern int audit_signals; | |||
546 | #define audit_get_loginuid(t) (-1) | 545 | #define audit_get_loginuid(t) (-1) |
547 | #define audit_get_sessionid(t) (-1) | 546 | #define audit_get_sessionid(t) (-1) |
548 | #define audit_log_task_context(b) do { ; } while (0) | 547 | #define audit_log_task_context(b) do { ; } while (0) |
549 | #define audit_ipc_obj(i) ({ 0; }) | 548 | #define audit_ipc_obj(i) ((void)0) |
550 | #define audit_ipc_set_perm(q,u,g,m) ({ 0; }) | 549 | #define audit_ipc_set_perm(q,u,g,m) ((void)0) |
551 | #define audit_bprm(p) ({ 0; }) | 550 | #define audit_bprm(p) ({ 0; }) |
552 | #define audit_socketcall(n,a) ({ 0; }) | 551 | #define audit_socketcall(n,a) ((void)0) |
553 | #define audit_fd_pair(n,a) ({ 0; }) | 552 | #define audit_fd_pair(n,a) ((void)0) |
554 | #define audit_sockaddr(len, addr) ({ 0; }) | 553 | #define audit_sockaddr(len, addr) ({ 0; }) |
555 | #define audit_set_macxattr(n) do { ; } while (0) | 554 | #define audit_set_macxattr(n) do { ; } while (0) |
556 | #define audit_mq_open(o,m,a) ({ 0; }) | 555 | #define audit_mq_open(o,m,a) ((void)0) |
557 | #define audit_mq_timedsend(d,l,p,t) ({ 0; }) | 556 | #define audit_mq_sendrecv(d,l,p,t) ((void)0) |
558 | #define audit_mq_timedreceive(d,l,p,t) ({ 0; }) | 557 | #define audit_mq_notify(d,n) ((void)0) |
559 | #define audit_mq_notify(d,n) ({ 0; }) | 558 | #define audit_mq_getsetattr(d,s) ((void)0) |
560 | #define audit_mq_getsetattr(d,s) ({ 0; }) | ||
561 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) | 559 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) |
562 | #define audit_log_capset(pid, ncr, ocr) ({ 0; }) | 560 | #define audit_log_capset(pid, ncr, ocr) ((void)0) |
563 | #define audit_ptrace(t) ((void)0) | 561 | #define audit_ptrace(t) ((void)0) |
564 | #define audit_n_rules 0 | 562 | #define audit_n_rules 0 |
565 | #define audit_signals 0 | 563 | #define audit_signals 0 |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index a08c33a26ca9..2878811c6134 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -137,9 +137,12 @@ extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits); | |||
137 | (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL \ | 137 | (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL \ |
138 | ) | 138 | ) |
139 | 139 | ||
140 | #define small_const_nbits(nbits) \ | ||
141 | (__builtin_constant_p(nbits) && (nbits) <= BITS_PER_LONG) | ||
142 | |||
140 | static inline void bitmap_zero(unsigned long *dst, int nbits) | 143 | static inline void bitmap_zero(unsigned long *dst, int nbits) |
141 | { | 144 | { |
142 | if (nbits <= BITS_PER_LONG) | 145 | if (small_const_nbits(nbits)) |
143 | *dst = 0UL; | 146 | *dst = 0UL; |
144 | else { | 147 | else { |
145 | int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); | 148 | int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); |
@@ -150,7 +153,7 @@ static inline void bitmap_zero(unsigned long *dst, int nbits) | |||
150 | static inline void bitmap_fill(unsigned long *dst, int nbits) | 153 | static inline void bitmap_fill(unsigned long *dst, int nbits) |
151 | { | 154 | { |
152 | size_t nlongs = BITS_TO_LONGS(nbits); | 155 | size_t nlongs = BITS_TO_LONGS(nbits); |
153 | if (nlongs > 1) { | 156 | if (!small_const_nbits(nbits)) { |
154 | int len = (nlongs - 1) * sizeof(unsigned long); | 157 | int len = (nlongs - 1) * sizeof(unsigned long); |
155 | memset(dst, 0xff, len); | 158 | memset(dst, 0xff, len); |
156 | } | 159 | } |
@@ -160,7 +163,7 @@ static inline void bitmap_fill(unsigned long *dst, int nbits) | |||
160 | static inline void bitmap_copy(unsigned long *dst, const unsigned long *src, | 163 | static inline void bitmap_copy(unsigned long *dst, const unsigned long *src, |
161 | int nbits) | 164 | int nbits) |
162 | { | 165 | { |
163 | if (nbits <= BITS_PER_LONG) | 166 | if (small_const_nbits(nbits)) |
164 | *dst = *src; | 167 | *dst = *src; |
165 | else { | 168 | else { |
166 | int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); | 169 | int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); |
@@ -171,7 +174,7 @@ static inline void bitmap_copy(unsigned long *dst, const unsigned long *src, | |||
171 | static inline void bitmap_and(unsigned long *dst, const unsigned long *src1, | 174 | static inline void bitmap_and(unsigned long *dst, const unsigned long *src1, |
172 | const unsigned long *src2, int nbits) | 175 | const unsigned long *src2, int nbits) |
173 | { | 176 | { |
174 | if (nbits <= BITS_PER_LONG) | 177 | if (small_const_nbits(nbits)) |
175 | *dst = *src1 & *src2; | 178 | *dst = *src1 & *src2; |
176 | else | 179 | else |
177 | __bitmap_and(dst, src1, src2, nbits); | 180 | __bitmap_and(dst, src1, src2, nbits); |
@@ -180,7 +183,7 @@ static inline void bitmap_and(unsigned long *dst, const unsigned long *src1, | |||
180 | static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, | 183 | static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, |
181 | const unsigned long *src2, int nbits) | 184 | const unsigned long *src2, int nbits) |
182 | { | 185 | { |
183 | if (nbits <= BITS_PER_LONG) | 186 | if (small_const_nbits(nbits)) |
184 | *dst = *src1 | *src2; | 187 | *dst = *src1 | *src2; |
185 | else | 188 | else |
186 | __bitmap_or(dst, src1, src2, nbits); | 189 | __bitmap_or(dst, src1, src2, nbits); |
@@ -189,7 +192,7 @@ static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, | |||
189 | static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1, | 192 | static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1, |
190 | const unsigned long *src2, int nbits) | 193 | const unsigned long *src2, int nbits) |
191 | { | 194 | { |
192 | if (nbits <= BITS_PER_LONG) | 195 | if (small_const_nbits(nbits)) |
193 | *dst = *src1 ^ *src2; | 196 | *dst = *src1 ^ *src2; |
194 | else | 197 | else |
195 | __bitmap_xor(dst, src1, src2, nbits); | 198 | __bitmap_xor(dst, src1, src2, nbits); |
@@ -198,7 +201,7 @@ static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1, | |||
198 | static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1, | 201 | static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1, |
199 | const unsigned long *src2, int nbits) | 202 | const unsigned long *src2, int nbits) |
200 | { | 203 | { |
201 | if (nbits <= BITS_PER_LONG) | 204 | if (small_const_nbits(nbits)) |
202 | *dst = *src1 & ~(*src2); | 205 | *dst = *src1 & ~(*src2); |
203 | else | 206 | else |
204 | __bitmap_andnot(dst, src1, src2, nbits); | 207 | __bitmap_andnot(dst, src1, src2, nbits); |
@@ -207,7 +210,7 @@ static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1, | |||
207 | static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, | 210 | static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, |
208 | int nbits) | 211 | int nbits) |
209 | { | 212 | { |
210 | if (nbits <= BITS_PER_LONG) | 213 | if (small_const_nbits(nbits)) |
211 | *dst = ~(*src) & BITMAP_LAST_WORD_MASK(nbits); | 214 | *dst = ~(*src) & BITMAP_LAST_WORD_MASK(nbits); |
212 | else | 215 | else |
213 | __bitmap_complement(dst, src, nbits); | 216 | __bitmap_complement(dst, src, nbits); |
@@ -216,7 +219,7 @@ static inline void bitmap_complement(unsigned long *dst, const unsigned long *sr | |||
216 | static inline int bitmap_equal(const unsigned long *src1, | 219 | static inline int bitmap_equal(const unsigned long *src1, |
217 | const unsigned long *src2, int nbits) | 220 | const unsigned long *src2, int nbits) |
218 | { | 221 | { |
219 | if (nbits <= BITS_PER_LONG) | 222 | if (small_const_nbits(nbits)) |
220 | return ! ((*src1 ^ *src2) & BITMAP_LAST_WORD_MASK(nbits)); | 223 | return ! ((*src1 ^ *src2) & BITMAP_LAST_WORD_MASK(nbits)); |
221 | else | 224 | else |
222 | return __bitmap_equal(src1, src2, nbits); | 225 | return __bitmap_equal(src1, src2, nbits); |
@@ -225,7 +228,7 @@ static inline int bitmap_equal(const unsigned long *src1, | |||
225 | static inline int bitmap_intersects(const unsigned long *src1, | 228 | static inline int bitmap_intersects(const unsigned long *src1, |
226 | const unsigned long *src2, int nbits) | 229 | const unsigned long *src2, int nbits) |
227 | { | 230 | { |
228 | if (nbits <= BITS_PER_LONG) | 231 | if (small_const_nbits(nbits)) |
229 | return ((*src1 & *src2) & BITMAP_LAST_WORD_MASK(nbits)) != 0; | 232 | return ((*src1 & *src2) & BITMAP_LAST_WORD_MASK(nbits)) != 0; |
230 | else | 233 | else |
231 | return __bitmap_intersects(src1, src2, nbits); | 234 | return __bitmap_intersects(src1, src2, nbits); |
@@ -234,7 +237,7 @@ static inline int bitmap_intersects(const unsigned long *src1, | |||
234 | static inline int bitmap_subset(const unsigned long *src1, | 237 | static inline int bitmap_subset(const unsigned long *src1, |
235 | const unsigned long *src2, int nbits) | 238 | const unsigned long *src2, int nbits) |
236 | { | 239 | { |
237 | if (nbits <= BITS_PER_LONG) | 240 | if (small_const_nbits(nbits)) |
238 | return ! ((*src1 & ~(*src2)) & BITMAP_LAST_WORD_MASK(nbits)); | 241 | return ! ((*src1 & ~(*src2)) & BITMAP_LAST_WORD_MASK(nbits)); |
239 | else | 242 | else |
240 | return __bitmap_subset(src1, src2, nbits); | 243 | return __bitmap_subset(src1, src2, nbits); |
@@ -242,7 +245,7 @@ static inline int bitmap_subset(const unsigned long *src1, | |||
242 | 245 | ||
243 | static inline int bitmap_empty(const unsigned long *src, int nbits) | 246 | static inline int bitmap_empty(const unsigned long *src, int nbits) |
244 | { | 247 | { |
245 | if (nbits <= BITS_PER_LONG) | 248 | if (small_const_nbits(nbits)) |
246 | return ! (*src & BITMAP_LAST_WORD_MASK(nbits)); | 249 | return ! (*src & BITMAP_LAST_WORD_MASK(nbits)); |
247 | else | 250 | else |
248 | return __bitmap_empty(src, nbits); | 251 | return __bitmap_empty(src, nbits); |
@@ -250,7 +253,7 @@ static inline int bitmap_empty(const unsigned long *src, int nbits) | |||
250 | 253 | ||
251 | static inline int bitmap_full(const unsigned long *src, int nbits) | 254 | static inline int bitmap_full(const unsigned long *src, int nbits) |
252 | { | 255 | { |
253 | if (nbits <= BITS_PER_LONG) | 256 | if (small_const_nbits(nbits)) |
254 | return ! (~(*src) & BITMAP_LAST_WORD_MASK(nbits)); | 257 | return ! (~(*src) & BITMAP_LAST_WORD_MASK(nbits)); |
255 | else | 258 | else |
256 | return __bitmap_full(src, nbits); | 259 | return __bitmap_full(src, nbits); |
@@ -258,7 +261,7 @@ static inline int bitmap_full(const unsigned long *src, int nbits) | |||
258 | 261 | ||
259 | static inline int bitmap_weight(const unsigned long *src, int nbits) | 262 | static inline int bitmap_weight(const unsigned long *src, int nbits) |
260 | { | 263 | { |
261 | if (nbits <= BITS_PER_LONG) | 264 | if (small_const_nbits(nbits)) |
262 | return hweight_long(*src & BITMAP_LAST_WORD_MASK(nbits)); | 265 | return hweight_long(*src & BITMAP_LAST_WORD_MASK(nbits)); |
263 | return __bitmap_weight(src, nbits); | 266 | return __bitmap_weight(src, nbits); |
264 | } | 267 | } |
@@ -266,7 +269,7 @@ static inline int bitmap_weight(const unsigned long *src, int nbits) | |||
266 | static inline void bitmap_shift_right(unsigned long *dst, | 269 | static inline void bitmap_shift_right(unsigned long *dst, |
267 | const unsigned long *src, int n, int nbits) | 270 | const unsigned long *src, int n, int nbits) |
268 | { | 271 | { |
269 | if (nbits <= BITS_PER_LONG) | 272 | if (small_const_nbits(nbits)) |
270 | *dst = *src >> n; | 273 | *dst = *src >> n; |
271 | else | 274 | else |
272 | __bitmap_shift_right(dst, src, n, nbits); | 275 | __bitmap_shift_right(dst, src, n, nbits); |
@@ -275,7 +278,7 @@ static inline void bitmap_shift_right(unsigned long *dst, | |||
275 | static inline void bitmap_shift_left(unsigned long *dst, | 278 | static inline void bitmap_shift_left(unsigned long *dst, |
276 | const unsigned long *src, int n, int nbits) | 279 | const unsigned long *src, int n, int nbits) |
277 | { | 280 | { |
278 | if (nbits <= BITS_PER_LONG) | 281 | if (small_const_nbits(nbits)) |
279 | *dst = (*src << n) & BITMAP_LAST_WORD_MASK(nbits); | 282 | *dst = (*src << n) & BITMAP_LAST_WORD_MASK(nbits); |
280 | else | 283 | else |
281 | __bitmap_shift_left(dst, src, n, nbits); | 284 | __bitmap_shift_left(dst, src, n, nbits); |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 024f2b027244..61829139795a 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -134,9 +134,20 @@ extern unsigned long find_first_bit(const unsigned long *addr, | |||
134 | */ | 134 | */ |
135 | extern unsigned long find_first_zero_bit(const unsigned long *addr, | 135 | extern unsigned long find_first_zero_bit(const unsigned long *addr, |
136 | unsigned long size); | 136 | unsigned long size); |
137 | |||
138 | #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */ | 137 | #endif /* CONFIG_GENERIC_FIND_FIRST_BIT */ |
139 | 138 | ||
139 | #ifdef CONFIG_GENERIC_FIND_LAST_BIT | ||
140 | /** | ||
141 | * find_last_bit - find the last set bit in a memory region | ||
142 | * @addr: The address to start the search at | ||
143 | * @size: The maximum size to search | ||
144 | * | ||
145 | * Returns the bit number of the first set bit, or size. | ||
146 | */ | ||
147 | extern unsigned long find_last_bit(const unsigned long *addr, | ||
148 | unsigned long size); | ||
149 | #endif /* CONFIG_GENERIC_FIND_LAST_BIT */ | ||
150 | |||
140 | #ifdef CONFIG_GENERIC_FIND_NEXT_BIT | 151 | #ifdef CONFIG_GENERIC_FIND_NEXT_BIT |
141 | 152 | ||
142 | /** | 153 | /** |
diff --git a/include/linux/blockgroup_lock.h b/include/linux/blockgroup_lock.h index 8607312983bd..e44b88ba552b 100644 --- a/include/linux/blockgroup_lock.h +++ b/include/linux/blockgroup_lock.h | |||
@@ -53,7 +53,10 @@ static inline void bgl_lock_init(struct blockgroup_lock *bgl) | |||
53 | * The accessor is a macro so we can embed a blockgroup_lock into different | 53 | * The accessor is a macro so we can embed a blockgroup_lock into different |
54 | * superblock types | 54 | * superblock types |
55 | */ | 55 | */ |
56 | #define sb_bgl_lock(sb, block_group) \ | 56 | static inline spinlock_t * |
57 | (&(sb)->s_blockgroup_lock.locks[(block_group) & (NR_BG_LOCKS-1)].lock) | 57 | bgl_lock_ptr(struct blockgroup_lock *bgl, unsigned int block_group) |
58 | { | ||
59 | return &bgl->locks[(block_group) & (NR_BG_LOCKS-1)].lock; | ||
60 | } | ||
58 | 61 | ||
59 | #endif | 62 | #endif |
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index ed3a5d473e52..cea153697ec7 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -82,13 +82,13 @@ struct clock_event_device { | |||
82 | int shift; | 82 | int shift; |
83 | int rating; | 83 | int rating; |
84 | int irq; | 84 | int irq; |
85 | cpumask_t cpumask; | 85 | const struct cpumask *cpumask; |
86 | int (*set_next_event)(unsigned long evt, | 86 | int (*set_next_event)(unsigned long evt, |
87 | struct clock_event_device *); | 87 | struct clock_event_device *); |
88 | void (*set_mode)(enum clock_event_mode mode, | 88 | void (*set_mode)(enum clock_event_mode mode, |
89 | struct clock_event_device *); | 89 | struct clock_event_device *); |
90 | void (*event_handler)(struct clock_event_device *); | 90 | void (*event_handler)(struct clock_event_device *); |
91 | void (*broadcast)(cpumask_t mask); | 91 | void (*broadcast)(const struct cpumask *mask); |
92 | struct list_head list; | 92 | struct list_head list; |
93 | enum clock_event_mode mode; | 93 | enum clock_event_mode mode; |
94 | ktime_t next_event; | 94 | ktime_t next_event; |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 5c8351b859f0..af40f8eb86f0 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -61,3 +61,8 @@ | |||
61 | #define noinline __attribute__((noinline)) | 61 | #define noinline __attribute__((noinline)) |
62 | #define __attribute_const__ __attribute__((__const__)) | 62 | #define __attribute_const__ __attribute__((__const__)) |
63 | #define __maybe_unused __attribute__((unused)) | 63 | #define __maybe_unused __attribute__((unused)) |
64 | |||
65 | #define __gcc_header(x) #x | ||
66 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) | ||
67 | #define gcc_header(x) _gcc_header(x) | ||
68 | #include gcc_header(__GNUC__) | ||
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index e5eb795f78a1..8005effc04f1 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h | |||
@@ -2,8 +2,9 @@ | |||
2 | #error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead." | 2 | #error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead." |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | /* These definitions are for GCC v3.x. */ | 5 | #if __GNUC_MINOR__ < 2 |
6 | #include <linux/compiler-gcc.h> | 6 | # error Sorry, your compiler is too old - please upgrade it. |
7 | #endif | ||
7 | 8 | ||
8 | #if __GNUC_MINOR__ >= 3 | 9 | #if __GNUC_MINOR__ >= 3 |
9 | # define __used __attribute__((__used__)) | 10 | # define __used __attribute__((__used__)) |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 974f5b7bb205..09992718f9e8 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -2,8 +2,10 @@ | |||
2 | #error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead." | 2 | #error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead." |
3 | #endif | 3 | #endif |
4 | 4 | ||
5 | /* These definitions are for GCC v4.x. */ | 5 | /* GCC 4.1.[01] miscompiles __weak */ |
6 | #include <linux/compiler-gcc.h> | 6 | #if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 |
7 | # error Your version of gcc miscompiles the __weak directive | ||
8 | #endif | ||
7 | 9 | ||
8 | #define __used __attribute__((__used__)) | 10 | #define __used __attribute__((__used__)) |
9 | #define __must_check __attribute__((warn_unused_result)) | 11 | #define __must_check __attribute__((warn_unused_result)) |
@@ -16,7 +18,7 @@ | |||
16 | */ | 18 | */ |
17 | #define uninitialized_var(x) x = x | 19 | #define uninitialized_var(x) x = x |
18 | 20 | ||
19 | #if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3) | 21 | #if __GNUC_MINOR__ >= 3 |
20 | /* Mark functions as cold. gcc will assume any path leading to a call | 22 | /* Mark functions as cold. gcc will assume any path leading to a call |
21 | to them will be unlikely. This means a lot of manual unlikely()s | 23 | to them will be unlikely. This means a lot of manual unlikely()s |
22 | are unnecessary now for any paths leading to the usual suspects | 24 | are unnecessary now for any paths leading to the usual suspects |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index ea7c6be354b7..d95da1020f1c 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -36,12 +36,8 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
36 | 36 | ||
37 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
38 | 38 | ||
39 | #if __GNUC__ >= 4 | 39 | #ifdef __GNUC__ |
40 | # include <linux/compiler-gcc4.h> | 40 | #include <linux/compiler-gcc.h> |
41 | #elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2 | ||
42 | # include <linux/compiler-gcc3.h> | ||
43 | #else | ||
44 | # error Sorry, your compiler is too old/not recognized. | ||
45 | #endif | 41 | #endif |
46 | 42 | ||
47 | #define notrace __attribute__((no_instrument_function)) | 43 | #define notrace __attribute__((no_instrument_function)) |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 1ee608fd7b77..484b3abf61bb 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -234,6 +234,7 @@ struct cpufreq_driver { | |||
234 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); | 234 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); |
235 | int (*resume) (struct cpufreq_policy *policy); | 235 | int (*resume) (struct cpufreq_policy *policy); |
236 | struct freq_attr **attr; | 236 | struct freq_attr **attr; |
237 | bool hide_interface; | ||
237 | }; | 238 | }; |
238 | 239 | ||
239 | /* flags */ | 240 | /* flags */ |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 21e1dd43e52a..9f315382610b 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -144,6 +144,7 @@ | |||
144 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; | 144 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; |
145 | extern cpumask_t _unused_cpumask_arg_; | 145 | extern cpumask_t _unused_cpumask_arg_; |
146 | 146 | ||
147 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
147 | #define cpu_set(cpu, dst) __cpu_set((cpu), &(dst)) | 148 | #define cpu_set(cpu, dst) __cpu_set((cpu), &(dst)) |
148 | static inline void __cpu_set(int cpu, volatile cpumask_t *dstp) | 149 | static inline void __cpu_set(int cpu, volatile cpumask_t *dstp) |
149 | { | 150 | { |
@@ -267,6 +268,26 @@ static inline void __cpus_shift_left(cpumask_t *dstp, | |||
267 | { | 268 | { |
268 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | 269 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); |
269 | } | 270 | } |
271 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
272 | |||
273 | /** | ||
274 | * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * | ||
275 | * @bitmap: the bitmap | ||
276 | * | ||
277 | * There are a few places where cpumask_var_t isn't appropriate and | ||
278 | * static cpumasks must be used (eg. very early boot), yet we don't | ||
279 | * expose the definition of 'struct cpumask'. | ||
280 | * | ||
281 | * This does the conversion, and can be used as a constant initializer. | ||
282 | */ | ||
283 | #define to_cpumask(bitmap) \ | ||
284 | ((struct cpumask *)(1 ? (bitmap) \ | ||
285 | : (void *)sizeof(__check_is_bitmap(bitmap)))) | ||
286 | |||
287 | static inline int __check_is_bitmap(const unsigned long *bitmap) | ||
288 | { | ||
289 | return 1; | ||
290 | } | ||
270 | 291 | ||
271 | /* | 292 | /* |
272 | * Special-case data structure for "single bit set only" constant CPU masks. | 293 | * Special-case data structure for "single bit set only" constant CPU masks. |
@@ -278,13 +299,14 @@ static inline void __cpus_shift_left(cpumask_t *dstp, | |||
278 | extern const unsigned long | 299 | extern const unsigned long |
279 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; | 300 | cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)]; |
280 | 301 | ||
281 | static inline const cpumask_t *get_cpu_mask(unsigned int cpu) | 302 | static inline const struct cpumask *get_cpu_mask(unsigned int cpu) |
282 | { | 303 | { |
283 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; | 304 | const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG]; |
284 | p -= cpu / BITS_PER_LONG; | 305 | p -= cpu / BITS_PER_LONG; |
285 | return (const cpumask_t *)p; | 306 | return to_cpumask(p); |
286 | } | 307 | } |
287 | 308 | ||
309 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
288 | /* | 310 | /* |
289 | * In cases where we take the address of the cpumask immediately, | 311 | * In cases where we take the address of the cpumask immediately, |
290 | * gcc optimizes it out (it's a constant) and there's no huge stack | 312 | * gcc optimizes it out (it's a constant) and there's no huge stack |
@@ -339,36 +361,6 @@ extern cpumask_t cpu_mask_all; | |||
339 | #endif | 361 | #endif |
340 | #define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v) | 362 | #define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v) |
341 | 363 | ||
342 | #define cpumask_scnprintf(buf, len, src) \ | ||
343 | __cpumask_scnprintf((buf), (len), &(src), NR_CPUS) | ||
344 | static inline int __cpumask_scnprintf(char *buf, int len, | ||
345 | const cpumask_t *srcp, int nbits) | ||
346 | { | ||
347 | return bitmap_scnprintf(buf, len, srcp->bits, nbits); | ||
348 | } | ||
349 | |||
350 | #define cpumask_parse_user(ubuf, ulen, dst) \ | ||
351 | __cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS) | ||
352 | static inline int __cpumask_parse_user(const char __user *buf, int len, | ||
353 | cpumask_t *dstp, int nbits) | ||
354 | { | ||
355 | return bitmap_parse_user(buf, len, dstp->bits, nbits); | ||
356 | } | ||
357 | |||
358 | #define cpulist_scnprintf(buf, len, src) \ | ||
359 | __cpulist_scnprintf((buf), (len), &(src), NR_CPUS) | ||
360 | static inline int __cpulist_scnprintf(char *buf, int len, | ||
361 | const cpumask_t *srcp, int nbits) | ||
362 | { | ||
363 | return bitmap_scnlistprintf(buf, len, srcp->bits, nbits); | ||
364 | } | ||
365 | |||
366 | #define cpulist_parse(buf, dst) __cpulist_parse((buf), &(dst), NR_CPUS) | ||
367 | static inline int __cpulist_parse(const char *buf, cpumask_t *dstp, int nbits) | ||
368 | { | ||
369 | return bitmap_parselist(buf, dstp->bits, nbits); | ||
370 | } | ||
371 | |||
372 | #define cpu_remap(oldbit, old, new) \ | 364 | #define cpu_remap(oldbit, old, new) \ |
373 | __cpu_remap((oldbit), &(old), &(new), NR_CPUS) | 365 | __cpu_remap((oldbit), &(old), &(new), NR_CPUS) |
374 | static inline int __cpu_remap(int oldbit, | 366 | static inline int __cpu_remap(int oldbit, |
@@ -400,19 +392,22 @@ static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp, | |||
400 | { | 392 | { |
401 | bitmap_fold(dstp->bits, origp->bits, sz, nbits); | 393 | bitmap_fold(dstp->bits, origp->bits, sz, nbits); |
402 | } | 394 | } |
395 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
403 | 396 | ||
404 | #if NR_CPUS == 1 | 397 | #if NR_CPUS == 1 |
405 | 398 | ||
406 | #define nr_cpu_ids 1 | 399 | #define nr_cpu_ids 1 |
400 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
407 | #define first_cpu(src) ({ (void)(src); 0; }) | 401 | #define first_cpu(src) ({ (void)(src); 0; }) |
408 | #define next_cpu(n, src) ({ (void)(src); 1; }) | 402 | #define next_cpu(n, src) ({ (void)(src); 1; }) |
409 | #define any_online_cpu(mask) 0 | 403 | #define any_online_cpu(mask) 0 |
410 | #define for_each_cpu_mask(cpu, mask) \ | 404 | #define for_each_cpu_mask(cpu, mask) \ |
411 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | 405 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) |
412 | 406 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | |
413 | #else /* NR_CPUS > 1 */ | 407 | #else /* NR_CPUS > 1 */ |
414 | 408 | ||
415 | extern int nr_cpu_ids; | 409 | extern int nr_cpu_ids; |
410 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
416 | int __first_cpu(const cpumask_t *srcp); | 411 | int __first_cpu(const cpumask_t *srcp); |
417 | int __next_cpu(int n, const cpumask_t *srcp); | 412 | int __next_cpu(int n, const cpumask_t *srcp); |
418 | int __any_online_cpu(const cpumask_t *mask); | 413 | int __any_online_cpu(const cpumask_t *mask); |
@@ -424,8 +419,10 @@ int __any_online_cpu(const cpumask_t *mask); | |||
424 | for ((cpu) = -1; \ | 419 | for ((cpu) = -1; \ |
425 | (cpu) = next_cpu((cpu), (mask)), \ | 420 | (cpu) = next_cpu((cpu), (mask)), \ |
426 | (cpu) < NR_CPUS; ) | 421 | (cpu) < NR_CPUS; ) |
422 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
427 | #endif | 423 | #endif |
428 | 424 | ||
425 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | ||
429 | #if NR_CPUS <= 64 | 426 | #if NR_CPUS <= 64 |
430 | 427 | ||
431 | #define next_cpu_nr(n, src) next_cpu(n, src) | 428 | #define next_cpu_nr(n, src) next_cpu(n, src) |
@@ -443,77 +440,67 @@ int __next_cpu_nr(int n, const cpumask_t *srcp); | |||
443 | (cpu) < nr_cpu_ids; ) | 440 | (cpu) < nr_cpu_ids; ) |
444 | 441 | ||
445 | #endif /* NR_CPUS > 64 */ | 442 | #endif /* NR_CPUS > 64 */ |
443 | #endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */ | ||
446 | 444 | ||
447 | /* | 445 | /* |
448 | * The following particular system cpumasks and operations manage | 446 | * The following particular system cpumasks and operations manage |
449 | * possible, present, active and online cpus. Each of them is a fixed size | 447 | * possible, present, active and online cpus. |
450 | * bitmap of size NR_CPUS. | ||
451 | * | 448 | * |
452 | * #ifdef CONFIG_HOTPLUG_CPU | 449 | * cpu_possible_mask- has bit 'cpu' set iff cpu is populatable |
453 | * cpu_possible_map - has bit 'cpu' set iff cpu is populatable | 450 | * cpu_present_mask - has bit 'cpu' set iff cpu is populated |
454 | * cpu_present_map - has bit 'cpu' set iff cpu is populated | 451 | * cpu_online_mask - has bit 'cpu' set iff cpu available to scheduler |
455 | * cpu_online_map - has bit 'cpu' set iff cpu available to scheduler | 452 | * cpu_active_mask - has bit 'cpu' set iff cpu available to migration |
456 | * cpu_active_map - has bit 'cpu' set iff cpu available to migration | ||
457 | * #else | ||
458 | * cpu_possible_map - has bit 'cpu' set iff cpu is populated | ||
459 | * cpu_present_map - copy of cpu_possible_map | ||
460 | * cpu_online_map - has bit 'cpu' set iff cpu available to scheduler | ||
461 | * #endif | ||
462 | * | 453 | * |
463 | * In either case, NR_CPUS is fixed at compile time, as the static | 454 | * If !CONFIG_HOTPLUG_CPU, present == possible, and active == online. |
464 | * size of these bitmaps. The cpu_possible_map is fixed at boot | ||
465 | * time, as the set of CPU id's that it is possible might ever | ||
466 | * be plugged in at anytime during the life of that system boot. | ||
467 | * The cpu_present_map is dynamic(*), representing which CPUs | ||
468 | * are currently plugged in. And cpu_online_map is the dynamic | ||
469 | * subset of cpu_present_map, indicating those CPUs available | ||
470 | * for scheduling. | ||
471 | * | 455 | * |
472 | * If HOTPLUG is enabled, then cpu_possible_map is forced to have | 456 | * The cpu_possible_mask is fixed at boot time, as the set of CPU id's |
457 | * that it is possible might ever be plugged in at anytime during the | ||
458 | * life of that system boot. The cpu_present_mask is dynamic(*), | ||
459 | * representing which CPUs are currently plugged in. And | ||
460 | * cpu_online_mask is the dynamic subset of cpu_present_mask, | ||
461 | * indicating those CPUs available for scheduling. | ||
462 | * | ||
463 | * If HOTPLUG is enabled, then cpu_possible_mask is forced to have | ||
473 | * all NR_CPUS bits set, otherwise it is just the set of CPUs that | 464 | * all NR_CPUS bits set, otherwise it is just the set of CPUs that |
474 | * ACPI reports present at boot. | 465 | * ACPI reports present at boot. |
475 | * | 466 | * |
476 | * If HOTPLUG is enabled, then cpu_present_map varies dynamically, | 467 | * If HOTPLUG is enabled, then cpu_present_mask varies dynamically, |
477 | * depending on what ACPI reports as currently plugged in, otherwise | 468 | * depending on what ACPI reports as currently plugged in, otherwise |
478 | * cpu_present_map is just a copy of cpu_possible_map. | 469 | * cpu_present_mask is just a copy of cpu_possible_mask. |
479 | * | 470 | * |
480 | * (*) Well, cpu_present_map is dynamic in the hotplug case. If not | 471 | * (*) Well, cpu_present_mask is dynamic in the hotplug case. If not |
481 | * hotplug, it's a copy of cpu_possible_map, hence fixed at boot. | 472 | * hotplug, it's a copy of cpu_possible_mask, hence fixed at boot. |
482 | * | 473 | * |
483 | * Subtleties: | 474 | * Subtleties: |
484 | * 1) UP arch's (NR_CPUS == 1, CONFIG_SMP not defined) hardcode | 475 | * 1) UP arch's (NR_CPUS == 1, CONFIG_SMP not defined) hardcode |
485 | * assumption that their single CPU is online. The UP | 476 | * assumption that their single CPU is online. The UP |
486 | * cpu_{online,possible,present}_maps are placebos. Changing them | 477 | * cpu_{online,possible,present}_masks are placebos. Changing them |
487 | * will have no useful affect on the following num_*_cpus() | 478 | * will have no useful affect on the following num_*_cpus() |
488 | * and cpu_*() macros in the UP case. This ugliness is a UP | 479 | * and cpu_*() macros in the UP case. This ugliness is a UP |
489 | * optimization - don't waste any instructions or memory references | 480 | * optimization - don't waste any instructions or memory references |
490 | * asking if you're online or how many CPUs there are if there is | 481 | * asking if you're online or how many CPUs there are if there is |
491 | * only one CPU. | 482 | * only one CPU. |
492 | * 2) Most SMP arch's #define some of these maps to be some | ||
493 | * other map specific to that arch. Therefore, the following | ||
494 | * must be #define macros, not inlines. To see why, examine | ||
495 | * the assembly code produced by the following. Note that | ||
496 | * set1() writes phys_x_map, but set2() writes x_map: | ||
497 | * int x_map, phys_x_map; | ||
498 | * #define set1(a) x_map = a | ||
499 | * inline void set2(int a) { x_map = a; } | ||
500 | * #define x_map phys_x_map | ||
501 | * main(){ set1(3); set2(5); } | ||
502 | */ | 483 | */ |
503 | 484 | ||
504 | extern cpumask_t cpu_possible_map; | 485 | extern const struct cpumask *const cpu_possible_mask; |
505 | extern cpumask_t cpu_online_map; | 486 | extern const struct cpumask *const cpu_online_mask; |
506 | extern cpumask_t cpu_present_map; | 487 | extern const struct cpumask *const cpu_present_mask; |
507 | extern cpumask_t cpu_active_map; | 488 | extern const struct cpumask *const cpu_active_mask; |
489 | |||
490 | /* These strip const, as traditionally they weren't const. */ | ||
491 | #define cpu_possible_map (*(cpumask_t *)cpu_possible_mask) | ||
492 | #define cpu_online_map (*(cpumask_t *)cpu_online_mask) | ||
493 | #define cpu_present_map (*(cpumask_t *)cpu_present_mask) | ||
494 | #define cpu_active_map (*(cpumask_t *)cpu_active_mask) | ||
508 | 495 | ||
509 | #if NR_CPUS > 1 | 496 | #if NR_CPUS > 1 |
510 | #define num_online_cpus() cpus_weight_nr(cpu_online_map) | 497 | #define num_online_cpus() cpumask_weight(cpu_online_mask) |
511 | #define num_possible_cpus() cpus_weight_nr(cpu_possible_map) | 498 | #define num_possible_cpus() cpumask_weight(cpu_possible_mask) |
512 | #define num_present_cpus() cpus_weight_nr(cpu_present_map) | 499 | #define num_present_cpus() cpumask_weight(cpu_present_mask) |
513 | #define cpu_online(cpu) cpu_isset((cpu), cpu_online_map) | 500 | #define cpu_online(cpu) cpumask_test_cpu((cpu), cpu_online_mask) |
514 | #define cpu_possible(cpu) cpu_isset((cpu), cpu_possible_map) | 501 | #define cpu_possible(cpu) cpumask_test_cpu((cpu), cpu_possible_mask) |
515 | #define cpu_present(cpu) cpu_isset((cpu), cpu_present_map) | 502 | #define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask) |
516 | #define cpu_active(cpu) cpu_isset((cpu), cpu_active_map) | 503 | #define cpu_active(cpu) cpumask_test_cpu((cpu), cpu_active_mask) |
517 | #else | 504 | #else |
518 | #define num_online_cpus() 1 | 505 | #define num_online_cpus() 1 |
519 | #define num_possible_cpus() 1 | 506 | #define num_possible_cpus() 1 |
@@ -526,10 +513,6 @@ extern cpumask_t cpu_active_map; | |||
526 | 513 | ||
527 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | 514 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) |
528 | 515 | ||
529 | #define for_each_possible_cpu(cpu) for_each_cpu_mask_nr((cpu), cpu_possible_map) | ||
530 | #define for_each_online_cpu(cpu) for_each_cpu_mask_nr((cpu), cpu_online_map) | ||
531 | #define for_each_present_cpu(cpu) for_each_cpu_mask_nr((cpu), cpu_present_map) | ||
532 | |||
533 | /* These are the new versions of the cpumask operators: passed by pointer. | 516 | /* These are the new versions of the cpumask operators: passed by pointer. |
534 | * The older versions will be implemented in terms of these, then deleted. */ | 517 | * The older versions will be implemented in terms of these, then deleted. */ |
535 | #define cpumask_bits(maskp) ((maskp)->bits) | 518 | #define cpumask_bits(maskp) ((maskp)->bits) |
@@ -540,9 +523,6 @@ extern cpumask_t cpu_active_map; | |||
540 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | 523 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ |
541 | } | 524 | } |
542 | 525 | ||
543 | /* This produces more efficient code. */ | ||
544 | #define nr_cpumask_bits NR_CPUS | ||
545 | |||
546 | #else /* NR_CPUS > BITS_PER_LONG */ | 526 | #else /* NR_CPUS > BITS_PER_LONG */ |
547 | 527 | ||
548 | #define CPU_BITS_ALL \ | 528 | #define CPU_BITS_ALL \ |
@@ -550,9 +530,15 @@ extern cpumask_t cpu_active_map; | |||
550 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ | 530 | [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \ |
551 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ | 531 | [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \ |
552 | } | 532 | } |
533 | #endif /* NR_CPUS > BITS_PER_LONG */ | ||
553 | 534 | ||
535 | #ifdef CONFIG_CPUMASK_OFFSTACK | ||
536 | /* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also, | ||
537 | * not all bits may be allocated. */ | ||
554 | #define nr_cpumask_bits nr_cpu_ids | 538 | #define nr_cpumask_bits nr_cpu_ids |
555 | #endif /* NR_CPUS > BITS_PER_LONG */ | 539 | #else |
540 | #define nr_cpumask_bits NR_CPUS | ||
541 | #endif | ||
556 | 542 | ||
557 | /* verify cpu argument to cpumask_* operators */ | 543 | /* verify cpu argument to cpumask_* operators */ |
558 | static inline unsigned int cpumask_check(unsigned int cpu) | 544 | static inline unsigned int cpumask_check(unsigned int cpu) |
@@ -714,7 +700,7 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp) | |||
714 | * No static inline type checking - see Subtlety (1) above. | 700 | * No static inline type checking - see Subtlety (1) above. |
715 | */ | 701 | */ |
716 | #define cpumask_test_cpu(cpu, cpumask) \ | 702 | #define cpumask_test_cpu(cpu, cpumask) \ |
717 | test_bit(cpumask_check(cpu), (cpumask)->bits) | 703 | test_bit(cpumask_check(cpu), cpumask_bits((cpumask))) |
718 | 704 | ||
719 | /** | 705 | /** |
720 | * cpumask_test_and_set_cpu - atomically test and set a cpu in a cpumask | 706 | * cpumask_test_and_set_cpu - atomically test and set a cpu in a cpumask |
@@ -946,22 +932,61 @@ static inline void cpumask_copy(struct cpumask *dstp, | |||
946 | #define cpumask_of(cpu) (get_cpu_mask(cpu)) | 932 | #define cpumask_of(cpu) (get_cpu_mask(cpu)) |
947 | 933 | ||
948 | /** | 934 | /** |
949 | * to_cpumask - convert an NR_CPUS bitmap to a struct cpumask * | 935 | * cpumask_scnprintf - print a cpumask into a string as comma-separated hex |
950 | * @bitmap: the bitmap | 936 | * @buf: the buffer to sprintf into |
937 | * @len: the length of the buffer | ||
938 | * @srcp: the cpumask to print | ||
951 | * | 939 | * |
952 | * There are a few places where cpumask_var_t isn't appropriate and | 940 | * If len is zero, returns zero. Otherwise returns the length of the |
953 | * static cpumasks must be used (eg. very early boot), yet we don't | 941 | * (nul-terminated) @buf string. |
954 | * expose the definition of 'struct cpumask'. | 942 | */ |
943 | static inline int cpumask_scnprintf(char *buf, int len, | ||
944 | const struct cpumask *srcp) | ||
945 | { | ||
946 | return bitmap_scnprintf(buf, len, cpumask_bits(srcp), nr_cpumask_bits); | ||
947 | } | ||
948 | |||
949 | /** | ||
950 | * cpumask_parse_user - extract a cpumask from a user string | ||
951 | * @buf: the buffer to extract from | ||
952 | * @len: the length of the buffer | ||
953 | * @dstp: the cpumask to set. | ||
955 | * | 954 | * |
956 | * This does the conversion, and can be used as a constant initializer. | 955 | * Returns -errno, or 0 for success. |
957 | */ | 956 | */ |
958 | #define to_cpumask(bitmap) \ | 957 | static inline int cpumask_parse_user(const char __user *buf, int len, |
959 | ((struct cpumask *)(1 ? (bitmap) \ | 958 | struct cpumask *dstp) |
960 | : (void *)sizeof(__check_is_bitmap(bitmap)))) | 959 | { |
960 | return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpumask_bits); | ||
961 | } | ||
961 | 962 | ||
962 | static inline int __check_is_bitmap(const unsigned long *bitmap) | 963 | /** |
964 | * cpulist_scnprintf - print a cpumask into a string as comma-separated list | ||
965 | * @buf: the buffer to sprintf into | ||
966 | * @len: the length of the buffer | ||
967 | * @srcp: the cpumask to print | ||
968 | * | ||
969 | * If len is zero, returns zero. Otherwise returns the length of the | ||
970 | * (nul-terminated) @buf string. | ||
971 | */ | ||
972 | static inline int cpulist_scnprintf(char *buf, int len, | ||
973 | const struct cpumask *srcp) | ||
963 | { | 974 | { |
964 | return 1; | 975 | return bitmap_scnlistprintf(buf, len, cpumask_bits(srcp), |
976 | nr_cpumask_bits); | ||
977 | } | ||
978 | |||
979 | /** | ||
980 | * cpulist_parse_user - extract a cpumask from a user string of ranges | ||
981 | * @buf: the buffer to extract from | ||
982 | * @len: the length of the buffer | ||
983 | * @dstp: the cpumask to set. | ||
984 | * | ||
985 | * Returns -errno, or 0 for success. | ||
986 | */ | ||
987 | static inline int cpulist_parse(const char *buf, struct cpumask *dstp) | ||
988 | { | ||
989 | return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits); | ||
965 | } | 990 | } |
966 | 991 | ||
967 | /** | 992 | /** |
@@ -995,6 +1020,7 @@ static inline size_t cpumask_size(void) | |||
995 | #ifdef CONFIG_CPUMASK_OFFSTACK | 1020 | #ifdef CONFIG_CPUMASK_OFFSTACK |
996 | typedef struct cpumask *cpumask_var_t; | 1021 | typedef struct cpumask *cpumask_var_t; |
997 | 1022 | ||
1023 | bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node); | ||
998 | bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); | 1024 | bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags); |
999 | void alloc_bootmem_cpumask_var(cpumask_var_t *mask); | 1025 | void alloc_bootmem_cpumask_var(cpumask_var_t *mask); |
1000 | void free_cpumask_var(cpumask_var_t mask); | 1026 | void free_cpumask_var(cpumask_var_t mask); |
@@ -1008,6 +1034,12 @@ static inline bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags) | |||
1008 | return true; | 1034 | return true; |
1009 | } | 1035 | } |
1010 | 1036 | ||
1037 | static inline bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, | ||
1038 | int node) | ||
1039 | { | ||
1040 | return true; | ||
1041 | } | ||
1042 | |||
1011 | static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask) | 1043 | static inline void alloc_bootmem_cpumask_var(cpumask_var_t *mask) |
1012 | { | 1044 | { |
1013 | } | 1045 | } |
@@ -1021,12 +1053,6 @@ static inline void free_bootmem_cpumask_var(cpumask_var_t mask) | |||
1021 | } | 1053 | } |
1022 | #endif /* CONFIG_CPUMASK_OFFSTACK */ | 1054 | #endif /* CONFIG_CPUMASK_OFFSTACK */ |
1023 | 1055 | ||
1024 | /* The pointer versions of the maps, these will become the primary versions. */ | ||
1025 | #define cpu_possible_mask ((const struct cpumask *)&cpu_possible_map) | ||
1026 | #define cpu_online_mask ((const struct cpumask *)&cpu_online_map) | ||
1027 | #define cpu_present_mask ((const struct cpumask *)&cpu_present_map) | ||
1028 | #define cpu_active_mask ((const struct cpumask *)&cpu_active_map) | ||
1029 | |||
1030 | /* It's common to want to use cpu_all_mask in struct member initializers, | 1056 | /* It's common to want to use cpu_all_mask in struct member initializers, |
1031 | * so it has to refer to an address rather than a pointer. */ | 1057 | * so it has to refer to an address rather than a pointer. */ |
1032 | extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS); | 1058 | extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS); |
@@ -1035,51 +1061,16 @@ extern const DECLARE_BITMAP(cpu_all_bits, NR_CPUS); | |||
1035 | /* First bits of cpu_bit_bitmap are in fact unset. */ | 1061 | /* First bits of cpu_bit_bitmap are in fact unset. */ |
1036 | #define cpu_none_mask to_cpumask(cpu_bit_bitmap[0]) | 1062 | #define cpu_none_mask to_cpumask(cpu_bit_bitmap[0]) |
1037 | 1063 | ||
1038 | /* Wrappers for arch boot code to manipulate normally-constant masks */ | 1064 | #define for_each_possible_cpu(cpu) for_each_cpu((cpu), cpu_possible_mask) |
1039 | static inline void set_cpu_possible(unsigned int cpu, bool possible) | 1065 | #define for_each_online_cpu(cpu) for_each_cpu((cpu), cpu_online_mask) |
1040 | { | 1066 | #define for_each_present_cpu(cpu) for_each_cpu((cpu), cpu_present_mask) |
1041 | if (possible) | ||
1042 | cpumask_set_cpu(cpu, &cpu_possible_map); | ||
1043 | else | ||
1044 | cpumask_clear_cpu(cpu, &cpu_possible_map); | ||
1045 | } | ||
1046 | |||
1047 | static inline void set_cpu_present(unsigned int cpu, bool present) | ||
1048 | { | ||
1049 | if (present) | ||
1050 | cpumask_set_cpu(cpu, &cpu_present_map); | ||
1051 | else | ||
1052 | cpumask_clear_cpu(cpu, &cpu_present_map); | ||
1053 | } | ||
1054 | |||
1055 | static inline void set_cpu_online(unsigned int cpu, bool online) | ||
1056 | { | ||
1057 | if (online) | ||
1058 | cpumask_set_cpu(cpu, &cpu_online_map); | ||
1059 | else | ||
1060 | cpumask_clear_cpu(cpu, &cpu_online_map); | ||
1061 | } | ||
1062 | |||
1063 | static inline void set_cpu_active(unsigned int cpu, bool active) | ||
1064 | { | ||
1065 | if (active) | ||
1066 | cpumask_set_cpu(cpu, &cpu_active_map); | ||
1067 | else | ||
1068 | cpumask_clear_cpu(cpu, &cpu_active_map); | ||
1069 | } | ||
1070 | |||
1071 | static inline void init_cpu_present(const struct cpumask *src) | ||
1072 | { | ||
1073 | cpumask_copy(&cpu_present_map, src); | ||
1074 | } | ||
1075 | |||
1076 | static inline void init_cpu_possible(const struct cpumask *src) | ||
1077 | { | ||
1078 | cpumask_copy(&cpu_possible_map, src); | ||
1079 | } | ||
1080 | 1067 | ||
1081 | static inline void init_cpu_online(const struct cpumask *src) | 1068 | /* Wrappers for arch boot code to manipulate normally-constant masks */ |
1082 | { | 1069 | void set_cpu_possible(unsigned int cpu, bool possible); |
1083 | cpumask_copy(&cpu_online_map, src); | 1070 | void set_cpu_present(unsigned int cpu, bool present); |
1084 | } | 1071 | void set_cpu_online(unsigned int cpu, bool online); |
1072 | void set_cpu_active(unsigned int cpu, bool active); | ||
1073 | void init_cpu_present(const struct cpumask *src); | ||
1074 | void init_cpu_possible(const struct cpumask *src); | ||
1075 | void init_cpu_online(const struct cpumask *src); | ||
1085 | #endif /* __LINUX_CPUMASK_H */ | 1076 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index a37359d0bad1..c66d22487bf8 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -75,14 +75,22 @@ full_name_hash(const unsigned char *name, unsigned int len) | |||
75 | return end_name_hash(hash); | 75 | return end_name_hash(hash); |
76 | } | 76 | } |
77 | 77 | ||
78 | struct dcookie_struct; | 78 | /* |
79 | 79 | * Try to keep struct dentry aligned on 64 byte cachelines (this will | |
80 | #define DNAME_INLINE_LEN_MIN 36 | 80 | * give reasonable cacheline footprint with larger lines without the |
81 | * large memory footprint increase). | ||
82 | */ | ||
83 | #ifdef CONFIG_64BIT | ||
84 | #define DNAME_INLINE_LEN_MIN 32 /* 192 bytes */ | ||
85 | #else | ||
86 | #define DNAME_INLINE_LEN_MIN 40 /* 128 bytes */ | ||
87 | #endif | ||
81 | 88 | ||
82 | struct dentry { | 89 | struct dentry { |
83 | atomic_t d_count; | 90 | atomic_t d_count; |
84 | unsigned int d_flags; /* protected by d_lock */ | 91 | unsigned int d_flags; /* protected by d_lock */ |
85 | spinlock_t d_lock; /* per dentry lock */ | 92 | spinlock_t d_lock; /* per dentry lock */ |
93 | int d_mounted; | ||
86 | struct inode *d_inode; /* Where the name belongs to - NULL is | 94 | struct inode *d_inode; /* Where the name belongs to - NULL is |
87 | * negative */ | 95 | * negative */ |
88 | /* | 96 | /* |
@@ -107,10 +115,7 @@ struct dentry { | |||
107 | struct dentry_operations *d_op; | 115 | struct dentry_operations *d_op; |
108 | struct super_block *d_sb; /* The root of the dentry tree */ | 116 | struct super_block *d_sb; /* The root of the dentry tree */ |
109 | void *d_fsdata; /* fs-specific data */ | 117 | void *d_fsdata; /* fs-specific data */ |
110 | #ifdef CONFIG_PROFILING | 118 | |
111 | struct dcookie_struct *d_cookie; /* cookie, if any */ | ||
112 | #endif | ||
113 | int d_mounted; | ||
114 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ | 119 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ |
115 | }; | 120 | }; |
116 | 121 | ||
@@ -177,6 +182,8 @@ d_iput: no no no yes | |||
177 | 182 | ||
178 | #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */ | 183 | #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */ |
179 | 184 | ||
185 | #define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */ | ||
186 | |||
180 | extern spinlock_t dcache_lock; | 187 | extern spinlock_t dcache_lock; |
181 | extern seqlock_t rename_lock; | 188 | extern seqlock_t rename_lock; |
182 | 189 | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index c17fd334e574..8209e08969f9 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -45,6 +45,8 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti); | |||
45 | */ | 45 | */ |
46 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, | 46 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, |
47 | union map_info *map_context); | 47 | union map_info *map_context); |
48 | typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone, | ||
49 | union map_info *map_context); | ||
48 | 50 | ||
49 | /* | 51 | /* |
50 | * Returns: | 52 | * Returns: |
@@ -57,6 +59,9 @@ typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, | |||
57 | typedef int (*dm_endio_fn) (struct dm_target *ti, | 59 | typedef int (*dm_endio_fn) (struct dm_target *ti, |
58 | struct bio *bio, int error, | 60 | struct bio *bio, int error, |
59 | union map_info *map_context); | 61 | union map_info *map_context); |
62 | typedef int (*dm_request_endio_fn) (struct dm_target *ti, | ||
63 | struct request *clone, int error, | ||
64 | union map_info *map_context); | ||
60 | 65 | ||
61 | typedef void (*dm_flush_fn) (struct dm_target *ti); | 66 | typedef void (*dm_flush_fn) (struct dm_target *ti); |
62 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); | 67 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); |
@@ -75,6 +80,13 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd, | |||
75 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, | 80 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, |
76 | struct bio_vec *biovec, int max_size); | 81 | struct bio_vec *biovec, int max_size); |
77 | 82 | ||
83 | /* | ||
84 | * Returns: | ||
85 | * 0: The target can handle the next I/O immediately. | ||
86 | * 1: The target can't handle the next I/O immediately. | ||
87 | */ | ||
88 | typedef int (*dm_busy_fn) (struct dm_target *ti); | ||
89 | |||
78 | void dm_error(const char *message); | 90 | void dm_error(const char *message); |
79 | 91 | ||
80 | /* | 92 | /* |
@@ -100,14 +112,23 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d); | |||
100 | /* | 112 | /* |
101 | * Information about a target type | 113 | * Information about a target type |
102 | */ | 114 | */ |
115 | |||
116 | /* | ||
117 | * Target features | ||
118 | */ | ||
119 | #define DM_TARGET_SUPPORTS_BARRIERS 0x00000001 | ||
120 | |||
103 | struct target_type { | 121 | struct target_type { |
122 | uint64_t features; | ||
104 | const char *name; | 123 | const char *name; |
105 | struct module *module; | 124 | struct module *module; |
106 | unsigned version[3]; | 125 | unsigned version[3]; |
107 | dm_ctr_fn ctr; | 126 | dm_ctr_fn ctr; |
108 | dm_dtr_fn dtr; | 127 | dm_dtr_fn dtr; |
109 | dm_map_fn map; | 128 | dm_map_fn map; |
129 | dm_map_request_fn map_rq; | ||
110 | dm_endio_fn end_io; | 130 | dm_endio_fn end_io; |
131 | dm_request_endio_fn rq_end_io; | ||
111 | dm_flush_fn flush; | 132 | dm_flush_fn flush; |
112 | dm_presuspend_fn presuspend; | 133 | dm_presuspend_fn presuspend; |
113 | dm_postsuspend_fn postsuspend; | 134 | dm_postsuspend_fn postsuspend; |
@@ -117,6 +138,7 @@ struct target_type { | |||
117 | dm_message_fn message; | 138 | dm_message_fn message; |
118 | dm_ioctl_fn ioctl; | 139 | dm_ioctl_fn ioctl; |
119 | dm_merge_fn merge; | 140 | dm_merge_fn merge; |
141 | dm_busy_fn busy; | ||
120 | }; | 142 | }; |
121 | 143 | ||
122 | struct io_restrictions { | 144 | struct io_restrictions { |
@@ -157,8 +179,7 @@ struct dm_target { | |||
157 | }; | 179 | }; |
158 | 180 | ||
159 | int dm_register_target(struct target_type *t); | 181 | int dm_register_target(struct target_type *t); |
160 | int dm_unregister_target(struct target_type *t); | 182 | void dm_unregister_target(struct target_type *t); |
161 | |||
162 | 183 | ||
163 | /*----------------------------------------------------------------- | 184 | /*----------------------------------------------------------------- |
164 | * Functions for creating and manipulating mapped devices. | 185 | * Functions for creating and manipulating mapped devices. |
@@ -276,6 +297,9 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | |||
276 | *---------------------------------------------------------------*/ | 297 | *---------------------------------------------------------------*/ |
277 | #define DM_NAME "device-mapper" | 298 | #define DM_NAME "device-mapper" |
278 | 299 | ||
300 | #define DMCRIT(f, arg...) \ | ||
301 | printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | ||
302 | |||
279 | #define DMERR(f, arg...) \ | 303 | #define DMERR(f, arg...) \ |
280 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | 304 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
281 | #define DMERR_LIMIT(f, arg...) \ | 305 | #define DMERR_LIMIT(f, arg...) \ |
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h index 952df39c989d..af1dab41674b 100644 --- a/include/linux/dma_remapping.h +++ b/include/linux/dma_remapping.h | |||
@@ -9,148 +9,24 @@ | |||
9 | #define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT) | 9 | #define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT) |
10 | #define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK) | 10 | #define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK) |
11 | 11 | ||
12 | #define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT) | ||
13 | #define DMA_32BIT_PFN IOVA_PFN(DMA_32BIT_MASK) | ||
14 | #define DMA_64BIT_PFN IOVA_PFN(DMA_64BIT_MASK) | ||
15 | |||
16 | |||
17 | /* | ||
18 | * 0: Present | ||
19 | * 1-11: Reserved | ||
20 | * 12-63: Context Ptr (12 - (haw-1)) | ||
21 | * 64-127: Reserved | ||
22 | */ | ||
23 | struct root_entry { | ||
24 | u64 val; | ||
25 | u64 rsvd1; | ||
26 | }; | ||
27 | #define ROOT_ENTRY_NR (VTD_PAGE_SIZE/sizeof(struct root_entry)) | ||
28 | static inline bool root_present(struct root_entry *root) | ||
29 | { | ||
30 | return (root->val & 1); | ||
31 | } | ||
32 | static inline void set_root_present(struct root_entry *root) | ||
33 | { | ||
34 | root->val |= 1; | ||
35 | } | ||
36 | static inline void set_root_value(struct root_entry *root, unsigned long value) | ||
37 | { | ||
38 | root->val |= value & VTD_PAGE_MASK; | ||
39 | } | ||
40 | |||
41 | struct context_entry; | ||
42 | static inline struct context_entry * | ||
43 | get_context_addr_from_root(struct root_entry *root) | ||
44 | { | ||
45 | return (struct context_entry *) | ||
46 | (root_present(root)?phys_to_virt( | ||
47 | root->val & VTD_PAGE_MASK) : | ||
48 | NULL); | ||
49 | } | ||
50 | |||
51 | /* | ||
52 | * low 64 bits: | ||
53 | * 0: present | ||
54 | * 1: fault processing disable | ||
55 | * 2-3: translation type | ||
56 | * 12-63: address space root | ||
57 | * high 64 bits: | ||
58 | * 0-2: address width | ||
59 | * 3-6: aval | ||
60 | * 8-23: domain id | ||
61 | */ | ||
62 | struct context_entry { | ||
63 | u64 lo; | ||
64 | u64 hi; | ||
65 | }; | ||
66 | #define context_present(c) ((c).lo & 1) | ||
67 | #define context_fault_disable(c) (((c).lo >> 1) & 1) | ||
68 | #define context_translation_type(c) (((c).lo >> 2) & 3) | ||
69 | #define context_address_root(c) ((c).lo & VTD_PAGE_MASK) | ||
70 | #define context_address_width(c) ((c).hi & 7) | ||
71 | #define context_domain_id(c) (((c).hi >> 8) & ((1 << 16) - 1)) | ||
72 | |||
73 | #define context_set_present(c) do {(c).lo |= 1;} while (0) | ||
74 | #define context_set_fault_enable(c) \ | ||
75 | do {(c).lo &= (((u64)-1) << 2) | 1;} while (0) | ||
76 | #define context_set_translation_type(c, val) \ | ||
77 | do { \ | ||
78 | (c).lo &= (((u64)-1) << 4) | 3; \ | ||
79 | (c).lo |= ((val) & 3) << 2; \ | ||
80 | } while (0) | ||
81 | #define CONTEXT_TT_MULTI_LEVEL 0 | ||
82 | #define context_set_address_root(c, val) \ | ||
83 | do {(c).lo |= (val) & VTD_PAGE_MASK; } while (0) | ||
84 | #define context_set_address_width(c, val) do {(c).hi |= (val) & 7;} while (0) | ||
85 | #define context_set_domain_id(c, val) \ | ||
86 | do {(c).hi |= ((val) & ((1 << 16) - 1)) << 8;} while (0) | ||
87 | #define context_clear_entry(c) do {(c).lo = 0; (c).hi = 0;} while (0) | ||
88 | |||
89 | /* | ||
90 | * 0: readable | ||
91 | * 1: writable | ||
92 | * 2-6: reserved | ||
93 | * 7: super page | ||
94 | * 8-11: available | ||
95 | * 12-63: Host physcial address | ||
96 | */ | ||
97 | struct dma_pte { | ||
98 | u64 val; | ||
99 | }; | ||
100 | #define dma_clear_pte(p) do {(p).val = 0;} while (0) | ||
101 | |||
102 | #define DMA_PTE_READ (1) | 12 | #define DMA_PTE_READ (1) |
103 | #define DMA_PTE_WRITE (2) | 13 | #define DMA_PTE_WRITE (2) |
104 | 14 | ||
105 | #define dma_set_pte_readable(p) do {(p).val |= DMA_PTE_READ;} while (0) | ||
106 | #define dma_set_pte_writable(p) do {(p).val |= DMA_PTE_WRITE;} while (0) | ||
107 | #define dma_set_pte_prot(p, prot) \ | ||
108 | do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0) | ||
109 | #define dma_pte_addr(p) ((p).val & VTD_PAGE_MASK) | ||
110 | #define dma_set_pte_addr(p, addr) do {\ | ||
111 | (p).val |= ((addr) & VTD_PAGE_MASK); } while (0) | ||
112 | #define dma_pte_present(p) (((p).val & 3) != 0) | ||
113 | |||
114 | struct intel_iommu; | 15 | struct intel_iommu; |
16 | struct dmar_domain; | ||
17 | struct root_entry; | ||
115 | 18 | ||
116 | struct dmar_domain { | ||
117 | int id; /* domain id */ | ||
118 | struct intel_iommu *iommu; /* back pointer to owning iommu */ | ||
119 | |||
120 | struct list_head devices; /* all devices' list */ | ||
121 | struct iova_domain iovad; /* iova's that belong to this domain */ | ||
122 | |||
123 | struct dma_pte *pgd; /* virtual address */ | ||
124 | spinlock_t mapping_lock; /* page table lock */ | ||
125 | int gaw; /* max guest address width */ | ||
126 | |||
127 | /* adjusted guest address width, 0 is level 2 30-bit */ | ||
128 | int agaw; | ||
129 | |||
130 | #define DOMAIN_FLAG_MULTIPLE_DEVICES 1 | ||
131 | int flags; | ||
132 | }; | ||
133 | |||
134 | /* PCI domain-device relationship */ | ||
135 | struct device_domain_info { | ||
136 | struct list_head link; /* link to domain siblings */ | ||
137 | struct list_head global; /* link to global list */ | ||
138 | u8 bus; /* PCI bus numer */ | ||
139 | u8 devfn; /* PCI devfn number */ | ||
140 | struct pci_dev *dev; /* it's NULL for PCIE-to-PCI bridge */ | ||
141 | struct dmar_domain *domain; /* pointer to domain */ | ||
142 | }; | ||
143 | |||
144 | extern int init_dmars(void); | ||
145 | extern void free_dmar_iommu(struct intel_iommu *iommu); | 19 | extern void free_dmar_iommu(struct intel_iommu *iommu); |
146 | 20 | ||
147 | extern int dmar_disabled; | 21 | #ifdef CONFIG_DMAR |
148 | 22 | extern int iommu_calculate_agaw(struct intel_iommu *iommu); | |
149 | #ifndef CONFIG_DMAR_GFX_WA | 23 | #else |
150 | static inline void iommu_prepare_gfx_mapping(void) | 24 | static inline int iommu_calculate_agaw(struct intel_iommu *iommu) |
151 | { | 25 | { |
152 | return; | 26 | return 0; |
153 | } | 27 | } |
154 | #endif /* !CONFIG_DMAR_GFX_WA */ | 28 | #endif |
29 | |||
30 | extern int dmar_disabled; | ||
155 | 31 | ||
156 | #endif | 32 | #endif |
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index f1984fc3e06d..f28440784cf0 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -144,7 +144,6 @@ struct dmar_rmrr_unit { | |||
144 | list_for_each_entry(rmrr, &dmar_rmrr_units, list) | 144 | list_for_each_entry(rmrr, &dmar_rmrr_units, list) |
145 | /* Intel DMAR initialization functions */ | 145 | /* Intel DMAR initialization functions */ |
146 | extern int intel_iommu_init(void); | 146 | extern int intel_iommu_init(void); |
147 | extern int dmar_disabled; | ||
148 | #else | 147 | #else |
149 | static inline int intel_iommu_init(void) | 148 | static inline int intel_iommu_init(void) |
150 | { | 149 | { |
diff --git a/include/linux/dqblk_qtree.h b/include/linux/dqblk_qtree.h new file mode 100644 index 000000000000..82a16527b367 --- /dev/null +++ b/include/linux/dqblk_qtree.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Definitions of structures and functions for quota formats using trie | ||
3 | */ | ||
4 | |||
5 | #ifndef _LINUX_DQBLK_QTREE_H | ||
6 | #define _LINUX_DQBLK_QTREE_H | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | |||
10 | /* Numbers of blocks needed for updates - we count with the smallest | ||
11 | * possible block size (1024) */ | ||
12 | #define QTREE_INIT_ALLOC 4 | ||
13 | #define QTREE_INIT_REWRITE 2 | ||
14 | #define QTREE_DEL_ALLOC 0 | ||
15 | #define QTREE_DEL_REWRITE 6 | ||
16 | |||
17 | struct dquot; | ||
18 | |||
19 | /* Operations */ | ||
20 | struct qtree_fmt_operations { | ||
21 | void (*mem2disk_dqblk)(void *disk, struct dquot *dquot); /* Convert given entry from in memory format to disk one */ | ||
22 | void (*disk2mem_dqblk)(struct dquot *dquot, void *disk); /* Convert given entry from disk format to in memory one */ | ||
23 | int (*is_id)(void *disk, struct dquot *dquot); /* Is this structure for given id? */ | ||
24 | }; | ||
25 | |||
26 | /* Inmemory copy of version specific information */ | ||
27 | struct qtree_mem_dqinfo { | ||
28 | struct super_block *dqi_sb; /* Sb quota is on */ | ||
29 | int dqi_type; /* Quota type */ | ||
30 | unsigned int dqi_blocks; /* # of blocks in quota file */ | ||
31 | unsigned int dqi_free_blk; /* First block in list of free blocks */ | ||
32 | unsigned int dqi_free_entry; /* First block with free entry */ | ||
33 | unsigned int dqi_blocksize_bits; /* Block size of quota file */ | ||
34 | unsigned int dqi_entry_size; /* Size of quota entry in quota file */ | ||
35 | unsigned int dqi_usable_bs; /* Space usable in block for quota data */ | ||
36 | unsigned int dqi_qtree_depth; /* Precomputed depth of quota tree */ | ||
37 | struct qtree_fmt_operations *dqi_ops; /* Operations for entry manipulation */ | ||
38 | }; | ||
39 | |||
40 | int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
41 | int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
42 | int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
43 | int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
44 | int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk); | ||
45 | static inline int qtree_depth(struct qtree_mem_dqinfo *info) | ||
46 | { | ||
47 | unsigned int epb = info->dqi_usable_bs >> 2; | ||
48 | unsigned long long entries = epb; | ||
49 | int i; | ||
50 | |||
51 | for (i = 1; entries < (1ULL << 32); i++) | ||
52 | entries *= epb; | ||
53 | return i; | ||
54 | } | ||
55 | |||
56 | #endif /* _LINUX_DQBLK_QTREE_H */ | ||
diff --git a/include/linux/dqblk_v1.h b/include/linux/dqblk_v1.h index 57f1250d5a52..3713a7232dd8 100644 --- a/include/linux/dqblk_v1.h +++ b/include/linux/dqblk_v1.h | |||
@@ -5,9 +5,6 @@ | |||
5 | #ifndef _LINUX_DQBLK_V1_H | 5 | #ifndef _LINUX_DQBLK_V1_H |
6 | #define _LINUX_DQBLK_V1_H | 6 | #define _LINUX_DQBLK_V1_H |
7 | 7 | ||
8 | /* Id of quota format */ | ||
9 | #define QFMT_VFS_OLD 1 | ||
10 | |||
11 | /* Root squash turned on */ | 8 | /* Root squash turned on */ |
12 | #define V1_DQF_RSQUASH 1 | 9 | #define V1_DQF_RSQUASH 1 |
13 | 10 | ||
@@ -17,8 +14,4 @@ | |||
17 | #define V1_DEL_ALLOC 0 | 14 | #define V1_DEL_ALLOC 0 |
18 | #define V1_DEL_REWRITE 2 | 15 | #define V1_DEL_REWRITE 2 |
19 | 16 | ||
20 | /* Special information about quotafile */ | ||
21 | struct v1_mem_dqinfo { | ||
22 | }; | ||
23 | |||
24 | #endif /* _LINUX_DQBLK_V1_H */ | 17 | #endif /* _LINUX_DQBLK_V1_H */ |
diff --git a/include/linux/dqblk_v2.h b/include/linux/dqblk_v2.h index 4f853322cb7f..18000a542677 100644 --- a/include/linux/dqblk_v2.h +++ b/include/linux/dqblk_v2.h | |||
@@ -1,26 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | * Definitions of structures for vfsv0 quota format | 2 | * Definitions for vfsv0 quota format |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #ifndef _LINUX_DQBLK_V2_H | 5 | #ifndef _LINUX_DQBLK_V2_H |
6 | #define _LINUX_DQBLK_V2_H | 6 | #define _LINUX_DQBLK_V2_H |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/dqblk_qtree.h> |
9 | |||
10 | /* id numbers of quota format */ | ||
11 | #define QFMT_VFS_V0 2 | ||
12 | 9 | ||
13 | /* Numbers of blocks needed for updates */ | 10 | /* Numbers of blocks needed for updates */ |
14 | #define V2_INIT_ALLOC 4 | 11 | #define V2_INIT_ALLOC QTREE_INIT_ALLOC |
15 | #define V2_INIT_REWRITE 2 | 12 | #define V2_INIT_REWRITE QTREE_INIT_REWRITE |
16 | #define V2_DEL_ALLOC 0 | 13 | #define V2_DEL_ALLOC QTREE_DEL_ALLOC |
17 | #define V2_DEL_REWRITE 6 | 14 | #define V2_DEL_REWRITE QTREE_DEL_REWRITE |
18 | |||
19 | /* Inmemory copy of version specific information */ | ||
20 | struct v2_mem_dqinfo { | ||
21 | unsigned int dqi_blocks; | ||
22 | unsigned int dqi_free_blk; | ||
23 | unsigned int dqi_free_entry; | ||
24 | }; | ||
25 | 15 | ||
26 | #endif /* _LINUX_DQBLK_V2_H */ | 16 | #endif /* _LINUX_DQBLK_V2_H */ |
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h index 79a8ed8e6a7d..55026b1a40bd 100644 --- a/include/linux/dvb/frontend.h +++ b/include/linux/dvb/frontend.h | |||
@@ -62,10 +62,11 @@ typedef enum fe_caps { | |||
62 | FE_CAN_HIERARCHY_AUTO = 0x100000, | 62 | FE_CAN_HIERARCHY_AUTO = 0x100000, |
63 | FE_CAN_8VSB = 0x200000, | 63 | FE_CAN_8VSB = 0x200000, |
64 | FE_CAN_16VSB = 0x400000, | 64 | FE_CAN_16VSB = 0x400000, |
65 | FE_HAS_EXTENDED_CAPS = 0x800000, // We need more bitspace for newer APIs, indicate this. | 65 | FE_HAS_EXTENDED_CAPS = 0x800000, /* We need more bitspace for newer APIs, indicate this. */ |
66 | FE_NEEDS_BENDING = 0x20000000, // not supported anymore, don't use (frontend requires frequency bending) | 66 | FE_CAN_2G_MODULATION = 0x10000000, /* frontend supports "2nd generation modulation" (DVB-S2) */ |
67 | FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically | 67 | FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */ |
68 | FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output | 68 | FE_CAN_RECOVER = 0x40000000, /* frontend can recover from a cable unplug automatically */ |
69 | FE_CAN_MUTE_TS = 0x80000000 /* frontend can stop spurious TS data output */ | ||
69 | } fe_caps_t; | 70 | } fe_caps_t; |
70 | 71 | ||
71 | 72 | ||
@@ -121,15 +122,15 @@ typedef enum fe_sec_mini_cmd { | |||
121 | 122 | ||
122 | 123 | ||
123 | typedef enum fe_status { | 124 | typedef enum fe_status { |
124 | FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ | 125 | FE_HAS_SIGNAL = 0x01, /* found something above the noise level */ |
125 | FE_HAS_CARRIER = 0x02, /* found a DVB signal */ | 126 | FE_HAS_CARRIER = 0x02, /* found a DVB signal */ |
126 | FE_HAS_VITERBI = 0x04, /* FEC is stable */ | 127 | FE_HAS_VITERBI = 0x04, /* FEC is stable */ |
127 | FE_HAS_SYNC = 0x08, /* found sync bytes */ | 128 | FE_HAS_SYNC = 0x08, /* found sync bytes */ |
128 | FE_HAS_LOCK = 0x10, /* everything's working... */ | 129 | FE_HAS_LOCK = 0x10, /* everything's working... */ |
129 | FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ | 130 | FE_TIMEDOUT = 0x20, /* no lock within the last ~2 seconds */ |
130 | FE_REINIT = 0x40 /* frontend was reinitialized, */ | 131 | FE_REINIT = 0x40 /* frontend was reinitialized, */ |
131 | } fe_status_t; /* application is recommended to reset */ | 132 | } fe_status_t; /* application is recommended to reset */ |
132 | /* DiSEqC, tone and parameters */ | 133 | /* DiSEqC, tone and parameters */ |
133 | 134 | ||
134 | typedef enum fe_spectral_inversion { | 135 | typedef enum fe_spectral_inversion { |
135 | INVERSION_OFF, | 136 | INVERSION_OFF, |
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index f273415ab6f1..dc541f3653d1 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h | |||
@@ -108,4 +108,10 @@ struct ext2_sb_info { | |||
108 | struct ext2_reserve_window_node s_rsv_window_head; | 108 | struct ext2_reserve_window_node s_rsv_window_head; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | static inline spinlock_t * | ||
112 | sb_bgl_lock(struct ext2_sb_info *sbi, unsigned int block_group) | ||
113 | { | ||
114 | return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); | ||
115 | } | ||
116 | |||
111 | #endif /* _LINUX_EXT2_FS_SB */ | 117 | #endif /* _LINUX_EXT2_FS_SB */ |
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index b65f0288b842..e024e38248ff 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h | |||
@@ -83,4 +83,10 @@ struct ext3_sb_info { | |||
83 | #endif | 83 | #endif |
84 | }; | 84 | }; |
85 | 85 | ||
86 | static inline spinlock_t * | ||
87 | sb_bgl_lock(struct ext3_sb_info *sbi, unsigned int block_group) | ||
88 | { | ||
89 | return bgl_lock_ptr(&sbi->s_blockgroup_lock, block_group); | ||
90 | } | ||
91 | |||
86 | #endif /* _LINUX_EXT3_FS_SB */ | 92 | #endif /* _LINUX_EXT3_FS_SB */ |
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index 4aab6f12cfab..09d6c5bbdddd 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h | |||
@@ -57,8 +57,6 @@ struct files_struct { | |||
57 | 57 | ||
58 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) | 58 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) |
59 | 59 | ||
60 | extern struct kmem_cache *filp_cachep; | ||
61 | |||
62 | struct file_operations; | 60 | struct file_operations; |
63 | struct vfsmount; | 61 | struct vfsmount; |
64 | struct dentry; | 62 | struct dentry; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 001ded4845b4..fb59673c60b1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -21,7 +21,6 @@ | |||
21 | 21 | ||
22 | /* Fixed constants first: */ | 22 | /* Fixed constants first: */ |
23 | #undef NR_OPEN | 23 | #undef NR_OPEN |
24 | extern int sysctl_nr_open; | ||
25 | #define INR_OPEN 1024 /* Initial setting for nfile rlimits */ | 24 | #define INR_OPEN 1024 /* Initial setting for nfile rlimits */ |
26 | 25 | ||
27 | #define BLOCK_SIZE_BITS 10 | 26 | #define BLOCK_SIZE_BITS 10 |
@@ -38,21 +37,13 @@ struct files_stat_struct { | |||
38 | int nr_free_files; /* read only */ | 37 | int nr_free_files; /* read only */ |
39 | int max_files; /* tunable */ | 38 | int max_files; /* tunable */ |
40 | }; | 39 | }; |
41 | extern struct files_stat_struct files_stat; | ||
42 | extern int get_max_files(void); | ||
43 | 40 | ||
44 | struct inodes_stat_t { | 41 | struct inodes_stat_t { |
45 | int nr_inodes; | 42 | int nr_inodes; |
46 | int nr_unused; | 43 | int nr_unused; |
47 | int dummy[5]; /* padding for sysctl ABI compatibility */ | 44 | int dummy[5]; /* padding for sysctl ABI compatibility */ |
48 | }; | 45 | }; |
49 | extern struct inodes_stat_t inodes_stat; | ||
50 | 46 | ||
51 | extern int leases_enable, lease_break_time; | ||
52 | |||
53 | #ifdef CONFIG_DNOTIFY | ||
54 | extern int dir_notify_enable; | ||
55 | #endif | ||
56 | 47 | ||
57 | #define NR_FILE 8192 /* this can well be larger on a larger system */ | 48 | #define NR_FILE 8192 /* this can well be larger on a larger system */ |
58 | 49 | ||
@@ -330,6 +321,15 @@ extern void __init inode_init(void); | |||
330 | extern void __init inode_init_early(void); | 321 | extern void __init inode_init_early(void); |
331 | extern void __init files_init(unsigned long); | 322 | extern void __init files_init(unsigned long); |
332 | 323 | ||
324 | extern struct files_stat_struct files_stat; | ||
325 | extern int get_max_files(void); | ||
326 | extern int sysctl_nr_open; | ||
327 | extern struct inodes_stat_t inodes_stat; | ||
328 | extern int leases_enable, lease_break_time; | ||
329 | #ifdef CONFIG_DNOTIFY | ||
330 | extern int dir_notify_enable; | ||
331 | #endif | ||
332 | |||
333 | struct buffer_head; | 333 | struct buffer_head; |
334 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | 334 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, |
335 | struct buffer_head *bh_result, int create); | 335 | struct buffer_head *bh_result, int create); |
@@ -423,6 +423,9 @@ enum positive_aop_returns { | |||
423 | 423 | ||
424 | #define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */ | 424 | #define AOP_FLAG_UNINTERRUPTIBLE 0x0001 /* will not do a short write */ |
425 | #define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */ | 425 | #define AOP_FLAG_CONT_EXPAND 0x0002 /* called from cont_expand */ |
426 | #define AOP_FLAG_NOFS 0x0004 /* used by filesystem to direct | ||
427 | * helper code (eg buffer layer) | ||
428 | * to clear GFP_FS from alloc */ | ||
426 | 429 | ||
427 | /* | 430 | /* |
428 | * oh the beauties of C type declarations. | 431 | * oh the beauties of C type declarations. |
@@ -1212,7 +1215,6 @@ extern void unlock_super(struct super_block *); | |||
1212 | /* | 1215 | /* |
1213 | * VFS helper functions.. | 1216 | * VFS helper functions.. |
1214 | */ | 1217 | */ |
1215 | extern int vfs_permission(struct nameidata *, int); | ||
1216 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); | 1218 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); |
1217 | extern int vfs_mkdir(struct inode *, struct dentry *, int); | 1219 | extern int vfs_mkdir(struct inode *, struct dentry *, int); |
1218 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); | 1220 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); |
@@ -1310,7 +1312,6 @@ struct file_operations { | |||
1310 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | 1312 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); |
1311 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 1313 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
1312 | int (*check_flags)(int); | 1314 | int (*check_flags)(int); |
1313 | int (*dir_notify)(struct file *filp, unsigned long arg); | ||
1314 | int (*flock) (struct file *, int, struct file_lock *); | 1315 | int (*flock) (struct file *, int, struct file_lock *); |
1315 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); | 1316 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); |
1316 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); | 1317 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); |
@@ -1829,7 +1830,7 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
1829 | extern int filemap_fdatawrite_range(struct address_space *mapping, | 1830 | extern int filemap_fdatawrite_range(struct address_space *mapping, |
1830 | loff_t start, loff_t end); | 1831 | loff_t start, loff_t end); |
1831 | 1832 | ||
1832 | extern long do_fsync(struct file *file, int datasync); | 1833 | extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); |
1833 | extern void sync_supers(void); | 1834 | extern void sync_supers(void); |
1834 | extern void sync_filesystems(int wait); | 1835 | extern void sync_filesystems(int wait); |
1835 | extern void __fsync_super(struct super_block *sb); | 1836 | extern void __fsync_super(struct super_block *sb); |
@@ -1869,7 +1870,7 @@ extern void free_write_pipe(struct file *); | |||
1869 | 1870 | ||
1870 | extern struct file *do_filp_open(int dfd, const char *pathname, | 1871 | extern struct file *do_filp_open(int dfd, const char *pathname, |
1871 | int open_flag, int mode); | 1872 | int open_flag, int mode); |
1872 | extern int may_open(struct nameidata *, int, int); | 1873 | extern int may_open(struct path *, int, int); |
1873 | 1874 | ||
1874 | extern int kernel_read(struct file *, unsigned long, char *, unsigned long); | 1875 | extern int kernel_read(struct file *, unsigned long, char *, unsigned long); |
1875 | extern struct file * open_exec(const char *); | 1876 | extern struct file * open_exec(const char *); |
@@ -1904,6 +1905,8 @@ extern struct inode *ilookup(struct super_block *sb, unsigned long ino); | |||
1904 | 1905 | ||
1905 | extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); | 1906 | extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); |
1906 | extern struct inode * iget_locked(struct super_block *, unsigned long); | 1907 | extern struct inode * iget_locked(struct super_block *, unsigned long); |
1908 | extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); | ||
1909 | extern int insert_inode_locked(struct inode *); | ||
1907 | extern void unlock_new_inode(struct inode *); | 1910 | extern void unlock_new_inode(struct inode *); |
1908 | 1911 | ||
1909 | extern void __iget(struct inode * inode); | 1912 | extern void __iget(struct inode * inode); |
@@ -2035,7 +2038,7 @@ extern int page_readlink(struct dentry *, char __user *, int); | |||
2035 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); | 2038 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); |
2036 | extern void page_put_link(struct dentry *, struct nameidata *, void *); | 2039 | extern void page_put_link(struct dentry *, struct nameidata *, void *); |
2037 | extern int __page_symlink(struct inode *inode, const char *symname, int len, | 2040 | extern int __page_symlink(struct inode *inode, const char *symname, int len, |
2038 | gfp_t gfp_mask); | 2041 | int nofs); |
2039 | extern int page_symlink(struct inode *inode, const char *symname, int len); | 2042 | extern int page_symlink(struct inode *inode, const char *symname, int len); |
2040 | extern const struct inode_operations page_symlink_inode_operations; | 2043 | extern const struct inode_operations page_symlink_inode_operations; |
2041 | extern int generic_readlink(struct dentry *, char __user *, int); | 2044 | extern int generic_readlink(struct dentry *, char __user *, int); |
@@ -2056,6 +2059,9 @@ extern int vfs_fstat(unsigned int, struct kstat *); | |||
2056 | 2059 | ||
2057 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | 2060 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, |
2058 | unsigned long arg); | 2061 | unsigned long arg); |
2062 | extern int __generic_block_fiemap(struct inode *inode, | ||
2063 | struct fiemap_extent_info *fieinfo, u64 start, | ||
2064 | u64 len, get_block_t *get_block); | ||
2059 | extern int generic_block_fiemap(struct inode *inode, | 2065 | extern int generic_block_fiemap(struct inode *inode, |
2060 | struct fiemap_extent_info *fieinfo, u64 start, | 2066 | struct fiemap_extent_info *fieinfo, u64 start, |
2061 | u64 len, get_block_t *get_block); | 2067 | u64 len, get_block_t *get_block); |
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h index 9e5a06e78d02..a97c053d3a9a 100644 --- a/include/linux/fs_struct.h +++ b/include/linux/fs_struct.h | |||
@@ -10,12 +10,6 @@ struct fs_struct { | |||
10 | struct path root, pwd; | 10 | struct path root, pwd; |
11 | }; | 11 | }; |
12 | 12 | ||
13 | #define INIT_FS { \ | ||
14 | .count = ATOMIC_INIT(1), \ | ||
15 | .lock = RW_LOCK_UNLOCKED, \ | ||
16 | .umask = 0022, \ | ||
17 | } | ||
18 | |||
19 | extern struct kmem_cache *fs_cachep; | 13 | extern struct kmem_cache *fs_cachep; |
20 | 14 | ||
21 | extern void exit_fs(struct task_struct *); | 15 | extern void exit_fs(struct task_struct *); |
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index 4cc913939817..fadff28505bb 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h | |||
@@ -21,7 +21,6 @@ struct real_driver { | |||
21 | void (*enable_tx_interrupts) (void *); | 21 | void (*enable_tx_interrupts) (void *); |
22 | void (*disable_rx_interrupts) (void *); | 22 | void (*disable_rx_interrupts) (void *); |
23 | void (*enable_rx_interrupts) (void *); | 23 | void (*enable_rx_interrupts) (void *); |
24 | int (*get_CD) (void *); | ||
25 | void (*shutdown_port) (void*); | 24 | void (*shutdown_port) (void*); |
26 | int (*set_real_termios) (void*); | 25 | int (*set_real_termios) (void*); |
27 | int (*chars_in_buffer) (void*); | 26 | int (*chars_in_buffer) (void*); |
diff --git a/include/linux/hid.h b/include/linux/hid.h index e5780f8c934a..81aa84d60c6b 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -403,15 +403,6 @@ struct hid_output_fifo { | |||
403 | #define HID_STAT_ADDED 1 | 403 | #define HID_STAT_ADDED 1 |
404 | #define HID_STAT_PARSED 2 | 404 | #define HID_STAT_PARSED 2 |
405 | 405 | ||
406 | #define HID_CTRL_RUNNING 1 | ||
407 | #define HID_OUT_RUNNING 2 | ||
408 | #define HID_IN_RUNNING 3 | ||
409 | #define HID_RESET_PENDING 4 | ||
410 | #define HID_SUSPENDED 5 | ||
411 | #define HID_CLEAR_HALT 6 | ||
412 | #define HID_DISCONNECTED 7 | ||
413 | #define HID_STARTED 8 | ||
414 | |||
415 | struct hid_input { | 406 | struct hid_input { |
416 | struct list_head list; | 407 | struct list_head list; |
417 | struct hid_report *report; | 408 | struct hid_report *report; |
@@ -540,6 +531,8 @@ struct hid_usage_id { | |||
540 | * @name: driver name (e.g. "Footech_bar-wheel") | 531 | * @name: driver name (e.g. "Footech_bar-wheel") |
541 | * @id_table: which devices is this driver for (must be non-NULL for probe | 532 | * @id_table: which devices is this driver for (must be non-NULL for probe |
542 | * to be called) | 533 | * to be called) |
534 | * @dyn_list: list of dynamically added device ids | ||
535 | * @dyn_lock: lock protecting @dyn_list | ||
543 | * @probe: new device inserted | 536 | * @probe: new device inserted |
544 | * @remove: device removed (NULL if not a hot-plug capable driver) | 537 | * @remove: device removed (NULL if not a hot-plug capable driver) |
545 | * @report_table: on which reports to call raw_event (NULL means all) | 538 | * @report_table: on which reports to call raw_event (NULL means all) |
@@ -567,6 +560,9 @@ struct hid_driver { | |||
567 | char *name; | 560 | char *name; |
568 | const struct hid_device_id *id_table; | 561 | const struct hid_device_id *id_table; |
569 | 562 | ||
563 | struct list_head dyn_list; | ||
564 | spinlock_t dyn_lock; | ||
565 | |||
570 | int (*probe)(struct hid_device *dev, const struct hid_device_id *id); | 566 | int (*probe)(struct hid_device *dev, const struct hid_device_id *id); |
571 | void (*remove)(struct hid_device *dev); | 567 | void (*remove)(struct hid_device *dev); |
572 | 568 | ||
@@ -797,6 +793,8 @@ dbg_hid(const char *fmt, ...) | |||
797 | 793 | ||
798 | #ifdef CONFIG_HID_COMPAT | 794 | #ifdef CONFIG_HID_COMPAT |
799 | #define HID_COMPAT_LOAD_DRIVER(name) \ | 795 | #define HID_COMPAT_LOAD_DRIVER(name) \ |
796 | /* prototype to avoid sparse warning */ \ | ||
797 | extern void hid_compat_##name(void); \ | ||
800 | void hid_compat_##name(void) { } \ | 798 | void hid_compat_##name(void) { } \ |
801 | EXPORT_SYMBOL(hid_compat_##name) | 799 | EXPORT_SYMBOL(hid_compat_##name) |
802 | #else | 800 | #else |
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h index dbb5c8c374f0..dd8d69269176 100644 --- a/include/linux/hidraw.h +++ b/include/linux/hidraw.h | |||
@@ -33,6 +33,8 @@ struct hidraw_devinfo { | |||
33 | #define HIDIOCGRDESCSIZE _IOR('H', 0x01, int) | 33 | #define HIDIOCGRDESCSIZE _IOR('H', 0x01, int) |
34 | #define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor) | 34 | #define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor) |
35 | #define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo) | 35 | #define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo) |
36 | #define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len) | ||
37 | #define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len) | ||
36 | 38 | ||
37 | #define HIDRAW_FIRST_MINOR 0 | 39 | #define HIDRAW_FIRST_MINOR 0 |
38 | #define HIDRAW_MAX_DEVICES 64 | 40 | #define HIDRAW_MAX_DEVICES 64 |
diff --git a/include/linux/i2c/dm355evm_msp.h b/include/linux/i2c/dm355evm_msp.h new file mode 100644 index 000000000000..372470350fab --- /dev/null +++ b/include/linux/i2c/dm355evm_msp.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * dm355evm_msp.h - support MSP430 microcontroller on DM355EVM board | ||
3 | */ | ||
4 | #ifndef __LINUX_I2C_DM355EVM_MSP | ||
5 | #define __LINUX_I2C_DM355EVM_MSP | ||
6 | |||
7 | /* | ||
8 | * Written against Spectrum's writeup for the A4 firmware revision, | ||
9 | * and tweaked to match source and rev D2 schematics by removing CPLD | ||
10 | * and NOR flash hooks (which were last appropriate in rev B boards). | ||
11 | * | ||
12 | * Note that the firmware supports a flavor of write posting ... to be | ||
13 | * sure a write completes, issue another read or write. | ||
14 | */ | ||
15 | |||
16 | /* utilities to access "registers" emulated by msp430 firmware */ | ||
17 | extern int dm355evm_msp_write(u8 value, u8 reg); | ||
18 | extern int dm355evm_msp_read(u8 reg); | ||
19 | |||
20 | |||
21 | /* command/control registers */ | ||
22 | #define DM355EVM_MSP_COMMAND 0x00 | ||
23 | # define MSP_COMMAND_NULL 0 | ||
24 | # define MSP_COMMAND_RESET_COLD 1 | ||
25 | # define MSP_COMMAND_RESET_WARM 2 | ||
26 | # define MSP_COMMAND_RESET_WARM_I 3 | ||
27 | # define MSP_COMMAND_POWEROFF 4 | ||
28 | # define MSP_COMMAND_IR_REINIT 5 | ||
29 | #define DM355EVM_MSP_STATUS 0x01 | ||
30 | # define MSP_STATUS_BAD_OFFSET BIT(0) | ||
31 | # define MSP_STATUS_BAD_COMMAND BIT(1) | ||
32 | # define MSP_STATUS_POWER_ERROR BIT(2) | ||
33 | # define MSP_STATUS_RXBUF_OVERRUN BIT(3) | ||
34 | #define DM355EVM_MSP_RESET 0x02 /* 0 bits == in reset */ | ||
35 | # define MSP_RESET_DC5 BIT(0) | ||
36 | # define MSP_RESET_TVP5154 BIT(2) | ||
37 | # define MSP_RESET_IMAGER BIT(3) | ||
38 | # define MSP_RESET_ETHERNET BIT(4) | ||
39 | # define MSP_RESET_SYS BIT(5) | ||
40 | # define MSP_RESET_AIC33 BIT(7) | ||
41 | |||
42 | /* GPIO registers ... bit patterns mostly match the source MSP ports */ | ||
43 | #define DM355EVM_MSP_LED 0x03 /* active low (MSP P4) */ | ||
44 | #define DM355EVM_MSP_SWITCH1 0x04 /* (MSP P5, masked) */ | ||
45 | # define MSP_SWITCH1_SW6_1 BIT(0) | ||
46 | # define MSP_SWITCH1_SW6_2 BIT(1) | ||
47 | # define MSP_SWITCH1_SW6_3 BIT(2) | ||
48 | # define MSP_SWITCH1_SW6_4 BIT(3) | ||
49 | # define MSP_SWITCH1_J1 BIT(4) /* NTSC/PAL */ | ||
50 | # define MSP_SWITCH1_MSP_INT BIT(5) /* active low */ | ||
51 | #define DM355EVM_MSP_SWITCH2 0x05 /* (MSP P6, masked) */ | ||
52 | # define MSP_SWITCH2_SW10 BIT(3) | ||
53 | # define MSP_SWITCH2_SW11 BIT(4) | ||
54 | # define MSP_SWITCH2_SW12 BIT(5) | ||
55 | # define MSP_SWITCH2_SW13 BIT(6) | ||
56 | # define MSP_SWITCH2_SW14 BIT(7) | ||
57 | #define DM355EVM_MSP_SDMMC 0x06 /* (MSP P2, masked) */ | ||
58 | # define MSP_SDMMC_0_WP BIT(1) | ||
59 | # define MSP_SDMMC_0_CD BIT(2) /* active low */ | ||
60 | # define MSP_SDMMC_1_WP BIT(3) | ||
61 | # define MSP_SDMMC_1_CD BIT(4) /* active low */ | ||
62 | #define DM355EVM_MSP_FIRMREV 0x07 /* not a GPIO (out of order) */ | ||
63 | #define DM355EVM_MSP_VIDEO_IN 0x08 /* (MSP P3, masked) */ | ||
64 | # define MSP_VIDEO_IMAGER BIT(7) /* low == tvp5146 */ | ||
65 | |||
66 | /* power supply registers are currently omitted */ | ||
67 | |||
68 | /* RTC registers */ | ||
69 | #define DM355EVM_MSP_RTC_0 0x12 /* LSB */ | ||
70 | #define DM355EVM_MSP_RTC_1 0x13 | ||
71 | #define DM355EVM_MSP_RTC_2 0x14 | ||
72 | #define DM355EVM_MSP_RTC_3 0x15 /* MSB */ | ||
73 | |||
74 | /* input event queue registers; code == ((HIGH << 8) | LOW) */ | ||
75 | #define DM355EVM_MSP_INPUT_COUNT 0x16 /* decrement by reading LOW */ | ||
76 | #define DM355EVM_MSP_INPUT_HIGH 0x17 | ||
77 | #define DM355EVM_MSP_INPUT_LOW 0x18 | ||
78 | |||
79 | #endif /* __LINUX_I2C_DM355EVM_MSP */ | ||
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index fb604dcd38f1..a8f84c01f82e 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h | |||
@@ -78,8 +78,8 @@ int twl4030_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | |||
78 | * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 | 78 | * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 |
79 | * for the value, and populate your data starting at offset 1. | 79 | * for the value, and populate your data starting at offset 1. |
80 | */ | 80 | */ |
81 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes); | 81 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
82 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes); | 82 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
83 | 83 | ||
84 | /*----------------------------------------------------------------------*/ | 84 | /*----------------------------------------------------------------------*/ |
85 | 85 | ||
@@ -278,6 +278,18 @@ struct twl4030_platform_data { | |||
278 | struct twl4030_keypad_data *keypad; | 278 | struct twl4030_keypad_data *keypad; |
279 | struct twl4030_usb_data *usb; | 279 | struct twl4030_usb_data *usb; |
280 | 280 | ||
281 | /* LDO regulators */ | ||
282 | struct regulator_init_data *vdac; | ||
283 | struct regulator_init_data *vpll1; | ||
284 | struct regulator_init_data *vpll2; | ||
285 | struct regulator_init_data *vmmc1; | ||
286 | struct regulator_init_data *vmmc2; | ||
287 | struct regulator_init_data *vsim; | ||
288 | struct regulator_init_data *vaux1; | ||
289 | struct regulator_init_data *vaux2; | ||
290 | struct regulator_init_data *vaux3; | ||
291 | struct regulator_init_data *vaux4; | ||
292 | |||
281 | /* REVISIT more to come ... _nothing_ should be hard-wired */ | 293 | /* REVISIT more to come ... _nothing_ should be hard-wired */ |
282 | }; | 294 | }; |
283 | 295 | ||
@@ -285,33 +297,6 @@ struct twl4030_platform_data { | |||
285 | 297 | ||
286 | int twl4030_sih_setup(int module); | 298 | int twl4030_sih_setup(int module); |
287 | 299 | ||
288 | /* | ||
289 | * FIXME completely stop using TWL4030_IRQ_BASE ... instead, pass the | ||
290 | * IRQ data to subsidiary devices using platform device resources. | ||
291 | */ | ||
292 | |||
293 | /* IRQ information-need base */ | ||
294 | #include <mach/irqs.h> | ||
295 | /* TWL4030 interrupts */ | ||
296 | |||
297 | /* #define TWL4030_MODIRQ_GPIO (TWL4030_IRQ_BASE + 0) */ | ||
298 | #define TWL4030_MODIRQ_KEYPAD (TWL4030_IRQ_BASE + 1) | ||
299 | #define TWL4030_MODIRQ_BCI (TWL4030_IRQ_BASE + 2) | ||
300 | #define TWL4030_MODIRQ_MADC (TWL4030_IRQ_BASE + 3) | ||
301 | /* #define TWL4030_MODIRQ_USB (TWL4030_IRQ_BASE + 4) */ | ||
302 | /* #define TWL4030_MODIRQ_PWR (TWL4030_IRQ_BASE + 5) */ | ||
303 | |||
304 | #define TWL4030_PWRIRQ_PWRBTN (TWL4030_PWR_IRQ_BASE + 0) | ||
305 | /* #define TWL4030_PWRIRQ_CHG_PRES (TWL4030_PWR_IRQ_BASE + 1) */ | ||
306 | /* #define TWL4030_PWRIRQ_USB_PRES (TWL4030_PWR_IRQ_BASE + 2) */ | ||
307 | /* #define TWL4030_PWRIRQ_RTC (TWL4030_PWR_IRQ_BASE + 3) */ | ||
308 | /* #define TWL4030_PWRIRQ_HOT_DIE (TWL4030_PWR_IRQ_BASE + 4) */ | ||
309 | /* #define TWL4030_PWRIRQ_PWROK_TIMEOUT (TWL4030_PWR_IRQ_BASE + 5) */ | ||
310 | /* #define TWL4030_PWRIRQ_MBCHG (TWL4030_PWR_IRQ_BASE + 6) */ | ||
311 | /* #define TWL4030_PWRIRQ_SC_DETECT (TWL4030_PWR_IRQ_BASE + 7) */ | ||
312 | |||
313 | /* Rest are unsued currently*/ | ||
314 | |||
315 | /* Offsets to Power Registers */ | 300 | /* Offsets to Power Registers */ |
316 | #define TWL4030_VDAC_DEV_GRP 0x3B | 301 | #define TWL4030_VDAC_DEV_GRP 0x3B |
317 | #define TWL4030_VDAC_DEDICATED 0x3E | 302 | #define TWL4030_VDAC_DEDICATED 0x3E |
@@ -322,10 +307,6 @@ int twl4030_sih_setup(int module); | |||
322 | #define TWL4030_VAUX3_DEV_GRP 0x1F | 307 | #define TWL4030_VAUX3_DEV_GRP 0x1F |
323 | #define TWL4030_VAUX3_DEDICATED 0x22 | 308 | #define TWL4030_VAUX3_DEDICATED 0x22 |
324 | 309 | ||
325 | /* TWL4030 GPIO interrupt definitions */ | ||
326 | |||
327 | #define TWL4030_GPIO_IRQ_NO(n) (TWL4030_GPIO_IRQ_BASE + (n)) | ||
328 | |||
329 | /* | 310 | /* |
330 | * Exported TWL4030 GPIO APIs | 311 | * Exported TWL4030 GPIO APIs |
331 | * | 312 | * |
@@ -340,4 +321,38 @@ int twl4030_set_gpio_debounce(int gpio, int enable); | |||
340 | static inline int twl4030charger_usb_en(int enable) { return 0; } | 321 | static inline int twl4030charger_usb_en(int enable) { return 0; } |
341 | #endif | 322 | #endif |
342 | 323 | ||
324 | /*----------------------------------------------------------------------*/ | ||
325 | |||
326 | /* Linux-specific regulator identifiers ... for now, we only support | ||
327 | * the LDOs, and leave the three buck converters alone. VDD1 and VDD2 | ||
328 | * need to tie into hardware based voltage scaling (cpufreq etc), while | ||
329 | * VIO is generally fixed. | ||
330 | */ | ||
331 | |||
332 | /* EXTERNAL dc-to-dc buck converters */ | ||
333 | #define TWL4030_REG_VDD1 0 | ||
334 | #define TWL4030_REG_VDD2 1 | ||
335 | #define TWL4030_REG_VIO 2 | ||
336 | |||
337 | /* EXTERNAL LDOs */ | ||
338 | #define TWL4030_REG_VDAC 3 | ||
339 | #define TWL4030_REG_VPLL1 4 | ||
340 | #define TWL4030_REG_VPLL2 5 /* not on all chips */ | ||
341 | #define TWL4030_REG_VMMC1 6 | ||
342 | #define TWL4030_REG_VMMC2 7 /* not on all chips */ | ||
343 | #define TWL4030_REG_VSIM 8 /* not on all chips */ | ||
344 | #define TWL4030_REG_VAUX1 9 /* not on all chips */ | ||
345 | #define TWL4030_REG_VAUX2_4030 10 /* (twl4030-specific) */ | ||
346 | #define TWL4030_REG_VAUX2 11 /* (twl5030 and newer) */ | ||
347 | #define TWL4030_REG_VAUX3 12 /* not on all chips */ | ||
348 | #define TWL4030_REG_VAUX4 13 /* not on all chips */ | ||
349 | |||
350 | /* INTERNAL LDOs */ | ||
351 | #define TWL4030_REG_VINTANA1 14 | ||
352 | #define TWL4030_REG_VINTANA2 15 | ||
353 | #define TWL4030_REG_VINTDIG 16 | ||
354 | #define TWL4030_REG_VUSB1V5 17 | ||
355 | #define TWL4030_REG_VUSB1V8 18 | ||
356 | #define TWL4030_REG_VUSB3V1 19 | ||
357 | |||
343 | #endif /* End of __TWL4030_H */ | 358 | #endif /* End of __TWL4030_H */ |
diff --git a/include/linux/ide.h b/include/linux/ide.h index e99c56de7f56..db5ef8ae1ab9 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -32,13 +32,6 @@ | |||
32 | # define SUPPORT_VLB_SYNC 1 | 32 | # define SUPPORT_VLB_SYNC 1 |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | /* | ||
36 | * Used to indicate "no IRQ", should be a value that cannot be an IRQ | ||
37 | * number. | ||
38 | */ | ||
39 | |||
40 | #define IDE_NO_IRQ (-1) | ||
41 | |||
42 | typedef unsigned char byte; /* used everywhere */ | 35 | typedef unsigned char byte; /* used everywhere */ |
43 | 36 | ||
44 | /* | 37 | /* |
@@ -403,6 +396,7 @@ enum { | |||
403 | * This is used for several packet commands (not for READ/WRITE commands). | 396 | * This is used for several packet commands (not for READ/WRITE commands). |
404 | */ | 397 | */ |
405 | #define IDE_PC_BUFFER_SIZE 256 | 398 | #define IDE_PC_BUFFER_SIZE 256 |
399 | #define ATAPI_WAIT_PC (60 * HZ) | ||
406 | 400 | ||
407 | struct ide_atapi_pc { | 401 | struct ide_atapi_pc { |
408 | /* actual packet bytes */ | 402 | /* actual packet bytes */ |
@@ -480,53 +474,53 @@ enum { | |||
480 | 474 | ||
481 | /* ide-cd */ | 475 | /* ide-cd */ |
482 | /* Drive cannot eject the disc. */ | 476 | /* Drive cannot eject the disc. */ |
483 | IDE_AFLAG_NO_EJECT = (1 << 3), | 477 | IDE_AFLAG_NO_EJECT = (1 << 1), |
484 | /* Drive is a pre ATAPI 1.2 drive. */ | 478 | /* Drive is a pre ATAPI 1.2 drive. */ |
485 | IDE_AFLAG_PRE_ATAPI12 = (1 << 4), | 479 | IDE_AFLAG_PRE_ATAPI12 = (1 << 2), |
486 | /* TOC addresses are in BCD. */ | 480 | /* TOC addresses are in BCD. */ |
487 | IDE_AFLAG_TOCADDR_AS_BCD = (1 << 5), | 481 | IDE_AFLAG_TOCADDR_AS_BCD = (1 << 3), |
488 | /* TOC track numbers are in BCD. */ | 482 | /* TOC track numbers are in BCD. */ |
489 | IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 6), | 483 | IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 4), |
490 | /* | 484 | /* |
491 | * Drive does not provide data in multiples of SECTOR_SIZE | 485 | * Drive does not provide data in multiples of SECTOR_SIZE |
492 | * when more than one interrupt is needed. | 486 | * when more than one interrupt is needed. |
493 | */ | 487 | */ |
494 | IDE_AFLAG_LIMIT_NFRAMES = (1 << 7), | 488 | IDE_AFLAG_LIMIT_NFRAMES = (1 << 5), |
495 | /* Saved TOC information is current. */ | 489 | /* Saved TOC information is current. */ |
496 | IDE_AFLAG_TOC_VALID = (1 << 9), | 490 | IDE_AFLAG_TOC_VALID = (1 << 6), |
497 | /* We think that the drive door is locked. */ | 491 | /* We think that the drive door is locked. */ |
498 | IDE_AFLAG_DOOR_LOCKED = (1 << 10), | 492 | IDE_AFLAG_DOOR_LOCKED = (1 << 7), |
499 | /* SET_CD_SPEED command is unsupported. */ | 493 | /* SET_CD_SPEED command is unsupported. */ |
500 | IDE_AFLAG_NO_SPEED_SELECT = (1 << 11), | 494 | IDE_AFLAG_NO_SPEED_SELECT = (1 << 8), |
501 | IDE_AFLAG_VERTOS_300_SSD = (1 << 12), | 495 | IDE_AFLAG_VERTOS_300_SSD = (1 << 9), |
502 | IDE_AFLAG_VERTOS_600_ESD = (1 << 13), | 496 | IDE_AFLAG_VERTOS_600_ESD = (1 << 10), |
503 | IDE_AFLAG_SANYO_3CD = (1 << 14), | 497 | IDE_AFLAG_SANYO_3CD = (1 << 11), |
504 | IDE_AFLAG_FULL_CAPS_PAGE = (1 << 15), | 498 | IDE_AFLAG_FULL_CAPS_PAGE = (1 << 12), |
505 | IDE_AFLAG_PLAY_AUDIO_OK = (1 << 16), | 499 | IDE_AFLAG_PLAY_AUDIO_OK = (1 << 13), |
506 | IDE_AFLAG_LE_SPEED_FIELDS = (1 << 17), | 500 | IDE_AFLAG_LE_SPEED_FIELDS = (1 << 14), |
507 | 501 | ||
508 | /* ide-floppy */ | 502 | /* ide-floppy */ |
509 | /* Avoid commands not supported in Clik drive */ | 503 | /* Avoid commands not supported in Clik drive */ |
510 | IDE_AFLAG_CLIK_DRIVE = (1 << 19), | 504 | IDE_AFLAG_CLIK_DRIVE = (1 << 15), |
511 | /* Requires BH algorithm for packets */ | 505 | /* Requires BH algorithm for packets */ |
512 | IDE_AFLAG_ZIP_DRIVE = (1 << 20), | 506 | IDE_AFLAG_ZIP_DRIVE = (1 << 16), |
513 | /* Supports format progress report */ | 507 | /* Supports format progress report */ |
514 | IDE_AFLAG_SRFP = (1 << 22), | 508 | IDE_AFLAG_SRFP = (1 << 17), |
515 | 509 | ||
516 | /* ide-tape */ | 510 | /* ide-tape */ |
517 | IDE_AFLAG_IGNORE_DSC = (1 << 23), | 511 | IDE_AFLAG_IGNORE_DSC = (1 << 18), |
518 | /* 0 When the tape position is unknown */ | 512 | /* 0 When the tape position is unknown */ |
519 | IDE_AFLAG_ADDRESS_VALID = (1 << 24), | 513 | IDE_AFLAG_ADDRESS_VALID = (1 << 19), |
520 | /* Device already opened */ | 514 | /* Device already opened */ |
521 | IDE_AFLAG_BUSY = (1 << 25), | 515 | IDE_AFLAG_BUSY = (1 << 20), |
522 | /* Attempt to auto-detect the current user block size */ | 516 | /* Attempt to auto-detect the current user block size */ |
523 | IDE_AFLAG_DETECT_BS = (1 << 26), | 517 | IDE_AFLAG_DETECT_BS = (1 << 21), |
524 | /* Currently on a filemark */ | 518 | /* Currently on a filemark */ |
525 | IDE_AFLAG_FILEMARK = (1 << 27), | 519 | IDE_AFLAG_FILEMARK = (1 << 22), |
526 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ | 520 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ |
527 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 28), | 521 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 23), |
528 | 522 | ||
529 | IDE_AFLAG_NO_AUTOCLOSE = (1 << 29), | 523 | IDE_AFLAG_NO_AUTOCLOSE = (1 << 24), |
530 | }; | 524 | }; |
531 | 525 | ||
532 | /* device flags */ | 526 | /* device flags */ |
@@ -565,28 +559,26 @@ enum { | |||
565 | IDE_DFLAG_NODMA = (1 << 16), | 559 | IDE_DFLAG_NODMA = (1 << 16), |
566 | /* powermanagment told us not to do anything, so sleep nicely */ | 560 | /* powermanagment told us not to do anything, so sleep nicely */ |
567 | IDE_DFLAG_BLOCKED = (1 << 17), | 561 | IDE_DFLAG_BLOCKED = (1 << 17), |
568 | /* ide-scsi emulation */ | ||
569 | IDE_DFLAG_SCSI = (1 << 18), | ||
570 | /* sleeping & sleep field valid */ | 562 | /* sleeping & sleep field valid */ |
571 | IDE_DFLAG_SLEEPING = (1 << 19), | 563 | IDE_DFLAG_SLEEPING = (1 << 18), |
572 | IDE_DFLAG_POST_RESET = (1 << 20), | 564 | IDE_DFLAG_POST_RESET = (1 << 19), |
573 | IDE_DFLAG_UDMA33_WARNED = (1 << 21), | 565 | IDE_DFLAG_UDMA33_WARNED = (1 << 20), |
574 | IDE_DFLAG_LBA48 = (1 << 22), | 566 | IDE_DFLAG_LBA48 = (1 << 21), |
575 | /* status of write cache */ | 567 | /* status of write cache */ |
576 | IDE_DFLAG_WCACHE = (1 << 23), | 568 | IDE_DFLAG_WCACHE = (1 << 22), |
577 | /* used for ignoring ATA_DF */ | 569 | /* used for ignoring ATA_DF */ |
578 | IDE_DFLAG_NOWERR = (1 << 24), | 570 | IDE_DFLAG_NOWERR = (1 << 23), |
579 | /* retrying in PIO */ | 571 | /* retrying in PIO */ |
580 | IDE_DFLAG_DMA_PIO_RETRY = (1 << 25), | 572 | IDE_DFLAG_DMA_PIO_RETRY = (1 << 24), |
581 | IDE_DFLAG_LBA = (1 << 26), | 573 | IDE_DFLAG_LBA = (1 << 25), |
582 | /* don't unload heads */ | 574 | /* don't unload heads */ |
583 | IDE_DFLAG_NO_UNLOAD = (1 << 27), | 575 | IDE_DFLAG_NO_UNLOAD = (1 << 26), |
584 | /* heads unloaded, please don't reset port */ | 576 | /* heads unloaded, please don't reset port */ |
585 | IDE_DFLAG_PARKED = (1 << 28), | 577 | IDE_DFLAG_PARKED = (1 << 27), |
586 | IDE_DFLAG_MEDIA_CHANGED = (1 << 29), | 578 | IDE_DFLAG_MEDIA_CHANGED = (1 << 28), |
587 | /* write protect */ | 579 | /* write protect */ |
588 | IDE_DFLAG_WP = (1 << 30), | 580 | IDE_DFLAG_WP = (1 << 29), |
589 | IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 31), | 581 | IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30), |
590 | }; | 582 | }; |
591 | 583 | ||
592 | struct ide_drive_s { | 584 | struct ide_drive_s { |
@@ -610,8 +602,6 @@ struct ide_drive_s { | |||
610 | unsigned long dev_flags; | 602 | unsigned long dev_flags; |
611 | 603 | ||
612 | unsigned long sleep; /* sleep until this time */ | 604 | unsigned long sleep; /* sleep until this time */ |
613 | unsigned long service_start; /* time we started last request */ | ||
614 | unsigned long service_time; /* service time of last request */ | ||
615 | unsigned long timeout; /* max time to wait for irq */ | 605 | unsigned long timeout; /* max time to wait for irq */ |
616 | 606 | ||
617 | special_t special; /* special action flags */ | 607 | special_t special; /* special action flags */ |
@@ -879,8 +869,6 @@ typedef struct hwgroup_s { | |||
879 | 869 | ||
880 | /* BOOL: protects all fields below */ | 870 | /* BOOL: protects all fields below */ |
881 | volatile int busy; | 871 | volatile int busy; |
882 | /* BOOL: wake us up on timer expiry */ | ||
883 | unsigned int sleeping : 1; | ||
884 | /* BOOL: polling active & poll_timeout field valid */ | 872 | /* BOOL: polling active & poll_timeout field valid */ |
885 | unsigned int polling : 1; | 873 | unsigned int polling : 1; |
886 | 874 | ||
@@ -1258,14 +1246,11 @@ int ide_set_media_lock(ide_drive_t *, struct gendisk *, int); | |||
1258 | void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *); | 1246 | void ide_create_request_sense_cmd(ide_drive_t *, struct ide_atapi_pc *); |
1259 | void ide_retry_pc(ide_drive_t *, struct gendisk *); | 1247 | void ide_retry_pc(ide_drive_t *, struct gendisk *); |
1260 | 1248 | ||
1261 | static inline unsigned long ide_scsi_get_timeout(struct ide_atapi_pc *pc) | 1249 | int ide_cd_expiry(ide_drive_t *); |
1262 | { | ||
1263 | return max_t(unsigned long, WAIT_CMD, pc->timeout - jiffies); | ||
1264 | } | ||
1265 | 1250 | ||
1266 | int ide_scsi_expiry(ide_drive_t *); | 1251 | int ide_cd_get_xferlen(struct request *); |
1267 | 1252 | ||
1268 | ide_startstop_t ide_issue_pc(ide_drive_t *, unsigned int, ide_expiry_t *); | 1253 | ide_startstop_t ide_issue_pc(ide_drive_t *); |
1269 | 1254 | ||
1270 | ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); | 1255 | ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); |
1271 | 1256 | ||
@@ -1287,6 +1272,26 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); | |||
1287 | 1272 | ||
1288 | extern void ide_timer_expiry(unsigned long); | 1273 | extern void ide_timer_expiry(unsigned long); |
1289 | extern irqreturn_t ide_intr(int irq, void *dev_id); | 1274 | extern irqreturn_t ide_intr(int irq, void *dev_id); |
1275 | |||
1276 | static inline int ide_lock_hwgroup(ide_hwgroup_t *hwgroup) | ||
1277 | { | ||
1278 | if (hwgroup->busy) | ||
1279 | return 1; | ||
1280 | |||
1281 | hwgroup->busy = 1; | ||
1282 | /* for atari only */ | ||
1283 | ide_get_lock(ide_intr, hwgroup); | ||
1284 | |||
1285 | return 0; | ||
1286 | } | ||
1287 | |||
1288 | static inline void ide_unlock_hwgroup(ide_hwgroup_t *hwgroup) | ||
1289 | { | ||
1290 | /* for atari only */ | ||
1291 | ide_release_lock(); | ||
1292 | hwgroup->busy = 0; | ||
1293 | } | ||
1294 | |||
1290 | extern void do_ide_request(struct request_queue *); | 1295 | extern void do_ide_request(struct request_queue *); |
1291 | 1296 | ||
1292 | void ide_init_disk(struct gendisk *, ide_drive_t *); | 1297 | void ide_init_disk(struct gendisk *, ide_drive_t *); |
@@ -1533,6 +1538,7 @@ void ide_unregister_region(struct gendisk *); | |||
1533 | void ide_undecoded_slave(ide_drive_t *); | 1538 | void ide_undecoded_slave(ide_drive_t *); |
1534 | 1539 | ||
1535 | void ide_port_apply_params(ide_hwif_t *); | 1540 | void ide_port_apply_params(ide_hwif_t *); |
1541 | int ide_sysfs_register_port(ide_hwif_t *); | ||
1536 | 1542 | ||
1537 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); | 1543 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); |
1538 | void ide_host_free(struct ide_host *); | 1544 | void ide_host_free(struct ide_host *); |
@@ -1627,6 +1633,9 @@ extern struct mutex ide_cfg_mtx; | |||
1627 | 1633 | ||
1628 | #define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0) | 1634 | #define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0) |
1629 | 1635 | ||
1636 | char *ide_media_string(ide_drive_t *); | ||
1637 | |||
1638 | extern struct device_attribute ide_dev_attrs[]; | ||
1630 | extern struct bus_type ide_bus_type; | 1639 | extern struct bus_type ide_bus_type; |
1631 | extern struct class *ide_port_class; | 1640 | extern struct class *ide_port_class; |
1632 | 1641 | ||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 959f5522d10a..2f3c2d4ef73b 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <net/net_namespace.h> | 12 | #include <net/net_namespace.h> |
13 | 13 | ||
14 | extern struct files_struct init_files; | 14 | extern struct files_struct init_files; |
15 | extern struct fs_struct init_fs; | ||
15 | 16 | ||
16 | #define INIT_KIOCTX(name, which_mm) \ | 17 | #define INIT_KIOCTX(name, which_mm) \ |
17 | { \ | 18 | { \ |
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 3d017cfd245b..c4f6c101dbcd 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
@@ -23,8 +23,6 @@ | |||
23 | #define _INTEL_IOMMU_H_ | 23 | #define _INTEL_IOMMU_H_ |
24 | 24 | ||
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/msi.h> | ||
27 | #include <linux/sysdev.h> | ||
28 | #include <linux/iova.h> | 26 | #include <linux/iova.h> |
29 | #include <linux/io.h> | 27 | #include <linux/io.h> |
30 | #include <linux/dma_remapping.h> | 28 | #include <linux/dma_remapping.h> |
@@ -289,10 +287,10 @@ struct intel_iommu { | |||
289 | void __iomem *reg; /* Pointer to hardware regs, virtual addr */ | 287 | void __iomem *reg; /* Pointer to hardware regs, virtual addr */ |
290 | u64 cap; | 288 | u64 cap; |
291 | u64 ecap; | 289 | u64 ecap; |
292 | int seg; | ||
293 | u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ | 290 | u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ |
294 | spinlock_t register_lock; /* protect register handling */ | 291 | spinlock_t register_lock; /* protect register handling */ |
295 | int seq_id; /* sequence id of the iommu */ | 292 | int seq_id; /* sequence id of the iommu */ |
293 | int agaw; /* agaw of this iommu */ | ||
296 | 294 | ||
297 | #ifdef CONFIG_DMAR | 295 | #ifdef CONFIG_DMAR |
298 | unsigned long *domain_ids; /* bitmap of domains */ | 296 | unsigned long *domain_ids; /* bitmap of domains */ |
@@ -302,8 +300,6 @@ struct intel_iommu { | |||
302 | 300 | ||
303 | unsigned int irq; | 301 | unsigned int irq; |
304 | unsigned char name[7]; /* Device Name */ | 302 | unsigned char name[7]; /* Device Name */ |
305 | struct msi_msg saved_msg; | ||
306 | struct sys_device sysdev; | ||
307 | struct iommu_flush flush; | 303 | struct iommu_flush flush; |
308 | #endif | 304 | #endif |
309 | struct q_inval *qi; /* Queued invalidation info */ | 305 | struct q_inval *qi; /* Queued invalidation info */ |
@@ -334,25 +330,6 @@ extern int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, | |||
334 | 330 | ||
335 | extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | 331 | extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); |
336 | 332 | ||
337 | void intel_iommu_domain_exit(struct dmar_domain *domain); | ||
338 | struct dmar_domain *intel_iommu_domain_alloc(struct pci_dev *pdev); | ||
339 | int intel_iommu_context_mapping(struct dmar_domain *domain, | ||
340 | struct pci_dev *pdev); | ||
341 | int intel_iommu_page_mapping(struct dmar_domain *domain, dma_addr_t iova, | ||
342 | u64 hpa, size_t size, int prot); | ||
343 | void intel_iommu_detach_dev(struct dmar_domain *domain, u8 bus, u8 devfn); | ||
344 | struct dmar_domain *intel_iommu_find_domain(struct pci_dev *pdev); | ||
345 | u64 intel_iommu_iova_to_pfn(struct dmar_domain *domain, u64 iova); | ||
346 | |||
347 | #ifdef CONFIG_DMAR | ||
348 | int intel_iommu_found(void); | ||
349 | #else /* CONFIG_DMAR */ | ||
350 | static inline int intel_iommu_found(void) | ||
351 | { | ||
352 | return 0; | ||
353 | } | ||
354 | #endif /* CONFIG_DMAR */ | ||
355 | |||
356 | extern void *intel_alloc_coherent(struct device *, size_t, dma_addr_t *, gfp_t); | 333 | extern void *intel_alloc_coherent(struct device *, size_t, dma_addr_t *, gfp_t); |
357 | extern void intel_free_coherent(struct device *, size_t, void *, dma_addr_t); | 334 | extern void intel_free_coherent(struct device *, size_t, void *, dma_addr_t); |
358 | extern dma_addr_t intel_map_single(struct device *, phys_addr_t, size_t, int); | 335 | extern dma_addr_t intel_map_single(struct device *, phys_addr_t, size_t, int); |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index be3c484b5242..0702c4d7bdf0 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -109,15 +109,15 @@ extern void enable_irq(unsigned int irq); | |||
109 | 109 | ||
110 | #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS) | 110 | #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS) |
111 | 111 | ||
112 | extern cpumask_t irq_default_affinity; | 112 | extern cpumask_var_t irq_default_affinity; |
113 | 113 | ||
114 | extern int irq_set_affinity(unsigned int irq, cpumask_t cpumask); | 114 | extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask); |
115 | extern int irq_can_set_affinity(unsigned int irq); | 115 | extern int irq_can_set_affinity(unsigned int irq); |
116 | extern int irq_select_affinity(unsigned int irq); | 116 | extern int irq_select_affinity(unsigned int irq); |
117 | 117 | ||
118 | #else /* CONFIG_SMP */ | 118 | #else /* CONFIG_SMP */ |
119 | 119 | ||
120 | static inline int irq_set_affinity(unsigned int irq, cpumask_t cpumask) | 120 | static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) |
121 | { | 121 | { |
122 | return -EINVAL; | 122 | return -EINVAL; |
123 | } | 123 | } |
@@ -464,4 +464,10 @@ static inline void init_irq_proc(void) | |||
464 | 464 | ||
465 | int show_interrupts(struct seq_file *p, void *v); | 465 | int show_interrupts(struct seq_file *p, void *v); |
466 | 466 | ||
467 | struct irq_desc; | ||
468 | |||
469 | extern int early_irq_init(void); | ||
470 | extern int arch_early_irq_init(void); | ||
471 | extern int arch_init_chip_data(struct irq_desc *desc, int cpu); | ||
472 | |||
467 | #endif | 473 | #endif |
diff --git a/include/linux/iommu.h b/include/linux/iommu.h new file mode 100644 index 000000000000..8a7bfb1b6ca0 --- /dev/null +++ b/include/linux/iommu.h | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2008 Advanced Micro Devices, Inc. | ||
3 | * Author: Joerg Roedel <joerg.roedel@amd.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License version 2 as published | ||
7 | * by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __LINUX_IOMMU_H | ||
20 | #define __LINUX_IOMMU_H | ||
21 | |||
22 | #define IOMMU_READ (1) | ||
23 | #define IOMMU_WRITE (2) | ||
24 | |||
25 | struct device; | ||
26 | |||
27 | struct iommu_domain { | ||
28 | void *priv; | ||
29 | }; | ||
30 | |||
31 | struct iommu_ops { | ||
32 | int (*domain_init)(struct iommu_domain *domain); | ||
33 | void (*domain_destroy)(struct iommu_domain *domain); | ||
34 | int (*attach_dev)(struct iommu_domain *domain, struct device *dev); | ||
35 | void (*detach_dev)(struct iommu_domain *domain, struct device *dev); | ||
36 | int (*map)(struct iommu_domain *domain, unsigned long iova, | ||
37 | phys_addr_t paddr, size_t size, int prot); | ||
38 | void (*unmap)(struct iommu_domain *domain, unsigned long iova, | ||
39 | size_t size); | ||
40 | phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, | ||
41 | unsigned long iova); | ||
42 | }; | ||
43 | |||
44 | #ifdef CONFIG_IOMMU_API | ||
45 | |||
46 | extern void register_iommu(struct iommu_ops *ops); | ||
47 | extern bool iommu_found(void); | ||
48 | extern struct iommu_domain *iommu_domain_alloc(void); | ||
49 | extern void iommu_domain_free(struct iommu_domain *domain); | ||
50 | extern int iommu_attach_device(struct iommu_domain *domain, | ||
51 | struct device *dev); | ||
52 | extern void iommu_detach_device(struct iommu_domain *domain, | ||
53 | struct device *dev); | ||
54 | extern int iommu_map_range(struct iommu_domain *domain, unsigned long iova, | ||
55 | phys_addr_t paddr, size_t size, int prot); | ||
56 | extern void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova, | ||
57 | size_t size); | ||
58 | extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | ||
59 | unsigned long iova); | ||
60 | |||
61 | #else /* CONFIG_IOMMU_API */ | ||
62 | |||
63 | static inline void register_iommu(struct iommu_ops *ops) | ||
64 | { | ||
65 | } | ||
66 | |||
67 | static inline bool iommu_found(void) | ||
68 | { | ||
69 | return false; | ||
70 | } | ||
71 | |||
72 | static inline struct iommu_domain *iommu_domain_alloc(void) | ||
73 | { | ||
74 | return NULL; | ||
75 | } | ||
76 | |||
77 | static inline void iommu_domain_free(struct iommu_domain *domain) | ||
78 | { | ||
79 | } | ||
80 | |||
81 | static inline int iommu_attach_device(struct iommu_domain *domain, | ||
82 | struct device *dev) | ||
83 | { | ||
84 | return -ENODEV; | ||
85 | } | ||
86 | |||
87 | static inline void iommu_detach_device(struct iommu_domain *domain, | ||
88 | struct device *dev) | ||
89 | { | ||
90 | } | ||
91 | |||
92 | static inline int iommu_map_range(struct iommu_domain *domain, | ||
93 | unsigned long iova, phys_addr_t paddr, | ||
94 | size_t size, int prot) | ||
95 | { | ||
96 | return -ENODEV; | ||
97 | } | ||
98 | |||
99 | static inline void iommu_unmap_range(struct iommu_domain *domain, | ||
100 | unsigned long iova, size_t size) | ||
101 | { | ||
102 | } | ||
103 | |||
104 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | ||
105 | unsigned long iova) | ||
106 | { | ||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | #endif /* CONFIG_IOMMU_API */ | ||
111 | |||
112 | #endif /* __LINUX_IOMMU_H */ | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index 98564dc64476..f899b502f186 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -113,7 +113,8 @@ struct irq_chip { | |||
113 | void (*eoi)(unsigned int irq); | 113 | void (*eoi)(unsigned int irq); |
114 | 114 | ||
115 | void (*end)(unsigned int irq); | 115 | void (*end)(unsigned int irq); |
116 | void (*set_affinity)(unsigned int irq, cpumask_t dest); | 116 | void (*set_affinity)(unsigned int irq, |
117 | const struct cpumask *dest); | ||
117 | int (*retrigger)(unsigned int irq); | 118 | int (*retrigger)(unsigned int irq); |
118 | int (*set_type)(unsigned int irq, unsigned int flow_type); | 119 | int (*set_type)(unsigned int irq, unsigned int flow_type); |
119 | int (*set_wake)(unsigned int irq, unsigned int on); | 120 | int (*set_wake)(unsigned int irq, unsigned int on); |
@@ -193,42 +194,23 @@ struct irq_desc { | |||
193 | const char *name; | 194 | const char *name; |
194 | } ____cacheline_internodealigned_in_smp; | 195 | } ____cacheline_internodealigned_in_smp; |
195 | 196 | ||
196 | extern void early_irq_init(void); | ||
197 | extern void arch_early_irq_init(void); | ||
198 | extern void arch_init_chip_data(struct irq_desc *desc, int cpu); | ||
199 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, | 197 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, |
200 | struct irq_desc *desc, int cpu); | 198 | struct irq_desc *desc, int cpu); |
201 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); | 199 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); |
202 | 200 | ||
203 | #ifndef CONFIG_SPARSE_IRQ | 201 | #ifndef CONFIG_SPARSE_IRQ |
204 | extern struct irq_desc irq_desc[NR_IRQS]; | 202 | extern struct irq_desc irq_desc[NR_IRQS]; |
205 | 203 | #else /* CONFIG_SPARSE_IRQ */ | |
206 | static inline struct irq_desc *irq_to_desc(unsigned int irq) | ||
207 | { | ||
208 | return (irq < NR_IRQS) ? irq_desc + irq : NULL; | ||
209 | } | ||
210 | static inline struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu) | ||
211 | { | ||
212 | return irq_to_desc(irq); | ||
213 | } | ||
214 | |||
215 | #else | ||
216 | |||
217 | extern struct irq_desc *irq_to_desc(unsigned int irq); | ||
218 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | ||
219 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); | 204 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); |
220 | 205 | ||
221 | # define for_each_irq_desc(irq, desc) \ | ||
222 | for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; irq++, desc = irq_to_desc(irq)) | ||
223 | # define for_each_irq_desc_reverse(irq, desc) \ | ||
224 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; irq--, desc = irq_to_desc(irq)) | ||
225 | |||
226 | #define kstat_irqs_this_cpu(DESC) \ | 206 | #define kstat_irqs_this_cpu(DESC) \ |
227 | ((DESC)->kstat_irqs[smp_processor_id()]) | 207 | ((DESC)->kstat_irqs[smp_processor_id()]) |
228 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ | 208 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ |
229 | ((DESC)->kstat_irqs[smp_processor_id()]++) | 209 | ((DESC)->kstat_irqs[smp_processor_id()]++) |
230 | 210 | ||
231 | #endif | 211 | #endif /* CONFIG_SPARSE_IRQ */ |
212 | |||
213 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | ||
232 | 214 | ||
233 | static inline struct irq_desc * | 215 | static inline struct irq_desc * |
234 | irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) | 216 | irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) |
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 95d2b74641f5..5504a5c97836 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
@@ -15,20 +15,23 @@ | |||
15 | 15 | ||
16 | # define for_each_irq_desc_reverse(irq, desc) \ | 16 | # define for_each_irq_desc_reverse(irq, desc) \ |
17 | for (irq = nr_irqs - 1; irq >= 0; irq--) | 17 | for (irq = nr_irqs - 1; irq >= 0; irq--) |
18 | #else | 18 | #else /* CONFIG_GENERIC_HARDIRQS */ |
19 | 19 | ||
20 | extern int nr_irqs; | 20 | extern int nr_irqs; |
21 | extern struct irq_desc *irq_to_desc(unsigned int irq); | ||
21 | 22 | ||
22 | #ifndef CONFIG_SPARSE_IRQ | 23 | # define for_each_irq_desc(irq, desc) \ |
24 | for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \ | ||
25 | irq++, desc = irq_to_desc(irq)) \ | ||
26 | if (desc) | ||
23 | 27 | ||
24 | struct irq_desc; | 28 | |
25 | # define for_each_irq_desc(irq, desc) \ | 29 | # define for_each_irq_desc_reverse(irq, desc) \ |
26 | for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) | 30 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \ |
27 | # define for_each_irq_desc_reverse(irq, desc) \ | 31 | irq--, desc = irq_to_desc(irq)) \ |
28 | for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ | 32 | if (desc) |
29 | irq >= 0; irq--, desc--) | 33 | |
30 | #endif | 34 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
31 | #endif | ||
32 | 35 | ||
33 | #define for_each_irq_nr(irq) \ | 36 | #define for_each_irq_nr(irq) \ |
34 | for (irq = 0; irq < nr_irqs; irq++) | 37 | for (irq = 0; irq < nr_irqs; irq++) |
diff --git a/include/linux/istallion.h b/include/linux/istallion.h index 0d1840723249..7faca98c7d14 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h | |||
@@ -59,9 +59,7 @@ struct stliport { | |||
59 | unsigned int devnr; | 59 | unsigned int devnr; |
60 | int baud_base; | 60 | int baud_base; |
61 | int custom_divisor; | 61 | int custom_divisor; |
62 | int close_delay; | ||
63 | int closing_wait; | 62 | int closing_wait; |
64 | int openwaitcnt; | ||
65 | int rc; | 63 | int rc; |
66 | int argsize; | 64 | int argsize; |
67 | void *argp; | 65 | void *argp; |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index c7d106ef22e2..34456476e761 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -329,6 +329,7 @@ enum jbd_state_bits { | |||
329 | BH_State, /* Pins most journal_head state */ | 329 | BH_State, /* Pins most journal_head state */ |
330 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | 330 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ |
331 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | 331 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ |
332 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
332 | }; | 333 | }; |
333 | 334 | ||
334 | BUFFER_FNS(JBD, jbd) | 335 | BUFFER_FNS(JBD, jbd) |
@@ -1007,6 +1008,35 @@ int __jbd2_journal_clean_checkpoint_list(journal_t *journal); | |||
1007 | int __jbd2_journal_remove_checkpoint(struct journal_head *); | 1008 | int __jbd2_journal_remove_checkpoint(struct journal_head *); |
1008 | void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *); | 1009 | void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *); |
1009 | 1010 | ||
1011 | |||
1012 | /* | ||
1013 | * Triggers | ||
1014 | */ | ||
1015 | |||
1016 | struct jbd2_buffer_trigger_type { | ||
1017 | /* | ||
1018 | * Fired just before a buffer is written to the journal. | ||
1019 | * mapped_data is a mapped buffer that is the frozen data for | ||
1020 | * commit. | ||
1021 | */ | ||
1022 | void (*t_commit)(struct jbd2_buffer_trigger_type *type, | ||
1023 | struct buffer_head *bh, void *mapped_data, | ||
1024 | size_t size); | ||
1025 | |||
1026 | /* | ||
1027 | * Fired during journal abort for dirty buffers that will not be | ||
1028 | * committed. | ||
1029 | */ | ||
1030 | void (*t_abort)(struct jbd2_buffer_trigger_type *type, | ||
1031 | struct buffer_head *bh); | ||
1032 | }; | ||
1033 | |||
1034 | extern void jbd2_buffer_commit_trigger(struct journal_head *jh, | ||
1035 | void *mapped_data, | ||
1036 | struct jbd2_buffer_trigger_type *triggers); | ||
1037 | extern void jbd2_buffer_abort_trigger(struct journal_head *jh, | ||
1038 | struct jbd2_buffer_trigger_type *triggers); | ||
1039 | |||
1010 | /* Buffer IO */ | 1040 | /* Buffer IO */ |
1011 | extern int | 1041 | extern int |
1012 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, | 1042 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, |
@@ -1045,6 +1075,8 @@ extern int jbd2_journal_extend (handle_t *, int nblocks); | |||
1045 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); | 1075 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); |
1046 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); | 1076 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); |
1047 | extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *); | 1077 | extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *); |
1078 | void jbd2_journal_set_triggers(struct buffer_head *, | ||
1079 | struct jbd2_buffer_trigger_type *type); | ||
1048 | extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); | 1080 | extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); |
1049 | extern void jbd2_journal_release_buffer (handle_t *, struct buffer_head *); | 1081 | extern void jbd2_journal_release_buffer (handle_t *, struct buffer_head *); |
1050 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); | 1082 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); |
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h index bb70ebb6a2d5..525aac3c97df 100644 --- a/include/linux/journal-head.h +++ b/include/linux/journal-head.h | |||
@@ -12,6 +12,8 @@ | |||
12 | 12 | ||
13 | typedef unsigned int tid_t; /* Unique transaction ID */ | 13 | typedef unsigned int tid_t; /* Unique transaction ID */ |
14 | typedef struct transaction_s transaction_t; /* Compound transaction type */ | 14 | typedef struct transaction_s transaction_t; /* Compound transaction type */ |
15 | |||
16 | |||
15 | struct buffer_head; | 17 | struct buffer_head; |
16 | 18 | ||
17 | struct journal_head { | 19 | struct journal_head { |
@@ -87,6 +89,12 @@ struct journal_head { | |||
87 | * [j_list_lock] | 89 | * [j_list_lock] |
88 | */ | 90 | */ |
89 | struct journal_head *b_cpnext, *b_cpprev; | 91 | struct journal_head *b_cpnext, *b_cpprev; |
92 | |||
93 | /* Trigger type */ | ||
94 | struct jbd2_buffer_trigger_type *b_triggers; | ||
95 | |||
96 | /* Trigger type for the committing transaction's frozen data */ | ||
97 | struct jbd2_buffer_trigger_type *b_frozen_triggers; | ||
90 | }; | 98 | }; |
91 | 99 | ||
92 | #endif /* JOURNAL_HEAD_H_INCLUDED */ | 100 | #endif /* JOURNAL_HEAD_H_INCLUDED */ |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 4ee4b3d2316f..570d20413119 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -79,10 +79,13 @@ static inline unsigned int kstat_irqs(unsigned int irq) | |||
79 | } | 79 | } |
80 | 80 | ||
81 | extern unsigned long long task_delta_exec(struct task_struct *); | 81 | extern unsigned long long task_delta_exec(struct task_struct *); |
82 | extern void account_user_time(struct task_struct *, cputime_t); | 82 | extern void account_user_time(struct task_struct *, cputime_t, cputime_t); |
83 | extern void account_user_time_scaled(struct task_struct *, cputime_t); | 83 | extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t); |
84 | extern void account_system_time(struct task_struct *, int, cputime_t); | 84 | extern void account_steal_time(cputime_t); |
85 | extern void account_system_time_scaled(struct task_struct *, cputime_t); | 85 | extern void account_idle_time(cputime_t); |
86 | extern void account_steal_time(struct task_struct *, cputime_t); | 86 | |
87 | extern void account_process_tick(struct task_struct *, int user); | ||
88 | extern void account_steal_ticks(unsigned long ticks); | ||
89 | extern void account_idle_ticks(unsigned long ticks); | ||
87 | 90 | ||
88 | #endif /* _LINUX_KERNEL_STAT_H */ | 91 | #endif /* _LINUX_KERNEL_STAT_H */ |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index f18b86fa8655..35525ac63337 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -83,6 +83,7 @@ struct kvm_irqchip { | |||
83 | #define KVM_EXIT_S390_SIEIC 13 | 83 | #define KVM_EXIT_S390_SIEIC 13 |
84 | #define KVM_EXIT_S390_RESET 14 | 84 | #define KVM_EXIT_S390_RESET 14 |
85 | #define KVM_EXIT_DCR 15 | 85 | #define KVM_EXIT_DCR 15 |
86 | #define KVM_EXIT_NMI 16 | ||
86 | 87 | ||
87 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ | 88 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ |
88 | struct kvm_run { | 89 | struct kvm_run { |
@@ -387,6 +388,14 @@ struct kvm_trace_rec { | |||
387 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 | 388 | #define KVM_CAP_DEVICE_ASSIGNMENT 17 |
388 | #endif | 389 | #endif |
389 | #define KVM_CAP_IOMMU 18 | 390 | #define KVM_CAP_IOMMU 18 |
391 | #if defined(CONFIG_X86) | ||
392 | #define KVM_CAP_DEVICE_MSI 20 | ||
393 | #endif | ||
394 | /* Bug in KVM_SET_USER_MEMORY_REGION fixed: */ | ||
395 | #define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21 | ||
396 | #if defined(CONFIG_X86) | ||
397 | #define KVM_CAP_USER_NMI 22 | ||
398 | #endif | ||
390 | 399 | ||
391 | /* | 400 | /* |
392 | * ioctls for VM fds | 401 | * ioctls for VM fds |
@@ -458,6 +467,8 @@ struct kvm_trace_rec { | |||
458 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) | 467 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) |
459 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) | 468 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) |
460 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) | 469 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
470 | /* Available with KVM_CAP_NMI */ | ||
471 | #define KVM_NMI _IO(KVMIO, 0x9a) | ||
461 | 472 | ||
462 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | 473 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) |
463 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | 474 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) |
@@ -500,10 +511,17 @@ struct kvm_assigned_irq { | |||
500 | __u32 guest_irq; | 511 | __u32 guest_irq; |
501 | __u32 flags; | 512 | __u32 flags; |
502 | union { | 513 | union { |
514 | struct { | ||
515 | __u32 addr_lo; | ||
516 | __u32 addr_hi; | ||
517 | __u32 data; | ||
518 | } guest_msi; | ||
503 | __u32 reserved[12]; | 519 | __u32 reserved[12]; |
504 | }; | 520 | }; |
505 | }; | 521 | }; |
506 | 522 | ||
507 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 523 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
508 | 524 | ||
525 | #define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI (1 << 0) | ||
526 | |||
509 | #endif | 527 | #endif |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index bb92be2153bc..ec49d0be7f52 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | #include <linux/preempt.h> | 17 | #include <linux/preempt.h> |
18 | #include <linux/marker.h> | 18 | #include <linux/marker.h> |
19 | #include <linux/msi.h> | ||
19 | #include <asm/signal.h> | 20 | #include <asm/signal.h> |
20 | 21 | ||
21 | #include <linux/kvm.h> | 22 | #include <linux/kvm.h> |
@@ -306,9 +307,16 @@ struct kvm_assigned_dev_kernel { | |||
306 | int host_busnr; | 307 | int host_busnr; |
307 | int host_devfn; | 308 | int host_devfn; |
308 | int host_irq; | 309 | int host_irq; |
310 | bool host_irq_disabled; | ||
309 | int guest_irq; | 311 | int guest_irq; |
310 | int irq_requested; | 312 | struct msi_msg guest_msi; |
313 | #define KVM_ASSIGNED_DEV_GUEST_INTX (1 << 0) | ||
314 | #define KVM_ASSIGNED_DEV_GUEST_MSI (1 << 1) | ||
315 | #define KVM_ASSIGNED_DEV_HOST_INTX (1 << 8) | ||
316 | #define KVM_ASSIGNED_DEV_HOST_MSI (1 << 9) | ||
317 | unsigned long irq_requested_type; | ||
311 | int irq_source_id; | 318 | int irq_source_id; |
319 | int flags; | ||
312 | struct pci_dev *dev; | 320 | struct pci_dev *dev; |
313 | struct kvm *kvm; | 321 | struct kvm *kvm; |
314 | }; | 322 | }; |
@@ -316,18 +324,20 @@ void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); | |||
316 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); | 324 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); |
317 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 325 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
318 | struct kvm_irq_ack_notifier *kian); | 326 | struct kvm_irq_ack_notifier *kian); |
319 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, | 327 | void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian); |
320 | struct kvm_irq_ack_notifier *kian); | ||
321 | int kvm_request_irq_source_id(struct kvm *kvm); | 328 | int kvm_request_irq_source_id(struct kvm *kvm); |
322 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); | 329 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); |
323 | 330 | ||
324 | #ifdef CONFIG_DMAR | 331 | #ifdef CONFIG_IOMMU_API |
325 | int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, | 332 | int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, |
326 | unsigned long npages); | 333 | unsigned long npages); |
327 | int kvm_iommu_map_guest(struct kvm *kvm, | 334 | int kvm_iommu_map_guest(struct kvm *kvm); |
328 | struct kvm_assigned_dev_kernel *assigned_dev); | ||
329 | int kvm_iommu_unmap_guest(struct kvm *kvm); | 335 | int kvm_iommu_unmap_guest(struct kvm *kvm); |
330 | #else /* CONFIG_DMAR */ | 336 | int kvm_assign_device(struct kvm *kvm, |
337 | struct kvm_assigned_dev_kernel *assigned_dev); | ||
338 | int kvm_deassign_device(struct kvm *kvm, | ||
339 | struct kvm_assigned_dev_kernel *assigned_dev); | ||
340 | #else /* CONFIG_IOMMU_API */ | ||
331 | static inline int kvm_iommu_map_pages(struct kvm *kvm, | 341 | static inline int kvm_iommu_map_pages(struct kvm *kvm, |
332 | gfn_t base_gfn, | 342 | gfn_t base_gfn, |
333 | unsigned long npages) | 343 | unsigned long npages) |
@@ -335,9 +345,7 @@ static inline int kvm_iommu_map_pages(struct kvm *kvm, | |||
335 | return 0; | 345 | return 0; |
336 | } | 346 | } |
337 | 347 | ||
338 | static inline int kvm_iommu_map_guest(struct kvm *kvm, | 348 | static inline int kvm_iommu_map_guest(struct kvm *kvm) |
339 | struct kvm_assigned_dev_kernel | ||
340 | *assigned_dev) | ||
341 | { | 349 | { |
342 | return -ENODEV; | 350 | return -ENODEV; |
343 | } | 351 | } |
@@ -346,7 +354,19 @@ static inline int kvm_iommu_unmap_guest(struct kvm *kvm) | |||
346 | { | 354 | { |
347 | return 0; | 355 | return 0; |
348 | } | 356 | } |
349 | #endif /* CONFIG_DMAR */ | 357 | |
358 | static inline int kvm_assign_device(struct kvm *kvm, | ||
359 | struct kvm_assigned_dev_kernel *assigned_dev) | ||
360 | { | ||
361 | return 0; | ||
362 | } | ||
363 | |||
364 | static inline int kvm_deassign_device(struct kvm *kvm, | ||
365 | struct kvm_assigned_dev_kernel *assigned_dev) | ||
366 | { | ||
367 | return 0; | ||
368 | } | ||
369 | #endif /* CONFIG_IOMMU_API */ | ||
350 | 370 | ||
351 | static inline void kvm_guest_enter(void) | 371 | static inline void kvm_guest_enter(void) |
352 | { | 372 | { |
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h index cad314c12439..115dbe965082 100644 --- a/include/linux/mfd/da903x.h +++ b/include/linux/mfd/da903x.h | |||
@@ -32,6 +32,7 @@ enum { | |||
32 | DA9030_ID_LDO18, | 32 | DA9030_ID_LDO18, |
33 | DA9030_ID_LDO19, | 33 | DA9030_ID_LDO19, |
34 | DA9030_ID_LDO_INT, /* LDO Internal */ | 34 | DA9030_ID_LDO_INT, /* LDO Internal */ |
35 | DA9030_ID_BAT, /* battery charger */ | ||
35 | 36 | ||
36 | DA9034_ID_LED_1, | 37 | DA9034_ID_LED_1, |
37 | DA9034_ID_LED_2, | 38 | DA9034_ID_LED_2, |
@@ -93,6 +94,43 @@ struct da9034_touch_pdata { | |||
93 | int y_inverted; | 94 | int y_inverted; |
94 | }; | 95 | }; |
95 | 96 | ||
97 | /* DA9030 battery charger data */ | ||
98 | struct power_supply_info; | ||
99 | |||
100 | struct da9030_battery_info { | ||
101 | /* battery parameters */ | ||
102 | struct power_supply_info *battery_info; | ||
103 | |||
104 | /* current and voltage to use for battery charging */ | ||
105 | unsigned int charge_milliamp; | ||
106 | unsigned int charge_millivolt; | ||
107 | |||
108 | /* voltage thresholds (in millivolts) */ | ||
109 | int vbat_low; | ||
110 | int vbat_crit; | ||
111 | int vbat_charge_start; | ||
112 | int vbat_charge_stop; | ||
113 | int vbat_charge_restart; | ||
114 | |||
115 | /* battery nominal minimal and maximal voltages in millivolts */ | ||
116 | int vcharge_min; | ||
117 | int vcharge_max; | ||
118 | |||
119 | /* Temperature thresholds. These are DA9030 register values | ||
120 | "as is" and should be measured for each battery type */ | ||
121 | int tbat_low; | ||
122 | int tbat_high; | ||
123 | int tbat_restart; | ||
124 | |||
125 | |||
126 | /* battery monitor interval (seconds) */ | ||
127 | unsigned int batmon_interval; | ||
128 | |||
129 | /* platform callbacks for battery low and critical events */ | ||
130 | void (*battery_low)(void); | ||
131 | void (*battery_critical)(void); | ||
132 | }; | ||
133 | |||
96 | struct da903x_subdev_info { | 134 | struct da903x_subdev_info { |
97 | int id; | 135 | int id; |
98 | const char *name; | 136 | const char *name; |
@@ -190,11 +228,13 @@ extern int da903x_unregister_notifier(struct device *dev, | |||
190 | extern int da903x_query_status(struct device *dev, unsigned int status); | 228 | extern int da903x_query_status(struct device *dev, unsigned int status); |
191 | 229 | ||
192 | 230 | ||
193 | /* NOTE: the two functions below are not intended for use outside | 231 | /* NOTE: the functions below are not intended for use outside |
194 | * of the DA9034 sub-device drivers | 232 | * of the DA903x sub-device drivers |
195 | */ | 233 | */ |
196 | extern int da903x_write(struct device *dev, int reg, uint8_t val); | 234 | extern int da903x_write(struct device *dev, int reg, uint8_t val); |
235 | extern int da903x_writes(struct device *dev, int reg, int len, uint8_t *val); | ||
197 | extern int da903x_read(struct device *dev, int reg, uint8_t *val); | 236 | extern int da903x_read(struct device *dev, int reg, uint8_t *val); |
237 | extern int da903x_reads(struct device *dev, int reg, int len, uint8_t *val); | ||
198 | extern int da903x_update(struct device *dev, int reg, uint8_t val, uint8_t mask); | 238 | extern int da903x_update(struct device *dev, int reg, uint8_t val, uint8_t mask); |
199 | extern int da903x_set_bits(struct device *dev, int reg, uint8_t bit_mask); | 239 | extern int da903x_set_bits(struct device *dev, int reg, uint8_t bit_mask); |
200 | extern int da903x_clr_bits(struct device *dev, int reg, uint8_t bit_mask); | 240 | extern int da903x_clr_bits(struct device *dev, int reg, uint8_t bit_mask); |
diff --git a/include/linux/mfd/wm8350/comparator.h b/include/linux/mfd/wm8350/comparator.h index 053788649452..54bc5d0fd502 100644 --- a/include/linux/mfd/wm8350/comparator.h +++ b/include/linux/mfd/wm8350/comparator.h | |||
@@ -164,4 +164,12 @@ | |||
164 | #define WM8350_AUXADC_BATT 6 | 164 | #define WM8350_AUXADC_BATT 6 |
165 | #define WM8350_AUXADC_TEMP 7 | 165 | #define WM8350_AUXADC_TEMP 7 |
166 | 166 | ||
167 | struct wm8350; | ||
168 | |||
169 | /* | ||
170 | * AUX ADC Readback | ||
171 | */ | ||
172 | int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, | ||
173 | int vref); | ||
174 | |||
167 | #endif | 175 | #endif |
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 6ebf97f2a475..980669d50dca 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
@@ -29,6 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | #define WM8350_RESET_ID 0x00 | 30 | #define WM8350_RESET_ID 0x00 |
31 | #define WM8350_ID 0x01 | 31 | #define WM8350_ID 0x01 |
32 | #define WM8350_REVISION 0x02 | ||
32 | #define WM8350_SYSTEM_CONTROL_1 0x03 | 33 | #define WM8350_SYSTEM_CONTROL_1 0x03 |
33 | #define WM8350_SYSTEM_CONTROL_2 0x04 | 34 | #define WM8350_SYSTEM_CONTROL_2 0x04 |
34 | #define WM8350_SYSTEM_HIBERNATE 0x05 | 35 | #define WM8350_SYSTEM_HIBERNATE 0x05 |
@@ -57,6 +58,10 @@ | |||
57 | #define WM8350_OVER_CURRENT_INT_STATUS_MASK 0x25 | 58 | #define WM8350_OVER_CURRENT_INT_STATUS_MASK 0x25 |
58 | #define WM8350_GPIO_INT_STATUS_MASK 0x26 | 59 | #define WM8350_GPIO_INT_STATUS_MASK 0x26 |
59 | #define WM8350_COMPARATOR_INT_STATUS_MASK 0x27 | 60 | #define WM8350_COMPARATOR_INT_STATUS_MASK 0x27 |
61 | #define WM8350_CHARGER_OVERRIDES 0xE2 | ||
62 | #define WM8350_MISC_OVERRIDES 0xE3 | ||
63 | #define WM8350_COMPARATOR_OVERRIDES 0xE7 | ||
64 | #define WM8350_STATE_MACHINE_STATUS 0xE9 | ||
60 | 65 | ||
61 | #define WM8350_MAX_REGISTER 0xFF | 66 | #define WM8350_MAX_REGISTER 0xFF |
62 | 67 | ||
@@ -77,6 +82,11 @@ | |||
77 | #define WM8350_CUST_ID_MASK 0x00FF | 82 | #define WM8350_CUST_ID_MASK 0x00FF |
78 | 83 | ||
79 | /* | 84 | /* |
85 | * R2 (0x02) - Revision | ||
86 | */ | ||
87 | #define WM8350_MASK_REV_MASK 0x00FF | ||
88 | |||
89 | /* | ||
80 | * R3 (0x03) - System Control 1 | 90 | * R3 (0x03) - System Control 1 |
81 | */ | 91 | */ |
82 | #define WM8350_CHIP_ON 0x8000 | 92 | #define WM8350_CHIP_ON 0x8000 |
@@ -523,6 +533,35 @@ | |||
523 | #define WM8350_DC2_STS 0x0002 | 533 | #define WM8350_DC2_STS 0x0002 |
524 | #define WM8350_DC1_STS 0x0001 | 534 | #define WM8350_DC1_STS 0x0001 |
525 | 535 | ||
536 | /* | ||
537 | * R226 (0xE2) - Charger status | ||
538 | */ | ||
539 | #define WM8350_CHG_BATT_HOT_OVRDE 0x8000 | ||
540 | #define WM8350_CHG_BATT_COLD_OVRDE 0x4000 | ||
541 | |||
542 | /* | ||
543 | * R227 (0xE3) - Misc Overrides | ||
544 | */ | ||
545 | #define WM8350_USB_LIMIT_OVRDE 0x0400 | ||
546 | |||
547 | /* | ||
548 | * R227 (0xE7) - Comparator Overrides | ||
549 | */ | ||
550 | #define WM8350_USB_FB_OVRDE 0x8000 | ||
551 | #define WM8350_WALL_FB_OVRDE 0x4000 | ||
552 | #define WM8350_BATT_FB_OVRDE 0x2000 | ||
553 | |||
554 | |||
555 | /* | ||
556 | * R233 (0xE9) - State Machinine Status | ||
557 | */ | ||
558 | #define WM8350_USB_SM_MASK 0x0700 | ||
559 | #define WM8350_USB_SM_SHIFT 8 | ||
560 | |||
561 | #define WM8350_USB_SM_100_SLV 1 | ||
562 | #define WM8350_USB_SM_500_SLV 5 | ||
563 | #define WM8350_USB_SM_STDBY_SLV 7 | ||
564 | |||
526 | /* WM8350 wake up conditions */ | 565 | /* WM8350 wake up conditions */ |
527 | #define WM8350_IRQ_WKUP_OFF_STATE 43 | 566 | #define WM8350_IRQ_WKUP_OFF_STATE 43 |
528 | #define WM8350_IRQ_WKUP_HIB_STATE 44 | 567 | #define WM8350_IRQ_WKUP_HIB_STATE 44 |
@@ -536,6 +575,7 @@ | |||
536 | #define WM8350_REV_E 0x4 | 575 | #define WM8350_REV_E 0x4 |
537 | #define WM8350_REV_F 0x5 | 576 | #define WM8350_REV_F 0x5 |
538 | #define WM8350_REV_G 0x6 | 577 | #define WM8350_REV_G 0x6 |
578 | #define WM8350_REV_H 0x7 | ||
539 | 579 | ||
540 | #define WM8350_NUM_IRQ 63 | 580 | #define WM8350_NUM_IRQ 63 |
541 | 581 | ||
@@ -549,6 +589,14 @@ extern const u16 wm8350_mode0_defaults[]; | |||
549 | extern const u16 wm8350_mode1_defaults[]; | 589 | extern const u16 wm8350_mode1_defaults[]; |
550 | extern const u16 wm8350_mode2_defaults[]; | 590 | extern const u16 wm8350_mode2_defaults[]; |
551 | extern const u16 wm8350_mode3_defaults[]; | 591 | extern const u16 wm8350_mode3_defaults[]; |
592 | extern const u16 wm8351_mode0_defaults[]; | ||
593 | extern const u16 wm8351_mode1_defaults[]; | ||
594 | extern const u16 wm8351_mode2_defaults[]; | ||
595 | extern const u16 wm8351_mode3_defaults[]; | ||
596 | extern const u16 wm8352_mode0_defaults[]; | ||
597 | extern const u16 wm8352_mode1_defaults[]; | ||
598 | extern const u16 wm8352_mode2_defaults[]; | ||
599 | extern const u16 wm8352_mode3_defaults[]; | ||
552 | 600 | ||
553 | struct wm8350; | 601 | struct wm8350; |
554 | 602 | ||
@@ -558,8 +606,6 @@ struct wm8350_irq { | |||
558 | }; | 606 | }; |
559 | 607 | ||
560 | struct wm8350 { | 608 | struct wm8350 { |
561 | int rev; /* chip revision */ | ||
562 | |||
563 | struct device *dev; | 609 | struct device *dev; |
564 | 610 | ||
565 | /* device IO */ | 611 | /* device IO */ |
@@ -572,6 +618,8 @@ struct wm8350 { | |||
572 | void *src); | 618 | void *src); |
573 | u16 *reg_cache; | 619 | u16 *reg_cache; |
574 | 620 | ||
621 | struct mutex auxadc_mutex; | ||
622 | |||
575 | /* Interrupt handling */ | 623 | /* Interrupt handling */ |
576 | struct work_struct irq_work; | 624 | struct work_struct irq_work; |
577 | struct mutex irq_mutex; /* IRQ table mutex */ | 625 | struct mutex irq_mutex; /* IRQ table mutex */ |
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h index 69b69e07f62f..96acbfc8aa12 100644 --- a/include/linux/mfd/wm8350/pmic.h +++ b/include/linux/mfd/wm8350/pmic.h | |||
@@ -701,6 +701,10 @@ struct platform_device; | |||
701 | struct regulator_init_data; | 701 | struct regulator_init_data; |
702 | 702 | ||
703 | struct wm8350_pmic { | 703 | struct wm8350_pmic { |
704 | /* Number of regulators of each type on this device */ | ||
705 | int max_dcdc; | ||
706 | int max_isink; | ||
707 | |||
704 | /* ISINK to DCDC mapping */ | 708 | /* ISINK to DCDC mapping */ |
705 | int isink_A_dcdc; | 709 | int isink_A_dcdc; |
706 | int isink_B_dcdc; | 710 | int isink_B_dcdc; |
diff --git a/include/linux/mfd/wm8350/supply.h b/include/linux/mfd/wm8350/supply.h index 1c8f3cde79b0..2b9479310bbd 100644 --- a/include/linux/mfd/wm8350/supply.h +++ b/include/linux/mfd/wm8350/supply.h | |||
@@ -13,7 +13,8 @@ | |||
13 | #ifndef __LINUX_MFD_WM8350_SUPPLY_H_ | 13 | #ifndef __LINUX_MFD_WM8350_SUPPLY_H_ |
14 | #define __LINUX_MFD_WM8350_SUPPLY_H_ | 14 | #define __LINUX_MFD_WM8350_SUPPLY_H_ |
15 | 15 | ||
16 | #include <linux/platform_device.h> | 16 | #include <linux/mutex.h> |
17 | #include <linux/power_supply.h> | ||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * Charger registers | 20 | * Charger registers |
@@ -104,8 +105,30 @@ | |||
104 | #define WM8350_IRQ_EXT_WALL_FB 37 | 105 | #define WM8350_IRQ_EXT_WALL_FB 37 |
105 | #define WM8350_IRQ_EXT_BAT_FB 38 | 106 | #define WM8350_IRQ_EXT_BAT_FB 38 |
106 | 107 | ||
108 | /* | ||
109 | * Policy to control charger state machine. | ||
110 | */ | ||
111 | struct wm8350_charger_policy { | ||
112 | |||
113 | /* charger state machine policy - set in machine driver */ | ||
114 | int eoc_mA; /* end of charge current (mA) */ | ||
115 | int charge_mV; /* charge voltage */ | ||
116 | int fast_limit_mA; /* fast charge current limit */ | ||
117 | int fast_limit_USB_mA; /* USB fast charge current limit */ | ||
118 | int charge_timeout; /* charge timeout (mins) */ | ||
119 | int trickle_start_mV; /* trickle charge starts at mV */ | ||
120 | int trickle_charge_mA; /* trickle charge current */ | ||
121 | int trickle_charge_USB_mA; /* USB trickle charge current */ | ||
122 | }; | ||
123 | |||
107 | struct wm8350_power { | 124 | struct wm8350_power { |
108 | struct platform_device *pdev; | 125 | struct platform_device *pdev; |
126 | struct power_supply battery; | ||
127 | struct power_supply usb; | ||
128 | struct power_supply ac; | ||
129 | struct wm8350_charger_policy *policy; | ||
130 | |||
131 | int rev_g_coeff; | ||
109 | }; | 132 | }; |
110 | 133 | ||
111 | #endif | 134 | #endif |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 143cebf0586f..7ac8b500d55c 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -151,4 +151,6 @@ static inline void mmc_claim_host(struct mmc_host *host) | |||
151 | __mmc_claim_host(host, NULL); | 151 | __mmc_claim_host(host, NULL); |
152 | } | 152 | } |
153 | 153 | ||
154 | extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); | ||
155 | |||
154 | #endif | 156 | #endif |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index f842f234e44f..4e457256bd33 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -41,6 +41,7 @@ struct mmc_ios { | |||
41 | 41 | ||
42 | #define MMC_BUS_WIDTH_1 0 | 42 | #define MMC_BUS_WIDTH_1 0 |
43 | #define MMC_BUS_WIDTH_4 2 | 43 | #define MMC_BUS_WIDTH_4 2 |
44 | #define MMC_BUS_WIDTH_8 3 | ||
44 | 45 | ||
45 | unsigned char timing; /* timing specification used */ | 46 | unsigned char timing; /* timing specification used */ |
46 | 47 | ||
@@ -116,6 +117,7 @@ struct mmc_host { | |||
116 | #define MMC_CAP_SDIO_IRQ (1 << 3) /* Can signal pending SDIO IRQs */ | 117 | #define MMC_CAP_SDIO_IRQ (1 << 3) /* Can signal pending SDIO IRQs */ |
117 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ | 118 | #define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ |
118 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ | 119 | #define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ |
120 | #define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ | ||
119 | 121 | ||
120 | /* host specific block data */ | 122 | /* host specific block data */ |
121 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 123 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index eb1033957486..c1f40c2f7ffb 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h | |||
@@ -13,6 +13,9 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, | |||
13 | char *secstrings, | 13 | char *secstrings, |
14 | struct module *mod); | 14 | struct module *mod); |
15 | 15 | ||
16 | /* Additional bytes needed by arch in front of individual sections */ | ||
17 | unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section); | ||
18 | |||
16 | /* Allocator used for allocating struct module, core sections and init | 19 | /* Allocator used for allocating struct module, core sections and init |
17 | sections. Returns NULL on failure. */ | 20 | sections. Returns NULL on failure. */ |
18 | void *module_alloc(unsigned long size); | 21 | void *module_alloc(unsigned long size); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 99eb80306dc5..fc2e03579877 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -94,4 +94,9 @@ static inline char *nd_get_link(struct nameidata *nd) | |||
94 | return nd->saved_names[nd->depth]; | 94 | return nd->saved_names[nd->depth]; |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline void nd_terminate_link(void *name, size_t len, size_t maxlen) | ||
98 | { | ||
99 | ((char *) name)[min(len, maxlen)] = '\0'; | ||
100 | } | ||
101 | |||
97 | #endif /* _LINUX_NAMEI_H */ | 102 | #endif /* _LINUX_NAMEI_H */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 41e1224651cf..c28bbba3c23d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -313,10 +313,11 @@ struct napi_struct { | |||
313 | #ifdef CONFIG_NETPOLL | 313 | #ifdef CONFIG_NETPOLL |
314 | spinlock_t poll_lock; | 314 | spinlock_t poll_lock; |
315 | int poll_owner; | 315 | int poll_owner; |
316 | struct net_device *dev; | ||
317 | #endif | 316 | #endif |
317 | struct net_device *dev; | ||
318 | struct list_head dev_list; | 318 | struct list_head dev_list; |
319 | struct sk_buff *gro_list; | 319 | struct sk_buff *gro_list; |
320 | struct sk_buff *skb; | ||
320 | }; | 321 | }; |
321 | 322 | ||
322 | enum | 323 | enum |
@@ -990,6 +991,9 @@ struct napi_gro_cb { | |||
990 | 991 | ||
991 | /* Number of segments aggregated. */ | 992 | /* Number of segments aggregated. */ |
992 | int count; | 993 | int count; |
994 | |||
995 | /* Free the skb? */ | ||
996 | int free; | ||
993 | }; | 997 | }; |
994 | 998 | ||
995 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) | 999 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) |
@@ -1011,6 +1015,14 @@ struct packet_type { | |||
1011 | struct list_head list; | 1015 | struct list_head list; |
1012 | }; | 1016 | }; |
1013 | 1017 | ||
1018 | struct napi_gro_fraginfo { | ||
1019 | skb_frag_t frags[MAX_SKB_FRAGS]; | ||
1020 | unsigned int nr_frags; | ||
1021 | unsigned int ip_summed; | ||
1022 | unsigned int len; | ||
1023 | __wsum csum; | ||
1024 | }; | ||
1025 | |||
1014 | #include <linux/interrupt.h> | 1026 | #include <linux/interrupt.h> |
1015 | #include <linux/notifier.h> | 1027 | #include <linux/notifier.h> |
1016 | 1028 | ||
@@ -1363,6 +1375,8 @@ extern int netif_receive_skb(struct sk_buff *skb); | |||
1363 | extern void napi_gro_flush(struct napi_struct *napi); | 1375 | extern void napi_gro_flush(struct napi_struct *napi); |
1364 | extern int napi_gro_receive(struct napi_struct *napi, | 1376 | extern int napi_gro_receive(struct napi_struct *napi, |
1365 | struct sk_buff *skb); | 1377 | struct sk_buff *skb); |
1378 | extern int napi_gro_frags(struct napi_struct *napi, | ||
1379 | struct napi_gro_fraginfo *info); | ||
1366 | extern void netif_nit_deliver(struct sk_buff *skb); | 1380 | extern void netif_nit_deliver(struct sk_buff *skb); |
1367 | extern int dev_valid_name(const char *name); | 1381 | extern int dev_valid_name(const char *name); |
1368 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1382 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 709742be02f0..01ca0856caff 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -241,7 +241,8 @@ unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, | |||
241 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, | 241 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, |
242 | int tag, unsigned int nr_pages, struct page **pages); | 242 | int tag, unsigned int nr_pages, struct page **pages); |
243 | 243 | ||
244 | struct page *__grab_cache_page(struct address_space *mapping, pgoff_t index); | 244 | struct page *grab_cache_page_write_begin(struct address_space *mapping, |
245 | pgoff_t index, unsigned flags); | ||
245 | 246 | ||
246 | /* | 247 | /* |
247 | * Returns locked page at given index in given cache, creating it if needed. | 248 | * Returns locked page at given index in given cache, creating it if needed. |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b6e694454280..218c73b1e6d4 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1766,6 +1766,7 @@ | |||
1766 | #define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 | 1766 | #define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 |
1767 | #define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 | 1767 | #define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 |
1768 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 | 1768 | #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 |
1769 | #define PCI_SUBDEVICE_ID_SIIG_DUAL_SERIAL 0x2530 | ||
1769 | 1770 | ||
1770 | #define PCI_VENDOR_ID_RADISYS 0x1331 | 1771 | #define PCI_VENDOR_ID_RADISYS 0x1331 |
1771 | 1772 | ||
@@ -1795,6 +1796,7 @@ | |||
1795 | #define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202 | 1796 | #define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202 |
1796 | #define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401 | 1797 | #define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401 |
1797 | #define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801 | 1798 | #define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801 |
1799 | #define PCI_DEVICE_ID_SEALEVEL_7803 0x7803 | ||
1798 | #define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804 | 1800 | #define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804 |
1799 | 1801 | ||
1800 | #define PCI_VENDOR_ID_HYPERCOPE 0x1365 | 1802 | #define PCI_VENDOR_ID_HYPERCOPE 0x1365 |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index f9348cba6dc1..8ff25e0e7f7a 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -45,6 +45,7 @@ enum { | |||
45 | POWER_SUPPLY_HEALTH_DEAD, | 45 | POWER_SUPPLY_HEALTH_DEAD, |
46 | POWER_SUPPLY_HEALTH_OVERVOLTAGE, | 46 | POWER_SUPPLY_HEALTH_OVERVOLTAGE, |
47 | POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, | 47 | POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, |
48 | POWER_SUPPLY_HEALTH_COLD, | ||
48 | }; | 49 | }; |
49 | 50 | ||
50 | enum { | 51 | enum { |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 40401b554484..d72d5d84fde5 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -36,17 +36,7 @@ | |||
36 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
37 | #include <linux/types.h> | 37 | #include <linux/types.h> |
38 | 38 | ||
39 | #define __DQUOT_VERSION__ "dquot_6.5.1" | 39 | #define __DQUOT_VERSION__ "dquot_6.5.2" |
40 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 | ||
41 | |||
42 | /* Size of blocks in which are counted size limits */ | ||
43 | #define QUOTABLOCK_BITS 10 | ||
44 | #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) | ||
45 | |||
46 | /* Conversion routines from and to quota blocks */ | ||
47 | #define qb2kb(x) ((x) << (QUOTABLOCK_BITS-10)) | ||
48 | #define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10)) | ||
49 | #define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS) | ||
50 | 40 | ||
51 | #define MAXQUOTAS 2 | 41 | #define MAXQUOTAS 2 |
52 | #define USRQUOTA 0 /* element used for user quotas */ | 42 | #define USRQUOTA 0 /* element used for user quotas */ |
@@ -80,16 +70,34 @@ | |||
80 | #define Q_GETQUOTA 0x800007 /* get user quota structure */ | 70 | #define Q_GETQUOTA 0x800007 /* get user quota structure */ |
81 | #define Q_SETQUOTA 0x800008 /* set user quota structure */ | 71 | #define Q_SETQUOTA 0x800008 /* set user quota structure */ |
82 | 72 | ||
73 | /* Quota format type IDs */ | ||
74 | #define QFMT_VFS_OLD 1 | ||
75 | #define QFMT_VFS_V0 2 | ||
76 | |||
77 | /* Size of block in which space limits are passed through the quota | ||
78 | * interface */ | ||
79 | #define QIF_DQBLKSIZE_BITS 10 | ||
80 | #define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS) | ||
81 | |||
83 | /* | 82 | /* |
84 | * Quota structure used for communication with userspace via quotactl | 83 | * Quota structure used for communication with userspace via quotactl |
85 | * Following flags are used to specify which fields are valid | 84 | * Following flags are used to specify which fields are valid |
86 | */ | 85 | */ |
87 | #define QIF_BLIMITS 1 | 86 | enum { |
88 | #define QIF_SPACE 2 | 87 | QIF_BLIMITS_B = 0, |
89 | #define QIF_ILIMITS 4 | 88 | QIF_SPACE_B, |
90 | #define QIF_INODES 8 | 89 | QIF_ILIMITS_B, |
91 | #define QIF_BTIME 16 | 90 | QIF_INODES_B, |
92 | #define QIF_ITIME 32 | 91 | QIF_BTIME_B, |
92 | QIF_ITIME_B, | ||
93 | }; | ||
94 | |||
95 | #define QIF_BLIMITS (1 << QIF_BLIMITS_B) | ||
96 | #define QIF_SPACE (1 << QIF_SPACE_B) | ||
97 | #define QIF_ILIMITS (1 << QIF_ILIMITS_B) | ||
98 | #define QIF_INODES (1 << QIF_INODES_B) | ||
99 | #define QIF_BTIME (1 << QIF_BTIME_B) | ||
100 | #define QIF_ITIME (1 << QIF_ITIME_B) | ||
93 | #define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS) | 101 | #define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS) |
94 | #define QIF_USAGE (QIF_SPACE | QIF_INODES) | 102 | #define QIF_USAGE (QIF_SPACE | QIF_INODES) |
95 | #define QIF_TIMES (QIF_BTIME | QIF_ITIME) | 103 | #define QIF_TIMES (QIF_BTIME | QIF_ITIME) |
@@ -172,7 +180,7 @@ enum { | |||
172 | #include <asm/atomic.h> | 180 | #include <asm/atomic.h> |
173 | 181 | ||
174 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ | 182 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ |
175 | typedef __u64 qsize_t; /* Type in which we store sizes */ | 183 | typedef long long qsize_t; /* Type in which we store sizes */ |
176 | 184 | ||
177 | extern spinlock_t dq_data_lock; | 185 | extern spinlock_t dq_data_lock; |
178 | 186 | ||
@@ -187,12 +195,12 @@ extern spinlock_t dq_data_lock; | |||
187 | * Data for one user/group kept in memory | 195 | * Data for one user/group kept in memory |
188 | */ | 196 | */ |
189 | struct mem_dqblk { | 197 | struct mem_dqblk { |
190 | __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ | 198 | qsize_t dqb_bhardlimit; /* absolute limit on disk blks alloc */ |
191 | __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ | 199 | qsize_t dqb_bsoftlimit; /* preferred limit on disk blks */ |
192 | qsize_t dqb_curspace; /* current used space */ | 200 | qsize_t dqb_curspace; /* current used space */ |
193 | __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | 201 | qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */ |
194 | __u32 dqb_isoftlimit; /* preferred inode limit */ | 202 | qsize_t dqb_isoftlimit; /* preferred inode limit */ |
195 | __u32 dqb_curinodes; /* current # allocated inodes */ | 203 | qsize_t dqb_curinodes; /* current # allocated inodes */ |
196 | time_t dqb_btime; /* time limit for excessive disk use */ | 204 | time_t dqb_btime; /* time limit for excessive disk use */ |
197 | time_t dqb_itime; /* time limit for excessive inode use */ | 205 | time_t dqb_itime; /* time limit for excessive inode use */ |
198 | }; | 206 | }; |
@@ -212,10 +220,7 @@ struct mem_dqinfo { | |||
212 | unsigned int dqi_igrace; | 220 | unsigned int dqi_igrace; |
213 | qsize_t dqi_maxblimit; | 221 | qsize_t dqi_maxblimit; |
214 | qsize_t dqi_maxilimit; | 222 | qsize_t dqi_maxilimit; |
215 | union { | 223 | void *dqi_priv; |
216 | struct v1_mem_dqinfo v1_i; | ||
217 | struct v2_mem_dqinfo v2_i; | ||
218 | } u; | ||
219 | }; | 224 | }; |
220 | 225 | ||
221 | struct super_block; | 226 | struct super_block; |
@@ -249,6 +254,11 @@ extern struct dqstats dqstats; | |||
249 | #define DQ_FAKE_B 3 /* no limits only usage */ | 254 | #define DQ_FAKE_B 3 /* no limits only usage */ |
250 | #define DQ_READ_B 4 /* dquot was read into memory */ | 255 | #define DQ_READ_B 4 /* dquot was read into memory */ |
251 | #define DQ_ACTIVE_B 5 /* dquot is active (dquot_release not called) */ | 256 | #define DQ_ACTIVE_B 5 /* dquot is active (dquot_release not called) */ |
257 | #define DQ_LASTSET_B 6 /* Following 6 bits (see QIF_) are reserved\ | ||
258 | * for the mask of entries set via SETQUOTA\ | ||
259 | * quotactl. They are set under dq_data_lock\ | ||
260 | * and the quota format handling dquot can\ | ||
261 | * clear them when it sees fit. */ | ||
252 | 262 | ||
253 | struct dquot { | 263 | struct dquot { |
254 | struct hlist_node dq_hash; /* Hash list in memory */ | 264 | struct hlist_node dq_hash; /* Hash list in memory */ |
@@ -287,11 +297,13 @@ struct dquot_operations { | |||
287 | int (*initialize) (struct inode *, int); | 297 | int (*initialize) (struct inode *, int); |
288 | int (*drop) (struct inode *); | 298 | int (*drop) (struct inode *); |
289 | int (*alloc_space) (struct inode *, qsize_t, int); | 299 | int (*alloc_space) (struct inode *, qsize_t, int); |
290 | int (*alloc_inode) (const struct inode *, unsigned long); | 300 | int (*alloc_inode) (const struct inode *, qsize_t); |
291 | int (*free_space) (struct inode *, qsize_t); | 301 | int (*free_space) (struct inode *, qsize_t); |
292 | int (*free_inode) (const struct inode *, unsigned long); | 302 | int (*free_inode) (const struct inode *, qsize_t); |
293 | int (*transfer) (struct inode *, struct iattr *); | 303 | int (*transfer) (struct inode *, struct iattr *); |
294 | int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ | 304 | int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ |
305 | struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */ | ||
306 | void (*destroy_dquot)(struct dquot *); /* Free memory for dquot */ | ||
295 | int (*acquire_dquot) (struct dquot *); /* Quota is going to be created on disk */ | 307 | int (*acquire_dquot) (struct dquot *); /* Quota is going to be created on disk */ |
296 | int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ | 308 | int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ |
297 | int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ | 309 | int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ |
@@ -320,12 +332,42 @@ struct quota_format_type { | |||
320 | struct quota_format_type *qf_next; | 332 | struct quota_format_type *qf_next; |
321 | }; | 333 | }; |
322 | 334 | ||
323 | #define DQUOT_USR_ENABLED 0x01 /* User diskquotas enabled */ | 335 | /* Quota state flags - they actually come in two flavors - for users and groups */ |
324 | #define DQUOT_GRP_ENABLED 0x02 /* Group diskquotas enabled */ | 336 | enum { |
325 | #define DQUOT_USR_SUSPENDED 0x04 /* User diskquotas are off, but | 337 | _DQUOT_USAGE_ENABLED = 0, /* Track disk usage for users */ |
338 | _DQUOT_LIMITS_ENABLED, /* Enforce quota limits for users */ | ||
339 | _DQUOT_SUSPENDED, /* User diskquotas are off, but | ||
326 | * we have necessary info in | 340 | * we have necessary info in |
327 | * memory to turn them on */ | 341 | * memory to turn them on */ |
328 | #define DQUOT_GRP_SUSPENDED 0x08 /* The same for group quotas */ | 342 | _DQUOT_STATE_FLAGS |
343 | }; | ||
344 | #define DQUOT_USAGE_ENABLED (1 << _DQUOT_USAGE_ENABLED) | ||
345 | #define DQUOT_LIMITS_ENABLED (1 << _DQUOT_LIMITS_ENABLED) | ||
346 | #define DQUOT_SUSPENDED (1 << _DQUOT_SUSPENDED) | ||
347 | #define DQUOT_STATE_FLAGS (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED | \ | ||
348 | DQUOT_SUSPENDED) | ||
349 | /* Other quota flags */ | ||
350 | #define DQUOT_QUOTA_SYS_FILE (1 << 6) /* Quota file is a special | ||
351 | * system file and user cannot | ||
352 | * touch it. Filesystem is | ||
353 | * responsible for setting | ||
354 | * S_NOQUOTA, S_NOATIME flags | ||
355 | */ | ||
356 | #define DQUOT_NEGATIVE_USAGE (1 << 7) /* Allow negative quota usage */ | ||
357 | |||
358 | static inline unsigned int dquot_state_flag(unsigned int flags, int type) | ||
359 | { | ||
360 | if (type == USRQUOTA) | ||
361 | return flags; | ||
362 | return flags << _DQUOT_STATE_FLAGS; | ||
363 | } | ||
364 | |||
365 | static inline unsigned int dquot_generic_flag(unsigned int flags, int type) | ||
366 | { | ||
367 | if (type == USRQUOTA) | ||
368 | return flags; | ||
369 | return flags >> _DQUOT_STATE_FLAGS; | ||
370 | } | ||
329 | 371 | ||
330 | struct quota_info { | 372 | struct quota_info { |
331 | unsigned int flags; /* Flags for diskquotas on this device */ | 373 | unsigned int flags; /* Flags for diskquotas on this device */ |
diff --git a/include/linux/quotaio_v1.h b/include/linux/quotaio_v1.h deleted file mode 100644 index 746654b5de70..000000000000 --- a/include/linux/quotaio_v1.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #ifndef _LINUX_QUOTAIO_V1_H | ||
2 | #define _LINUX_QUOTAIO_V1_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* | ||
7 | * The following constants define the amount of time given a user | ||
8 | * before the soft limits are treated as hard limits (usually resulting | ||
9 | * in an allocation failure). The timer is started when the user crosses | ||
10 | * their soft limit, it is reset when they go below their soft limit. | ||
11 | */ | ||
12 | #define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */ | ||
13 | #define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */ | ||
14 | |||
15 | /* | ||
16 | * The following structure defines the format of the disk quota file | ||
17 | * (as it appears on disk) - the file is an array of these structures | ||
18 | * indexed by user or group number. | ||
19 | */ | ||
20 | struct v1_disk_dqblk { | ||
21 | __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ | ||
22 | __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ | ||
23 | __u32 dqb_curblocks; /* current block count */ | ||
24 | __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | ||
25 | __u32 dqb_isoftlimit; /* preferred inode limit */ | ||
26 | __u32 dqb_curinodes; /* current # allocated inodes */ | ||
27 | time_t dqb_btime; /* time limit for excessive disk use */ | ||
28 | time_t dqb_itime; /* time limit for excessive inode use */ | ||
29 | }; | ||
30 | |||
31 | #define v1_dqoff(UID) ((loff_t)((UID) * sizeof (struct v1_disk_dqblk))) | ||
32 | |||
33 | #endif /* _LINUX_QUOTAIO_V1_H */ | ||
diff --git a/include/linux/quotaio_v2.h b/include/linux/quotaio_v2.h deleted file mode 100644 index 303d7cbe30d4..000000000000 --- a/include/linux/quotaio_v2.h +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions of structures for vfsv0 quota format | ||
3 | */ | ||
4 | |||
5 | #ifndef _LINUX_QUOTAIO_V2_H | ||
6 | #define _LINUX_QUOTAIO_V2_H | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | #include <linux/quota.h> | ||
10 | |||
11 | /* | ||
12 | * Definitions of magics and versions of current quota files | ||
13 | */ | ||
14 | #define V2_INITQMAGICS {\ | ||
15 | 0xd9c01f11, /* USRQUOTA */\ | ||
16 | 0xd9c01927 /* GRPQUOTA */\ | ||
17 | } | ||
18 | |||
19 | #define V2_INITQVERSIONS {\ | ||
20 | 0, /* USRQUOTA */\ | ||
21 | 0 /* GRPQUOTA */\ | ||
22 | } | ||
23 | |||
24 | /* | ||
25 | * The following structure defines the format of the disk quota file | ||
26 | * (as it appears on disk) - the file is a radix tree whose leaves point | ||
27 | * to blocks of these structures. | ||
28 | */ | ||
29 | struct v2_disk_dqblk { | ||
30 | __le32 dqb_id; /* id this quota applies to */ | ||
31 | __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | ||
32 | __le32 dqb_isoftlimit; /* preferred inode limit */ | ||
33 | __le32 dqb_curinodes; /* current # allocated inodes */ | ||
34 | __le32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ | ||
35 | __le32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ | ||
36 | __le64 dqb_curspace; /* current space occupied (in bytes) */ | ||
37 | __le64 dqb_btime; /* time limit for excessive disk use */ | ||
38 | __le64 dqb_itime; /* time limit for excessive inode use */ | ||
39 | }; | ||
40 | |||
41 | /* | ||
42 | * Here are header structures as written on disk and their in-memory copies | ||
43 | */ | ||
44 | /* First generic header */ | ||
45 | struct v2_disk_dqheader { | ||
46 | __le32 dqh_magic; /* Magic number identifying file */ | ||
47 | __le32 dqh_version; /* File version */ | ||
48 | }; | ||
49 | |||
50 | /* Header with type and version specific information */ | ||
51 | struct v2_disk_dqinfo { | ||
52 | __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ | ||
53 | __le32 dqi_igrace; /* Time before inode soft limit becomes hard limit */ | ||
54 | __le32 dqi_flags; /* Flags for quotafile (DQF_*) */ | ||
55 | __le32 dqi_blocks; /* Number of blocks in file */ | ||
56 | __le32 dqi_free_blk; /* Number of first free block in the list */ | ||
57 | __le32 dqi_free_entry; /* Number of block with at least one free entry */ | ||
58 | }; | ||
59 | |||
60 | /* | ||
61 | * Structure of header of block with quota structures. It is padded to 16 bytes so | ||
62 | * there will be space for exactly 21 quota-entries in a block | ||
63 | */ | ||
64 | struct v2_disk_dqdbheader { | ||
65 | __le32 dqdh_next_free; /* Number of next block with free entry */ | ||
66 | __le32 dqdh_prev_free; /* Number of previous block with free entry */ | ||
67 | __le16 dqdh_entries; /* Number of valid entries in block */ | ||
68 | __le16 dqdh_pad1; | ||
69 | __le32 dqdh_pad2; | ||
70 | }; | ||
71 | |||
72 | #define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ | ||
73 | #define V2_DQBLKSIZE_BITS 10 | ||
74 | #define V2_DQBLKSIZE (1 << V2_DQBLKSIZE_BITS) /* Size of block with quota structures */ | ||
75 | #define V2_DQTREEOFF 1 /* Offset of tree in file in blocks */ | ||
76 | #define V2_DQTREEDEPTH 4 /* Depth of quota tree */ | ||
77 | #define V2_DQSTRINBLK ((V2_DQBLKSIZE - sizeof(struct v2_disk_dqdbheader)) / sizeof(struct v2_disk_dqblk)) /* Number of entries in one blocks */ | ||
78 | |||
79 | #endif /* _LINUX_QUOTAIO_V2_H */ | ||
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index a558a4c1d35a..21b781a3350f 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -24,12 +24,21 @@ void sync_dquots(struct super_block *sb, int type); | |||
24 | 24 | ||
25 | int dquot_initialize(struct inode *inode, int type); | 25 | int dquot_initialize(struct inode *inode, int type); |
26 | int dquot_drop(struct inode *inode); | 26 | int dquot_drop(struct inode *inode); |
27 | int dquot_drop_locked(struct inode *inode); | ||
28 | struct dquot *dqget(struct super_block *sb, unsigned int id, int type); | ||
29 | void dqput(struct dquot *dquot); | ||
30 | int dquot_is_cached(struct super_block *sb, unsigned int id, int type); | ||
31 | int dquot_scan_active(struct super_block *sb, | ||
32 | int (*fn)(struct dquot *dquot, unsigned long priv), | ||
33 | unsigned long priv); | ||
34 | struct dquot *dquot_alloc(struct super_block *sb, int type); | ||
35 | void dquot_destroy(struct dquot *dquot); | ||
27 | 36 | ||
28 | int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); | 37 | int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); |
29 | int dquot_alloc_inode(const struct inode *inode, unsigned long number); | 38 | int dquot_alloc_inode(const struct inode *inode, qsize_t number); |
30 | 39 | ||
31 | int dquot_free_space(struct inode *inode, qsize_t number); | 40 | int dquot_free_space(struct inode *inode, qsize_t number); |
32 | int dquot_free_inode(const struct inode *inode, unsigned long number); | 41 | int dquot_free_inode(const struct inode *inode, qsize_t number); |
33 | 42 | ||
34 | int dquot_transfer(struct inode *inode, struct iattr *iattr); | 43 | int dquot_transfer(struct inode *inode, struct iattr *iattr); |
35 | int dquot_commit(struct dquot *dquot); | 44 | int dquot_commit(struct dquot *dquot); |
@@ -40,11 +49,14 @@ int dquot_mark_dquot_dirty(struct dquot *dquot); | |||
40 | 49 | ||
41 | int vfs_quota_on(struct super_block *sb, int type, int format_id, | 50 | int vfs_quota_on(struct super_block *sb, int type, int format_id, |
42 | char *path, int remount); | 51 | char *path, int remount); |
52 | int vfs_quota_enable(struct inode *inode, int type, int format_id, | ||
53 | unsigned int flags); | ||
43 | int vfs_quota_on_path(struct super_block *sb, int type, int format_id, | 54 | int vfs_quota_on_path(struct super_block *sb, int type, int format_id, |
44 | struct path *path); | 55 | struct path *path); |
45 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, | 56 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, |
46 | int format_id, int type); | 57 | int format_id, int type); |
47 | int vfs_quota_off(struct super_block *sb, int type, int remount); | 58 | int vfs_quota_off(struct super_block *sb, int type, int remount); |
59 | int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags); | ||
48 | int vfs_quota_sync(struct super_block *sb, int type); | 60 | int vfs_quota_sync(struct super_block *sb, int type); |
49 | int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 61 | int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
50 | int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 62 | int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
@@ -64,24 +76,22 @@ static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) | |||
64 | * Functions for checking status of quota | 76 | * Functions for checking status of quota |
65 | */ | 77 | */ |
66 | 78 | ||
67 | static inline int sb_has_quota_enabled(struct super_block *sb, int type) | 79 | static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type) |
68 | { | 80 | { |
69 | if (type == USRQUOTA) | 81 | return sb_dqopt(sb)->flags & |
70 | return sb_dqopt(sb)->flags & DQUOT_USR_ENABLED; | 82 | dquot_state_flag(DQUOT_USAGE_ENABLED, type); |
71 | return sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED; | ||
72 | } | 83 | } |
73 | 84 | ||
74 | static inline int sb_any_quota_enabled(struct super_block *sb) | 85 | static inline int sb_has_quota_limits_enabled(struct super_block *sb, int type) |
75 | { | 86 | { |
76 | return sb_has_quota_enabled(sb, USRQUOTA) || | 87 | return sb_dqopt(sb)->flags & |
77 | sb_has_quota_enabled(sb, GRPQUOTA); | 88 | dquot_state_flag(DQUOT_LIMITS_ENABLED, type); |
78 | } | 89 | } |
79 | 90 | ||
80 | static inline int sb_has_quota_suspended(struct super_block *sb, int type) | 91 | static inline int sb_has_quota_suspended(struct super_block *sb, int type) |
81 | { | 92 | { |
82 | if (type == USRQUOTA) | 93 | return sb_dqopt(sb)->flags & |
83 | return sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED; | 94 | dquot_state_flag(DQUOT_SUSPENDED, type); |
84 | return sb_dqopt(sb)->flags & DQUOT_GRP_SUSPENDED; | ||
85 | } | 95 | } |
86 | 96 | ||
87 | static inline int sb_any_quota_suspended(struct super_block *sb) | 97 | static inline int sb_any_quota_suspended(struct super_block *sb) |
@@ -90,6 +100,31 @@ static inline int sb_any_quota_suspended(struct super_block *sb) | |||
90 | sb_has_quota_suspended(sb, GRPQUOTA); | 100 | sb_has_quota_suspended(sb, GRPQUOTA); |
91 | } | 101 | } |
92 | 102 | ||
103 | /* Does kernel know about any quota information for given sb + type? */ | ||
104 | static inline int sb_has_quota_loaded(struct super_block *sb, int type) | ||
105 | { | ||
106 | /* Currently if anything is on, then quota usage is on as well */ | ||
107 | return sb_has_quota_usage_enabled(sb, type); | ||
108 | } | ||
109 | |||
110 | static inline int sb_any_quota_loaded(struct super_block *sb) | ||
111 | { | ||
112 | return sb_has_quota_loaded(sb, USRQUOTA) || | ||
113 | sb_has_quota_loaded(sb, GRPQUOTA); | ||
114 | } | ||
115 | |||
116 | static inline int sb_has_quota_active(struct super_block *sb, int type) | ||
117 | { | ||
118 | return sb_has_quota_loaded(sb, type) && | ||
119 | !sb_has_quota_suspended(sb, type); | ||
120 | } | ||
121 | |||
122 | static inline int sb_any_quota_active(struct super_block *sb) | ||
123 | { | ||
124 | return sb_has_quota_active(sb, USRQUOTA) || | ||
125 | sb_has_quota_active(sb, GRPQUOTA); | ||
126 | } | ||
127 | |||
93 | /* | 128 | /* |
94 | * Operations supported for diskquotas. | 129 | * Operations supported for diskquotas. |
95 | */ | 130 | */ |
@@ -104,7 +139,7 @@ extern struct quotactl_ops vfs_quotactl_ops; | |||
104 | static inline void vfs_dq_init(struct inode *inode) | 139 | static inline void vfs_dq_init(struct inode *inode) |
105 | { | 140 | { |
106 | BUG_ON(!inode->i_sb); | 141 | BUG_ON(!inode->i_sb); |
107 | if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode)) | 142 | if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode)) |
108 | inode->i_sb->dq_op->initialize(inode, -1); | 143 | inode->i_sb->dq_op->initialize(inode, -1); |
109 | } | 144 | } |
110 | 145 | ||
@@ -112,7 +147,7 @@ static inline void vfs_dq_init(struct inode *inode) | |||
112 | * a transaction (deadlocks possible otherwise) */ | 147 | * a transaction (deadlocks possible otherwise) */ |
113 | static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) | 148 | static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) |
114 | { | 149 | { |
115 | if (sb_any_quota_enabled(inode->i_sb)) { | 150 | if (sb_any_quota_active(inode->i_sb)) { |
116 | /* Used space is updated in alloc_space() */ | 151 | /* Used space is updated in alloc_space() */ |
117 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA) | 152 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA) |
118 | return 1; | 153 | return 1; |
@@ -132,7 +167,7 @@ static inline int vfs_dq_prealloc_space(struct inode *inode, qsize_t nr) | |||
132 | 167 | ||
133 | static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) | 168 | static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) |
134 | { | 169 | { |
135 | if (sb_any_quota_enabled(inode->i_sb)) { | 170 | if (sb_any_quota_active(inode->i_sb)) { |
136 | /* Used space is updated in alloc_space() */ | 171 | /* Used space is updated in alloc_space() */ |
137 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA) | 172 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA) |
138 | return 1; | 173 | return 1; |
@@ -152,7 +187,7 @@ static inline int vfs_dq_alloc_space(struct inode *inode, qsize_t nr) | |||
152 | 187 | ||
153 | static inline int vfs_dq_alloc_inode(struct inode *inode) | 188 | static inline int vfs_dq_alloc_inode(struct inode *inode) |
154 | { | 189 | { |
155 | if (sb_any_quota_enabled(inode->i_sb)) { | 190 | if (sb_any_quota_active(inode->i_sb)) { |
156 | vfs_dq_init(inode); | 191 | vfs_dq_init(inode); |
157 | if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) | 192 | if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) |
158 | return 1; | 193 | return 1; |
@@ -162,7 +197,7 @@ static inline int vfs_dq_alloc_inode(struct inode *inode) | |||
162 | 197 | ||
163 | static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) | 198 | static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) |
164 | { | 199 | { |
165 | if (sb_any_quota_enabled(inode->i_sb)) | 200 | if (sb_any_quota_active(inode->i_sb)) |
166 | inode->i_sb->dq_op->free_space(inode, nr); | 201 | inode->i_sb->dq_op->free_space(inode, nr); |
167 | else | 202 | else |
168 | inode_sub_bytes(inode, nr); | 203 | inode_sub_bytes(inode, nr); |
@@ -176,7 +211,7 @@ static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr) | |||
176 | 211 | ||
177 | static inline void vfs_dq_free_inode(struct inode *inode) | 212 | static inline void vfs_dq_free_inode(struct inode *inode) |
178 | { | 213 | { |
179 | if (sb_any_quota_enabled(inode->i_sb)) | 214 | if (sb_any_quota_active(inode->i_sb)) |
180 | inode->i_sb->dq_op->free_inode(inode, 1); | 215 | inode->i_sb->dq_op->free_inode(inode, 1); |
181 | } | 216 | } |
182 | 217 | ||
@@ -197,12 +232,12 @@ static inline int vfs_dq_off(struct super_block *sb, int remount) | |||
197 | 232 | ||
198 | #else | 233 | #else |
199 | 234 | ||
200 | static inline int sb_has_quota_enabled(struct super_block *sb, int type) | 235 | static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type) |
201 | { | 236 | { |
202 | return 0; | 237 | return 0; |
203 | } | 238 | } |
204 | 239 | ||
205 | static inline int sb_any_quota_enabled(struct super_block *sb) | 240 | static inline int sb_has_quota_limits_enabled(struct super_block *sb, int type) |
206 | { | 241 | { |
207 | return 0; | 242 | return 0; |
208 | } | 243 | } |
@@ -217,6 +252,27 @@ static inline int sb_any_quota_suspended(struct super_block *sb) | |||
217 | return 0; | 252 | return 0; |
218 | } | 253 | } |
219 | 254 | ||
255 | /* Does kernel know about any quota information for given sb + type? */ | ||
256 | static inline int sb_has_quota_loaded(struct super_block *sb, int type) | ||
257 | { | ||
258 | return 0; | ||
259 | } | ||
260 | |||
261 | static inline int sb_any_quota_loaded(struct super_block *sb) | ||
262 | { | ||
263 | return 0; | ||
264 | } | ||
265 | |||
266 | static inline int sb_has_quota_active(struct super_block *sb, int type) | ||
267 | { | ||
268 | return 0; | ||
269 | } | ||
270 | |||
271 | static inline int sb_any_quota_active(struct super_block *sb) | ||
272 | { | ||
273 | return 0; | ||
274 | } | ||
275 | |||
220 | /* | 276 | /* |
221 | * NO-OP when quota not configured. | 277 | * NO-OP when quota not configured. |
222 | */ | 278 | */ |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index a916c6660dfa..355f6e80db0d 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -136,7 +136,7 @@ do { \ | |||
136 | */ | 136 | */ |
137 | static inline void *radix_tree_deref_slot(void **pslot) | 137 | static inline void *radix_tree_deref_slot(void **pslot) |
138 | { | 138 | { |
139 | void *ret = *pslot; | 139 | void *ret = rcu_dereference(*pslot); |
140 | if (unlikely(radix_tree_is_indirect_ptr(ret))) | 140 | if (unlikely(radix_tree_is_indirect_ptr(ret))) |
141 | ret = RADIX_TREE_RETRY; | 141 | ret = RADIX_TREE_RETRY; |
142 | return ret; | 142 | return ret; |
diff --git a/include/linux/random.h b/include/linux/random.h index adbf3bd3c6b3..407ea3646f8f 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -45,56 +45,6 @@ struct rand_pool_info { | |||
45 | 45 | ||
46 | extern void rand_initialize_irq(int irq); | 46 | extern void rand_initialize_irq(int irq); |
47 | 47 | ||
48 | struct timer_rand_state; | ||
49 | #ifndef CONFIG_SPARSE_IRQ | ||
50 | |||
51 | extern struct timer_rand_state *irq_timer_state[]; | ||
52 | |||
53 | static inline struct timer_rand_state *get_timer_rand_state(unsigned int irq) | ||
54 | { | ||
55 | if (irq >= nr_irqs) | ||
56 | return NULL; | ||
57 | |||
58 | return irq_timer_state[irq]; | ||
59 | } | ||
60 | |||
61 | static inline void set_timer_rand_state(unsigned int irq, struct timer_rand_state *state) | ||
62 | { | ||
63 | if (irq >= nr_irqs) | ||
64 | return; | ||
65 | |||
66 | irq_timer_state[irq] = state; | ||
67 | } | ||
68 | |||
69 | #else | ||
70 | |||
71 | #include <linux/irq.h> | ||
72 | static inline struct timer_rand_state *get_timer_rand_state(unsigned int irq) | ||
73 | { | ||
74 | struct irq_desc *desc; | ||
75 | |||
76 | desc = irq_to_desc(irq); | ||
77 | |||
78 | if (!desc) | ||
79 | return NULL; | ||
80 | |||
81 | return desc->timer_rand_state; | ||
82 | } | ||
83 | |||
84 | static inline void set_timer_rand_state(unsigned int irq, struct timer_rand_state *state) | ||
85 | { | ||
86 | struct irq_desc *desc; | ||
87 | |||
88 | desc = irq_to_desc(irq); | ||
89 | |||
90 | if (!desc) | ||
91 | return; | ||
92 | |||
93 | desc->timer_rand_state = state; | ||
94 | } | ||
95 | #endif | ||
96 | |||
97 | |||
98 | extern void add_input_randomness(unsigned int type, unsigned int code, | 48 | extern void add_input_randomness(unsigned int type, unsigned int code, |
99 | unsigned int value); | 49 | unsigned int value); |
100 | extern void add_interrupt_randomness(int irq); | 50 | extern void add_interrupt_randomness(int irq); |
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h index 301dda829e37..f3f697df1d71 100644 --- a/include/linux/rcuclassic.h +++ b/include/linux/rcuclassic.h | |||
@@ -59,8 +59,8 @@ struct rcu_ctrlblk { | |||
59 | int signaled; | 59 | int signaled; |
60 | 60 | ||
61 | spinlock_t lock ____cacheline_internodealigned_in_smp; | 61 | spinlock_t lock ____cacheline_internodealigned_in_smp; |
62 | cpumask_t cpumask; /* CPUs that need to switch in order */ | 62 | DECLARE_BITMAP(cpumask, NR_CPUS); /* CPUs that need to switch for */ |
63 | /* for current batch to proceed. */ | 63 | /* current batch to proceed. */ |
64 | } ____cacheline_internodealigned_in_smp; | 64 | } ____cacheline_internodealigned_in_smp; |
65 | 65 | ||
66 | /* Is batch a before batch b ? */ | 66 | /* Is batch a before batch b ? */ |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 91f597ad6acc..4046b75563c1 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -145,6 +145,8 @@ struct rtc_class_ops { | |||
145 | int (*irq_set_state)(struct device *, int enabled); | 145 | int (*irq_set_state)(struct device *, int enabled); |
146 | int (*irq_set_freq)(struct device *, int freq); | 146 | int (*irq_set_freq)(struct device *, int freq); |
147 | int (*read_callback)(struct device *, int data); | 147 | int (*read_callback)(struct device *, int data); |
148 | int (*alarm_irq_enable)(struct device *, unsigned int enabled); | ||
149 | int (*update_irq_enable)(struct device *, unsigned int enabled); | ||
148 | }; | 150 | }; |
149 | 151 | ||
150 | #define RTC_DEVICE_NAME_SIZE 20 | 152 | #define RTC_DEVICE_NAME_SIZE 20 |
@@ -181,7 +183,7 @@ struct rtc_device | |||
181 | struct timer_list uie_timer; | 183 | struct timer_list uie_timer; |
182 | /* Those fields are protected by rtc->irq_lock */ | 184 | /* Those fields are protected by rtc->irq_lock */ |
183 | unsigned int oldsecs; | 185 | unsigned int oldsecs; |
184 | unsigned int irq_active:1; | 186 | unsigned int uie_irq_active:1; |
185 | unsigned int stop_uie_polling:1; | 187 | unsigned int stop_uie_polling:1; |
186 | unsigned int uie_task_active:1; | 188 | unsigned int uie_task_active:1; |
187 | unsigned int uie_timer_active:1; | 189 | unsigned int uie_timer_active:1; |
@@ -216,6 +218,10 @@ extern int rtc_irq_set_state(struct rtc_device *rtc, | |||
216 | struct rtc_task *task, int enabled); | 218 | struct rtc_task *task, int enabled); |
217 | extern int rtc_irq_set_freq(struct rtc_device *rtc, | 219 | extern int rtc_irq_set_freq(struct rtc_device *rtc, |
218 | struct rtc_task *task, int freq); | 220 | struct rtc_task *task, int freq); |
221 | extern int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled); | ||
222 | extern int rtc_alarm_irq_enable(struct rtc_device *rtc, unsigned int enabled); | ||
223 | extern int rtc_dev_update_irq_enable_emul(struct rtc_device *rtc, | ||
224 | unsigned int enabled); | ||
219 | 225 | ||
220 | typedef struct rtc_task { | 226 | typedef struct rtc_task { |
221 | void (*func)(void *private_data); | 227 | void (*func)(void *private_data); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8395e715809d..38a3f4b15394 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -250,7 +250,7 @@ extern void init_idle_bootup_task(struct task_struct *idle); | |||
250 | extern int runqueue_is_locked(void); | 250 | extern int runqueue_is_locked(void); |
251 | extern void task_rq_unlock_wait(struct task_struct *p); | 251 | extern void task_rq_unlock_wait(struct task_struct *p); |
252 | 252 | ||
253 | extern cpumask_t nohz_cpu_mask; | 253 | extern cpumask_var_t nohz_cpu_mask; |
254 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 254 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
255 | extern int select_nohz_load_balancer(int cpu); | 255 | extern int select_nohz_load_balancer(int cpu); |
256 | #else | 256 | #else |
@@ -284,7 +284,6 @@ long io_schedule_timeout(long timeout); | |||
284 | 284 | ||
285 | extern void cpu_init (void); | 285 | extern void cpu_init (void); |
286 | extern void trap_init(void); | 286 | extern void trap_init(void); |
287 | extern void account_process_tick(struct task_struct *task, int user); | ||
288 | extern void update_process_times(int user); | 287 | extern void update_process_times(int user); |
289 | extern void scheduler_tick(void); | 288 | extern void scheduler_tick(void); |
290 | 289 | ||
@@ -758,20 +757,51 @@ enum cpu_idle_type { | |||
758 | #define SD_SERIALIZE 1024 /* Only a single load balancing instance */ | 757 | #define SD_SERIALIZE 1024 /* Only a single load balancing instance */ |
759 | #define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */ | 758 | #define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */ |
760 | 759 | ||
761 | #define BALANCE_FOR_MC_POWER \ | 760 | enum powersavings_balance_level { |
762 | (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) | 761 | POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ |
762 | POWERSAVINGS_BALANCE_BASIC, /* Fill one thread/core/package | ||
763 | * first for long running threads | ||
764 | */ | ||
765 | POWERSAVINGS_BALANCE_WAKEUP, /* Also bias task wakeups to semi-idle | ||
766 | * cpu package for power savings | ||
767 | */ | ||
768 | MAX_POWERSAVINGS_BALANCE_LEVELS | ||
769 | }; | ||
763 | 770 | ||
764 | #define BALANCE_FOR_PKG_POWER \ | 771 | extern int sched_mc_power_savings, sched_smt_power_savings; |
765 | ((sched_mc_power_savings || sched_smt_power_savings) ? \ | ||
766 | SD_POWERSAVINGS_BALANCE : 0) | ||
767 | 772 | ||
768 | #define test_sd_parent(sd, flag) ((sd->parent && \ | 773 | static inline int sd_balance_for_mc_power(void) |
769 | (sd->parent->flags & flag)) ? 1 : 0) | 774 | { |
775 | if (sched_smt_power_savings) | ||
776 | return SD_POWERSAVINGS_BALANCE; | ||
770 | 777 | ||
778 | return 0; | ||
779 | } | ||
780 | |||
781 | static inline int sd_balance_for_package_power(void) | ||
782 | { | ||
783 | if (sched_mc_power_savings | sched_smt_power_savings) | ||
784 | return SD_POWERSAVINGS_BALANCE; | ||
785 | |||
786 | return 0; | ||
787 | } | ||
788 | |||
789 | /* | ||
790 | * Optimise SD flags for power savings: | ||
791 | * SD_BALANCE_NEWIDLE helps agressive task consolidation and power savings. | ||
792 | * Keep default SD flags if sched_{smt,mc}_power_saving=0 | ||
793 | */ | ||
794 | |||
795 | static inline int sd_power_saving_flags(void) | ||
796 | { | ||
797 | if (sched_mc_power_savings | sched_smt_power_savings) | ||
798 | return SD_BALANCE_NEWIDLE; | ||
799 | |||
800 | return 0; | ||
801 | } | ||
771 | 802 | ||
772 | struct sched_group { | 803 | struct sched_group { |
773 | struct sched_group *next; /* Must be a circular list */ | 804 | struct sched_group *next; /* Must be a circular list */ |
774 | cpumask_t cpumask; | ||
775 | 805 | ||
776 | /* | 806 | /* |
777 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a | 807 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a |
@@ -784,8 +814,15 @@ struct sched_group { | |||
784 | * (see include/linux/reciprocal_div.h) | 814 | * (see include/linux/reciprocal_div.h) |
785 | */ | 815 | */ |
786 | u32 reciprocal_cpu_power; | 816 | u32 reciprocal_cpu_power; |
817 | |||
818 | unsigned long cpumask[]; | ||
787 | }; | 819 | }; |
788 | 820 | ||
821 | static inline struct cpumask *sched_group_cpus(struct sched_group *sg) | ||
822 | { | ||
823 | return to_cpumask(sg->cpumask); | ||
824 | } | ||
825 | |||
789 | enum sched_domain_level { | 826 | enum sched_domain_level { |
790 | SD_LV_NONE = 0, | 827 | SD_LV_NONE = 0, |
791 | SD_LV_SIBLING, | 828 | SD_LV_SIBLING, |
@@ -809,7 +846,6 @@ struct sched_domain { | |||
809 | struct sched_domain *parent; /* top domain must be null terminated */ | 846 | struct sched_domain *parent; /* top domain must be null terminated */ |
810 | struct sched_domain *child; /* bottom domain must be null terminated */ | 847 | struct sched_domain *child; /* bottom domain must be null terminated */ |
811 | struct sched_group *groups; /* the balancing groups of the domain */ | 848 | struct sched_group *groups; /* the balancing groups of the domain */ |
812 | cpumask_t span; /* span of all CPUs in this domain */ | ||
813 | unsigned long min_interval; /* Minimum balance interval ms */ | 849 | unsigned long min_interval; /* Minimum balance interval ms */ |
814 | unsigned long max_interval; /* Maximum balance interval ms */ | 850 | unsigned long max_interval; /* Maximum balance interval ms */ |
815 | unsigned int busy_factor; /* less balancing by factor if busy */ | 851 | unsigned int busy_factor; /* less balancing by factor if busy */ |
@@ -864,18 +900,35 @@ struct sched_domain { | |||
864 | #ifdef CONFIG_SCHED_DEBUG | 900 | #ifdef CONFIG_SCHED_DEBUG |
865 | char *name; | 901 | char *name; |
866 | #endif | 902 | #endif |
903 | |||
904 | /* span of all CPUs in this domain */ | ||
905 | unsigned long span[]; | ||
867 | }; | 906 | }; |
868 | 907 | ||
869 | extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | 908 | static inline struct cpumask *sched_domain_span(struct sched_domain *sd) |
909 | { | ||
910 | return to_cpumask(sd->span); | ||
911 | } | ||
912 | |||
913 | extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, | ||
870 | struct sched_domain_attr *dattr_new); | 914 | struct sched_domain_attr *dattr_new); |
871 | extern int arch_reinit_sched_domains(void); | 915 | extern int arch_reinit_sched_domains(void); |
872 | 916 | ||
917 | /* Test a flag in parent sched domain */ | ||
918 | static inline int test_sd_parent(struct sched_domain *sd, int flag) | ||
919 | { | ||
920 | if (sd->parent && (sd->parent->flags & flag)) | ||
921 | return 1; | ||
922 | |||
923 | return 0; | ||
924 | } | ||
925 | |||
873 | #else /* CONFIG_SMP */ | 926 | #else /* CONFIG_SMP */ |
874 | 927 | ||
875 | struct sched_domain_attr; | 928 | struct sched_domain_attr; |
876 | 929 | ||
877 | static inline void | 930 | static inline void |
878 | partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | 931 | partition_sched_domains(int ndoms_new, struct cpumask *doms_new, |
879 | struct sched_domain_attr *dattr_new) | 932 | struct sched_domain_attr *dattr_new) |
880 | { | 933 | { |
881 | } | 934 | } |
@@ -926,7 +979,7 @@ struct sched_class { | |||
926 | void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); | 979 | void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); |
927 | 980 | ||
928 | void (*set_cpus_allowed)(struct task_struct *p, | 981 | void (*set_cpus_allowed)(struct task_struct *p, |
929 | const cpumask_t *newmask); | 982 | const struct cpumask *newmask); |
930 | 983 | ||
931 | void (*rq_online)(struct rq *rq); | 984 | void (*rq_online)(struct rq *rq); |
932 | void (*rq_offline)(struct rq *rq); | 985 | void (*rq_offline)(struct rq *rq); |
@@ -1579,12 +1632,12 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1579 | 1632 | ||
1580 | #ifdef CONFIG_SMP | 1633 | #ifdef CONFIG_SMP |
1581 | extern int set_cpus_allowed_ptr(struct task_struct *p, | 1634 | extern int set_cpus_allowed_ptr(struct task_struct *p, |
1582 | const cpumask_t *new_mask); | 1635 | const struct cpumask *new_mask); |
1583 | #else | 1636 | #else |
1584 | static inline int set_cpus_allowed_ptr(struct task_struct *p, | 1637 | static inline int set_cpus_allowed_ptr(struct task_struct *p, |
1585 | const cpumask_t *new_mask) | 1638 | const struct cpumask *new_mask) |
1586 | { | 1639 | { |
1587 | if (!cpu_isset(0, *new_mask)) | 1640 | if (!cpumask_test_cpu(0, new_mask)) |
1588 | return -EINVAL; | 1641 | return -EINVAL; |
1589 | return 0; | 1642 | return 0; |
1590 | } | 1643 | } |
@@ -2195,10 +2248,8 @@ __trace_special(void *__tr, void *__data, | |||
2195 | } | 2248 | } |
2196 | #endif | 2249 | #endif |
2197 | 2250 | ||
2198 | extern long sched_setaffinity(pid_t pid, const cpumask_t *new_mask); | 2251 | extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); |
2199 | extern long sched_getaffinity(pid_t pid, cpumask_t *mask); | 2252 | extern long sched_getaffinity(pid_t pid, struct cpumask *mask); |
2200 | |||
2201 | extern int sched_mc_power_savings, sched_smt_power_savings; | ||
2202 | 2253 | ||
2203 | extern void normalize_rt_tasks(void); | 2254 | extern void normalize_rt_tasks(void); |
2204 | 2255 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index f9c390494f18..1f2ab6353c00 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -336,17 +336,37 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
336 | * @dir contains the inode structure of the parent directory of the new link. | 336 | * @dir contains the inode structure of the parent directory of the new link. |
337 | * @new_dentry contains the dentry structure for the new link. | 337 | * @new_dentry contains the dentry structure for the new link. |
338 | * Return 0 if permission is granted. | 338 | * Return 0 if permission is granted. |
339 | * @path_link: | ||
340 | * Check permission before creating a new hard link to a file. | ||
341 | * @old_dentry contains the dentry structure for an existing link | ||
342 | * to the file. | ||
343 | * @new_dir contains the path structure of the parent directory of | ||
344 | * the new link. | ||
345 | * @new_dentry contains the dentry structure for the new link. | ||
346 | * Return 0 if permission is granted. | ||
339 | * @inode_unlink: | 347 | * @inode_unlink: |
340 | * Check the permission to remove a hard link to a file. | 348 | * Check the permission to remove a hard link to a file. |
341 | * @dir contains the inode structure of parent directory of the file. | 349 | * @dir contains the inode structure of parent directory of the file. |
342 | * @dentry contains the dentry structure for file to be unlinked. | 350 | * @dentry contains the dentry structure for file to be unlinked. |
343 | * Return 0 if permission is granted. | 351 | * Return 0 if permission is granted. |
352 | * @path_unlink: | ||
353 | * Check the permission to remove a hard link to a file. | ||
354 | * @dir contains the path structure of parent directory of the file. | ||
355 | * @dentry contains the dentry structure for file to be unlinked. | ||
356 | * Return 0 if permission is granted. | ||
344 | * @inode_symlink: | 357 | * @inode_symlink: |
345 | * Check the permission to create a symbolic link to a file. | 358 | * Check the permission to create a symbolic link to a file. |
346 | * @dir contains the inode structure of parent directory of the symbolic link. | 359 | * @dir contains the inode structure of parent directory of the symbolic link. |
347 | * @dentry contains the dentry structure of the symbolic link. | 360 | * @dentry contains the dentry structure of the symbolic link. |
348 | * @old_name contains the pathname of file. | 361 | * @old_name contains the pathname of file. |
349 | * Return 0 if permission is granted. | 362 | * Return 0 if permission is granted. |
363 | * @path_symlink: | ||
364 | * Check the permission to create a symbolic link to a file. | ||
365 | * @dir contains the path structure of parent directory of | ||
366 | * the symbolic link. | ||
367 | * @dentry contains the dentry structure of the symbolic link. | ||
368 | * @old_name contains the pathname of file. | ||
369 | * Return 0 if permission is granted. | ||
350 | * @inode_mkdir: | 370 | * @inode_mkdir: |
351 | * Check permissions to create a new directory in the existing directory | 371 | * Check permissions to create a new directory in the existing directory |
352 | * associated with inode strcture @dir. | 372 | * associated with inode strcture @dir. |
@@ -354,11 +374,25 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
354 | * @dentry contains the dentry structure of new directory. | 374 | * @dentry contains the dentry structure of new directory. |
355 | * @mode contains the mode of new directory. | 375 | * @mode contains the mode of new directory. |
356 | * Return 0 if permission is granted. | 376 | * Return 0 if permission is granted. |
377 | * @path_mkdir: | ||
378 | * Check permissions to create a new directory in the existing directory | ||
379 | * associated with path strcture @path. | ||
380 | * @dir containst the path structure of parent of the directory | ||
381 | * to be created. | ||
382 | * @dentry contains the dentry structure of new directory. | ||
383 | * @mode contains the mode of new directory. | ||
384 | * Return 0 if permission is granted. | ||
357 | * @inode_rmdir: | 385 | * @inode_rmdir: |
358 | * Check the permission to remove a directory. | 386 | * Check the permission to remove a directory. |
359 | * @dir contains the inode structure of parent of the directory to be removed. | 387 | * @dir contains the inode structure of parent of the directory to be removed. |
360 | * @dentry contains the dentry structure of directory to be removed. | 388 | * @dentry contains the dentry structure of directory to be removed. |
361 | * Return 0 if permission is granted. | 389 | * Return 0 if permission is granted. |
390 | * @path_rmdir: | ||
391 | * Check the permission to remove a directory. | ||
392 | * @dir contains the path structure of parent of the directory to be | ||
393 | * removed. | ||
394 | * @dentry contains the dentry structure of directory to be removed. | ||
395 | * Return 0 if permission is granted. | ||
362 | * @inode_mknod: | 396 | * @inode_mknod: |
363 | * Check permissions when creating a special file (or a socket or a fifo | 397 | * Check permissions when creating a special file (or a socket or a fifo |
364 | * file created via the mknod system call). Note that if mknod operation | 398 | * file created via the mknod system call). Note that if mknod operation |
@@ -369,6 +403,15 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
369 | * @mode contains the mode of the new file. | 403 | * @mode contains the mode of the new file. |
370 | * @dev contains the device number. | 404 | * @dev contains the device number. |
371 | * Return 0 if permission is granted. | 405 | * Return 0 if permission is granted. |
406 | * @path_mknod: | ||
407 | * Check permissions when creating a file. Note that this hook is called | ||
408 | * even if mknod operation is being done for a regular file. | ||
409 | * @dir contains the path structure of parent of the new file. | ||
410 | * @dentry contains the dentry structure of the new file. | ||
411 | * @mode contains the mode of the new file. | ||
412 | * @dev contains the undecoded device number. Use new_decode_dev() to get | ||
413 | * the decoded device number. | ||
414 | * Return 0 if permission is granted. | ||
372 | * @inode_rename: | 415 | * @inode_rename: |
373 | * Check for permission to rename a file or directory. | 416 | * Check for permission to rename a file or directory. |
374 | * @old_dir contains the inode structure for parent of the old link. | 417 | * @old_dir contains the inode structure for parent of the old link. |
@@ -376,6 +419,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
376 | * @new_dir contains the inode structure for parent of the new link. | 419 | * @new_dir contains the inode structure for parent of the new link. |
377 | * @new_dentry contains the dentry structure of the new link. | 420 | * @new_dentry contains the dentry structure of the new link. |
378 | * Return 0 if permission is granted. | 421 | * Return 0 if permission is granted. |
422 | * @path_rename: | ||
423 | * Check for permission to rename a file or directory. | ||
424 | * @old_dir contains the path structure for parent of the old link. | ||
425 | * @old_dentry contains the dentry structure of the old link. | ||
426 | * @new_dir contains the path structure for parent of the new link. | ||
427 | * @new_dentry contains the dentry structure of the new link. | ||
428 | * Return 0 if permission is granted. | ||
379 | * @inode_readlink: | 429 | * @inode_readlink: |
380 | * Check the permission to read the symbolic link. | 430 | * Check the permission to read the symbolic link. |
381 | * @dentry contains the dentry structure for the file link. | 431 | * @dentry contains the dentry structure for the file link. |
@@ -404,6 +454,12 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
404 | * @dentry contains the dentry structure for the file. | 454 | * @dentry contains the dentry structure for the file. |
405 | * @attr is the iattr structure containing the new file attributes. | 455 | * @attr is the iattr structure containing the new file attributes. |
406 | * Return 0 if permission is granted. | 456 | * Return 0 if permission is granted. |
457 | * @path_truncate: | ||
458 | * Check permission before truncating a file. | ||
459 | * @path contains the path structure for the file. | ||
460 | * @length is the new length of the file. | ||
461 | * @time_attrs is the flags passed to do_truncate(). | ||
462 | * Return 0 if permission is granted. | ||
407 | * @inode_getattr: | 463 | * @inode_getattr: |
408 | * Check permission before obtaining file attributes. | 464 | * Check permission before obtaining file attributes. |
409 | * @mnt is the vfsmount where the dentry was looked up | 465 | * @mnt is the vfsmount where the dentry was looked up |
@@ -1336,6 +1392,22 @@ struct security_operations { | |||
1336 | struct super_block *newsb); | 1392 | struct super_block *newsb); |
1337 | int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); | 1393 | int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); |
1338 | 1394 | ||
1395 | #ifdef CONFIG_SECURITY_PATH | ||
1396 | int (*path_unlink) (struct path *dir, struct dentry *dentry); | ||
1397 | int (*path_mkdir) (struct path *dir, struct dentry *dentry, int mode); | ||
1398 | int (*path_rmdir) (struct path *dir, struct dentry *dentry); | ||
1399 | int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode, | ||
1400 | unsigned int dev); | ||
1401 | int (*path_truncate) (struct path *path, loff_t length, | ||
1402 | unsigned int time_attrs); | ||
1403 | int (*path_symlink) (struct path *dir, struct dentry *dentry, | ||
1404 | const char *old_name); | ||
1405 | int (*path_link) (struct dentry *old_dentry, struct path *new_dir, | ||
1406 | struct dentry *new_dentry); | ||
1407 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, | ||
1408 | struct path *new_dir, struct dentry *new_dentry); | ||
1409 | #endif | ||
1410 | |||
1339 | int (*inode_alloc_security) (struct inode *inode); | 1411 | int (*inode_alloc_security) (struct inode *inode); |
1340 | void (*inode_free_security) (struct inode *inode); | 1412 | void (*inode_free_security) (struct inode *inode); |
1341 | int (*inode_init_security) (struct inode *inode, struct inode *dir, | 1413 | int (*inode_init_security) (struct inode *inode, struct inode *dir, |
@@ -2728,6 +2800,71 @@ static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi | |||
2728 | 2800 | ||
2729 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ | 2801 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ |
2730 | 2802 | ||
2803 | #ifdef CONFIG_SECURITY_PATH | ||
2804 | int security_path_unlink(struct path *dir, struct dentry *dentry); | ||
2805 | int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode); | ||
2806 | int security_path_rmdir(struct path *dir, struct dentry *dentry); | ||
2807 | int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, | ||
2808 | unsigned int dev); | ||
2809 | int security_path_truncate(struct path *path, loff_t length, | ||
2810 | unsigned int time_attrs); | ||
2811 | int security_path_symlink(struct path *dir, struct dentry *dentry, | ||
2812 | const char *old_name); | ||
2813 | int security_path_link(struct dentry *old_dentry, struct path *new_dir, | ||
2814 | struct dentry *new_dentry); | ||
2815 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, | ||
2816 | struct path *new_dir, struct dentry *new_dentry); | ||
2817 | #else /* CONFIG_SECURITY_PATH */ | ||
2818 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) | ||
2819 | { | ||
2820 | return 0; | ||
2821 | } | ||
2822 | |||
2823 | static inline int security_path_mkdir(struct path *dir, struct dentry *dentry, | ||
2824 | int mode) | ||
2825 | { | ||
2826 | return 0; | ||
2827 | } | ||
2828 | |||
2829 | static inline int security_path_rmdir(struct path *dir, struct dentry *dentry) | ||
2830 | { | ||
2831 | return 0; | ||
2832 | } | ||
2833 | |||
2834 | static inline int security_path_mknod(struct path *dir, struct dentry *dentry, | ||
2835 | int mode, unsigned int dev) | ||
2836 | { | ||
2837 | return 0; | ||
2838 | } | ||
2839 | |||
2840 | static inline int security_path_truncate(struct path *path, loff_t length, | ||
2841 | unsigned int time_attrs) | ||
2842 | { | ||
2843 | return 0; | ||
2844 | } | ||
2845 | |||
2846 | static inline int security_path_symlink(struct path *dir, struct dentry *dentry, | ||
2847 | const char *old_name) | ||
2848 | { | ||
2849 | return 0; | ||
2850 | } | ||
2851 | |||
2852 | static inline int security_path_link(struct dentry *old_dentry, | ||
2853 | struct path *new_dir, | ||
2854 | struct dentry *new_dentry) | ||
2855 | { | ||
2856 | return 0; | ||
2857 | } | ||
2858 | |||
2859 | static inline int security_path_rename(struct path *old_dir, | ||
2860 | struct dentry *old_dentry, | ||
2861 | struct path *new_dir, | ||
2862 | struct dentry *new_dentry) | ||
2863 | { | ||
2864 | return 0; | ||
2865 | } | ||
2866 | #endif /* CONFIG_SECURITY_PATH */ | ||
2867 | |||
2731 | #ifdef CONFIG_KEYS | 2868 | #ifdef CONFIG_KEYS |
2732 | #ifdef CONFIG_SECURITY | 2869 | #ifdef CONFIG_SECURITY |
2733 | 2870 | ||
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index b3dfa72f13b9..40ea5058c2ec 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -50,10 +50,11 @@ int seq_path(struct seq_file *, struct path *, char *); | |||
50 | int seq_dentry(struct seq_file *, struct dentry *, char *); | 50 | int seq_dentry(struct seq_file *, struct dentry *, char *); |
51 | int seq_path_root(struct seq_file *m, struct path *path, struct path *root, | 51 | int seq_path_root(struct seq_file *m, struct path *path, struct path *root, |
52 | char *esc); | 52 | char *esc); |
53 | int seq_bitmap(struct seq_file *m, unsigned long *bits, unsigned int nr_bits); | 53 | int seq_bitmap(struct seq_file *m, const unsigned long *bits, |
54 | static inline int seq_cpumask(struct seq_file *m, cpumask_t *mask) | 54 | unsigned int nr_bits); |
55 | static inline int seq_cpumask(struct seq_file *m, const struct cpumask *mask) | ||
55 | { | 56 | { |
56 | return seq_bitmap(m, mask->bits, NR_CPUS); | 57 | return seq_bitmap(m, mask->bits, nr_cpu_ids); |
57 | } | 58 | } |
58 | 59 | ||
59 | static inline int seq_nodemask(struct seq_file *m, nodemask_t *mask) | 60 | static inline int seq_nodemask(struct seq_file *m, nodemask_t *mask) |
diff --git a/include/linux/serial.h b/include/linux/serial.h index 1ea8d9265bf6..9136cc5608c3 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -10,8 +10,9 @@ | |||
10 | #ifndef _LINUX_SERIAL_H | 10 | #ifndef _LINUX_SERIAL_H |
11 | #define _LINUX_SERIAL_H | 11 | #define _LINUX_SERIAL_H |
12 | 12 | ||
13 | #ifdef __KERNEL__ | ||
14 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | |||
15 | #ifdef __KERNEL__ | ||
15 | #include <asm/page.h> | 16 | #include <asm/page.h> |
16 | 17 | ||
17 | /* | 18 | /* |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 3d37c94abbc8..d4d2a78ad43e 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -28,6 +28,9 @@ struct plat_serial8250_port { | |||
28 | unsigned char iotype; /* UPIO_* */ | 28 | unsigned char iotype; /* UPIO_* */ |
29 | unsigned char hub6; | 29 | unsigned char hub6; |
30 | upf_t flags; /* UPF_* flags */ | 30 | upf_t flags; /* UPF_* flags */ |
31 | unsigned int type; /* If UPF_FIXED_TYPE */ | ||
32 | unsigned int (*serial_in)(struct uart_port *, int); | ||
33 | void (*serial_out)(struct uart_port *, int, int); | ||
31 | }; | 34 | }; |
32 | 35 | ||
33 | /* | 36 | /* |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index feb3b939ec4b..b4199841f1fc 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -40,7 +40,8 @@ | |||
40 | #define PORT_NS16550A 14 | 40 | #define PORT_NS16550A 14 |
41 | #define PORT_XSCALE 15 | 41 | #define PORT_XSCALE 15 |
42 | #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ | 42 | #define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ |
43 | #define PORT_MAX_8250 16 /* max port ID */ | 43 | #define PORT_OCTEON 17 /* Cavium OCTEON internal UART */ |
44 | #define PORT_MAX_8250 17 /* max port ID */ | ||
44 | 45 | ||
45 | /* | 46 | /* |
46 | * ARM specific type numbers. These are not currently guaranteed | 47 | * ARM specific type numbers. These are not currently guaranteed |
@@ -248,6 +249,8 @@ struct uart_port { | |||
248 | spinlock_t lock; /* port lock */ | 249 | spinlock_t lock; /* port lock */ |
249 | unsigned long iobase; /* in/out[bwl] */ | 250 | unsigned long iobase; /* in/out[bwl] */ |
250 | unsigned char __iomem *membase; /* read/write[bwl] */ | 251 | unsigned char __iomem *membase; /* read/write[bwl] */ |
252 | unsigned int (*serial_in)(struct uart_port *, int); | ||
253 | void (*serial_out)(struct uart_port *, int, int); | ||
251 | unsigned int irq; /* irq number */ | 254 | unsigned int irq; /* irq number */ |
252 | unsigned int uartclk; /* base uart clock */ | 255 | unsigned int uartclk; /* base uart clock */ |
253 | unsigned int fifosize; /* tx fifo size */ | 256 | unsigned int fifosize; /* tx fifo size */ |
@@ -293,6 +296,8 @@ struct uart_port { | |||
293 | #define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) | 296 | #define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) |
294 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) | 297 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
295 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) | 298 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) |
299 | /* The exact UART type is known and should not be probed. */ | ||
300 | #define UPF_FIXED_TYPE ((__force upf_t) (1 << 27)) | ||
296 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) | 301 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) |
297 | #define UPF_FIXED_PORT ((__force upf_t) (1 << 29)) | 302 | #define UPF_FIXED_PORT ((__force upf_t) (1 << 29)) |
298 | #define UPF_DEAD ((__force upf_t) (1 << 30)) | 303 | #define UPF_DEAD ((__force upf_t) (1 << 30)) |
@@ -316,35 +321,13 @@ struct uart_port { | |||
316 | }; | 321 | }; |
317 | 322 | ||
318 | /* | 323 | /* |
319 | * This is the state information which is persistent across opens. | ||
320 | * The low level driver must not to touch any elements contained | ||
321 | * within. | ||
322 | */ | ||
323 | struct uart_state { | ||
324 | unsigned int close_delay; /* msec */ | ||
325 | unsigned int closing_wait; /* msec */ | ||
326 | |||
327 | #define USF_CLOSING_WAIT_INF (0) | ||
328 | #define USF_CLOSING_WAIT_NONE (~0U) | ||
329 | |||
330 | int count; | ||
331 | int pm_state; | ||
332 | struct uart_info *info; | ||
333 | struct uart_port *port; | ||
334 | |||
335 | struct mutex mutex; | ||
336 | }; | ||
337 | |||
338 | #define UART_XMIT_SIZE PAGE_SIZE | ||
339 | |||
340 | typedef unsigned int __bitwise__ uif_t; | ||
341 | |||
342 | /* | ||
343 | * This is the state information which is only valid when the port | 324 | * This is the state information which is only valid when the port |
344 | * is open; it may be freed by the core driver once the device has | 325 | * is open; it may be cleared the core driver once the device has |
345 | * been closed. Either the low level driver or the core can modify | 326 | * been closed. Either the low level driver or the core can modify |
346 | * stuff here. | 327 | * stuff here. |
347 | */ | 328 | */ |
329 | typedef unsigned int __bitwise__ uif_t; | ||
330 | |||
348 | struct uart_info { | 331 | struct uart_info { |
349 | struct tty_port port; | 332 | struct tty_port port; |
350 | struct circ_buf xmit; | 333 | struct circ_buf xmit; |
@@ -366,6 +349,29 @@ struct uart_info { | |||
366 | wait_queue_head_t delta_msr_wait; | 349 | wait_queue_head_t delta_msr_wait; |
367 | }; | 350 | }; |
368 | 351 | ||
352 | /* | ||
353 | * This is the state information which is persistent across opens. | ||
354 | * The low level driver must not to touch any elements contained | ||
355 | * within. | ||
356 | */ | ||
357 | struct uart_state { | ||
358 | unsigned int close_delay; /* msec */ | ||
359 | unsigned int closing_wait; /* msec */ | ||
360 | |||
361 | #define USF_CLOSING_WAIT_INF (0) | ||
362 | #define USF_CLOSING_WAIT_NONE (~0U) | ||
363 | |||
364 | int count; | ||
365 | int pm_state; | ||
366 | struct uart_info info; | ||
367 | struct uart_port *port; | ||
368 | |||
369 | struct mutex mutex; | ||
370 | }; | ||
371 | |||
372 | #define UART_XMIT_SIZE PAGE_SIZE | ||
373 | |||
374 | |||
369 | /* number of characters left in xmit buffer before we ask for more */ | 375 | /* number of characters left in xmit buffer before we ask for more */ |
370 | #define WAKEUP_CHARS 256 | 376 | #define WAKEUP_CHARS 256 |
371 | 377 | ||
@@ -439,8 +445,13 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port); | |||
439 | #define uart_circ_chars_free(circ) \ | 445 | #define uart_circ_chars_free(circ) \ |
440 | (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) | 446 | (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) |
441 | 447 | ||
442 | #define uart_tx_stopped(portp) \ | 448 | static inline int uart_tx_stopped(struct uart_port *port) |
443 | ((portp)->info->port.tty->stopped || (portp)->info->port.tty->hw_stopped) | 449 | { |
450 | struct tty_struct *tty = port->info->port.tty; | ||
451 | if(tty->stopped || tty->hw_stopped) | ||
452 | return 1; | ||
453 | return 0; | ||
454 | } | ||
444 | 455 | ||
445 | /* | 456 | /* |
446 | * The following are helper functions for the low level drivers. | 457 | * The following are helper functions for the low level drivers. |
@@ -451,7 +462,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch) | |||
451 | #ifdef SUPPORT_SYSRQ | 462 | #ifdef SUPPORT_SYSRQ |
452 | if (port->sysrq) { | 463 | if (port->sysrq) { |
453 | if (ch && time_before(jiffies, port->sysrq)) { | 464 | if (ch && time_before(jiffies, port->sysrq)) { |
454 | handle_sysrq(ch, port->info ? port->info->port.tty : NULL); | 465 | handle_sysrq(ch, port->info->port.tty); |
455 | port->sysrq = 0; | 466 | port->sysrq = 0; |
456 | return 1; | 467 | return 1; |
457 | } | 468 | } |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 6e7ba16ff454..b82466968101 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -21,6 +21,9 @@ struct call_single_data { | |||
21 | u16 priv; | 21 | u16 priv; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | /* total number of cpus in this system (may exceed NR_CPUS) */ | ||
25 | extern unsigned int total_cpus; | ||
26 | |||
24 | #ifdef CONFIG_SMP | 27 | #ifdef CONFIG_SMP |
25 | 28 | ||
26 | #include <linux/preempt.h> | 29 | #include <linux/preempt.h> |
@@ -64,15 +67,16 @@ extern void smp_cpus_done(unsigned int max_cpus); | |||
64 | * Call a function on all other processors | 67 | * Call a function on all other processors |
65 | */ | 68 | */ |
66 | int smp_call_function(void(*func)(void *info), void *info, int wait); | 69 | int smp_call_function(void(*func)(void *info), void *info, int wait); |
67 | /* Deprecated: use smp_call_function_many() which uses a cpumask ptr. */ | 70 | void smp_call_function_many(const struct cpumask *mask, |
68 | int smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, | 71 | void (*func)(void *info), void *info, bool wait); |
69 | int wait); | ||
70 | 72 | ||
71 | static inline void smp_call_function_many(const struct cpumask *mask, | 73 | /* Deprecated: Use smp_call_function_many which takes a pointer to the mask. */ |
72 | void (*func)(void *info), void *info, | 74 | static inline int |
73 | int wait) | 75 | smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info, |
76 | int wait) | ||
74 | { | 77 | { |
75 | smp_call_function_mask(*mask, func, info, wait); | 78 | smp_call_function_many(&mask, func, info, wait); |
79 | return 0; | ||
76 | } | 80 | } |
77 | 81 | ||
78 | int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, | 82 | int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, |
diff --git a/include/linux/spi/mmc_spi.h b/include/linux/spi/mmc_spi.h index a3626aedaec9..0f4eb165f254 100644 --- a/include/linux/spi/mmc_spi.h +++ b/include/linux/spi/mmc_spi.h | |||
@@ -1,9 +1,10 @@ | |||
1 | #ifndef __LINUX_SPI_MMC_SPI_H | 1 | #ifndef __LINUX_SPI_MMC_SPI_H |
2 | #define __LINUX_SPI_MMC_SPI_H | 2 | #define __LINUX_SPI_MMC_SPI_H |
3 | 3 | ||
4 | #include <linux/device.h> | ||
5 | #include <linux/spi/spi.h> | ||
4 | #include <linux/interrupt.h> | 6 | #include <linux/interrupt.h> |
5 | 7 | ||
6 | struct device; | ||
7 | struct mmc_host; | 8 | struct mmc_host; |
8 | 9 | ||
9 | /* Put this in platform_data of a device being used to manage an MMC/SD | 10 | /* Put this in platform_data of a device being used to manage an MMC/SD |
@@ -41,4 +42,16 @@ struct mmc_spi_platform_data { | |||
41 | void (*setpower)(struct device *, unsigned int maskval); | 42 | void (*setpower)(struct device *, unsigned int maskval); |
42 | }; | 43 | }; |
43 | 44 | ||
45 | #ifdef CONFIG_OF | ||
46 | extern struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi); | ||
47 | extern void mmc_spi_put_pdata(struct spi_device *spi); | ||
48 | #else | ||
49 | static inline struct mmc_spi_platform_data * | ||
50 | mmc_spi_get_pdata(struct spi_device *spi) | ||
51 | { | ||
52 | return spi->dev.platform_data; | ||
53 | } | ||
54 | static inline void mmc_spi_put_pdata(struct spi_device *spi) {} | ||
55 | #endif /* CONFIG_OF */ | ||
56 | |||
44 | #endif /* __LINUX_SPI_MMC_SPI_H */ | 57 | #endif /* __LINUX_SPI_MMC_SPI_H */ |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 4be01bb44377..82229317753d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef __LINUX_SPI_H | 19 | #ifndef __LINUX_SPI_H |
20 | #define __LINUX_SPI_H | 20 | #define __LINUX_SPI_H |
21 | 21 | ||
22 | #include <linux/device.h> | ||
23 | |||
22 | /* | 24 | /* |
23 | * INTERFACES between SPI master-side drivers and SPI infrastructure. | 25 | * INTERFACES between SPI master-side drivers and SPI infrastructure. |
24 | * (There's no SPI slave support for Linux yet...) | 26 | * (There's no SPI slave support for Linux yet...) |
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index faf1519b5adc..baba3a23a814 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -23,7 +23,7 @@ | |||
23 | * | 23 | * |
24 | * This can be thought of as a very heavy write lock, equivalent to | 24 | * This can be thought of as a very heavy write lock, equivalent to |
25 | * grabbing every spinlock in the kernel. */ | 25 | * grabbing every spinlock in the kernel. */ |
26 | int stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus); | 26 | int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * __stop_machine: freeze the machine on all CPUs and run this function | 29 | * __stop_machine: freeze the machine on all CPUs and run this function |
@@ -34,11 +34,29 @@ int stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus); | |||
34 | * Description: This is a special version of the above, which assumes cpus | 34 | * Description: This is a special version of the above, which assumes cpus |
35 | * won't come or go while it's being called. Used by hotplug cpu. | 35 | * won't come or go while it's being called. Used by hotplug cpu. |
36 | */ | 36 | */ |
37 | int __stop_machine(int (*fn)(void *), void *data, const cpumask_t *cpus); | 37 | int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); |
38 | |||
39 | /** | ||
40 | * stop_machine_create: create all stop_machine threads | ||
41 | * | ||
42 | * Description: This causes all stop_machine threads to be created before | ||
43 | * stop_machine actually gets called. This can be used by subsystems that | ||
44 | * need a non failing stop_machine infrastructure. | ||
45 | */ | ||
46 | int stop_machine_create(void); | ||
47 | |||
48 | /** | ||
49 | * stop_machine_destroy: destroy all stop_machine threads | ||
50 | * | ||
51 | * Description: This causes all stop_machine threads which were created with | ||
52 | * stop_machine_create to be destroyed again. | ||
53 | */ | ||
54 | void stop_machine_destroy(void); | ||
55 | |||
38 | #else | 56 | #else |
39 | 57 | ||
40 | static inline int stop_machine(int (*fn)(void *), void *data, | 58 | static inline int stop_machine(int (*fn)(void *), void *data, |
41 | const cpumask_t *cpus) | 59 | const struct cpumask *cpus) |
42 | { | 60 | { |
43 | int ret; | 61 | int ret; |
44 | local_irq_disable(); | 62 | local_irq_disable(); |
@@ -46,5 +64,9 @@ static inline int stop_machine(int (*fn)(void *), void *data, | |||
46 | local_irq_enable(); | 64 | local_irq_enable(); |
47 | return ret; | 65 | return ret; |
48 | } | 66 | } |
67 | |||
68 | static inline int stop_machine_create(void) { return 0; } | ||
69 | static inline void stop_machine_destroy(void) { } | ||
70 | |||
49 | #endif /* CONFIG_SMP */ | 71 | #endif /* CONFIG_SMP */ |
50 | #endif /* _LINUX_STOP_MACHINE */ | 72 | #endif /* _LINUX_STOP_MACHINE */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 04fb47bfb920..18d0a243a7b3 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -549,7 +549,7 @@ asmlinkage long sys_inotify_init(void); | |||
549 | asmlinkage long sys_inotify_init1(int flags); | 549 | asmlinkage long sys_inotify_init1(int flags); |
550 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, | 550 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, |
551 | u32 mask); | 551 | u32 mask); |
552 | asmlinkage long sys_inotify_rm_watch(int fd, u32 wd); | 552 | asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd); |
553 | 553 | ||
554 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, | 554 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, |
555 | __u32 __user *ustatus); | 555 | __u32 __user *ustatus); |
diff --git a/include/linux/threads.h b/include/linux/threads.h index 38d1a5d6568e..052b12bec8bd 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h | |||
@@ -8,17 +8,17 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Maximum supported processors that can run under SMP. This value is | 11 | * Maximum supported processors. Setting this smaller saves quite a |
12 | * set via configure setting. The maximum is equal to the size of the | 12 | * bit of memory. Use nr_cpu_ids instead of this except for static bitmaps. |
13 | * bitmasks used on that platform, i.e. 32 or 64. Setting this smaller | ||
14 | * saves quite a bit of memory. | ||
15 | */ | 13 | */ |
16 | #ifdef CONFIG_SMP | 14 | #ifndef CONFIG_NR_CPUS |
17 | #define NR_CPUS CONFIG_NR_CPUS | 15 | /* FIXME: This should be fixed in the arch's Kconfig */ |
18 | #else | 16 | #define CONFIG_NR_CPUS 1 |
19 | #define NR_CPUS 1 | ||
20 | #endif | 17 | #endif |
21 | 18 | ||
19 | /* Places which use this should consider cpumask_var_t. */ | ||
20 | #define NR_CPUS CONFIG_NR_CPUS | ||
21 | |||
22 | #define MIN_THREADS_LEFT_FOR_ROOT 4 | 22 | #define MIN_THREADS_LEFT_FOR_ROOT 4 |
23 | 23 | ||
24 | /* | 24 | /* |
diff --git a/include/linux/tick.h b/include/linux/tick.h index b6ec8189ac0c..469b82d88b3b 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -84,10 +84,10 @@ static inline void tick_cancel_sched_timer(int cpu) { } | |||
84 | 84 | ||
85 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | 85 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST |
86 | extern struct tick_device *tick_get_broadcast_device(void); | 86 | extern struct tick_device *tick_get_broadcast_device(void); |
87 | extern cpumask_t *tick_get_broadcast_mask(void); | 87 | extern struct cpumask *tick_get_broadcast_mask(void); |
88 | 88 | ||
89 | # ifdef CONFIG_TICK_ONESHOT | 89 | # ifdef CONFIG_TICK_ONESHOT |
90 | extern cpumask_t *tick_get_broadcast_oneshot_mask(void); | 90 | extern struct cpumask *tick_get_broadcast_oneshot_mask(void); |
91 | # endif | 91 | # endif |
92 | 92 | ||
93 | # endif /* BROADCAST */ | 93 | # endif /* BROADCAST */ |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 0c5b5ac36d8e..e632d29f0544 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -125,7 +125,8 @@ int arch_update_cpu_topology(void); | |||
125 | | SD_WAKE_AFFINE \ | 125 | | SD_WAKE_AFFINE \ |
126 | | SD_WAKE_BALANCE \ | 126 | | SD_WAKE_BALANCE \ |
127 | | SD_SHARE_PKG_RESOURCES\ | 127 | | SD_SHARE_PKG_RESOURCES\ |
128 | | BALANCE_FOR_MC_POWER, \ | 128 | | sd_balance_for_mc_power()\ |
129 | | sd_power_saving_flags(),\ | ||
129 | .last_balance = jiffies, \ | 130 | .last_balance = jiffies, \ |
130 | .balance_interval = 1, \ | 131 | .balance_interval = 1, \ |
131 | } | 132 | } |
@@ -150,7 +151,8 @@ int arch_update_cpu_topology(void); | |||
150 | | SD_BALANCE_FORK \ | 151 | | SD_BALANCE_FORK \ |
151 | | SD_WAKE_AFFINE \ | 152 | | SD_WAKE_AFFINE \ |
152 | | SD_WAKE_BALANCE \ | 153 | | SD_WAKE_BALANCE \ |
153 | | BALANCE_FOR_PKG_POWER,\ | 154 | | sd_balance_for_package_power()\ |
155 | | sd_power_saving_flags(),\ | ||
154 | .last_balance = jiffies, \ | 156 | .last_balance = jiffies, \ |
155 | .balance_interval = 1, \ | 157 | .balance_interval = 1, \ |
156 | } | 158 | } |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 3f4954c55e53..fc39db95499f 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -180,8 +180,17 @@ struct signal_struct; | |||
180 | * until a hangup so don't use the wrong path. | 180 | * until a hangup so don't use the wrong path. |
181 | */ | 181 | */ |
182 | 182 | ||
183 | struct tty_port; | ||
184 | |||
185 | struct tty_port_operations { | ||
186 | /* Return 1 if the carrier is raised */ | ||
187 | int (*carrier_raised)(struct tty_port *port); | ||
188 | void (*raise_dtr_rts)(struct tty_port *port); | ||
189 | }; | ||
190 | |||
183 | struct tty_port { | 191 | struct tty_port { |
184 | struct tty_struct *tty; /* Back pointer */ | 192 | struct tty_struct *tty; /* Back pointer */ |
193 | const struct tty_port_operations *ops; /* Port operations */ | ||
185 | spinlock_t lock; /* Lock protecting tty field */ | 194 | spinlock_t lock; /* Lock protecting tty field */ |
186 | int blocked_open; /* Waiting to open */ | 195 | int blocked_open; /* Waiting to open */ |
187 | int count; /* Usage count */ | 196 | int count; /* Usage count */ |
@@ -253,6 +262,7 @@ struct tty_struct { | |||
253 | unsigned int column; | 262 | unsigned int column; |
254 | unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; | 263 | unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1; |
255 | unsigned char closing:1; | 264 | unsigned char closing:1; |
265 | unsigned char echo_overrun:1; | ||
256 | unsigned short minimum_to_wake; | 266 | unsigned short minimum_to_wake; |
257 | unsigned long overrun_time; | 267 | unsigned long overrun_time; |
258 | int num_overrun; | 268 | int num_overrun; |
@@ -262,11 +272,16 @@ struct tty_struct { | |||
262 | int read_tail; | 272 | int read_tail; |
263 | int read_cnt; | 273 | int read_cnt; |
264 | unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))]; | 274 | unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))]; |
275 | unsigned char *echo_buf; | ||
276 | unsigned int echo_pos; | ||
277 | unsigned int echo_cnt; | ||
265 | int canon_data; | 278 | int canon_data; |
266 | unsigned long canon_head; | 279 | unsigned long canon_head; |
267 | unsigned int canon_column; | 280 | unsigned int canon_column; |
268 | struct mutex atomic_read_lock; | 281 | struct mutex atomic_read_lock; |
269 | struct mutex atomic_write_lock; | 282 | struct mutex atomic_write_lock; |
283 | struct mutex output_lock; | ||
284 | struct mutex echo_lock; | ||
270 | unsigned char *write_buf; | 285 | unsigned char *write_buf; |
271 | int write_cnt; | 286 | int write_cnt; |
272 | spinlock_t read_lock; | 287 | spinlock_t read_lock; |
@@ -295,6 +310,7 @@ struct tty_struct { | |||
295 | #define TTY_PUSH 6 /* n_tty private */ | 310 | #define TTY_PUSH 6 /* n_tty private */ |
296 | #define TTY_CLOSING 7 /* ->close() in progress */ | 311 | #define TTY_CLOSING 7 /* ->close() in progress */ |
297 | #define TTY_LDISC 9 /* Line discipline attached */ | 312 | #define TTY_LDISC 9 /* Line discipline attached */ |
313 | #define TTY_LDISC_CHANGING 10 /* Line discipline changing */ | ||
298 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ | 314 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ |
299 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ | 315 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ |
300 | #define TTY_PTY_LOCK 16 /* pty private */ | 316 | #define TTY_PTY_LOCK 16 /* pty private */ |
@@ -354,8 +370,7 @@ extern int tty_write_room(struct tty_struct *tty); | |||
354 | extern void tty_driver_flush_buffer(struct tty_struct *tty); | 370 | extern void tty_driver_flush_buffer(struct tty_struct *tty); |
355 | extern void tty_throttle(struct tty_struct *tty); | 371 | extern void tty_throttle(struct tty_struct *tty); |
356 | extern void tty_unthrottle(struct tty_struct *tty); | 372 | extern void tty_unthrottle(struct tty_struct *tty); |
357 | extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty, | 373 | extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); |
358 | struct winsize *ws); | ||
359 | extern void tty_shutdown(struct tty_struct *tty); | 374 | extern void tty_shutdown(struct tty_struct *tty); |
360 | extern void tty_free_termios(struct tty_struct *tty); | 375 | extern void tty_free_termios(struct tty_struct *tty); |
361 | extern int is_current_pgrp_orphaned(void); | 376 | extern int is_current_pgrp_orphaned(void); |
@@ -421,6 +436,14 @@ extern int tty_port_alloc_xmit_buf(struct tty_port *port); | |||
421 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 436 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
422 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); | 437 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); |
423 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); | 438 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); |
439 | extern int tty_port_carrier_raised(struct tty_port *port); | ||
440 | extern void tty_port_raise_dtr_rts(struct tty_port *port); | ||
441 | extern void tty_port_hangup(struct tty_port *port); | ||
442 | extern int tty_port_block_til_ready(struct tty_port *port, | ||
443 | struct tty_struct *tty, struct file *filp); | ||
444 | extern int tty_port_close_start(struct tty_port *port, | ||
445 | struct tty_struct *tty, struct file *filp); | ||
446 | extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); | ||
424 | 447 | ||
425 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); | 448 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); |
426 | extern int tty_unregister_ldisc(int disc); | 449 | extern int tty_unregister_ldisc(int disc); |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 78416b901589..08e088334dba 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -196,8 +196,7 @@ | |||
196 | * Optional: If not provided then the write method is called under | 196 | * Optional: If not provided then the write method is called under |
197 | * the atomic write lock to keep it serialized with the ldisc. | 197 | * the atomic write lock to keep it serialized with the ldisc. |
198 | * | 198 | * |
199 | * int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, | 199 | * int (*resize)(struct tty_struct *tty, struct winsize *ws) |
200 | * unsigned int rows, unsigned int cols); | ||
201 | * | 200 | * |
202 | * Called when a termios request is issued which changes the | 201 | * Called when a termios request is issued which changes the |
203 | * requested terminal geometry. | 202 | * requested terminal geometry. |
@@ -258,8 +257,7 @@ struct tty_operations { | |||
258 | int (*tiocmget)(struct tty_struct *tty, struct file *file); | 257 | int (*tiocmget)(struct tty_struct *tty, struct file *file); |
259 | int (*tiocmset)(struct tty_struct *tty, struct file *file, | 258 | int (*tiocmset)(struct tty_struct *tty, struct file *file, |
260 | unsigned int set, unsigned int clear); | 259 | unsigned int set, unsigned int clear); |
261 | int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, | 260 | int (*resize)(struct tty_struct *tty, struct winsize *ws); |
262 | struct winsize *ws); | ||
263 | int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew); | 261 | int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew); |
264 | #ifdef CONFIG_CONSOLE_POLL | 262 | #ifdef CONFIG_CONSOLE_POLL |
265 | int (*poll_init)(struct tty_driver *driver, int line, char *options); | 263 | int (*poll_init)(struct tty_driver *driver, int line, char *options); |
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h index a102561e7026..fb7c359bdfba 100644 --- a/include/linux/usb/wusb-wa.h +++ b/include/linux/usb/wusb-wa.h | |||
@@ -51,6 +51,7 @@ enum { | |||
51 | WUSB_REQ_GET_TIME = 25, | 51 | WUSB_REQ_GET_TIME = 25, |
52 | WUSB_REQ_SET_STREAM_IDX = 26, | 52 | WUSB_REQ_SET_STREAM_IDX = 26, |
53 | WUSB_REQ_SET_WUSB_MAS = 27, | 53 | WUSB_REQ_SET_WUSB_MAS = 27, |
54 | WUSB_REQ_CHAN_STOP = 28, | ||
54 | }; | 55 | }; |
55 | 56 | ||
56 | 57 | ||
diff --git a/include/linux/uwb.h b/include/linux/uwb.h index f9ccbd9a2ced..c02128991ff7 100644 --- a/include/linux/uwb.h +++ b/include/linux/uwb.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
31 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
32 | #include <linux/timer.h> | 32 | #include <linux/timer.h> |
33 | #include <linux/wait.h> | ||
33 | #include <linux/workqueue.h> | 34 | #include <linux/workqueue.h> |
34 | #include <linux/uwb/spec.h> | 35 | #include <linux/uwb/spec.h> |
35 | 36 | ||
@@ -66,6 +67,7 @@ struct uwb_dev { | |||
66 | struct uwb_dev_addr dev_addr; | 67 | struct uwb_dev_addr dev_addr; |
67 | int beacon_slot; | 68 | int beacon_slot; |
68 | DECLARE_BITMAP(streams, UWB_NUM_STREAMS); | 69 | DECLARE_BITMAP(streams, UWB_NUM_STREAMS); |
70 | DECLARE_BITMAP(last_availability_bm, UWB_NUM_MAS); | ||
69 | }; | 71 | }; |
70 | #define to_uwb_dev(d) container_of(d, struct uwb_dev, dev) | 72 | #define to_uwb_dev(d) container_of(d, struct uwb_dev, dev) |
71 | 73 | ||
@@ -86,12 +88,31 @@ struct uwb_notifs_chain { | |||
86 | struct mutex mutex; | 88 | struct mutex mutex; |
87 | }; | 89 | }; |
88 | 90 | ||
91 | /* Beacon cache list */ | ||
92 | struct uwb_beca { | ||
93 | struct list_head list; | ||
94 | size_t entries; | ||
95 | struct mutex mutex; | ||
96 | }; | ||
97 | |||
98 | /* Event handling thread. */ | ||
99 | struct uwbd { | ||
100 | int pid; | ||
101 | struct task_struct *task; | ||
102 | wait_queue_head_t wq; | ||
103 | struct list_head event_list; | ||
104 | spinlock_t event_list_lock; | ||
105 | }; | ||
106 | |||
89 | /** | 107 | /** |
90 | * struct uwb_mas_bm - a bitmap of all MAS in a superframe | 108 | * struct uwb_mas_bm - a bitmap of all MAS in a superframe |
91 | * @bm: a bitmap of length #UWB_NUM_MAS | 109 | * @bm: a bitmap of length #UWB_NUM_MAS |
92 | */ | 110 | */ |
93 | struct uwb_mas_bm { | 111 | struct uwb_mas_bm { |
94 | DECLARE_BITMAP(bm, UWB_NUM_MAS); | 112 | DECLARE_BITMAP(bm, UWB_NUM_MAS); |
113 | DECLARE_BITMAP(unsafe_bm, UWB_NUM_MAS); | ||
114 | int safe; | ||
115 | int unsafe; | ||
95 | }; | 116 | }; |
96 | 117 | ||
97 | /** | 118 | /** |
@@ -117,14 +138,24 @@ struct uwb_mas_bm { | |||
117 | * FIXME: further target states TBD. | 138 | * FIXME: further target states TBD. |
118 | */ | 139 | */ |
119 | enum uwb_rsv_state { | 140 | enum uwb_rsv_state { |
120 | UWB_RSV_STATE_NONE, | 141 | UWB_RSV_STATE_NONE = 0, |
121 | UWB_RSV_STATE_O_INITIATED, | 142 | UWB_RSV_STATE_O_INITIATED, |
122 | UWB_RSV_STATE_O_PENDING, | 143 | UWB_RSV_STATE_O_PENDING, |
123 | UWB_RSV_STATE_O_MODIFIED, | 144 | UWB_RSV_STATE_O_MODIFIED, |
124 | UWB_RSV_STATE_O_ESTABLISHED, | 145 | UWB_RSV_STATE_O_ESTABLISHED, |
146 | UWB_RSV_STATE_O_TO_BE_MOVED, | ||
147 | UWB_RSV_STATE_O_MOVE_EXPANDING, | ||
148 | UWB_RSV_STATE_O_MOVE_COMBINING, | ||
149 | UWB_RSV_STATE_O_MOVE_REDUCING, | ||
125 | UWB_RSV_STATE_T_ACCEPTED, | 150 | UWB_RSV_STATE_T_ACCEPTED, |
126 | UWB_RSV_STATE_T_DENIED, | 151 | UWB_RSV_STATE_T_DENIED, |
152 | UWB_RSV_STATE_T_CONFLICT, | ||
127 | UWB_RSV_STATE_T_PENDING, | 153 | UWB_RSV_STATE_T_PENDING, |
154 | UWB_RSV_STATE_T_EXPANDING_ACCEPTED, | ||
155 | UWB_RSV_STATE_T_EXPANDING_CONFLICT, | ||
156 | UWB_RSV_STATE_T_EXPANDING_PENDING, | ||
157 | UWB_RSV_STATE_T_EXPANDING_DENIED, | ||
158 | UWB_RSV_STATE_T_RESIZED, | ||
128 | 159 | ||
129 | UWB_RSV_STATE_LAST, | 160 | UWB_RSV_STATE_LAST, |
130 | }; | 161 | }; |
@@ -149,6 +180,12 @@ struct uwb_rsv_target { | |||
149 | }; | 180 | }; |
150 | }; | 181 | }; |
151 | 182 | ||
183 | struct uwb_rsv_move { | ||
184 | struct uwb_mas_bm final_mas; | ||
185 | struct uwb_ie_drp *companion_drp_ie; | ||
186 | struct uwb_mas_bm companion_mas; | ||
187 | }; | ||
188 | |||
152 | /* | 189 | /* |
153 | * Number of streams reserved for reservations targeted at DevAddrs. | 190 | * Number of streams reserved for reservations targeted at DevAddrs. |
154 | */ | 191 | */ |
@@ -186,6 +223,7 @@ typedef void (*uwb_rsv_cb_f)(struct uwb_rsv *rsv); | |||
186 | * | 223 | * |
187 | * @status: negotiation status | 224 | * @status: negotiation status |
188 | * @stream: stream index allocated for this reservation | 225 | * @stream: stream index allocated for this reservation |
226 | * @tiebreaker: conflict tiebreaker for this reservation | ||
189 | * @mas: reserved MAS | 227 | * @mas: reserved MAS |
190 | * @drp_ie: the DRP IE | 228 | * @drp_ie: the DRP IE |
191 | * @ie_valid: true iff the DRP IE matches the reservation parameters | 229 | * @ie_valid: true iff the DRP IE matches the reservation parameters |
@@ -201,25 +239,29 @@ struct uwb_rsv { | |||
201 | struct uwb_rc *rc; | 239 | struct uwb_rc *rc; |
202 | struct list_head rc_node; | 240 | struct list_head rc_node; |
203 | struct list_head pal_node; | 241 | struct list_head pal_node; |
242 | struct kref kref; | ||
204 | 243 | ||
205 | struct uwb_dev *owner; | 244 | struct uwb_dev *owner; |
206 | struct uwb_rsv_target target; | 245 | struct uwb_rsv_target target; |
207 | enum uwb_drp_type type; | 246 | enum uwb_drp_type type; |
208 | int max_mas; | 247 | int max_mas; |
209 | int min_mas; | 248 | int min_mas; |
210 | int sparsity; | 249 | int max_interval; |
211 | bool is_multicast; | 250 | bool is_multicast; |
212 | 251 | ||
213 | uwb_rsv_cb_f callback; | 252 | uwb_rsv_cb_f callback; |
214 | void *pal_priv; | 253 | void *pal_priv; |
215 | 254 | ||
216 | enum uwb_rsv_state state; | 255 | enum uwb_rsv_state state; |
256 | bool needs_release_companion_mas; | ||
217 | u8 stream; | 257 | u8 stream; |
258 | u8 tiebreaker; | ||
218 | struct uwb_mas_bm mas; | 259 | struct uwb_mas_bm mas; |
219 | struct uwb_ie_drp *drp_ie; | 260 | struct uwb_ie_drp *drp_ie; |
261 | struct uwb_rsv_move mv; | ||
220 | bool ie_valid; | 262 | bool ie_valid; |
221 | struct timer_list timer; | 263 | struct timer_list timer; |
222 | bool expired; | 264 | struct work_struct handle_timeout_work; |
223 | }; | 265 | }; |
224 | 266 | ||
225 | static const | 267 | static const |
@@ -261,6 +303,13 @@ struct uwb_drp_avail { | |||
261 | bool ie_valid; | 303 | bool ie_valid; |
262 | }; | 304 | }; |
263 | 305 | ||
306 | struct uwb_drp_backoff_win { | ||
307 | u8 window; | ||
308 | u8 n; | ||
309 | int total_expired; | ||
310 | struct timer_list timer; | ||
311 | bool can_reserve_extra_mases; | ||
312 | }; | ||
264 | 313 | ||
265 | const char *uwb_rsv_state_str(enum uwb_rsv_state state); | 314 | const char *uwb_rsv_state_str(enum uwb_rsv_state state); |
266 | const char *uwb_rsv_type_str(enum uwb_drp_type type); | 315 | const char *uwb_rsv_type_str(enum uwb_drp_type type); |
@@ -276,6 +325,8 @@ void uwb_rsv_terminate(struct uwb_rsv *rsv); | |||
276 | 325 | ||
277 | void uwb_rsv_accept(struct uwb_rsv *rsv, uwb_rsv_cb_f cb, void *pal_priv); | 326 | void uwb_rsv_accept(struct uwb_rsv *rsv, uwb_rsv_cb_f cb, void *pal_priv); |
278 | 327 | ||
328 | void uwb_rsv_get_usable_mas(struct uwb_rsv *orig_rsv, struct uwb_mas_bm *mas); | ||
329 | |||
279 | /** | 330 | /** |
280 | * Radio Control Interface instance | 331 | * Radio Control Interface instance |
281 | * | 332 | * |
@@ -337,23 +388,33 @@ struct uwb_rc { | |||
337 | u8 ctx_roll; | 388 | u8 ctx_roll; |
338 | 389 | ||
339 | int beaconing; /* Beaconing state [channel number] */ | 390 | int beaconing; /* Beaconing state [channel number] */ |
391 | int beaconing_forced; | ||
340 | int scanning; | 392 | int scanning; |
341 | enum uwb_scan_type scan_type:3; | 393 | enum uwb_scan_type scan_type:3; |
342 | unsigned ready:1; | 394 | unsigned ready:1; |
343 | struct uwb_notifs_chain notifs_chain; | 395 | struct uwb_notifs_chain notifs_chain; |
396 | struct uwb_beca uwb_beca; | ||
397 | |||
398 | struct uwbd uwbd; | ||
344 | 399 | ||
400 | struct uwb_drp_backoff_win bow; | ||
345 | struct uwb_drp_avail drp_avail; | 401 | struct uwb_drp_avail drp_avail; |
346 | struct list_head reservations; | 402 | struct list_head reservations; |
403 | struct list_head cnflt_alien_list; | ||
404 | struct uwb_mas_bm cnflt_alien_bitmap; | ||
347 | struct mutex rsvs_mutex; | 405 | struct mutex rsvs_mutex; |
406 | spinlock_t rsvs_lock; | ||
348 | struct workqueue_struct *rsv_workq; | 407 | struct workqueue_struct *rsv_workq; |
349 | struct work_struct rsv_update_work; | ||
350 | 408 | ||
409 | struct delayed_work rsv_update_work; | ||
410 | struct delayed_work rsv_alien_bp_work; | ||
411 | int set_drp_ie_pending; | ||
351 | struct mutex ies_mutex; | 412 | struct mutex ies_mutex; |
352 | struct uwb_rc_cmd_set_ie *ies; | 413 | struct uwb_rc_cmd_set_ie *ies; |
353 | size_t ies_capacity; | 414 | size_t ies_capacity; |
354 | 415 | ||
355 | spinlock_t pal_lock; | ||
356 | struct list_head pals; | 416 | struct list_head pals; |
417 | int active_pals; | ||
357 | 418 | ||
358 | struct uwb_dbg *dbg; | 419 | struct uwb_dbg *dbg; |
359 | }; | 420 | }; |
@@ -361,11 +422,19 @@ struct uwb_rc { | |||
361 | 422 | ||
362 | /** | 423 | /** |
363 | * struct uwb_pal - a UWB PAL | 424 | * struct uwb_pal - a UWB PAL |
364 | * @name: descriptive name for this PAL (wushc, wlp, etc.). | 425 | * @name: descriptive name for this PAL (wusbhc, wlp, etc.). |
365 | * @device: a device for the PAL. Used to link the PAL and the radio | 426 | * @device: a device for the PAL. Used to link the PAL and the radio |
366 | * controller in sysfs. | 427 | * controller in sysfs. |
428 | * @rc: the radio controller the PAL uses. | ||
429 | * @channel_changed: called when the channel used by the radio changes. | ||
430 | * A channel of -1 means the channel has been stopped. | ||
367 | * @new_rsv: called when a peer requests a reservation (may be NULL if | 431 | * @new_rsv: called when a peer requests a reservation (may be NULL if |
368 | * the PAL cannot accept reservation requests). | 432 | * the PAL cannot accept reservation requests). |
433 | * @channel: channel being used by the PAL; 0 if the PAL isn't using | ||
434 | * the radio; -1 if the PAL wishes to use the radio but | ||
435 | * cannot. | ||
436 | * @debugfs_dir: a debugfs directory which the PAL can use for its own | ||
437 | * debugfs files. | ||
369 | * | 438 | * |
370 | * A Protocol Adaptation Layer (PAL) is a user of the WiMedia UWB | 439 | * A Protocol Adaptation Layer (PAL) is a user of the WiMedia UWB |
371 | * radio platform (e.g., WUSB, WLP or Bluetooth UWB AMP). | 440 | * radio platform (e.g., WUSB, WLP or Bluetooth UWB AMP). |
@@ -384,12 +453,21 @@ struct uwb_pal { | |||
384 | struct list_head node; | 453 | struct list_head node; |
385 | const char *name; | 454 | const char *name; |
386 | struct device *device; | 455 | struct device *device; |
387 | void (*new_rsv)(struct uwb_rsv *rsv); | 456 | struct uwb_rc *rc; |
457 | |||
458 | void (*channel_changed)(struct uwb_pal *pal, int channel); | ||
459 | void (*new_rsv)(struct uwb_pal *pal, struct uwb_rsv *rsv); | ||
460 | |||
461 | int channel; | ||
462 | struct dentry *debugfs_dir; | ||
388 | }; | 463 | }; |
389 | 464 | ||
390 | void uwb_pal_init(struct uwb_pal *pal); | 465 | void uwb_pal_init(struct uwb_pal *pal); |
391 | int uwb_pal_register(struct uwb_rc *rc, struct uwb_pal *pal); | 466 | int uwb_pal_register(struct uwb_pal *pal); |
392 | void uwb_pal_unregister(struct uwb_rc *rc, struct uwb_pal *pal); | 467 | void uwb_pal_unregister(struct uwb_pal *pal); |
468 | |||
469 | int uwb_radio_start(struct uwb_pal *pal); | ||
470 | void uwb_radio_stop(struct uwb_pal *pal); | ||
393 | 471 | ||
394 | /* | 472 | /* |
395 | * General public API | 473 | * General public API |
@@ -443,8 +521,6 @@ ssize_t uwb_rc_vcmd(struct uwb_rc *rc, const char *cmd_name, | |||
443 | struct uwb_rccb *cmd, size_t cmd_size, | 521 | struct uwb_rccb *cmd, size_t cmd_size, |
444 | u8 expected_type, u16 expected_event, | 522 | u8 expected_type, u16 expected_event, |
445 | struct uwb_rceb **preply); | 523 | struct uwb_rceb **preply); |
446 | ssize_t uwb_rc_get_ie(struct uwb_rc *, struct uwb_rc_evt_get_ie **); | ||
447 | int uwb_bg_joined(struct uwb_rc *rc); | ||
448 | 524 | ||
449 | size_t __uwb_addr_print(char *, size_t, const unsigned char *, int); | 525 | size_t __uwb_addr_print(char *, size_t, const unsigned char *, int); |
450 | 526 | ||
@@ -520,6 +596,8 @@ void uwb_rc_rm(struct uwb_rc *); | |||
520 | void uwb_rc_neh_grok(struct uwb_rc *, void *, size_t); | 596 | void uwb_rc_neh_grok(struct uwb_rc *, void *, size_t); |
521 | void uwb_rc_neh_error(struct uwb_rc *, int); | 597 | void uwb_rc_neh_error(struct uwb_rc *, int); |
522 | void uwb_rc_reset_all(struct uwb_rc *rc); | 598 | void uwb_rc_reset_all(struct uwb_rc *rc); |
599 | void uwb_rc_pre_reset(struct uwb_rc *rc); | ||
600 | void uwb_rc_post_reset(struct uwb_rc *rc); | ||
523 | 601 | ||
524 | /** | 602 | /** |
525 | * uwb_rsv_is_owner - is the owner of this reservation the RC? | 603 | * uwb_rsv_is_owner - is the owner of this reservation the RC? |
@@ -531,7 +609,9 @@ static inline bool uwb_rsv_is_owner(struct uwb_rsv *rsv) | |||
531 | } | 609 | } |
532 | 610 | ||
533 | /** | 611 | /** |
534 | * Events generated by UWB that can be passed to any listeners | 612 | * enum uwb_notifs - UWB events that can be passed to any listeners |
613 | * @UWB_NOTIF_ONAIR: a new neighbour has joined the beacon group. | ||
614 | * @UWB_NOTIF_OFFAIR: a neighbour has left the beacon group. | ||
535 | * | 615 | * |
536 | * Higher layers can register callback functions with the radio | 616 | * Higher layers can register callback functions with the radio |
537 | * controller using uwb_notifs_register(). The radio controller | 617 | * controller using uwb_notifs_register(). The radio controller |
@@ -539,8 +619,6 @@ static inline bool uwb_rsv_is_owner(struct uwb_rsv *rsv) | |||
539 | * nodes when an event occurs. | 619 | * nodes when an event occurs. |
540 | */ | 620 | */ |
541 | enum uwb_notifs { | 621 | enum uwb_notifs { |
542 | UWB_NOTIF_BG_JOIN = 0, /* radio controller joined a beacon group */ | ||
543 | UWB_NOTIF_BG_LEAVE = 1, /* radio controller left a beacon group */ | ||
544 | UWB_NOTIF_ONAIR, | 622 | UWB_NOTIF_ONAIR, |
545 | UWB_NOTIF_OFFAIR, | 623 | UWB_NOTIF_OFFAIR, |
546 | }; | 624 | }; |
@@ -652,22 +730,9 @@ static inline int edc_inc(struct edc *err_hist, u16 max_err, u16 timeframe) | |||
652 | 730 | ||
653 | /* Information Element handling */ | 731 | /* Information Element handling */ |
654 | 732 | ||
655 | /* For representing the state of writing to a buffer when iterating */ | ||
656 | struct uwb_buf_ctx { | ||
657 | char *buf; | ||
658 | size_t bytes, size; | ||
659 | }; | ||
660 | |||
661 | typedef int (*uwb_ie_f)(struct uwb_dev *, const struct uwb_ie_hdr *, | ||
662 | size_t, void *); | ||
663 | struct uwb_ie_hdr *uwb_ie_next(void **ptr, size_t *len); | 733 | struct uwb_ie_hdr *uwb_ie_next(void **ptr, size_t *len); |
664 | ssize_t uwb_ie_for_each(struct uwb_dev *uwb_dev, uwb_ie_f fn, void *data, | 734 | int uwb_rc_ie_add(struct uwb_rc *uwb_rc, const struct uwb_ie_hdr *ies, size_t size); |
665 | const void *buf, size_t size); | 735 | int uwb_rc_ie_rm(struct uwb_rc *uwb_rc, enum uwb_ie element_id); |
666 | int uwb_ie_dump_hex(struct uwb_dev *, const struct uwb_ie_hdr *, | ||
667 | size_t, void *); | ||
668 | int uwb_rc_set_ie(struct uwb_rc *, struct uwb_rc_cmd_set_ie *); | ||
669 | struct uwb_ie_hdr *uwb_ie_next(void **ptr, size_t *len); | ||
670 | |||
671 | 736 | ||
672 | /* | 737 | /* |
673 | * Transmission statistics | 738 | * Transmission statistics |
diff --git a/include/linux/uwb/debug-cmd.h b/include/linux/uwb/debug-cmd.h index 1141f41bab5c..8da004e25628 100644 --- a/include/linux/uwb/debug-cmd.h +++ b/include/linux/uwb/debug-cmd.h | |||
@@ -32,6 +32,10 @@ | |||
32 | enum uwb_dbg_cmd_type { | 32 | enum uwb_dbg_cmd_type { |
33 | UWB_DBG_CMD_RSV_ESTABLISH = 1, | 33 | UWB_DBG_CMD_RSV_ESTABLISH = 1, |
34 | UWB_DBG_CMD_RSV_TERMINATE = 2, | 34 | UWB_DBG_CMD_RSV_TERMINATE = 2, |
35 | UWB_DBG_CMD_IE_ADD = 3, | ||
36 | UWB_DBG_CMD_IE_RM = 4, | ||
37 | UWB_DBG_CMD_RADIO_START = 5, | ||
38 | UWB_DBG_CMD_RADIO_STOP = 6, | ||
35 | }; | 39 | }; |
36 | 40 | ||
37 | struct uwb_dbg_cmd_rsv_establish { | 41 | struct uwb_dbg_cmd_rsv_establish { |
@@ -39,18 +43,25 @@ struct uwb_dbg_cmd_rsv_establish { | |||
39 | __u8 type; | 43 | __u8 type; |
40 | __u16 max_mas; | 44 | __u16 max_mas; |
41 | __u16 min_mas; | 45 | __u16 min_mas; |
42 | __u8 sparsity; | 46 | __u8 max_interval; |
43 | }; | 47 | }; |
44 | 48 | ||
45 | struct uwb_dbg_cmd_rsv_terminate { | 49 | struct uwb_dbg_cmd_rsv_terminate { |
46 | int index; | 50 | int index; |
47 | }; | 51 | }; |
48 | 52 | ||
53 | struct uwb_dbg_cmd_ie { | ||
54 | __u8 data[128]; | ||
55 | int len; | ||
56 | }; | ||
57 | |||
49 | struct uwb_dbg_cmd { | 58 | struct uwb_dbg_cmd { |
50 | __u32 type; | 59 | __u32 type; |
51 | union { | 60 | union { |
52 | struct uwb_dbg_cmd_rsv_establish rsv_establish; | 61 | struct uwb_dbg_cmd_rsv_establish rsv_establish; |
53 | struct uwb_dbg_cmd_rsv_terminate rsv_terminate; | 62 | struct uwb_dbg_cmd_rsv_terminate rsv_terminate; |
63 | struct uwb_dbg_cmd_ie ie_add; | ||
64 | struct uwb_dbg_cmd_ie ie_rm; | ||
54 | }; | 65 | }; |
55 | }; | 66 | }; |
56 | 67 | ||
diff --git a/include/linux/uwb/debug.h b/include/linux/uwb/debug.h deleted file mode 100644 index a86a73fe303f..000000000000 --- a/include/linux/uwb/debug.h +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | /* | ||
2 | * Ultra Wide Band | ||
3 | * Debug Support | ||
4 | * | ||
5 | * Copyright (C) 2005-2006 Intel Corporation | ||
6 | * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License version | ||
10 | * 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
20 | * 02110-1301, USA. | ||
21 | * | ||
22 | * | ||
23 | * FIXME: doc | ||
24 | * Invoke like: | ||
25 | * | ||
26 | * #define D_LOCAL 4 | ||
27 | * #include <linux/uwb/debug.h> | ||
28 | * | ||
29 | * At the end of your include files. | ||
30 | */ | ||
31 | #include <linux/types.h> | ||
32 | |||
33 | struct device; | ||
34 | extern void dump_bytes(struct device *dev, const void *_buf, size_t rsize); | ||
35 | |||
36 | /* Master debug switch; !0 enables, 0 disables */ | ||
37 | #define D_MASTER (!0) | ||
38 | |||
39 | /* Local (per-file) debug switch; #define before #including */ | ||
40 | #ifndef D_LOCAL | ||
41 | #define D_LOCAL 0 | ||
42 | #endif | ||
43 | |||
44 | #undef __d_printf | ||
45 | #undef d_fnstart | ||
46 | #undef d_fnend | ||
47 | #undef d_printf | ||
48 | #undef d_dump | ||
49 | |||
50 | #define __d_printf(l, _tag, _dev, f, a...) \ | ||
51 | do { \ | ||
52 | struct device *__dev = (_dev); \ | ||
53 | if (D_MASTER && D_LOCAL >= (l)) { \ | ||
54 | char __head[64] = ""; \ | ||
55 | if (_dev != NULL) { \ | ||
56 | if ((unsigned long)__dev < 4096) \ | ||
57 | printk(KERN_ERR "E: Corrupt dev %p\n", \ | ||
58 | __dev); \ | ||
59 | else \ | ||
60 | snprintf(__head, sizeof(__head), \ | ||
61 | "%s %s: ", \ | ||
62 | dev_driver_string(__dev), \ | ||
63 | __dev->bus_id); \ | ||
64 | } \ | ||
65 | printk(KERN_ERR "%s%s" _tag ": " f, __head, \ | ||
66 | __func__, ## a); \ | ||
67 | } \ | ||
68 | } while (0 && _dev) | ||
69 | |||
70 | #define d_fnstart(l, _dev, f, a...) \ | ||
71 | __d_printf(l, " FNSTART", _dev, f, ## a) | ||
72 | #define d_fnend(l, _dev, f, a...) \ | ||
73 | __d_printf(l, " FNEND", _dev, f, ## a) | ||
74 | #define d_printf(l, _dev, f, a...) \ | ||
75 | __d_printf(l, "", _dev, f, ## a) | ||
76 | #define d_dump(l, _dev, ptr, size) \ | ||
77 | do { \ | ||
78 | struct device *__dev = _dev; \ | ||
79 | if (D_MASTER && D_LOCAL >= (l)) \ | ||
80 | dump_bytes(__dev, ptr, size); \ | ||
81 | } while (0 && _dev) | ||
82 | #define d_test(l) (D_MASTER && D_LOCAL >= (l)) | ||
diff --git a/include/linux/uwb/spec.h b/include/linux/uwb/spec.h index 198c15f8e251..b52e44f1bd33 100644 --- a/include/linux/uwb/spec.h +++ b/include/linux/uwb/spec.h | |||
@@ -59,6 +59,11 @@ enum { UWB_NUM_ZONES = 16 }; | |||
59 | #define UWB_MAS_PER_ZONE (UWB_NUM_MAS / UWB_NUM_ZONES) | 59 | #define UWB_MAS_PER_ZONE (UWB_NUM_MAS / UWB_NUM_ZONES) |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * Number of MAS required before a row can be considered available. | ||
63 | */ | ||
64 | #define UWB_USABLE_MAS_PER_ROW (UWB_NUM_ZONES - 1) | ||
65 | |||
66 | /* | ||
62 | * Number of streams per DRP reservation between a pair of devices. | 67 | * Number of streams per DRP reservation between a pair of devices. |
63 | * | 68 | * |
64 | * [ECMA-368] section 16.8.6. | 69 | * [ECMA-368] section 16.8.6. |
@@ -94,6 +99,26 @@ enum { UWB_BEACON_SLOT_LENGTH_US = 85 }; | |||
94 | enum { UWB_MAX_LOST_BEACONS = 3 }; | 99 | enum { UWB_MAX_LOST_BEACONS = 3 }; |
95 | 100 | ||
96 | /* | 101 | /* |
102 | * mDRPBackOffWinMin | ||
103 | * | ||
104 | * The minimum number of superframes to wait before trying to reserve | ||
105 | * extra MAS. | ||
106 | * | ||
107 | * [ECMA-368] section 17.16 | ||
108 | */ | ||
109 | enum { UWB_DRP_BACKOFF_WIN_MIN = 2 }; | ||
110 | |||
111 | /* | ||
112 | * mDRPBackOffWinMax | ||
113 | * | ||
114 | * The maximum number of superframes to wait before trying to reserve | ||
115 | * extra MAS. | ||
116 | * | ||
117 | * [ECMA-368] section 17.16 | ||
118 | */ | ||
119 | enum { UWB_DRP_BACKOFF_WIN_MAX = 16 }; | ||
120 | |||
121 | /* | ||
97 | * Length of a superframe in microseconds. | 122 | * Length of a superframe in microseconds. |
98 | */ | 123 | */ |
99 | #define UWB_SUPERFRAME_LENGTH_US (UWB_MAS_LENGTH_US * UWB_NUM_MAS) | 124 | #define UWB_SUPERFRAME_LENGTH_US (UWB_MAS_LENGTH_US * UWB_NUM_MAS) |
@@ -200,6 +225,12 @@ enum uwb_drp_reason { | |||
200 | UWB_DRP_REASON_MODIFIED, | 225 | UWB_DRP_REASON_MODIFIED, |
201 | }; | 226 | }; |
202 | 227 | ||
228 | /** Relinquish Request Reason Codes ([ECMA-368] table 113) */ | ||
229 | enum uwb_relinquish_req_reason { | ||
230 | UWB_RELINQUISH_REQ_REASON_NON_SPECIFIC = 0, | ||
231 | UWB_RELINQUISH_REQ_REASON_OVER_ALLOCATION, | ||
232 | }; | ||
233 | |||
203 | /** | 234 | /** |
204 | * DRP Notification Reason Codes (WHCI 0.95 [3.1.4.9]) | 235 | * DRP Notification Reason Codes (WHCI 0.95 [3.1.4.9]) |
205 | */ | 236 | */ |
@@ -252,6 +283,7 @@ enum uwb_ie { | |||
252 | UWB_APP_SPEC_PROBE_IE = 15, | 283 | UWB_APP_SPEC_PROBE_IE = 15, |
253 | UWB_IDENTIFICATION_IE = 19, | 284 | UWB_IDENTIFICATION_IE = 19, |
254 | UWB_MASTER_KEY_ID_IE = 20, | 285 | UWB_MASTER_KEY_ID_IE = 20, |
286 | UWB_RELINQUISH_REQUEST_IE = 21, | ||
255 | UWB_IE_WLP = 250, /* WiMedia Logical Link Control Protocol WLP 0.99 */ | 287 | UWB_IE_WLP = 250, /* WiMedia Logical Link Control Protocol WLP 0.99 */ |
256 | UWB_APP_SPEC_IE = 255, | 288 | UWB_APP_SPEC_IE = 255, |
257 | }; | 289 | }; |
@@ -365,6 +397,27 @@ struct uwb_ie_drp_avail { | |||
365 | DECLARE_BITMAP(bmp, UWB_NUM_MAS); | 397 | DECLARE_BITMAP(bmp, UWB_NUM_MAS); |
366 | } __attribute__((packed)); | 398 | } __attribute__((packed)); |
367 | 399 | ||
400 | /* Relinqish Request IE ([ECMA-368] section 16.8.19). */ | ||
401 | struct uwb_relinquish_request_ie { | ||
402 | struct uwb_ie_hdr hdr; | ||
403 | __le16 relinquish_req_control; | ||
404 | struct uwb_dev_addr dev_addr; | ||
405 | struct uwb_drp_alloc allocs[]; | ||
406 | } __attribute__((packed)); | ||
407 | |||
408 | static inline int uwb_ie_relinquish_req_reason_code(struct uwb_relinquish_request_ie *ie) | ||
409 | { | ||
410 | return (le16_to_cpu(ie->relinquish_req_control) >> 0) & 0xf; | ||
411 | } | ||
412 | |||
413 | static inline void uwb_ie_relinquish_req_set_reason_code(struct uwb_relinquish_request_ie *ie, | ||
414 | int reason_code) | ||
415 | { | ||
416 | u16 ctrl = le16_to_cpu(ie->relinquish_req_control); | ||
417 | ctrl = (ctrl & ~(0xf << 0)) | (reason_code << 0); | ||
418 | ie->relinquish_req_control = cpu_to_le16(ctrl); | ||
419 | } | ||
420 | |||
368 | /** | 421 | /** |
369 | * The Vendor ID is set to an OUI that indicates the vendor of the device. | 422 | * The Vendor ID is set to an OUI that indicates the vendor of the device. |
370 | * ECMA-368 [16.8.10] | 423 | * ECMA-368 [16.8.10] |
diff --git a/include/linux/uwb/umc.h b/include/linux/uwb/umc.h index 36a39e34f8d7..4b4fc0f43855 100644 --- a/include/linux/uwb/umc.h +++ b/include/linux/uwb/umc.h | |||
@@ -89,6 +89,8 @@ struct umc_driver { | |||
89 | void (*remove)(struct umc_dev *); | 89 | void (*remove)(struct umc_dev *); |
90 | int (*suspend)(struct umc_dev *, pm_message_t state); | 90 | int (*suspend)(struct umc_dev *, pm_message_t state); |
91 | int (*resume)(struct umc_dev *); | 91 | int (*resume)(struct umc_dev *); |
92 | int (*pre_reset)(struct umc_dev *); | ||
93 | int (*post_reset)(struct umc_dev *); | ||
92 | 94 | ||
93 | struct device_driver driver; | 95 | struct device_driver driver; |
94 | }; | 96 | }; |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 1f126e30766c..5571dbe1c0ad 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1370,25 +1370,41 @@ struct v4l2_streamparm { | |||
1370 | /* | 1370 | /* |
1371 | * A D V A N C E D D E B U G G I N G | 1371 | * A D V A N C E D D E B U G G I N G |
1372 | * | 1372 | * |
1373 | * NOTE: EXPERIMENTAL API | 1373 | * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! |
1374 | * FOR DEBUGGING, TESTING AND INTERNAL USE ONLY! | ||
1374 | */ | 1375 | */ |
1375 | 1376 | ||
1376 | /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ | 1377 | /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ |
1377 | 1378 | ||
1378 | #define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ | 1379 | #define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ |
1379 | #define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver ID */ | 1380 | #define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver name */ |
1380 | #define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ | 1381 | #define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ |
1381 | #define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */ | 1382 | #define V4L2_CHIP_MATCH_AC97 3 /* Match against anciliary AC97 chip */ |
1382 | 1383 | ||
1383 | struct v4l2_register { | 1384 | struct v4l2_dbg_match { |
1384 | __u32 match_type; /* Match type */ | 1385 | __u32 type; /* Match type */ |
1385 | __u32 match_chip; /* Match this chip, meaning determined by match_type */ | 1386 | union { /* Match this chip, meaning determined by type */ |
1387 | __u32 addr; | ||
1388 | char name[32]; | ||
1389 | }; | ||
1390 | } __attribute__ ((packed)); | ||
1391 | |||
1392 | struct v4l2_dbg_register { | ||
1393 | struct v4l2_dbg_match match; | ||
1394 | __u32 size; /* register size in bytes */ | ||
1386 | __u64 reg; | 1395 | __u64 reg; |
1387 | __u64 val; | 1396 | __u64 val; |
1388 | }; | 1397 | } __attribute__ ((packed)); |
1398 | |||
1399 | /* VIDIOC_DBG_G_CHIP_IDENT */ | ||
1400 | struct v4l2_dbg_chip_ident { | ||
1401 | struct v4l2_dbg_match match; | ||
1402 | __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */ | ||
1403 | __u32 revision; /* chip revision, chip specific */ | ||
1404 | } __attribute__ ((packed)); | ||
1389 | 1405 | ||
1390 | /* VIDIOC_G_CHIP_IDENT */ | 1406 | /* VIDIOC_G_CHIP_IDENT_OLD: Deprecated, do not use */ |
1391 | struct v4l2_chip_ident { | 1407 | struct v4l2_chip_ident_old { |
1392 | __u32 match_type; /* Match type */ | 1408 | __u32 match_type; /* Match type */ |
1393 | __u32 match_chip; /* Match this chip, meaning determined by match_type */ | 1409 | __u32 match_chip; /* Match this chip, meaning determined by match_type */ |
1394 | __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */ | 1410 | __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */ |
@@ -1460,13 +1476,22 @@ struct v4l2_chip_ident { | |||
1460 | #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) | 1476 | #define VIDIOC_G_ENC_INDEX _IOR('V', 76, struct v4l2_enc_idx) |
1461 | #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) | 1477 | #define VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) |
1462 | #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) | 1478 | #define VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) |
1479 | #endif | ||
1463 | 1480 | ||
1464 | /* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | 1481 | #if 1 |
1465 | #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_register) | 1482 | /* Experimental, meant for debugging, testing and internal use. |
1466 | #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_register) | 1483 | Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined. |
1467 | 1484 | You must be root to use these ioctls. Never use these in applications! */ | |
1468 | #define VIDIOC_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_chip_ident) | 1485 | #define VIDIOC_DBG_S_REGISTER _IOW('V', 79, struct v4l2_dbg_register) |
1486 | #define VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register) | ||
1487 | |||
1488 | /* Experimental, meant for debugging, testing and internal use. | ||
1489 | Never use this ioctl in applications! */ | ||
1490 | #define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident) | ||
1491 | /* This is deprecated and will go away in 2.6.30 */ | ||
1492 | #define VIDIOC_G_CHIP_IDENT_OLD _IOWR('V', 81, struct v4l2_chip_ident_old) | ||
1469 | #endif | 1493 | #endif |
1494 | |||
1470 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) | 1495 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) |
1471 | /* Reminder: when adding new ioctls please add support for them to | 1496 | /* Reminder: when adding new ioctls please add support for them to |
1472 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 1497 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
diff --git a/include/linux/wlp.h b/include/linux/wlp.h index 033545e145c7..ac95ce6606ac 100644 --- a/include/linux/wlp.h +++ b/include/linux/wlp.h | |||
@@ -646,6 +646,7 @@ struct wlp_wss { | |||
646 | struct wlp { | 646 | struct wlp { |
647 | struct mutex mutex; | 647 | struct mutex mutex; |
648 | struct uwb_rc *rc; /* UWB radio controller */ | 648 | struct uwb_rc *rc; /* UWB radio controller */ |
649 | struct net_device *ndev; | ||
649 | struct uwb_pal pal; | 650 | struct uwb_pal pal; |
650 | struct wlp_eda eda; | 651 | struct wlp_eda eda; |
651 | struct wlp_uuid uuid; | 652 | struct wlp_uuid uuid; |
@@ -675,7 +676,7 @@ struct wlp_wss_attribute { | |||
675 | static struct wlp_wss_attribute wss_attr_##_name = __ATTR(_name, _mode, \ | 676 | static struct wlp_wss_attribute wss_attr_##_name = __ATTR(_name, _mode, \ |
676 | _show, _store) | 677 | _show, _store) |
677 | 678 | ||
678 | extern int wlp_setup(struct wlp *, struct uwb_rc *); | 679 | extern int wlp_setup(struct wlp *, struct uwb_rc *, struct net_device *ndev); |
679 | extern void wlp_remove(struct wlp *); | 680 | extern void wlp_remove(struct wlp *); |
680 | extern ssize_t wlp_neighborhood_show(struct wlp *, char *); | 681 | extern ssize_t wlp_neighborhood_show(struct wlp *, char *); |
681 | extern int wlp_wss_setup(struct net_device *, struct wlp_wss *); | 682 | extern int wlp_wss_setup(struct net_device *, struct wlp_wss *); |
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index 6bbb0d93bb5f..c8d0b23fde29 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
@@ -177,9 +177,9 @@ struct saa7146_ext_vv | |||
177 | int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); | 177 | int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); |
178 | 178 | ||
179 | struct saa7146_extension_ioctls *ioctls; | 179 | struct saa7146_extension_ioctls *ioctls; |
180 | int (*ioctl)(struct saa7146_fh*, unsigned int cmd, void *arg); | 180 | long (*ioctl)(struct saa7146_fh *, unsigned int cmd, void *arg); |
181 | 181 | ||
182 | struct file_operations vbi_fops; | 182 | struct v4l2_file_operations vbi_fops; |
183 | }; | 183 | }; |
184 | 184 | ||
185 | struct saa7146_use_ops { | 185 | struct saa7146_use_ops { |
@@ -216,7 +216,7 @@ void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data); | |||
216 | extern struct saa7146_use_ops saa7146_video_uops; | 216 | extern struct saa7146_use_ops saa7146_video_uops; |
217 | int saa7146_start_preview(struct saa7146_fh *fh); | 217 | int saa7146_start_preview(struct saa7146_fh *fh); |
218 | int saa7146_stop_preview(struct saa7146_fh *fh); | 218 | int saa7146_stop_preview(struct saa7146_fh *fh); |
219 | int saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); | 219 | long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); |
220 | 220 | ||
221 | /* from saa7146_vbi.c */ | 221 | /* from saa7146_vbi.c */ |
222 | extern struct saa7146_use_ops saa7146_vbi_uops; | 222 | extern struct saa7146_use_ops saa7146_vbi_uops; |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 425b6a98c95c..7440d9250665 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -164,12 +164,12 @@ struct soc_camera_ops { | |||
164 | unsigned long (*query_bus_param)(struct soc_camera_device *); | 164 | unsigned long (*query_bus_param)(struct soc_camera_device *); |
165 | int (*set_bus_param)(struct soc_camera_device *, unsigned long); | 165 | int (*set_bus_param)(struct soc_camera_device *, unsigned long); |
166 | int (*get_chip_id)(struct soc_camera_device *, | 166 | int (*get_chip_id)(struct soc_camera_device *, |
167 | struct v4l2_chip_ident *); | 167 | struct v4l2_dbg_chip_ident *); |
168 | int (*set_std)(struct soc_camera_device *, v4l2_std_id *); | 168 | int (*set_std)(struct soc_camera_device *, v4l2_std_id *); |
169 | int (*enum_input)(struct soc_camera_device *, struct v4l2_input *); | 169 | int (*enum_input)(struct soc_camera_device *, struct v4l2_input *); |
170 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 170 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
171 | int (*get_register)(struct soc_camera_device *, struct v4l2_register *); | 171 | int (*get_register)(struct soc_camera_device *, struct v4l2_dbg_register *); |
172 | int (*set_register)(struct soc_camera_device *, struct v4l2_register *); | 172 | int (*set_register)(struct soc_camera_device *, struct v4l2_dbg_register *); |
173 | #endif | 173 | #endif |
174 | int (*get_control)(struct soc_camera_device *, struct v4l2_control *); | 174 | int (*get_control)(struct soc_camera_device *, struct v4l2_control *); |
175 | int (*set_control)(struct soc_camera_device *, struct v4l2_control *); | 175 | int (*set_control)(struct soc_camera_device *, struct v4l2_control *); |
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 43dbb659f1f5..9aaf652b20ef 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -2,7 +2,7 @@ | |||
2 | v4l2 chip identifiers header | 2 | v4l2 chip identifiers header |
3 | 3 | ||
4 | This header provides a list of chip identifiers that can be returned | 4 | This header provides a list of chip identifiers that can be returned |
5 | through the VIDIOC_G_CHIP_IDENT ioctl. | 5 | through the VIDIOC_DBG_G_CHIP_IDENT ioctl. |
6 | 6 | ||
7 | Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl> | 7 | Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl> |
8 | 8 | ||
@@ -24,7 +24,7 @@ | |||
24 | #ifndef V4L2_CHIP_IDENT_H_ | 24 | #ifndef V4L2_CHIP_IDENT_H_ |
25 | #define V4L2_CHIP_IDENT_H_ | 25 | #define V4L2_CHIP_IDENT_H_ |
26 | 26 | ||
27 | /* VIDIOC_G_CHIP_IDENT: identifies the actual chip installed on the board */ | 27 | /* VIDIOC_DBG_G_CHIP_IDENT: identifies the actual chip installed on the board */ |
28 | enum { | 28 | enum { |
29 | /* general idents: reserved range 0-49 */ | 29 | /* general idents: reserved range 0-49 */ |
30 | V4L2_IDENT_NONE = 0, /* No chip matched */ | 30 | V4L2_IDENT_NONE = 0, /* No chip matched */ |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index f99c866d8c37..95e74f1874e1 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -114,10 +114,10 @@ u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id); | |||
114 | /* Register/chip ident helper function */ | 114 | /* Register/chip ident helper function */ |
115 | 115 | ||
116 | struct i2c_client; /* forward reference */ | 116 | struct i2c_client; /* forward reference */ |
117 | int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 id_type, u32 chip_id); | 117 | int v4l2_chip_match_i2c_client(struct i2c_client *c, const struct v4l2_dbg_match *match); |
118 | int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident *chip, | 118 | int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_dbg_chip_ident *chip, |
119 | u32 ident, u32 revision); | 119 | u32 ident, u32 revision); |
120 | int v4l2_chip_match_host(u32 id_type, u32 chip_id); | 120 | int v4l2_chip_match_host(const struct v4l2_dbg_match *match); |
121 | 121 | ||
122 | /* ------------------------------------------------------------------------- */ | 122 | /* ------------------------------------------------------------------------- */ |
123 | 123 | ||
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 0a88d1d17d30..e36faab8459b 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define VFL_TYPE_MAX 4 | 25 | #define VFL_TYPE_MAX 4 |
26 | 26 | ||
27 | struct v4l2_ioctl_callbacks; | 27 | struct v4l2_ioctl_callbacks; |
28 | struct video_device; | ||
28 | struct v4l2_device; | 29 | struct v4l2_device; |
29 | 30 | ||
30 | /* Flag to mark the video_device struct as unregistered. | 31 | /* Flag to mark the video_device struct as unregistered. |
@@ -32,6 +33,18 @@ struct v4l2_device; | |||
32 | device access. It is set by video_unregister_device. */ | 33 | device access. It is set by video_unregister_device. */ |
33 | #define V4L2_FL_UNREGISTERED (0) | 34 | #define V4L2_FL_UNREGISTERED (0) |
34 | 35 | ||
36 | struct v4l2_file_operations { | ||
37 | struct module *owner; | ||
38 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); | ||
39 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | ||
40 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | ||
41 | long (*ioctl) (struct file *, unsigned int, unsigned long); | ||
42 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | ||
43 | int (*mmap) (struct file *, struct vm_area_struct *); | ||
44 | int (*open) (struct file *); | ||
45 | int (*release) (struct file *); | ||
46 | }; | ||
47 | |||
35 | /* | 48 | /* |
36 | * Newer version of video_device, handled by videodev2.c | 49 | * Newer version of video_device, handled by videodev2.c |
37 | * This version moves redundant code from video device code to | 50 | * This version moves redundant code from video device code to |
@@ -41,7 +54,7 @@ struct v4l2_device; | |||
41 | struct video_device | 54 | struct video_device |
42 | { | 55 | { |
43 | /* device ops */ | 56 | /* device ops */ |
44 | const struct file_operations *fops; | 57 | const struct v4l2_file_operations *fops; |
45 | 58 | ||
46 | /* sysfs */ | 59 | /* sysfs */ |
47 | struct device dev; /* v4l device */ | 60 | struct device dev; /* v4l device */ |
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index 97b283a04289..9bf4ccc93dbf 100644 --- a/include/media/v4l2-device.h +++ b/include/media/v4l2-device.h | |||
@@ -80,7 +80,7 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd); | |||
80 | #define __v4l2_device_call_subdevs_until_err(dev, cond, o, f, args...) \ | 80 | #define __v4l2_device_call_subdevs_until_err(dev, cond, o, f, args...) \ |
81 | ({ \ | 81 | ({ \ |
82 | struct v4l2_subdev *sd; \ | 82 | struct v4l2_subdev *sd; \ |
83 | int err = 0; \ | 83 | long err = 0; \ |
84 | \ | 84 | \ |
85 | list_for_each_entry(sd, &(dev)->subdevs, list) { \ | 85 | list_for_each_entry(sd, &(dev)->subdevs, list) { \ |
86 | if ((cond) && sd->ops->o && sd->ops->o->f) \ | 86 | if ((cond) && sd->ops->o && sd->ops->o->f) \ |
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h index ecda3c725837..fbf585561570 100644 --- a/include/media/v4l2-int-device.h +++ b/include/media/v4l2-int-device.h | |||
@@ -219,7 +219,7 @@ enum v4l2_int_ioctl_num { | |||
219 | vidioc_int_reset_num, | 219 | vidioc_int_reset_num, |
220 | /* VIDIOC_INT_INIT */ | 220 | /* VIDIOC_INT_INIT */ |
221 | vidioc_int_init_num, | 221 | vidioc_int_init_num, |
222 | /* VIDIOC_INT_G_CHIP_IDENT */ | 222 | /* VIDIOC_DBG_G_CHIP_IDENT */ |
223 | vidioc_int_g_chip_ident_num, | 223 | vidioc_int_g_chip_ident_num, |
224 | 224 | ||
225 | /* | 225 | /* |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index fcdb58c4ce07..b01c044868d0 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -225,12 +225,12 @@ struct v4l2_ioctl_ops { | |||
225 | /* Debugging ioctls */ | 225 | /* Debugging ioctls */ |
226 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 226 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
227 | int (*vidioc_g_register) (struct file *file, void *fh, | 227 | int (*vidioc_g_register) (struct file *file, void *fh, |
228 | struct v4l2_register *reg); | 228 | struct v4l2_dbg_register *reg); |
229 | int (*vidioc_s_register) (struct file *file, void *fh, | 229 | int (*vidioc_s_register) (struct file *file, void *fh, |
230 | struct v4l2_register *reg); | 230 | struct v4l2_dbg_register *reg); |
231 | #endif | 231 | #endif |
232 | int (*vidioc_g_chip_ident) (struct file *file, void *fh, | 232 | int (*vidioc_g_chip_ident) (struct file *file, void *fh, |
233 | struct v4l2_chip_ident *chip); | 233 | struct v4l2_dbg_chip_ident *chip); |
234 | 234 | ||
235 | int (*vidioc_enum_framesizes) (struct file *file, void *fh, | 235 | int (*vidioc_enum_framesizes) (struct file *file, void *fh, |
236 | struct v4l2_frmsizeenum *fsize); | 236 | struct v4l2_frmsizeenum *fsize); |
@@ -239,7 +239,7 @@ struct v4l2_ioctl_ops { | |||
239 | struct v4l2_frmivalenum *fival); | 239 | struct v4l2_frmivalenum *fival); |
240 | 240 | ||
241 | /* For other private ioctls */ | 241 | /* For other private ioctls */ |
242 | int (*vidioc_default) (struct file *file, void *fh, | 242 | long (*vidioc_default) (struct file *file, void *fh, |
243 | int cmd, void *arg); | 243 | int cmd, void *arg); |
244 | }; | 244 | }; |
245 | 245 | ||
@@ -277,36 +277,27 @@ extern const char *v4l2_field_names[]; | |||
277 | extern const char *v4l2_type_names[]; | 277 | extern const char *v4l2_type_names[]; |
278 | 278 | ||
279 | /* Compatibility layer interface -- v4l1-compat module */ | 279 | /* Compatibility layer interface -- v4l1-compat module */ |
280 | typedef int (*v4l2_kioctl)(struct file *file, | 280 | typedef long (*v4l2_kioctl)(struct file *file, |
281 | unsigned int cmd, void *arg); | 281 | unsigned int cmd, void *arg); |
282 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 282 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
283 | int v4l_compat_translate_ioctl(struct file *file, | 283 | long v4l_compat_translate_ioctl(struct file *file, |
284 | int cmd, void *arg, v4l2_kioctl driver_ioctl); | 284 | int cmd, void *arg, v4l2_kioctl driver_ioctl); |
285 | #else | 285 | #else |
286 | #define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL) | 286 | #define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL) |
287 | #endif | 287 | #endif |
288 | 288 | ||
289 | #ifdef CONFIG_COMPAT | ||
289 | /* 32 Bits compatibility layer for 64 bits processors */ | 290 | /* 32 Bits compatibility layer for 64 bits processors */ |
290 | extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, | 291 | extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, |
291 | unsigned long arg); | 292 | unsigned long arg); |
293 | #endif | ||
292 | 294 | ||
293 | /* Include support for obsoleted stuff */ | 295 | /* Include support for obsoleted stuff */ |
294 | extern int video_usercopy(struct file *file, unsigned int cmd, | 296 | extern long video_usercopy(struct file *file, unsigned int cmd, |
295 | unsigned long arg, v4l2_kioctl func); | 297 | unsigned long arg, v4l2_kioctl func); |
296 | 298 | ||
297 | /* Standard handlers for V4L ioctl's */ | 299 | /* Standard handlers for V4L ioctl's */ |
298 | 300 | extern long video_ioctl2(struct file *file, | |
299 | /* This prototype is used on fops.unlocked_ioctl */ | ||
300 | extern long __video_ioctl2(struct file *file, | ||
301 | unsigned int cmd, unsigned long arg); | ||
302 | |||
303 | /* This prototype is used on fops.ioctl | ||
304 | * Since fops.ioctl enables Kernel Big Lock, it is preferred | ||
305 | * to use __video_ioctl2 instead. | ||
306 | * It should be noticed that there's no lock code inside | ||
307 | * video_ioctl2(). | ||
308 | */ | ||
309 | extern int video_ioctl2(struct inode *inode, struct file *file, | ||
310 | unsigned int cmd, unsigned long arg); | 301 | unsigned int cmd, unsigned long arg); |
311 | 302 | ||
312 | #endif /* _V4L2_IOCTL_H */ | 303 | #endif /* _V4L2_IOCTL_H */ |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index ceef016bb0b7..37b09e56e943 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -69,7 +69,7 @@ struct tuner_setup; | |||
69 | not yet implemented) since ops provide proper type-checking. | 69 | not yet implemented) since ops provide proper type-checking. |
70 | */ | 70 | */ |
71 | struct v4l2_subdev_core_ops { | 71 | struct v4l2_subdev_core_ops { |
72 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_chip_ident *chip); | 72 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); |
73 | int (*log_status)(struct v4l2_subdev *sd); | 73 | int (*log_status)(struct v4l2_subdev *sd); |
74 | int (*init)(struct v4l2_subdev *sd, u32 val); | 74 | int (*init)(struct v4l2_subdev *sd, u32 val); |
75 | int (*s_standby)(struct v4l2_subdev *sd, u32 standby); | 75 | int (*s_standby)(struct v4l2_subdev *sd, u32 standby); |
@@ -79,10 +79,10 @@ struct v4l2_subdev_core_ops { | |||
79 | int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 79 | int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
80 | int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); | 80 | int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); |
81 | int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); | 81 | int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); |
82 | int (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); | 82 | long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); |
83 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 83 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
84 | int (*g_register)(struct v4l2_subdev *sd, struct v4l2_register *reg); | 84 | int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); |
85 | int (*s_register)(struct v4l2_subdev *sd, struct v4l2_register *reg); | 85 | int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); |
86 | #endif | 86 | #endif |
87 | }; | 87 | }; |
88 | 88 | ||
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index ce532f2222ce..1459ed3e2697 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -155,9 +155,9 @@ static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const s | |||
155 | { | 155 | { |
156 | 156 | ||
157 | if (dev) | 157 | if (dev) |
158 | return __neigh_lookup(&nd_tbl, addr, dev, 1); | 158 | return __neigh_lookup_errno(&nd_tbl, addr, dev); |
159 | 159 | ||
160 | return NULL; | 160 | return ERR_PTR(-ENODEV); |
161 | } | 161 | } |
162 | 162 | ||
163 | 163 | ||
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index b6870cbaf2b3..426899e529c5 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h | |||
@@ -36,7 +36,7 @@ struct snd_tea575x_ops { | |||
36 | struct snd_tea575x { | 36 | struct snd_tea575x { |
37 | struct snd_card *card; | 37 | struct snd_card *card; |
38 | struct video_device vd; /* video device */ | 38 | struct video_device vd; /* video device */ |
39 | struct file_operations fops; | 39 | struct v4l2_file_operations fops; |
40 | int dev_nr; /* requested device number + 1 */ | 40 | int dev_nr; /* requested device number + 1 */ |
41 | int vd_registered; /* video device is registered */ | 41 | int vd_registered; /* video device is registered */ |
42 | int tea5759; /* 5759 chip is present */ | 42 | int tea5759; /* 5759 chip is present */ |