diff options
author | David Vrabel <david.vrabel@csr.com> | 2009-01-02 08:17:13 -0500 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2009-01-02 08:17:13 -0500 |
commit | b21a207141d83a06abc5f492b80204602e02ca44 (patch) | |
tree | f0152cde543008c72d7eb5c12c18095ad92785e6 /include/linux | |
parent | 3af373021fa32f8f787bfbdcc1a9277a287bde4e (diff) | |
parent | b58602a4bac012b5f4fc12fe6b46ab237b610d5d (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream
Conflicts:
drivers/uwb/wlp/eda.c
Diffstat (limited to 'include/linux')
147 files changed, 3900 insertions, 1180 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index e531783e5d78..95ac82340c3b 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -313,6 +313,7 @@ unifdef-y += ptrace.h | |||
313 | unifdef-y += qnx4_fs.h | 313 | unifdef-y += qnx4_fs.h |
314 | unifdef-y += quota.h | 314 | unifdef-y += quota.h |
315 | unifdef-y += random.h | 315 | unifdef-y += random.h |
316 | unifdef-y += irqnr.h | ||
316 | unifdef-y += reboot.h | 317 | unifdef-y += reboot.h |
317 | unifdef-y += reiserfs_fs.h | 318 | unifdef-y += reiserfs_fs.h |
318 | unifdef-y += reiserfs_xattr.h | 319 | unifdef-y += reiserfs_xattr.h |
diff --git a/include/linux/aio.h b/include/linux/aio.h index f6b8cf99b596..b16a957030f8 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/workqueue.h> | 5 | #include <linux/workqueue.h> |
6 | #include <linux/aio_abi.h> | 6 | #include <linux/aio_abi.h> |
7 | #include <linux/uio.h> | 7 | #include <linux/uio.h> |
8 | #include <linux/rcupdate.h> | ||
8 | 9 | ||
9 | #include <asm/atomic.h> | 10 | #include <asm/atomic.h> |
10 | 11 | ||
@@ -183,7 +184,7 @@ struct kioctx { | |||
183 | 184 | ||
184 | /* This needs improving */ | 185 | /* This needs improving */ |
185 | unsigned long user_id; | 186 | unsigned long user_id; |
186 | struct kioctx *next; | 187 | struct hlist_node list; |
187 | 188 | ||
188 | wait_queue_head_t wait; | 189 | wait_queue_head_t wait; |
189 | 190 | ||
@@ -199,6 +200,8 @@ struct kioctx { | |||
199 | struct aio_ring_info ring_info; | 200 | struct aio_ring_info ring_info; |
200 | 201 | ||
201 | struct delayed_work wq; | 202 | struct delayed_work wq; |
203 | |||
204 | struct rcu_head rcu_head; | ||
202 | }; | 205 | }; |
203 | 206 | ||
204 | /* prototypes */ | 207 | /* prototypes */ |
diff --git a/include/linux/atm.h b/include/linux/atm.h index c791ddd96939..d3b292174aeb 100644 --- a/include/linux/atm.h +++ b/include/linux/atm.h | |||
@@ -231,10 +231,21 @@ static __inline__ int atmpvc_addr_in_use(struct sockaddr_atmpvc addr) | |||
231 | */ | 231 | */ |
232 | 232 | ||
233 | struct atmif_sioc { | 233 | struct atmif_sioc { |
234 | int number; | 234 | int number; |
235 | int length; | 235 | int length; |
236 | void __user *arg; | 236 | void __user *arg; |
237 | }; | 237 | }; |
238 | 238 | ||
239 | #ifdef __KERNEL__ | ||
240 | #ifdef CONFIG_COMPAT | ||
241 | #include <linux/compat.h> | ||
242 | struct compat_atmif_sioc { | ||
243 | int number; | ||
244 | int length; | ||
245 | compat_uptr_t arg; | ||
246 | }; | ||
247 | #endif | ||
248 | #endif | ||
249 | |||
239 | typedef unsigned short atm_backend_t; | 250 | typedef unsigned short atm_backend_t; |
240 | #endif | 251 | #endif |
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index a3d07c29d16c..086e5c362d3a 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -100,6 +100,10 @@ struct atm_dev_stats { | |||
100 | /* use backend to make new if */ | 100 | /* use backend to make new if */ |
101 | #define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf) | 101 | #define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf) |
102 | /* add party to p2mp call */ | 102 | /* add party to p2mp call */ |
103 | #ifdef CONFIG_COMPAT | ||
104 | /* It actually takes struct sockaddr_atmsvc, not struct atm_iobuf */ | ||
105 | #define COMPAT_ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct compat_atm_iobuf) | ||
106 | #endif | ||
103 | #define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int) | 107 | #define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int) |
104 | /* drop party from p2mp call */ | 108 | /* drop party from p2mp call */ |
105 | 109 | ||
@@ -224,6 +228,13 @@ struct atm_cirange { | |||
224 | extern struct proc_dir_entry *atm_proc_root; | 228 | extern struct proc_dir_entry *atm_proc_root; |
225 | #endif | 229 | #endif |
226 | 230 | ||
231 | #ifdef CONFIG_COMPAT | ||
232 | #include <linux/compat.h> | ||
233 | struct compat_atm_iobuf { | ||
234 | int length; | ||
235 | compat_uptr_t buffer; | ||
236 | }; | ||
237 | #endif | ||
227 | 238 | ||
228 | struct k_atm_aal_stats { | 239 | struct k_atm_aal_stats { |
229 | #define __HANDLE_ITEM(i) atomic_t i | 240 | #define __HANDLE_ITEM(i) atomic_t i |
@@ -379,6 +390,10 @@ struct atmdev_ops { /* only send is required */ | |||
379 | int (*open)(struct atm_vcc *vcc); | 390 | int (*open)(struct atm_vcc *vcc); |
380 | void (*close)(struct atm_vcc *vcc); | 391 | void (*close)(struct atm_vcc *vcc); |
381 | int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void __user *arg); | 392 | int (*ioctl)(struct atm_dev *dev,unsigned int cmd,void __user *arg); |
393 | #ifdef CONFIG_COMPAT | ||
394 | int (*compat_ioctl)(struct atm_dev *dev,unsigned int cmd, | ||
395 | void __user *arg); | ||
396 | #endif | ||
382 | int (*getsockopt)(struct atm_vcc *vcc,int level,int optname, | 397 | int (*getsockopt)(struct atm_vcc *vcc,int level,int optname, |
383 | void __user *optval,int optlen); | 398 | void __user *optval,int optlen); |
384 | int (*setsockopt)(struct atm_vcc *vcc,int level,int optname, | 399 | int (*setsockopt)(struct atm_vcc *vcc,int level,int optname, |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 6272a395d43c..26c4f6f65a46 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -99,6 +99,8 @@ | |||
99 | #define AUDIT_OBJ_PID 1318 /* ptrace target */ | 99 | #define AUDIT_OBJ_PID 1318 /* ptrace target */ |
100 | #define AUDIT_TTY 1319 /* Input on an administrative TTY */ | 100 | #define AUDIT_TTY 1319 /* Input on an administrative TTY */ |
101 | #define AUDIT_EOE 1320 /* End of multi-record event */ | 101 | #define AUDIT_EOE 1320 /* End of multi-record event */ |
102 | #define AUDIT_BPRM_FCAPS 1321 /* Information about fcaps increasing perms */ | ||
103 | #define AUDIT_CAPSET 1322 /* Record showing argument to sys_capset */ | ||
102 | 104 | ||
103 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 105 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
104 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 106 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
@@ -391,6 +393,7 @@ extern int audit_classify_arch(int arch); | |||
391 | #ifdef CONFIG_AUDITSYSCALL | 393 | #ifdef CONFIG_AUDITSYSCALL |
392 | /* These are defined in auditsc.c */ | 394 | /* These are defined in auditsc.c */ |
393 | /* Public API */ | 395 | /* Public API */ |
396 | extern void audit_finish_fork(struct task_struct *child); | ||
394 | extern int audit_alloc(struct task_struct *task); | 397 | extern int audit_alloc(struct task_struct *task); |
395 | extern void audit_free(struct task_struct *task); | 398 | extern void audit_free(struct task_struct *task); |
396 | extern void audit_syscall_entry(int arch, | 399 | extern void audit_syscall_entry(int arch, |
@@ -434,7 +437,7 @@ static inline void audit_ptrace(struct task_struct *t) | |||
434 | 437 | ||
435 | /* Private API (for audit.c only) */ | 438 | /* Private API (for audit.c only) */ |
436 | extern unsigned int audit_serial(void); | 439 | extern unsigned int audit_serial(void); |
437 | extern void auditsc_get_stamp(struct audit_context *ctx, | 440 | extern int auditsc_get_stamp(struct audit_context *ctx, |
438 | struct timespec *t, unsigned int *serial); | 441 | struct timespec *t, unsigned int *serial); |
439 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 442 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); |
440 | #define audit_get_loginuid(t) ((t)->loginuid) | 443 | #define audit_get_loginuid(t) ((t)->loginuid) |
@@ -452,6 +455,10 @@ extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_pr | |||
452 | 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); | 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); |
453 | extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification); | 456 | extern int __audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification); |
454 | extern int __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, | ||
459 | const struct cred *new, | ||
460 | const struct cred *old); | ||
461 | extern int __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); | ||
455 | 462 | ||
456 | static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) | 463 | static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) |
457 | { | 464 | { |
@@ -501,9 +508,28 @@ static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) | |||
501 | return __audit_mq_getsetattr(mqdes, mqstat); | 508 | return __audit_mq_getsetattr(mqdes, mqstat); |
502 | return 0; | 509 | return 0; |
503 | } | 510 | } |
511 | |||
512 | static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, | ||
513 | const struct cred *new, | ||
514 | const struct cred *old) | ||
515 | { | ||
516 | if (unlikely(!audit_dummy_context())) | ||
517 | return __audit_log_bprm_fcaps(bprm, new, old); | ||
518 | return 0; | ||
519 | } | ||
520 | |||
521 | static inline int audit_log_capset(pid_t pid, const struct cred *new, | ||
522 | const struct cred *old) | ||
523 | { | ||
524 | if (unlikely(!audit_dummy_context())) | ||
525 | return __audit_log_capset(pid, new, old); | ||
526 | return 0; | ||
527 | } | ||
528 | |||
504 | extern int audit_n_rules; | 529 | extern int audit_n_rules; |
505 | extern int audit_signals; | 530 | extern int audit_signals; |
506 | #else | 531 | #else |
532 | #define audit_finish_fork(t) | ||
507 | #define audit_alloc(t) ({ 0; }) | 533 | #define audit_alloc(t) ({ 0; }) |
508 | #define audit_free(t) do { ; } while (0) | 534 | #define audit_free(t) do { ; } while (0) |
509 | #define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) | 535 | #define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) |
@@ -516,7 +542,7 @@ extern int audit_signals; | |||
516 | #define audit_inode(n,d) do { ; } while (0) | 542 | #define audit_inode(n,d) do { ; } while (0) |
517 | #define audit_inode_child(d,i,p) do { ; } while (0) | 543 | #define audit_inode_child(d,i,p) do { ; } while (0) |
518 | #define audit_core_dumps(i) do { ; } while (0) | 544 | #define audit_core_dumps(i) do { ; } while (0) |
519 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) | 545 | #define auditsc_get_stamp(c,t,s) (0) |
520 | #define audit_get_loginuid(t) (-1) | 546 | #define audit_get_loginuid(t) (-1) |
521 | #define audit_get_sessionid(t) (-1) | 547 | #define audit_get_sessionid(t) (-1) |
522 | #define audit_log_task_context(b) do { ; } while (0) | 548 | #define audit_log_task_context(b) do { ; } while (0) |
@@ -532,6 +558,8 @@ extern int audit_signals; | |||
532 | #define audit_mq_timedreceive(d,l,p,t) ({ 0; }) | 558 | #define audit_mq_timedreceive(d,l,p,t) ({ 0; }) |
533 | #define audit_mq_notify(d,n) ({ 0; }) | 559 | #define audit_mq_notify(d,n) ({ 0; }) |
534 | #define audit_mq_getsetattr(d,s) ({ 0; }) | 560 | #define audit_mq_getsetattr(d,s) ({ 0; }) |
561 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) | ||
562 | #define audit_log_capset(pid, ncr, ocr) ({ 0; }) | ||
535 | #define audit_ptrace(t) ((void)0) | 563 | #define audit_ptrace(t) ((void)0) |
536 | #define audit_n_rules 0 | 564 | #define audit_n_rules 0 |
537 | #define audit_signals 0 | 565 | #define audit_signals 0 |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 7394b5b349ff..6cbfbe297180 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -35,16 +35,20 @@ struct linux_binprm{ | |||
35 | struct mm_struct *mm; | 35 | struct mm_struct *mm; |
36 | unsigned long p; /* current top of mem */ | 36 | unsigned long p; /* current top of mem */ |
37 | unsigned int sh_bang:1, | 37 | unsigned int sh_bang:1, |
38 | misc_bang:1; | 38 | misc_bang:1, |
39 | cred_prepared:1,/* true if creds already prepared (multiple | ||
40 | * preps happen for interpreters) */ | ||
41 | cap_effective:1;/* true if has elevated effective capabilities, | ||
42 | * false if not; except for init which inherits | ||
43 | * its parent's caps anyway */ | ||
39 | #ifdef __alpha__ | 44 | #ifdef __alpha__ |
40 | unsigned int taso:1; | 45 | unsigned int taso:1; |
41 | #endif | 46 | #endif |
42 | unsigned int recursion_depth; | 47 | unsigned int recursion_depth; |
43 | struct file * file; | 48 | struct file * file; |
44 | int e_uid, e_gid; | 49 | struct cred *cred; /* new credentials */ |
45 | kernel_cap_t cap_post_exec_permitted; | 50 | int unsafe; /* how unsafe this exec is (mask of LSM_UNSAFE_*) */ |
46 | bool cap_effective; | 51 | unsigned int per_clear; /* bits to clear in current->personality */ |
47 | void *security; | ||
48 | int argc, envc; | 52 | int argc, envc; |
49 | char * filename; /* Name of binary as seen by procps */ | 53 | char * filename; /* Name of binary as seen by procps */ |
50 | char * interp; /* Name of the binary really executed. Most | 54 | char * interp; /* Name of the binary really executed. Most |
@@ -101,7 +105,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm, | |||
101 | int executable_stack); | 105 | int executable_stack); |
102 | extern int bprm_mm_init(struct linux_binprm *bprm); | 106 | extern int bprm_mm_init(struct linux_binprm *bprm); |
103 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | 107 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); |
104 | extern void compute_creds(struct linux_binprm *binprm); | 108 | extern void install_exec_creds(struct linux_binprm *bprm); |
105 | extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); | 109 | extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); |
106 | extern int set_binfmt(struct linux_binfmt *new); | 110 | extern int set_binfmt(struct linux_binfmt *new); |
107 | extern void free_bprm(struct linux_binprm *); | 111 | extern void free_bprm(struct linux_binprm *); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 6a642098e5c3..18462c5b8fff 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -90,10 +90,11 @@ struct bio { | |||
90 | 90 | ||
91 | unsigned int bi_comp_cpu; /* completion CPU */ | 91 | unsigned int bi_comp_cpu; /* completion CPU */ |
92 | 92 | ||
93 | atomic_t bi_cnt; /* pin count */ | ||
94 | |||
93 | struct bio_vec *bi_io_vec; /* the actual vec list */ | 95 | struct bio_vec *bi_io_vec; /* the actual vec list */ |
94 | 96 | ||
95 | bio_end_io_t *bi_end_io; | 97 | bio_end_io_t *bi_end_io; |
96 | atomic_t bi_cnt; /* pin count */ | ||
97 | 98 | ||
98 | void *bi_private; | 99 | void *bi_private; |
99 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 100 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
@@ -101,6 +102,13 @@ struct bio { | |||
101 | #endif | 102 | #endif |
102 | 103 | ||
103 | bio_destructor_t *bi_destructor; /* destructor */ | 104 | bio_destructor_t *bi_destructor; /* destructor */ |
105 | |||
106 | /* | ||
107 | * We can inline a number of vecs at the end of the bio, to avoid | ||
108 | * double allocations for a small number of bio_vecs. This member | ||
109 | * MUST obviously be kept at the very end of the bio. | ||
110 | */ | ||
111 | struct bio_vec bi_inline_vecs[0]; | ||
104 | }; | 112 | }; |
105 | 113 | ||
106 | /* | 114 | /* |
@@ -117,6 +125,7 @@ struct bio { | |||
117 | #define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ | 125 | #define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ |
118 | #define BIO_NULL_MAPPED 9 /* contains invalid user pages */ | 126 | #define BIO_NULL_MAPPED 9 /* contains invalid user pages */ |
119 | #define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ | 127 | #define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ |
128 | #define BIO_QUIET 11 /* Make BIO Quiet */ | ||
120 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) | 129 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) |
121 | 130 | ||
122 | /* | 131 | /* |
@@ -211,6 +220,11 @@ static inline void *bio_data(struct bio *bio) | |||
211 | return NULL; | 220 | return NULL; |
212 | } | 221 | } |
213 | 222 | ||
223 | static inline int bio_has_allocated_vec(struct bio *bio) | ||
224 | { | ||
225 | return bio->bi_io_vec && bio->bi_io_vec != bio->bi_inline_vecs; | ||
226 | } | ||
227 | |||
214 | /* | 228 | /* |
215 | * will die | 229 | * will die |
216 | */ | 230 | */ |
@@ -332,7 +346,7 @@ struct bio_pair { | |||
332 | extern struct bio_pair *bio_split(struct bio *bi, int first_sectors); | 346 | extern struct bio_pair *bio_split(struct bio *bi, int first_sectors); |
333 | extern void bio_pair_release(struct bio_pair *dbio); | 347 | extern void bio_pair_release(struct bio_pair *dbio); |
334 | 348 | ||
335 | extern struct bio_set *bioset_create(int, int); | 349 | extern struct bio_set *bioset_create(unsigned int, unsigned int); |
336 | extern void bioset_free(struct bio_set *); | 350 | extern void bioset_free(struct bio_set *); |
337 | 351 | ||
338 | extern struct bio *bio_alloc(gfp_t, int); | 352 | extern struct bio *bio_alloc(gfp_t, int); |
@@ -377,6 +391,7 @@ extern struct bio *bio_copy_user_iov(struct request_queue *, | |||
377 | extern int bio_uncopy_user(struct bio *); | 391 | extern int bio_uncopy_user(struct bio *); |
378 | void zero_fill_bio(struct bio *bio); | 392 | void zero_fill_bio(struct bio *bio); |
379 | extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *); | 393 | extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *); |
394 | extern void bvec_free_bs(struct bio_set *, struct bio_vec *, unsigned int); | ||
380 | extern unsigned int bvec_nr_vecs(unsigned short idx); | 395 | extern unsigned int bvec_nr_vecs(unsigned short idx); |
381 | 396 | ||
382 | /* | 397 | /* |
@@ -395,13 +410,17 @@ static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu) | |||
395 | */ | 410 | */ |
396 | #define BIO_POOL_SIZE 2 | 411 | #define BIO_POOL_SIZE 2 |
397 | #define BIOVEC_NR_POOLS 6 | 412 | #define BIOVEC_NR_POOLS 6 |
413 | #define BIOVEC_MAX_IDX (BIOVEC_NR_POOLS - 1) | ||
398 | 414 | ||
399 | struct bio_set { | 415 | struct bio_set { |
416 | struct kmem_cache *bio_slab; | ||
417 | unsigned int front_pad; | ||
418 | |||
400 | mempool_t *bio_pool; | 419 | mempool_t *bio_pool; |
401 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 420 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
402 | mempool_t *bio_integrity_pool; | 421 | mempool_t *bio_integrity_pool; |
403 | #endif | 422 | #endif |
404 | mempool_t *bvec_pools[BIOVEC_NR_POOLS]; | 423 | mempool_t *bvec_pool; |
405 | }; | 424 | }; |
406 | 425 | ||
407 | struct biovec_slab { | 426 | struct biovec_slab { |
@@ -411,6 +430,7 @@ struct biovec_slab { | |||
411 | }; | 430 | }; |
412 | 431 | ||
413 | extern struct bio_set *fs_bio_set; | 432 | extern struct bio_set *fs_bio_set; |
433 | extern struct biovec_slab bvec_slabs[BIOVEC_NR_POOLS] __read_mostly; | ||
414 | 434 | ||
415 | /* | 435 | /* |
416 | * a small number of entries is fine, not going to be performance critical. | 436 | * a small number of entries is fine, not going to be performance critical. |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 031a315c0509..7035cec583b6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -26,7 +26,6 @@ struct scsi_ioctl_command; | |||
26 | 26 | ||
27 | struct request_queue; | 27 | struct request_queue; |
28 | struct elevator_queue; | 28 | struct elevator_queue; |
29 | typedef struct elevator_queue elevator_t; | ||
30 | struct request_pm_state; | 29 | struct request_pm_state; |
31 | struct blk_trace; | 30 | struct blk_trace; |
32 | struct request; | 31 | struct request; |
@@ -313,7 +312,7 @@ struct request_queue | |||
313 | */ | 312 | */ |
314 | struct list_head queue_head; | 313 | struct list_head queue_head; |
315 | struct request *last_merge; | 314 | struct request *last_merge; |
316 | elevator_t *elevator; | 315 | struct elevator_queue *elevator; |
317 | 316 | ||
318 | /* | 317 | /* |
319 | * the queue request freelist, one for reads and one for writes | 318 | * the queue request freelist, one for reads and one for writes |
@@ -449,6 +448,7 @@ struct request_queue | |||
449 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ | 448 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ |
450 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ | 449 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ |
451 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 450 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
451 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | ||
452 | 452 | ||
453 | static inline int queue_is_locked(struct request_queue *q) | 453 | static inline int queue_is_locked(struct request_queue *q) |
454 | { | 454 | { |
@@ -522,22 +522,32 @@ enum { | |||
522 | * TAG_FLUSH : ordering by tag w/ pre and post flushes | 522 | * TAG_FLUSH : ordering by tag w/ pre and post flushes |
523 | * TAG_FUA : ordering by tag w/ pre flush and FUA write | 523 | * TAG_FUA : ordering by tag w/ pre flush and FUA write |
524 | */ | 524 | */ |
525 | QUEUE_ORDERED_NONE = 0x00, | 525 | QUEUE_ORDERED_BY_DRAIN = 0x01, |
526 | QUEUE_ORDERED_DRAIN = 0x01, | 526 | QUEUE_ORDERED_BY_TAG = 0x02, |
527 | QUEUE_ORDERED_TAG = 0x02, | 527 | QUEUE_ORDERED_DO_PREFLUSH = 0x10, |
528 | 528 | QUEUE_ORDERED_DO_BAR = 0x20, | |
529 | QUEUE_ORDERED_PREFLUSH = 0x10, | 529 | QUEUE_ORDERED_DO_POSTFLUSH = 0x40, |
530 | QUEUE_ORDERED_POSTFLUSH = 0x20, | 530 | QUEUE_ORDERED_DO_FUA = 0x80, |
531 | QUEUE_ORDERED_FUA = 0x40, | 531 | |
532 | 532 | QUEUE_ORDERED_NONE = 0x00, | |
533 | QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN | | 533 | |
534 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH, | 534 | QUEUE_ORDERED_DRAIN = QUEUE_ORDERED_BY_DRAIN | |
535 | QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN | | 535 | QUEUE_ORDERED_DO_BAR, |
536 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA, | 536 | QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN | |
537 | QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG | | 537 | QUEUE_ORDERED_DO_PREFLUSH | |
538 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH, | 538 | QUEUE_ORDERED_DO_POSTFLUSH, |
539 | QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG | | 539 | QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN | |
540 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA, | 540 | QUEUE_ORDERED_DO_PREFLUSH | |
541 | QUEUE_ORDERED_DO_FUA, | ||
542 | |||
543 | QUEUE_ORDERED_TAG = QUEUE_ORDERED_BY_TAG | | ||
544 | QUEUE_ORDERED_DO_BAR, | ||
545 | QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG | | ||
546 | QUEUE_ORDERED_DO_PREFLUSH | | ||
547 | QUEUE_ORDERED_DO_POSTFLUSH, | ||
548 | QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG | | ||
549 | QUEUE_ORDERED_DO_PREFLUSH | | ||
550 | QUEUE_ORDERED_DO_FUA, | ||
541 | 551 | ||
542 | /* | 552 | /* |
543 | * Ordered operation sequence | 553 | * Ordered operation sequence |
@@ -585,7 +595,6 @@ enum { | |||
585 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 595 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
586 | #define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD) | 596 | #define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD) |
587 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | 597 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) |
588 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) | ||
589 | /* rq->queuelist of dequeued request must be list_empty() */ | 598 | /* rq->queuelist of dequeued request must be list_empty() */ |
590 | #define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist)) | 599 | #define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist)) |
591 | 600 | ||
@@ -855,10 +864,10 @@ extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | |||
855 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | 864 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); |
856 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 865 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
857 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); | 866 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); |
858 | extern int blk_do_ordered(struct request_queue *, struct request **); | 867 | extern bool blk_do_ordered(struct request_queue *, struct request **); |
859 | extern unsigned blk_ordered_cur_seq(struct request_queue *); | 868 | extern unsigned blk_ordered_cur_seq(struct request_queue *); |
860 | extern unsigned blk_ordered_req_seq(struct request *); | 869 | extern unsigned blk_ordered_req_seq(struct request *); |
861 | extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int); | 870 | extern bool blk_ordered_complete_seq(struct request_queue *, unsigned, int); |
862 | 871 | ||
863 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 872 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
864 | extern void blk_dump_rq_flags(struct request *, char *); | 873 | extern void blk_dump_rq_flags(struct request *, char *); |
@@ -977,7 +986,6 @@ static inline void put_dev_sector(Sector p) | |||
977 | 986 | ||
978 | struct work_struct; | 987 | struct work_struct; |
979 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); | 988 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); |
980 | void kblockd_flush_work(struct work_struct *work); | ||
981 | 989 | ||
982 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 990 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
983 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) | 991 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index bdf505d33e77..1dba3493d520 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -160,7 +160,6 @@ struct blk_trace { | |||
160 | 160 | ||
161 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | 161 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); |
162 | extern void blk_trace_shutdown(struct request_queue *); | 162 | extern void blk_trace_shutdown(struct request_queue *); |
163 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | ||
164 | extern int do_blk_trace_setup(struct request_queue *q, | 163 | extern int do_blk_trace_setup(struct request_queue *q, |
165 | char *name, dev_t dev, struct blk_user_trace_setup *buts); | 164 | char *name, dev_t dev, struct blk_user_trace_setup *buts); |
166 | extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); | 165 | extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); |
@@ -186,168 +185,8 @@ extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); | |||
186 | } while (0) | 185 | } while (0) |
187 | #define BLK_TN_MAX_MSG 128 | 186 | #define BLK_TN_MAX_MSG 128 |
188 | 187 | ||
189 | /** | 188 | extern void blk_add_driver_data(struct request_queue *q, struct request *rq, |
190 | * blk_add_trace_rq - Add a trace for a request oriented action | 189 | void *data, size_t len); |
191 | * @q: queue the io is for | ||
192 | * @rq: the source request | ||
193 | * @what: the action | ||
194 | * | ||
195 | * Description: | ||
196 | * Records an action against a request. Will log the bio offset + size. | ||
197 | * | ||
198 | **/ | ||
199 | static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | ||
200 | u32 what) | ||
201 | { | ||
202 | struct blk_trace *bt = q->blk_trace; | ||
203 | int rw = rq->cmd_flags & 0x03; | ||
204 | |||
205 | if (likely(!bt)) | ||
206 | return; | ||
207 | |||
208 | if (blk_discard_rq(rq)) | ||
209 | rw |= (1 << BIO_RW_DISCARD); | ||
210 | |||
211 | if (blk_pc_request(rq)) { | ||
212 | what |= BLK_TC_ACT(BLK_TC_PC); | ||
213 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd); | ||
214 | } else { | ||
215 | what |= BLK_TC_ACT(BLK_TC_FS); | ||
216 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, rw, what, rq->errors, 0, NULL); | ||
217 | } | ||
218 | } | ||
219 | |||
220 | /** | ||
221 | * blk_add_trace_bio - Add a trace for a bio oriented action | ||
222 | * @q: queue the io is for | ||
223 | * @bio: the source bio | ||
224 | * @what: the action | ||
225 | * | ||
226 | * Description: | ||
227 | * Records an action against a bio. Will log the bio offset + size. | ||
228 | * | ||
229 | **/ | ||
230 | static inline void blk_add_trace_bio(struct request_queue *q, struct bio *bio, | ||
231 | u32 what) | ||
232 | { | ||
233 | struct blk_trace *bt = q->blk_trace; | ||
234 | |||
235 | if (likely(!bt)) | ||
236 | return; | ||
237 | |||
238 | __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), 0, NULL); | ||
239 | } | ||
240 | |||
241 | /** | ||
242 | * blk_add_trace_generic - Add a trace for a generic action | ||
243 | * @q: queue the io is for | ||
244 | * @bio: the source bio | ||
245 | * @rw: the data direction | ||
246 | * @what: the action | ||
247 | * | ||
248 | * Description: | ||
249 | * Records a simple trace | ||
250 | * | ||
251 | **/ | ||
252 | static inline void blk_add_trace_generic(struct request_queue *q, | ||
253 | struct bio *bio, int rw, u32 what) | ||
254 | { | ||
255 | struct blk_trace *bt = q->blk_trace; | ||
256 | |||
257 | if (likely(!bt)) | ||
258 | return; | ||
259 | |||
260 | if (bio) | ||
261 | blk_add_trace_bio(q, bio, what); | ||
262 | else | ||
263 | __blk_add_trace(bt, 0, 0, rw, what, 0, 0, NULL); | ||
264 | } | ||
265 | |||
266 | /** | ||
267 | * blk_add_trace_pdu_int - Add a trace for a bio with an integer payload | ||
268 | * @q: queue the io is for | ||
269 | * @what: the action | ||
270 | * @bio: the source bio | ||
271 | * @pdu: the integer payload | ||
272 | * | ||
273 | * Description: | ||
274 | * Adds a trace with some integer payload. This might be an unplug | ||
275 | * option given as the action, with the depth at unplug time given | ||
276 | * as the payload | ||
277 | * | ||
278 | **/ | ||
279 | static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what, | ||
280 | struct bio *bio, unsigned int pdu) | ||
281 | { | ||
282 | struct blk_trace *bt = q->blk_trace; | ||
283 | __be64 rpdu = cpu_to_be64(pdu); | ||
284 | |||
285 | if (likely(!bt)) | ||
286 | return; | ||
287 | |||
288 | if (bio) | ||
289 | __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), sizeof(rpdu), &rpdu); | ||
290 | else | ||
291 | __blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu); | ||
292 | } | ||
293 | |||
294 | /** | ||
295 | * blk_add_trace_remap - Add a trace for a remap operation | ||
296 | * @q: queue the io is for | ||
297 | * @bio: the source bio | ||
298 | * @dev: target device | ||
299 | * @from: source sector | ||
300 | * @to: target sector | ||
301 | * | ||
302 | * Description: | ||
303 | * Device mapper or raid target sometimes need to split a bio because | ||
304 | * it spans a stripe (or similar). Add a trace for that action. | ||
305 | * | ||
306 | **/ | ||
307 | static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | ||
308 | dev_t dev, sector_t from, sector_t to) | ||
309 | { | ||
310 | struct blk_trace *bt = q->blk_trace; | ||
311 | struct blk_io_trace_remap r; | ||
312 | |||
313 | if (likely(!bt)) | ||
314 | return; | ||
315 | |||
316 | r.device = cpu_to_be32(dev); | ||
317 | r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev); | ||
318 | r.sector = cpu_to_be64(to); | ||
319 | |||
320 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); | ||
321 | } | ||
322 | |||
323 | /** | ||
324 | * blk_add_driver_data - Add binary message with driver-specific data | ||
325 | * @q: queue the io is for | ||
326 | * @rq: io request | ||
327 | * @data: driver-specific data | ||
328 | * @len: length of driver-specific data | ||
329 | * | ||
330 | * Description: | ||
331 | * Some drivers might want to write driver-specific data per request. | ||
332 | * | ||
333 | **/ | ||
334 | static inline void blk_add_driver_data(struct request_queue *q, | ||
335 | struct request *rq, | ||
336 | void *data, size_t len) | ||
337 | { | ||
338 | struct blk_trace *bt = q->blk_trace; | ||
339 | |||
340 | if (likely(!bt)) | ||
341 | return; | ||
342 | |||
343 | if (blk_pc_request(rq)) | ||
344 | __blk_add_trace(bt, 0, rq->data_len, 0, BLK_TA_DRV_DATA, | ||
345 | rq->errors, len, data); | ||
346 | else | ||
347 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, | ||
348 | 0, BLK_TA_DRV_DATA, rq->errors, len, data); | ||
349 | } | ||
350 | |||
351 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, | 190 | extern int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, |
352 | char __user *arg); | 191 | char __user *arg); |
353 | extern int blk_trace_startstop(struct request_queue *q, int start); | 192 | extern int blk_trace_startstop(struct request_queue *q, int start); |
@@ -356,13 +195,8 @@ extern int blk_trace_remove(struct request_queue *q); | |||
356 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ | 195 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ |
357 | #define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) | 196 | #define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) |
358 | #define blk_trace_shutdown(q) do { } while (0) | 197 | #define blk_trace_shutdown(q) do { } while (0) |
359 | #define blk_add_trace_rq(q, rq, what) do { } while (0) | ||
360 | #define blk_add_trace_bio(q, rq, what) do { } while (0) | ||
361 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) | ||
362 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) | ||
363 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) | ||
364 | #define blk_add_driver_data(q, rq, data, len) do {} while (0) | ||
365 | #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) | 198 | #define do_blk_trace_setup(q, name, dev, buts) (-ENOTTY) |
199 | #define blk_add_driver_data(q, rq, data, len) do {} while (0) | ||
366 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) | 200 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) |
367 | #define blk_trace_startstop(q, start) (-ENOTTY) | 201 | #define blk_trace_startstop(q, start) (-ENOTTY) |
368 | #define blk_trace_remove(q) (-ENOTTY) | 202 | #define blk_trace_remove(q) (-ENOTTY) |
diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h index 777dbf695d44..27b1bcffe408 100644 --- a/include/linux/bottom_half.h +++ b/include/linux/bottom_half.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _LINUX_BH_H | 2 | #define _LINUX_BH_H |
3 | 3 | ||
4 | extern void local_bh_disable(void); | 4 | extern void local_bh_disable(void); |
5 | extern void __local_bh_enable(void); | ||
6 | extern void _local_bh_enable(void); | 5 | extern void _local_bh_enable(void); |
7 | extern void local_bh_enable(void); | 6 | extern void local_bh_enable(void); |
8 | extern void local_bh_enable_ip(unsigned long ip); | 7 | extern void local_bh_enable_ip(unsigned long ip); |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 3ce64b90118c..8605f8a74df9 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -35,6 +35,7 @@ enum bh_state_bits { | |||
35 | BH_Ordered, /* ordered write */ | 35 | BH_Ordered, /* ordered write */ |
36 | BH_Eopnotsupp, /* operation not supported (barrier) */ | 36 | BH_Eopnotsupp, /* operation not supported (barrier) */ |
37 | BH_Unwritten, /* Buffer is allocated on disk but not written */ | 37 | BH_Unwritten, /* Buffer is allocated on disk but not written */ |
38 | BH_Quiet, /* Buffer Error Prinks to be quiet */ | ||
38 | 39 | ||
39 | BH_PrivateStart,/* not a state bit, but the first bit available | 40 | BH_PrivateStart,/* not a state bit, but the first bit available |
40 | * for private allocation by other entities | 41 | * for private allocation by other entities |
diff --git a/include/linux/can/core.h b/include/linux/can/core.h index e9ca210ffa5b..f50785ad4781 100644 --- a/include/linux/can/core.h +++ b/include/linux/can/core.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/skbuff.h> | 19 | #include <linux/skbuff.h> |
20 | #include <linux/netdevice.h> | 20 | #include <linux/netdevice.h> |
21 | 21 | ||
22 | #define CAN_VERSION "20071116" | 22 | #define CAN_VERSION "20081130" |
23 | 23 | ||
24 | /* increment this number each time you change some user-space interface */ | 24 | /* increment this number each time you change some user-space interface */ |
25 | #define CAN_ABI_VERSION "8" | 25 | #define CAN_ABI_VERSION "8" |
diff --git a/include/linux/capability.h b/include/linux/capability.h index 9d1fe30b6f6c..e22f48c2a46f 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -53,6 +53,7 @@ typedef struct __user_cap_data_struct { | |||
53 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX | 53 | #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX |
54 | 54 | ||
55 | #define VFS_CAP_REVISION_MASK 0xFF000000 | 55 | #define VFS_CAP_REVISION_MASK 0xFF000000 |
56 | #define VFS_CAP_REVISION_SHIFT 24 | ||
56 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK | 57 | #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK |
57 | #define VFS_CAP_FLAGS_EFFECTIVE 0x000001 | 58 | #define VFS_CAP_FLAGS_EFFECTIVE 0x000001 |
58 | 59 | ||
@@ -68,6 +69,9 @@ typedef struct __user_cap_data_struct { | |||
68 | #define VFS_CAP_U32 VFS_CAP_U32_2 | 69 | #define VFS_CAP_U32 VFS_CAP_U32_2 |
69 | #define VFS_CAP_REVISION VFS_CAP_REVISION_2 | 70 | #define VFS_CAP_REVISION VFS_CAP_REVISION_2 |
70 | 71 | ||
72 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
73 | extern int file_caps_enabled; | ||
74 | #endif | ||
71 | 75 | ||
72 | struct vfs_cap_data { | 76 | struct vfs_cap_data { |
73 | __le32 magic_etc; /* Little endian */ | 77 | __le32 magic_etc; /* Little endian */ |
@@ -96,6 +100,13 @@ typedef struct kernel_cap_struct { | |||
96 | __u32 cap[_KERNEL_CAPABILITY_U32S]; | 100 | __u32 cap[_KERNEL_CAPABILITY_U32S]; |
97 | } kernel_cap_t; | 101 | } kernel_cap_t; |
98 | 102 | ||
103 | /* exact same as vfs_cap_data but in cpu endian and always filled completely */ | ||
104 | struct cpu_vfs_cap_data { | ||
105 | __u32 magic_etc; | ||
106 | kernel_cap_t permitted; | ||
107 | kernel_cap_t inheritable; | ||
108 | }; | ||
109 | |||
99 | #define _USER_CAP_HEADER_SIZE (sizeof(struct __user_cap_header_struct)) | 110 | #define _USER_CAP_HEADER_SIZE (sizeof(struct __user_cap_header_struct)) |
100 | #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) | 111 | #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) |
101 | 112 | ||
@@ -454,6 +465,13 @@ static inline int cap_isclear(const kernel_cap_t a) | |||
454 | return 1; | 465 | return 1; |
455 | } | 466 | } |
456 | 467 | ||
468 | /* | ||
469 | * Check if "a" is a subset of "set". | ||
470 | * return 1 if ALL of the capabilities in "a" are also in "set" | ||
471 | * cap_issubset(0101, 1111) will return 1 | ||
472 | * return 0 if ANY of the capabilities in "a" are not in "set" | ||
473 | * cap_issubset(1111, 0101) will return 0 | ||
474 | */ | ||
457 | static inline int cap_issubset(const kernel_cap_t a, const kernel_cap_t set) | 475 | static inline int cap_issubset(const kernel_cap_t a, const kernel_cap_t set) |
458 | { | 476 | { |
459 | kernel_cap_t dest; | 477 | kernel_cap_t dest; |
@@ -501,8 +519,6 @@ extern const kernel_cap_t __cap_empty_set; | |||
501 | extern const kernel_cap_t __cap_full_set; | 519 | extern const kernel_cap_t __cap_full_set; |
502 | extern const kernel_cap_t __cap_init_eff_set; | 520 | extern const kernel_cap_t __cap_init_eff_set; |
503 | 521 | ||
504 | kernel_cap_t cap_set_effective(const kernel_cap_t pE_new); | ||
505 | |||
506 | /** | 522 | /** |
507 | * has_capability - Determine if a task has a superior capability available | 523 | * has_capability - Determine if a task has a superior capability available |
508 | * @t: The task in question | 524 | * @t: The task in question |
@@ -514,9 +530,14 @@ kernel_cap_t cap_set_effective(const kernel_cap_t pE_new); | |||
514 | * Note that this does not set PF_SUPERPRIV on the task. | 530 | * Note that this does not set PF_SUPERPRIV on the task. |
515 | */ | 531 | */ |
516 | #define has_capability(t, cap) (security_capable((t), (cap)) == 0) | 532 | #define has_capability(t, cap) (security_capable((t), (cap)) == 0) |
533 | #define has_capability_noaudit(t, cap) (security_capable_noaudit((t), (cap)) == 0) | ||
517 | 534 | ||
518 | extern int capable(int cap); | 535 | extern int capable(int cap); |
519 | 536 | ||
537 | /* audit system wants to get cap info from files as well */ | ||
538 | struct dentry; | ||
539 | extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); | ||
540 | |||
520 | #endif /* __KERNEL__ */ | 541 | #endif /* __KERNEL__ */ |
521 | 542 | ||
522 | #endif /* !_LINUX_CAPABILITY_H */ | 543 | #endif /* !_LINUX_CAPABILITY_H */ |
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 9c22396e8b50..9c8d31bacf46 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -54,3 +54,9 @@ SUBSYS(freezer) | |||
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | /* */ | 56 | /* */ |
57 | |||
58 | #ifdef CONFIG_NET_CLS_CGROUP | ||
59 | SUBSYS(net_cls) | ||
60 | #endif | ||
61 | |||
62 | /* */ | ||
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 98115d9d04da..ea7c6be354b7 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -59,8 +59,88 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
59 | * specific implementations come from the above header files | 59 | * specific implementations come from the above header files |
60 | */ | 60 | */ |
61 | 61 | ||
62 | #define likely(x) __builtin_expect(!!(x), 1) | 62 | struct ftrace_branch_data { |
63 | #define unlikely(x) __builtin_expect(!!(x), 0) | 63 | const char *func; |
64 | const char *file; | ||
65 | unsigned line; | ||
66 | union { | ||
67 | struct { | ||
68 | unsigned long correct; | ||
69 | unsigned long incorrect; | ||
70 | }; | ||
71 | struct { | ||
72 | unsigned long miss; | ||
73 | unsigned long hit; | ||
74 | }; | ||
75 | }; | ||
76 | }; | ||
77 | |||
78 | /* | ||
79 | * Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code | ||
80 | * to disable branch tracing on a per file basis. | ||
81 | */ | ||
82 | #if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING) | ||
83 | void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | ||
84 | |||
85 | #define likely_notrace(x) __builtin_expect(!!(x), 1) | ||
86 | #define unlikely_notrace(x) __builtin_expect(!!(x), 0) | ||
87 | |||
88 | #define __branch_check__(x, expect) ({ \ | ||
89 | int ______r; \ | ||
90 | static struct ftrace_branch_data \ | ||
91 | __attribute__((__aligned__(4))) \ | ||
92 | __attribute__((section("_ftrace_annotated_branch"))) \ | ||
93 | ______f = { \ | ||
94 | .func = __func__, \ | ||
95 | .file = __FILE__, \ | ||
96 | .line = __LINE__, \ | ||
97 | }; \ | ||
98 | ______r = likely_notrace(x); \ | ||
99 | ftrace_likely_update(&______f, ______r, expect); \ | ||
100 | ______r; \ | ||
101 | }) | ||
102 | |||
103 | /* | ||
104 | * Using __builtin_constant_p(x) to ignore cases where the return | ||
105 | * value is always the same. This idea is taken from a similar patch | ||
106 | * written by Daniel Walker. | ||
107 | */ | ||
108 | # ifndef likely | ||
109 | # define likely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 1)) | ||
110 | # endif | ||
111 | # ifndef unlikely | ||
112 | # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) | ||
113 | # endif | ||
114 | |||
115 | #ifdef CONFIG_PROFILE_ALL_BRANCHES | ||
116 | /* | ||
117 | * "Define 'is'", Bill Clinton | ||
118 | * "Define 'if'", Steven Rostedt | ||
119 | */ | ||
120 | #define if(cond) if (__builtin_constant_p((cond)) ? !!(cond) : \ | ||
121 | ({ \ | ||
122 | int ______r; \ | ||
123 | static struct ftrace_branch_data \ | ||
124 | __attribute__((__aligned__(4))) \ | ||
125 | __attribute__((section("_ftrace_branch"))) \ | ||
126 | ______f = { \ | ||
127 | .func = __func__, \ | ||
128 | .file = __FILE__, \ | ||
129 | .line = __LINE__, \ | ||
130 | }; \ | ||
131 | ______r = !!(cond); \ | ||
132 | if (______r) \ | ||
133 | ______f.hit++; \ | ||
134 | else \ | ||
135 | ______f.miss++; \ | ||
136 | ______r; \ | ||
137 | })) | ||
138 | #endif /* CONFIG_PROFILE_ALL_BRANCHES */ | ||
139 | |||
140 | #else | ||
141 | # define likely(x) __builtin_expect(!!(x), 1) | ||
142 | # define unlikely(x) __builtin_expect(!!(x), 0) | ||
143 | #endif | ||
64 | 144 | ||
65 | /* Optimization barrier */ | 145 | /* Optimization barrier */ |
66 | #ifndef barrier | 146 | #ifndef barrier |
diff --git a/include/linux/console.h b/include/linux/console.h index 248e6e3b9b73..a67a90cf8268 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -153,4 +153,8 @@ void vcs_remove_sysfs(struct tty_struct *tty); | |||
153 | #define VESA_HSYNC_SUSPEND 2 | 153 | #define VESA_HSYNC_SUSPEND 2 |
154 | #define VESA_POWERDOWN 3 | 154 | #define VESA_POWERDOWN 3 |
155 | 155 | ||
156 | #ifdef CONFIG_VGA_CONSOLE | ||
157 | extern bool vgacon_text_force(void); | ||
158 | #endif | ||
159 | |||
156 | #endif /* _LINUX_CONSOLE_H */ | 160 | #endif /* _LINUX_CONSOLE_H */ |
diff --git a/include/linux/crc32c.h b/include/linux/crc32c.h index 508f512e5a2f..bd8b44d96bdc 100644 --- a/include/linux/crc32c.h +++ b/include/linux/crc32c.h | |||
@@ -3,9 +3,9 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | extern u32 crc32c_le(u32 crc, unsigned char const *address, size_t length); | 6 | extern u32 crc32c(u32 crc, const void *address, unsigned int length); |
7 | extern u32 crc32c_be(u32 crc, unsigned char const *address, size_t length); | ||
8 | 7 | ||
9 | #define crc32c(seed, data, length) crc32c_le(seed, (unsigned char const *)data, length) | 8 | /* This macro exists for backwards-compatibility. */ |
9 | #define crc32c_le crc32c | ||
10 | 10 | ||
11 | #endif /* _LINUX_CRC32C_H */ | 11 | #endif /* _LINUX_CRC32C_H */ |
diff --git a/include/linux/cred.h b/include/linux/cred.h index b69222cc1fd2..3282ee4318e7 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Credentials management | 1 | /* Credentials management - see Documentation/credentials.txt |
2 | * | 2 | * |
3 | * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. | 3 | * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. |
4 | * Written by David Howells (dhowells@redhat.com) | 4 | * Written by David Howells (dhowells@redhat.com) |
@@ -12,39 +12,335 @@ | |||
12 | #ifndef _LINUX_CRED_H | 12 | #ifndef _LINUX_CRED_H |
13 | #define _LINUX_CRED_H | 13 | #define _LINUX_CRED_H |
14 | 14 | ||
15 | #define get_current_user() (get_uid(current->user)) | 15 | #include <linux/capability.h> |
16 | #include <linux/key.h> | ||
17 | #include <asm/atomic.h> | ||
16 | 18 | ||
17 | #define task_uid(task) ((task)->uid) | 19 | struct user_struct; |
18 | #define task_gid(task) ((task)->gid) | 20 | struct cred; |
19 | #define task_euid(task) ((task)->euid) | 21 | struct inode; |
20 | #define task_egid(task) ((task)->egid) | ||
21 | 22 | ||
22 | #define current_uid() (current->uid) | 23 | /* |
23 | #define current_gid() (current->gid) | 24 | * COW Supplementary groups list |
24 | #define current_euid() (current->euid) | 25 | */ |
25 | #define current_egid() (current->egid) | 26 | #define NGROUPS_SMALL 32 |
26 | #define current_suid() (current->suid) | 27 | #define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t))) |
27 | #define current_sgid() (current->sgid) | 28 | |
28 | #define current_fsuid() (current->fsuid) | 29 | struct group_info { |
29 | #define current_fsgid() (current->fsgid) | 30 | atomic_t usage; |
30 | #define current_cap() (current->cap_effective) | 31 | int ngroups; |
32 | int nblocks; | ||
33 | gid_t small_block[NGROUPS_SMALL]; | ||
34 | gid_t *blocks[0]; | ||
35 | }; | ||
36 | |||
37 | /** | ||
38 | * get_group_info - Get a reference to a group info structure | ||
39 | * @group_info: The group info to reference | ||
40 | * | ||
41 | * This gets a reference to a set of supplementary groups. | ||
42 | * | ||
43 | * If the caller is accessing a task's credentials, they must hold the RCU read | ||
44 | * lock when reading. | ||
45 | */ | ||
46 | static inline struct group_info *get_group_info(struct group_info *gi) | ||
47 | { | ||
48 | atomic_inc(&gi->usage); | ||
49 | return gi; | ||
50 | } | ||
51 | |||
52 | /** | ||
53 | * put_group_info - Release a reference to a group info structure | ||
54 | * @group_info: The group info to release | ||
55 | */ | ||
56 | #define put_group_info(group_info) \ | ||
57 | do { \ | ||
58 | if (atomic_dec_and_test(&(group_info)->usage)) \ | ||
59 | groups_free(group_info); \ | ||
60 | } while (0) | ||
61 | |||
62 | extern struct group_info *groups_alloc(int); | ||
63 | extern struct group_info init_groups; | ||
64 | extern void groups_free(struct group_info *); | ||
65 | extern int set_current_groups(struct group_info *); | ||
66 | extern int set_groups(struct cred *, struct group_info *); | ||
67 | extern int groups_search(const struct group_info *, gid_t); | ||
68 | |||
69 | /* access the groups "array" with this macro */ | ||
70 | #define GROUP_AT(gi, i) \ | ||
71 | ((gi)->blocks[(i) / NGROUPS_PER_BLOCK][(i) % NGROUPS_PER_BLOCK]) | ||
72 | |||
73 | extern int in_group_p(gid_t); | ||
74 | extern int in_egroup_p(gid_t); | ||
75 | |||
76 | /* | ||
77 | * The common credentials for a thread group | ||
78 | * - shared by CLONE_THREAD | ||
79 | */ | ||
80 | #ifdef CONFIG_KEYS | ||
81 | struct thread_group_cred { | ||
82 | atomic_t usage; | ||
83 | pid_t tgid; /* thread group process ID */ | ||
84 | spinlock_t lock; | ||
85 | struct key *session_keyring; /* keyring inherited over fork */ | ||
86 | struct key *process_keyring; /* keyring private to this process */ | ||
87 | struct rcu_head rcu; /* RCU deletion hook */ | ||
88 | }; | ||
89 | #endif | ||
90 | |||
91 | /* | ||
92 | * The security context of a task | ||
93 | * | ||
94 | * The parts of the context break down into two categories: | ||
95 | * | ||
96 | * (1) The objective context of a task. These parts are used when some other | ||
97 | * task is attempting to affect this one. | ||
98 | * | ||
99 | * (2) The subjective context. These details are used when the task is acting | ||
100 | * upon another object, be that a file, a task, a key or whatever. | ||
101 | * | ||
102 | * Note that some members of this structure belong to both categories - the | ||
103 | * LSM security pointer for instance. | ||
104 | * | ||
105 | * A task has two security pointers. task->real_cred points to the objective | ||
106 | * context that defines that task's actual details. The objective part of this | ||
107 | * context is used whenever that task is acted upon. | ||
108 | * | ||
109 | * task->cred points to the subjective context that defines the details of how | ||
110 | * that task is going to act upon another object. This may be overridden | ||
111 | * temporarily to point to another security context, but normally points to the | ||
112 | * same context as task->real_cred. | ||
113 | */ | ||
114 | struct cred { | ||
115 | atomic_t usage; | ||
116 | uid_t uid; /* real UID of the task */ | ||
117 | gid_t gid; /* real GID of the task */ | ||
118 | uid_t suid; /* saved UID of the task */ | ||
119 | gid_t sgid; /* saved GID of the task */ | ||
120 | uid_t euid; /* effective UID of the task */ | ||
121 | gid_t egid; /* effective GID of the task */ | ||
122 | uid_t fsuid; /* UID for VFS ops */ | ||
123 | gid_t fsgid; /* GID for VFS ops */ | ||
124 | unsigned securebits; /* SUID-less security management */ | ||
125 | kernel_cap_t cap_inheritable; /* caps our children can inherit */ | ||
126 | kernel_cap_t cap_permitted; /* caps we're permitted */ | ||
127 | kernel_cap_t cap_effective; /* caps we can actually use */ | ||
128 | kernel_cap_t cap_bset; /* capability bounding set */ | ||
129 | #ifdef CONFIG_KEYS | ||
130 | unsigned char jit_keyring; /* default keyring to attach requested | ||
131 | * keys to */ | ||
132 | struct key *thread_keyring; /* keyring private to this thread */ | ||
133 | struct key *request_key_auth; /* assumed request_key authority */ | ||
134 | struct thread_group_cred *tgcred; /* thread-group shared credentials */ | ||
135 | #endif | ||
136 | #ifdef CONFIG_SECURITY | ||
137 | void *security; /* subjective LSM security */ | ||
138 | #endif | ||
139 | struct user_struct *user; /* real user ID subscription */ | ||
140 | struct group_info *group_info; /* supplementary groups for euid/fsgid */ | ||
141 | struct rcu_head rcu; /* RCU deletion hook */ | ||
142 | }; | ||
143 | |||
144 | extern void __put_cred(struct cred *); | ||
145 | extern int copy_creds(struct task_struct *, unsigned long); | ||
146 | extern struct cred *prepare_creds(void); | ||
147 | extern struct cred *prepare_exec_creds(void); | ||
148 | extern struct cred *prepare_usermodehelper_creds(void); | ||
149 | extern int commit_creds(struct cred *); | ||
150 | extern void abort_creds(struct cred *); | ||
151 | extern const struct cred *override_creds(const struct cred *); | ||
152 | extern void revert_creds(const struct cred *); | ||
153 | extern struct cred *prepare_kernel_cred(struct task_struct *); | ||
154 | extern int change_create_files_as(struct cred *, struct inode *); | ||
155 | extern int set_security_override(struct cred *, u32); | ||
156 | extern int set_security_override_from_ctx(struct cred *, const char *); | ||
157 | extern int set_create_files_as(struct cred *, struct inode *); | ||
158 | extern void __init cred_init(void); | ||
159 | |||
160 | /** | ||
161 | * get_new_cred - Get a reference on a new set of credentials | ||
162 | * @cred: The new credentials to reference | ||
163 | * | ||
164 | * Get a reference on the specified set of new credentials. The caller must | ||
165 | * release the reference. | ||
166 | */ | ||
167 | static inline struct cred *get_new_cred(struct cred *cred) | ||
168 | { | ||
169 | atomic_inc(&cred->usage); | ||
170 | return cred; | ||
171 | } | ||
172 | |||
173 | /** | ||
174 | * get_cred - Get a reference on a set of credentials | ||
175 | * @cred: The credentials to reference | ||
176 | * | ||
177 | * Get a reference on the specified set of credentials. The caller must | ||
178 | * release the reference. | ||
179 | * | ||
180 | * This is used to deal with a committed set of credentials. Although the | ||
181 | * pointer is const, this will temporarily discard the const and increment the | ||
182 | * usage count. The purpose of this is to attempt to catch at compile time the | ||
183 | * accidental alteration of a set of credentials that should be considered | ||
184 | * immutable. | ||
185 | */ | ||
186 | static inline const struct cred *get_cred(const struct cred *cred) | ||
187 | { | ||
188 | return get_new_cred((struct cred *) cred); | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * put_cred - Release a reference to a set of credentials | ||
193 | * @cred: The credentials to release | ||
194 | * | ||
195 | * Release a reference to a set of credentials, deleting them when the last ref | ||
196 | * is released. | ||
197 | * | ||
198 | * This takes a const pointer to a set of credentials because the credentials | ||
199 | * on task_struct are attached by const pointers to prevent accidental | ||
200 | * alteration of otherwise immutable credential sets. | ||
201 | */ | ||
202 | static inline void put_cred(const struct cred *_cred) | ||
203 | { | ||
204 | struct cred *cred = (struct cred *) _cred; | ||
205 | |||
206 | BUG_ON(atomic_read(&(cred)->usage) <= 0); | ||
207 | if (atomic_dec_and_test(&(cred)->usage)) | ||
208 | __put_cred(cred); | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | * current_cred - Access the current task's subjective credentials | ||
213 | * | ||
214 | * Access the subjective credentials of the current task. | ||
215 | */ | ||
216 | #define current_cred() \ | ||
217 | (current->cred) | ||
218 | |||
219 | /** | ||
220 | * __task_cred - Access a task's objective credentials | ||
221 | * @task: The task to query | ||
222 | * | ||
223 | * Access the objective credentials of a task. The caller must hold the RCU | ||
224 | * readlock. | ||
225 | * | ||
226 | * The caller must make sure task doesn't go away, either by holding a ref on | ||
227 | * task or by holding tasklist_lock to prevent it from being unlinked. | ||
228 | */ | ||
229 | #define __task_cred(task) \ | ||
230 | ((const struct cred *)(rcu_dereference((task)->real_cred))) | ||
231 | |||
232 | /** | ||
233 | * get_task_cred - Get another task's objective credentials | ||
234 | * @task: The task to query | ||
235 | * | ||
236 | * Get the objective credentials of a task, pinning them so that they can't go | ||
237 | * away. Accessing a task's credentials directly is not permitted. | ||
238 | * | ||
239 | * The caller must make sure task doesn't go away, either by holding a ref on | ||
240 | * task or by holding tasklist_lock to prevent it from being unlinked. | ||
241 | */ | ||
242 | #define get_task_cred(task) \ | ||
243 | ({ \ | ||
244 | struct cred *__cred; \ | ||
245 | rcu_read_lock(); \ | ||
246 | __cred = (struct cred *) __task_cred((task)); \ | ||
247 | get_cred(__cred); \ | ||
248 | rcu_read_unlock(); \ | ||
249 | __cred; \ | ||
250 | }) | ||
251 | |||
252 | /** | ||
253 | * get_current_cred - Get the current task's subjective credentials | ||
254 | * | ||
255 | * Get the subjective credentials of the current task, pinning them so that | ||
256 | * they can't go away. Accessing the current task's credentials directly is | ||
257 | * not permitted. | ||
258 | */ | ||
259 | #define get_current_cred() \ | ||
260 | (get_cred(current_cred())) | ||
261 | |||
262 | /** | ||
263 | * get_current_user - Get the current task's user_struct | ||
264 | * | ||
265 | * Get the user record of the current task, pinning it so that it can't go | ||
266 | * away. | ||
267 | */ | ||
268 | #define get_current_user() \ | ||
269 | ({ \ | ||
270 | struct user_struct *__u; \ | ||
271 | struct cred *__cred; \ | ||
272 | __cred = (struct cred *) current_cred(); \ | ||
273 | __u = get_uid(__cred->user); \ | ||
274 | __u; \ | ||
275 | }) | ||
276 | |||
277 | /** | ||
278 | * get_current_groups - Get the current task's supplementary group list | ||
279 | * | ||
280 | * Get the supplementary group list of the current task, pinning it so that it | ||
281 | * can't go away. | ||
282 | */ | ||
283 | #define get_current_groups() \ | ||
284 | ({ \ | ||
285 | struct group_info *__groups; \ | ||
286 | struct cred *__cred; \ | ||
287 | __cred = (struct cred *) current_cred(); \ | ||
288 | __groups = get_group_info(__cred->group_info); \ | ||
289 | __groups; \ | ||
290 | }) | ||
291 | |||
292 | #define task_cred_xxx(task, xxx) \ | ||
293 | ({ \ | ||
294 | __typeof__(((struct cred *)NULL)->xxx) ___val; \ | ||
295 | rcu_read_lock(); \ | ||
296 | ___val = __task_cred((task))->xxx; \ | ||
297 | rcu_read_unlock(); \ | ||
298 | ___val; \ | ||
299 | }) | ||
300 | |||
301 | #define task_uid(task) (task_cred_xxx((task), uid)) | ||
302 | #define task_euid(task) (task_cred_xxx((task), euid)) | ||
303 | |||
304 | #define current_cred_xxx(xxx) \ | ||
305 | ({ \ | ||
306 | current->cred->xxx; \ | ||
307 | }) | ||
308 | |||
309 | #define current_uid() (current_cred_xxx(uid)) | ||
310 | #define current_gid() (current_cred_xxx(gid)) | ||
311 | #define current_euid() (current_cred_xxx(euid)) | ||
312 | #define current_egid() (current_cred_xxx(egid)) | ||
313 | #define current_suid() (current_cred_xxx(suid)) | ||
314 | #define current_sgid() (current_cred_xxx(sgid)) | ||
315 | #define current_fsuid() (current_cred_xxx(fsuid)) | ||
316 | #define current_fsgid() (current_cred_xxx(fsgid)) | ||
317 | #define current_cap() (current_cred_xxx(cap_effective)) | ||
318 | #define current_user() (current_cred_xxx(user)) | ||
319 | #define current_user_ns() (current_cred_xxx(user)->user_ns) | ||
320 | #define current_security() (current_cred_xxx(security)) | ||
31 | 321 | ||
32 | #define current_uid_gid(_uid, _gid) \ | 322 | #define current_uid_gid(_uid, _gid) \ |
33 | do { \ | 323 | do { \ |
34 | *(_uid) = current->uid; \ | 324 | const struct cred *__cred; \ |
35 | *(_gid) = current->gid; \ | 325 | __cred = current_cred(); \ |
326 | *(_uid) = __cred->uid; \ | ||
327 | *(_gid) = __cred->gid; \ | ||
36 | } while(0) | 328 | } while(0) |
37 | 329 | ||
38 | #define current_euid_egid(_uid, _gid) \ | 330 | #define current_euid_egid(_euid, _egid) \ |
39 | do { \ | 331 | do { \ |
40 | *(_uid) = current->euid; \ | 332 | const struct cred *__cred; \ |
41 | *(_gid) = current->egid; \ | 333 | __cred = current_cred(); \ |
334 | *(_euid) = __cred->euid; \ | ||
335 | *(_egid) = __cred->egid; \ | ||
42 | } while(0) | 336 | } while(0) |
43 | 337 | ||
44 | #define current_fsuid_fsgid(_uid, _gid) \ | 338 | #define current_fsuid_fsgid(_fsuid, _fsgid) \ |
45 | do { \ | 339 | do { \ |
46 | *(_uid) = current->fsuid; \ | 340 | const struct cred *__cred; \ |
47 | *(_gid) = current->fsgid; \ | 341 | __cred = current_cred(); \ |
342 | *(_fsuid) = __cred->fsuid; \ | ||
343 | *(_fsgid) = __cred->fsgid; \ | ||
48 | } while(0) | 344 | } while(0) |
49 | 345 | ||
50 | #endif /* _LINUX_CRED_H */ | 346 | #endif /* _LINUX_CRED_H */ |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 3d2317e4af2e..3bacd71509fb 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -36,7 +36,8 @@ | |||
36 | #define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005 | 36 | #define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005 |
37 | #define CRYPTO_ALG_TYPE_GIVCIPHER 0x00000006 | 37 | #define CRYPTO_ALG_TYPE_GIVCIPHER 0x00000006 |
38 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 | 38 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 |
39 | #define CRYPTO_ALG_TYPE_HASH 0x00000009 | 39 | #define CRYPTO_ALG_TYPE_HASH 0x00000008 |
40 | #define CRYPTO_ALG_TYPE_SHASH 0x00000009 | ||
40 | #define CRYPTO_ALG_TYPE_AHASH 0x0000000a | 41 | #define CRYPTO_ALG_TYPE_AHASH 0x0000000a |
41 | #define CRYPTO_ALG_TYPE_RNG 0x0000000c | 42 | #define CRYPTO_ALG_TYPE_RNG 0x0000000c |
42 | 43 | ||
@@ -220,6 +221,7 @@ struct ablkcipher_alg { | |||
220 | 221 | ||
221 | struct ahash_alg { | 222 | struct ahash_alg { |
222 | int (*init)(struct ahash_request *req); | 223 | int (*init)(struct ahash_request *req); |
224 | int (*reinit)(struct ahash_request *req); | ||
223 | int (*update)(struct ahash_request *req); | 225 | int (*update)(struct ahash_request *req); |
224 | int (*final)(struct ahash_request *req); | 226 | int (*final)(struct ahash_request *req); |
225 | int (*digest)(struct ahash_request *req); | 227 | int (*digest)(struct ahash_request *req); |
@@ -480,6 +482,8 @@ struct crypto_tfm { | |||
480 | struct compress_tfm compress; | 482 | struct compress_tfm compress; |
481 | struct rng_tfm rng; | 483 | struct rng_tfm rng; |
482 | } crt_u; | 484 | } crt_u; |
485 | |||
486 | void (*exit)(struct crypto_tfm *tfm); | ||
483 | 487 | ||
484 | struct crypto_alg *__crt_alg; | 488 | struct crypto_alg *__crt_alg; |
485 | 489 | ||
@@ -544,7 +548,9 @@ struct crypto_attr_u32 { | |||
544 | * Transform user interface. | 548 | * Transform user interface. |
545 | */ | 549 | */ |
546 | 550 | ||
547 | struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); | 551 | struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, |
552 | const struct crypto_type *frontend, | ||
553 | u32 type, u32 mask); | ||
548 | struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); | 554 | struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); |
549 | void crypto_free_tfm(struct crypto_tfm *tfm); | 555 | void crypto_free_tfm(struct crypto_tfm *tfm); |
550 | 556 | ||
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/dcbnl.h b/include/linux/dcbnl.h new file mode 100644 index 000000000000..b0ef274e0031 --- /dev/null +++ b/include/linux/dcbnl.h | |||
@@ -0,0 +1,340 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008, Intel Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
17 | * Author: Lucy Liu <lucy.liu@intel.com> | ||
18 | */ | ||
19 | |||
20 | #ifndef __LINUX_DCBNL_H__ | ||
21 | #define __LINUX_DCBNL_H__ | ||
22 | |||
23 | #define DCB_PROTO_VERSION 1 | ||
24 | |||
25 | struct dcbmsg { | ||
26 | unsigned char dcb_family; | ||
27 | __u8 cmd; | ||
28 | __u16 dcb_pad; | ||
29 | }; | ||
30 | |||
31 | /** | ||
32 | * enum dcbnl_commands - supported DCB commands | ||
33 | * | ||
34 | * @DCB_CMD_UNDEFINED: unspecified command to catch errors | ||
35 | * @DCB_CMD_GSTATE: request the state of DCB in the device | ||
36 | * @DCB_CMD_SSTATE: set the state of DCB in the device | ||
37 | * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx | ||
38 | * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx | ||
39 | * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx | ||
40 | * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx | ||
41 | * @DCB_CMD_PFC_GCFG: request the priority flow control configuration | ||
42 | * @DCB_CMD_PFC_SCFG: set the priority flow control configuration | ||
43 | * @DCB_CMD_SET_ALL: apply all changes to the underlying device | ||
44 | * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying | ||
45 | * device. Only useful when using bonding. | ||
46 | * @DCB_CMD_GCAP: request the DCB capabilities of the device | ||
47 | * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported | ||
48 | * @DCB_CMD_SNUMTCS: set the number of traffic classes | ||
49 | * @DCB_CMD_GBCN: set backward congestion notification configuration | ||
50 | * @DCB_CMD_SBCN: get backward congestion notification configration. | ||
51 | */ | ||
52 | enum dcbnl_commands { | ||
53 | DCB_CMD_UNDEFINED, | ||
54 | |||
55 | DCB_CMD_GSTATE, | ||
56 | DCB_CMD_SSTATE, | ||
57 | |||
58 | DCB_CMD_PGTX_GCFG, | ||
59 | DCB_CMD_PGTX_SCFG, | ||
60 | DCB_CMD_PGRX_GCFG, | ||
61 | DCB_CMD_PGRX_SCFG, | ||
62 | |||
63 | DCB_CMD_PFC_GCFG, | ||
64 | DCB_CMD_PFC_SCFG, | ||
65 | |||
66 | DCB_CMD_SET_ALL, | ||
67 | |||
68 | DCB_CMD_GPERM_HWADDR, | ||
69 | |||
70 | DCB_CMD_GCAP, | ||
71 | |||
72 | DCB_CMD_GNUMTCS, | ||
73 | DCB_CMD_SNUMTCS, | ||
74 | |||
75 | DCB_CMD_PFC_GSTATE, | ||
76 | DCB_CMD_PFC_SSTATE, | ||
77 | |||
78 | DCB_CMD_BCN_GCFG, | ||
79 | DCB_CMD_BCN_SCFG, | ||
80 | |||
81 | __DCB_CMD_ENUM_MAX, | ||
82 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, | ||
83 | }; | ||
84 | |||
85 | /** | ||
86 | * enum dcbnl_attrs - DCB top-level netlink attributes | ||
87 | * | ||
88 | * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
89 | * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING) | ||
90 | * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8) | ||
91 | * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8) | ||
92 | * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED) | ||
93 | * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8) | ||
94 | * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED) | ||
95 | * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8) | ||
96 | * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED) | ||
97 | * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED) | ||
98 | * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED) | ||
99 | * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED) | ||
100 | */ | ||
101 | enum dcbnl_attrs { | ||
102 | DCB_ATTR_UNDEFINED, | ||
103 | |||
104 | DCB_ATTR_IFNAME, | ||
105 | DCB_ATTR_STATE, | ||
106 | DCB_ATTR_PFC_STATE, | ||
107 | DCB_ATTR_PFC_CFG, | ||
108 | DCB_ATTR_NUM_TC, | ||
109 | DCB_ATTR_PG_CFG, | ||
110 | DCB_ATTR_SET_ALL, | ||
111 | DCB_ATTR_PERM_HWADDR, | ||
112 | DCB_ATTR_CAP, | ||
113 | DCB_ATTR_NUMTCS, | ||
114 | DCB_ATTR_BCN, | ||
115 | |||
116 | __DCB_ATTR_ENUM_MAX, | ||
117 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, | ||
118 | }; | ||
119 | |||
120 | /** | ||
121 | * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs | ||
122 | * | ||
123 | * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
124 | * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8) | ||
125 | * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8) | ||
126 | * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8) | ||
127 | * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8) | ||
128 | * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8) | ||
129 | * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8) | ||
130 | * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8) | ||
131 | * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8) | ||
132 | * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined | ||
133 | * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG) | ||
134 | * | ||
135 | */ | ||
136 | enum dcbnl_pfc_up_attrs { | ||
137 | DCB_PFC_UP_ATTR_UNDEFINED, | ||
138 | |||
139 | DCB_PFC_UP_ATTR_0, | ||
140 | DCB_PFC_UP_ATTR_1, | ||
141 | DCB_PFC_UP_ATTR_2, | ||
142 | DCB_PFC_UP_ATTR_3, | ||
143 | DCB_PFC_UP_ATTR_4, | ||
144 | DCB_PFC_UP_ATTR_5, | ||
145 | DCB_PFC_UP_ATTR_6, | ||
146 | DCB_PFC_UP_ATTR_7, | ||
147 | DCB_PFC_UP_ATTR_ALL, | ||
148 | |||
149 | __DCB_PFC_UP_ATTR_ENUM_MAX, | ||
150 | DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1, | ||
151 | }; | ||
152 | |||
153 | /** | ||
154 | * enum dcbnl_pg_attrs - DCB Priority Group attributes | ||
155 | * | ||
156 | * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
157 | * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED) | ||
158 | * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED) | ||
159 | * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED) | ||
160 | * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED) | ||
161 | * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED) | ||
162 | * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED) | ||
163 | * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED) | ||
164 | * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED) | ||
165 | * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined | ||
166 | * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED) | ||
167 | * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8) | ||
168 | * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8) | ||
169 | * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8) | ||
170 | * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8) | ||
171 | * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8) | ||
172 | * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8) | ||
173 | * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8) | ||
174 | * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8) | ||
175 | * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined | ||
176 | * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG) | ||
177 | * | ||
178 | */ | ||
179 | enum dcbnl_pg_attrs { | ||
180 | DCB_PG_ATTR_UNDEFINED, | ||
181 | |||
182 | DCB_PG_ATTR_TC_0, | ||
183 | DCB_PG_ATTR_TC_1, | ||
184 | DCB_PG_ATTR_TC_2, | ||
185 | DCB_PG_ATTR_TC_3, | ||
186 | DCB_PG_ATTR_TC_4, | ||
187 | DCB_PG_ATTR_TC_5, | ||
188 | DCB_PG_ATTR_TC_6, | ||
189 | DCB_PG_ATTR_TC_7, | ||
190 | DCB_PG_ATTR_TC_MAX, | ||
191 | DCB_PG_ATTR_TC_ALL, | ||
192 | |||
193 | DCB_PG_ATTR_BW_ID_0, | ||
194 | DCB_PG_ATTR_BW_ID_1, | ||
195 | DCB_PG_ATTR_BW_ID_2, | ||
196 | DCB_PG_ATTR_BW_ID_3, | ||
197 | DCB_PG_ATTR_BW_ID_4, | ||
198 | DCB_PG_ATTR_BW_ID_5, | ||
199 | DCB_PG_ATTR_BW_ID_6, | ||
200 | DCB_PG_ATTR_BW_ID_7, | ||
201 | DCB_PG_ATTR_BW_ID_MAX, | ||
202 | DCB_PG_ATTR_BW_ID_ALL, | ||
203 | |||
204 | __DCB_PG_ATTR_ENUM_MAX, | ||
205 | DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1, | ||
206 | }; | ||
207 | |||
208 | /** | ||
209 | * enum dcbnl_tc_attrs - DCB Traffic Class attributes | ||
210 | * | ||
211 | * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors | ||
212 | * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to | ||
213 | * Valid values are: 0-7 | ||
214 | * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map | ||
215 | * Some devices may not support changing the | ||
216 | * user priority map of a TC. | ||
217 | * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting | ||
218 | * 0 - none | ||
219 | * 1 - group strict | ||
220 | * 2 - link strict | ||
221 | * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and | ||
222 | * not configured to use link strict priority, | ||
223 | * this is the percentage of bandwidth of the | ||
224 | * priority group this traffic class belongs to | ||
225 | * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters | ||
226 | * | ||
227 | */ | ||
228 | enum dcbnl_tc_attrs { | ||
229 | DCB_TC_ATTR_PARAM_UNDEFINED, | ||
230 | |||
231 | DCB_TC_ATTR_PARAM_PGID, | ||
232 | DCB_TC_ATTR_PARAM_UP_MAPPING, | ||
233 | DCB_TC_ATTR_PARAM_STRICT_PRIO, | ||
234 | DCB_TC_ATTR_PARAM_BW_PCT, | ||
235 | DCB_TC_ATTR_PARAM_ALL, | ||
236 | |||
237 | __DCB_TC_ATTR_PARAM_ENUM_MAX, | ||
238 | DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1, | ||
239 | }; | ||
240 | |||
241 | /** | ||
242 | * enum dcbnl_cap_attrs - DCB Capability attributes | ||
243 | * | ||
244 | * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
245 | * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters | ||
246 | * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups | ||
247 | * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control | ||
248 | * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to | ||
249 | * traffic class mapping | ||
250 | * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a | ||
251 | * number of traffic classes the device | ||
252 | * can be configured to use for Priority Groups | ||
253 | * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a | ||
254 | * number of traffic classes the device can be | ||
255 | * configured to use for Priority Flow Control | ||
256 | * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority | ||
257 | * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion | ||
258 | * Notification | ||
259 | */ | ||
260 | enum dcbnl_cap_attrs { | ||
261 | DCB_CAP_ATTR_UNDEFINED, | ||
262 | DCB_CAP_ATTR_ALL, | ||
263 | DCB_CAP_ATTR_PG, | ||
264 | DCB_CAP_ATTR_PFC, | ||
265 | DCB_CAP_ATTR_UP2TC, | ||
266 | DCB_CAP_ATTR_PG_TCS, | ||
267 | DCB_CAP_ATTR_PFC_TCS, | ||
268 | DCB_CAP_ATTR_GSP, | ||
269 | DCB_CAP_ATTR_BCN, | ||
270 | |||
271 | __DCB_CAP_ATTR_ENUM_MAX, | ||
272 | DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1, | ||
273 | }; | ||
274 | |||
275 | /** | ||
276 | * enum dcbnl_numtcs_attrs - number of traffic classes | ||
277 | * | ||
278 | * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors | ||
279 | * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes | ||
280 | * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for | ||
281 | * priority groups | ||
282 | * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can | ||
283 | * support priority flow control | ||
284 | */ | ||
285 | enum dcbnl_numtcs_attrs { | ||
286 | DCB_NUMTCS_ATTR_UNDEFINED, | ||
287 | DCB_NUMTCS_ATTR_ALL, | ||
288 | DCB_NUMTCS_ATTR_PG, | ||
289 | DCB_NUMTCS_ATTR_PFC, | ||
290 | |||
291 | __DCB_NUMTCS_ATTR_ENUM_MAX, | ||
292 | DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1, | ||
293 | }; | ||
294 | |||
295 | enum dcbnl_bcn_attrs{ | ||
296 | DCB_BCN_ATTR_UNDEFINED = 0, | ||
297 | |||
298 | DCB_BCN_ATTR_RP_0, | ||
299 | DCB_BCN_ATTR_RP_1, | ||
300 | DCB_BCN_ATTR_RP_2, | ||
301 | DCB_BCN_ATTR_RP_3, | ||
302 | DCB_BCN_ATTR_RP_4, | ||
303 | DCB_BCN_ATTR_RP_5, | ||
304 | DCB_BCN_ATTR_RP_6, | ||
305 | DCB_BCN_ATTR_RP_7, | ||
306 | DCB_BCN_ATTR_RP_ALL, | ||
307 | |||
308 | DCB_BCN_ATTR_BCNA_0, | ||
309 | DCB_BCN_ATTR_BCNA_1, | ||
310 | DCB_BCN_ATTR_ALPHA, | ||
311 | DCB_BCN_ATTR_BETA, | ||
312 | DCB_BCN_ATTR_GD, | ||
313 | DCB_BCN_ATTR_GI, | ||
314 | DCB_BCN_ATTR_TMAX, | ||
315 | DCB_BCN_ATTR_TD, | ||
316 | DCB_BCN_ATTR_RMIN, | ||
317 | DCB_BCN_ATTR_W, | ||
318 | DCB_BCN_ATTR_RD, | ||
319 | DCB_BCN_ATTR_RU, | ||
320 | DCB_BCN_ATTR_WRTT, | ||
321 | DCB_BCN_ATTR_RI, | ||
322 | DCB_BCN_ATTR_C, | ||
323 | DCB_BCN_ATTR_ALL, | ||
324 | |||
325 | __DCB_BCN_ATTR_ENUM_MAX, | ||
326 | DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1, | ||
327 | }; | ||
328 | |||
329 | /** | ||
330 | * enum dcb_general_attr_values - general DCB attribute values | ||
331 | * | ||
332 | * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported | ||
333 | * | ||
334 | */ | ||
335 | enum dcb_general_attr_values { | ||
336 | DCB_ATTR_VALUE_UNDEFINED = 0xff | ||
337 | }; | ||
338 | |||
339 | |||
340 | #endif /* __LINUX_DCBNL_H__ */ | ||
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 6080449fbec9..61734e27abb7 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -168,6 +168,8 @@ enum { | |||
168 | DCCPO_MIN_CCID_SPECIFIC = 128, | 168 | DCCPO_MIN_CCID_SPECIFIC = 128, |
169 | DCCPO_MAX_CCID_SPECIFIC = 255, | 169 | DCCPO_MAX_CCID_SPECIFIC = 255, |
170 | }; | 170 | }; |
171 | /* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */ | ||
172 | #define DCCP_SINGLE_OPT_MAXLEN 253 | ||
171 | 173 | ||
172 | /* DCCP CCIDS */ | 174 | /* DCCP CCIDS */ |
173 | enum { | 175 | enum { |
@@ -176,29 +178,23 @@ enum { | |||
176 | }; | 178 | }; |
177 | 179 | ||
178 | /* DCCP features (RFC 4340 section 6.4) */ | 180 | /* DCCP features (RFC 4340 section 6.4) */ |
179 | enum { | 181 | enum dccp_feature_numbers { |
180 | DCCPF_RESERVED = 0, | 182 | DCCPF_RESERVED = 0, |
181 | DCCPF_CCID = 1, | 183 | DCCPF_CCID = 1, |
182 | DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */ | 184 | DCCPF_SHORT_SEQNOS = 2, |
183 | DCCPF_SEQUENCE_WINDOW = 3, | 185 | DCCPF_SEQUENCE_WINDOW = 3, |
184 | DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */ | 186 | DCCPF_ECN_INCAPABLE = 4, |
185 | DCCPF_ACK_RATIO = 5, | 187 | DCCPF_ACK_RATIO = 5, |
186 | DCCPF_SEND_ACK_VECTOR = 6, | 188 | DCCPF_SEND_ACK_VECTOR = 6, |
187 | DCCPF_SEND_NDP_COUNT = 7, | 189 | DCCPF_SEND_NDP_COUNT = 7, |
188 | DCCPF_MIN_CSUM_COVER = 8, | 190 | DCCPF_MIN_CSUM_COVER = 8, |
189 | DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */ | 191 | DCCPF_DATA_CHECKSUM = 9, |
190 | /* 10-127 reserved */ | 192 | /* 10-127 reserved */ |
191 | DCCPF_MIN_CCID_SPECIFIC = 128, | 193 | DCCPF_MIN_CCID_SPECIFIC = 128, |
194 | DCCPF_SEND_LEV_RATE = 192, /* RFC 4342, sec. 8.4 */ | ||
192 | DCCPF_MAX_CCID_SPECIFIC = 255, | 195 | DCCPF_MAX_CCID_SPECIFIC = 255, |
193 | }; | 196 | }; |
194 | 197 | ||
195 | /* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ | ||
196 | struct dccp_so_feat { | ||
197 | __u8 dccpsf_feat; | ||
198 | __u8 __user *dccpsf_val; | ||
199 | __u8 dccpsf_len; | ||
200 | }; | ||
201 | |||
202 | /* DCCP socket options */ | 198 | /* DCCP socket options */ |
203 | #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ | 199 | #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ |
204 | #define DCCP_SOCKOPT_SERVICE 2 | 200 | #define DCCP_SOCKOPT_SERVICE 2 |
@@ -208,6 +204,10 @@ struct dccp_so_feat { | |||
208 | #define DCCP_SOCKOPT_SERVER_TIMEWAIT 6 | 204 | #define DCCP_SOCKOPT_SERVER_TIMEWAIT 6 |
209 | #define DCCP_SOCKOPT_SEND_CSCOV 10 | 205 | #define DCCP_SOCKOPT_SEND_CSCOV 10 |
210 | #define DCCP_SOCKOPT_RECV_CSCOV 11 | 206 | #define DCCP_SOCKOPT_RECV_CSCOV 11 |
207 | #define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 | ||
208 | #define DCCP_SOCKOPT_CCID 13 | ||
209 | #define DCCP_SOCKOPT_TX_CCID 14 | ||
210 | #define DCCP_SOCKOPT_RX_CCID 15 | ||
211 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | 211 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 |
212 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 | 212 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 |
213 | 213 | ||
@@ -360,7 +360,6 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | |||
360 | #define DCCPF_INITIAL_SEQUENCE_WINDOW 100 | 360 | #define DCCPF_INITIAL_SEQUENCE_WINDOW 100 |
361 | #define DCCPF_INITIAL_ACK_RATIO 2 | 361 | #define DCCPF_INITIAL_ACK_RATIO 2 |
362 | #define DCCPF_INITIAL_CCID DCCPC_CCID2 | 362 | #define DCCPF_INITIAL_CCID DCCPC_CCID2 |
363 | #define DCCPF_INITIAL_SEND_ACK_VECTOR 1 | ||
364 | /* FIXME: for now we're default to 1 but it should really be 0 */ | 363 | /* FIXME: for now we're default to 1 but it should really be 0 */ |
365 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 | 364 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 |
366 | 365 | ||
@@ -370,20 +369,11 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | |||
370 | * Will be used to pass the state from dccp_request_sock to dccp_sock. | 369 | * Will be used to pass the state from dccp_request_sock to dccp_sock. |
371 | * | 370 | * |
372 | * @dccpms_sequence_window - Sequence Window Feature (section 7.5.2) | 371 | * @dccpms_sequence_window - Sequence Window Feature (section 7.5.2) |
373 | * @dccpms_ccid - Congestion Control Id (CCID) (section 10) | ||
374 | * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5) | ||
375 | * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2) | ||
376 | * @dccpms_ack_ratio - Ack Ratio Feature (section 11.3) | ||
377 | * @dccpms_pending - List of features being negotiated | 372 | * @dccpms_pending - List of features being negotiated |
378 | * @dccpms_conf - | 373 | * @dccpms_conf - |
379 | */ | 374 | */ |
380 | struct dccp_minisock { | 375 | struct dccp_minisock { |
381 | __u64 dccpms_sequence_window; | 376 | __u64 dccpms_sequence_window; |
382 | __u8 dccpms_rx_ccid; | ||
383 | __u8 dccpms_tx_ccid; | ||
384 | __u8 dccpms_send_ack_vector; | ||
385 | __u8 dccpms_send_ndp_count; | ||
386 | __u8 dccpms_ack_ratio; | ||
387 | struct list_head dccpms_pending; | 377 | struct list_head dccpms_pending; |
388 | struct list_head dccpms_conf; | 378 | struct list_head dccpms_conf; |
389 | }; | 379 | }; |
@@ -411,6 +401,7 @@ extern void dccp_minisock_init(struct dccp_minisock *dmsk); | |||
411 | * @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1) | 401 | * @dreq_iss: initial sequence number sent on the Response (RFC 4340, 7.1) |
412 | * @dreq_isr: initial sequence number received on the Request | 402 | * @dreq_isr: initial sequence number received on the Request |
413 | * @dreq_service: service code present on the Request (there is just one) | 403 | * @dreq_service: service code present on the Request (there is just one) |
404 | * @dreq_featneg: feature negotiation options for this connection | ||
414 | * The following two fields are analogous to the ones in dccp_sock: | 405 | * The following two fields are analogous to the ones in dccp_sock: |
415 | * @dreq_timestamp_echo: last received timestamp to echo (13.1) | 406 | * @dreq_timestamp_echo: last received timestamp to echo (13.1) |
416 | * @dreq_timestamp_echo: the time of receiving the last @dreq_timestamp_echo | 407 | * @dreq_timestamp_echo: the time of receiving the last @dreq_timestamp_echo |
@@ -420,6 +411,7 @@ struct dccp_request_sock { | |||
420 | __u64 dreq_iss; | 411 | __u64 dreq_iss; |
421 | __u64 dreq_isr; | 412 | __u64 dreq_isr; |
422 | __be32 dreq_service; | 413 | __be32 dreq_service; |
414 | struct list_head dreq_featneg; | ||
423 | __u32 dreq_timestamp_echo; | 415 | __u32 dreq_timestamp_echo; |
424 | __u32 dreq_timestamp_time; | 416 | __u32 dreq_timestamp_time; |
425 | }; | 417 | }; |
@@ -493,10 +485,12 @@ struct dccp_ackvec; | |||
493 | * @dccps_r_ack_ratio - feature-remote Ack Ratio | 485 | * @dccps_r_ack_ratio - feature-remote Ack Ratio |
494 | * @dccps_pcslen - sender partial checksum coverage (via sockopt) | 486 | * @dccps_pcslen - sender partial checksum coverage (via sockopt) |
495 | * @dccps_pcrlen - receiver partial checksum coverage (via sockopt) | 487 | * @dccps_pcrlen - receiver partial checksum coverage (via sockopt) |
488 | * @dccps_send_ndp_count - local Send NDP Count feature (7.7.2) | ||
496 | * @dccps_ndp_count - number of Non Data Packets since last data packet | 489 | * @dccps_ndp_count - number of Non Data Packets since last data packet |
497 | * @dccps_mss_cache - current value of MSS (path MTU minus header sizes) | 490 | * @dccps_mss_cache - current value of MSS (path MTU minus header sizes) |
498 | * @dccps_rate_last - timestamp for rate-limiting DCCP-Sync (RFC 4340, 7.5.4) | 491 | * @dccps_rate_last - timestamp for rate-limiting DCCP-Sync (RFC 4340, 7.5.4) |
499 | * @dccps_minisock - associated minisock (accessed via dccp_msk) | 492 | * @dccps_minisock - associated minisock (accessed via dccp_msk) |
493 | * @dccps_featneg - tracks feature-negotiation state (mostly during handshake) | ||
500 | * @dccps_hc_rx_ackvec - rx half connection ack vector | 494 | * @dccps_hc_rx_ackvec - rx half connection ack vector |
501 | * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) | 495 | * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) |
502 | * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection) | 496 | * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection) |
@@ -529,11 +523,13 @@ struct dccp_sock { | |||
529 | __u32 dccps_timestamp_time; | 523 | __u32 dccps_timestamp_time; |
530 | __u16 dccps_l_ack_ratio; | 524 | __u16 dccps_l_ack_ratio; |
531 | __u16 dccps_r_ack_ratio; | 525 | __u16 dccps_r_ack_ratio; |
532 | __u16 dccps_pcslen; | 526 | __u8 dccps_pcslen:4; |
533 | __u16 dccps_pcrlen; | 527 | __u8 dccps_pcrlen:4; |
528 | __u8 dccps_send_ndp_count:1; | ||
534 | __u64 dccps_ndp_count:48; | 529 | __u64 dccps_ndp_count:48; |
535 | unsigned long dccps_rate_last; | 530 | unsigned long dccps_rate_last; |
536 | struct dccp_minisock dccps_minisock; | 531 | struct dccp_minisock dccps_minisock; |
532 | struct list_head dccps_featneg; | ||
537 | struct dccp_ackvec *dccps_hc_rx_ackvec; | 533 | struct dccp_ackvec *dccps_hc_rx_ackvec; |
538 | struct ccid *dccps_hc_rx_ccid; | 534 | struct ccid *dccps_hc_rx_ccid; |
539 | struct ccid *dccps_hc_tx_ccid; | 535 | struct ccid *dccps_hc_tx_ccid; |
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 4aaa4afb1cb9..096476f1fb35 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
@@ -17,7 +17,7 @@ extern int debug_locks_off(void); | |||
17 | ({ \ | 17 | ({ \ |
18 | int __ret = 0; \ | 18 | int __ret = 0; \ |
19 | \ | 19 | \ |
20 | if (unlikely(c)) { \ | 20 | if (!oops_in_progress && unlikely(c)) { \ |
21 | if (debug_locks_off() && !debug_locks_silent) \ | 21 | if (debug_locks_off() && !debug_locks_silent) \ |
22 | WARN_ON(1); \ | 22 | WARN_ON(1); \ |
23 | __ret = 1; \ | 23 | __ret = 1; \ |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index e5084eb5943a..34161907b2f8 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -44,8 +44,10 @@ extern const struct dmi_device * dmi_find_device(int type, const char *name, | |||
44 | extern void dmi_scan_machine(void); | 44 | extern void dmi_scan_machine(void); |
45 | extern int dmi_get_year(int field); | 45 | extern int dmi_get_year(int field); |
46 | extern int dmi_name_in_vendors(const char *str); | 46 | extern int dmi_name_in_vendors(const char *str); |
47 | extern int dmi_name_in_serial(const char *str); | ||
47 | extern int dmi_available; | 48 | extern int dmi_available; |
48 | extern int dmi_walk(void (*decode)(const struct dmi_header *)); | 49 | extern int dmi_walk(void (*decode)(const struct dmi_header *)); |
50 | extern bool dmi_match(enum dmi_field f, const char *str); | ||
49 | 51 | ||
50 | #else | 52 | #else |
51 | 53 | ||
@@ -56,9 +58,12 @@ static inline const struct dmi_device * dmi_find_device(int type, const char *na | |||
56 | static inline void dmi_scan_machine(void) { return; } | 58 | static inline void dmi_scan_machine(void) { return; } |
57 | static inline int dmi_get_year(int year) { return 0; } | 59 | static inline int dmi_get_year(int year) { return 0; } |
58 | static inline int dmi_name_in_vendors(const char *s) { return 0; } | 60 | static inline int dmi_name_in_vendors(const char *s) { return 0; } |
61 | static inline int dmi_name_in_serial(const char *s) { return 0; } | ||
59 | #define dmi_available 0 | 62 | #define dmi_available 0 |
60 | static inline int dmi_walk(void (*decode)(const struct dmi_header *)) | 63 | static inline int dmi_walk(void (*decode)(const struct dmi_header *)) |
61 | { return -1; } | 64 | { return -1; } |
65 | static inline bool dmi_match(enum dmi_field f, const char *str) | ||
66 | { return false; } | ||
62 | 67 | ||
63 | #endif | 68 | #endif |
64 | 69 | ||
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 92f6f634e3e6..7a204256b155 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -28,7 +28,7 @@ typedef void (elevator_activate_req_fn) (struct request_queue *, struct request | |||
28 | typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *); | 28 | typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *); |
29 | 29 | ||
30 | typedef void *(elevator_init_fn) (struct request_queue *); | 30 | typedef void *(elevator_init_fn) (struct request_queue *); |
31 | typedef void (elevator_exit_fn) (elevator_t *); | 31 | typedef void (elevator_exit_fn) (struct elevator_queue *); |
32 | 32 | ||
33 | struct elevator_ops | 33 | struct elevator_ops |
34 | { | 34 | { |
@@ -62,8 +62,8 @@ struct elevator_ops | |||
62 | 62 | ||
63 | struct elv_fs_entry { | 63 | struct elv_fs_entry { |
64 | struct attribute attr; | 64 | struct attribute attr; |
65 | ssize_t (*show)(elevator_t *, char *); | 65 | ssize_t (*show)(struct elevator_queue *, char *); |
66 | ssize_t (*store)(elevator_t *, const char *, size_t); | 66 | ssize_t (*store)(struct elevator_queue *, const char *, size_t); |
67 | }; | 67 | }; |
68 | 68 | ||
69 | /* | 69 | /* |
@@ -130,7 +130,7 @@ extern ssize_t elv_iosched_show(struct request_queue *, char *); | |||
130 | extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t); | 130 | extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t); |
131 | 131 | ||
132 | extern int elevator_init(struct request_queue *, char *); | 132 | extern int elevator_init(struct request_queue *, char *); |
133 | extern void elevator_exit(elevator_t *); | 133 | extern void elevator_exit(struct elevator_queue *); |
134 | extern int elv_rq_merge_ok(struct request *, struct bio *); | 134 | extern int elv_rq_merge_ok(struct request *, struct bio *); |
135 | 135 | ||
136 | /* | 136 | /* |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 25d62e6e3290..1cb0f0b90926 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/if_ether.h> | 27 | #include <linux/if_ether.h> |
28 | #include <linux/netdevice.h> | 28 | #include <linux/netdevice.h> |
29 | #include <linux/random.h> | 29 | #include <linux/random.h> |
30 | #include <asm/unaligned.h> | ||
30 | 31 | ||
31 | #ifdef __KERNEL__ | 32 | #ifdef __KERNEL__ |
32 | extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); | 33 | extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); |
@@ -41,6 +42,10 @@ extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh); | |||
41 | extern void eth_header_cache_update(struct hh_cache *hh, | 42 | extern void eth_header_cache_update(struct hh_cache *hh, |
42 | const struct net_device *dev, | 43 | const struct net_device *dev, |
43 | const unsigned char *haddr); | 44 | const unsigned char *haddr); |
45 | extern int eth_mac_addr(struct net_device *dev, void *p); | ||
46 | extern int eth_change_mtu(struct net_device *dev, int new_mtu); | ||
47 | extern int eth_validate_addr(struct net_device *dev); | ||
48 | |||
44 | 49 | ||
45 | 50 | ||
46 | extern struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count); | 51 | extern struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count); |
@@ -136,6 +141,47 @@ static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) | |||
136 | BUILD_BUG_ON(ETH_ALEN != 6); | 141 | BUILD_BUG_ON(ETH_ALEN != 6); |
137 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; | 142 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; |
138 | } | 143 | } |
144 | |||
145 | static inline unsigned long zap_last_2bytes(unsigned long value) | ||
146 | { | ||
147 | #ifdef __BIG_ENDIAN | ||
148 | return value >> 16; | ||
149 | #else | ||
150 | return value << 16; | ||
151 | #endif | ||
152 | } | ||
153 | |||
154 | /** | ||
155 | * compare_ether_addr_64bits - Compare two Ethernet addresses | ||
156 | * @addr1: Pointer to an array of 8 bytes | ||
157 | * @addr2: Pointer to an other array of 8 bytes | ||
158 | * | ||
159 | * Compare two ethernet addresses, returns 0 if equal. | ||
160 | * Same result than "memcmp(addr1, addr2, ETH_ALEN)" but without conditional | ||
161 | * branches, and possibly long word memory accesses on CPU allowing cheap | ||
162 | * unaligned memory reads. | ||
163 | * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2} | ||
164 | * | ||
165 | * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits. | ||
166 | */ | ||
167 | |||
168 | static inline unsigned compare_ether_addr_64bits(const u8 addr1[6+2], | ||
169 | const u8 addr2[6+2]) | ||
170 | { | ||
171 | #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS | ||
172 | unsigned long fold = ((*(unsigned long *)addr1) ^ | ||
173 | (*(unsigned long *)addr2)); | ||
174 | |||
175 | if (sizeof(fold) == 8) | ||
176 | return zap_last_2bytes(fold) != 0; | ||
177 | |||
178 | fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^ | ||
179 | (*(unsigned long *)(addr2 + 4))); | ||
180 | return fold != 0; | ||
181 | #else | ||
182 | return compare_ether_addr(addr1, addr2); | ||
183 | #endif | ||
184 | } | ||
139 | #endif /* __KERNEL__ */ | 185 | #endif /* __KERNEL__ */ |
140 | 186 | ||
141 | #endif /* _LINUX_ETHERDEVICE_H */ | 187 | #endif /* _LINUX_ETHERDEVICE_H */ |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index b4b038b89ee6..27c67a542235 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -467,6 +467,8 @@ struct ethtool_ops { | |||
467 | 467 | ||
468 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ | 468 | #define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */ |
469 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ | 469 | #define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */ |
470 | #define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */ | ||
471 | #define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */ | ||
470 | 472 | ||
471 | /* compatibility with older code */ | 473 | /* compatibility with older code */ |
472 | #define SPARC_ETH_GSET ETHTOOL_GSET | 474 | #define SPARC_ETH_GSET ETHTOOL_GSET |
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h index 32368c4f0326..06ca9b21dad2 100644 --- a/include/linux/fault-inject.h +++ b/include/linux/fault-inject.h | |||
@@ -81,4 +81,13 @@ static inline void cleanup_fault_attr_dentries(struct fault_attr *attr) | |||
81 | 81 | ||
82 | #endif /* CONFIG_FAULT_INJECTION */ | 82 | #endif /* CONFIG_FAULT_INJECTION */ |
83 | 83 | ||
84 | #ifdef CONFIG_FAILSLAB | ||
85 | extern bool should_failslab(size_t size, gfp_t gfpflags); | ||
86 | #else | ||
87 | static inline bool should_failslab(size_t size, gfp_t gfpflags) | ||
88 | { | ||
89 | return false; | ||
90 | } | ||
91 | #endif /* CONFIG_FAILSLAB */ | ||
92 | |||
84 | #endif /* _LINUX_FAULT_INJECT_H */ | 93 | #endif /* _LINUX_FAULT_INJECT_H */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 75a81eaf3430..1ee63df5be92 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -888,7 +888,7 @@ struct fb_info { | |||
888 | #define fb_writeq sbus_writeq | 888 | #define fb_writeq sbus_writeq |
889 | #define fb_memset sbus_memset_io | 889 | #define fb_memset sbus_memset_io |
890 | 890 | ||
891 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || (defined(__sh__) && !defined(__SH5__)) || defined(__powerpc__) || defined(__avr32__) | 891 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) |
892 | 892 | ||
893 | #define fb_readb __raw_readb | 893 | #define fb_readb __raw_readb |
894 | #define fb_readw __raw_readw | 894 | #define fb_readw __raw_readw |
diff --git a/include/linux/fddidevice.h b/include/linux/fddidevice.h index e61e42dfd317..155bafd9e886 100644 --- a/include/linux/fddidevice.h +++ b/include/linux/fddidevice.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
28 | extern __be16 fddi_type_trans(struct sk_buff *skb, | 28 | extern __be16 fddi_type_trans(struct sk_buff *skb, |
29 | struct net_device *dev); | 29 | struct net_device *dev); |
30 | extern int fddi_change_mtu(struct net_device *dev, int new_mtu); | ||
30 | extern struct net_device *alloc_fddidev(int sizeof_priv); | 31 | extern struct net_device *alloc_fddidev(int sizeof_priv); |
31 | #endif | 32 | #endif |
32 | 33 | ||
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/filter.h b/include/linux/filter.h index b6ea9aa9e853..1354aaf6abbe 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -122,7 +122,8 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */ | |||
122 | #define SKF_AD_PKTTYPE 4 | 122 | #define SKF_AD_PKTTYPE 4 |
123 | #define SKF_AD_IFINDEX 8 | 123 | #define SKF_AD_IFINDEX 8 |
124 | #define SKF_AD_NLATTR 12 | 124 | #define SKF_AD_NLATTR 12 |
125 | #define SKF_AD_MAX 16 | 125 | #define SKF_AD_NLATTR_NEST 16 |
126 | #define SKF_AD_MAX 20 | ||
126 | #define SKF_NET_OFF (-0x100000) | 127 | #define SKF_NET_OFF (-0x100000) |
127 | #define SKF_LL_OFF (-0x200000) | 128 | #define SKF_LL_OFF (-0x200000) |
128 | 129 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4a853ef6fd35..e2170ee21e18 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 | ||
@@ -82,6 +73,14 @@ extern int dir_notify_enable; | |||
82 | (specialy hack for floppy.c) */ | 73 | (specialy hack for floppy.c) */ |
83 | #define FMODE_WRITE_IOCTL ((__force fmode_t)128) | 74 | #define FMODE_WRITE_IOCTL ((__force fmode_t)128) |
84 | 75 | ||
76 | /* | ||
77 | * Don't update ctime and mtime. | ||
78 | * | ||
79 | * Currently a special hack for the XFS open_by_handle ioctl, but we'll | ||
80 | * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon. | ||
81 | */ | ||
82 | #define FMODE_NOCMTIME ((__force fmode_t)2048) | ||
83 | |||
85 | #define RW_MASK 1 | 84 | #define RW_MASK 1 |
86 | #define RWA_MASK 2 | 85 | #define RWA_MASK 2 |
87 | #define READ 0 | 86 | #define READ 0 |
@@ -316,11 +315,21 @@ struct poll_table_struct; | |||
316 | struct kstatfs; | 315 | struct kstatfs; |
317 | struct vm_area_struct; | 316 | struct vm_area_struct; |
318 | struct vfsmount; | 317 | struct vfsmount; |
318 | struct cred; | ||
319 | 319 | ||
320 | extern void __init inode_init(void); | 320 | extern void __init inode_init(void); |
321 | extern void __init inode_init_early(void); | 321 | extern void __init inode_init_early(void); |
322 | extern void __init files_init(unsigned long); | 322 | extern void __init files_init(unsigned long); |
323 | 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 | |||
324 | struct buffer_head; | 333 | struct buffer_head; |
325 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | 334 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, |
326 | struct buffer_head *bh_result, int create); | 335 | struct buffer_head *bh_result, int create); |
@@ -827,7 +836,7 @@ struct file { | |||
827 | fmode_t f_mode; | 836 | fmode_t f_mode; |
828 | loff_t f_pos; | 837 | loff_t f_pos; |
829 | struct fown_struct f_owner; | 838 | struct fown_struct f_owner; |
830 | unsigned int f_uid, f_gid; | 839 | const struct cred *f_cred; |
831 | struct file_ra_state f_ra; | 840 | struct file_ra_state f_ra; |
832 | 841 | ||
833 | u64 f_version; | 842 | u64 f_version; |
@@ -1194,7 +1203,7 @@ enum { | |||
1194 | #define has_fs_excl() atomic_read(¤t->fs_excl) | 1203 | #define has_fs_excl() atomic_read(¤t->fs_excl) |
1195 | 1204 | ||
1196 | #define is_owner_or_cap(inode) \ | 1205 | #define is_owner_or_cap(inode) \ |
1197 | ((current->fsuid == (inode)->i_uid) || capable(CAP_FOWNER)) | 1206 | ((current_fsuid() == (inode)->i_uid) || capable(CAP_FOWNER)) |
1198 | 1207 | ||
1199 | /* not quite ready to be deprecated, but... */ | 1208 | /* not quite ready to be deprecated, but... */ |
1200 | extern void lock_super(struct super_block *); | 1209 | extern void lock_super(struct super_block *); |
@@ -1203,7 +1212,6 @@ extern void unlock_super(struct super_block *); | |||
1203 | /* | 1212 | /* |
1204 | * VFS helper functions.. | 1213 | * VFS helper functions.. |
1205 | */ | 1214 | */ |
1206 | extern int vfs_permission(struct nameidata *, int); | ||
1207 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); | 1215 | extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); |
1208 | extern int vfs_mkdir(struct inode *, struct dentry *, int); | 1216 | extern int vfs_mkdir(struct inode *, struct dentry *, int); |
1209 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); | 1217 | extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); |
@@ -1301,7 +1309,6 @@ struct file_operations { | |||
1301 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | 1309 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); |
1302 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 1310 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
1303 | int (*check_flags)(int); | 1311 | int (*check_flags)(int); |
1304 | int (*dir_notify)(struct file *filp, unsigned long arg); | ||
1305 | int (*flock) (struct file *, int, struct file_lock *); | 1312 | int (*flock) (struct file *, int, struct file_lock *); |
1306 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); | 1313 | ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); |
1307 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); | 1314 | ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); |
@@ -1674,7 +1681,8 @@ extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, | |||
1674 | extern long do_sys_open(int dfd, const char __user *filename, int flags, | 1681 | extern long do_sys_open(int dfd, const char __user *filename, int flags, |
1675 | int mode); | 1682 | int mode); |
1676 | extern struct file *filp_open(const char *, int, int); | 1683 | extern struct file *filp_open(const char *, int, int); |
1677 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); | 1684 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, |
1685 | const struct cred *); | ||
1678 | extern int filp_close(struct file *, fl_owner_t id); | 1686 | extern int filp_close(struct file *, fl_owner_t id); |
1679 | extern char * getname(const char __user *); | 1687 | extern char * getname(const char __user *); |
1680 | 1688 | ||
@@ -1859,7 +1867,7 @@ extern void free_write_pipe(struct file *); | |||
1859 | 1867 | ||
1860 | extern struct file *do_filp_open(int dfd, const char *pathname, | 1868 | extern struct file *do_filp_open(int dfd, const char *pathname, |
1861 | int open_flag, int mode); | 1869 | int open_flag, int mode); |
1862 | extern int may_open(struct nameidata *, int, int); | 1870 | extern int may_open(struct path *, int, int); |
1863 | 1871 | ||
1864 | extern int kernel_read(struct file *, unsigned long, char *, unsigned long); | 1872 | extern int kernel_read(struct file *, unsigned long, char *, unsigned long); |
1865 | extern struct file * open_exec(const char *); | 1873 | extern struct file * open_exec(const char *); |
@@ -1875,7 +1883,9 @@ extern loff_t default_llseek(struct file *file, loff_t offset, int origin); | |||
1875 | 1883 | ||
1876 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | 1884 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); |
1877 | 1885 | ||
1886 | extern struct inode * inode_init_always(struct super_block *, struct inode *); | ||
1878 | extern void inode_init_once(struct inode *); | 1887 | extern void inode_init_once(struct inode *); |
1888 | extern void inode_add_to_lists(struct super_block *, struct inode *); | ||
1879 | extern void iput(struct inode *); | 1889 | extern void iput(struct inode *); |
1880 | extern struct inode * igrab(struct inode *); | 1890 | extern struct inode * igrab(struct inode *); |
1881 | extern ino_t iunique(struct super_block *, ino_t); | 1891 | extern ino_t iunique(struct super_block *, ino_t); |
@@ -1892,6 +1902,8 @@ extern struct inode *ilookup(struct super_block *sb, unsigned long ino); | |||
1892 | 1902 | ||
1893 | extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); | 1903 | extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*test)(struct inode *, void *), int (*set)(struct inode *, void *), void *); |
1894 | extern struct inode * iget_locked(struct super_block *, unsigned long); | 1904 | extern struct inode * iget_locked(struct super_block *, unsigned long); |
1905 | extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); | ||
1906 | extern int insert_inode_locked(struct inode *); | ||
1895 | extern void unlock_new_inode(struct inode *); | 1907 | extern void unlock_new_inode(struct inode *); |
1896 | 1908 | ||
1897 | extern void __iget(struct inode * inode); | 1909 | extern void __iget(struct inode * inode); |
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/fsl_devices.h b/include/linux/fsl_devices.h index 708bab58d8d0..d9051d717d27 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -47,12 +47,7 @@ | |||
47 | struct gianfar_platform_data { | 47 | struct gianfar_platform_data { |
48 | /* device specific information */ | 48 | /* device specific information */ |
49 | u32 device_flags; | 49 | u32 device_flags; |
50 | /* board specific information */ | 50 | char bus_id[BUS_ID_SIZE]; |
51 | u32 board_flags; | ||
52 | int mdio_bus; /* Bus controlled by us */ | ||
53 | char bus_id[MII_BUS_ID_SIZE]; /* Bus PHY is on */ | ||
54 | u32 phy_id; | ||
55 | u8 mac_addr[6]; | ||
56 | phy_interface_t interface; | 51 | phy_interface_t interface; |
57 | }; | 52 | }; |
58 | 53 | ||
@@ -61,17 +56,6 @@ struct gianfar_mdio_data { | |||
61 | int irq[32]; | 56 | int irq[32]; |
62 | }; | 57 | }; |
63 | 58 | ||
64 | /* Flags related to gianfar device features */ | ||
65 | #define FSL_GIANFAR_DEV_HAS_GIGABIT 0x00000001 | ||
66 | #define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 | ||
67 | #define FSL_GIANFAR_DEV_HAS_RMON 0x00000004 | ||
68 | #define FSL_GIANFAR_DEV_HAS_MULTI_INTR 0x00000008 | ||
69 | #define FSL_GIANFAR_DEV_HAS_CSUM 0x00000010 | ||
70 | #define FSL_GIANFAR_DEV_HAS_VLAN 0x00000020 | ||
71 | #define FSL_GIANFAR_DEV_HAS_EXTENDED_HASH 0x00000040 | ||
72 | #define FSL_GIANFAR_DEV_HAS_PADDING 0x00000080 | ||
73 | #define FSL_GIANFAR_DEV_HAS_MAGIC_PACKET 0x00000100 | ||
74 | |||
75 | /* Flags in gianfar_platform_data */ | 59 | /* Flags in gianfar_platform_data */ |
76 | #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */ | 60 | #define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */ |
77 | #define FSL_GIANFAR_BRD_IS_REDUCED 0x00000002 /* Set if RGMII, RMII */ | 61 | #define FSL_GIANFAR_BRD_IS_REDUCED 0x00000002 /* Set if RGMII, RMII */ |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 703eb53cfa2b..677432b9cb7e 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -6,7 +6,10 @@ | |||
6 | #include <linux/ktime.h> | 6 | #include <linux/ktime.h> |
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/module.h> | ||
9 | #include <linux/kallsyms.h> | 10 | #include <linux/kallsyms.h> |
11 | #include <linux/bitops.h> | ||
12 | #include <linux/sched.h> | ||
10 | 13 | ||
11 | #ifdef CONFIG_FUNCTION_TRACER | 14 | #ifdef CONFIG_FUNCTION_TRACER |
12 | 15 | ||
@@ -23,6 +26,45 @@ struct ftrace_ops { | |||
23 | struct ftrace_ops *next; | 26 | struct ftrace_ops *next; |
24 | }; | 27 | }; |
25 | 28 | ||
29 | extern int function_trace_stop; | ||
30 | |||
31 | /* | ||
32 | * Type of the current tracing. | ||
33 | */ | ||
34 | enum ftrace_tracing_type_t { | ||
35 | FTRACE_TYPE_ENTER = 0, /* Hook the call of the function */ | ||
36 | FTRACE_TYPE_RETURN, /* Hook the return of the function */ | ||
37 | }; | ||
38 | |||
39 | /* Current tracing type, default is FTRACE_TYPE_ENTER */ | ||
40 | extern enum ftrace_tracing_type_t ftrace_tracing_type; | ||
41 | |||
42 | /** | ||
43 | * ftrace_stop - stop function tracer. | ||
44 | * | ||
45 | * A quick way to stop the function tracer. Note this an on off switch, | ||
46 | * it is not something that is recursive like preempt_disable. | ||
47 | * This does not disable the calling of mcount, it only stops the | ||
48 | * calling of functions from mcount. | ||
49 | */ | ||
50 | static inline void ftrace_stop(void) | ||
51 | { | ||
52 | function_trace_stop = 1; | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * ftrace_start - start the function tracer. | ||
57 | * | ||
58 | * This function is the inverse of ftrace_stop. This does not enable | ||
59 | * the function tracing if the function tracer is disabled. This only | ||
60 | * sets the function tracer flag to continue calling the functions | ||
61 | * from mcount. | ||
62 | */ | ||
63 | static inline void ftrace_start(void) | ||
64 | { | ||
65 | function_trace_stop = 0; | ||
66 | } | ||
67 | |||
26 | /* | 68 | /* |
27 | * The ftrace_ops must be a static and should also | 69 | * The ftrace_ops must be a static and should also |
28 | * be read_mostly. These functions do modify read_mostly variables | 70 | * be read_mostly. These functions do modify read_mostly variables |
@@ -41,9 +83,21 @@ extern void ftrace_stub(unsigned long a0, unsigned long a1); | |||
41 | # define unregister_ftrace_function(ops) do { } while (0) | 83 | # define unregister_ftrace_function(ops) do { } while (0) |
42 | # define clear_ftrace_function(ops) do { } while (0) | 84 | # define clear_ftrace_function(ops) do { } while (0) |
43 | static inline void ftrace_kill(void) { } | 85 | static inline void ftrace_kill(void) { } |
86 | static inline void ftrace_stop(void) { } | ||
87 | static inline void ftrace_start(void) { } | ||
44 | #endif /* CONFIG_FUNCTION_TRACER */ | 88 | #endif /* CONFIG_FUNCTION_TRACER */ |
45 | 89 | ||
90 | #ifdef CONFIG_STACK_TRACER | ||
91 | extern int stack_tracer_enabled; | ||
92 | int | ||
93 | stack_trace_sysctl(struct ctl_table *table, int write, | ||
94 | struct file *file, void __user *buffer, size_t *lenp, | ||
95 | loff_t *ppos); | ||
96 | #endif | ||
97 | |||
46 | #ifdef CONFIG_DYNAMIC_FTRACE | 98 | #ifdef CONFIG_DYNAMIC_FTRACE |
99 | /* asm/ftrace.h must be defined for archs supporting dynamic ftrace */ | ||
100 | #include <asm/ftrace.h> | ||
47 | 101 | ||
48 | enum { | 102 | enum { |
49 | FTRACE_FL_FREE = (1 << 0), | 103 | FTRACE_FL_FREE = (1 << 0), |
@@ -59,6 +113,7 @@ struct dyn_ftrace { | |||
59 | struct list_head list; | 113 | struct list_head list; |
60 | unsigned long ip; /* address of mcount call-site */ | 114 | unsigned long ip; /* address of mcount call-site */ |
61 | unsigned long flags; | 115 | unsigned long flags; |
116 | struct dyn_arch_ftrace arch; | ||
62 | }; | 117 | }; |
63 | 118 | ||
64 | int ftrace_force_update(void); | 119 | int ftrace_force_update(void); |
@@ -66,19 +121,48 @@ void ftrace_set_filter(unsigned char *buf, int len, int reset); | |||
66 | 121 | ||
67 | /* defined in arch */ | 122 | /* defined in arch */ |
68 | extern int ftrace_ip_converted(unsigned long ip); | 123 | extern int ftrace_ip_converted(unsigned long ip); |
69 | extern unsigned char *ftrace_nop_replace(void); | ||
70 | extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr); | ||
71 | extern int ftrace_dyn_arch_init(void *data); | 124 | extern int ftrace_dyn_arch_init(void *data); |
72 | extern int ftrace_update_ftrace_func(ftrace_func_t func); | 125 | extern int ftrace_update_ftrace_func(ftrace_func_t func); |
73 | extern void ftrace_caller(void); | 126 | extern void ftrace_caller(void); |
74 | extern void ftrace_call(void); | 127 | extern void ftrace_call(void); |
75 | extern void mcount_call(void); | 128 | extern void mcount_call(void); |
129 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
130 | extern void ftrace_graph_caller(void); | ||
131 | extern int ftrace_enable_ftrace_graph_caller(void); | ||
132 | extern int ftrace_disable_ftrace_graph_caller(void); | ||
133 | #else | ||
134 | static inline int ftrace_enable_ftrace_graph_caller(void) { return 0; } | ||
135 | static inline int ftrace_disable_ftrace_graph_caller(void) { return 0; } | ||
136 | #endif | ||
137 | |||
138 | /** | ||
139 | * ftrace_make_nop - convert code into top | ||
140 | * @mod: module structure if called by module load initialization | ||
141 | * @rec: the mcount call site record | ||
142 | * @addr: the address that the call site should be calling | ||
143 | * | ||
144 | * This is a very sensitive operation and great care needs | ||
145 | * to be taken by the arch. The operation should carefully | ||
146 | * read the location, check to see if what is read is indeed | ||
147 | * what we expect it to be, and then on success of the compare, | ||
148 | * it should write to the location. | ||
149 | * | ||
150 | * The code segment at @rec->ip should be a caller to @addr | ||
151 | * | ||
152 | * Return must be: | ||
153 | * 0 on success | ||
154 | * -EFAULT on error reading the location | ||
155 | * -EINVAL on a failed compare of the contents | ||
156 | * -EPERM on error writing to the location | ||
157 | * Any other value will be considered a failure. | ||
158 | */ | ||
159 | extern int ftrace_make_nop(struct module *mod, | ||
160 | struct dyn_ftrace *rec, unsigned long addr); | ||
76 | 161 | ||
77 | /** | 162 | /** |
78 | * ftrace_modify_code - modify code segment | 163 | * ftrace_make_call - convert a nop call site into a call to addr |
79 | * @ip: the address of the code segment | 164 | * @rec: the mcount call site record |
80 | * @old_code: the contents of what is expected to be there | 165 | * @addr: the address that the call site should call |
81 | * @new_code: the code to patch in | ||
82 | * | 166 | * |
83 | * This is a very sensitive operation and great care needs | 167 | * This is a very sensitive operation and great care needs |
84 | * to be taken by the arch. The operation should carefully | 168 | * to be taken by the arch. The operation should carefully |
@@ -86,6 +170,8 @@ extern void mcount_call(void); | |||
86 | * what we expect it to be, and then on success of the compare, | 170 | * what we expect it to be, and then on success of the compare, |
87 | * it should write to the location. | 171 | * it should write to the location. |
88 | * | 172 | * |
173 | * The code segment at @rec->ip should be a nop | ||
174 | * | ||
89 | * Return must be: | 175 | * Return must be: |
90 | * 0 on success | 176 | * 0 on success |
91 | * -EFAULT on error reading the location | 177 | * -EFAULT on error reading the location |
@@ -93,8 +179,11 @@ extern void mcount_call(void); | |||
93 | * -EPERM on error writing to the location | 179 | * -EPERM on error writing to the location |
94 | * Any other value will be considered a failure. | 180 | * Any other value will be considered a failure. |
95 | */ | 181 | */ |
96 | extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code, | 182 | extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr); |
97 | unsigned char *new_code); | 183 | |
184 | |||
185 | /* May be defined in arch */ | ||
186 | extern int ftrace_arch_read_dyn_info(char *buf, int size); | ||
98 | 187 | ||
99 | extern int skip_trace(unsigned long ip); | 188 | extern int skip_trace(unsigned long ip); |
100 | 189 | ||
@@ -102,7 +191,6 @@ extern void ftrace_release(void *start, unsigned long size); | |||
102 | 191 | ||
103 | extern void ftrace_disable_daemon(void); | 192 | extern void ftrace_disable_daemon(void); |
104 | extern void ftrace_enable_daemon(void); | 193 | extern void ftrace_enable_daemon(void); |
105 | |||
106 | #else | 194 | #else |
107 | # define skip_trace(ip) ({ 0; }) | 195 | # define skip_trace(ip) ({ 0; }) |
108 | # define ftrace_force_update() ({ 0; }) | 196 | # define ftrace_force_update() ({ 0; }) |
@@ -181,6 +269,12 @@ static inline void __ftrace_enabled_restore(int enabled) | |||
181 | #endif | 269 | #endif |
182 | 270 | ||
183 | #ifdef CONFIG_TRACING | 271 | #ifdef CONFIG_TRACING |
272 | extern int ftrace_dump_on_oops; | ||
273 | |||
274 | extern void tracing_start(void); | ||
275 | extern void tracing_stop(void); | ||
276 | extern void ftrace_off_permanent(void); | ||
277 | |||
184 | extern void | 278 | extern void |
185 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); | 279 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); |
186 | 280 | ||
@@ -209,8 +303,11 @@ extern void ftrace_dump(void); | |||
209 | static inline void | 303 | static inline void |
210 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } | 304 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } |
211 | static inline int | 305 | static inline int |
212 | ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0))); | 306 | ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); |
213 | 307 | ||
308 | static inline void tracing_start(void) { } | ||
309 | static inline void tracing_stop(void) { } | ||
310 | static inline void ftrace_off_permanent(void) { } | ||
214 | static inline int | 311 | static inline int |
215 | ftrace_printk(const char *fmt, ...) | 312 | ftrace_printk(const char *fmt, ...) |
216 | { | 313 | { |
@@ -221,33 +318,178 @@ static inline void ftrace_dump(void) { } | |||
221 | 318 | ||
222 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD | 319 | #ifdef CONFIG_FTRACE_MCOUNT_RECORD |
223 | extern void ftrace_init(void); | 320 | extern void ftrace_init(void); |
224 | extern void ftrace_init_module(unsigned long *start, unsigned long *end); | 321 | extern void ftrace_init_module(struct module *mod, |
322 | unsigned long *start, unsigned long *end); | ||
225 | #else | 323 | #else |
226 | static inline void ftrace_init(void) { } | 324 | static inline void ftrace_init(void) { } |
227 | static inline void | 325 | static inline void |
228 | ftrace_init_module(unsigned long *start, unsigned long *end) { } | 326 | ftrace_init_module(struct module *mod, |
327 | unsigned long *start, unsigned long *end) { } | ||
328 | #endif | ||
329 | |||
330 | enum { | ||
331 | POWER_NONE = 0, | ||
332 | POWER_CSTATE = 1, | ||
333 | POWER_PSTATE = 2, | ||
334 | }; | ||
335 | |||
336 | struct power_trace { | ||
337 | #ifdef CONFIG_POWER_TRACER | ||
338 | ktime_t stamp; | ||
339 | ktime_t end; | ||
340 | int type; | ||
341 | int state; | ||
229 | #endif | 342 | #endif |
343 | }; | ||
230 | 344 | ||
345 | #ifdef CONFIG_POWER_TRACER | ||
346 | extern void trace_power_start(struct power_trace *it, unsigned int type, | ||
347 | unsigned int state); | ||
348 | extern void trace_power_mark(struct power_trace *it, unsigned int type, | ||
349 | unsigned int state); | ||
350 | extern void trace_power_end(struct power_trace *it); | ||
351 | #else | ||
352 | static inline void trace_power_start(struct power_trace *it, unsigned int type, | ||
353 | unsigned int state) { } | ||
354 | static inline void trace_power_mark(struct power_trace *it, unsigned int type, | ||
355 | unsigned int state) { } | ||
356 | static inline void trace_power_end(struct power_trace *it) { } | ||
357 | #endif | ||
358 | |||
359 | |||
360 | /* | ||
361 | * Structure that defines an entry function trace. | ||
362 | */ | ||
363 | struct ftrace_graph_ent { | ||
364 | unsigned long func; /* Current function */ | ||
365 | int depth; | ||
366 | }; | ||
231 | 367 | ||
232 | struct boot_trace { | 368 | /* |
233 | pid_t caller; | 369 | * Structure that defines a return function trace. |
234 | char func[KSYM_NAME_LEN]; | 370 | */ |
235 | int result; | 371 | struct ftrace_graph_ret { |
236 | unsigned long long duration; /* usecs */ | 372 | unsigned long func; /* Current function */ |
237 | ktime_t calltime; | 373 | unsigned long long calltime; |
238 | ktime_t rettime; | 374 | unsigned long long rettime; |
375 | /* Number of functions that overran the depth limit for current task */ | ||
376 | unsigned long overrun; | ||
377 | int depth; | ||
239 | }; | 378 | }; |
240 | 379 | ||
241 | #ifdef CONFIG_BOOT_TRACER | 380 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
242 | extern void trace_boot(struct boot_trace *it, initcall_t fn); | 381 | |
243 | extern void start_boot_trace(void); | 382 | /* |
244 | extern void stop_boot_trace(void); | 383 | * Sometimes we don't want to trace a function with the function |
384 | * graph tracer but we want them to keep traced by the usual function | ||
385 | * tracer if the function graph tracer is not configured. | ||
386 | */ | ||
387 | #define __notrace_funcgraph notrace | ||
388 | |||
389 | /* | ||
390 | * We want to which function is an entrypoint of a hardirq. | ||
391 | * That will help us to put a signal on output. | ||
392 | */ | ||
393 | #define __irq_entry __attribute__((__section__(".irqentry.text"))) | ||
394 | |||
395 | /* Limits of hardirq entrypoints */ | ||
396 | extern char __irqentry_text_start[]; | ||
397 | extern char __irqentry_text_end[]; | ||
398 | |||
399 | #define FTRACE_RETFUNC_DEPTH 50 | ||
400 | #define FTRACE_RETSTACK_ALLOC_SIZE 32 | ||
401 | /* Type of the callback handlers for tracing function graph*/ | ||
402 | typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */ | ||
403 | typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */ | ||
404 | |||
405 | extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, | ||
406 | trace_func_graph_ent_t entryfunc); | ||
407 | |||
408 | extern void ftrace_graph_stop(void); | ||
409 | |||
410 | /* The current handlers in use */ | ||
411 | extern trace_func_graph_ret_t ftrace_graph_return; | ||
412 | extern trace_func_graph_ent_t ftrace_graph_entry; | ||
413 | |||
414 | extern void unregister_ftrace_graph(void); | ||
415 | |||
416 | extern void ftrace_graph_init_task(struct task_struct *t); | ||
417 | extern void ftrace_graph_exit_task(struct task_struct *t); | ||
418 | |||
419 | static inline int task_curr_ret_stack(struct task_struct *t) | ||
420 | { | ||
421 | return t->curr_ret_stack; | ||
422 | } | ||
423 | |||
424 | static inline void pause_graph_tracing(void) | ||
425 | { | ||
426 | atomic_inc(¤t->tracing_graph_pause); | ||
427 | } | ||
428 | |||
429 | static inline void unpause_graph_tracing(void) | ||
430 | { | ||
431 | atomic_dec(¤t->tracing_graph_pause); | ||
432 | } | ||
245 | #else | 433 | #else |
246 | static inline void trace_boot(struct boot_trace *it, initcall_t fn) { } | 434 | |
247 | static inline void start_boot_trace(void) { } | 435 | #define __notrace_funcgraph |
248 | static inline void stop_boot_trace(void) { } | 436 | #define __irq_entry |
437 | |||
438 | static inline void ftrace_graph_init_task(struct task_struct *t) { } | ||
439 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } | ||
440 | |||
441 | static inline int task_curr_ret_stack(struct task_struct *tsk) | ||
442 | { | ||
443 | return -1; | ||
444 | } | ||
445 | |||
446 | static inline void pause_graph_tracing(void) { } | ||
447 | static inline void unpause_graph_tracing(void) { } | ||
249 | #endif | 448 | #endif |
250 | 449 | ||
450 | #ifdef CONFIG_TRACING | ||
451 | #include <linux/sched.h> | ||
452 | |||
453 | /* flags for current->trace */ | ||
454 | enum { | ||
455 | TSK_TRACE_FL_TRACE_BIT = 0, | ||
456 | TSK_TRACE_FL_GRAPH_BIT = 1, | ||
457 | }; | ||
458 | enum { | ||
459 | TSK_TRACE_FL_TRACE = 1 << TSK_TRACE_FL_TRACE_BIT, | ||
460 | TSK_TRACE_FL_GRAPH = 1 << TSK_TRACE_FL_GRAPH_BIT, | ||
461 | }; | ||
462 | |||
463 | static inline void set_tsk_trace_trace(struct task_struct *tsk) | ||
464 | { | ||
465 | set_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace); | ||
466 | } | ||
467 | |||
468 | static inline void clear_tsk_trace_trace(struct task_struct *tsk) | ||
469 | { | ||
470 | clear_bit(TSK_TRACE_FL_TRACE_BIT, &tsk->trace); | ||
471 | } | ||
472 | |||
473 | static inline int test_tsk_trace_trace(struct task_struct *tsk) | ||
474 | { | ||
475 | return tsk->trace & TSK_TRACE_FL_TRACE; | ||
476 | } | ||
477 | |||
478 | static inline void set_tsk_trace_graph(struct task_struct *tsk) | ||
479 | { | ||
480 | set_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace); | ||
481 | } | ||
482 | |||
483 | static inline void clear_tsk_trace_graph(struct task_struct *tsk) | ||
484 | { | ||
485 | clear_bit(TSK_TRACE_FL_GRAPH_BIT, &tsk->trace); | ||
486 | } | ||
487 | |||
488 | static inline int test_tsk_trace_graph(struct task_struct *tsk) | ||
489 | { | ||
490 | return tsk->trace & TSK_TRACE_FL_GRAPH; | ||
491 | } | ||
251 | 492 | ||
493 | #endif /* CONFIG_TRACING */ | ||
252 | 494 | ||
253 | #endif /* _LINUX_FTRACE_H */ | 495 | #endif /* _LINUX_FTRACE_H */ |
diff --git a/include/linux/ftrace_irq.h b/include/linux/ftrace_irq.h new file mode 100644 index 000000000000..366a054d0b05 --- /dev/null +++ b/include/linux/ftrace_irq.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef _LINUX_FTRACE_IRQ_H | ||
2 | #define _LINUX_FTRACE_IRQ_H | ||
3 | |||
4 | |||
5 | #if defined(CONFIG_DYNAMIC_FTRACE) || defined(CONFIG_FUNCTION_GRAPH_TRACER) | ||
6 | extern void ftrace_nmi_enter(void); | ||
7 | extern void ftrace_nmi_exit(void); | ||
8 | #else | ||
9 | static inline void ftrace_nmi_enter(void) { } | ||
10 | static inline void ftrace_nmi_exit(void) { } | ||
11 | #endif | ||
12 | |||
13 | #endif /* _LINUX_FTRACE_IRQ_H */ | ||
diff --git a/include/linux/futex.h b/include/linux/futex.h index 586ab56a3ec3..3bf5bb5a34f9 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -25,7 +25,8 @@ union ktime; | |||
25 | #define FUTEX_WAKE_BITSET 10 | 25 | #define FUTEX_WAKE_BITSET 10 |
26 | 26 | ||
27 | #define FUTEX_PRIVATE_FLAG 128 | 27 | #define FUTEX_PRIVATE_FLAG 128 |
28 | #define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG | 28 | #define FUTEX_CLOCK_REALTIME 256 |
29 | #define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME) | ||
29 | 30 | ||
30 | #define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG) | 31 | #define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG) |
31 | #define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG) | 32 | #define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG) |
@@ -164,6 +165,8 @@ union futex_key { | |||
164 | } both; | 165 | } both; |
165 | }; | 166 | }; |
166 | 167 | ||
168 | #define FUTEX_KEY_INIT (union futex_key) { .both = { .ptr = NULL } } | ||
169 | |||
167 | #ifdef CONFIG_FUTEX | 170 | #ifdef CONFIG_FUTEX |
168 | extern void exit_robust_list(struct task_struct *curr); | 171 | extern void exit_robust_list(struct task_struct *curr); |
169 | extern void exit_pi_state_list(struct task_struct *curr); | 172 | extern void exit_pi_state_list(struct task_struct *curr); |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 3df7742ce246..16948eaecae3 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -126,6 +126,7 @@ struct blk_scsi_cmd_filter { | |||
126 | struct disk_part_tbl { | 126 | struct disk_part_tbl { |
127 | struct rcu_head rcu_head; | 127 | struct rcu_head rcu_head; |
128 | int len; | 128 | int len; |
129 | struct hd_struct *last_lookup; | ||
129 | struct hd_struct *part[]; | 130 | struct hd_struct *part[]; |
130 | }; | 131 | }; |
131 | 132 | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 181006cc94a0..f83288347dda 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #include <linux/smp_lock.h> | 5 | #include <linux/smp_lock.h> |
6 | #include <linux/lockdep.h> | 6 | #include <linux/lockdep.h> |
7 | #include <linux/ftrace_irq.h> | ||
7 | #include <asm/hardirq.h> | 8 | #include <asm/hardirq.h> |
8 | #include <asm/system.h> | 9 | #include <asm/system.h> |
9 | 10 | ||
@@ -118,13 +119,17 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
118 | } | 119 | } |
119 | #endif | 120 | #endif |
120 | 121 | ||
121 | #if defined(CONFIG_PREEMPT_RCU) && defined(CONFIG_NO_HZ) | 122 | #if defined(CONFIG_NO_HZ) && !defined(CONFIG_CLASSIC_RCU) |
122 | extern void rcu_irq_enter(void); | 123 | extern void rcu_irq_enter(void); |
123 | extern void rcu_irq_exit(void); | 124 | extern void rcu_irq_exit(void); |
125 | extern void rcu_nmi_enter(void); | ||
126 | extern void rcu_nmi_exit(void); | ||
124 | #else | 127 | #else |
125 | # define rcu_irq_enter() do { } while (0) | 128 | # define rcu_irq_enter() do { } while (0) |
126 | # define rcu_irq_exit() do { } while (0) | 129 | # define rcu_irq_exit() do { } while (0) |
127 | #endif /* CONFIG_PREEMPT_RCU */ | 130 | # define rcu_nmi_enter() do { } while (0) |
131 | # define rcu_nmi_exit() do { } while (0) | ||
132 | #endif /* #if defined(CONFIG_NO_HZ) && !defined(CONFIG_CLASSIC_RCU) */ | ||
128 | 133 | ||
129 | /* | 134 | /* |
130 | * It is safe to do non-atomic ops on ->hardirq_context, | 135 | * It is safe to do non-atomic ops on ->hardirq_context, |
@@ -134,7 +139,6 @@ extern void rcu_irq_exit(void); | |||
134 | */ | 139 | */ |
135 | #define __irq_enter() \ | 140 | #define __irq_enter() \ |
136 | do { \ | 141 | do { \ |
137 | rcu_irq_enter(); \ | ||
138 | account_system_vtime(current); \ | 142 | account_system_vtime(current); \ |
139 | add_preempt_count(HARDIRQ_OFFSET); \ | 143 | add_preempt_count(HARDIRQ_OFFSET); \ |
140 | trace_hardirq_enter(); \ | 144 | trace_hardirq_enter(); \ |
@@ -153,7 +157,6 @@ extern void irq_enter(void); | |||
153 | trace_hardirq_exit(); \ | 157 | trace_hardirq_exit(); \ |
154 | account_system_vtime(current); \ | 158 | account_system_vtime(current); \ |
155 | sub_preempt_count(HARDIRQ_OFFSET); \ | 159 | sub_preempt_count(HARDIRQ_OFFSET); \ |
156 | rcu_irq_exit(); \ | ||
157 | } while (0) | 160 | } while (0) |
158 | 161 | ||
159 | /* | 162 | /* |
@@ -161,7 +164,20 @@ extern void irq_enter(void); | |||
161 | */ | 164 | */ |
162 | extern void irq_exit(void); | 165 | extern void irq_exit(void); |
163 | 166 | ||
164 | #define nmi_enter() do { lockdep_off(); __irq_enter(); } while (0) | 167 | #define nmi_enter() \ |
165 | #define nmi_exit() do { __irq_exit(); lockdep_on(); } while (0) | 168 | do { \ |
169 | ftrace_nmi_enter(); \ | ||
170 | lockdep_off(); \ | ||
171 | rcu_nmi_enter(); \ | ||
172 | __irq_enter(); \ | ||
173 | } while (0) | ||
174 | |||
175 | #define nmi_exit() \ | ||
176 | do { \ | ||
177 | __irq_exit(); \ | ||
178 | rcu_nmi_exit(); \ | ||
179 | lockdep_on(); \ | ||
180 | ftrace_nmi_exit(); \ | ||
181 | } while (0) | ||
166 | 182 | ||
167 | #endif /* LINUX_HARDIRQ_H */ | 183 | #endif /* LINUX_HARDIRQ_H */ |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index c59769693bee..fd47a151665e 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -43,7 +43,7 @@ struct hdlc_proto { | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | 45 | ||
46 | /* Pointed to by dev->priv */ | 46 | /* Pointed to by netdev_priv(dev) */ |
47 | typedef struct hdlc_device { | 47 | typedef struct hdlc_device { |
48 | /* used by HDLC layer to take control over HDLC device from hw driver*/ | 48 | /* used by HDLC layer to take control over HDLC device from hw driver*/ |
49 | int (*attach)(struct net_device *dev, | 49 | int (*attach)(struct net_device *dev, |
@@ -80,7 +80,7 @@ struct net_device *alloc_hdlcdev(void *priv); | |||
80 | 80 | ||
81 | static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev) | 81 | static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev) |
82 | { | 82 | { |
83 | return dev->priv; | 83 | return netdev_priv(dev); |
84 | } | 84 | } |
85 | 85 | ||
86 | static __inline__ void debug_frame(const struct sk_buff *skb) | 86 | static __inline__ void debug_frame(const struct sk_buff *skb) |
diff --git a/include/linux/hippidevice.h b/include/linux/hippidevice.h index bab303dafd6e..f148e4908410 100644 --- a/include/linux/hippidevice.h +++ b/include/linux/hippidevice.h | |||
@@ -32,7 +32,9 @@ struct hippi_cb { | |||
32 | }; | 32 | }; |
33 | 33 | ||
34 | extern __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev); | 34 | extern __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev); |
35 | 35 | extern int hippi_change_mtu(struct net_device *dev, int new_mtu); | |
36 | extern int hippi_mac_addr(struct net_device *dev, void *p); | ||
37 | extern int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p); | ||
36 | extern struct net_device *alloc_hippi_dev(int sizeof_priv); | 38 | extern struct net_device *alloc_hippi_dev(int sizeof_priv); |
37 | #endif | 39 | #endif |
38 | 40 | ||
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 3eba43878dcb..bd37078c2d7d 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -43,26 +43,6 @@ enum hrtimer_restart { | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * hrtimer callback modes: | ||
47 | * | ||
48 | * HRTIMER_CB_SOFTIRQ: Callback must run in softirq context | ||
49 | * HRTIMER_CB_IRQSAFE_PERCPU: Callback must run in hardirq context | ||
50 | * Special mode for tick emulation and | ||
51 | * scheduler timer. Such timers are per | ||
52 | * cpu and not allowed to be migrated on | ||
53 | * cpu unplug. | ||
54 | * HRTIMER_CB_IRQSAFE_UNLOCKED: Callback should run in hardirq context | ||
55 | * with timer->base lock unlocked | ||
56 | * used for timers which call wakeup to | ||
57 | * avoid lock order problems with rq->lock | ||
58 | */ | ||
59 | enum hrtimer_cb_mode { | ||
60 | HRTIMER_CB_SOFTIRQ, | ||
61 | HRTIMER_CB_IRQSAFE_PERCPU, | ||
62 | HRTIMER_CB_IRQSAFE_UNLOCKED, | ||
63 | }; | ||
64 | |||
65 | /* | ||
66 | * Values to track state of the timer | 46 | * Values to track state of the timer |
67 | * | 47 | * |
68 | * Possible states: | 48 | * Possible states: |
@@ -70,7 +50,6 @@ enum hrtimer_cb_mode { | |||
70 | * 0x00 inactive | 50 | * 0x00 inactive |
71 | * 0x01 enqueued into rbtree | 51 | * 0x01 enqueued into rbtree |
72 | * 0x02 callback function running | 52 | * 0x02 callback function running |
73 | * 0x04 callback pending (high resolution mode) | ||
74 | * | 53 | * |
75 | * Special cases: | 54 | * Special cases: |
76 | * 0x03 callback function running and enqueued | 55 | * 0x03 callback function running and enqueued |
@@ -92,8 +71,7 @@ enum hrtimer_cb_mode { | |||
92 | #define HRTIMER_STATE_INACTIVE 0x00 | 71 | #define HRTIMER_STATE_INACTIVE 0x00 |
93 | #define HRTIMER_STATE_ENQUEUED 0x01 | 72 | #define HRTIMER_STATE_ENQUEUED 0x01 |
94 | #define HRTIMER_STATE_CALLBACK 0x02 | 73 | #define HRTIMER_STATE_CALLBACK 0x02 |
95 | #define HRTIMER_STATE_PENDING 0x04 | 74 | #define HRTIMER_STATE_MIGRATE 0x04 |
96 | #define HRTIMER_STATE_MIGRATE 0x08 | ||
97 | 75 | ||
98 | /** | 76 | /** |
99 | * struct hrtimer - the basic hrtimer structure | 77 | * struct hrtimer - the basic hrtimer structure |
@@ -109,8 +87,6 @@ enum hrtimer_cb_mode { | |||
109 | * @function: timer expiry callback function | 87 | * @function: timer expiry callback function |
110 | * @base: pointer to the timer base (per cpu and per clock) | 88 | * @base: pointer to the timer base (per cpu and per clock) |
111 | * @state: state information (See bit values above) | 89 | * @state: state information (See bit values above) |
112 | * @cb_mode: high resolution timer feature to select the callback execution | ||
113 | * mode | ||
114 | * @cb_entry: list head to enqueue an expired timer into the callback list | 90 | * @cb_entry: list head to enqueue an expired timer into the callback list |
115 | * @start_site: timer statistics field to store the site where the timer | 91 | * @start_site: timer statistics field to store the site where the timer |
116 | * was started | 92 | * was started |
@@ -129,7 +105,6 @@ struct hrtimer { | |||
129 | struct hrtimer_clock_base *base; | 105 | struct hrtimer_clock_base *base; |
130 | unsigned long state; | 106 | unsigned long state; |
131 | struct list_head cb_entry; | 107 | struct list_head cb_entry; |
132 | enum hrtimer_cb_mode cb_mode; | ||
133 | #ifdef CONFIG_TIMER_STATS | 108 | #ifdef CONFIG_TIMER_STATS |
134 | int start_pid; | 109 | int start_pid; |
135 | void *start_site; | 110 | void *start_site; |
@@ -188,15 +163,11 @@ struct hrtimer_clock_base { | |||
188 | * @check_clocks: Indictator, when set evaluate time source and clock | 163 | * @check_clocks: Indictator, when set evaluate time source and clock |
189 | * event devices whether high resolution mode can be | 164 | * event devices whether high resolution mode can be |
190 | * activated. | 165 | * activated. |
191 | * @cb_pending: Expired timers are moved from the rbtree to this | ||
192 | * list in the timer interrupt. The list is processed | ||
193 | * in the softirq. | ||
194 | * @nr_events: Total number of timer interrupt events | 166 | * @nr_events: Total number of timer interrupt events |
195 | */ | 167 | */ |
196 | struct hrtimer_cpu_base { | 168 | struct hrtimer_cpu_base { |
197 | spinlock_t lock; | 169 | spinlock_t lock; |
198 | struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; | 170 | struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; |
199 | struct list_head cb_pending; | ||
200 | #ifdef CONFIG_HIGH_RES_TIMERS | 171 | #ifdef CONFIG_HIGH_RES_TIMERS |
201 | ktime_t expires_next; | 172 | ktime_t expires_next; |
202 | int hres_active; | 173 | int hres_active; |
@@ -404,8 +375,7 @@ static inline int hrtimer_active(const struct hrtimer *timer) | |||
404 | */ | 375 | */ |
405 | static inline int hrtimer_is_queued(struct hrtimer *timer) | 376 | static inline int hrtimer_is_queued(struct hrtimer *timer) |
406 | { | 377 | { |
407 | return timer->state & | 378 | return timer->state & HRTIMER_STATE_ENQUEUED; |
408 | (HRTIMER_STATE_ENQUEUED | HRTIMER_STATE_PENDING); | ||
409 | } | 379 | } |
410 | 380 | ||
411 | /* | 381 | /* |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 010fb26a1579..e99c56de7f56 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -122,8 +122,6 @@ struct ide_io_ports { | |||
122 | #define MAX_DRIVES 2 /* per interface; 2 assumed by lots of code */ | 122 | #define MAX_DRIVES 2 /* per interface; 2 assumed by lots of code */ |
123 | #define SECTOR_SIZE 512 | 123 | #define SECTOR_SIZE 512 |
124 | 124 | ||
125 | #define IDE_LARGE_SEEK(b1,b2,t) (((b1) > (b2) + (t)) || ((b2) > (b1) + (t))) | ||
126 | |||
127 | /* | 125 | /* |
128 | * Timeouts for various operations: | 126 | * Timeouts for various operations: |
129 | */ | 127 | */ |
@@ -172,9 +170,7 @@ typedef int (ide_ack_intr_t)(struct hwif_s *); | |||
172 | enum { ide_unknown, ide_generic, ide_pci, | 170 | enum { ide_unknown, ide_generic, ide_pci, |
173 | ide_cmd640, ide_dtc2278, ide_ali14xx, | 171 | ide_cmd640, ide_dtc2278, ide_ali14xx, |
174 | ide_qd65xx, ide_umc8672, ide_ht6560b, | 172 | ide_qd65xx, ide_umc8672, ide_ht6560b, |
175 | ide_rz1000, ide_trm290, | 173 | ide_4drives, ide_pmac, ide_acorn, |
176 | ide_cmd646, ide_cy82c693, ide_4drives, | ||
177 | ide_pmac, ide_acorn, | ||
178 | ide_au1xxx, ide_palm3710 | 174 | ide_au1xxx, ide_palm3710 |
179 | }; | 175 | }; |
180 | 176 | ||
@@ -496,8 +492,6 @@ enum { | |||
496 | * when more than one interrupt is needed. | 492 | * when more than one interrupt is needed. |
497 | */ | 493 | */ |
498 | IDE_AFLAG_LIMIT_NFRAMES = (1 << 7), | 494 | IDE_AFLAG_LIMIT_NFRAMES = (1 << 7), |
499 | /* Seeking in progress. */ | ||
500 | IDE_AFLAG_SEEKING = (1 << 8), | ||
501 | /* Saved TOC information is current. */ | 495 | /* Saved TOC information is current. */ |
502 | IDE_AFLAG_TOC_VALID = (1 << 9), | 496 | IDE_AFLAG_TOC_VALID = (1 << 9), |
503 | /* We think that the drive door is locked. */ | 497 | /* We think that the drive door is locked. */ |
@@ -845,8 +839,6 @@ typedef struct hwif_s { | |||
845 | unsigned extra_ports; /* number of extra dma ports */ | 839 | unsigned extra_ports; /* number of extra dma ports */ |
846 | 840 | ||
847 | unsigned present : 1; /* this interface exists */ | 841 | unsigned present : 1; /* this interface exists */ |
848 | unsigned serialized : 1; /* serialized all channel operation */ | ||
849 | unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ | ||
850 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 842 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
851 | 843 | ||
852 | struct device gendev; | 844 | struct device gendev; |
@@ -909,6 +901,8 @@ typedef struct hwgroup_s { | |||
909 | 901 | ||
910 | int req_gen; | 902 | int req_gen; |
911 | int req_gen_timer; | 903 | int req_gen_timer; |
904 | |||
905 | spinlock_t lock; | ||
912 | } ide_hwgroup_t; | 906 | } ide_hwgroup_t; |
913 | 907 | ||
914 | typedef struct ide_driver_s ide_driver_t; | 908 | typedef struct ide_driver_s ide_driver_t; |
@@ -1122,6 +1116,14 @@ enum { | |||
1122 | IDE_PM_COMPLETED, | 1116 | IDE_PM_COMPLETED, |
1123 | }; | 1117 | }; |
1124 | 1118 | ||
1119 | int generic_ide_suspend(struct device *, pm_message_t); | ||
1120 | int generic_ide_resume(struct device *); | ||
1121 | |||
1122 | void ide_complete_power_step(ide_drive_t *, struct request *); | ||
1123 | ide_startstop_t ide_start_power_step(ide_drive_t *, struct request *); | ||
1124 | void ide_complete_pm_request(ide_drive_t *, struct request *); | ||
1125 | void ide_check_pm_state(ide_drive_t *, struct request *); | ||
1126 | |||
1125 | /* | 1127 | /* |
1126 | * Subdrivers support. | 1128 | * Subdrivers support. |
1127 | * | 1129 | * |
@@ -1376,8 +1378,8 @@ enum { | |||
1376 | IDE_HFLAG_LEGACY_IRQS = (1 << 21), | 1378 | IDE_HFLAG_LEGACY_IRQS = (1 << 21), |
1377 | /* force use of legacy IRQs */ | 1379 | /* force use of legacy IRQs */ |
1378 | IDE_HFLAG_FORCE_LEGACY_IRQS = (1 << 22), | 1380 | IDE_HFLAG_FORCE_LEGACY_IRQS = (1 << 22), |
1379 | /* limit LBA48 requests to 256 sectors */ | 1381 | /* host is TRM290 */ |
1380 | IDE_HFLAG_RQSIZE_256 = (1 << 23), | 1382 | IDE_HFLAG_TRM290 = (1 << 23), |
1381 | /* use 32-bit I/O ops */ | 1383 | /* use 32-bit I/O ops */ |
1382 | IDE_HFLAG_IO_32BIT = (1 << 24), | 1384 | IDE_HFLAG_IO_32BIT = (1 << 24), |
1383 | /* unmask IRQs */ | 1385 | /* unmask IRQs */ |
@@ -1415,6 +1417,9 @@ struct ide_port_info { | |||
1415 | 1417 | ||
1416 | ide_pci_enablebit_t enablebits[2]; | 1418 | ide_pci_enablebit_t enablebits[2]; |
1417 | hwif_chipset_t chipset; | 1419 | hwif_chipset_t chipset; |
1420 | |||
1421 | u16 max_sectors; /* if < than the default one */ | ||
1422 | |||
1418 | u32 host_flags; | 1423 | u32 host_flags; |
1419 | u8 pio_mask; | 1424 | u8 pio_mask; |
1420 | u8 swdma_mask; | 1425 | u8 swdma_mask; |
@@ -1610,13 +1615,13 @@ extern struct mutex ide_cfg_mtx; | |||
1610 | /* | 1615 | /* |
1611 | * Structure locking: | 1616 | * Structure locking: |
1612 | * | 1617 | * |
1613 | * ide_cfg_mtx and ide_lock together protect changes to | 1618 | * ide_cfg_mtx and hwgroup->lock together protect changes to |
1614 | * ide_hwif_t->{next,hwgroup} | 1619 | * ide_hwif_t->next |
1615 | * ide_drive_t->next | 1620 | * ide_drive_t->next |
1616 | * | 1621 | * |
1617 | * ide_hwgroup_t->busy: ide_lock | 1622 | * ide_hwgroup_t->busy: hwgroup->lock |
1618 | * ide_hwgroup_t->hwif: ide_lock | 1623 | * ide_hwgroup_t->hwif: hwgroup->lock |
1619 | * ide_hwif_t->mate: constant, no locking | 1624 | * ide_hwif_t->{hwgroup,mate}: constant, no locking |
1620 | * ide_drive_t->hwif: constant, no locking | 1625 | * ide_drive_t->hwif: constant, no locking |
1621 | */ | 1626 | */ |
1622 | 1627 | ||
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 14126bc36641..c4e6ca1a6306 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -12,8 +12,8 @@ | |||
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifndef IEEE80211_H | 15 | #ifndef LINUX_IEEE80211_H |
16 | #define IEEE80211_H | 16 | #define LINUX_IEEE80211_H |
17 | 17 | ||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <asm/byteorder.h> | 19 | #include <asm/byteorder.h> |
@@ -97,7 +97,10 @@ | |||
97 | #define IEEE80211_MAX_FRAME_LEN 2352 | 97 | #define IEEE80211_MAX_FRAME_LEN 2352 |
98 | 98 | ||
99 | #define IEEE80211_MAX_SSID_LEN 32 | 99 | #define IEEE80211_MAX_SSID_LEN 32 |
100 | |||
100 | #define IEEE80211_MAX_MESH_ID_LEN 32 | 101 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
102 | #define IEEE80211_MESH_CONFIG_LEN 19 | ||
103 | |||
101 | #define IEEE80211_QOS_CTL_LEN 2 | 104 | #define IEEE80211_QOS_CTL_LEN 2 |
102 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F | 105 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F |
103 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 | 106 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 |
@@ -666,6 +669,13 @@ struct ieee80211_cts { | |||
666 | u8 ra[6]; | 669 | u8 ra[6]; |
667 | } __attribute__ ((packed)); | 670 | } __attribute__ ((packed)); |
668 | 671 | ||
672 | struct ieee80211_pspoll { | ||
673 | __le16 frame_control; | ||
674 | __le16 aid; | ||
675 | u8 bssid[6]; | ||
676 | u8 ta[6]; | ||
677 | } __attribute__ ((packed)); | ||
678 | |||
669 | /** | 679 | /** |
670 | * struct ieee80211_bar - HT Block Ack Request | 680 | * struct ieee80211_bar - HT Block Ack Request |
671 | * | 681 | * |
@@ -685,28 +695,88 @@ struct ieee80211_bar { | |||
685 | #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 | 695 | #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 |
686 | #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 | 696 | #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 |
687 | 697 | ||
698 | |||
699 | #define IEEE80211_HT_MCS_MASK_LEN 10 | ||
700 | |||
701 | /** | ||
702 | * struct ieee80211_mcs_info - MCS information | ||
703 | * @rx_mask: RX mask | ||
704 | * @rx_highest: highest supported RX rate | ||
705 | * @tx_params: TX parameters | ||
706 | */ | ||
707 | struct ieee80211_mcs_info { | ||
708 | u8 rx_mask[IEEE80211_HT_MCS_MASK_LEN]; | ||
709 | __le16 rx_highest; | ||
710 | u8 tx_params; | ||
711 | u8 reserved[3]; | ||
712 | } __attribute__((packed)); | ||
713 | |||
714 | /* 802.11n HT capability MSC set */ | ||
715 | #define IEEE80211_HT_MCS_RX_HIGHEST_MASK 0x3ff | ||
716 | #define IEEE80211_HT_MCS_TX_DEFINED 0x01 | ||
717 | #define IEEE80211_HT_MCS_TX_RX_DIFF 0x02 | ||
718 | /* value 0 == 1 stream etc */ | ||
719 | #define IEEE80211_HT_MCS_TX_MAX_STREAMS_MASK 0x0C | ||
720 | #define IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT 2 | ||
721 | #define IEEE80211_HT_MCS_TX_MAX_STREAMS 4 | ||
722 | #define IEEE80211_HT_MCS_TX_UNEQUAL_MODULATION 0x10 | ||
723 | |||
724 | /* | ||
725 | * 802.11n D5.0 20.3.5 / 20.6 says: | ||
726 | * - indices 0 to 7 and 32 are single spatial stream | ||
727 | * - 8 to 31 are multiple spatial streams using equal modulation | ||
728 | * [8..15 for two streams, 16..23 for three and 24..31 for four] | ||
729 | * - remainder are multiple spatial streams using unequal modulation | ||
730 | */ | ||
731 | #define IEEE80211_HT_MCS_UNEQUAL_MODULATION_START 33 | ||
732 | #define IEEE80211_HT_MCS_UNEQUAL_MODULATION_START_BYTE \ | ||
733 | (IEEE80211_HT_MCS_UNEQUAL_MODULATION_START / 8) | ||
734 | |||
688 | /** | 735 | /** |
689 | * struct ieee80211_ht_cap - HT capabilities | 736 | * struct ieee80211_ht_cap - HT capabilities |
690 | * | 737 | * |
691 | * This structure refers to "HT capabilities element" as | 738 | * This structure is the "HT capabilities element" as |
692 | * described in 802.11n draft section 7.3.2.52 | 739 | * described in 802.11n D5.0 7.3.2.57 |
693 | */ | 740 | */ |
694 | struct ieee80211_ht_cap { | 741 | struct ieee80211_ht_cap { |
695 | __le16 cap_info; | 742 | __le16 cap_info; |
696 | u8 ampdu_params_info; | 743 | u8 ampdu_params_info; |
697 | u8 supp_mcs_set[16]; | 744 | |
745 | /* 16 bytes MCS information */ | ||
746 | struct ieee80211_mcs_info mcs; | ||
747 | |||
698 | __le16 extended_ht_cap_info; | 748 | __le16 extended_ht_cap_info; |
699 | __le32 tx_BF_cap_info; | 749 | __le32 tx_BF_cap_info; |
700 | u8 antenna_selection_info; | 750 | u8 antenna_selection_info; |
701 | } __attribute__ ((packed)); | 751 | } __attribute__ ((packed)); |
702 | 752 | ||
753 | /* 802.11n HT capabilities masks (for cap_info) */ | ||
754 | #define IEEE80211_HT_CAP_LDPC_CODING 0x0001 | ||
755 | #define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 | ||
756 | #define IEEE80211_HT_CAP_SM_PS 0x000C | ||
757 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 | ||
758 | #define IEEE80211_HT_CAP_SGI_20 0x0020 | ||
759 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | ||
760 | #define IEEE80211_HT_CAP_TX_STBC 0x0080 | ||
761 | #define IEEE80211_HT_CAP_RX_STBC 0x0300 | ||
762 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | ||
763 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | ||
764 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | ||
765 | #define IEEE80211_HT_CAP_PSMP_SUPPORT 0x2000 | ||
766 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 | ||
767 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 | ||
768 | |||
769 | /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ | ||
770 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 | ||
771 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C | ||
772 | |||
703 | /** | 773 | /** |
704 | * struct ieee80211_ht_cap - HT additional information | 774 | * struct ieee80211_ht_info - HT information |
705 | * | 775 | * |
706 | * This structure refers to "HT information element" as | 776 | * This structure is the "HT information element" as |
707 | * described in 802.11n draft section 7.3.2.53 | 777 | * described in 802.11n D5.0 7.3.2.58 |
708 | */ | 778 | */ |
709 | struct ieee80211_ht_addt_info { | 779 | struct ieee80211_ht_info { |
710 | u8 control_chan; | 780 | u8 control_chan; |
711 | u8 ht_param; | 781 | u8 ht_param; |
712 | __le16 operation_mode; | 782 | __le16 operation_mode; |
@@ -714,36 +784,33 @@ struct ieee80211_ht_addt_info { | |||
714 | u8 basic_set[16]; | 784 | u8 basic_set[16]; |
715 | } __attribute__ ((packed)); | 785 | } __attribute__ ((packed)); |
716 | 786 | ||
717 | /* 802.11n HT capabilities masks */ | 787 | /* for ht_param */ |
718 | #define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 | 788 | #define IEEE80211_HT_PARAM_CHA_SEC_OFFSET 0x03 |
719 | #define IEEE80211_HT_CAP_SM_PS 0x000C | 789 | #define IEEE80211_HT_PARAM_CHA_SEC_NONE 0x00 |
720 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 | 790 | #define IEEE80211_HT_PARAM_CHA_SEC_ABOVE 0x01 |
721 | #define IEEE80211_HT_CAP_SGI_20 0x0020 | 791 | #define IEEE80211_HT_PARAM_CHA_SEC_BELOW 0x03 |
722 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | 792 | #define IEEE80211_HT_PARAM_CHAN_WIDTH_ANY 0x04 |
723 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | 793 | #define IEEE80211_HT_PARAM_RIFS_MODE 0x08 |
724 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | 794 | #define IEEE80211_HT_PARAM_SPSMP_SUPPORT 0x10 |
725 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | 795 | #define IEEE80211_HT_PARAM_SERV_INTERVAL_GRAN 0xE0 |
726 | /* 802.11n HT capability AMPDU settings */ | 796 | |
727 | #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 | 797 | /* for operation_mode */ |
728 | #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C | 798 | #define IEEE80211_HT_OP_MODE_PROTECTION 0x0003 |
729 | /* 802.11n HT capability MSC set */ | 799 | #define IEEE80211_HT_OP_MODE_PROTECTION_NONE 0 |
730 | #define IEEE80211_SUPP_MCS_SET_UEQM 4 | 800 | #define IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER 1 |
731 | #define IEEE80211_HT_CAP_MAX_STREAMS 4 | 801 | #define IEEE80211_HT_OP_MODE_PROTECTION_20MHZ 2 |
732 | #define IEEE80211_SUPP_MCS_SET_LEN 10 | 802 | #define IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED 3 |
733 | /* maximum streams the spec allows */ | 803 | #define IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT 0x0004 |
734 | #define IEEE80211_HT_CAP_MCS_TX_DEFINED 0x01 | 804 | #define IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT 0x0010 |
735 | #define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02 | 805 | |
736 | #define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C | 806 | /* for stbc_param */ |
737 | #define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10 | 807 | #define IEEE80211_HT_STBC_PARAM_DUAL_BEACON 0x0040 |
738 | /* 802.11n HT IE masks */ | 808 | #define IEEE80211_HT_STBC_PARAM_DUAL_CTS_PROT 0x0080 |
739 | #define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 | 809 | #define IEEE80211_HT_STBC_PARAM_STBC_BEACON 0x0100 |
740 | #define IEEE80211_HT_IE_CHA_SEC_NONE 0x00 | 810 | #define IEEE80211_HT_STBC_PARAM_LSIG_TXOP_FULLPROT 0x0200 |
741 | #define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01 | 811 | #define IEEE80211_HT_STBC_PARAM_PCO_ACTIVE 0x0400 |
742 | #define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03 | 812 | #define IEEE80211_HT_STBC_PARAM_PCO_PHASE 0x0800 |
743 | #define IEEE80211_HT_IE_CHA_WIDTH 0x04 | 813 | |
744 | #define IEEE80211_HT_IE_HT_PROTECTION 0x0003 | ||
745 | #define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 | ||
746 | #define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 | ||
747 | 814 | ||
748 | /* block-ack parameters */ | 815 | /* block-ack parameters */ |
749 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 | 816 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 |
@@ -769,7 +836,6 @@ struct ieee80211_ht_addt_info { | |||
769 | /* Authentication algorithms */ | 836 | /* Authentication algorithms */ |
770 | #define WLAN_AUTH_OPEN 0 | 837 | #define WLAN_AUTH_OPEN 0 |
771 | #define WLAN_AUTH_SHARED_KEY 1 | 838 | #define WLAN_AUTH_SHARED_KEY 1 |
772 | #define WLAN_AUTH_FAST_BSS_TRANSITION 2 | ||
773 | #define WLAN_AUTH_LEAP 128 | 839 | #define WLAN_AUTH_LEAP 128 |
774 | 840 | ||
775 | #define WLAN_AUTH_CHALLENGE_LEN 128 | 841 | #define WLAN_AUTH_CHALLENGE_LEN 128 |
@@ -949,7 +1015,7 @@ enum ieee80211_eid { | |||
949 | WLAN_EID_EXT_SUPP_RATES = 50, | 1015 | WLAN_EID_EXT_SUPP_RATES = 50, |
950 | /* 802.11n */ | 1016 | /* 802.11n */ |
951 | WLAN_EID_HT_CAPABILITY = 45, | 1017 | WLAN_EID_HT_CAPABILITY = 45, |
952 | WLAN_EID_HT_EXTRA_INFO = 61, | 1018 | WLAN_EID_HT_INFORMATION = 61, |
953 | /* 802.11i */ | 1019 | /* 802.11i */ |
954 | WLAN_EID_RSN = 48, | 1020 | WLAN_EID_RSN = 48, |
955 | WLAN_EID_WPA = 221, | 1021 | WLAN_EID_WPA = 221, |
@@ -976,6 +1042,68 @@ enum ieee80211_spectrum_mgmt_actioncode { | |||
976 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, | 1042 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, |
977 | }; | 1043 | }; |
978 | 1044 | ||
1045 | /* | ||
1046 | * IEEE 802.11-2007 7.3.2.9 Country information element | ||
1047 | * | ||
1048 | * Minimum length is 8 octets, ie len must be evenly | ||
1049 | * divisible by 2 | ||
1050 | */ | ||
1051 | |||
1052 | /* Although the spec says 8 I'm seeing 6 in practice */ | ||
1053 | #define IEEE80211_COUNTRY_IE_MIN_LEN 6 | ||
1054 | |||
1055 | /* | ||
1056 | * For regulatory extension stuff see IEEE 802.11-2007 | ||
1057 | * Annex I (page 1141) and Annex J (page 1147). Also | ||
1058 | * review 7.3.2.9. | ||
1059 | * | ||
1060 | * When dot11RegulatoryClassesRequired is true and the | ||
1061 | * first_channel/reg_extension_id is >= 201 then the IE | ||
1062 | * compromises of the 'ext' struct represented below: | ||
1063 | * | ||
1064 | * - Regulatory extension ID - when generating IE this just needs | ||
1065 | * to be monotonically increasing for each triplet passed in | ||
1066 | * the IE | ||
1067 | * - Regulatory class - index into set of rules | ||
1068 | * - Coverage class - index into air propagation time (Table 7-27), | ||
1069 | * in microseconds, you can compute the air propagation time from | ||
1070 | * the index by multiplying by 3, so index 10 yields a propagation | ||
1071 | * of 10 us. Valid values are 0-31, values 32-255 are not defined | ||
1072 | * yet. A value of 0 inicates air propagation of <= 1 us. | ||
1073 | * | ||
1074 | * See also Table I.2 for Emission limit sets and table | ||
1075 | * I.3 for Behavior limit sets. Table J.1 indicates how to map | ||
1076 | * a reg_class to an emission limit set and behavior limit set. | ||
1077 | */ | ||
1078 | #define IEEE80211_COUNTRY_EXTENSION_ID 201 | ||
1079 | |||
1080 | /* | ||
1081 | * Channels numbers in the IE must be monotonically increasing | ||
1082 | * if dot11RegulatoryClassesRequired is not true. | ||
1083 | * | ||
1084 | * If dot11RegulatoryClassesRequired is true consecutive | ||
1085 | * subband triplets following a regulatory triplet shall | ||
1086 | * have monotonically increasing first_channel number fields. | ||
1087 | * | ||
1088 | * Channel numbers shall not overlap. | ||
1089 | * | ||
1090 | * Note that max_power is signed. | ||
1091 | */ | ||
1092 | struct ieee80211_country_ie_triplet { | ||
1093 | union { | ||
1094 | struct { | ||
1095 | u8 first_channel; | ||
1096 | u8 num_channels; | ||
1097 | s8 max_power; | ||
1098 | } __attribute__ ((packed)) chans; | ||
1099 | struct { | ||
1100 | u8 reg_extension_id; | ||
1101 | u8 reg_class; | ||
1102 | u8 coverage_class; | ||
1103 | } __attribute__ ((packed)) ext; | ||
1104 | }; | ||
1105 | } __attribute__ ((packed)); | ||
1106 | |||
979 | /* BACK action code */ | 1107 | /* BACK action code */ |
980 | enum ieee80211_back_actioncode { | 1108 | enum ieee80211_back_actioncode { |
981 | WLAN_ACTION_ADDBA_REQ = 0, | 1109 | WLAN_ACTION_ADDBA_REQ = 0, |
@@ -1057,4 +1185,4 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) | |||
1057 | return hdr->addr1; | 1185 | return hdr->addr1; |
1058 | } | 1186 | } |
1059 | 1187 | ||
1060 | #endif /* IEEE80211_H */ | 1188 | #endif /* LINUX_IEEE80211_H */ |
diff --git a/include/linux/if.h b/include/linux/if.h index 65246846c844..2a6e29620a96 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -65,6 +65,7 @@ | |||
65 | #define IFF_BONDING 0x20 /* bonding master or slave */ | 65 | #define IFF_BONDING 0x20 /* bonding master or slave */ |
66 | #define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ | 66 | #define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ |
67 | #define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */ | 67 | #define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */ |
68 | #define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */ | ||
68 | 69 | ||
69 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 70 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
70 | #define IF_GET_PROTO 0x0002 | 71 | #define IF_GET_PROTO 0x0002 |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 4d3401812e6c..5ff89809a581 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -87,6 +87,9 @@ | |||
87 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ | 87 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ |
88 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ | 88 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ |
89 | 89 | ||
90 | #define ARPHRD_PHONET 820 /* PhoNet media type */ | ||
91 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ | ||
92 | |||
90 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ | 93 | #define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ |
91 | #define ARPHRD_NONE 0xFFFE /* zero header length */ | 94 | #define ARPHRD_NONE 0xFFFE /* zero header length */ |
92 | 95 | ||
diff --git a/include/linux/in.h b/include/linux/in.h index db458beef19d..d60122a3a088 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -80,6 +80,10 @@ struct in_addr { | |||
80 | /* BSD compatibility */ | 80 | /* BSD compatibility */ |
81 | #define IP_RECVRETOPTS IP_RETOPTS | 81 | #define IP_RECVRETOPTS IP_RETOPTS |
82 | 82 | ||
83 | /* TProxy original addresses */ | ||
84 | #define IP_ORIGDSTADDR 20 | ||
85 | #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR | ||
86 | |||
83 | /* IP_MTU_DISCOVER values */ | 87 | /* IP_MTU_DISCOVER values */ |
84 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ | 88 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ |
85 | #define IP_PMTUDISC_WANT 1 /* Use per route hints */ | 89 | #define IP_PMTUDISC_WANT 1 /* Use per route hints */ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 23fd8909b9e5..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 | { \ |
@@ -57,7 +58,6 @@ extern struct nsproxy init_nsproxy; | |||
57 | .mnt_ns = NULL, \ | 58 | .mnt_ns = NULL, \ |
58 | INIT_NET_NS(net_ns) \ | 59 | INIT_NET_NS(net_ns) \ |
59 | INIT_IPC_NS(ipc_ns) \ | 60 | INIT_IPC_NS(ipc_ns) \ |
60 | .user_ns = &init_user_ns, \ | ||
61 | } | 61 | } |
62 | 62 | ||
63 | #define INIT_SIGHAND(sighand) { \ | 63 | #define INIT_SIGHAND(sighand) { \ |
@@ -113,6 +113,8 @@ extern struct group_info init_groups; | |||
113 | # define CAP_INIT_BSET CAP_INIT_EFF_SET | 113 | # define CAP_INIT_BSET CAP_INIT_EFF_SET |
114 | #endif | 114 | #endif |
115 | 115 | ||
116 | extern struct cred init_cred; | ||
117 | |||
116 | /* | 118 | /* |
117 | * INIT_TASK is used to set up the first task table, touch at | 119 | * INIT_TASK is used to set up the first task table, touch at |
118 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 120 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
@@ -147,13 +149,10 @@ extern struct group_info init_groups; | |||
147 | .children = LIST_HEAD_INIT(tsk.children), \ | 149 | .children = LIST_HEAD_INIT(tsk.children), \ |
148 | .sibling = LIST_HEAD_INIT(tsk.sibling), \ | 150 | .sibling = LIST_HEAD_INIT(tsk.sibling), \ |
149 | .group_leader = &tsk, \ | 151 | .group_leader = &tsk, \ |
150 | .group_info = &init_groups, \ | 152 | .real_cred = &init_cred, \ |
151 | .cap_effective = CAP_INIT_EFF_SET, \ | 153 | .cred = &init_cred, \ |
152 | .cap_inheritable = CAP_INIT_INH_SET, \ | 154 | .cred_exec_mutex = \ |
153 | .cap_permitted = CAP_FULL_SET, \ | 155 | __MUTEX_INITIALIZER(tsk.cred_exec_mutex), \ |
154 | .cap_bset = CAP_INIT_BSET, \ | ||
155 | .securebits = SECUREBITS_DEFAULT, \ | ||
156 | .user = INIT_USER, \ | ||
157 | .comm = "swapper", \ | 156 | .comm = "swapper", \ |
158 | .thread = INIT_THREAD, \ | 157 | .thread = INIT_THREAD, \ |
159 | .fs = &init_fs, \ | 158 | .fs = &init_fs, \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 5341e8251f8c..9a6355f74db2 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -659,6 +659,8 @@ struct input_absinfo { | |||
659 | #define SW_RADIO SW_RFKILL_ALL /* deprecated */ | 659 | #define SW_RADIO SW_RFKILL_ALL /* deprecated */ |
660 | #define SW_MICROPHONE_INSERT 0x04 /* set = inserted */ | 660 | #define SW_MICROPHONE_INSERT 0x04 /* set = inserted */ |
661 | #define SW_DOCK 0x05 /* set = plugged into dock */ | 661 | #define SW_DOCK 0x05 /* set = plugged into dock */ |
662 | #define SW_LINEOUT_INSERT 0x06 /* set = inserted */ | ||
663 | #define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */ | ||
662 | #define SW_MAX 0x0f | 664 | #define SW_MAX 0x0f |
663 | #define SW_CNT (SW_MAX+1) | 665 | #define SW_CNT (SW_MAX+1) |
664 | 666 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index f58a0cf8929a..8cc8ef47f5b6 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/irqflags.h> | 14 | #include <linux/irqflags.h> |
15 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
16 | #include <linux/percpu.h> | 16 | #include <linux/percpu.h> |
17 | #include <linux/irqnr.h> | ||
18 | |||
17 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
18 | #include <asm/ptrace.h> | 20 | #include <asm/ptrace.h> |
19 | #include <asm/system.h> | 21 | #include <asm/system.h> |
@@ -251,9 +253,6 @@ enum | |||
251 | BLOCK_SOFTIRQ, | 253 | BLOCK_SOFTIRQ, |
252 | TASKLET_SOFTIRQ, | 254 | TASKLET_SOFTIRQ, |
253 | SCHED_SOFTIRQ, | 255 | SCHED_SOFTIRQ, |
254 | #ifdef CONFIG_HIGH_RES_TIMERS | ||
255 | HRTIMER_SOFTIRQ, | ||
256 | #endif | ||
257 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ | 256 | RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */ |
258 | 257 | ||
259 | NR_SOFTIRQS | 258 | NR_SOFTIRQS |
@@ -465,4 +464,10 @@ static inline void init_irq_proc(void) | |||
465 | 464 | ||
466 | int show_interrupts(struct seq_file *p, void *v); | 465 | int show_interrupts(struct seq_file *p, void *v); |
467 | 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 | |||
468 | #endif | 473 | #endif |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 641e026eee8f..0b816cae533e 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -278,6 +278,7 @@ struct ipv6_pinfo { | |||
278 | struct in6_addr saddr; | 278 | struct in6_addr saddr; |
279 | struct in6_addr rcv_saddr; | 279 | struct in6_addr rcv_saddr; |
280 | struct in6_addr daddr; | 280 | struct in6_addr daddr; |
281 | struct in6_pktinfo sticky_pktinfo; | ||
281 | struct in6_addr *daddr_cache; | 282 | struct in6_addr *daddr_cache; |
282 | #ifdef CONFIG_IPV6_SUBTREES | 283 | #ifdef CONFIG_IPV6_SUBTREES |
283 | struct in6_addr *saddr_cache; | 284 | struct in6_addr *saddr_cache; |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 3dddfa703ebd..d64a6d49bdef 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -129,9 +129,14 @@ struct irq_chip { | |||
129 | const char *typename; | 129 | const char *typename; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | struct timer_rand_state; | ||
133 | struct irq_2_iommu; | ||
132 | /** | 134 | /** |
133 | * struct irq_desc - interrupt descriptor | 135 | * struct irq_desc - interrupt descriptor |
134 | * @irq: interrupt number for this descriptor | 136 | * @irq: interrupt number for this descriptor |
137 | * @timer_rand_state: pointer to timer rand state struct | ||
138 | * @kstat_irqs: irq stats per cpu | ||
139 | * @irq_2_iommu: iommu with this irq | ||
135 | * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] | 140 | * @handle_irq: highlevel irq-events handler [if NULL, __do_IRQ()] |
136 | * @chip: low level interrupt hardware access | 141 | * @chip: low level interrupt hardware access |
137 | * @msi_desc: MSI descriptor | 142 | * @msi_desc: MSI descriptor |
@@ -143,8 +148,8 @@ struct irq_chip { | |||
143 | * @depth: disable-depth, for nested irq_disable() calls | 148 | * @depth: disable-depth, for nested irq_disable() calls |
144 | * @wake_depth: enable depth, for multiple set_irq_wake() callers | 149 | * @wake_depth: enable depth, for multiple set_irq_wake() callers |
145 | * @irq_count: stats field to detect stalled irqs | 150 | * @irq_count: stats field to detect stalled irqs |
146 | * @irqs_unhandled: stats field for spurious unhandled interrupts | ||
147 | * @last_unhandled: aging timer for unhandled count | 151 | * @last_unhandled: aging timer for unhandled count |
152 | * @irqs_unhandled: stats field for spurious unhandled interrupts | ||
148 | * @lock: locking for SMP | 153 | * @lock: locking for SMP |
149 | * @affinity: IRQ affinity on SMP | 154 | * @affinity: IRQ affinity on SMP |
150 | * @cpu: cpu index useful for balancing | 155 | * @cpu: cpu index useful for balancing |
@@ -154,6 +159,13 @@ struct irq_chip { | |||
154 | */ | 159 | */ |
155 | struct irq_desc { | 160 | struct irq_desc { |
156 | unsigned int irq; | 161 | unsigned int irq; |
162 | #ifdef CONFIG_SPARSE_IRQ | ||
163 | struct timer_rand_state *timer_rand_state; | ||
164 | unsigned int *kstat_irqs; | ||
165 | # ifdef CONFIG_INTR_REMAP | ||
166 | struct irq_2_iommu *irq_2_iommu; | ||
167 | # endif | ||
168 | #endif | ||
157 | irq_flow_handler_t handle_irq; | 169 | irq_flow_handler_t handle_irq; |
158 | struct irq_chip *chip; | 170 | struct irq_chip *chip; |
159 | struct msi_desc *msi_desc; | 171 | struct msi_desc *msi_desc; |
@@ -165,8 +177,8 @@ struct irq_desc { | |||
165 | unsigned int depth; /* nested irq disables */ | 177 | unsigned int depth; /* nested irq disables */ |
166 | unsigned int wake_depth; /* nested wake enables */ | 178 | unsigned int wake_depth; /* nested wake enables */ |
167 | unsigned int irq_count; /* For detecting broken IRQs */ | 179 | unsigned int irq_count; /* For detecting broken IRQs */ |
168 | unsigned int irqs_unhandled; | ||
169 | unsigned long last_unhandled; /* Aging timer for unhandled count */ | 180 | unsigned long last_unhandled; /* Aging timer for unhandled count */ |
181 | unsigned int irqs_unhandled; | ||
170 | spinlock_t lock; | 182 | spinlock_t lock; |
171 | #ifdef CONFIG_SMP | 183 | #ifdef CONFIG_SMP |
172 | cpumask_t affinity; | 184 | cpumask_t affinity; |
@@ -181,12 +193,32 @@ struct irq_desc { | |||
181 | const char *name; | 193 | const char *name; |
182 | } ____cacheline_internodealigned_in_smp; | 194 | } ____cacheline_internodealigned_in_smp; |
183 | 195 | ||
196 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, | ||
197 | struct irq_desc *desc, int cpu); | ||
198 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); | ||
184 | 199 | ||
200 | #ifndef CONFIG_SPARSE_IRQ | ||
185 | extern struct irq_desc irq_desc[NR_IRQS]; | 201 | extern struct irq_desc irq_desc[NR_IRQS]; |
202 | #else /* CONFIG_SPARSE_IRQ */ | ||
203 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); | ||
204 | |||
205 | #define kstat_irqs_this_cpu(DESC) \ | ||
206 | ((DESC)->kstat_irqs[smp_processor_id()]) | ||
207 | #define kstat_incr_irqs_this_cpu(irqno, DESC) \ | ||
208 | ((DESC)->kstat_irqs[smp_processor_id()]++) | ||
186 | 209 | ||
187 | static inline struct irq_desc *irq_to_desc(unsigned int irq) | 210 | #endif /* CONFIG_SPARSE_IRQ */ |
211 | |||
212 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | ||
213 | |||
214 | static inline struct irq_desc * | ||
215 | irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) | ||
188 | { | 216 | { |
189 | return (irq < nr_irqs) ? irq_desc + irq : NULL; | 217 | #ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC |
218 | return irq_to_desc(irq); | ||
219 | #else | ||
220 | return desc; | ||
221 | #endif | ||
190 | } | 222 | } |
191 | 223 | ||
192 | /* | 224 | /* |
@@ -380,6 +412,11 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry); | |||
380 | #define get_irq_data(irq) (irq_to_desc(irq)->handler_data) | 412 | #define get_irq_data(irq) (irq_to_desc(irq)->handler_data) |
381 | #define get_irq_msi(irq) (irq_to_desc(irq)->msi_desc) | 413 | #define get_irq_msi(irq) (irq_to_desc(irq)->msi_desc) |
382 | 414 | ||
415 | #define get_irq_desc_chip(desc) ((desc)->chip) | ||
416 | #define get_irq_desc_chip_data(desc) ((desc)->chip_data) | ||
417 | #define get_irq_desc_data(desc) ((desc)->handler_data) | ||
418 | #define get_irq_desc_msi(desc) ((desc)->msi_desc) | ||
419 | |||
383 | #endif /* CONFIG_GENERIC_HARDIRQS */ | 420 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
384 | 421 | ||
385 | #endif /* !CONFIG_S390 */ | 422 | #endif /* !CONFIG_S390 */ |
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 452c280c8115..5504a5c97836 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
@@ -1,24 +1,41 @@ | |||
1 | #ifndef _LINUX_IRQNR_H | 1 | #ifndef _LINUX_IRQNR_H |
2 | #define _LINUX_IRQNR_H | 2 | #define _LINUX_IRQNR_H |
3 | 3 | ||
4 | /* | ||
5 | * Generic irq_desc iterators: | ||
6 | */ | ||
7 | #ifdef __KERNEL__ | ||
8 | |||
4 | #ifndef CONFIG_GENERIC_HARDIRQS | 9 | #ifndef CONFIG_GENERIC_HARDIRQS |
5 | #include <asm/irq.h> | 10 | #include <asm/irq.h> |
6 | # define nr_irqs NR_IRQS | 11 | # define nr_irqs NR_IRQS |
7 | 12 | ||
8 | # define for_each_irq_desc(irq, desc) \ | 13 | # define for_each_irq_desc(irq, desc) \ |
9 | for (irq = 0; irq < nr_irqs; irq++) | 14 | for (irq = 0; irq < nr_irqs; irq++) |
10 | #else | 15 | |
16 | # define for_each_irq_desc_reverse(irq, desc) \ | ||
17 | for (irq = nr_irqs - 1; irq >= 0; irq--) | ||
18 | #else /* CONFIG_GENERIC_HARDIRQS */ | ||
19 | |||
11 | extern int nr_irqs; | 20 | extern int nr_irqs; |
21 | extern struct irq_desc *irq_to_desc(unsigned int irq); | ||
22 | |||
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) | ||
12 | 27 | ||
13 | # define for_each_irq_desc(irq, desc) \ | ||
14 | for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) | ||
15 | 28 | ||
16 | # define for_each_irq_desc_reverse(irq, desc) \ | 29 | # define for_each_irq_desc_reverse(irq, desc) \ |
17 | for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ | 30 | for (irq = nr_irqs - 1, desc = irq_to_desc(irq); irq >= 0; \ |
18 | irq >= 0; irq--, desc--) | 31 | irq--, desc = irq_to_desc(irq)) \ |
19 | #endif | 32 | if (desc) |
20 | 33 | ||
21 | #define for_each_irq_nr(irq) \ | 34 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
22 | for (irq = 0; irq < nr_irqs; irq++) | 35 | |
36 | #define for_each_irq_nr(irq) \ | ||
37 | for (irq = 0; irq < nr_irqs; irq++) | ||
38 | |||
39 | #endif /* __KERNEL__ */ | ||
23 | 40 | ||
24 | #endif | 41 | #endif |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index abb6ac639e8e..1a9cf78bfce5 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -115,10 +115,20 @@ static inline u64 get_jiffies_64(void) | |||
115 | ((long)(a) - (long)(b) >= 0)) | 115 | ((long)(a) - (long)(b) >= 0)) |
116 | #define time_before_eq(a,b) time_after_eq(b,a) | 116 | #define time_before_eq(a,b) time_after_eq(b,a) |
117 | 117 | ||
118 | /* | ||
119 | * Calculate whether a is in the range of [b, c]. | ||
120 | */ | ||
118 | #define time_in_range(a,b,c) \ | 121 | #define time_in_range(a,b,c) \ |
119 | (time_after_eq(a,b) && \ | 122 | (time_after_eq(a,b) && \ |
120 | time_before_eq(a,c)) | 123 | time_before_eq(a,c)) |
121 | 124 | ||
125 | /* | ||
126 | * Calculate whether a is in the range of [b, c). | ||
127 | */ | ||
128 | #define time_in_range_open(a,b,c) \ | ||
129 | (time_after_eq(a,b) && \ | ||
130 | time_before(a,c)) | ||
131 | |||
122 | /* Same as above, but does so with platform independent 64bit types. | 132 | /* Same as above, but does so with platform independent 64bit types. |
123 | * These must be used when utilizing jiffies_64 (i.e. return value of | 133 | * These must be used when utilizing jiffies_64 (i.e. return value of |
124 | * get_jiffies_64() */ | 134 | * get_jiffies_64() */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index dc7e0d0a6474..ca9ff6411dfa 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -141,6 +141,15 @@ extern int _cond_resched(void); | |||
141 | (__x < 0) ? -__x : __x; \ | 141 | (__x < 0) ? -__x : __x; \ |
142 | }) | 142 | }) |
143 | 143 | ||
144 | #ifdef CONFIG_PROVE_LOCKING | ||
145 | void might_fault(void); | ||
146 | #else | ||
147 | static inline void might_fault(void) | ||
148 | { | ||
149 | might_sleep(); | ||
150 | } | ||
151 | #endif | ||
152 | |||
144 | extern struct atomic_notifier_head panic_notifier_list; | 153 | extern struct atomic_notifier_head panic_notifier_list; |
145 | extern long (*panic_blink)(long time); | 154 | extern long (*panic_blink)(long time); |
146 | NORET_TYPE void panic(const char * fmt, ...) | 155 | NORET_TYPE void panic(const char * fmt, ...) |
@@ -188,6 +197,8 @@ extern unsigned long long memparse(const char *ptr, char **retptr); | |||
188 | extern int core_kernel_text(unsigned long addr); | 197 | extern int core_kernel_text(unsigned long addr); |
189 | extern int __kernel_text_address(unsigned long addr); | 198 | extern int __kernel_text_address(unsigned long addr); |
190 | extern int kernel_text_address(unsigned long addr); | 199 | extern int kernel_text_address(unsigned long addr); |
200 | extern int func_ptr_is_kernel_text(void *ptr); | ||
201 | |||
191 | struct pid; | 202 | struct pid; |
192 | extern struct pid *session_of_pgrp(struct pid *pgrp); | 203 | extern struct pid *session_of_pgrp(struct pid *pgrp); |
193 | 204 | ||
@@ -361,18 +372,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
361 | ((unsigned char *)&addr)[3] | 372 | ((unsigned char *)&addr)[3] |
362 | #define NIPQUAD_FMT "%u.%u.%u.%u" | 373 | #define NIPQUAD_FMT "%u.%u.%u.%u" |
363 | 374 | ||
364 | #define NIP6(addr) \ | ||
365 | ntohs((addr).s6_addr16[0]), \ | ||
366 | ntohs((addr).s6_addr16[1]), \ | ||
367 | ntohs((addr).s6_addr16[2]), \ | ||
368 | ntohs((addr).s6_addr16[3]), \ | ||
369 | ntohs((addr).s6_addr16[4]), \ | ||
370 | ntohs((addr).s6_addr16[5]), \ | ||
371 | ntohs((addr).s6_addr16[6]), \ | ||
372 | ntohs((addr).s6_addr16[7]) | ||
373 | #define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x" | ||
374 | #define NIP6_SEQFMT "%04x%04x%04x%04x%04x%04x%04x%04x" | ||
375 | |||
376 | #if defined(__LITTLE_ENDIAN) | 375 | #if defined(__LITTLE_ENDIAN) |
377 | #define HIPQUAD(addr) \ | 376 | #define HIPQUAD(addr) \ |
378 | ((unsigned char *)&addr)[3], \ | 377 | ((unsigned char *)&addr)[3], \ |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 4a145caeee07..4ee4b3d2316f 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -28,7 +28,9 @@ struct cpu_usage_stat { | |||
28 | 28 | ||
29 | struct kernel_stat { | 29 | struct kernel_stat { |
30 | struct cpu_usage_stat cpustat; | 30 | struct cpu_usage_stat cpustat; |
31 | unsigned int irqs[NR_IRQS]; | 31 | #ifndef CONFIG_SPARSE_IRQ |
32 | unsigned int irqs[NR_IRQS]; | ||
33 | #endif | ||
32 | }; | 34 | }; |
33 | 35 | ||
34 | DECLARE_PER_CPU(struct kernel_stat, kstat); | 36 | DECLARE_PER_CPU(struct kernel_stat, kstat); |
@@ -39,6 +41,10 @@ DECLARE_PER_CPU(struct kernel_stat, kstat); | |||
39 | 41 | ||
40 | extern unsigned long long nr_context_switches(void); | 42 | extern unsigned long long nr_context_switches(void); |
41 | 43 | ||
44 | #ifndef CONFIG_SPARSE_IRQ | ||
45 | #define kstat_irqs_this_cpu(irq) \ | ||
46 | (kstat_this_cpu.irqs[irq]) | ||
47 | |||
42 | struct irq_desc; | 48 | struct irq_desc; |
43 | 49 | ||
44 | static inline void kstat_incr_irqs_this_cpu(unsigned int irq, | 50 | static inline void kstat_incr_irqs_this_cpu(unsigned int irq, |
@@ -46,11 +52,17 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq, | |||
46 | { | 52 | { |
47 | kstat_this_cpu.irqs[irq]++; | 53 | kstat_this_cpu.irqs[irq]++; |
48 | } | 54 | } |
55 | #endif | ||
56 | |||
49 | 57 | ||
58 | #ifndef CONFIG_SPARSE_IRQ | ||
50 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 59 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) |
51 | { | 60 | { |
52 | return kstat_cpu(cpu).irqs[irq]; | 61 | return kstat_cpu(cpu).irqs[irq]; |
53 | } | 62 | } |
63 | #else | ||
64 | extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | ||
65 | #endif | ||
54 | 66 | ||
55 | /* | 67 | /* |
56 | * Number of interrupts per specific IRQ source, since bootup | 68 | * Number of interrupts per specific IRQ source, since bootup |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 17f76fc05173..adc34f2c6eff 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -100,6 +100,10 @@ struct kimage { | |||
100 | #define KEXEC_TYPE_DEFAULT 0 | 100 | #define KEXEC_TYPE_DEFAULT 0 |
101 | #define KEXEC_TYPE_CRASH 1 | 101 | #define KEXEC_TYPE_CRASH 1 |
102 | unsigned int preserve_context : 1; | 102 | unsigned int preserve_context : 1; |
103 | |||
104 | #ifdef ARCH_HAS_KIMAGE_ARCH | ||
105 | struct kimage_arch arch; | ||
106 | #endif | ||
103 | }; | 107 | }; |
104 | 108 | ||
105 | 109 | ||
diff --git a/include/linux/key-ui.h b/include/linux/key-ui.h deleted file mode 100644 index e8b8a7a5c496..000000000000 --- a/include/linux/key-ui.h +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* key-ui.h: key userspace interface stuff | ||
2 | * | ||
3 | * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_KEY_UI_H | ||
13 | #define _LINUX_KEY_UI_H | ||
14 | |||
15 | #include <linux/key.h> | ||
16 | |||
17 | /* the key tree */ | ||
18 | extern struct rb_root key_serial_tree; | ||
19 | extern spinlock_t key_serial_lock; | ||
20 | |||
21 | /* required permissions */ | ||
22 | #define KEY_VIEW 0x01 /* require permission to view attributes */ | ||
23 | #define KEY_READ 0x02 /* require permission to read content */ | ||
24 | #define KEY_WRITE 0x04 /* require permission to update / modify */ | ||
25 | #define KEY_SEARCH 0x08 /* require permission to search (keyring) or find (key) */ | ||
26 | #define KEY_LINK 0x10 /* require permission to link */ | ||
27 | #define KEY_SETATTR 0x20 /* require permission to change attributes */ | ||
28 | #define KEY_ALL 0x3f /* all the above permissions */ | ||
29 | |||
30 | /* | ||
31 | * the keyring payload contains a list of the keys to which the keyring is | ||
32 | * subscribed | ||
33 | */ | ||
34 | struct keyring_list { | ||
35 | struct rcu_head rcu; /* RCU deletion hook */ | ||
36 | unsigned short maxkeys; /* max keys this list can hold */ | ||
37 | unsigned short nkeys; /* number of keys currently held */ | ||
38 | unsigned short delkey; /* key to be unlinked by RCU */ | ||
39 | struct key *keys[0]; | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * check to see whether permission is granted to use a key in the desired way | ||
44 | */ | ||
45 | extern int key_task_permission(const key_ref_t key_ref, | ||
46 | struct task_struct *context, | ||
47 | key_perm_t perm); | ||
48 | |||
49 | static inline int key_permission(const key_ref_t key_ref, key_perm_t perm) | ||
50 | { | ||
51 | return key_task_permission(key_ref, current, perm); | ||
52 | } | ||
53 | |||
54 | extern key_ref_t lookup_user_key(struct task_struct *context, | ||
55 | key_serial_t id, int create, int partial, | ||
56 | key_perm_t perm); | ||
57 | |||
58 | extern long join_session_keyring(const char *name); | ||
59 | |||
60 | extern struct key_type *key_type_lookup(const char *type); | ||
61 | extern void key_type_put(struct key_type *ktype); | ||
62 | |||
63 | #define key_negative_timeout 60 /* default timeout on a negative key's existence */ | ||
64 | |||
65 | |||
66 | #endif /* _LINUX_KEY_UI_H */ | ||
diff --git a/include/linux/key.h b/include/linux/key.h index 1b70e35a71e3..21d32a142c00 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -73,6 +73,7 @@ struct key; | |||
73 | struct seq_file; | 73 | struct seq_file; |
74 | struct user_struct; | 74 | struct user_struct; |
75 | struct signal_struct; | 75 | struct signal_struct; |
76 | struct cred; | ||
76 | 77 | ||
77 | struct key_type; | 78 | struct key_type; |
78 | struct key_owner; | 79 | struct key_owner; |
@@ -181,7 +182,7 @@ struct key { | |||
181 | extern struct key *key_alloc(struct key_type *type, | 182 | extern struct key *key_alloc(struct key_type *type, |
182 | const char *desc, | 183 | const char *desc, |
183 | uid_t uid, gid_t gid, | 184 | uid_t uid, gid_t gid, |
184 | struct task_struct *ctx, | 185 | const struct cred *cred, |
185 | key_perm_t perm, | 186 | key_perm_t perm, |
186 | unsigned long flags); | 187 | unsigned long flags); |
187 | 188 | ||
@@ -249,7 +250,7 @@ extern int key_unlink(struct key *keyring, | |||
249 | struct key *key); | 250 | struct key *key); |
250 | 251 | ||
251 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, | 252 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, |
252 | struct task_struct *ctx, | 253 | const struct cred *cred, |
253 | unsigned long flags, | 254 | unsigned long flags, |
254 | struct key *dest); | 255 | struct key *dest); |
255 | 256 | ||
@@ -276,24 +277,11 @@ extern ctl_table key_sysctls[]; | |||
276 | /* | 277 | /* |
277 | * the userspace interface | 278 | * the userspace interface |
278 | */ | 279 | */ |
279 | extern void switch_uid_keyring(struct user_struct *new_user); | 280 | extern int install_thread_keyring_to_cred(struct cred *cred); |
280 | extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); | ||
281 | extern int copy_thread_group_keys(struct task_struct *tsk); | ||
282 | extern void exit_keys(struct task_struct *tsk); | ||
283 | extern void exit_thread_group_keys(struct signal_struct *tg); | ||
284 | extern int suid_keys(struct task_struct *tsk); | ||
285 | extern int exec_keys(struct task_struct *tsk); | ||
286 | extern void key_fsuid_changed(struct task_struct *tsk); | 281 | extern void key_fsuid_changed(struct task_struct *tsk); |
287 | extern void key_fsgid_changed(struct task_struct *tsk); | 282 | extern void key_fsgid_changed(struct task_struct *tsk); |
288 | extern void key_init(void); | 283 | extern void key_init(void); |
289 | 284 | ||
290 | #define __install_session_keyring(tsk, keyring) \ | ||
291 | ({ \ | ||
292 | struct key *old_session = tsk->signal->session_keyring; \ | ||
293 | tsk->signal->session_keyring = keyring; \ | ||
294 | old_session; \ | ||
295 | }) | ||
296 | |||
297 | #else /* CONFIG_KEYS */ | 285 | #else /* CONFIG_KEYS */ |
298 | 286 | ||
299 | #define key_validate(k) 0 | 287 | #define key_validate(k) 0 |
@@ -302,17 +290,9 @@ extern void key_init(void); | |||
302 | #define key_revoke(k) do { } while(0) | 290 | #define key_revoke(k) do { } while(0) |
303 | #define key_put(k) do { } while(0) | 291 | #define key_put(k) do { } while(0) |
304 | #define key_ref_put(k) do { } while(0) | 292 | #define key_ref_put(k) do { } while(0) |
305 | #define make_key_ref(k, p) ({ NULL; }) | 293 | #define make_key_ref(k, p) NULL |
306 | #define key_ref_to_ptr(k) ({ NULL; }) | 294 | #define key_ref_to_ptr(k) NULL |
307 | #define is_key_possessed(k) 0 | 295 | #define is_key_possessed(k) 0 |
308 | #define switch_uid_keyring(u) do { } while(0) | ||
309 | #define __install_session_keyring(t, k) ({ NULL; }) | ||
310 | #define copy_keys(f,t) 0 | ||
311 | #define copy_thread_group_keys(t) 0 | ||
312 | #define exit_keys(t) do { } while(0) | ||
313 | #define exit_thread_group_keys(tg) do { } while(0) | ||
314 | #define suid_keys(t) do { } while(0) | ||
315 | #define exec_keys(t) do { } while(0) | ||
316 | #define key_fsuid_changed(t) do { } while(0) | 296 | #define key_fsuid_changed(t) do { } while(0) |
317 | #define key_fsgid_changed(t) do { } while(0) | 297 | #define key_fsgid_changed(t) do { } while(0) |
318 | #define key_init() do { } while(0) | 298 | #define key_init() do { } while(0) |
diff --git a/include/linux/keyctl.h b/include/linux/keyctl.h index 656ee6b77a4a..c0688eb72093 100644 --- a/include/linux/keyctl.h +++ b/include/linux/keyctl.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* keyctl.h: keyctl command IDs | 1 | /* keyctl.h: keyctl command IDs |
2 | * | 2 | * |
3 | * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. | 3 | * Copyright (C) 2004, 2008 Red Hat, Inc. All Rights Reserved. |
4 | * Written by David Howells (dhowells@redhat.com) | 4 | * Written by David Howells (dhowells@redhat.com) |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
@@ -20,6 +20,7 @@ | |||
20 | #define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */ | 20 | #define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */ |
21 | #define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */ | 21 | #define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */ |
22 | #define KEY_SPEC_REQKEY_AUTH_KEY -7 /* - key ID for assumed request_key auth key */ | 22 | #define KEY_SPEC_REQKEY_AUTH_KEY -7 /* - key ID for assumed request_key auth key */ |
23 | #define KEY_SPEC_REQUESTOR_KEYRING -8 /* - key ID for request_key() dest keyring */ | ||
23 | 24 | ||
24 | /* request-key default keyrings */ | 25 | /* request-key default keyrings */ |
25 | #define KEY_REQKEY_DEFL_NO_CHANGE -1 | 26 | #define KEY_REQKEY_DEFL_NO_CHANGE -1 |
@@ -30,6 +31,7 @@ | |||
30 | #define KEY_REQKEY_DEFL_USER_KEYRING 4 | 31 | #define KEY_REQKEY_DEFL_USER_KEYRING 4 |
31 | #define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5 | 32 | #define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5 |
32 | #define KEY_REQKEY_DEFL_GROUP_KEYRING 6 | 33 | #define KEY_REQKEY_DEFL_GROUP_KEYRING 6 |
34 | #define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7 | ||
33 | 35 | ||
34 | /* keyctl commands */ | 36 | /* keyctl commands */ |
35 | #define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */ | 37 | #define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */ |
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h index e7217dc58f39..a53407a4165c 100644 --- a/include/linux/lguest_launcher.h +++ b/include/linux/lguest_launcher.h | |||
@@ -54,9 +54,13 @@ struct lguest_vqconfig { | |||
54 | /* Write command first word is a request. */ | 54 | /* Write command first word is a request. */ |
55 | enum lguest_req | 55 | enum lguest_req |
56 | { | 56 | { |
57 | LHREQ_INITIALIZE, /* + base, pfnlimit, pgdir, start */ | 57 | LHREQ_INITIALIZE, /* + base, pfnlimit, start */ |
58 | LHREQ_GETDMA, /* No longer used */ | 58 | LHREQ_GETDMA, /* No longer used */ |
59 | LHREQ_IRQ, /* + irq */ | 59 | LHREQ_IRQ, /* + irq */ |
60 | LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */ | 60 | LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */ |
61 | }; | 61 | }; |
62 | |||
63 | /* The alignment to use between consumer and producer parts of vring. | ||
64 | * x86 pagesize for historical reasons. */ | ||
65 | #define LGUEST_VRING_ALIGN 4096 | ||
62 | #endif /* _LINUX_LGUEST_LAUNCHER */ | 66 | #endif /* _LINUX_LGUEST_LAUNCHER */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index ed3f26eb5df1..3449de597eff 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -213,10 +213,11 @@ enum { | |||
213 | ATA_PFLAG_FROZEN = (1 << 2), /* port is frozen */ | 213 | ATA_PFLAG_FROZEN = (1 << 2), /* port is frozen */ |
214 | ATA_PFLAG_RECOVERED = (1 << 3), /* recovery action performed */ | 214 | ATA_PFLAG_RECOVERED = (1 << 3), /* recovery action performed */ |
215 | ATA_PFLAG_LOADING = (1 << 4), /* boot/loading probe */ | 215 | ATA_PFLAG_LOADING = (1 << 4), /* boot/loading probe */ |
216 | ATA_PFLAG_UNLOADING = (1 << 5), /* module is unloading */ | ||
217 | ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ | 216 | ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ |
218 | ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */ | 217 | ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */ |
219 | ATA_PFLAG_RESETTING = (1 << 8), /* reset in progress */ | 218 | ATA_PFLAG_RESETTING = (1 << 8), /* reset in progress */ |
219 | ATA_PFLAG_UNLOADING = (1 << 9), /* driver is being unloaded */ | ||
220 | ATA_PFLAG_UNLOADED = (1 << 10), /* driver is unloaded */ | ||
220 | 221 | ||
221 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ | 222 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ |
222 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ | 223 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ |
@@ -1285,26 +1286,62 @@ static inline int ata_link_active(struct ata_link *link) | |||
1285 | return ata_tag_valid(link->active_tag) || link->sactive; | 1286 | return ata_tag_valid(link->active_tag) || link->sactive; |
1286 | } | 1287 | } |
1287 | 1288 | ||
1288 | extern struct ata_link *__ata_port_next_link(struct ata_port *ap, | 1289 | /* |
1289 | struct ata_link *link, | 1290 | * Iterators |
1290 | bool dev_only); | 1291 | * |
1292 | * ATA_LITER_* constants are used to select link iteration mode and | ||
1293 | * ATA_DITER_* device iteration mode. | ||
1294 | * | ||
1295 | * For a custom iteration directly using ata_{link|dev}_next(), if | ||
1296 | * @link or @dev, respectively, is NULL, the first element is | ||
1297 | * returned. @dev and @link can be any valid device or link and the | ||
1298 | * next element according to the iteration mode will be returned. | ||
1299 | * After the last element, NULL is returned. | ||
1300 | */ | ||
1301 | enum ata_link_iter_mode { | ||
1302 | ATA_LITER_EDGE, /* if present, PMP links only; otherwise, | ||
1303 | * host link. no slave link */ | ||
1304 | ATA_LITER_HOST_FIRST, /* host link followed by PMP or slave links */ | ||
1305 | ATA_LITER_PMP_FIRST, /* PMP links followed by host link, | ||
1306 | * slave link still comes after host link */ | ||
1307 | }; | ||
1291 | 1308 | ||
1292 | #define __ata_port_for_each_link(link, ap) \ | 1309 | enum ata_dev_iter_mode { |
1293 | for ((link) = __ata_port_next_link((ap), NULL, false); (link); \ | 1310 | ATA_DITER_ENABLED, |
1294 | (link) = __ata_port_next_link((ap), (link), false)) | 1311 | ATA_DITER_ENABLED_REVERSE, |
1312 | ATA_DITER_ALL, | ||
1313 | ATA_DITER_ALL_REVERSE, | ||
1314 | }; | ||
1295 | 1315 | ||
1296 | #define ata_port_for_each_link(link, ap) \ | 1316 | extern struct ata_link *ata_link_next(struct ata_link *link, |
1297 | for ((link) = __ata_port_next_link((ap), NULL, true); (link); \ | 1317 | struct ata_port *ap, |
1298 | (link) = __ata_port_next_link((ap), (link), true)) | 1318 | enum ata_link_iter_mode mode); |
1299 | 1319 | ||
1300 | #define ata_link_for_each_dev(dev, link) \ | 1320 | extern struct ata_device *ata_dev_next(struct ata_device *dev, |
1301 | for ((dev) = (link)->device; \ | 1321 | struct ata_link *link, |
1302 | (dev) < (link)->device + ata_link_max_devices(link) || ((dev) = NULL); \ | 1322 | enum ata_dev_iter_mode mode); |
1303 | (dev)++) | 1323 | |
1324 | /* | ||
1325 | * Shortcut notation for iterations | ||
1326 | * | ||
1327 | * ata_for_each_link() iterates over each link of @ap according to | ||
1328 | * @mode. @link points to the current link in the loop. @link is | ||
1329 | * NULL after loop termination. ata_for_each_dev() works the same way | ||
1330 | * except that it iterates over each device of @link. | ||
1331 | * | ||
1332 | * Note that the mode prefixes ATA_{L|D}ITER_ shouldn't need to be | ||
1333 | * specified when using the following shorthand notations. Only the | ||
1334 | * mode itself (EDGE, HOST_FIRST, ENABLED, etc...) should be | ||
1335 | * specified. This not only increases brevity but also makes it | ||
1336 | * impossible to use ATA_LITER_* for device iteration or vice-versa. | ||
1337 | */ | ||
1338 | #define ata_for_each_link(link, ap, mode) \ | ||
1339 | for ((link) = ata_link_next(NULL, (ap), ATA_LITER_##mode); (link); \ | ||
1340 | (link) = ata_link_next((link), (ap), ATA_LITER_##mode)) | ||
1304 | 1341 | ||
1305 | #define ata_link_for_each_dev_reverse(dev, link) \ | 1342 | #define ata_for_each_dev(dev, link, mode) \ |
1306 | for ((dev) = (link)->device + ata_link_max_devices(link) - 1; \ | 1343 | for ((dev) = ata_dev_next(NULL, (link), ATA_DITER_##mode); (dev); \ |
1307 | (dev) >= (link)->device || ((dev) = NULL); (dev)--) | 1344 | (dev) = ata_dev_next((dev), (link), ATA_DITER_##mode)) |
1308 | 1345 | ||
1309 | /** | 1346 | /** |
1310 | * ata_ncq_enabled - Test whether NCQ is enabled | 1347 | * ata_ncq_enabled - Test whether NCQ is enabled |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 9fd1f859021b..fee9e59649c1 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -64,14 +64,6 @@ | |||
64 | name: | 64 | name: |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #define KPROBE_ENTRY(name) \ | ||
68 | .pushsection .kprobes.text, "ax"; \ | ||
69 | ENTRY(name) | ||
70 | |||
71 | #define KPROBE_END(name) \ | ||
72 | END(name); \ | ||
73 | .popsection | ||
74 | |||
75 | #ifndef END | 67 | #ifndef END |
76 | #define END(name) \ | 68 | #define END(name) \ |
77 | .size name, .-name | 69 | .size name, .-name |
diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h new file mode 100644 index 000000000000..93150ecf3ea4 --- /dev/null +++ b/include/linux/list_nulls.h | |||
@@ -0,0 +1,94 @@ | |||
1 | #ifndef _LINUX_LIST_NULLS_H | ||
2 | #define _LINUX_LIST_NULLS_H | ||
3 | |||
4 | /* | ||
5 | * Special version of lists, where end of list is not a NULL pointer, | ||
6 | * but a 'nulls' marker, which can have many different values. | ||
7 | * (up to 2^31 different values guaranteed on all platforms) | ||
8 | * | ||
9 | * In the standard hlist, termination of a list is the NULL pointer. | ||
10 | * In this special 'nulls' variant, we use the fact that objects stored in | ||
11 | * a list are aligned on a word (4 or 8 bytes alignment). | ||
12 | * We therefore use the last significant bit of 'ptr' : | ||
13 | * Set to 1 : This is a 'nulls' end-of-list marker (ptr >> 1) | ||
14 | * Set to 0 : This is a pointer to some object (ptr) | ||
15 | */ | ||
16 | |||
17 | struct hlist_nulls_head { | ||
18 | struct hlist_nulls_node *first; | ||
19 | }; | ||
20 | |||
21 | struct hlist_nulls_node { | ||
22 | struct hlist_nulls_node *next, **pprev; | ||
23 | }; | ||
24 | #define INIT_HLIST_NULLS_HEAD(ptr, nulls) \ | ||
25 | ((ptr)->first = (struct hlist_nulls_node *) (1UL | (((long)nulls) << 1))) | ||
26 | |||
27 | #define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) | ||
28 | /** | ||
29 | * ptr_is_a_nulls - Test if a ptr is a nulls | ||
30 | * @ptr: ptr to be tested | ||
31 | * | ||
32 | */ | ||
33 | static inline int is_a_nulls(const struct hlist_nulls_node *ptr) | ||
34 | { | ||
35 | return ((unsigned long)ptr & 1); | ||
36 | } | ||
37 | |||
38 | /** | ||
39 | * get_nulls_value - Get the 'nulls' value of the end of chain | ||
40 | * @ptr: end of chain | ||
41 | * | ||
42 | * Should be called only if is_a_nulls(ptr); | ||
43 | */ | ||
44 | static inline unsigned long get_nulls_value(const struct hlist_nulls_node *ptr) | ||
45 | { | ||
46 | return ((unsigned long)ptr) >> 1; | ||
47 | } | ||
48 | |||
49 | static inline int hlist_nulls_unhashed(const struct hlist_nulls_node *h) | ||
50 | { | ||
51 | return !h->pprev; | ||
52 | } | ||
53 | |||
54 | static inline int hlist_nulls_empty(const struct hlist_nulls_head *h) | ||
55 | { | ||
56 | return is_a_nulls(h->first); | ||
57 | } | ||
58 | |||
59 | static inline void __hlist_nulls_del(struct hlist_nulls_node *n) | ||
60 | { | ||
61 | struct hlist_nulls_node *next = n->next; | ||
62 | struct hlist_nulls_node **pprev = n->pprev; | ||
63 | *pprev = next; | ||
64 | if (!is_a_nulls(next)) | ||
65 | next->pprev = pprev; | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * hlist_nulls_for_each_entry - iterate over list of given type | ||
70 | * @tpos: the type * to use as a loop cursor. | ||
71 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
72 | * @head: the head for your list. | ||
73 | * @member: the name of the hlist_node within the struct. | ||
74 | * | ||
75 | */ | ||
76 | #define hlist_nulls_for_each_entry(tpos, pos, head, member) \ | ||
77 | for (pos = (head)->first; \ | ||
78 | (!is_a_nulls(pos)) && \ | ||
79 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1;}); \ | ||
80 | pos = pos->next) | ||
81 | |||
82 | /** | ||
83 | * hlist_nulls_for_each_entry_from - iterate over a hlist continuing from current point | ||
84 | * @tpos: the type * to use as a loop cursor. | ||
85 | * @pos: the &struct hlist_node to use as a loop cursor. | ||
86 | * @member: the name of the hlist_node within the struct. | ||
87 | * | ||
88 | */ | ||
89 | #define hlist_nulls_for_each_entry_from(tpos, pos, member) \ | ||
90 | for (; (!is_a_nulls(pos)) && \ | ||
91 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1;}); \ | ||
92 | pos = pos->next) | ||
93 | |||
94 | #endif | ||
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index e5872dc994c0..fbc48f898521 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h | |||
@@ -41,6 +41,7 @@ struct nlmclnt_initdata { | |||
41 | size_t addrlen; | 41 | size_t addrlen; |
42 | unsigned short protocol; | 42 | unsigned short protocol; |
43 | u32 nfs_version; | 43 | u32 nfs_version; |
44 | int noresvport; | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | /* | 47 | /* |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index b56d5aa9b194..23da3fa69efa 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -49,6 +49,7 @@ struct nlm_host { | |||
49 | unsigned short h_proto; /* transport proto */ | 49 | unsigned short h_proto; /* transport proto */ |
50 | unsigned short h_reclaiming : 1, | 50 | unsigned short h_reclaiming : 1, |
51 | h_server : 1, /* server side, not client side */ | 51 | h_server : 1, /* server side, not client side */ |
52 | h_noresvport : 1, | ||
52 | h_inuse : 1; | 53 | h_inuse : 1; |
53 | wait_queue_head_t h_gracewait; /* wait while reclaiming */ | 54 | wait_queue_head_t h_gracewait; /* wait while reclaiming */ |
54 | struct rw_semaphore h_rwsem; /* Reboot recovery lock */ | 55 | struct rw_semaphore h_rwsem; /* Reboot recovery lock */ |
@@ -220,7 +221,8 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, | |||
220 | const size_t salen, | 221 | const size_t salen, |
221 | const unsigned short protocol, | 222 | const unsigned short protocol, |
222 | const u32 version, | 223 | const u32 version, |
223 | const char *hostname); | 224 | const char *hostname, |
225 | int noresvport); | ||
224 | struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp, | 226 | struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp, |
225 | const char *hostname, | 227 | const char *hostname, |
226 | const size_t hostname_len); | 228 | const size_t hostname_len); |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 29aec6e10020..23bf02fb124f 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -73,6 +73,8 @@ struct lock_class_key { | |||
73 | struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES]; | 73 | struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES]; |
74 | }; | 74 | }; |
75 | 75 | ||
76 | #define LOCKSTAT_POINTS 4 | ||
77 | |||
76 | /* | 78 | /* |
77 | * The lock-class itself: | 79 | * The lock-class itself: |
78 | */ | 80 | */ |
@@ -119,7 +121,8 @@ struct lock_class { | |||
119 | int name_version; | 121 | int name_version; |
120 | 122 | ||
121 | #ifdef CONFIG_LOCK_STAT | 123 | #ifdef CONFIG_LOCK_STAT |
122 | unsigned long contention_point[4]; | 124 | unsigned long contention_point[LOCKSTAT_POINTS]; |
125 | unsigned long contending_point[LOCKSTAT_POINTS]; | ||
123 | #endif | 126 | #endif |
124 | }; | 127 | }; |
125 | 128 | ||
@@ -144,6 +147,7 @@ enum bounce_type { | |||
144 | 147 | ||
145 | struct lock_class_stats { | 148 | struct lock_class_stats { |
146 | unsigned long contention_point[4]; | 149 | unsigned long contention_point[4]; |
150 | unsigned long contending_point[4]; | ||
147 | struct lock_time read_waittime; | 151 | struct lock_time read_waittime; |
148 | struct lock_time write_waittime; | 152 | struct lock_time write_waittime; |
149 | struct lock_time read_holdtime; | 153 | struct lock_time read_holdtime; |
@@ -165,6 +169,7 @@ struct lockdep_map { | |||
165 | const char *name; | 169 | const char *name; |
166 | #ifdef CONFIG_LOCK_STAT | 170 | #ifdef CONFIG_LOCK_STAT |
167 | int cpu; | 171 | int cpu; |
172 | unsigned long ip; | ||
168 | #endif | 173 | #endif |
169 | }; | 174 | }; |
170 | 175 | ||
@@ -309,8 +314,15 @@ extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
309 | extern void lock_release(struct lockdep_map *lock, int nested, | 314 | extern void lock_release(struct lockdep_map *lock, int nested, |
310 | unsigned long ip); | 315 | unsigned long ip); |
311 | 316 | ||
312 | extern void lock_set_subclass(struct lockdep_map *lock, unsigned int subclass, | 317 | extern void lock_set_class(struct lockdep_map *lock, const char *name, |
313 | unsigned long ip); | 318 | struct lock_class_key *key, unsigned int subclass, |
319 | unsigned long ip); | ||
320 | |||
321 | static inline void lock_set_subclass(struct lockdep_map *lock, | ||
322 | unsigned int subclass, unsigned long ip) | ||
323 | { | ||
324 | lock_set_class(lock, lock->name, lock->key, subclass, ip); | ||
325 | } | ||
314 | 326 | ||
315 | # define INIT_LOCKDEP .lockdep_recursion = 0, | 327 | # define INIT_LOCKDEP .lockdep_recursion = 0, |
316 | 328 | ||
@@ -328,6 +340,7 @@ static inline void lockdep_on(void) | |||
328 | 340 | ||
329 | # define lock_acquire(l, s, t, r, c, n, i) do { } while (0) | 341 | # define lock_acquire(l, s, t, r, c, n, i) do { } while (0) |
330 | # define lock_release(l, n, i) do { } while (0) | 342 | # define lock_release(l, n, i) do { } while (0) |
343 | # define lock_set_class(l, n, k, s, i) do { } while (0) | ||
331 | # define lock_set_subclass(l, s, i) do { } while (0) | 344 | # define lock_set_subclass(l, s, i) do { } while (0) |
332 | # define lockdep_init() do { } while (0) | 345 | # define lockdep_init() do { } while (0) |
333 | # define lockdep_info() do { } while (0) | 346 | # define lockdep_info() do { } while (0) |
@@ -356,7 +369,7 @@ struct lock_class_key { }; | |||
356 | #ifdef CONFIG_LOCK_STAT | 369 | #ifdef CONFIG_LOCK_STAT |
357 | 370 | ||
358 | extern void lock_contended(struct lockdep_map *lock, unsigned long ip); | 371 | extern void lock_contended(struct lockdep_map *lock, unsigned long ip); |
359 | extern void lock_acquired(struct lockdep_map *lock); | 372 | extern void lock_acquired(struct lockdep_map *lock, unsigned long ip); |
360 | 373 | ||
361 | #define LOCK_CONTENDED(_lock, try, lock) \ | 374 | #define LOCK_CONTENDED(_lock, try, lock) \ |
362 | do { \ | 375 | do { \ |
@@ -364,20 +377,20 @@ do { \ | |||
364 | lock_contended(&(_lock)->dep_map, _RET_IP_); \ | 377 | lock_contended(&(_lock)->dep_map, _RET_IP_); \ |
365 | lock(_lock); \ | 378 | lock(_lock); \ |
366 | } \ | 379 | } \ |
367 | lock_acquired(&(_lock)->dep_map); \ | 380 | lock_acquired(&(_lock)->dep_map, _RET_IP_); \ |
368 | } while (0) | 381 | } while (0) |
369 | 382 | ||
370 | #else /* CONFIG_LOCK_STAT */ | 383 | #else /* CONFIG_LOCK_STAT */ |
371 | 384 | ||
372 | #define lock_contended(lockdep_map, ip) do {} while (0) | 385 | #define lock_contended(lockdep_map, ip) do {} while (0) |
373 | #define lock_acquired(lockdep_map) do {} while (0) | 386 | #define lock_acquired(lockdep_map, ip) do {} while (0) |
374 | 387 | ||
375 | #define LOCK_CONTENDED(_lock, try, lock) \ | 388 | #define LOCK_CONTENDED(_lock, try, lock) \ |
376 | lock(_lock) | 389 | lock(_lock) |
377 | 390 | ||
378 | #endif /* CONFIG_LOCK_STAT */ | 391 | #endif /* CONFIG_LOCK_STAT */ |
379 | 392 | ||
380 | #if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS) | 393 | #ifdef CONFIG_GENERIC_HARDIRQS |
381 | extern void early_init_irq_lock_class(void); | 394 | extern void early_init_irq_lock_class(void); |
382 | #else | 395 | #else |
383 | static inline void early_init_irq_lock_class(void) | 396 | static inline void early_init_irq_lock_class(void) |
@@ -481,4 +494,22 @@ static inline void print_irqtrace_events(struct task_struct *curr) | |||
481 | # define lock_map_release(l) do { } while (0) | 494 | # define lock_map_release(l) do { } while (0) |
482 | #endif | 495 | #endif |
483 | 496 | ||
497 | #ifdef CONFIG_PROVE_LOCKING | ||
498 | # define might_lock(lock) \ | ||
499 | do { \ | ||
500 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ | ||
501 | lock_acquire(&(lock)->dep_map, 0, 0, 0, 2, NULL, _THIS_IP_); \ | ||
502 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ | ||
503 | } while (0) | ||
504 | # define might_lock_read(lock) \ | ||
505 | do { \ | ||
506 | typecheck(struct lockdep_map *, &(lock)->dep_map); \ | ||
507 | lock_acquire(&(lock)->dep_map, 0, 0, 1, 2, NULL, _THIS_IP_); \ | ||
508 | lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ | ||
509 | } while (0) | ||
510 | #else | ||
511 | # define might_lock(lock) do { } while (0) | ||
512 | # define might_lock_read(lock) do { } while (0) | ||
513 | #endif | ||
514 | |||
484 | #endif /* __LINUX_LOCKDEP_H */ | 515 | #endif /* __LINUX_LOCKDEP_H */ |
diff --git a/include/linux/marker.h b/include/linux/marker.h index 889196c7fbb1..b85e74ca782f 100644 --- a/include/linux/marker.h +++ b/include/linux/marker.h | |||
@@ -12,6 +12,7 @@ | |||
12 | * See the file COPYING for more details. | 12 | * See the file COPYING for more details. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <stdarg.h> | ||
15 | #include <linux/types.h> | 16 | #include <linux/types.h> |
16 | 17 | ||
17 | struct module; | 18 | struct module; |
@@ -48,10 +49,28 @@ struct marker { | |||
48 | void (*call)(const struct marker *mdata, void *call_private, ...); | 49 | void (*call)(const struct marker *mdata, void *call_private, ...); |
49 | struct marker_probe_closure single; | 50 | struct marker_probe_closure single; |
50 | struct marker_probe_closure *multi; | 51 | struct marker_probe_closure *multi; |
52 | const char *tp_name; /* Optional tracepoint name */ | ||
53 | void *tp_cb; /* Optional tracepoint callback */ | ||
51 | } __attribute__((aligned(8))); | 54 | } __attribute__((aligned(8))); |
52 | 55 | ||
53 | #ifdef CONFIG_MARKERS | 56 | #ifdef CONFIG_MARKERS |
54 | 57 | ||
58 | #define _DEFINE_MARKER(name, tp_name_str, tp_cb, format) \ | ||
59 | static const char __mstrtab_##name[] \ | ||
60 | __attribute__((section("__markers_strings"))) \ | ||
61 | = #name "\0" format; \ | ||
62 | static struct marker __mark_##name \ | ||
63 | __attribute__((section("__markers"), aligned(8))) = \ | ||
64 | { __mstrtab_##name, &__mstrtab_##name[sizeof(#name)], \ | ||
65 | 0, 0, marker_probe_cb, { __mark_empty_function, NULL},\ | ||
66 | NULL, tp_name_str, tp_cb } | ||
67 | |||
68 | #define DEFINE_MARKER(name, format) \ | ||
69 | _DEFINE_MARKER(name, NULL, NULL, format) | ||
70 | |||
71 | #define DEFINE_MARKER_TP(name, tp_name, tp_cb, format) \ | ||
72 | _DEFINE_MARKER(name, #tp_name, tp_cb, format) | ||
73 | |||
55 | /* | 74 | /* |
56 | * Note : the empty asm volatile with read constraint is used here instead of a | 75 | * Note : the empty asm volatile with read constraint is used here instead of a |
57 | * "used" attribute to fix a gcc 4.1.x bug. | 76 | * "used" attribute to fix a gcc 4.1.x bug. |
@@ -65,14 +84,7 @@ struct marker { | |||
65 | */ | 84 | */ |
66 | #define __trace_mark(generic, name, call_private, format, args...) \ | 85 | #define __trace_mark(generic, name, call_private, format, args...) \ |
67 | do { \ | 86 | do { \ |
68 | static const char __mstrtab_##name[] \ | 87 | DEFINE_MARKER(name, format); \ |
69 | __attribute__((section("__markers_strings"))) \ | ||
70 | = #name "\0" format; \ | ||
71 | static struct marker __mark_##name \ | ||
72 | __attribute__((section("__markers"), aligned(8))) = \ | ||
73 | { __mstrtab_##name, &__mstrtab_##name[sizeof(#name)], \ | ||
74 | 0, 0, marker_probe_cb, \ | ||
75 | { __mark_empty_function, NULL}, NULL }; \ | ||
76 | __mark_check_format(format, ## args); \ | 88 | __mark_check_format(format, ## args); \ |
77 | if (unlikely(__mark_##name.state)) { \ | 89 | if (unlikely(__mark_##name.state)) { \ |
78 | (*__mark_##name.call) \ | 90 | (*__mark_##name.call) \ |
@@ -80,14 +92,39 @@ struct marker { | |||
80 | } \ | 92 | } \ |
81 | } while (0) | 93 | } while (0) |
82 | 94 | ||
95 | #define __trace_mark_tp(name, call_private, tp_name, tp_cb, format, args...) \ | ||
96 | do { \ | ||
97 | void __check_tp_type(void) \ | ||
98 | { \ | ||
99 | register_trace_##tp_name(tp_cb); \ | ||
100 | } \ | ||
101 | DEFINE_MARKER_TP(name, tp_name, tp_cb, format); \ | ||
102 | __mark_check_format(format, ## args); \ | ||
103 | (*__mark_##name.call)(&__mark_##name, call_private, \ | ||
104 | ## args); \ | ||
105 | } while (0) | ||
106 | |||
83 | extern void marker_update_probe_range(struct marker *begin, | 107 | extern void marker_update_probe_range(struct marker *begin, |
84 | struct marker *end); | 108 | struct marker *end); |
109 | |||
110 | #define GET_MARKER(name) (__mark_##name) | ||
111 | |||
85 | #else /* !CONFIG_MARKERS */ | 112 | #else /* !CONFIG_MARKERS */ |
113 | #define DEFINE_MARKER(name, tp_name, tp_cb, format) | ||
86 | #define __trace_mark(generic, name, call_private, format, args...) \ | 114 | #define __trace_mark(generic, name, call_private, format, args...) \ |
87 | __mark_check_format(format, ## args) | 115 | __mark_check_format(format, ## args) |
116 | #define __trace_mark_tp(name, call_private, tp_name, tp_cb, format, args...) \ | ||
117 | do { \ | ||
118 | void __check_tp_type(void) \ | ||
119 | { \ | ||
120 | register_trace_##tp_name(tp_cb); \ | ||
121 | } \ | ||
122 | __mark_check_format(format, ## args); \ | ||
123 | } while (0) | ||
88 | static inline void marker_update_probe_range(struct marker *begin, | 124 | static inline void marker_update_probe_range(struct marker *begin, |
89 | struct marker *end) | 125 | struct marker *end) |
90 | { } | 126 | { } |
127 | #define GET_MARKER(name) | ||
91 | #endif /* CONFIG_MARKERS */ | 128 | #endif /* CONFIG_MARKERS */ |
92 | 129 | ||
93 | /** | 130 | /** |
@@ -117,6 +154,20 @@ static inline void marker_update_probe_range(struct marker *begin, | |||
117 | __trace_mark(1, name, NULL, format, ## args) | 154 | __trace_mark(1, name, NULL, format, ## args) |
118 | 155 | ||
119 | /** | 156 | /** |
157 | * trace_mark_tp - Marker in a tracepoint callback | ||
158 | * @name: marker name, not quoted. | ||
159 | * @tp_name: tracepoint name, not quoted. | ||
160 | * @tp_cb: tracepoint callback. Should have an associated global symbol so it | ||
161 | * is not optimized away by the compiler (should not be static). | ||
162 | * @format: format string | ||
163 | * @args...: variable argument list | ||
164 | * | ||
165 | * Places a marker in a tracepoint callback. | ||
166 | */ | ||
167 | #define trace_mark_tp(name, tp_name, tp_cb, format, args...) \ | ||
168 | __trace_mark_tp(name, NULL, tp_name, tp_cb, format, ## args) | ||
169 | |||
170 | /** | ||
120 | * MARK_NOARGS - Format string for a marker with no argument. | 171 | * MARK_NOARGS - Format string for a marker with no argument. |
121 | */ | 172 | */ |
122 | #define MARK_NOARGS " " | 173 | #define MARK_NOARGS " " |
@@ -136,8 +187,6 @@ extern marker_probe_func __mark_empty_function; | |||
136 | 187 | ||
137 | extern void marker_probe_cb(const struct marker *mdata, | 188 | extern void marker_probe_cb(const struct marker *mdata, |
138 | void *call_private, ...); | 189 | void *call_private, ...); |
139 | extern void marker_probe_cb_noarg(const struct marker *mdata, | ||
140 | void *call_private, ...); | ||
141 | 190 | ||
142 | /* | 191 | /* |
143 | * Connect a probe to a marker. | 192 | * Connect a probe to a marker. |
@@ -162,8 +211,10 @@ extern void *marker_get_private_data(const char *name, marker_probe_func *probe, | |||
162 | 211 | ||
163 | /* | 212 | /* |
164 | * marker_synchronize_unregister must be called between the last marker probe | 213 | * marker_synchronize_unregister must be called between the last marker probe |
165 | * unregistration and the end of module exit to make sure there is no caller | 214 | * unregistration and the first one of |
166 | * executing a probe when it is freed. | 215 | * - the end of module exit function |
216 | * - the free of any resource used by the probes | ||
217 | * to ensure the code and data are valid for any possibly running probes. | ||
167 | */ | 218 | */ |
168 | #define marker_synchronize_unregister() synchronize_sched() | 219 | #define marker_synchronize_unregister() synchronize_sched() |
169 | 220 | ||
diff --git a/include/linux/mdio-gpio.h b/include/linux/mdio-gpio.h new file mode 100644 index 000000000000..e9d3fdfe41d7 --- /dev/null +++ b/include/linux/mdio-gpio.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * MDIO-GPIO bus platform data structures | ||
3 | * | ||
4 | * Copyright (C) 2008, Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_MDIO_GPIO_H | ||
12 | #define __LINUX_MDIO_GPIO_H | ||
13 | |||
14 | #include <linux/mdio-bitbang.h> | ||
15 | |||
16 | struct mdio_gpio_platform_data { | ||
17 | /* GPIO numbers for bus pins */ | ||
18 | unsigned int mdc; | ||
19 | unsigned int mdio; | ||
20 | |||
21 | unsigned int phy_mask; | ||
22 | int irqs[PHY_MAX_ADDR]; | ||
23 | }; | ||
24 | |||
25 | #endif /* __LINUX_MDIO_GPIO_H */ | ||
diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h index 217bb22ebb8e..af95a1d2f3a1 100644 --- a/include/linux/mfd/wm8350/audio.h +++ b/include/linux/mfd/wm8350/audio.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * audio.h -- Audio Driver for Wolfson WM8350 PMIC | 2 | * audio.h -- Audio Driver for Wolfson WM8350 PMIC |
3 | * | 3 | * |
4 | * Copyright 2007 Wolfson Microelectronics PLC | 4 | * Copyright 2007, 2008 Wolfson Microelectronics PLC |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License as published by the | 7 | * under the terms of the GNU General Public License as published by the |
@@ -70,9 +70,9 @@ | |||
70 | #define WM8350_CODEC_ISEL_0_5 3 /* x0.5 */ | 70 | #define WM8350_CODEC_ISEL_0_5 3 /* x0.5 */ |
71 | 71 | ||
72 | #define WM8350_VMID_OFF 0 | 72 | #define WM8350_VMID_OFF 0 |
73 | #define WM8350_VMID_500K 1 | 73 | #define WM8350_VMID_300K 1 |
74 | #define WM8350_VMID_100K 2 | 74 | #define WM8350_VMID_50K 2 |
75 | #define WM8350_VMID_10K 3 | 75 | #define WM8350_VMID_5K 3 |
76 | 76 | ||
77 | /* | 77 | /* |
78 | * R40 (0x28) - Clock Control 1 | 78 | * R40 (0x28) - Clock Control 1 |
@@ -591,8 +591,38 @@ | |||
591 | #define WM8350_IRQ_CODEC_MICSCD 41 | 591 | #define WM8350_IRQ_CODEC_MICSCD 41 |
592 | #define WM8350_IRQ_CODEC_MICD 42 | 592 | #define WM8350_IRQ_CODEC_MICD 42 |
593 | 593 | ||
594 | /* | ||
595 | * WM8350 Platform data. | ||
596 | * | ||
597 | * This must be initialised per platform for best audio performance. | ||
598 | * Please see WM8350 datasheet for information. | ||
599 | */ | ||
600 | struct wm8350_audio_platform_data { | ||
601 | int vmid_discharge_msecs; /* VMID --> OFF discharge time */ | ||
602 | int drain_msecs; /* OFF drain time */ | ||
603 | int cap_discharge_msecs; /* Cap ON (from OFF) discharge time */ | ||
604 | int vmid_charge_msecs; /* vmid power up time */ | ||
605 | u32 vmid_s_curve:2; /* vmid enable s curve speed */ | ||
606 | u32 dis_out4:2; /* out4 discharge speed */ | ||
607 | u32 dis_out3:2; /* out3 discharge speed */ | ||
608 | u32 dis_out2:2; /* out2 discharge speed */ | ||
609 | u32 dis_out1:2; /* out1 discharge speed */ | ||
610 | u32 vroi_out4:1; /* out4 tie off */ | ||
611 | u32 vroi_out3:1; /* out3 tie off */ | ||
612 | u32 vroi_out2:1; /* out2 tie off */ | ||
613 | u32 vroi_out1:1; /* out1 tie off */ | ||
614 | u32 vroi_enable:1; /* enable tie off */ | ||
615 | u32 codec_current_on:2; /* current level ON */ | ||
616 | u32 codec_current_standby:2; /* current level STANDBY */ | ||
617 | u32 codec_current_charge:2; /* codec current @ vmid charge */ | ||
618 | }; | ||
619 | |||
620 | struct snd_soc_codec; | ||
621 | |||
594 | struct wm8350_codec { | 622 | struct wm8350_codec { |
595 | struct platform_device *pdev; | 623 | struct platform_device *pdev; |
624 | struct snd_soc_codec *codec; | ||
625 | struct wm8350_audio_platform_data *platform_data; | ||
596 | }; | 626 | }; |
597 | 627 | ||
598 | #endif | 628 | #endif |
diff --git a/include/linux/mii.h b/include/linux/mii.h index 151b7e0182c7..ad748588faf1 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -135,6 +135,10 @@ | |||
135 | #define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ | 135 | #define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ |
136 | #define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ | 136 | #define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ |
137 | 137 | ||
138 | /* Flow control flags */ | ||
139 | #define FLOW_CTRL_TX 0x01 | ||
140 | #define FLOW_CTRL_RX 0x02 | ||
141 | |||
138 | /* This structure is used in all SIOCxMIIxxx ioctl calls */ | 142 | /* This structure is used in all SIOCxMIIxxx ioctl calls */ |
139 | struct mii_ioctl_data { | 143 | struct mii_ioctl_data { |
140 | __u16 phy_id; | 144 | __u16 phy_id; |
@@ -235,5 +239,34 @@ static inline unsigned int mii_duplex (unsigned int duplex_lock, | |||
235 | return 0; | 239 | return 0; |
236 | } | 240 | } |
237 | 241 | ||
242 | /** | ||
243 | * mii_resolve_flowctrl_fdx | ||
244 | * @lcladv: value of MII ADVERTISE register | ||
245 | * @rmtadv: value of MII LPA register | ||
246 | * | ||
247 | * Resolve full duplex flow control as per IEEE 802.3-2005 table 28B-3 | ||
248 | */ | ||
249 | static inline u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv) | ||
250 | { | ||
251 | u8 cap = 0; | ||
252 | |||
253 | if (lcladv & ADVERTISE_PAUSE_CAP) { | ||
254 | if (lcladv & ADVERTISE_PAUSE_ASYM) { | ||
255 | if (rmtadv & LPA_PAUSE_CAP) | ||
256 | cap = FLOW_CTRL_TX | FLOW_CTRL_RX; | ||
257 | else if (rmtadv & LPA_PAUSE_ASYM) | ||
258 | cap = FLOW_CTRL_RX; | ||
259 | } else { | ||
260 | if (rmtadv & LPA_PAUSE_CAP) | ||
261 | cap = FLOW_CTRL_TX | FLOW_CTRL_RX; | ||
262 | } | ||
263 | } else if (lcladv & ADVERTISE_PAUSE_ASYM) { | ||
264 | if ((rmtadv & LPA_PAUSE_CAP) && (rmtadv & LPA_PAUSE_ASYM)) | ||
265 | cap = FLOW_CTRL_TX; | ||
266 | } | ||
267 | |||
268 | return cap; | ||
269 | } | ||
270 | |||
238 | #endif /* __KERNEL__ */ | 271 | #endif /* __KERNEL__ */ |
239 | #endif /* __LINUX_MII_H__ */ | 272 | #endif /* __LINUX_MII_H__ */ |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 371086fd946f..8f659cc29960 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -206,6 +206,7 @@ struct mlx4_caps { | |||
206 | int reserved_cqs; | 206 | int reserved_cqs; |
207 | int num_eqs; | 207 | int num_eqs; |
208 | int reserved_eqs; | 208 | int reserved_eqs; |
209 | int num_comp_vectors; | ||
209 | int num_mpts; | 210 | int num_mpts; |
210 | int num_mtt_segs; | 211 | int num_mtt_segs; |
211 | int fmr_reserved_mtts; | 212 | int fmr_reserved_mtts; |
@@ -328,6 +329,7 @@ struct mlx4_cq { | |||
328 | int arm_sn; | 329 | int arm_sn; |
329 | 330 | ||
330 | int cqn; | 331 | int cqn; |
332 | unsigned vector; | ||
331 | 333 | ||
332 | atomic_t refcount; | 334 | atomic_t refcount; |
333 | struct completion free; | 335 | struct completion free; |
@@ -437,7 +439,7 @@ void mlx4_free_hwq_res(struct mlx4_dev *mdev, struct mlx4_hwq_resources *wqres, | |||
437 | 439 | ||
438 | int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, | 440 | int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt, |
439 | struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq, | 441 | struct mlx4_uar *uar, u64 db_rec, struct mlx4_cq *cq, |
440 | int collapsed); | 442 | unsigned vector, int collapsed); |
441 | void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); | 443 | void mlx4_cq_free(struct mlx4_dev *dev, struct mlx4_cq *cq); |
442 | 444 | ||
443 | int mlx4_qp_reserve_range(struct mlx4_dev *dev, int cnt, int align, int *base); | 445 | int mlx4_qp_reserve_range(struct mlx4_dev *dev, int cnt, int align, int *base); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index ffee2f743418..aaa8b843be28 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -145,6 +145,23 @@ extern pgprot_t protection_map[16]; | |||
145 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ | 145 | #define FAULT_FLAG_WRITE 0x01 /* Fault was a write access */ |
146 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ | 146 | #define FAULT_FLAG_NONLINEAR 0x02 /* Fault was via a nonlinear mapping */ |
147 | 147 | ||
148 | /* | ||
149 | * This interface is used by x86 PAT code to identify a pfn mapping that is | ||
150 | * linear over entire vma. This is to optimize PAT code that deals with | ||
151 | * marking the physical region with a particular prot. This is not for generic | ||
152 | * mm use. Note also that this check will not work if the pfn mapping is | ||
153 | * linear for a vma starting at physical address 0. In which case PAT code | ||
154 | * falls back to slow path of reserving physical range page by page. | ||
155 | */ | ||
156 | static inline int is_linear_pfn_mapping(struct vm_area_struct *vma) | ||
157 | { | ||
158 | return ((vma->vm_flags & VM_PFNMAP) && vma->vm_pgoff); | ||
159 | } | ||
160 | |||
161 | static inline int is_pfn_mapping(struct vm_area_struct *vma) | ||
162 | { | ||
163 | return (vma->vm_flags & VM_PFNMAP); | ||
164 | } | ||
148 | 165 | ||
149 | /* | 166 | /* |
150 | * vm_fault is filled by the the pagefault handler and passed to the vma's | 167 | * vm_fault is filled by the the pagefault handler and passed to the vma's |
@@ -781,6 +798,8 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | |||
781 | struct vm_area_struct *vma); | 798 | struct vm_area_struct *vma); |
782 | void unmap_mapping_range(struct address_space *mapping, | 799 | void unmap_mapping_range(struct address_space *mapping, |
783 | loff_t const holebegin, loff_t const holelen, int even_cows); | 800 | loff_t const holebegin, loff_t const holelen, int even_cows); |
801 | int follow_phys(struct vm_area_struct *vma, unsigned long address, | ||
802 | unsigned int flags, unsigned long *prot, resource_size_t *phys); | ||
784 | int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, | 803 | int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, |
785 | void *buf, int len, int write); | 804 | void *buf, int len, int write); |
786 | 805 | ||
@@ -1286,5 +1305,7 @@ int vmemmap_populate_basepages(struct page *start_page, | |||
1286 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | 1305 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); |
1287 | void vmemmap_populate_print_last(void); | 1306 | void vmemmap_populate_print_last(void); |
1288 | 1307 | ||
1308 | extern void *alloc_locked_buffer(size_t size); | ||
1309 | extern void free_locked_buffer(void *buffer, size_t size); | ||
1289 | #endif /* __KERNEL__ */ | 1310 | #endif /* __KERNEL__ */ |
1290 | #endif /* _LINUX_MM_H */ | 1311 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index fe825471d5aa..9cfc9b627fdd 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -232,8 +232,9 @@ struct mm_struct { | |||
232 | struct core_state *core_state; /* coredumping support */ | 232 | struct core_state *core_state; /* coredumping support */ |
233 | 233 | ||
234 | /* aio bits */ | 234 | /* aio bits */ |
235 | rwlock_t ioctx_list_lock; /* aio lock */ | 235 | spinlock_t ioctx_lock; |
236 | struct kioctx *ioctx_list; | 236 | struct hlist_head ioctx_list; |
237 | |||
237 | #ifdef CONFIG_MM_OWNER | 238 | #ifdef CONFIG_MM_OWNER |
238 | /* | 239 | /* |
239 | * "owner" points to a task that is regarded as the canonical | 240 | * "owner" points to a task that is regarded as the canonical |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 6f4c180179e2..5375faca1f72 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -117,6 +117,7 @@ struct sioc_mif_req6 | |||
117 | 117 | ||
118 | #include <linux/pim.h> | 118 | #include <linux/pim.h> |
119 | #include <linux/skbuff.h> /* for struct sk_buff_head */ | 119 | #include <linux/skbuff.h> /* for struct sk_buff_head */ |
120 | #include <net/net_namespace.h> | ||
120 | 121 | ||
121 | #ifdef CONFIG_IPV6_MROUTE | 122 | #ifdef CONFIG_IPV6_MROUTE |
122 | static inline int ip6_mroute_opt(int opt) | 123 | static inline int ip6_mroute_opt(int opt) |
@@ -187,6 +188,9 @@ struct mif_device | |||
187 | struct mfc6_cache | 188 | struct mfc6_cache |
188 | { | 189 | { |
189 | struct mfc6_cache *next; /* Next entry on cache line */ | 190 | struct mfc6_cache *next; /* Next entry on cache line */ |
191 | #ifdef CONFIG_NET_NS | ||
192 | struct net *mfc6_net; | ||
193 | #endif | ||
190 | struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ | 194 | struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ |
191 | struct in6_addr mf6c_origin; /* Source of packet */ | 195 | struct in6_addr mf6c_origin; /* Source of packet */ |
192 | mifi_t mf6c_parent; /* Source interface */ | 196 | mifi_t mf6c_parent; /* Source interface */ |
@@ -209,6 +213,18 @@ struct mfc6_cache | |||
209 | } mfc_un; | 213 | } mfc_un; |
210 | }; | 214 | }; |
211 | 215 | ||
216 | static inline | ||
217 | struct net *mfc6_net(const struct mfc6_cache *mfc) | ||
218 | { | ||
219 | return read_pnet(&mfc->mfc6_net); | ||
220 | } | ||
221 | |||
222 | static inline | ||
223 | void mfc6_net_set(struct mfc6_cache *mfc, struct net *net) | ||
224 | { | ||
225 | write_pnet(&mfc->mfc6_net, hold_net(net)); | ||
226 | } | ||
227 | |||
212 | #define MFC_STATIC 1 | 228 | #define MFC_STATIC 1 |
213 | #define MFC_NOTIFY 2 | 229 | #define MFC_NOTIFY 2 |
214 | 230 | ||
@@ -229,13 +245,17 @@ struct mfc6_cache | |||
229 | 245 | ||
230 | #ifdef __KERNEL__ | 246 | #ifdef __KERNEL__ |
231 | struct rtmsg; | 247 | struct rtmsg; |
232 | extern int ip6mr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); | 248 | extern int ip6mr_get_route(struct net *net, struct sk_buff *skb, |
249 | struct rtmsg *rtm, int nowait); | ||
233 | 250 | ||
234 | #ifdef CONFIG_IPV6_MROUTE | 251 | #ifdef CONFIG_IPV6_MROUTE |
235 | extern struct sock *mroute6_socket; | 252 | static inline struct sock *mroute6_socket(struct net *net) |
253 | { | ||
254 | return net->ipv6.mroute6_sk; | ||
255 | } | ||
236 | extern int ip6mr_sk_done(struct sock *sk); | 256 | extern int ip6mr_sk_done(struct sock *sk); |
237 | #else | 257 | #else |
238 | #define mroute6_socket NULL | 258 | static inline struct sock *mroute6_socket(struct net *net) { return NULL; } |
239 | static inline int ip6mr_sk_done(struct sock *sk) { return 0; } | 259 | static inline int ip6mr_sk_done(struct sock *sk) { return 0; } |
240 | #endif | 260 | #endif |
241 | #endif | 261 | #endif |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 8f2939227207..d2b8a1e8ca11 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -10,8 +10,11 @@ struct msi_msg { | |||
10 | }; | 10 | }; |
11 | 11 | ||
12 | /* Helper functions */ | 12 | /* Helper functions */ |
13 | struct irq_desc; | ||
13 | extern void mask_msi_irq(unsigned int irq); | 14 | extern void mask_msi_irq(unsigned int irq); |
14 | extern void unmask_msi_irq(unsigned int irq); | 15 | extern void unmask_msi_irq(unsigned int irq); |
16 | extern void read_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg); | ||
17 | extern void write_msi_msg_desc(struct irq_desc *desc, struct msi_msg *msg); | ||
15 | extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); | 18 | extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); |
16 | extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); | 19 | extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); |
17 | 20 | ||
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index bc6da10ceee0..7a0e5c4f8072 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -144,6 +144,8 @@ extern int __must_check mutex_lock_killable(struct mutex *lock); | |||
144 | /* | 144 | /* |
145 | * NOTE: mutex_trylock() follows the spin_trylock() convention, | 145 | * NOTE: mutex_trylock() follows the spin_trylock() convention, |
146 | * not the down_trylock() convention! | 146 | * not the down_trylock() convention! |
147 | * | ||
148 | * Returns 1 if the mutex has been acquired successfully, and 0 on contention. | ||
147 | */ | 149 | */ |
148 | extern int mutex_trylock(struct mutex *lock); | 150 | extern int mutex_trylock(struct mutex *lock); |
149 | extern void mutex_unlock(struct mutex *lock); | 151 | extern void mutex_unlock(struct mutex *lock); |
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 9d77b1d7dca8..41e1224651cf 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -43,6 +43,9 @@ | |||
43 | 43 | ||
44 | #include <net/net_namespace.h> | 44 | #include <net/net_namespace.h> |
45 | #include <net/dsa.h> | 45 | #include <net/dsa.h> |
46 | #ifdef CONFIG_DCB | ||
47 | #include <net/dcbnl.h> | ||
48 | #endif | ||
46 | 49 | ||
47 | struct vlan_group; | 50 | struct vlan_group; |
48 | struct ethtool_ops; | 51 | struct ethtool_ops; |
@@ -311,14 +314,16 @@ struct napi_struct { | |||
311 | spinlock_t poll_lock; | 314 | spinlock_t poll_lock; |
312 | int poll_owner; | 315 | int poll_owner; |
313 | struct net_device *dev; | 316 | struct net_device *dev; |
314 | struct list_head dev_list; | ||
315 | #endif | 317 | #endif |
318 | struct list_head dev_list; | ||
319 | struct sk_buff *gro_list; | ||
316 | }; | 320 | }; |
317 | 321 | ||
318 | enum | 322 | enum |
319 | { | 323 | { |
320 | NAPI_STATE_SCHED, /* Poll is scheduled */ | 324 | NAPI_STATE_SCHED, /* Poll is scheduled */ |
321 | NAPI_STATE_DISABLE, /* Disable pending */ | 325 | NAPI_STATE_DISABLE, /* Disable pending */ |
326 | NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ | ||
322 | }; | 327 | }; |
323 | 328 | ||
324 | extern void __napi_schedule(struct napi_struct *n); | 329 | extern void __napi_schedule(struct napi_struct *n); |
@@ -372,22 +377,8 @@ static inline int napi_reschedule(struct napi_struct *napi) | |||
372 | * | 377 | * |
373 | * Mark NAPI processing as complete. | 378 | * Mark NAPI processing as complete. |
374 | */ | 379 | */ |
375 | static inline void __napi_complete(struct napi_struct *n) | 380 | extern void __napi_complete(struct napi_struct *n); |
376 | { | 381 | extern void napi_complete(struct napi_struct *n); |
377 | BUG_ON(!test_bit(NAPI_STATE_SCHED, &n->state)); | ||
378 | list_del(&n->poll_list); | ||
379 | smp_mb__before_clear_bit(); | ||
380 | clear_bit(NAPI_STATE_SCHED, &n->state); | ||
381 | } | ||
382 | |||
383 | static inline void napi_complete(struct napi_struct *n) | ||
384 | { | ||
385 | unsigned long flags; | ||
386 | |||
387 | local_irq_save(flags); | ||
388 | __napi_complete(n); | ||
389 | local_irq_restore(flags); | ||
390 | } | ||
391 | 382 | ||
392 | /** | 383 | /** |
393 | * napi_disable - prevent NAPI from scheduling | 384 | * napi_disable - prevent NAPI from scheduling |
@@ -451,6 +442,147 @@ struct netdev_queue { | |||
451 | struct Qdisc *qdisc_sleeping; | 442 | struct Qdisc *qdisc_sleeping; |
452 | } ____cacheline_aligned_in_smp; | 443 | } ____cacheline_aligned_in_smp; |
453 | 444 | ||
445 | |||
446 | /* | ||
447 | * This structure defines the management hooks for network devices. | ||
448 | * The following hooks can be defined; unless noted otherwise, they are | ||
449 | * optional and can be filled with a null pointer. | ||
450 | * | ||
451 | * int (*ndo_init)(struct net_device *dev); | ||
452 | * This function is called once when network device is registered. | ||
453 | * The network device can use this to any late stage initializaton | ||
454 | * or semantic validattion. It can fail with an error code which will | ||
455 | * be propogated back to register_netdev | ||
456 | * | ||
457 | * void (*ndo_uninit)(struct net_device *dev); | ||
458 | * This function is called when device is unregistered or when registration | ||
459 | * fails. It is not called if init fails. | ||
460 | * | ||
461 | * int (*ndo_open)(struct net_device *dev); | ||
462 | * This function is called when network device transistions to the up | ||
463 | * state. | ||
464 | * | ||
465 | * int (*ndo_stop)(struct net_device *dev); | ||
466 | * This function is called when network device transistions to the down | ||
467 | * state. | ||
468 | * | ||
469 | * int (*ndo_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev); | ||
470 | * Called when a packet needs to be transmitted. | ||
471 | * Must return NETDEV_TX_OK , NETDEV_TX_BUSY, or NETDEV_TX_LOCKED, | ||
472 | * Required can not be NULL. | ||
473 | * | ||
474 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); | ||
475 | * Called to decide which queue to when device supports multiple | ||
476 | * transmit queues. | ||
477 | * | ||
478 | * void (*ndo_change_rx_flags)(struct net_device *dev, int flags); | ||
479 | * This function is called to allow device receiver to make | ||
480 | * changes to configuration when multicast or promiscious is enabled. | ||
481 | * | ||
482 | * void (*ndo_set_rx_mode)(struct net_device *dev); | ||
483 | * This function is called device changes address list filtering. | ||
484 | * | ||
485 | * void (*ndo_set_multicast_list)(struct net_device *dev); | ||
486 | * This function is called when the multicast address list changes. | ||
487 | * | ||
488 | * int (*ndo_set_mac_address)(struct net_device *dev, void *addr); | ||
489 | * This function is called when the Media Access Control address | ||
490 | * needs to be changed. If not this interface is not defined, the | ||
491 | * mac address can not be changed. | ||
492 | * | ||
493 | * int (*ndo_validate_addr)(struct net_device *dev); | ||
494 | * Test if Media Access Control address is valid for the device. | ||
495 | * | ||
496 | * int (*ndo_do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd); | ||
497 | * Called when a user request an ioctl which can't be handled by | ||
498 | * the generic interface code. If not defined ioctl's return | ||
499 | * not supported error code. | ||
500 | * | ||
501 | * int (*ndo_set_config)(struct net_device *dev, struct ifmap *map); | ||
502 | * Used to set network devices bus interface parameters. This interface | ||
503 | * is retained for legacy reason, new devices should use the bus | ||
504 | * interface (PCI) for low level management. | ||
505 | * | ||
506 | * int (*ndo_change_mtu)(struct net_device *dev, int new_mtu); | ||
507 | * Called when a user wants to change the Maximum Transfer Unit | ||
508 | * of a device. If not defined, any request to change MTU will | ||
509 | * will return an error. | ||
510 | * | ||
511 | * void (*ndo_tx_timeout)(struct net_device *dev); | ||
512 | * Callback uses when the transmitter has not made any progress | ||
513 | * for dev->watchdog ticks. | ||
514 | * | ||
515 | * struct net_device_stats* (*get_stats)(struct net_device *dev); | ||
516 | * Called when a user wants to get the network device usage | ||
517 | * statistics. If not defined, the counters in dev->stats will | ||
518 | * be used. | ||
519 | * | ||
520 | * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp); | ||
521 | * If device support VLAN receive accleration | ||
522 | * (ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called | ||
523 | * when vlan groups for the device changes. Note: grp is NULL | ||
524 | * if no vlan's groups are being used. | ||
525 | * | ||
526 | * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); | ||
527 | * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) | ||
528 | * this function is called when a VLAN id is registered. | ||
529 | * | ||
530 | * void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid); | ||
531 | * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) | ||
532 | * this function is called when a VLAN id is unregistered. | ||
533 | * | ||
534 | * void (*ndo_poll_controller)(struct net_device *dev); | ||
535 | */ | ||
536 | #define HAVE_NET_DEVICE_OPS | ||
537 | struct net_device_ops { | ||
538 | int (*ndo_init)(struct net_device *dev); | ||
539 | void (*ndo_uninit)(struct net_device *dev); | ||
540 | int (*ndo_open)(struct net_device *dev); | ||
541 | int (*ndo_stop)(struct net_device *dev); | ||
542 | int (*ndo_start_xmit) (struct sk_buff *skb, | ||
543 | struct net_device *dev); | ||
544 | u16 (*ndo_select_queue)(struct net_device *dev, | ||
545 | struct sk_buff *skb); | ||
546 | #define HAVE_CHANGE_RX_FLAGS | ||
547 | void (*ndo_change_rx_flags)(struct net_device *dev, | ||
548 | int flags); | ||
549 | #define HAVE_SET_RX_MODE | ||
550 | void (*ndo_set_rx_mode)(struct net_device *dev); | ||
551 | #define HAVE_MULTICAST | ||
552 | void (*ndo_set_multicast_list)(struct net_device *dev); | ||
553 | #define HAVE_SET_MAC_ADDR | ||
554 | int (*ndo_set_mac_address)(struct net_device *dev, | ||
555 | void *addr); | ||
556 | #define HAVE_VALIDATE_ADDR | ||
557 | int (*ndo_validate_addr)(struct net_device *dev); | ||
558 | #define HAVE_PRIVATE_IOCTL | ||
559 | int (*ndo_do_ioctl)(struct net_device *dev, | ||
560 | struct ifreq *ifr, int cmd); | ||
561 | #define HAVE_SET_CONFIG | ||
562 | int (*ndo_set_config)(struct net_device *dev, | ||
563 | struct ifmap *map); | ||
564 | #define HAVE_CHANGE_MTU | ||
565 | int (*ndo_change_mtu)(struct net_device *dev, | ||
566 | int new_mtu); | ||
567 | int (*ndo_neigh_setup)(struct net_device *dev, | ||
568 | struct neigh_parms *); | ||
569 | #define HAVE_TX_TIMEOUT | ||
570 | void (*ndo_tx_timeout) (struct net_device *dev); | ||
571 | |||
572 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); | ||
573 | |||
574 | void (*ndo_vlan_rx_register)(struct net_device *dev, | ||
575 | struct vlan_group *grp); | ||
576 | void (*ndo_vlan_rx_add_vid)(struct net_device *dev, | ||
577 | unsigned short vid); | ||
578 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, | ||
579 | unsigned short vid); | ||
580 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
581 | #define HAVE_NETDEV_POLL | ||
582 | void (*ndo_poll_controller)(struct net_device *dev); | ||
583 | #endif | ||
584 | }; | ||
585 | |||
454 | /* | 586 | /* |
455 | * The DEVICE structure. | 587 | * The DEVICE structure. |
456 | * Actually, this whole structure is a big mistake. It mixes I/O | 588 | * Actually, this whole structure is a big mistake. It mixes I/O |
@@ -495,14 +627,7 @@ struct net_device | |||
495 | unsigned long state; | 627 | unsigned long state; |
496 | 628 | ||
497 | struct list_head dev_list; | 629 | struct list_head dev_list; |
498 | #ifdef CONFIG_NETPOLL | ||
499 | struct list_head napi_list; | 630 | struct list_head napi_list; |
500 | #endif | ||
501 | |||
502 | /* The device initialization function. Called only once. */ | ||
503 | int (*init)(struct net_device *dev); | ||
504 | |||
505 | /* ------- Fields preinitialized in Space.c finish here ------- */ | ||
506 | 631 | ||
507 | /* Net device features */ | 632 | /* Net device features */ |
508 | unsigned long features; | 633 | unsigned long features; |
@@ -521,6 +646,7 @@ struct net_device | |||
521 | #define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */ | 646 | #define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */ |
522 | /* do not use LLTX in new drivers */ | 647 | /* do not use LLTX in new drivers */ |
523 | #define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */ | 648 | #define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */ |
649 | #define NETIF_F_GRO 16384 /* Generic receive offload */ | ||
524 | #define NETIF_F_LRO 32768 /* large receive offload */ | 650 | #define NETIF_F_LRO 32768 /* large receive offload */ |
525 | 651 | ||
526 | /* Segmentation offload features */ | 652 | /* Segmentation offload features */ |
@@ -546,15 +672,13 @@ struct net_device | |||
546 | * for all in netdev_increment_features. | 672 | * for all in netdev_increment_features. |
547 | */ | 673 | */ |
548 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ | 674 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ |
549 | NETIF_F_SG | NETIF_F_HIGHDMA | \ | 675 | NETIF_F_SG | NETIF_F_HIGHDMA | \ |
550 | NETIF_F_FRAGLIST) | 676 | NETIF_F_FRAGLIST) |
551 | 677 | ||
552 | /* Interface index. Unique device identifier */ | 678 | /* Interface index. Unique device identifier */ |
553 | int ifindex; | 679 | int ifindex; |
554 | int iflink; | 680 | int iflink; |
555 | 681 | ||
556 | |||
557 | struct net_device_stats* (*get_stats)(struct net_device *dev); | ||
558 | struct net_device_stats stats; | 682 | struct net_device_stats stats; |
559 | 683 | ||
560 | #ifdef CONFIG_WIRELESS_EXT | 684 | #ifdef CONFIG_WIRELESS_EXT |
@@ -564,18 +688,13 @@ struct net_device | |||
564 | /* Instance data managed by the core of Wireless Extensions. */ | 688 | /* Instance data managed by the core of Wireless Extensions. */ |
565 | struct iw_public_data * wireless_data; | 689 | struct iw_public_data * wireless_data; |
566 | #endif | 690 | #endif |
691 | /* Management operations */ | ||
692 | const struct net_device_ops *netdev_ops; | ||
567 | const struct ethtool_ops *ethtool_ops; | 693 | const struct ethtool_ops *ethtool_ops; |
568 | 694 | ||
569 | /* Hardware header description */ | 695 | /* Hardware header description */ |
570 | const struct header_ops *header_ops; | 696 | const struct header_ops *header_ops; |
571 | 697 | ||
572 | /* | ||
573 | * This marks the end of the "visible" part of the structure. All | ||
574 | * fields hereafter are internal to the system, and may change at | ||
575 | * will (read: may be cleaned up at will). | ||
576 | */ | ||
577 | |||
578 | |||
579 | unsigned int flags; /* interface flags (a la BSD) */ | 698 | unsigned int flags; /* interface flags (a la BSD) */ |
580 | unsigned short gflags; | 699 | unsigned short gflags; |
581 | unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ | 700 | unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ |
@@ -634,7 +753,7 @@ struct net_device | |||
634 | unsigned long last_rx; /* Time of last Rx */ | 753 | unsigned long last_rx; /* Time of last Rx */ |
635 | /* Interface address info used in eth_type_trans() */ | 754 | /* Interface address info used in eth_type_trans() */ |
636 | unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast | 755 | unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast |
637 | because most packets are unicast) */ | 756 | because most packets are unicast) */ |
638 | 757 | ||
639 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 758 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
640 | 759 | ||
@@ -653,18 +772,12 @@ struct net_device | |||
653 | /* | 772 | /* |
654 | * One part is mostly used on xmit path (device) | 773 | * One part is mostly used on xmit path (device) |
655 | */ | 774 | */ |
656 | void *priv; /* pointer to private data */ | ||
657 | int (*hard_start_xmit) (struct sk_buff *skb, | ||
658 | struct net_device *dev); | ||
659 | /* These may be needed for future network-power-down code. */ | 775 | /* These may be needed for future network-power-down code. */ |
660 | unsigned long trans_start; /* Time (in jiffies) of last Tx */ | 776 | unsigned long trans_start; /* Time (in jiffies) of last Tx */ |
661 | 777 | ||
662 | int watchdog_timeo; /* used by dev_watchdog() */ | 778 | int watchdog_timeo; /* used by dev_watchdog() */ |
663 | struct timer_list watchdog_timer; | 779 | struct timer_list watchdog_timer; |
664 | 780 | ||
665 | /* | ||
666 | * refcnt is a very hot point, so align it on SMP | ||
667 | */ | ||
668 | /* Number of references to this device */ | 781 | /* Number of references to this device */ |
669 | atomic_t refcnt ____cacheline_aligned_in_smp; | 782 | atomic_t refcnt ____cacheline_aligned_in_smp; |
670 | 783 | ||
@@ -683,56 +796,12 @@ struct net_device | |||
683 | NETREG_RELEASED, /* called free_netdev */ | 796 | NETREG_RELEASED, /* called free_netdev */ |
684 | } reg_state; | 797 | } reg_state; |
685 | 798 | ||
686 | /* Called after device is detached from network. */ | 799 | /* Called from unregister, can be used to call free_netdev */ |
687 | void (*uninit)(struct net_device *dev); | 800 | void (*destructor)(struct net_device *dev); |
688 | /* Called after last user reference disappears. */ | ||
689 | void (*destructor)(struct net_device *dev); | ||
690 | 801 | ||
691 | /* Pointers to interface service routines. */ | ||
692 | int (*open)(struct net_device *dev); | ||
693 | int (*stop)(struct net_device *dev); | ||
694 | #define HAVE_NETDEV_POLL | ||
695 | #define HAVE_CHANGE_RX_FLAGS | ||
696 | void (*change_rx_flags)(struct net_device *dev, | ||
697 | int flags); | ||
698 | #define HAVE_SET_RX_MODE | ||
699 | void (*set_rx_mode)(struct net_device *dev); | ||
700 | #define HAVE_MULTICAST | ||
701 | void (*set_multicast_list)(struct net_device *dev); | ||
702 | #define HAVE_SET_MAC_ADDR | ||
703 | int (*set_mac_address)(struct net_device *dev, | ||
704 | void *addr); | ||
705 | #define HAVE_VALIDATE_ADDR | ||
706 | int (*validate_addr)(struct net_device *dev); | ||
707 | #define HAVE_PRIVATE_IOCTL | ||
708 | int (*do_ioctl)(struct net_device *dev, | ||
709 | struct ifreq *ifr, int cmd); | ||
710 | #define HAVE_SET_CONFIG | ||
711 | int (*set_config)(struct net_device *dev, | ||
712 | struct ifmap *map); | ||
713 | #define HAVE_CHANGE_MTU | ||
714 | int (*change_mtu)(struct net_device *dev, int new_mtu); | ||
715 | |||
716 | #define HAVE_TX_TIMEOUT | ||
717 | void (*tx_timeout) (struct net_device *dev); | ||
718 | |||
719 | void (*vlan_rx_register)(struct net_device *dev, | ||
720 | struct vlan_group *grp); | ||
721 | void (*vlan_rx_add_vid)(struct net_device *dev, | ||
722 | unsigned short vid); | ||
723 | void (*vlan_rx_kill_vid)(struct net_device *dev, | ||
724 | unsigned short vid); | ||
725 | |||
726 | int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); | ||
727 | #ifdef CONFIG_NETPOLL | 802 | #ifdef CONFIG_NETPOLL |
728 | struct netpoll_info *npinfo; | 803 | struct netpoll_info *npinfo; |
729 | #endif | 804 | #endif |
730 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
731 | void (*poll_controller)(struct net_device *dev); | ||
732 | #endif | ||
733 | |||
734 | u16 (*select_queue)(struct net_device *dev, | ||
735 | struct sk_buff *skb); | ||
736 | 805 | ||
737 | #ifdef CONFIG_NET_NS | 806 | #ifdef CONFIG_NET_NS |
738 | /* Network namespace this network device is inside */ | 807 | /* Network namespace this network device is inside */ |
@@ -763,6 +832,49 @@ struct net_device | |||
763 | /* for setting kernel sock attribute on TCP connection setup */ | 832 | /* for setting kernel sock attribute on TCP connection setup */ |
764 | #define GSO_MAX_SIZE 65536 | 833 | #define GSO_MAX_SIZE 65536 |
765 | unsigned int gso_max_size; | 834 | unsigned int gso_max_size; |
835 | |||
836 | #ifdef CONFIG_DCB | ||
837 | /* Data Center Bridging netlink ops */ | ||
838 | struct dcbnl_rtnl_ops *dcbnl_ops; | ||
839 | #endif | ||
840 | |||
841 | #ifdef CONFIG_COMPAT_NET_DEV_OPS | ||
842 | struct { | ||
843 | int (*init)(struct net_device *dev); | ||
844 | void (*uninit)(struct net_device *dev); | ||
845 | int (*open)(struct net_device *dev); | ||
846 | int (*stop)(struct net_device *dev); | ||
847 | int (*hard_start_xmit) (struct sk_buff *skb, | ||
848 | struct net_device *dev); | ||
849 | u16 (*select_queue)(struct net_device *dev, | ||
850 | struct sk_buff *skb); | ||
851 | void (*change_rx_flags)(struct net_device *dev, | ||
852 | int flags); | ||
853 | void (*set_rx_mode)(struct net_device *dev); | ||
854 | void (*set_multicast_list)(struct net_device *dev); | ||
855 | int (*set_mac_address)(struct net_device *dev, | ||
856 | void *addr); | ||
857 | int (*validate_addr)(struct net_device *dev); | ||
858 | int (*do_ioctl)(struct net_device *dev, | ||
859 | struct ifreq *ifr, int cmd); | ||
860 | int (*set_config)(struct net_device *dev, | ||
861 | struct ifmap *map); | ||
862 | int (*change_mtu)(struct net_device *dev, int new_mtu); | ||
863 | int (*neigh_setup)(struct net_device *dev, | ||
864 | struct neigh_parms *); | ||
865 | void (*tx_timeout) (struct net_device *dev); | ||
866 | struct net_device_stats* (*get_stats)(struct net_device *dev); | ||
867 | void (*vlan_rx_register)(struct net_device *dev, | ||
868 | struct vlan_group *grp); | ||
869 | void (*vlan_rx_add_vid)(struct net_device *dev, | ||
870 | unsigned short vid); | ||
871 | void (*vlan_rx_kill_vid)(struct net_device *dev, | ||
872 | unsigned short vid); | ||
873 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
874 | void (*poll_controller)(struct net_device *dev); | ||
875 | #endif | ||
876 | }; | ||
877 | #endif | ||
766 | }; | 878 | }; |
767 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 879 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
768 | 880 | ||
@@ -858,22 +970,8 @@ static inline void *netdev_priv(const struct net_device *dev) | |||
858 | * netif_napi_add() must be used to initialize a napi context prior to calling | 970 | * netif_napi_add() must be used to initialize a napi context prior to calling |
859 | * *any* of the other napi related functions. | 971 | * *any* of the other napi related functions. |
860 | */ | 972 | */ |
861 | static inline void netif_napi_add(struct net_device *dev, | 973 | void netif_napi_add(struct net_device *dev, struct napi_struct *napi, |
862 | struct napi_struct *napi, | 974 | int (*poll)(struct napi_struct *, int), int weight); |
863 | int (*poll)(struct napi_struct *, int), | ||
864 | int weight) | ||
865 | { | ||
866 | INIT_LIST_HEAD(&napi->poll_list); | ||
867 | napi->poll = poll; | ||
868 | napi->weight = weight; | ||
869 | #ifdef CONFIG_NETPOLL | ||
870 | napi->dev = dev; | ||
871 | list_add(&napi->dev_list, &dev->napi_list); | ||
872 | spin_lock_init(&napi->poll_lock); | ||
873 | napi->poll_owner = -1; | ||
874 | #endif | ||
875 | set_bit(NAPI_STATE_SCHED, &napi->state); | ||
876 | } | ||
877 | 975 | ||
878 | /** | 976 | /** |
879 | * netif_napi_del - remove a napi context | 977 | * netif_napi_del - remove a napi context |
@@ -881,12 +979,20 @@ static inline void netif_napi_add(struct net_device *dev, | |||
881 | * | 979 | * |
882 | * netif_napi_del() removes a napi context from the network device napi list | 980 | * netif_napi_del() removes a napi context from the network device napi list |
883 | */ | 981 | */ |
884 | static inline void netif_napi_del(struct napi_struct *napi) | 982 | void netif_napi_del(struct napi_struct *napi); |
885 | { | 983 | |
886 | #ifdef CONFIG_NETPOLL | 984 | struct napi_gro_cb { |
887 | list_del(&napi->dev_list); | 985 | /* This is non-zero if the packet may be of the same flow. */ |
888 | #endif | 986 | int same_flow; |
889 | } | 987 | |
988 | /* This is non-zero if the packet cannot be merged with the new skb. */ | ||
989 | int flush; | ||
990 | |||
991 | /* Number of segments aggregated. */ | ||
992 | int count; | ||
993 | }; | ||
994 | |||
995 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) | ||
890 | 996 | ||
891 | struct packet_type { | 997 | struct packet_type { |
892 | __be16 type; /* This is really htons(ether_type). */ | 998 | __be16 type; /* This is really htons(ether_type). */ |
@@ -898,6 +1004,9 @@ struct packet_type { | |||
898 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 1004 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
899 | int features); | 1005 | int features); |
900 | int (*gso_send_check)(struct sk_buff *skb); | 1006 | int (*gso_send_check)(struct sk_buff *skb); |
1007 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
1008 | struct sk_buff *skb); | ||
1009 | int (*gro_complete)(struct sk_buff *skb); | ||
901 | void *af_packet_priv; | 1010 | void *af_packet_priv; |
902 | struct list_head list; | 1011 | struct list_head list; |
903 | }; | 1012 | }; |
@@ -1251,6 +1360,9 @@ extern int netif_rx(struct sk_buff *skb); | |||
1251 | extern int netif_rx_ni(struct sk_buff *skb); | 1360 | extern int netif_rx_ni(struct sk_buff *skb); |
1252 | #define HAVE_NETIF_RECEIVE_SKB 1 | 1361 | #define HAVE_NETIF_RECEIVE_SKB 1 |
1253 | extern int netif_receive_skb(struct sk_buff *skb); | 1362 | extern int netif_receive_skb(struct sk_buff *skb); |
1363 | extern void napi_gro_flush(struct napi_struct *napi); | ||
1364 | extern int napi_gro_receive(struct napi_struct *napi, | ||
1365 | struct sk_buff *skb); | ||
1254 | extern void netif_nit_deliver(struct sk_buff *skb); | 1366 | extern void netif_nit_deliver(struct sk_buff *skb); |
1255 | extern int dev_valid_name(const char *name); | 1367 | extern int dev_valid_name(const char *name); |
1256 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1368 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
@@ -1443,8 +1555,7 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits) | |||
1443 | } | 1555 | } |
1444 | 1556 | ||
1445 | /* Test if receive needs to be scheduled but only if up */ | 1557 | /* Test if receive needs to be scheduled but only if up */ |
1446 | static inline int netif_rx_schedule_prep(struct net_device *dev, | 1558 | static inline int netif_rx_schedule_prep(struct napi_struct *napi) |
1447 | struct napi_struct *napi) | ||
1448 | { | 1559 | { |
1449 | return napi_schedule_prep(napi); | 1560 | return napi_schedule_prep(napi); |
1450 | } | 1561 | } |
@@ -1452,27 +1563,24 @@ static inline int netif_rx_schedule_prep(struct net_device *dev, | |||
1452 | /* Add interface to tail of rx poll list. This assumes that _prep has | 1563 | /* Add interface to tail of rx poll list. This assumes that _prep has |
1453 | * already been called and returned 1. | 1564 | * already been called and returned 1. |
1454 | */ | 1565 | */ |
1455 | static inline void __netif_rx_schedule(struct net_device *dev, | 1566 | static inline void __netif_rx_schedule(struct napi_struct *napi) |
1456 | struct napi_struct *napi) | ||
1457 | { | 1567 | { |
1458 | __napi_schedule(napi); | 1568 | __napi_schedule(napi); |
1459 | } | 1569 | } |
1460 | 1570 | ||
1461 | /* Try to reschedule poll. Called by irq handler. */ | 1571 | /* Try to reschedule poll. Called by irq handler. */ |
1462 | 1572 | ||
1463 | static inline void netif_rx_schedule(struct net_device *dev, | 1573 | static inline void netif_rx_schedule(struct napi_struct *napi) |
1464 | struct napi_struct *napi) | ||
1465 | { | 1574 | { |
1466 | if (netif_rx_schedule_prep(dev, napi)) | 1575 | if (netif_rx_schedule_prep(napi)) |
1467 | __netif_rx_schedule(dev, napi); | 1576 | __netif_rx_schedule(napi); |
1468 | } | 1577 | } |
1469 | 1578 | ||
1470 | /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */ | 1579 | /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */ |
1471 | static inline int netif_rx_reschedule(struct net_device *dev, | 1580 | static inline int netif_rx_reschedule(struct napi_struct *napi) |
1472 | struct napi_struct *napi) | ||
1473 | { | 1581 | { |
1474 | if (napi_schedule_prep(napi)) { | 1582 | if (napi_schedule_prep(napi)) { |
1475 | __netif_rx_schedule(dev, napi); | 1583 | __netif_rx_schedule(napi); |
1476 | return 1; | 1584 | return 1; |
1477 | } | 1585 | } |
1478 | return 0; | 1586 | return 0; |
@@ -1481,8 +1589,7 @@ static inline int netif_rx_reschedule(struct net_device *dev, | |||
1481 | /* same as netif_rx_complete, except that local_irq_save(flags) | 1589 | /* same as netif_rx_complete, except that local_irq_save(flags) |
1482 | * has already been issued | 1590 | * has already been issued |
1483 | */ | 1591 | */ |
1484 | static inline void __netif_rx_complete(struct net_device *dev, | 1592 | static inline void __netif_rx_complete(struct napi_struct *napi) |
1485 | struct napi_struct *napi) | ||
1486 | { | 1593 | { |
1487 | __napi_complete(napi); | 1594 | __napi_complete(napi); |
1488 | } | 1595 | } |
@@ -1492,14 +1599,9 @@ static inline void __netif_rx_complete(struct net_device *dev, | |||
1492 | * it completes the work. The device cannot be out of poll list at this | 1599 | * it completes the work. The device cannot be out of poll list at this |
1493 | * moment, it is BUG(). | 1600 | * moment, it is BUG(). |
1494 | */ | 1601 | */ |
1495 | static inline void netif_rx_complete(struct net_device *dev, | 1602 | static inline void netif_rx_complete(struct napi_struct *napi) |
1496 | struct napi_struct *napi) | ||
1497 | { | 1603 | { |
1498 | unsigned long flags; | 1604 | napi_complete(napi); |
1499 | |||
1500 | local_irq_save(flags); | ||
1501 | __netif_rx_complete(dev, napi); | ||
1502 | local_irq_restore(flags); | ||
1503 | } | 1605 | } |
1504 | 1606 | ||
1505 | static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu) | 1607 | static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu) |
@@ -1676,6 +1778,8 @@ extern void netdev_features_change(struct net_device *dev); | |||
1676 | /* Load a device via the kmod */ | 1778 | /* Load a device via the kmod */ |
1677 | extern void dev_load(struct net *net, const char *name); | 1779 | extern void dev_load(struct net *net, const char *name); |
1678 | extern void dev_mcast_init(void); | 1780 | extern void dev_mcast_init(void); |
1781 | extern const struct net_device_stats *dev_get_stats(struct net_device *dev); | ||
1782 | |||
1679 | extern int netdev_max_backlog; | 1783 | extern int netdev_max_backlog; |
1680 | extern int weight_p; | 1784 | extern int weight_p; |
1681 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 1785 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
@@ -1724,6 +1828,8 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | |||
1724 | { | 1828 | { |
1725 | return skb_is_gso(skb) && | 1829 | return skb_is_gso(skb) && |
1726 | (!skb_gso_ok(skb, dev->features) || | 1830 | (!skb_gso_ok(skb, dev->features) || |
1831 | (skb_shinfo(skb)->frag_list && | ||
1832 | !(dev->features & NETIF_F_FRAGLIST)) || | ||
1727 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 1833 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
1728 | } | 1834 | } |
1729 | 1835 | ||
@@ -1742,26 +1848,31 @@ static inline int skb_bond_should_drop(struct sk_buff *skb) | |||
1742 | struct net_device *dev = skb->dev; | 1848 | struct net_device *dev = skb->dev; |
1743 | struct net_device *master = dev->master; | 1849 | struct net_device *master = dev->master; |
1744 | 1850 | ||
1745 | if (master && | 1851 | if (master) { |
1746 | (dev->priv_flags & IFF_SLAVE_INACTIVE)) { | 1852 | if (master->priv_flags & IFF_MASTER_ARPMON) |
1747 | if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && | 1853 | dev->last_rx = jiffies; |
1748 | skb->protocol == __constant_htons(ETH_P_ARP)) | ||
1749 | return 0; | ||
1750 | 1854 | ||
1751 | if (master->priv_flags & IFF_MASTER_ALB) { | 1855 | if (dev->priv_flags & IFF_SLAVE_INACTIVE) { |
1752 | if (skb->pkt_type != PACKET_BROADCAST && | 1856 | if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && |
1753 | skb->pkt_type != PACKET_MULTICAST) | 1857 | skb->protocol == __constant_htons(ETH_P_ARP)) |
1754 | return 0; | 1858 | return 0; |
1755 | } | ||
1756 | if (master->priv_flags & IFF_MASTER_8023AD && | ||
1757 | skb->protocol == __constant_htons(ETH_P_SLOW)) | ||
1758 | return 0; | ||
1759 | 1859 | ||
1760 | return 1; | 1860 | if (master->priv_flags & IFF_MASTER_ALB) { |
1861 | if (skb->pkt_type != PACKET_BROADCAST && | ||
1862 | skb->pkt_type != PACKET_MULTICAST) | ||
1863 | return 0; | ||
1864 | } | ||
1865 | if (master->priv_flags & IFF_MASTER_8023AD && | ||
1866 | skb->protocol == __constant_htons(ETH_P_SLOW)) | ||
1867 | return 0; | ||
1868 | |||
1869 | return 1; | ||
1870 | } | ||
1761 | } | 1871 | } |
1762 | return 0; | 1872 | return 0; |
1763 | } | 1873 | } |
1764 | 1874 | ||
1875 | extern struct pernet_operations __net_initdata loopback_net_ops; | ||
1765 | #endif /* __KERNEL__ */ | 1876 | #endif /* __KERNEL__ */ |
1766 | 1877 | ||
1767 | #endif /* _LINUX_DEV_H */ | 1878 | #endif /* _LINUX_DEV_H */ |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index c19595c89304..29fe9ea1d346 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -141,6 +141,7 @@ enum ctattr_protonat { | |||
141 | #define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1) | 141 | #define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1) |
142 | 142 | ||
143 | enum ctattr_natseq { | 143 | enum ctattr_natseq { |
144 | CTA_NAT_SEQ_UNSPEC, | ||
144 | CTA_NAT_SEQ_CORRECTION_POS, | 145 | CTA_NAT_SEQ_CORRECTION_POS, |
145 | CTA_NAT_SEQ_OFFSET_BEFORE, | 146 | CTA_NAT_SEQ_OFFSET_BEFORE, |
146 | CTA_NAT_SEQ_OFFSET_AFTER, | 147 | CTA_NAT_SEQ_OFFSET_AFTER, |
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index d45e29cd1cfb..e40ddb94b1af 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
@@ -300,7 +300,8 @@ struct ebt_table | |||
300 | 300 | ||
301 | #define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ | 301 | #define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ |
302 | ~(__alignof__(struct ebt_replace)-1)) | 302 | ~(__alignof__(struct ebt_replace)-1)) |
303 | extern int ebt_register_table(struct ebt_table *table); | 303 | extern struct ebt_table *ebt_register_table(struct net *net, |
304 | struct ebt_table *table); | ||
304 | extern void ebt_unregister_table(struct ebt_table *table); | 305 | extern void ebt_unregister_table(struct ebt_table *table); |
305 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | 306 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, |
306 | const struct net_device *in, const struct net_device *out, | 307 | const struct net_device *in, const struct net_device *out, |
diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h index b9478a255301..1037fb2cd206 100644 --- a/include/linux/netfilter_ipv4/ipt_policy.h +++ b/include/linux/netfilter_ipv4/ipt_policy.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _IPT_POLICY_H | 1 | #ifndef _IPT_POLICY_H |
2 | #define _IPT_POLICY_H | 2 | #define _IPT_POLICY_H |
3 | 3 | ||
4 | #include <linux/netfilter/xt_policy.h> | ||
5 | |||
4 | #define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM | 6 | #define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM |
5 | 7 | ||
6 | /* ipt_policy_flags */ | 8 | /* ipt_policy_flags */ |
diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h index 6bab3163d2fb..b1c449d7ec89 100644 --- a/include/linux/netfilter_ipv6/ip6t_policy.h +++ b/include/linux/netfilter_ipv6/ip6t_policy.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _IP6T_POLICY_H | 1 | #ifndef _IP6T_POLICY_H |
2 | #define _IP6T_POLICY_H | 2 | #define _IP6T_POLICY_H |
3 | 3 | ||
4 | #include <linux/netfilter/xt_policy.h> | ||
5 | |||
4 | #define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM | 6 | #define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM |
5 | 7 | ||
6 | /* ip6t_policy_flags */ | 8 | /* ip6t_policy_flags */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 9ff1b54908f3..51b09a1f46c3 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -242,7 +242,8 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) | |||
242 | nlh->nlmsg_flags = flags; | 242 | nlh->nlmsg_flags = flags; |
243 | nlh->nlmsg_pid = pid; | 243 | nlh->nlmsg_pid = pid; |
244 | nlh->nlmsg_seq = seq; | 244 | nlh->nlmsg_seq = seq; |
245 | memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size); | 245 | if (!__builtin_constant_p(size) || NLMSG_ALIGN(size) - size != 0) |
246 | memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size); | ||
246 | return nlh; | 247 | return nlh; |
247 | } | 248 | } |
248 | 249 | ||
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index e3d79593fb3a..e38d3c9dccda 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -94,11 +94,6 @@ static inline void netpoll_poll_unlock(void *have) | |||
94 | rcu_read_unlock(); | 94 | rcu_read_unlock(); |
95 | } | 95 | } |
96 | 96 | ||
97 | static inline void netpoll_netdev_init(struct net_device *dev) | ||
98 | { | ||
99 | INIT_LIST_HEAD(&dev->napi_list); | ||
100 | } | ||
101 | |||
102 | #else | 97 | #else |
103 | static inline int netpoll_rx(struct sk_buff *skb) | 98 | static inline int netpoll_rx(struct sk_buff *skb) |
104 | { | 99 | { |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 4eaa8347a0d9..db867b04ac3c 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -83,7 +83,7 @@ struct nfs_open_context { | |||
83 | struct rpc_cred *cred; | 83 | struct rpc_cred *cred; |
84 | struct nfs4_state *state; | 84 | struct nfs4_state *state; |
85 | fl_owner_t lockowner; | 85 | fl_owner_t lockowner; |
86 | int mode; | 86 | fmode_t mode; |
87 | 87 | ||
88 | unsigned long flags; | 88 | unsigned long flags; |
89 | #define NFS_CONTEXT_ERROR_WRITE (0) | 89 | #define NFS_CONTEXT_ERROR_WRITE (0) |
@@ -130,7 +130,10 @@ struct nfs_inode { | |||
130 | * | 130 | * |
131 | * We need to revalidate the cached attrs for this inode if | 131 | * We need to revalidate the cached attrs for this inode if |
132 | * | 132 | * |
133 | * jiffies - read_cache_jiffies > attrtimeo | 133 | * jiffies - read_cache_jiffies >= attrtimeo |
134 | * | ||
135 | * Please note the comparison is greater than or equal | ||
136 | * so that zero timeout values can be specified. | ||
134 | */ | 137 | */ |
135 | unsigned long read_cache_jiffies; | 138 | unsigned long read_cache_jiffies; |
136 | unsigned long attrtimeo; | 139 | unsigned long attrtimeo; |
@@ -180,7 +183,7 @@ struct nfs_inode { | |||
180 | /* NFSv4 state */ | 183 | /* NFSv4 state */ |
181 | struct list_head open_states; | 184 | struct list_head open_states; |
182 | struct nfs_delegation *delegation; | 185 | struct nfs_delegation *delegation; |
183 | int delegation_state; | 186 | fmode_t delegation_state; |
184 | struct rw_semaphore rwsem; | 187 | struct rw_semaphore rwsem; |
185 | #endif /* CONFIG_NFS_V4*/ | 188 | #endif /* CONFIG_NFS_V4*/ |
186 | struct inode vfs_inode; | 189 | struct inode vfs_inode; |
@@ -342,7 +345,7 @@ extern int nfs_setattr(struct dentry *, struct iattr *); | |||
342 | extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); | 345 | extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); |
343 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 346 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
344 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 347 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
345 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); | 348 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); |
346 | extern u64 nfs_compat_user_ino64(u64 fileid); | 349 | extern u64 nfs_compat_user_ino64(u64 fileid); |
347 | extern void nfs_fattr_init(struct nfs_fattr *fattr); | 350 | extern void nfs_fattr_init(struct nfs_fattr *fattr); |
348 | 351 | ||
@@ -533,12 +536,6 @@ static inline void nfs3_forget_cached_acls(struct inode *inode) | |||
533 | #endif /* CONFIG_NFS_V3_ACL */ | 536 | #endif /* CONFIG_NFS_V3_ACL */ |
534 | 537 | ||
535 | /* | 538 | /* |
536 | * linux/fs/mount_clnt.c | ||
537 | */ | ||
538 | extern int nfs_mount(struct sockaddr *, size_t, char *, char *, | ||
539 | int, int, struct nfs_fh *); | ||
540 | |||
541 | /* | ||
542 | * inline functions | 539 | * inline functions |
543 | */ | 540 | */ |
544 | 541 | ||
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 4e477ae58699..9bb81aec91cf 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -42,12 +42,6 @@ struct nfs_client { | |||
42 | struct rb_root cl_openowner_id; | 42 | struct rb_root cl_openowner_id; |
43 | struct rb_root cl_lockowner_id; | 43 | struct rb_root cl_lockowner_id; |
44 | 44 | ||
45 | /* | ||
46 | * The following rwsem ensures exclusive access to the server | ||
47 | * while we recover the state following a lease expiration. | ||
48 | */ | ||
49 | struct rw_semaphore cl_sem; | ||
50 | |||
51 | struct list_head cl_delegations; | 45 | struct list_head cl_delegations; |
52 | struct rb_root cl_state_owners; | 46 | struct rb_root cl_state_owners; |
53 | spinlock_t cl_lock; | 47 | spinlock_t cl_lock; |
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h index 6549a06ac16e..4499016e6d0d 100644 --- a/include/linux/nfs_mount.h +++ b/include/linux/nfs_mount.h | |||
@@ -45,7 +45,7 @@ struct nfs_mount_data { | |||
45 | char context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */ | 45 | char context[NFS_MAX_CONTEXT_LEN + 1]; /* 6 */ |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /* bits in the flags field */ | 48 | /* bits in the flags field visible to user space */ |
49 | 49 | ||
50 | #define NFS_MOUNT_SOFT 0x0001 /* 1 */ | 50 | #define NFS_MOUNT_SOFT 0x0001 /* 1 */ |
51 | #define NFS_MOUNT_INTR 0x0002 /* 1 */ /* now unused, but ABI */ | 51 | #define NFS_MOUNT_INTR 0x0002 /* 1 */ /* now unused, but ABI */ |
@@ -68,5 +68,6 @@ struct nfs_mount_data { | |||
68 | /* The following are for internal use only */ | 68 | /* The following are for internal use only */ |
69 | #define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000 | 69 | #define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000 |
70 | #define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000 | 70 | #define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000 |
71 | #define NFS_MOUNT_NORESVPORT 0x40000 | ||
71 | 72 | ||
72 | #endif | 73 | #endif |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index c1c31acb8a2b..a550b528319f 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -120,13 +120,14 @@ struct nfs_openargs { | |||
120 | const struct nfs_fh * fh; | 120 | const struct nfs_fh * fh; |
121 | struct nfs_seqid * seqid; | 121 | struct nfs_seqid * seqid; |
122 | int open_flags; | 122 | int open_flags; |
123 | fmode_t fmode; | ||
123 | __u64 clientid; | 124 | __u64 clientid; |
124 | __u64 id; | 125 | __u64 id; |
125 | union { | 126 | union { |
126 | struct iattr * attrs; /* UNCHECKED, GUARDED */ | 127 | struct iattr * attrs; /* UNCHECKED, GUARDED */ |
127 | nfs4_verifier verifier; /* EXCLUSIVE */ | 128 | nfs4_verifier verifier; /* EXCLUSIVE */ |
128 | nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */ | 129 | nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */ |
129 | int delegation_type; /* CLAIM_PREVIOUS */ | 130 | fmode_t delegation_type; /* CLAIM_PREVIOUS */ |
130 | } u; | 131 | } u; |
131 | const struct qstr * name; | 132 | const struct qstr * name; |
132 | const struct nfs_server *server; /* Needed for ID mapping */ | 133 | const struct nfs_server *server; /* Needed for ID mapping */ |
@@ -143,7 +144,7 @@ struct nfs_openres { | |||
143 | struct nfs_fattr * dir_attr; | 144 | struct nfs_fattr * dir_attr; |
144 | struct nfs_seqid * seqid; | 145 | struct nfs_seqid * seqid; |
145 | const struct nfs_server *server; | 146 | const struct nfs_server *server; |
146 | int delegation_type; | 147 | fmode_t delegation_type; |
147 | nfs4_stateid delegation; | 148 | nfs4_stateid delegation; |
148 | __u32 do_recall; | 149 | __u32 do_recall; |
149 | __u64 maxsize; | 150 | __u64 maxsize; |
@@ -171,7 +172,7 @@ struct nfs_closeargs { | |||
171 | struct nfs_fh * fh; | 172 | struct nfs_fh * fh; |
172 | nfs4_stateid * stateid; | 173 | nfs4_stateid * stateid; |
173 | struct nfs_seqid * seqid; | 174 | struct nfs_seqid * seqid; |
174 | int open_flags; | 175 | fmode_t fmode; |
175 | const u32 * bitmask; | 176 | const u32 * bitmask; |
176 | }; | 177 | }; |
177 | 178 | ||
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index d0fe2e378452..128298c0362d 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -124,6 +124,8 @@ struct nfs4_client { | |||
124 | nfs4_verifier cl_verifier; /* generated by client */ | 124 | nfs4_verifier cl_verifier; /* generated by client */ |
125 | time_t cl_time; /* time of last lease renewal */ | 125 | time_t cl_time; /* time of last lease renewal */ |
126 | __be32 cl_addr; /* client ipaddress */ | 126 | __be32 cl_addr; /* client ipaddress */ |
127 | u32 cl_flavor; /* setclientid pseudoflavor */ | ||
128 | char *cl_principal; /* setclientid principal name */ | ||
127 | struct svc_cred cl_cred; /* setclientid principal */ | 129 | struct svc_cred cl_cred; /* setclientid principal */ |
128 | clientid_t cl_clientid; /* generated by server */ | 130 | clientid_t cl_clientid; /* generated by server */ |
129 | nfs4_verifier cl_confirm; /* generated by server */ | 131 | nfs4_verifier cl_confirm; /* generated by server */ |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 9bad65400fba..e86ed59f9ad5 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -3,7 +3,26 @@ | |||
3 | /* | 3 | /* |
4 | * 802.11 netlink interface public header | 4 | * 802.11 netlink interface public header |
5 | * | 5 | * |
6 | * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net> | 6 | * Copyright 2006, 2007, 2008 Johannes Berg <johannes@sipsolutions.net> |
7 | * Copyright 2008 Michael Wu <flamingice@sourmilk.net> | ||
8 | * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> | ||
9 | * Copyright 2008 Michael Buesch <mb@bu3sch.de> | ||
10 | * Copyright 2008 Luis R. Rodriguez <lrodriguez@atheros.com> | ||
11 | * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> | ||
12 | * Copyright 2008 Colin McCabe <colin@cozybit.com> | ||
13 | * | ||
14 | * Permission to use, copy, modify, and/or distribute this software for any | ||
15 | * purpose with or without fee is hereby granted, provided that the above | ||
16 | * copyright notice and this permission notice appear in all copies. | ||
17 | * | ||
18 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
19 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
20 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
21 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
22 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
23 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
24 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
25 | * | ||
7 | */ | 26 | */ |
8 | 27 | ||
9 | /** | 28 | /** |
@@ -25,8 +44,10 @@ | |||
25 | * | 44 | * |
26 | * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request | 45 | * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request |
27 | * to get a list of all present wiphys. | 46 | * to get a list of all present wiphys. |
28 | * @NL80211_CMD_SET_WIPHY: set wiphy name, needs %NL80211_ATTR_WIPHY and | 47 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or |
29 | * %NL80211_ATTR_WIPHY_NAME. | 48 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, |
49 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, and/or | ||
50 | * %NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET. | ||
30 | * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request | 51 | * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request |
31 | * or rename notification. Has attributes %NL80211_ATTR_WIPHY and | 52 | * or rename notification. Has attributes %NL80211_ATTR_WIPHY and |
32 | * %NL80211_ATTR_WIPHY_NAME. | 53 | * %NL80211_ATTR_WIPHY_NAME. |
@@ -106,6 +127,12 @@ | |||
106 | * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will | 127 | * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will |
107 | * store this as a valid request and then query userspace for it. | 128 | * store this as a valid request and then query userspace for it. |
108 | * | 129 | * |
130 | * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the | ||
131 | * interface identified by %NL80211_ATTR_IFINDEX | ||
132 | * | ||
133 | * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the | ||
134 | * interface identified by %NL80211_ATTR_IFINDEX | ||
135 | * | ||
109 | * @NL80211_CMD_MAX: highest used command number | 136 | * @NL80211_CMD_MAX: highest used command number |
110 | * @__NL80211_CMD_AFTER_LAST: internal use | 137 | * @__NL80211_CMD_AFTER_LAST: internal use |
111 | */ | 138 | */ |
@@ -148,6 +175,9 @@ enum nl80211_commands { | |||
148 | NL80211_CMD_SET_REG, | 175 | NL80211_CMD_SET_REG, |
149 | NL80211_CMD_REQ_SET_REG, | 176 | NL80211_CMD_REQ_SET_REG, |
150 | 177 | ||
178 | NL80211_CMD_GET_MESH_PARAMS, | ||
179 | NL80211_CMD_SET_MESH_PARAMS, | ||
180 | |||
151 | /* add new commands above here */ | 181 | /* add new commands above here */ |
152 | 182 | ||
153 | /* used to define NL80211_CMD_MAX below */ | 183 | /* used to define NL80211_CMD_MAX below */ |
@@ -169,6 +199,15 @@ enum nl80211_commands { | |||
169 | * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf. | 199 | * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf. |
170 | * /sys/class/ieee80211/<phyname>/index | 200 | * /sys/class/ieee80211/<phyname>/index |
171 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) | 201 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) |
202 | * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters | ||
203 | * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz | ||
204 | * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ | ||
205 | * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included): | ||
206 | * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including | ||
207 | * this attribute) | ||
208 | * NL80211_CHAN_HT20 = HT20 only | ||
209 | * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel | ||
210 | * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel | ||
172 | * | 211 | * |
173 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on | 212 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on |
174 | * @NL80211_ATTR_IFNAME: network interface name | 213 | * @NL80211_ATTR_IFNAME: network interface name |
@@ -234,6 +273,9 @@ enum nl80211_commands { | |||
234 | * (u8, 0 or 1) | 273 | * (u8, 0 or 1) |
235 | * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled | 274 | * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled |
236 | * (u8, 0 or 1) | 275 | * (u8, 0 or 1) |
276 | * @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic | ||
277 | * rates in format defined by IEEE 802.11 7.3.2.2 but without the length | ||
278 | * restriction (at most %NL80211_MAX_SUPP_RATES). | ||
237 | * | 279 | * |
238 | * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from | 280 | * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from |
239 | * association request when used with NL80211_CMD_NEW_STATION) | 281 | * association request when used with NL80211_CMD_NEW_STATION) |
@@ -296,6 +338,14 @@ enum nl80211_attrs { | |||
296 | NL80211_ATTR_REG_ALPHA2, | 338 | NL80211_ATTR_REG_ALPHA2, |
297 | NL80211_ATTR_REG_RULES, | 339 | NL80211_ATTR_REG_RULES, |
298 | 340 | ||
341 | NL80211_ATTR_MESH_PARAMS, | ||
342 | |||
343 | NL80211_ATTR_BSS_BASIC_RATES, | ||
344 | |||
345 | NL80211_ATTR_WIPHY_TXQ_PARAMS, | ||
346 | NL80211_ATTR_WIPHY_FREQ, | ||
347 | NL80211_ATTR_WIPHY_CHANNEL_TYPE, | ||
348 | |||
299 | /* add attributes here, update the policy in nl80211.c */ | 349 | /* add attributes here, update the policy in nl80211.c */ |
300 | 350 | ||
301 | __NL80211_ATTR_AFTER_LAST, | 351 | __NL80211_ATTR_AFTER_LAST, |
@@ -307,6 +357,10 @@ enum nl80211_attrs { | |||
307 | * here | 357 | * here |
308 | */ | 358 | */ |
309 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY | 359 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY |
360 | #define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES | ||
361 | #define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS | ||
362 | #define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ | ||
363 | #define NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET NL80211_ATTR_WIPHY_SEC_CHAN_OFFSET | ||
310 | 364 | ||
311 | #define NL80211_MAX_SUPP_RATES 32 | 365 | #define NL80211_MAX_SUPP_RATES 32 |
312 | #define NL80211_MAX_SUPP_REG_RULES 32 | 366 | #define NL80211_MAX_SUPP_REG_RULES 32 |
@@ -371,6 +425,32 @@ enum nl80211_sta_flags { | |||
371 | }; | 425 | }; |
372 | 426 | ||
373 | /** | 427 | /** |
428 | * enum nl80211_rate_info - bitrate information | ||
429 | * | ||
430 | * These attribute types are used with %NL80211_STA_INFO_TXRATE | ||
431 | * when getting information about the bitrate of a station. | ||
432 | * | ||
433 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved | ||
434 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) | ||
435 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) | ||
436 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate | ||
437 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval | ||
438 | * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined | ||
439 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use | ||
440 | */ | ||
441 | enum nl80211_rate_info { | ||
442 | __NL80211_RATE_INFO_INVALID, | ||
443 | NL80211_RATE_INFO_BITRATE, | ||
444 | NL80211_RATE_INFO_MCS, | ||
445 | NL80211_RATE_INFO_40_MHZ_WIDTH, | ||
446 | NL80211_RATE_INFO_SHORT_GI, | ||
447 | |||
448 | /* keep last */ | ||
449 | __NL80211_RATE_INFO_AFTER_LAST, | ||
450 | NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1 | ||
451 | }; | ||
452 | |||
453 | /** | ||
374 | * enum nl80211_sta_info - station information | 454 | * enum nl80211_sta_info - station information |
375 | * | 455 | * |
376 | * These attribute types are used with %NL80211_ATTR_STA_INFO | 456 | * These attribute types are used with %NL80211_ATTR_STA_INFO |
@@ -382,6 +462,9 @@ enum nl80211_sta_flags { | |||
382 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) | 462 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) |
383 | * @__NL80211_STA_INFO_AFTER_LAST: internal | 463 | * @__NL80211_STA_INFO_AFTER_LAST: internal |
384 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | 464 | * @NL80211_STA_INFO_MAX: highest possible station info attribute |
465 | * @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm) | ||
466 | * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute | ||
467 | * containing info as possible, see &enum nl80211_sta_info_txrate. | ||
385 | */ | 468 | */ |
386 | enum nl80211_sta_info { | 469 | enum nl80211_sta_info { |
387 | __NL80211_STA_INFO_INVALID, | 470 | __NL80211_STA_INFO_INVALID, |
@@ -391,6 +474,8 @@ enum nl80211_sta_info { | |||
391 | NL80211_STA_INFO_LLID, | 474 | NL80211_STA_INFO_LLID, |
392 | NL80211_STA_INFO_PLID, | 475 | NL80211_STA_INFO_PLID, |
393 | NL80211_STA_INFO_PLINK_STATE, | 476 | NL80211_STA_INFO_PLINK_STATE, |
477 | NL80211_STA_INFO_SIGNAL, | ||
478 | NL80211_STA_INFO_TX_BITRATE, | ||
394 | 479 | ||
395 | /* keep last */ | 480 | /* keep last */ |
396 | __NL80211_STA_INFO_AFTER_LAST, | 481 | __NL80211_STA_INFO_AFTER_LAST, |
@@ -452,17 +537,29 @@ enum nl80211_mpath_info { | |||
452 | * an array of nested frequency attributes | 537 | * an array of nested frequency attributes |
453 | * @NL80211_BAND_ATTR_RATES: supported bitrates in this band, | 538 | * @NL80211_BAND_ATTR_RATES: supported bitrates in this band, |
454 | * an array of nested bitrate attributes | 539 | * an array of nested bitrate attributes |
540 | * @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as | ||
541 | * defined in 802.11n | ||
542 | * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE | ||
543 | * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n | ||
544 | * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n | ||
455 | */ | 545 | */ |
456 | enum nl80211_band_attr { | 546 | enum nl80211_band_attr { |
457 | __NL80211_BAND_ATTR_INVALID, | 547 | __NL80211_BAND_ATTR_INVALID, |
458 | NL80211_BAND_ATTR_FREQS, | 548 | NL80211_BAND_ATTR_FREQS, |
459 | NL80211_BAND_ATTR_RATES, | 549 | NL80211_BAND_ATTR_RATES, |
460 | 550 | ||
551 | NL80211_BAND_ATTR_HT_MCS_SET, | ||
552 | NL80211_BAND_ATTR_HT_CAPA, | ||
553 | NL80211_BAND_ATTR_HT_AMPDU_FACTOR, | ||
554 | NL80211_BAND_ATTR_HT_AMPDU_DENSITY, | ||
555 | |||
461 | /* keep last */ | 556 | /* keep last */ |
462 | __NL80211_BAND_ATTR_AFTER_LAST, | 557 | __NL80211_BAND_ATTR_AFTER_LAST, |
463 | NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 | 558 | NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 |
464 | }; | 559 | }; |
465 | 560 | ||
561 | #define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA | ||
562 | |||
466 | /** | 563 | /** |
467 | * enum nl80211_frequency_attr - frequency attributes | 564 | * enum nl80211_frequency_attr - frequency attributes |
468 | * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz | 565 | * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz |
@@ -474,6 +571,8 @@ enum nl80211_band_attr { | |||
474 | * on this channel in current regulatory domain. | 571 | * on this channel in current regulatory domain. |
475 | * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory | 572 | * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory |
476 | * on this channel in current regulatory domain. | 573 | * on this channel in current regulatory domain. |
574 | * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm | ||
575 | * (100 * dBm). | ||
477 | */ | 576 | */ |
478 | enum nl80211_frequency_attr { | 577 | enum nl80211_frequency_attr { |
479 | __NL80211_FREQUENCY_ATTR_INVALID, | 578 | __NL80211_FREQUENCY_ATTR_INVALID, |
@@ -482,12 +581,15 @@ enum nl80211_frequency_attr { | |||
482 | NL80211_FREQUENCY_ATTR_PASSIVE_SCAN, | 581 | NL80211_FREQUENCY_ATTR_PASSIVE_SCAN, |
483 | NL80211_FREQUENCY_ATTR_NO_IBSS, | 582 | NL80211_FREQUENCY_ATTR_NO_IBSS, |
484 | NL80211_FREQUENCY_ATTR_RADAR, | 583 | NL80211_FREQUENCY_ATTR_RADAR, |
584 | NL80211_FREQUENCY_ATTR_MAX_TX_POWER, | ||
485 | 585 | ||
486 | /* keep last */ | 586 | /* keep last */ |
487 | __NL80211_FREQUENCY_ATTR_AFTER_LAST, | 587 | __NL80211_FREQUENCY_ATTR_AFTER_LAST, |
488 | NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1 | 588 | NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1 |
489 | }; | 589 | }; |
490 | 590 | ||
591 | #define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER | ||
592 | |||
491 | /** | 593 | /** |
492 | * enum nl80211_bitrate_attr - bitrate attributes | 594 | * enum nl80211_bitrate_attr - bitrate attributes |
493 | * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps | 595 | * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps |
@@ -594,4 +696,119 @@ enum nl80211_mntr_flags { | |||
594 | NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1 | 696 | NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1 |
595 | }; | 697 | }; |
596 | 698 | ||
699 | /** | ||
700 | * enum nl80211_meshconf_params - mesh configuration parameters | ||
701 | * | ||
702 | * Mesh configuration parameters | ||
703 | * | ||
704 | * @__NL80211_MESHCONF_INVALID: internal use | ||
705 | * | ||
706 | * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in | ||
707 | * millisecond units, used by the Peer Link Open message | ||
708 | * | ||
709 | * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the inital confirm timeout, in | ||
710 | * millisecond units, used by the peer link management to close a peer link | ||
711 | * | ||
712 | * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in | ||
713 | * millisecond units | ||
714 | * | ||
715 | * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed | ||
716 | * on this mesh interface | ||
717 | * | ||
718 | * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link | ||
719 | * open retries that can be sent to establish a new peer link instance in a | ||
720 | * mesh | ||
721 | * | ||
722 | * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh | ||
723 | * point. | ||
724 | * | ||
725 | * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically | ||
726 | * open peer links when we detect compatible mesh peers. | ||
727 | * | ||
728 | * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames | ||
729 | * containing a PREQ that an MP can send to a particular destination (path | ||
730 | * target) | ||
731 | * | ||
732 | * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths | ||
733 | * (in milliseconds) | ||
734 | * | ||
735 | * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait | ||
736 | * until giving up on a path discovery (in milliseconds) | ||
737 | * | ||
738 | * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh | ||
739 | * points receiving a PREQ shall consider the forwarding information from the | ||
740 | * root to be valid. (TU = time unit) | ||
741 | * | ||
742 | * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in | ||
743 | * TUs) during which an MP can send only one action frame containing a PREQ | ||
744 | * reference element | ||
745 | * | ||
746 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) | ||
747 | * that it takes for an HWMP information element to propagate across the mesh | ||
748 | * | ||
749 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute | ||
750 | * | ||
751 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | ||
752 | */ | ||
753 | enum nl80211_meshconf_params { | ||
754 | __NL80211_MESHCONF_INVALID, | ||
755 | NL80211_MESHCONF_RETRY_TIMEOUT, | ||
756 | NL80211_MESHCONF_CONFIRM_TIMEOUT, | ||
757 | NL80211_MESHCONF_HOLDING_TIMEOUT, | ||
758 | NL80211_MESHCONF_MAX_PEER_LINKS, | ||
759 | NL80211_MESHCONF_MAX_RETRIES, | ||
760 | NL80211_MESHCONF_TTL, | ||
761 | NL80211_MESHCONF_AUTO_OPEN_PLINKS, | ||
762 | NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES, | ||
763 | NL80211_MESHCONF_PATH_REFRESH_TIME, | ||
764 | NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT, | ||
765 | NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, | ||
766 | NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, | ||
767 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, | ||
768 | |||
769 | /* keep last */ | ||
770 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | ||
771 | NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1 | ||
772 | }; | ||
773 | |||
774 | /** | ||
775 | * enum nl80211_txq_attr - TX queue parameter attributes | ||
776 | * @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved | ||
777 | * @NL80211_TXQ_ATTR_QUEUE: TX queue identifier (NL80211_TXQ_Q_*) | ||
778 | * @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning | ||
779 | * disabled | ||
780 | * @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form | ||
781 | * 2^n-1 in the range 1..32767] | ||
782 | * @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form | ||
783 | * 2^n-1 in the range 1..32767] | ||
784 | * @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255] | ||
785 | * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal | ||
786 | * @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number | ||
787 | */ | ||
788 | enum nl80211_txq_attr { | ||
789 | __NL80211_TXQ_ATTR_INVALID, | ||
790 | NL80211_TXQ_ATTR_QUEUE, | ||
791 | NL80211_TXQ_ATTR_TXOP, | ||
792 | NL80211_TXQ_ATTR_CWMIN, | ||
793 | NL80211_TXQ_ATTR_CWMAX, | ||
794 | NL80211_TXQ_ATTR_AIFS, | ||
795 | |||
796 | /* keep last */ | ||
797 | __NL80211_TXQ_ATTR_AFTER_LAST, | ||
798 | NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1 | ||
799 | }; | ||
800 | |||
801 | enum nl80211_txq_q { | ||
802 | NL80211_TXQ_Q_VO, | ||
803 | NL80211_TXQ_Q_VI, | ||
804 | NL80211_TXQ_Q_BE, | ||
805 | NL80211_TXQ_Q_BK | ||
806 | }; | ||
807 | |||
808 | enum nl80211_channel_type { | ||
809 | NL80211_CHAN_NO_HT, | ||
810 | NL80211_CHAN_HT20, | ||
811 | NL80211_CHAN_HT40MINUS, | ||
812 | NL80211_CHAN_HT40PLUS | ||
813 | }; | ||
597 | #endif /* __LINUX_NL80211_H */ | 814 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index c8a768e59640..afad7dec1b36 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -27,7 +27,6 @@ struct nsproxy { | |||
27 | struct ipc_namespace *ipc_ns; | 27 | struct ipc_namespace *ipc_ns; |
28 | struct mnt_namespace *mnt_ns; | 28 | struct mnt_namespace *mnt_ns; |
29 | struct pid_namespace *pid_ns; | 29 | struct pid_namespace *pid_ns; |
30 | struct user_namespace *user_ns; | ||
31 | struct net *net_ns; | 30 | struct net *net_ns; |
32 | }; | 31 | }; |
33 | extern struct nsproxy init_nsproxy; | 32 | extern struct nsproxy init_nsproxy; |
diff --git a/include/linux/of.h b/include/linux/of.h index e2488f5e7cb2..6a7efa242f5e 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -57,6 +57,12 @@ extern struct device_node *of_get_next_child(const struct device_node *node, | |||
57 | for (child = of_get_next_child(parent, NULL); child != NULL; \ | 57 | for (child = of_get_next_child(parent, NULL); child != NULL; \ |
58 | child = of_get_next_child(parent, child)) | 58 | child = of_get_next_child(parent, child)) |
59 | 59 | ||
60 | extern struct device_node *of_find_node_with_property( | ||
61 | struct device_node *from, const char *prop_name); | ||
62 | #define for_each_node_with_property(dn, prop_name) \ | ||
63 | for (dn = of_find_node_with_property(NULL, prop_name); dn; \ | ||
64 | dn = of_find_node_with_property(dn, prop_name)) | ||
65 | |||
60 | extern struct property *of_find_property(const struct device_node *np, | 66 | extern struct property *of_find_property(const struct device_node *np, |
61 | const char *name, | 67 | const char *name, |
62 | int *lenp); | 68 | int *lenp); |
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index 67db101d0eb8..fc2472c3c254 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
@@ -14,9 +14,22 @@ | |||
14 | #ifndef __LINUX_OF_GPIO_H | 14 | #ifndef __LINUX_OF_GPIO_H |
15 | #define __LINUX_OF_GPIO_H | 15 | #define __LINUX_OF_GPIO_H |
16 | 16 | ||
17 | #include <linux/compiler.h> | ||
18 | #include <linux/kernel.h> | ||
17 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
18 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
19 | 21 | ||
22 | struct device_node; | ||
23 | |||
24 | /* | ||
25 | * This is Linux-specific flags. By default controllers' and Linux' mapping | ||
26 | * match, but GPIO controllers are free to translate their own flags to | ||
27 | * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended. | ||
28 | */ | ||
29 | enum of_gpio_flags { | ||
30 | OF_GPIO_ACTIVE_LOW = 0x1, | ||
31 | }; | ||
32 | |||
20 | #ifdef CONFIG_OF_GPIO | 33 | #ifdef CONFIG_OF_GPIO |
21 | 34 | ||
22 | /* | 35 | /* |
@@ -26,7 +39,7 @@ struct of_gpio_chip { | |||
26 | struct gpio_chip gc; | 39 | struct gpio_chip gc; |
27 | int gpio_cells; | 40 | int gpio_cells; |
28 | int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np, | 41 | int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np, |
29 | const void *gpio_spec); | 42 | const void *gpio_spec, enum of_gpio_flags *flags); |
30 | }; | 43 | }; |
31 | 44 | ||
32 | static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc) | 45 | static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc) |
@@ -50,20 +63,43 @@ static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) | |||
50 | return container_of(of_gc, struct of_mm_gpio_chip, of_gc); | 63 | return container_of(of_gc, struct of_mm_gpio_chip, of_gc); |
51 | } | 64 | } |
52 | 65 | ||
53 | extern int of_get_gpio(struct device_node *np, int index); | 66 | extern int of_get_gpio_flags(struct device_node *np, int index, |
67 | enum of_gpio_flags *flags); | ||
68 | extern unsigned int of_gpio_count(struct device_node *np); | ||
69 | |||
54 | extern int of_mm_gpiochip_add(struct device_node *np, | 70 | extern int of_mm_gpiochip_add(struct device_node *np, |
55 | struct of_mm_gpio_chip *mm_gc); | 71 | struct of_mm_gpio_chip *mm_gc); |
56 | extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc, | 72 | extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc, |
57 | struct device_node *np, | 73 | struct device_node *np, |
58 | const void *gpio_spec); | 74 | const void *gpio_spec, |
75 | enum of_gpio_flags *flags); | ||
59 | #else | 76 | #else |
60 | 77 | ||
61 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ | 78 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ |
62 | static inline int of_get_gpio(struct device_node *np, int index) | 79 | static inline int of_get_gpio_flags(struct device_node *np, int index, |
80 | enum of_gpio_flags *flags) | ||
63 | { | 81 | { |
64 | return -ENOSYS; | 82 | return -ENOSYS; |
65 | } | 83 | } |
66 | 84 | ||
85 | static inline unsigned int of_gpio_count(struct device_node *np) | ||
86 | { | ||
87 | return 0; | ||
88 | } | ||
89 | |||
67 | #endif /* CONFIG_OF_GPIO */ | 90 | #endif /* CONFIG_OF_GPIO */ |
68 | 91 | ||
92 | /** | ||
93 | * of_get_gpio - Get a GPIO number to use with GPIO API | ||
94 | * @np: device node to get GPIO from | ||
95 | * @index: index of the GPIO | ||
96 | * | ||
97 | * Returns GPIO number to use with Linux generic GPIO API, or one of the errno | ||
98 | * value on the error condition. | ||
99 | */ | ||
100 | static inline int of_get_gpio(struct device_node *np, int index) | ||
101 | { | ||
102 | return of_get_gpio_flags(np, index, NULL); | ||
103 | } | ||
104 | |||
69 | #endif /* __LINUX_OF_GPIO_H */ | 105 | #endif /* __LINUX_OF_GPIO_H */ |
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index a8efcfeea732..3d327b67d7e2 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
@@ -26,8 +26,7 @@ extern struct bus_type of_platform_bus_type; | |||
26 | 26 | ||
27 | /* | 27 | /* |
28 | * An of_platform_driver driver is attached to a basic of_device on | 28 | * An of_platform_driver driver is attached to a basic of_device on |
29 | * the "platform bus" (of_platform_bus_type) (or ISA, EBUS and SBUS | 29 | * the "platform bus" (of_platform_bus_type). |
30 | * busses on sparc). | ||
31 | */ | 30 | */ |
32 | struct of_platform_driver | 31 | struct of_platform_driver |
33 | { | 32 | { |
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h index 5231861f357d..1ce9fe572e51 100644 --- a/include/linux/oprofile.h +++ b/include/linux/oprofile.h | |||
@@ -86,8 +86,7 @@ int oprofile_arch_init(struct oprofile_operations * ops); | |||
86 | void oprofile_arch_exit(void); | 86 | void oprofile_arch_exit(void); |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * Add a sample. This may be called from any context. Pass | 89 | * Add a sample. This may be called from any context. |
90 | * smp_processor_id() as cpu. | ||
91 | */ | 90 | */ |
92 | void oprofile_add_sample(struct pt_regs * const regs, unsigned long event); | 91 | void oprofile_add_sample(struct pt_regs * const regs, unsigned long event); |
93 | 92 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index feb4657bb043..03b0b8c3c81b 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -134,6 +134,11 @@ enum pci_dev_flags { | |||
134 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, | 134 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, |
135 | }; | 135 | }; |
136 | 136 | ||
137 | enum pci_irq_reroute_variant { | ||
138 | INTEL_IRQ_REROUTE_VARIANT = 1, | ||
139 | MAX_IRQ_REROUTE_VARIANTS = 3 | ||
140 | }; | ||
141 | |||
137 | typedef unsigned short __bitwise pci_bus_flags_t; | 142 | typedef unsigned short __bitwise pci_bus_flags_t; |
138 | enum pci_bus_flags { | 143 | enum pci_bus_flags { |
139 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, | 144 | PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, |
@@ -218,6 +223,7 @@ struct pci_dev { | |||
218 | unsigned int no_msi:1; /* device may not use msi */ | 223 | unsigned int no_msi:1; /* device may not use msi */ |
219 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ | 224 | unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ |
220 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | 225 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ |
226 | unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ | ||
221 | unsigned int msi_enabled:1; | 227 | unsigned int msi_enabled:1; |
222 | unsigned int msix_enabled:1; | 228 | unsigned int msix_enabled:1; |
223 | unsigned int ari_enabled:1; /* ARI forwarding */ | 229 | unsigned int ari_enabled:1; /* ARI forwarding */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 1800f1d6e40d..b6e694454280 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2304,6 +2304,10 @@ | |||
2304 | #define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 | 2304 | #define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 |
2305 | #define PCI_DEVICE_ID_INTEL_PXH_1 0x032A | 2305 | #define PCI_DEVICE_ID_INTEL_PXH_1 0x032A |
2306 | #define PCI_DEVICE_ID_INTEL_PXHV 0x032C | 2306 | #define PCI_DEVICE_ID_INTEL_PXHV 0x032C |
2307 | #define PCI_DEVICE_ID_INTEL_80332_0 0x0330 | ||
2308 | #define PCI_DEVICE_ID_INTEL_80332_1 0x0332 | ||
2309 | #define PCI_DEVICE_ID_INTEL_80333_0 0x0370 | ||
2310 | #define PCI_DEVICE_ID_INTEL_80333_1 0x0372 | ||
2307 | #define PCI_DEVICE_ID_INTEL_82375 0x0482 | 2311 | #define PCI_DEVICE_ID_INTEL_82375 0x0482 |
2308 | #define PCI_DEVICE_ID_INTEL_82424 0x0483 | 2312 | #define PCI_DEVICE_ID_INTEL_82424 0x0483 |
2309 | #define PCI_DEVICE_ID_INTEL_82378 0x0484 | 2313 | #define PCI_DEVICE_ID_INTEL_82378 0x0484 |
@@ -2376,6 +2380,7 @@ | |||
2376 | #define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4 | 2380 | #define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4 |
2377 | #define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6 | 2381 | #define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6 |
2378 | #define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab | 2382 | #define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab |
2383 | #define PCI_DEVICE_ID_INTEL_ESB_10 0x25ac | ||
2379 | #define PCI_DEVICE_ID_INTEL_82820_HB 0x2500 | 2384 | #define PCI_DEVICE_ID_INTEL_82820_HB 0x2500 |
2380 | #define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501 | 2385 | #define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501 |
2381 | #define PCI_DEVICE_ID_INTEL_82850_HB 0x2530 | 2386 | #define PCI_DEVICE_ID_INTEL_82850_HB 0x2530 |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 77c4ed60b982..d7e54d98869f 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -467,6 +467,8 @@ int genphy_restart_aneg(struct phy_device *phydev); | |||
467 | int genphy_config_aneg(struct phy_device *phydev); | 467 | int genphy_config_aneg(struct phy_device *phydev); |
468 | int genphy_update_link(struct phy_device *phydev); | 468 | int genphy_update_link(struct phy_device *phydev); |
469 | int genphy_read_status(struct phy_device *phydev); | 469 | int genphy_read_status(struct phy_device *phydev); |
470 | int genphy_suspend(struct phy_device *phydev); | ||
471 | int genphy_resume(struct phy_device *phydev); | ||
470 | void phy_driver_unregister(struct phy_driver *drv); | 472 | void phy_driver_unregister(struct phy_driver *drv); |
471 | int phy_driver_register(struct phy_driver *new_driver); | 473 | int phy_driver_register(struct phy_driver *new_driver); |
472 | void phy_prepare_link(struct phy_device *phydev, | 474 | void phy_prepare_link(struct phy_device *phydev, |
diff --git a/include/linux/pid.h b/include/linux/pid.h index d7e98ff8021e..bb206c56d1f0 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -147,9 +147,9 @@ pid_t pid_vnr(struct pid *pid); | |||
147 | #define do_each_pid_task(pid, type, task) \ | 147 | #define do_each_pid_task(pid, type, task) \ |
148 | do { \ | 148 | do { \ |
149 | struct hlist_node *pos___; \ | 149 | struct hlist_node *pos___; \ |
150 | if (pid != NULL) \ | 150 | if ((pid) != NULL) \ |
151 | hlist_for_each_entry_rcu((task), pos___, \ | 151 | hlist_for_each_entry_rcu((task), pos___, \ |
152 | &pid->tasks[type], pids[type].node) { | 152 | &(pid)->tasks[type], pids[type].node) { |
153 | 153 | ||
154 | /* | 154 | /* |
155 | * Both old and new leaders may be attached to | 155 | * Both old and new leaders may be attached to |
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 7cf7824df778..e6aa8482ad7a 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h | |||
@@ -394,6 +394,20 @@ enum | |||
394 | 394 | ||
395 | #define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1) | 395 | #define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1) |
396 | 396 | ||
397 | |||
398 | /* Cgroup classifier */ | ||
399 | |||
400 | enum | ||
401 | { | ||
402 | TCA_CGROUP_UNSPEC, | ||
403 | TCA_CGROUP_ACT, | ||
404 | TCA_CGROUP_POLICE, | ||
405 | TCA_CGROUP_EMATCHES, | ||
406 | __TCA_CGROUP_MAX, | ||
407 | }; | ||
408 | |||
409 | #define TCA_CGROUP_MAX (__TCA_CGROUP_MAX - 1) | ||
410 | |||
397 | /* Extended Matches */ | 411 | /* Extended Matches */ |
398 | 412 | ||
399 | struct tcf_ematch_tree_hdr | 413 | struct tcf_ematch_tree_hdr |
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 5d921fa91a5b..e3f133adba78 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -500,4 +500,20 @@ struct tc_netem_corrupt | |||
500 | 500 | ||
501 | #define NETEM_DIST_SCALE 8192 | 501 | #define NETEM_DIST_SCALE 8192 |
502 | 502 | ||
503 | /* DRR */ | ||
504 | |||
505 | enum | ||
506 | { | ||
507 | TCA_DRR_UNSPEC, | ||
508 | TCA_DRR_QUANTUM, | ||
509 | __TCA_DRR_MAX | ||
510 | }; | ||
511 | |||
512 | #define TCA_DRR_MAX (__TCA_DRR_MAX - 1) | ||
513 | |||
514 | struct tc_drr_stats | ||
515 | { | ||
516 | u32 deficit; | ||
517 | }; | ||
518 | |||
503 | #endif | 519 | #endif |
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index a7c721355549..4f71bf4e628c 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
@@ -45,7 +45,11 @@ struct k_itimer { | |||
45 | int it_requeue_pending; /* waiting to requeue this timer */ | 45 | int it_requeue_pending; /* waiting to requeue this timer */ |
46 | #define REQUEUE_PENDING 1 | 46 | #define REQUEUE_PENDING 1 |
47 | int it_sigev_notify; /* notify word of sigevent struct */ | 47 | int it_sigev_notify; /* notify word of sigevent struct */ |
48 | struct task_struct *it_process; /* process to send signal to */ | 48 | struct signal_struct *it_signal; |
49 | union { | ||
50 | struct pid *it_pid; /* pid of process to send signal to */ | ||
51 | struct task_struct *it_process; /* for clock_nanosleep */ | ||
52 | }; | ||
49 | struct sigqueue *sigq; /* signal queue entry. */ | 53 | struct sigqueue *sigq; /* signal queue entry. */ |
50 | union { | 54 | union { |
51 | struct { | 55 | struct { |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 22641d5d45df..98b93ca4db06 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -94,6 +94,7 @@ extern void ptrace_notify(int exit_code); | |||
94 | extern void __ptrace_link(struct task_struct *child, | 94 | extern void __ptrace_link(struct task_struct *child, |
95 | struct task_struct *new_parent); | 95 | struct task_struct *new_parent); |
96 | extern void __ptrace_unlink(struct task_struct *child); | 96 | extern void __ptrace_unlink(struct task_struct *child); |
97 | extern void ptrace_fork(struct task_struct *task, unsigned long clone_flags); | ||
97 | #define PTRACE_MODE_READ 1 | 98 | #define PTRACE_MODE_READ 1 |
98 | #define PTRACE_MODE_ATTACH 2 | 99 | #define PTRACE_MODE_ATTACH 2 |
99 | /* Returns 0 on success, -errno on denial. */ | 100 | /* Returns 0 on success, -errno on denial. */ |
@@ -313,6 +314,27 @@ static inline void user_enable_block_step(struct task_struct *task) | |||
313 | #define arch_ptrace_stop(code, info) do { } while (0) | 314 | #define arch_ptrace_stop(code, info) do { } while (0) |
314 | #endif | 315 | #endif |
315 | 316 | ||
317 | #ifndef arch_ptrace_untrace | ||
318 | /* | ||
319 | * Do machine-specific work before untracing child. | ||
320 | * | ||
321 | * This is called for a normal detach as well as from ptrace_exit() | ||
322 | * when the tracing task dies. | ||
323 | * | ||
324 | * Called with write_lock(&tasklist_lock) held. | ||
325 | */ | ||
326 | #define arch_ptrace_untrace(task) do { } while (0) | ||
327 | #endif | ||
328 | |||
329 | #ifndef arch_ptrace_fork | ||
330 | /* | ||
331 | * Do machine-specific work to initialize a new task. | ||
332 | * | ||
333 | * This is called from copy_process(). | ||
334 | */ | ||
335 | #define arch_ptrace_fork(child, clone_flags) do { } while (0) | ||
336 | #endif | ||
337 | |||
316 | extern int task_current_syscall(struct task_struct *target, long *callno, | 338 | extern int task_current_syscall(struct task_struct *target, long *callno, |
317 | unsigned long args[6], unsigned int maxargs, | 339 | unsigned long args[6], unsigned int maxargs, |
318 | unsigned long *sp, unsigned long *pc); | 340 | unsigned long *sp, unsigned long *pc); |
diff --git a/include/linux/random.h b/include/linux/random.h index 36f125c0c603..adbf3bd3c6b3 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #define _LINUX_RANDOM_H | 8 | #define _LINUX_RANDOM_H |
9 | 9 | ||
10 | #include <linux/ioctl.h> | 10 | #include <linux/ioctl.h> |
11 | #include <linux/irqnr.h> | ||
11 | 12 | ||
12 | /* ioctl()'s for the random number generator */ | 13 | /* ioctl()'s for the random number generator */ |
13 | 14 | ||
@@ -44,6 +45,56 @@ struct rand_pool_info { | |||
44 | 45 | ||
45 | extern void rand_initialize_irq(int irq); | 46 | extern void rand_initialize_irq(int irq); |
46 | 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 | |||
47 | extern void add_input_randomness(unsigned int type, unsigned int code, | 98 | extern void add_input_randomness(unsigned int type, unsigned int code, |
48 | unsigned int value); | 99 | unsigned int value); |
49 | extern void add_interrupt_randomness(int irq); | 100 | extern void add_interrupt_randomness(int irq); |
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h index 5f89b62e6983..301dda829e37 100644 --- a/include/linux/rcuclassic.h +++ b/include/linux/rcuclassic.h | |||
@@ -41,7 +41,7 @@ | |||
41 | #include <linux/seqlock.h> | 41 | #include <linux/seqlock.h> |
42 | 42 | ||
43 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | 43 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR |
44 | #define RCU_SECONDS_TILL_STALL_CHECK ( 3 * HZ) /* for rcp->jiffies_stall */ | 44 | #define RCU_SECONDS_TILL_STALL_CHECK (10 * HZ) /* for rcp->jiffies_stall */ |
45 | #define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ) /* for rcp->jiffies_stall */ | 45 | #define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ) /* for rcp->jiffies_stall */ |
46 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | 46 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ |
47 | 47 | ||
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h new file mode 100644 index 000000000000..f9ddd03961a8 --- /dev/null +++ b/include/linux/rculist_nulls.h | |||
@@ -0,0 +1,110 @@ | |||
1 | #ifndef _LINUX_RCULIST_NULLS_H | ||
2 | #define _LINUX_RCULIST_NULLS_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | /* | ||
7 | * RCU-protected list version | ||
8 | */ | ||
9 | #include <linux/list_nulls.h> | ||
10 | #include <linux/rcupdate.h> | ||
11 | |||
12 | /** | ||
13 | * hlist_nulls_del_init_rcu - deletes entry from hash list with re-initialization | ||
14 | * @n: the element to delete from the hash list. | ||
15 | * | ||
16 | * Note: hlist_nulls_unhashed() on the node return true after this. It is | ||
17 | * useful for RCU based read lockfree traversal if the writer side | ||
18 | * must know if the list entry is still hashed or already unhashed. | ||
19 | * | ||
20 | * In particular, it means that we can not poison the forward pointers | ||
21 | * that may still be used for walking the hash list and we can only | ||
22 | * zero the pprev pointer so list_unhashed() will return true after | ||
23 | * this. | ||
24 | * | ||
25 | * The caller must take whatever precautions are necessary (such as | ||
26 | * holding appropriate locks) to avoid racing with another | ||
27 | * list-mutation primitive, such as hlist_nulls_add_head_rcu() or | ||
28 | * hlist_nulls_del_rcu(), running on this same list. However, it is | ||
29 | * perfectly legal to run concurrently with the _rcu list-traversal | ||
30 | * primitives, such as hlist_nulls_for_each_entry_rcu(). | ||
31 | */ | ||
32 | static inline void hlist_nulls_del_init_rcu(struct hlist_nulls_node *n) | ||
33 | { | ||
34 | if (!hlist_nulls_unhashed(n)) { | ||
35 | __hlist_nulls_del(n); | ||
36 | n->pprev = NULL; | ||
37 | } | ||
38 | } | ||
39 | |||
40 | /** | ||
41 | * hlist_nulls_del_rcu - deletes entry from hash list without re-initialization | ||
42 | * @n: the element to delete from the hash list. | ||
43 | * | ||
44 | * Note: hlist_nulls_unhashed() on entry does not return true after this, | ||
45 | * the entry is in an undefined state. It is useful for RCU based | ||
46 | * lockfree traversal. | ||
47 | * | ||
48 | * In particular, it means that we can not poison the forward | ||
49 | * pointers that may still be used for walking the hash list. | ||
50 | * | ||
51 | * The caller must take whatever precautions are necessary | ||
52 | * (such as holding appropriate locks) to avoid racing | ||
53 | * with another list-mutation primitive, such as hlist_nulls_add_head_rcu() | ||
54 | * or hlist_nulls_del_rcu(), running on this same list. | ||
55 | * However, it is perfectly legal to run concurrently with | ||
56 | * the _rcu list-traversal primitives, such as | ||
57 | * hlist_nulls_for_each_entry(). | ||
58 | */ | ||
59 | static inline void hlist_nulls_del_rcu(struct hlist_nulls_node *n) | ||
60 | { | ||
61 | __hlist_nulls_del(n); | ||
62 | n->pprev = LIST_POISON2; | ||
63 | } | ||
64 | |||
65 | /** | ||
66 | * hlist_nulls_add_head_rcu | ||
67 | * @n: the element to add to the hash list. | ||
68 | * @h: the list to add to. | ||
69 | * | ||
70 | * Description: | ||
71 | * Adds the specified element to the specified hlist_nulls, | ||
72 | * while permitting racing traversals. | ||
73 | * | ||
74 | * The caller must take whatever precautions are necessary | ||
75 | * (such as holding appropriate locks) to avoid racing | ||
76 | * with another list-mutation primitive, such as hlist_nulls_add_head_rcu() | ||
77 | * or hlist_nulls_del_rcu(), running on this same list. | ||
78 | * However, it is perfectly legal to run concurrently with | ||
79 | * the _rcu list-traversal primitives, such as | ||
80 | * hlist_nulls_for_each_entry_rcu(), used to prevent memory-consistency | ||
81 | * problems on Alpha CPUs. Regardless of the type of CPU, the | ||
82 | * list-traversal primitive must be guarded by rcu_read_lock(). | ||
83 | */ | ||
84 | static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, | ||
85 | struct hlist_nulls_head *h) | ||
86 | { | ||
87 | struct hlist_nulls_node *first = h->first; | ||
88 | |||
89 | n->next = first; | ||
90 | n->pprev = &h->first; | ||
91 | rcu_assign_pointer(h->first, n); | ||
92 | if (!is_a_nulls(first)) | ||
93 | first->pprev = &n->next; | ||
94 | } | ||
95 | /** | ||
96 | * hlist_nulls_for_each_entry_rcu - iterate over rcu list of given type | ||
97 | * @tpos: the type * to use as a loop cursor. | ||
98 | * @pos: the &struct hlist_nulls_node to use as a loop cursor. | ||
99 | * @head: the head for your list. | ||
100 | * @member: the name of the hlist_nulls_node within the struct. | ||
101 | * | ||
102 | */ | ||
103 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ | ||
104 | for (pos = rcu_dereference((head)->first); \ | ||
105 | (!is_a_nulls(pos)) && \ | ||
106 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ | ||
107 | pos = rcu_dereference(pos->next)) | ||
108 | |||
109 | #endif | ||
110 | #endif | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 86f1f5e43e33..1168fbcea8d4 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -52,11 +52,15 @@ struct rcu_head { | |||
52 | void (*func)(struct rcu_head *head); | 52 | void (*func)(struct rcu_head *head); |
53 | }; | 53 | }; |
54 | 54 | ||
55 | #ifdef CONFIG_CLASSIC_RCU | 55 | #if defined(CONFIG_CLASSIC_RCU) |
56 | #include <linux/rcuclassic.h> | 56 | #include <linux/rcuclassic.h> |
57 | #else /* #ifdef CONFIG_CLASSIC_RCU */ | 57 | #elif defined(CONFIG_TREE_RCU) |
58 | #include <linux/rcutree.h> | ||
59 | #elif defined(CONFIG_PREEMPT_RCU) | ||
58 | #include <linux/rcupreempt.h> | 60 | #include <linux/rcupreempt.h> |
59 | #endif /* #else #ifdef CONFIG_CLASSIC_RCU */ | 61 | #else |
62 | #error "Unknown RCU implementation specified to kernel configuration" | ||
63 | #endif /* #else #if defined(CONFIG_CLASSIC_RCU) */ | ||
60 | 64 | ||
61 | #define RCU_HEAD_INIT { .next = NULL, .func = NULL } | 65 | #define RCU_HEAD_INIT { .next = NULL, .func = NULL } |
62 | #define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT | 66 | #define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT |
@@ -142,6 +146,7 @@ struct rcu_head { | |||
142 | * on the write-side to insure proper synchronization. | 146 | * on the write-side to insure proper synchronization. |
143 | */ | 147 | */ |
144 | #define rcu_read_lock_sched() preempt_disable() | 148 | #define rcu_read_lock_sched() preempt_disable() |
149 | #define rcu_read_lock_sched_notrace() preempt_disable_notrace() | ||
145 | 150 | ||
146 | /* | 151 | /* |
147 | * rcu_read_unlock_sched - marks the end of a RCU-classic critical section | 152 | * rcu_read_unlock_sched - marks the end of a RCU-classic critical section |
@@ -149,6 +154,7 @@ struct rcu_head { | |||
149 | * See rcu_read_lock_sched for more information. | 154 | * See rcu_read_lock_sched for more information. |
150 | */ | 155 | */ |
151 | #define rcu_read_unlock_sched() preempt_enable() | 156 | #define rcu_read_unlock_sched() preempt_enable() |
157 | #define rcu_read_unlock_sched_notrace() preempt_enable_notrace() | ||
152 | 158 | ||
153 | 159 | ||
154 | 160 | ||
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h new file mode 100644 index 000000000000..d4368b7975c3 --- /dev/null +++ b/include/linux/rcutree.h | |||
@@ -0,0 +1,329 @@ | |||
1 | /* | ||
2 | * Read-Copy Update mechanism for mutual exclusion (tree-based version) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
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 | * Copyright IBM Corporation, 2008 | ||
19 | * | ||
20 | * Author: Dipankar Sarma <dipankar@in.ibm.com> | ||
21 | * Paul E. McKenney <paulmck@linux.vnet.ibm.com> Hierarchical algorithm | ||
22 | * | ||
23 | * Based on the original work by Paul McKenney <paulmck@us.ibm.com> | ||
24 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. | ||
25 | * | ||
26 | * For detailed explanation of Read-Copy Update mechanism see - | ||
27 | * Documentation/RCU | ||
28 | */ | ||
29 | |||
30 | #ifndef __LINUX_RCUTREE_H | ||
31 | #define __LINUX_RCUTREE_H | ||
32 | |||
33 | #include <linux/cache.h> | ||
34 | #include <linux/spinlock.h> | ||
35 | #include <linux/threads.h> | ||
36 | #include <linux/percpu.h> | ||
37 | #include <linux/cpumask.h> | ||
38 | #include <linux/seqlock.h> | ||
39 | |||
40 | /* | ||
41 | * Define shape of hierarchy based on NR_CPUS and CONFIG_RCU_FANOUT. | ||
42 | * In theory, it should be possible to add more levels straightforwardly. | ||
43 | * In practice, this has not been tested, so there is probably some | ||
44 | * bug somewhere. | ||
45 | */ | ||
46 | #define MAX_RCU_LVLS 3 | ||
47 | #define RCU_FANOUT (CONFIG_RCU_FANOUT) | ||
48 | #define RCU_FANOUT_SQ (RCU_FANOUT * RCU_FANOUT) | ||
49 | #define RCU_FANOUT_CUBE (RCU_FANOUT_SQ * RCU_FANOUT) | ||
50 | |||
51 | #if NR_CPUS <= RCU_FANOUT | ||
52 | # define NUM_RCU_LVLS 1 | ||
53 | # define NUM_RCU_LVL_0 1 | ||
54 | # define NUM_RCU_LVL_1 (NR_CPUS) | ||
55 | # define NUM_RCU_LVL_2 0 | ||
56 | # define NUM_RCU_LVL_3 0 | ||
57 | #elif NR_CPUS <= RCU_FANOUT_SQ | ||
58 | # define NUM_RCU_LVLS 2 | ||
59 | # define NUM_RCU_LVL_0 1 | ||
60 | # define NUM_RCU_LVL_1 (((NR_CPUS) + RCU_FANOUT - 1) / RCU_FANOUT) | ||
61 | # define NUM_RCU_LVL_2 (NR_CPUS) | ||
62 | # define NUM_RCU_LVL_3 0 | ||
63 | #elif NR_CPUS <= RCU_FANOUT_CUBE | ||
64 | # define NUM_RCU_LVLS 3 | ||
65 | # define NUM_RCU_LVL_0 1 | ||
66 | # define NUM_RCU_LVL_1 (((NR_CPUS) + RCU_FANOUT_SQ - 1) / RCU_FANOUT_SQ) | ||
67 | # define NUM_RCU_LVL_2 (((NR_CPUS) + (RCU_FANOUT) - 1) / (RCU_FANOUT)) | ||
68 | # define NUM_RCU_LVL_3 NR_CPUS | ||
69 | #else | ||
70 | # error "CONFIG_RCU_FANOUT insufficient for NR_CPUS" | ||
71 | #endif /* #if (NR_CPUS) <= RCU_FANOUT */ | ||
72 | |||
73 | #define RCU_SUM (NUM_RCU_LVL_0 + NUM_RCU_LVL_1 + NUM_RCU_LVL_2 + NUM_RCU_LVL_3) | ||
74 | #define NUM_RCU_NODES (RCU_SUM - NR_CPUS) | ||
75 | |||
76 | /* | ||
77 | * Dynticks per-CPU state. | ||
78 | */ | ||
79 | struct rcu_dynticks { | ||
80 | int dynticks_nesting; /* Track nesting level, sort of. */ | ||
81 | int dynticks; /* Even value for dynticks-idle, else odd. */ | ||
82 | int dynticks_nmi; /* Even value for either dynticks-idle or */ | ||
83 | /* not in nmi handler, else odd. So this */ | ||
84 | /* remains even for nmi from irq handler. */ | ||
85 | }; | ||
86 | |||
87 | /* | ||
88 | * Definition for node within the RCU grace-period-detection hierarchy. | ||
89 | */ | ||
90 | struct rcu_node { | ||
91 | spinlock_t lock; | ||
92 | unsigned long qsmask; /* CPUs or groups that need to switch in */ | ||
93 | /* order for current grace period to proceed.*/ | ||
94 | unsigned long qsmaskinit; | ||
95 | /* Per-GP initialization for qsmask. */ | ||
96 | unsigned long grpmask; /* Mask to apply to parent qsmask. */ | ||
97 | int grplo; /* lowest-numbered CPU or group here. */ | ||
98 | int grphi; /* highest-numbered CPU or group here. */ | ||
99 | u8 grpnum; /* CPU/group number for next level up. */ | ||
100 | u8 level; /* root is at level 0. */ | ||
101 | struct rcu_node *parent; | ||
102 | } ____cacheline_internodealigned_in_smp; | ||
103 | |||
104 | /* Index values for nxttail array in struct rcu_data. */ | ||
105 | #define RCU_DONE_TAIL 0 /* Also RCU_WAIT head. */ | ||
106 | #define RCU_WAIT_TAIL 1 /* Also RCU_NEXT_READY head. */ | ||
107 | #define RCU_NEXT_READY_TAIL 2 /* Also RCU_NEXT head. */ | ||
108 | #define RCU_NEXT_TAIL 3 | ||
109 | #define RCU_NEXT_SIZE 4 | ||
110 | |||
111 | /* Per-CPU data for read-copy update. */ | ||
112 | struct rcu_data { | ||
113 | /* 1) quiescent-state and grace-period handling : */ | ||
114 | long completed; /* Track rsp->completed gp number */ | ||
115 | /* in order to detect GP end. */ | ||
116 | long gpnum; /* Highest gp number that this CPU */ | ||
117 | /* is aware of having started. */ | ||
118 | long passed_quiesc_completed; | ||
119 | /* Value of completed at time of qs. */ | ||
120 | bool passed_quiesc; /* User-mode/idle loop etc. */ | ||
121 | bool qs_pending; /* Core waits for quiesc state. */ | ||
122 | bool beenonline; /* CPU online at least once. */ | ||
123 | struct rcu_node *mynode; /* This CPU's leaf of hierarchy */ | ||
124 | unsigned long grpmask; /* Mask to apply to leaf qsmask. */ | ||
125 | |||
126 | /* 2) batch handling */ | ||
127 | /* | ||
128 | * If nxtlist is not NULL, it is partitioned as follows. | ||
129 | * Any of the partitions might be empty, in which case the | ||
130 | * pointer to that partition will be equal to the pointer for | ||
131 | * the following partition. When the list is empty, all of | ||
132 | * the nxttail elements point to nxtlist, which is NULL. | ||
133 | * | ||
134 | * [*nxttail[RCU_NEXT_READY_TAIL], NULL = *nxttail[RCU_NEXT_TAIL]): | ||
135 | * Entries that might have arrived after current GP ended | ||
136 | * [*nxttail[RCU_WAIT_TAIL], *nxttail[RCU_NEXT_READY_TAIL]): | ||
137 | * Entries known to have arrived before current GP ended | ||
138 | * [*nxttail[RCU_DONE_TAIL], *nxttail[RCU_WAIT_TAIL]): | ||
139 | * Entries that batch # <= ->completed - 1: waiting for current GP | ||
140 | * [nxtlist, *nxttail[RCU_DONE_TAIL]): | ||
141 | * Entries that batch # <= ->completed | ||
142 | * The grace period for these entries has completed, and | ||
143 | * the other grace-period-completed entries may be moved | ||
144 | * here temporarily in rcu_process_callbacks(). | ||
145 | */ | ||
146 | struct rcu_head *nxtlist; | ||
147 | struct rcu_head **nxttail[RCU_NEXT_SIZE]; | ||
148 | long qlen; /* # of queued callbacks */ | ||
149 | long blimit; /* Upper limit on a processed batch */ | ||
150 | |||
151 | #ifdef CONFIG_NO_HZ | ||
152 | /* 3) dynticks interface. */ | ||
153 | struct rcu_dynticks *dynticks; /* Shared per-CPU dynticks state. */ | ||
154 | int dynticks_snap; /* Per-GP tracking for dynticks. */ | ||
155 | int dynticks_nmi_snap; /* Per-GP tracking for dynticks_nmi. */ | ||
156 | #endif /* #ifdef CONFIG_NO_HZ */ | ||
157 | |||
158 | /* 4) reasons this CPU needed to be kicked by force_quiescent_state */ | ||
159 | #ifdef CONFIG_NO_HZ | ||
160 | unsigned long dynticks_fqs; /* Kicked due to dynticks idle. */ | ||
161 | #endif /* #ifdef CONFIG_NO_HZ */ | ||
162 | unsigned long offline_fqs; /* Kicked due to being offline. */ | ||
163 | unsigned long resched_ipi; /* Sent a resched IPI. */ | ||
164 | |||
165 | /* 5) state to allow this CPU to force_quiescent_state on others */ | ||
166 | long n_rcu_pending; /* rcu_pending() calls since boot. */ | ||
167 | long n_rcu_pending_force_qs; /* when to force quiescent states. */ | ||
168 | |||
169 | int cpu; | ||
170 | }; | ||
171 | |||
172 | /* Values for signaled field in struct rcu_state. */ | ||
173 | #define RCU_GP_INIT 0 /* Grace period being initialized. */ | ||
174 | #define RCU_SAVE_DYNTICK 1 /* Need to scan dyntick state. */ | ||
175 | #define RCU_FORCE_QS 2 /* Need to force quiescent state. */ | ||
176 | #ifdef CONFIG_NO_HZ | ||
177 | #define RCU_SIGNAL_INIT RCU_SAVE_DYNTICK | ||
178 | #else /* #ifdef CONFIG_NO_HZ */ | ||
179 | #define RCU_SIGNAL_INIT RCU_FORCE_QS | ||
180 | #endif /* #else #ifdef CONFIG_NO_HZ */ | ||
181 | |||
182 | #define RCU_JIFFIES_TILL_FORCE_QS 3 /* for rsp->jiffies_force_qs */ | ||
183 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
184 | #define RCU_SECONDS_TILL_STALL_CHECK (10 * HZ) /* for rsp->jiffies_stall */ | ||
185 | #define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ) /* for rsp->jiffies_stall */ | ||
186 | #define RCU_STALL_RAT_DELAY 2 /* Allow other CPUs time */ | ||
187 | /* to take at least one */ | ||
188 | /* scheduling clock irq */ | ||
189 | /* before ratting on them. */ | ||
190 | |||
191 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
192 | |||
193 | /* | ||
194 | * RCU global state, including node hierarchy. This hierarchy is | ||
195 | * represented in "heap" form in a dense array. The root (first level) | ||
196 | * of the hierarchy is in ->node[0] (referenced by ->level[0]), the second | ||
197 | * level in ->node[1] through ->node[m] (->node[1] referenced by ->level[1]), | ||
198 | * and the third level in ->node[m+1] and following (->node[m+1] referenced | ||
199 | * by ->level[2]). The number of levels is determined by the number of | ||
200 | * CPUs and by CONFIG_RCU_FANOUT. Small systems will have a "hierarchy" | ||
201 | * consisting of a single rcu_node. | ||
202 | */ | ||
203 | struct rcu_state { | ||
204 | struct rcu_node node[NUM_RCU_NODES]; /* Hierarchy. */ | ||
205 | struct rcu_node *level[NUM_RCU_LVLS]; /* Hierarchy levels. */ | ||
206 | u32 levelcnt[MAX_RCU_LVLS + 1]; /* # nodes in each level. */ | ||
207 | u8 levelspread[NUM_RCU_LVLS]; /* kids/node in each level. */ | ||
208 | struct rcu_data *rda[NR_CPUS]; /* array of rdp pointers. */ | ||
209 | |||
210 | /* The following fields are guarded by the root rcu_node's lock. */ | ||
211 | |||
212 | u8 signaled ____cacheline_internodealigned_in_smp; | ||
213 | /* Force QS state. */ | ||
214 | long gpnum; /* Current gp number. */ | ||
215 | long completed; /* # of last completed gp. */ | ||
216 | spinlock_t onofflock; /* exclude on/offline and */ | ||
217 | /* starting new GP. */ | ||
218 | spinlock_t fqslock; /* Only one task forcing */ | ||
219 | /* quiescent states. */ | ||
220 | unsigned long jiffies_force_qs; /* Time at which to invoke */ | ||
221 | /* force_quiescent_state(). */ | ||
222 | unsigned long n_force_qs; /* Number of calls to */ | ||
223 | /* force_quiescent_state(). */ | ||
224 | unsigned long n_force_qs_lh; /* ~Number of calls leaving */ | ||
225 | /* due to lock unavailable. */ | ||
226 | unsigned long n_force_qs_ngp; /* Number of calls leaving */ | ||
227 | /* due to no GP active. */ | ||
228 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
229 | unsigned long gp_start; /* Time at which GP started, */ | ||
230 | /* but in jiffies. */ | ||
231 | unsigned long jiffies_stall; /* Time at which to check */ | ||
232 | /* for CPU stalls. */ | ||
233 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
234 | #ifdef CONFIG_NO_HZ | ||
235 | long dynticks_completed; /* Value of completed @ snap. */ | ||
236 | #endif /* #ifdef CONFIG_NO_HZ */ | ||
237 | }; | ||
238 | |||
239 | extern struct rcu_state rcu_state; | ||
240 | DECLARE_PER_CPU(struct rcu_data, rcu_data); | ||
241 | |||
242 | extern struct rcu_state rcu_bh_state; | ||
243 | DECLARE_PER_CPU(struct rcu_data, rcu_bh_data); | ||
244 | |||
245 | /* | ||
246 | * Increment the quiescent state counter. | ||
247 | * The counter is a bit degenerated: We do not need to know | ||
248 | * how many quiescent states passed, just if there was at least | ||
249 | * one since the start of the grace period. Thus just a flag. | ||
250 | */ | ||
251 | static inline void rcu_qsctr_inc(int cpu) | ||
252 | { | ||
253 | struct rcu_data *rdp = &per_cpu(rcu_data, cpu); | ||
254 | rdp->passed_quiesc = 1; | ||
255 | rdp->passed_quiesc_completed = rdp->completed; | ||
256 | } | ||
257 | static inline void rcu_bh_qsctr_inc(int cpu) | ||
258 | { | ||
259 | struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu); | ||
260 | rdp->passed_quiesc = 1; | ||
261 | rdp->passed_quiesc_completed = rdp->completed; | ||
262 | } | ||
263 | |||
264 | extern int rcu_pending(int cpu); | ||
265 | extern int rcu_needs_cpu(int cpu); | ||
266 | |||
267 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
268 | extern struct lockdep_map rcu_lock_map; | ||
269 | # define rcu_read_acquire() \ | ||
270 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) | ||
271 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) | ||
272 | #else | ||
273 | # define rcu_read_acquire() do { } while (0) | ||
274 | # define rcu_read_release() do { } while (0) | ||
275 | #endif | ||
276 | |||
277 | static inline void __rcu_read_lock(void) | ||
278 | { | ||
279 | preempt_disable(); | ||
280 | __acquire(RCU); | ||
281 | rcu_read_acquire(); | ||
282 | } | ||
283 | static inline void __rcu_read_unlock(void) | ||
284 | { | ||
285 | rcu_read_release(); | ||
286 | __release(RCU); | ||
287 | preempt_enable(); | ||
288 | } | ||
289 | static inline void __rcu_read_lock_bh(void) | ||
290 | { | ||
291 | local_bh_disable(); | ||
292 | __acquire(RCU_BH); | ||
293 | rcu_read_acquire(); | ||
294 | } | ||
295 | static inline void __rcu_read_unlock_bh(void) | ||
296 | { | ||
297 | rcu_read_release(); | ||
298 | __release(RCU_BH); | ||
299 | local_bh_enable(); | ||
300 | } | ||
301 | |||
302 | #define __synchronize_sched() synchronize_rcu() | ||
303 | |||
304 | #define call_rcu_sched(head, func) call_rcu(head, func) | ||
305 | |||
306 | static inline void rcu_init_sched(void) | ||
307 | { | ||
308 | } | ||
309 | |||
310 | extern void __rcu_init(void); | ||
311 | extern void rcu_check_callbacks(int cpu, int user); | ||
312 | extern void rcu_restart_cpu(int cpu); | ||
313 | |||
314 | extern long rcu_batches_completed(void); | ||
315 | extern long rcu_batches_completed_bh(void); | ||
316 | |||
317 | #ifdef CONFIG_NO_HZ | ||
318 | void rcu_enter_nohz(void); | ||
319 | void rcu_exit_nohz(void); | ||
320 | #else /* CONFIG_NO_HZ */ | ||
321 | static inline void rcu_enter_nohz(void) | ||
322 | { | ||
323 | } | ||
324 | static inline void rcu_exit_nohz(void) | ||
325 | { | ||
326 | } | ||
327 | #endif /* CONFIG_NO_HZ */ | ||
328 | |||
329 | #endif /* __LINUX_RCUTREE_H */ | ||
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 4cd64b0d9825..164332cbb77c 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -108,6 +108,7 @@ struct rfkill { | |||
108 | 108 | ||
109 | struct device dev; | 109 | struct device dev; |
110 | struct list_head node; | 110 | struct list_head node; |
111 | enum rfkill_state state_for_resume; | ||
111 | }; | 112 | }; |
112 | #define to_rfkill(d) container_of(d, struct rfkill, dev) | 113 | #define to_rfkill(d) container_of(d, struct rfkill, dev) |
113 | 114 | ||
@@ -148,11 +149,4 @@ static inline char *rfkill_get_led_name(struct rfkill *rfkill) | |||
148 | #endif | 149 | #endif |
149 | } | 150 | } |
150 | 151 | ||
151 | /* rfkill notification chain */ | ||
152 | #define RFKILL_STATE_CHANGED 0x0001 /* state of a normal rfkill | ||
153 | switch has changed */ | ||
154 | |||
155 | int register_rfkill_notifier(struct notifier_block *nb); | ||
156 | int unregister_rfkill_notifier(struct notifier_block *nb); | ||
157 | |||
158 | #endif /* RFKILL_H */ | 152 | #endif /* RFKILL_H */ |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index e097c2e6b6dc..b3b359660082 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -28,17 +28,19 @@ struct ring_buffer_event { | |||
28 | * size = 8 bytes | 28 | * size = 8 bytes |
29 | * | 29 | * |
30 | * @RINGBUF_TYPE_TIME_STAMP: Sync time stamp with external clock | 30 | * @RINGBUF_TYPE_TIME_STAMP: Sync time stamp with external clock |
31 | * array[0] = tv_nsec | 31 | * array[0] = tv_nsec |
32 | * array[1] = tv_sec | 32 | * array[1..2] = tv_sec |
33 | * size = 16 bytes | 33 | * size = 16 bytes |
34 | * | 34 | * |
35 | * @RINGBUF_TYPE_DATA: Data record | 35 | * @RINGBUF_TYPE_DATA: Data record |
36 | * If len is zero: | 36 | * If len is zero: |
37 | * array[0] holds the actual length | 37 | * array[0] holds the actual length |
38 | * array[1..(length+3)/4-1] holds data | 38 | * array[1..(length+3)/4] holds data |
39 | * size = 4 + 4 + length (bytes) | ||
39 | * else | 40 | * else |
40 | * length = len << 2 | 41 | * length = len << 2 |
41 | * array[0..(length+3)/4] holds data | 42 | * array[0..(length+3)/4-1] holds data |
43 | * size = 4 + length (bytes) | ||
42 | */ | 44 | */ |
43 | enum ring_buffer_type { | 45 | enum ring_buffer_type { |
44 | RINGBUF_TYPE_PADDING, | 46 | RINGBUF_TYPE_PADDING, |
@@ -116,12 +118,20 @@ void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu); | |||
116 | 118 | ||
117 | unsigned long ring_buffer_entries(struct ring_buffer *buffer); | 119 | unsigned long ring_buffer_entries(struct ring_buffer *buffer); |
118 | unsigned long ring_buffer_overruns(struct ring_buffer *buffer); | 120 | unsigned long ring_buffer_overruns(struct ring_buffer *buffer); |
121 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); | ||
122 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); | ||
119 | 123 | ||
120 | u64 ring_buffer_time_stamp(int cpu); | 124 | u64 ring_buffer_time_stamp(int cpu); |
121 | void ring_buffer_normalize_time_stamp(int cpu, u64 *ts); | 125 | void ring_buffer_normalize_time_stamp(int cpu, u64 *ts); |
122 | 126 | ||
123 | void tracing_on(void); | 127 | void tracing_on(void); |
124 | void tracing_off(void); | 128 | void tracing_off(void); |
129 | void tracing_off_permanent(void); | ||
130 | |||
131 | void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); | ||
132 | void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); | ||
133 | int ring_buffer_read_page(struct ring_buffer *buffer, | ||
134 | void **data_page, int cpu, int full); | ||
125 | 135 | ||
126 | enum ring_buffer_flags { | 136 | enum ring_buffer_flags { |
127 | RB_FL_OVERWRITE = 1 << 0, | 137 | RB_FL_OVERWRITE = 1 << 0, |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index 90987b7bcc1b..32c0547ffafc 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
@@ -427,9 +427,9 @@ void rio_dev_put(struct rio_dev *); | |||
427 | * Get the unique RIO device identifier. Returns the device | 427 | * Get the unique RIO device identifier. Returns the device |
428 | * identifier string. | 428 | * identifier string. |
429 | */ | 429 | */ |
430 | static inline char *rio_name(struct rio_dev *rdev) | 430 | static inline const char *rio_name(struct rio_dev *rdev) |
431 | { | 431 | { |
432 | return rdev->dev.bus_id; | 432 | return dev_name(&rdev->dev); |
433 | } | 433 | } |
434 | 434 | ||
435 | /** | 435 | /** |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 2b3d51c6ec9c..e88f7058b3a1 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -107,6 +107,11 @@ enum { | |||
107 | RTM_GETADDRLABEL, | 107 | RTM_GETADDRLABEL, |
108 | #define RTM_GETADDRLABEL RTM_GETADDRLABEL | 108 | #define RTM_GETADDRLABEL RTM_GETADDRLABEL |
109 | 109 | ||
110 | RTM_GETDCB = 78, | ||
111 | #define RTM_GETDCB RTM_GETDCB | ||
112 | RTM_SETDCB, | ||
113 | #define RTM_SETDCB RTM_SETDCB | ||
114 | |||
110 | __RTM_MAX, | 115 | __RTM_MAX, |
111 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 116 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
112 | }; | 117 | }; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 55e30d114477..8395e715809d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -96,6 +96,7 @@ struct exec_domain; | |||
96 | struct futex_pi_state; | 96 | struct futex_pi_state; |
97 | struct robust_list_head; | 97 | struct robust_list_head; |
98 | struct bio; | 98 | struct bio; |
99 | struct bts_tracer; | ||
99 | 100 | ||
100 | /* | 101 | /* |
101 | * List of flags we want to share for kernel threads, | 102 | * List of flags we want to share for kernel threads, |
@@ -259,8 +260,6 @@ static inline int select_nohz_load_balancer(int cpu) | |||
259 | } | 260 | } |
260 | #endif | 261 | #endif |
261 | 262 | ||
262 | extern unsigned long rt_needs_cpu(int cpu); | ||
263 | |||
264 | /* | 263 | /* |
265 | * Only dump TASK_* tasks. (0 for all tasks) | 264 | * Only dump TASK_* tasks. (0 for all tasks) |
266 | */ | 265 | */ |
@@ -572,12 +571,6 @@ struct signal_struct { | |||
572 | */ | 571 | */ |
573 | struct rlimit rlim[RLIM_NLIMITS]; | 572 | struct rlimit rlim[RLIM_NLIMITS]; |
574 | 573 | ||
575 | /* keep the process-shared keyrings here so that they do the right | ||
576 | * thing in threads created with CLONE_THREAD */ | ||
577 | #ifdef CONFIG_KEYS | ||
578 | struct key *session_keyring; /* keyring inherited over fork */ | ||
579 | struct key *process_keyring; /* keyring private to this process */ | ||
580 | #endif | ||
581 | #ifdef CONFIG_BSD_PROCESS_ACCT | 574 | #ifdef CONFIG_BSD_PROCESS_ACCT |
582 | struct pacct_struct pacct; /* per-process accounting information */ | 575 | struct pacct_struct pacct; /* per-process accounting information */ |
583 | #endif | 576 | #endif |
@@ -648,6 +641,7 @@ struct user_struct { | |||
648 | /* Hash table maintenance information */ | 641 | /* Hash table maintenance information */ |
649 | struct hlist_node uidhash_node; | 642 | struct hlist_node uidhash_node; |
650 | uid_t uid; | 643 | uid_t uid; |
644 | struct user_namespace *user_ns; | ||
651 | 645 | ||
652 | #ifdef CONFIG_USER_SCHED | 646 | #ifdef CONFIG_USER_SCHED |
653 | struct task_group *tg; | 647 | struct task_group *tg; |
@@ -665,6 +659,7 @@ extern struct user_struct *find_user(uid_t); | |||
665 | extern struct user_struct root_user; | 659 | extern struct user_struct root_user; |
666 | #define INIT_USER (&root_user) | 660 | #define INIT_USER (&root_user) |
667 | 661 | ||
662 | |||
668 | struct backing_dev_info; | 663 | struct backing_dev_info; |
669 | struct reclaim_state; | 664 | struct reclaim_state; |
670 | 665 | ||
@@ -672,8 +667,7 @@ struct reclaim_state; | |||
672 | struct sched_info { | 667 | struct sched_info { |
673 | /* cumulative counters */ | 668 | /* cumulative counters */ |
674 | unsigned long pcount; /* # of times run on this cpu */ | 669 | unsigned long pcount; /* # of times run on this cpu */ |
675 | unsigned long long cpu_time, /* time spent on the cpu */ | 670 | unsigned long long run_delay; /* time spent waiting on a runqueue */ |
676 | run_delay; /* time spent waiting on a runqueue */ | ||
677 | 671 | ||
678 | /* timestamps */ | 672 | /* timestamps */ |
679 | unsigned long long last_arrival,/* when we last ran on a cpu */ | 673 | unsigned long long last_arrival,/* when we last ran on a cpu */ |
@@ -888,38 +882,7 @@ partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | |||
888 | #endif /* !CONFIG_SMP */ | 882 | #endif /* !CONFIG_SMP */ |
889 | 883 | ||
890 | struct io_context; /* See blkdev.h */ | 884 | struct io_context; /* See blkdev.h */ |
891 | #define NGROUPS_SMALL 32 | ||
892 | #define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t))) | ||
893 | struct group_info { | ||
894 | int ngroups; | ||
895 | atomic_t usage; | ||
896 | gid_t small_block[NGROUPS_SMALL]; | ||
897 | int nblocks; | ||
898 | gid_t *blocks[0]; | ||
899 | }; | ||
900 | |||
901 | /* | ||
902 | * get_group_info() must be called with the owning task locked (via task_lock()) | ||
903 | * when task != current. The reason being that the vast majority of callers are | ||
904 | * looking at current->group_info, which can not be changed except by the | ||
905 | * current task. Changing current->group_info requires the task lock, too. | ||
906 | */ | ||
907 | #define get_group_info(group_info) do { \ | ||
908 | atomic_inc(&(group_info)->usage); \ | ||
909 | } while (0) | ||
910 | 885 | ||
911 | #define put_group_info(group_info) do { \ | ||
912 | if (atomic_dec_and_test(&(group_info)->usage)) \ | ||
913 | groups_free(group_info); \ | ||
914 | } while (0) | ||
915 | |||
916 | extern struct group_info *groups_alloc(int gidsetsize); | ||
917 | extern void groups_free(struct group_info *group_info); | ||
918 | extern int set_current_groups(struct group_info *group_info); | ||
919 | extern int groups_search(struct group_info *group_info, gid_t grp); | ||
920 | /* access the groups "array" with this macro */ | ||
921 | #define GROUP_AT(gi, i) \ | ||
922 | ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) | ||
923 | 886 | ||
924 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK | 887 | #ifdef ARCH_HAS_PREFETCH_SWITCH_STACK |
925 | extern void prefetch_stack(struct task_struct *t); | 888 | extern void prefetch_stack(struct task_struct *t); |
@@ -1165,6 +1128,19 @@ struct task_struct { | |||
1165 | struct list_head ptraced; | 1128 | struct list_head ptraced; |
1166 | struct list_head ptrace_entry; | 1129 | struct list_head ptrace_entry; |
1167 | 1130 | ||
1131 | #ifdef CONFIG_X86_PTRACE_BTS | ||
1132 | /* | ||
1133 | * This is the tracer handle for the ptrace BTS extension. | ||
1134 | * This field actually belongs to the ptracer task. | ||
1135 | */ | ||
1136 | struct bts_tracer *bts; | ||
1137 | /* | ||
1138 | * The buffer to hold the BTS data. | ||
1139 | */ | ||
1140 | void *bts_buffer; | ||
1141 | size_t bts_size; | ||
1142 | #endif /* CONFIG_X86_PTRACE_BTS */ | ||
1143 | |||
1168 | /* PID/PID hash table linkage. */ | 1144 | /* PID/PID hash table linkage. */ |
1169 | struct pid_link pids[PIDTYPE_MAX]; | 1145 | struct pid_link pids[PIDTYPE_MAX]; |
1170 | struct list_head thread_group; | 1146 | struct list_head thread_group; |
@@ -1186,17 +1162,12 @@ struct task_struct { | |||
1186 | struct list_head cpu_timers[3]; | 1162 | struct list_head cpu_timers[3]; |
1187 | 1163 | ||
1188 | /* process credentials */ | 1164 | /* process credentials */ |
1189 | uid_t uid,euid,suid,fsuid; | 1165 | const struct cred *real_cred; /* objective and real subjective task |
1190 | gid_t gid,egid,sgid,fsgid; | 1166 | * credentials (COW) */ |
1191 | struct group_info *group_info; | 1167 | const struct cred *cred; /* effective (overridable) subjective task |
1192 | kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset; | 1168 | * credentials (COW) */ |
1193 | struct user_struct *user; | 1169 | struct mutex cred_exec_mutex; /* execve vs ptrace cred calculation mutex */ |
1194 | unsigned securebits; | 1170 | |
1195 | #ifdef CONFIG_KEYS | ||
1196 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ | ||
1197 | struct key *request_key_auth; /* assumed request_key authority */ | ||
1198 | struct key *thread_keyring; /* keyring private to this thread */ | ||
1199 | #endif | ||
1200 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1171 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
1201 | - access with [gs]et_task_comm (which lock | 1172 | - access with [gs]et_task_comm (which lock |
1202 | it with task_lock()) | 1173 | it with task_lock()) |
@@ -1233,9 +1204,6 @@ struct task_struct { | |||
1233 | int (*notifier)(void *priv); | 1204 | int (*notifier)(void *priv); |
1234 | void *notifier_data; | 1205 | void *notifier_data; |
1235 | sigset_t *notifier_mask; | 1206 | sigset_t *notifier_mask; |
1236 | #ifdef CONFIG_SECURITY | ||
1237 | void *security; | ||
1238 | #endif | ||
1239 | struct audit_context *audit_context; | 1207 | struct audit_context *audit_context; |
1240 | #ifdef CONFIG_AUDITSYSCALL | 1208 | #ifdef CONFIG_AUDITSYSCALL |
1241 | uid_t loginuid; | 1209 | uid_t loginuid; |
@@ -1356,6 +1324,23 @@ struct task_struct { | |||
1356 | unsigned long default_timer_slack_ns; | 1324 | unsigned long default_timer_slack_ns; |
1357 | 1325 | ||
1358 | struct list_head *scm_work_list; | 1326 | struct list_head *scm_work_list; |
1327 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
1328 | /* Index of current stored adress in ret_stack */ | ||
1329 | int curr_ret_stack; | ||
1330 | /* Stack of return addresses for return function tracing */ | ||
1331 | struct ftrace_ret_stack *ret_stack; | ||
1332 | /* | ||
1333 | * Number of functions that haven't been traced | ||
1334 | * because of depth overrun. | ||
1335 | */ | ||
1336 | atomic_t trace_overrun; | ||
1337 | /* Pause for the tracing */ | ||
1338 | atomic_t tracing_graph_pause; | ||
1339 | #endif | ||
1340 | #ifdef CONFIG_TRACING | ||
1341 | /* state flags for use by tracers */ | ||
1342 | unsigned long trace; | ||
1343 | #endif | ||
1359 | }; | 1344 | }; |
1360 | 1345 | ||
1361 | /* | 1346 | /* |
@@ -1775,7 +1760,6 @@ static inline struct user_struct *get_uid(struct user_struct *u) | |||
1775 | return u; | 1760 | return u; |
1776 | } | 1761 | } |
1777 | extern void free_uid(struct user_struct *); | 1762 | extern void free_uid(struct user_struct *); |
1778 | extern void switch_uid(struct user_struct *); | ||
1779 | extern void release_uids(struct user_namespace *ns); | 1763 | extern void release_uids(struct user_namespace *ns); |
1780 | 1764 | ||
1781 | #include <asm/current.h> | 1765 | #include <asm/current.h> |
@@ -1794,9 +1778,6 @@ extern void wake_up_new_task(struct task_struct *tsk, | |||
1794 | extern void sched_fork(struct task_struct *p, int clone_flags); | 1778 | extern void sched_fork(struct task_struct *p, int clone_flags); |
1795 | extern void sched_dead(struct task_struct *p); | 1779 | extern void sched_dead(struct task_struct *p); |
1796 | 1780 | ||
1797 | extern int in_group_p(gid_t); | ||
1798 | extern int in_egroup_p(gid_t); | ||
1799 | |||
1800 | extern void proc_caches_init(void); | 1781 | extern void proc_caches_init(void); |
1801 | extern void flush_signals(struct task_struct *); | 1782 | extern void flush_signals(struct task_struct *); |
1802 | extern void ignore_signals(struct task_struct *); | 1783 | extern void ignore_signals(struct task_struct *); |
@@ -1928,6 +1909,8 @@ static inline unsigned long wait_task_inactive(struct task_struct *p, | |||
1928 | #define for_each_process(p) \ | 1909 | #define for_each_process(p) \ |
1929 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) | 1910 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) |
1930 | 1911 | ||
1912 | extern bool is_single_threaded(struct task_struct *); | ||
1913 | |||
1931 | /* | 1914 | /* |
1932 | * Careful: do_each_thread/while_each_thread is a double loop so | 1915 | * Careful: do_each_thread/while_each_thread is a double loop so |
1933 | * 'break' will not work as expected - use goto instead. | 1916 | * 'break' will not work as expected - use goto instead. |
@@ -2224,6 +2207,7 @@ extern void normalize_rt_tasks(void); | |||
2224 | extern struct task_group init_task_group; | 2207 | extern struct task_group init_task_group; |
2225 | #ifdef CONFIG_USER_SCHED | 2208 | #ifdef CONFIG_USER_SCHED |
2226 | extern struct task_group root_task_group; | 2209 | extern struct task_group root_task_group; |
2210 | extern void set_tg_uid(struct user_struct *user); | ||
2227 | #endif | 2211 | #endif |
2228 | 2212 | ||
2229 | extern struct task_group *sched_create_group(struct task_group *parent); | 2213 | extern struct task_group *sched_create_group(struct task_group *parent); |
diff --git a/include/linux/securebits.h b/include/linux/securebits.h index 92f09bdf1175..d2c5ed845bcc 100644 --- a/include/linux/securebits.h +++ b/include/linux/securebits.h | |||
@@ -32,7 +32,7 @@ | |||
32 | setting is locked or not. A setting which is locked cannot be | 32 | setting is locked or not. A setting which is locked cannot be |
33 | changed from user-level. */ | 33 | changed from user-level. */ |
34 | #define issecure_mask(X) (1 << (X)) | 34 | #define issecure_mask(X) (1 << (X)) |
35 | #define issecure(X) (issecure_mask(X) & current->securebits) | 35 | #define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits)) |
36 | 36 | ||
37 | #define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ | 37 | #define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ |
38 | issecure_mask(SECURE_NO_SETUID_FIXUP) | \ | 38 | issecure_mask(SECURE_NO_SETUID_FIXUP) | \ |
diff --git a/include/linux/security.h b/include/linux/security.h index e3d4ecda2673..b92b5e453f64 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -37,6 +37,10 @@ | |||
37 | /* Maximum number of letters for an LSM name string */ | 37 | /* Maximum number of letters for an LSM name string */ |
38 | #define SECURITY_NAME_MAX 10 | 38 | #define SECURITY_NAME_MAX 10 |
39 | 39 | ||
40 | /* If capable should audit the security request */ | ||
41 | #define SECURITY_CAP_NOAUDIT 0 | ||
42 | #define SECURITY_CAP_AUDIT 1 | ||
43 | |||
40 | struct ctl_table; | 44 | struct ctl_table; |
41 | struct audit_krule; | 45 | struct audit_krule; |
42 | 46 | ||
@@ -44,25 +48,25 @@ struct audit_krule; | |||
44 | * These functions are in security/capability.c and are used | 48 | * These functions are in security/capability.c and are used |
45 | * as the default capabilities functions | 49 | * as the default capabilities functions |
46 | */ | 50 | */ |
47 | extern int cap_capable(struct task_struct *tsk, int cap); | 51 | extern int cap_capable(struct task_struct *tsk, int cap, int audit); |
48 | extern int cap_settime(struct timespec *ts, struct timezone *tz); | 52 | extern int cap_settime(struct timespec *ts, struct timezone *tz); |
49 | extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); | 53 | extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); |
50 | extern int cap_ptrace_traceme(struct task_struct *parent); | 54 | extern int cap_ptrace_traceme(struct task_struct *parent); |
51 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 55 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
52 | extern int cap_capset_check(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 56 | extern int cap_capset(struct cred *new, const struct cred *old, |
53 | extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 57 | const kernel_cap_t *effective, |
54 | extern int cap_bprm_set_security(struct linux_binprm *bprm); | 58 | const kernel_cap_t *inheritable, |
55 | extern void cap_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); | 59 | const kernel_cap_t *permitted); |
60 | extern int cap_bprm_set_creds(struct linux_binprm *bprm); | ||
56 | extern int cap_bprm_secureexec(struct linux_binprm *bprm); | 61 | extern int cap_bprm_secureexec(struct linux_binprm *bprm); |
57 | extern int cap_inode_setxattr(struct dentry *dentry, const char *name, | 62 | extern int cap_inode_setxattr(struct dentry *dentry, const char *name, |
58 | const void *value, size_t size, int flags); | 63 | const void *value, size_t size, int flags); |
59 | extern int cap_inode_removexattr(struct dentry *dentry, const char *name); | 64 | extern int cap_inode_removexattr(struct dentry *dentry, const char *name); |
60 | extern int cap_inode_need_killpriv(struct dentry *dentry); | 65 | extern int cap_inode_need_killpriv(struct dentry *dentry); |
61 | extern int cap_inode_killpriv(struct dentry *dentry); | 66 | extern int cap_inode_killpriv(struct dentry *dentry); |
62 | extern int cap_task_post_setuid(uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); | 67 | extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); |
63 | extern void cap_task_reparent_to_init(struct task_struct *p); | ||
64 | extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, | 68 | extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, |
65 | unsigned long arg4, unsigned long arg5, long *rc_p); | 69 | unsigned long arg4, unsigned long arg5); |
66 | extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp); | 70 | extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp); |
67 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); | 71 | extern int cap_task_setioprio(struct task_struct *p, int ioprio); |
68 | extern int cap_task_setnice(struct task_struct *p, int nice); | 72 | extern int cap_task_setnice(struct task_struct *p, int nice); |
@@ -105,7 +109,7 @@ extern unsigned long mmap_min_addr; | |||
105 | struct sched_param; | 109 | struct sched_param; |
106 | struct request_sock; | 110 | struct request_sock; |
107 | 111 | ||
108 | /* bprm_apply_creds unsafe reasons */ | 112 | /* bprm->unsafe reasons */ |
109 | #define LSM_UNSAFE_SHARE 1 | 113 | #define LSM_UNSAFE_SHARE 1 |
110 | #define LSM_UNSAFE_PTRACE 2 | 114 | #define LSM_UNSAFE_PTRACE 2 |
111 | #define LSM_UNSAFE_PTRACE_CAP 4 | 115 | #define LSM_UNSAFE_PTRACE_CAP 4 |
@@ -149,36 +153,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
149 | * | 153 | * |
150 | * Security hooks for program execution operations. | 154 | * Security hooks for program execution operations. |
151 | * | 155 | * |
152 | * @bprm_alloc_security: | 156 | * @bprm_set_creds: |
153 | * Allocate and attach a security structure to the @bprm->security field. | ||
154 | * The security field is initialized to NULL when the bprm structure is | ||
155 | * allocated. | ||
156 | * @bprm contains the linux_binprm structure to be modified. | ||
157 | * Return 0 if operation was successful. | ||
158 | * @bprm_free_security: | ||
159 | * @bprm contains the linux_binprm structure to be modified. | ||
160 | * Deallocate and clear the @bprm->security field. | ||
161 | * @bprm_apply_creds: | ||
162 | * Compute and set the security attributes of a process being transformed | ||
163 | * by an execve operation based on the old attributes (current->security) | ||
164 | * and the information saved in @bprm->security by the set_security hook. | ||
165 | * Since this hook function (and its caller) are void, this hook can not | ||
166 | * return an error. However, it can leave the security attributes of the | ||
167 | * process unchanged if an access failure occurs at this point. | ||
168 | * bprm_apply_creds is called under task_lock. @unsafe indicates various | ||
169 | * reasons why it may be unsafe to change security state. | ||
170 | * @bprm contains the linux_binprm structure. | ||
171 | * @bprm_post_apply_creds: | ||
172 | * Runs after bprm_apply_creds with the task_lock dropped, so that | ||
173 | * functions which cannot be called safely under the task_lock can | ||
174 | * be used. This hook is a good place to perform state changes on | ||
175 | * the process such as closing open file descriptors to which access | ||
176 | * is no longer granted if the attributes were changed. | ||
177 | * Note that a security module might need to save state between | ||
178 | * bprm_apply_creds and bprm_post_apply_creds to store the decision | ||
179 | * on whether the process may proceed. | ||
180 | * @bprm contains the linux_binprm structure. | ||
181 | * @bprm_set_security: | ||
182 | * Save security information in the bprm->security field, typically based | 157 | * Save security information in the bprm->security field, typically based |
183 | * on information about the bprm->file, for later use by the apply_creds | 158 | * on information about the bprm->file, for later use by the apply_creds |
184 | * hook. This hook may also optionally check permissions (e.g. for | 159 | * hook. This hook may also optionally check permissions (e.g. for |
@@ -191,15 +166,30 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
191 | * @bprm contains the linux_binprm structure. | 166 | * @bprm contains the linux_binprm structure. |
192 | * Return 0 if the hook is successful and permission is granted. | 167 | * Return 0 if the hook is successful and permission is granted. |
193 | * @bprm_check_security: | 168 | * @bprm_check_security: |
194 | * This hook mediates the point when a search for a binary handler will | 169 | * This hook mediates the point when a search for a binary handler will |
195 | * begin. It allows a check the @bprm->security value which is set in | 170 | * begin. It allows a check the @bprm->security value which is set in the |
196 | * the preceding set_security call. The primary difference from | 171 | * preceding set_creds call. The primary difference from set_creds is |
197 | * set_security is that the argv list and envp list are reliably | 172 | * that the argv list and envp list are reliably available in @bprm. This |
198 | * available in @bprm. This hook may be called multiple times | 173 | * hook may be called multiple times during a single execve; and in each |
199 | * during a single execve; and in each pass set_security is called | 174 | * pass set_creds is called first. |
200 | * first. | ||
201 | * @bprm contains the linux_binprm structure. | 175 | * @bprm contains the linux_binprm structure. |
202 | * Return 0 if the hook is successful and permission is granted. | 176 | * Return 0 if the hook is successful and permission is granted. |
177 | * @bprm_committing_creds: | ||
178 | * Prepare to install the new security attributes of a process being | ||
179 | * transformed by an execve operation, based on the old credentials | ||
180 | * pointed to by @current->cred and the information set in @bprm->cred by | ||
181 | * the bprm_set_creds hook. @bprm points to the linux_binprm structure. | ||
182 | * This hook is a good place to perform state changes on the process such | ||
183 | * as closing open file descriptors to which access will no longer be | ||
184 | * granted when the attributes are changed. This is called immediately | ||
185 | * before commit_creds(). | ||
186 | * @bprm_committed_creds: | ||
187 | * Tidy up after the installation of the new security attributes of a | ||
188 | * process being transformed by an execve operation. The new credentials | ||
189 | * have, by this point, been set to @current->cred. @bprm points to the | ||
190 | * linux_binprm structure. This hook is a good place to perform state | ||
191 | * changes on the process such as clearing out non-inheritable signal | ||
192 | * state. This is called immediately after commit_creds(). | ||
203 | * @bprm_secureexec: | 193 | * @bprm_secureexec: |
204 | * Return a boolean value (0 or 1) indicating whether a "secure exec" | 194 | * Return a boolean value (0 or 1) indicating whether a "secure exec" |
205 | * is required. The flag is passed in the auxiliary table | 195 | * is required. The flag is passed in the auxiliary table |
@@ -345,17 +335,37 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
345 | * @dir contains the inode structure of the parent directory of the new link. | 335 | * @dir contains the inode structure of the parent directory of the new link. |
346 | * @new_dentry contains the dentry structure for the new link. | 336 | * @new_dentry contains the dentry structure for the new link. |
347 | * Return 0 if permission is granted. | 337 | * Return 0 if permission is granted. |
338 | * @path_link: | ||
339 | * Check permission before creating a new hard link to a file. | ||
340 | * @old_dentry contains the dentry structure for an existing link | ||
341 | * to the file. | ||
342 | * @new_dir contains the path structure of the parent directory of | ||
343 | * the new link. | ||
344 | * @new_dentry contains the dentry structure for the new link. | ||
345 | * Return 0 if permission is granted. | ||
348 | * @inode_unlink: | 346 | * @inode_unlink: |
349 | * Check the permission to remove a hard link to a file. | 347 | * Check the permission to remove a hard link to a file. |
350 | * @dir contains the inode structure of parent directory of the file. | 348 | * @dir contains the inode structure of parent directory of the file. |
351 | * @dentry contains the dentry structure for file to be unlinked. | 349 | * @dentry contains the dentry structure for file to be unlinked. |
352 | * Return 0 if permission is granted. | 350 | * Return 0 if permission is granted. |
351 | * @path_unlink: | ||
352 | * Check the permission to remove a hard link to a file. | ||
353 | * @dir contains the path structure of parent directory of the file. | ||
354 | * @dentry contains the dentry structure for file to be unlinked. | ||
355 | * Return 0 if permission is granted. | ||
353 | * @inode_symlink: | 356 | * @inode_symlink: |
354 | * Check the permission to create a symbolic link to a file. | 357 | * Check the permission to create a symbolic link to a file. |
355 | * @dir contains the inode structure of parent directory of the symbolic link. | 358 | * @dir contains the inode structure of parent directory of the symbolic link. |
356 | * @dentry contains the dentry structure of the symbolic link. | 359 | * @dentry contains the dentry structure of the symbolic link. |
357 | * @old_name contains the pathname of file. | 360 | * @old_name contains the pathname of file. |
358 | * Return 0 if permission is granted. | 361 | * Return 0 if permission is granted. |
362 | * @path_symlink: | ||
363 | * Check the permission to create a symbolic link to a file. | ||
364 | * @dir contains the path structure of parent directory of | ||
365 | * the symbolic link. | ||
366 | * @dentry contains the dentry structure of the symbolic link. | ||
367 | * @old_name contains the pathname of file. | ||
368 | * Return 0 if permission is granted. | ||
359 | * @inode_mkdir: | 369 | * @inode_mkdir: |
360 | * Check permissions to create a new directory in the existing directory | 370 | * Check permissions to create a new directory in the existing directory |
361 | * associated with inode strcture @dir. | 371 | * associated with inode strcture @dir. |
@@ -363,11 +373,25 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
363 | * @dentry contains the dentry structure of new directory. | 373 | * @dentry contains the dentry structure of new directory. |
364 | * @mode contains the mode of new directory. | 374 | * @mode contains the mode of new directory. |
365 | * Return 0 if permission is granted. | 375 | * Return 0 if permission is granted. |
376 | * @path_mkdir: | ||
377 | * Check permissions to create a new directory in the existing directory | ||
378 | * associated with path strcture @path. | ||
379 | * @dir containst the path structure of parent of the directory | ||
380 | * to be created. | ||
381 | * @dentry contains the dentry structure of new directory. | ||
382 | * @mode contains the mode of new directory. | ||
383 | * Return 0 if permission is granted. | ||
366 | * @inode_rmdir: | 384 | * @inode_rmdir: |
367 | * Check the permission to remove a directory. | 385 | * Check the permission to remove a directory. |
368 | * @dir contains the inode structure of parent of the directory to be removed. | 386 | * @dir contains the inode structure of parent of the directory to be removed. |
369 | * @dentry contains the dentry structure of directory to be removed. | 387 | * @dentry contains the dentry structure of directory to be removed. |
370 | * Return 0 if permission is granted. | 388 | * Return 0 if permission is granted. |
389 | * @path_rmdir: | ||
390 | * Check the permission to remove a directory. | ||
391 | * @dir contains the path structure of parent of the directory to be | ||
392 | * removed. | ||
393 | * @dentry contains the dentry structure of directory to be removed. | ||
394 | * Return 0 if permission is granted. | ||
371 | * @inode_mknod: | 395 | * @inode_mknod: |
372 | * Check permissions when creating a special file (or a socket or a fifo | 396 | * Check permissions when creating a special file (or a socket or a fifo |
373 | * file created via the mknod system call). Note that if mknod operation | 397 | * file created via the mknod system call). Note that if mknod operation |
@@ -378,6 +402,15 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
378 | * @mode contains the mode of the new file. | 402 | * @mode contains the mode of the new file. |
379 | * @dev contains the device number. | 403 | * @dev contains the device number. |
380 | * Return 0 if permission is granted. | 404 | * Return 0 if permission is granted. |
405 | * @path_mknod: | ||
406 | * Check permissions when creating a file. Note that this hook is called | ||
407 | * even if mknod operation is being done for a regular file. | ||
408 | * @dir contains the path structure of parent of the new file. | ||
409 | * @dentry contains the dentry structure of the new file. | ||
410 | * @mode contains the mode of the new file. | ||
411 | * @dev contains the undecoded device number. Use new_decode_dev() to get | ||
412 | * the decoded device number. | ||
413 | * Return 0 if permission is granted. | ||
381 | * @inode_rename: | 414 | * @inode_rename: |
382 | * Check for permission to rename a file or directory. | 415 | * Check for permission to rename a file or directory. |
383 | * @old_dir contains the inode structure for parent of the old link. | 416 | * @old_dir contains the inode structure for parent of the old link. |
@@ -385,6 +418,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
385 | * @new_dir contains the inode structure for parent of the new link. | 418 | * @new_dir contains the inode structure for parent of the new link. |
386 | * @new_dentry contains the dentry structure of the new link. | 419 | * @new_dentry contains the dentry structure of the new link. |
387 | * Return 0 if permission is granted. | 420 | * Return 0 if permission is granted. |
421 | * @path_rename: | ||
422 | * Check for permission to rename a file or directory. | ||
423 | * @old_dir contains the path structure for parent of the old link. | ||
424 | * @old_dentry contains the dentry structure of the old link. | ||
425 | * @new_dir contains the path structure for parent of the new link. | ||
426 | * @new_dentry contains the dentry structure of the new link. | ||
427 | * Return 0 if permission is granted. | ||
388 | * @inode_readlink: | 428 | * @inode_readlink: |
389 | * Check the permission to read the symbolic link. | 429 | * Check the permission to read the symbolic link. |
390 | * @dentry contains the dentry structure for the file link. | 430 | * @dentry contains the dentry structure for the file link. |
@@ -413,6 +453,12 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
413 | * @dentry contains the dentry structure for the file. | 453 | * @dentry contains the dentry structure for the file. |
414 | * @attr is the iattr structure containing the new file attributes. | 454 | * @attr is the iattr structure containing the new file attributes. |
415 | * Return 0 if permission is granted. | 455 | * Return 0 if permission is granted. |
456 | * @path_truncate: | ||
457 | * Check permission before truncating a file. | ||
458 | * @path contains the path structure for the file. | ||
459 | * @length is the new length of the file. | ||
460 | * @time_attrs is the flags passed to do_truncate(). | ||
461 | * Return 0 if permission is granted. | ||
416 | * @inode_getattr: | 462 | * @inode_getattr: |
417 | * Check permission before obtaining file attributes. | 463 | * Check permission before obtaining file attributes. |
418 | * @mnt is the vfsmount where the dentry was looked up | 464 | * @mnt is the vfsmount where the dentry was looked up |
@@ -585,15 +631,31 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
585 | * manual page for definitions of the @clone_flags. | 631 | * manual page for definitions of the @clone_flags. |
586 | * @clone_flags contains the flags indicating what should be shared. | 632 | * @clone_flags contains the flags indicating what should be shared. |
587 | * Return 0 if permission is granted. | 633 | * Return 0 if permission is granted. |
588 | * @task_alloc_security: | 634 | * @cred_free: |
589 | * @p contains the task_struct for child process. | 635 | * @cred points to the credentials. |
590 | * Allocate and attach a security structure to the p->security field. The | 636 | * Deallocate and clear the cred->security field in a set of credentials. |
591 | * security field is initialized to NULL when the task structure is | 637 | * @cred_prepare: |
592 | * allocated. | 638 | * @new points to the new credentials. |
593 | * Return 0 if operation was successful. | 639 | * @old points to the original credentials. |
594 | * @task_free_security: | 640 | * @gfp indicates the atomicity of any memory allocations. |
595 | * @p contains the task_struct for process. | 641 | * Prepare a new set of credentials by copying the data from the old set. |
596 | * Deallocate and clear the p->security field. | 642 | * @cred_commit: |
643 | * @new points to the new credentials. | ||
644 | * @old points to the original credentials. | ||
645 | * Install a new set of credentials. | ||
646 | * @kernel_act_as: | ||
647 | * Set the credentials for a kernel service to act as (subjective context). | ||
648 | * @new points to the credentials to be modified. | ||
649 | * @secid specifies the security ID to be set | ||
650 | * The current task must be the one that nominated @secid. | ||
651 | * Return 0 if successful. | ||
652 | * @kernel_create_files_as: | ||
653 | * Set the file creation context in a set of credentials to be the same as | ||
654 | * the objective context of the specified inode. | ||
655 | * @new points to the credentials to be modified. | ||
656 | * @inode points to the inode to use as a reference. | ||
657 | * The current task must be the one that nominated @inode. | ||
658 | * Return 0 if successful. | ||
597 | * @task_setuid: | 659 | * @task_setuid: |
598 | * Check permission before setting one or more of the user identity | 660 | * Check permission before setting one or more of the user identity |
599 | * attributes of the current process. The @flags parameter indicates | 661 | * attributes of the current process. The @flags parameter indicates |
@@ -606,15 +668,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
606 | * @id2 contains a uid. | 668 | * @id2 contains a uid. |
607 | * @flags contains one of the LSM_SETID_* values. | 669 | * @flags contains one of the LSM_SETID_* values. |
608 | * Return 0 if permission is granted. | 670 | * Return 0 if permission is granted. |
609 | * @task_post_setuid: | 671 | * @task_fix_setuid: |
610 | * Update the module's state after setting one or more of the user | 672 | * Update the module's state after setting one or more of the user |
611 | * identity attributes of the current process. The @flags parameter | 673 | * identity attributes of the current process. The @flags parameter |
612 | * indicates which of the set*uid system calls invoked this hook. If | 674 | * indicates which of the set*uid system calls invoked this hook. If |
613 | * @flags is LSM_SETID_FS, then @old_ruid is the old fs uid and the other | 675 | * @new is the set of credentials that will be installed. Modifications |
614 | * parameters are not used. | 676 | * should be made to this rather than to @current->cred. |
615 | * @old_ruid contains the old real uid (or fs uid if LSM_SETID_FS). | 677 | * @old is the set of credentials that are being replaces |
616 | * @old_euid contains the old effective uid (or -1 if LSM_SETID_FS). | ||
617 | * @old_suid contains the old saved uid (or -1 if LSM_SETID_FS). | ||
618 | * @flags contains one of the LSM_SETID_* values. | 678 | * @flags contains one of the LSM_SETID_* values. |
619 | * Return 0 on success. | 679 | * Return 0 on success. |
620 | * @task_setgid: | 680 | * @task_setgid: |
@@ -717,13 +777,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
717 | * @arg3 contains a argument. | 777 | * @arg3 contains a argument. |
718 | * @arg4 contains a argument. | 778 | * @arg4 contains a argument. |
719 | * @arg5 contains a argument. | 779 | * @arg5 contains a argument. |
720 | * @rc_p contains a pointer to communicate back the forced return code | 780 | * Return -ENOSYS if no-one wanted to handle this op, any other value to |
721 | * Return 0 if permission is granted, and non-zero if the security module | 781 | * cause prctl() to return immediately with that value. |
722 | * has taken responsibility (setting *rc_p) for the prctl call. | ||
723 | * @task_reparent_to_init: | ||
724 | * Set the security attributes in @p->security for a kernel thread that | ||
725 | * is being reparented to the init task. | ||
726 | * @p contains the task_struct for the kernel thread. | ||
727 | * @task_to_inode: | 782 | * @task_to_inode: |
728 | * Set the security attributes for an inode based on an associated task's | 783 | * Set the security attributes for an inode based on an associated task's |
729 | * security attributes, e.g. for /proc/pid inodes. | 784 | * security attributes, e.g. for /proc/pid inodes. |
@@ -1000,7 +1055,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1000 | * See whether a specific operational right is granted to a process on a | 1055 | * See whether a specific operational right is granted to a process on a |
1001 | * key. | 1056 | * key. |
1002 | * @key_ref refers to the key (key pointer + possession attribute bit). | 1057 | * @key_ref refers to the key (key pointer + possession attribute bit). |
1003 | * @context points to the process to provide the context against which to | 1058 | * @cred points to the credentials to provide the context against which to |
1004 | * evaluate the security data on the key. | 1059 | * evaluate the security data on the key. |
1005 | * @perm describes the combination of permissions required of this key. | 1060 | * @perm describes the combination of permissions required of this key. |
1006 | * Return 1 if permission granted, 0 if permission denied and -ve it the | 1061 | * Return 1 if permission granted, 0 if permission denied and -ve it the |
@@ -1162,6 +1217,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1162 | * @child process. | 1217 | * @child process. |
1163 | * Security modules may also want to perform a process tracing check | 1218 | * Security modules may also want to perform a process tracing check |
1164 | * during an execve in the set_security or apply_creds hooks of | 1219 | * during an execve in the set_security or apply_creds hooks of |
1220 | * tracing check during an execve in the bprm_set_creds hook of | ||
1165 | * binprm_security_ops if the process is being traced and its security | 1221 | * binprm_security_ops if the process is being traced and its security |
1166 | * attributes would be changed by the execve. | 1222 | * attributes would be changed by the execve. |
1167 | * @child contains the task_struct structure for the target process. | 1223 | * @child contains the task_struct structure for the target process. |
@@ -1185,29 +1241,15 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1185 | * @inheritable contains the inheritable capability set. | 1241 | * @inheritable contains the inheritable capability set. |
1186 | * @permitted contains the permitted capability set. | 1242 | * @permitted contains the permitted capability set. |
1187 | * Return 0 if the capability sets were successfully obtained. | 1243 | * Return 0 if the capability sets were successfully obtained. |
1188 | * @capset_check: | 1244 | * @capset: |
1189 | * Check permission before setting the @effective, @inheritable, and | ||
1190 | * @permitted capability sets for the @target process. | ||
1191 | * Caveat: @target is also set to current if a set of processes is | ||
1192 | * specified (i.e. all processes other than current and init or a | ||
1193 | * particular process group). Hence, the capset_set hook may need to | ||
1194 | * revalidate permission to the actual target process. | ||
1195 | * @target contains the task_struct structure for target process. | ||
1196 | * @effective contains the effective capability set. | ||
1197 | * @inheritable contains the inheritable capability set. | ||
1198 | * @permitted contains the permitted capability set. | ||
1199 | * Return 0 if permission is granted. | ||
1200 | * @capset_set: | ||
1201 | * Set the @effective, @inheritable, and @permitted capability sets for | 1245 | * Set the @effective, @inheritable, and @permitted capability sets for |
1202 | * the @target process. Since capset_check cannot always check permission | 1246 | * the current process. |
1203 | * to the real @target process, this hook may also perform permission | 1247 | * @new contains the new credentials structure for target process. |
1204 | * checking to determine if the current process is allowed to set the | 1248 | * @old contains the current credentials structure for target process. |
1205 | * capability sets of the @target process. However, this hook has no way | ||
1206 | * of returning an error due to the structure of the sys_capset code. | ||
1207 | * @target contains the task_struct structure for target process. | ||
1208 | * @effective contains the effective capability set. | 1249 | * @effective contains the effective capability set. |
1209 | * @inheritable contains the inheritable capability set. | 1250 | * @inheritable contains the inheritable capability set. |
1210 | * @permitted contains the permitted capability set. | 1251 | * @permitted contains the permitted capability set. |
1252 | * Return 0 and update @new if permission is granted. | ||
1211 | * @capable: | 1253 | * @capable: |
1212 | * Check whether the @tsk process has the @cap capability. | 1254 | * Check whether the @tsk process has the @cap capability. |
1213 | * @tsk contains the task_struct for the process. | 1255 | * @tsk contains the task_struct for the process. |
@@ -1299,15 +1341,12 @@ struct security_operations { | |||
1299 | int (*capget) (struct task_struct *target, | 1341 | int (*capget) (struct task_struct *target, |
1300 | kernel_cap_t *effective, | 1342 | kernel_cap_t *effective, |
1301 | kernel_cap_t *inheritable, kernel_cap_t *permitted); | 1343 | kernel_cap_t *inheritable, kernel_cap_t *permitted); |
1302 | int (*capset_check) (struct task_struct *target, | 1344 | int (*capset) (struct cred *new, |
1303 | kernel_cap_t *effective, | 1345 | const struct cred *old, |
1304 | kernel_cap_t *inheritable, | 1346 | const kernel_cap_t *effective, |
1305 | kernel_cap_t *permitted); | 1347 | const kernel_cap_t *inheritable, |
1306 | void (*capset_set) (struct task_struct *target, | 1348 | const kernel_cap_t *permitted); |
1307 | kernel_cap_t *effective, | 1349 | int (*capable) (struct task_struct *tsk, int cap, int audit); |
1308 | kernel_cap_t *inheritable, | ||
1309 | kernel_cap_t *permitted); | ||
1310 | int (*capable) (struct task_struct *tsk, int cap); | ||
1311 | int (*acct) (struct file *file); | 1350 | int (*acct) (struct file *file); |
1312 | int (*sysctl) (struct ctl_table *table, int op); | 1351 | int (*sysctl) (struct ctl_table *table, int op); |
1313 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); | 1352 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); |
@@ -1316,18 +1355,16 @@ struct security_operations { | |||
1316 | int (*settime) (struct timespec *ts, struct timezone *tz); | 1355 | int (*settime) (struct timespec *ts, struct timezone *tz); |
1317 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); | 1356 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); |
1318 | 1357 | ||
1319 | int (*bprm_alloc_security) (struct linux_binprm *bprm); | 1358 | int (*bprm_set_creds) (struct linux_binprm *bprm); |
1320 | void (*bprm_free_security) (struct linux_binprm *bprm); | ||
1321 | void (*bprm_apply_creds) (struct linux_binprm *bprm, int unsafe); | ||
1322 | void (*bprm_post_apply_creds) (struct linux_binprm *bprm); | ||
1323 | int (*bprm_set_security) (struct linux_binprm *bprm); | ||
1324 | int (*bprm_check_security) (struct linux_binprm *bprm); | 1359 | int (*bprm_check_security) (struct linux_binprm *bprm); |
1325 | int (*bprm_secureexec) (struct linux_binprm *bprm); | 1360 | int (*bprm_secureexec) (struct linux_binprm *bprm); |
1361 | void (*bprm_committing_creds) (struct linux_binprm *bprm); | ||
1362 | void (*bprm_committed_creds) (struct linux_binprm *bprm); | ||
1326 | 1363 | ||
1327 | int (*sb_alloc_security) (struct super_block *sb); | 1364 | int (*sb_alloc_security) (struct super_block *sb); |
1328 | void (*sb_free_security) (struct super_block *sb); | 1365 | void (*sb_free_security) (struct super_block *sb); |
1329 | int (*sb_copy_data) (char *orig, char *copy); | 1366 | int (*sb_copy_data) (char *orig, char *copy); |
1330 | int (*sb_kern_mount) (struct super_block *sb, void *data); | 1367 | int (*sb_kern_mount) (struct super_block *sb, int flags, void *data); |
1331 | int (*sb_show_options) (struct seq_file *m, struct super_block *sb); | 1368 | int (*sb_show_options) (struct seq_file *m, struct super_block *sb); |
1332 | int (*sb_statfs) (struct dentry *dentry); | 1369 | int (*sb_statfs) (struct dentry *dentry); |
1333 | int (*sb_mount) (char *dev_name, struct path *path, | 1370 | int (*sb_mount) (char *dev_name, struct path *path, |
@@ -1350,6 +1387,22 @@ struct security_operations { | |||
1350 | struct super_block *newsb); | 1387 | struct super_block *newsb); |
1351 | int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); | 1388 | int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); |
1352 | 1389 | ||
1390 | #ifdef CONFIG_SECURITY_PATH | ||
1391 | int (*path_unlink) (struct path *dir, struct dentry *dentry); | ||
1392 | int (*path_mkdir) (struct path *dir, struct dentry *dentry, int mode); | ||
1393 | int (*path_rmdir) (struct path *dir, struct dentry *dentry); | ||
1394 | int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode, | ||
1395 | unsigned int dev); | ||
1396 | int (*path_truncate) (struct path *path, loff_t length, | ||
1397 | unsigned int time_attrs); | ||
1398 | int (*path_symlink) (struct path *dir, struct dentry *dentry, | ||
1399 | const char *old_name); | ||
1400 | int (*path_link) (struct dentry *old_dentry, struct path *new_dir, | ||
1401 | struct dentry *new_dentry); | ||
1402 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, | ||
1403 | struct path *new_dir, struct dentry *new_dentry); | ||
1404 | #endif | ||
1405 | |||
1353 | int (*inode_alloc_security) (struct inode *inode); | 1406 | int (*inode_alloc_security) (struct inode *inode); |
1354 | void (*inode_free_security) (struct inode *inode); | 1407 | void (*inode_free_security) (struct inode *inode); |
1355 | int (*inode_init_security) (struct inode *inode, struct inode *dir, | 1408 | int (*inode_init_security) (struct inode *inode, struct inode *dir, |
@@ -1406,14 +1459,18 @@ struct security_operations { | |||
1406 | int (*file_send_sigiotask) (struct task_struct *tsk, | 1459 | int (*file_send_sigiotask) (struct task_struct *tsk, |
1407 | struct fown_struct *fown, int sig); | 1460 | struct fown_struct *fown, int sig); |
1408 | int (*file_receive) (struct file *file); | 1461 | int (*file_receive) (struct file *file); |
1409 | int (*dentry_open) (struct file *file); | 1462 | int (*dentry_open) (struct file *file, const struct cred *cred); |
1410 | 1463 | ||
1411 | int (*task_create) (unsigned long clone_flags); | 1464 | int (*task_create) (unsigned long clone_flags); |
1412 | int (*task_alloc_security) (struct task_struct *p); | 1465 | void (*cred_free) (struct cred *cred); |
1413 | void (*task_free_security) (struct task_struct *p); | 1466 | int (*cred_prepare)(struct cred *new, const struct cred *old, |
1467 | gfp_t gfp); | ||
1468 | void (*cred_commit)(struct cred *new, const struct cred *old); | ||
1469 | int (*kernel_act_as)(struct cred *new, u32 secid); | ||
1470 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); | ||
1414 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); | 1471 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); |
1415 | int (*task_post_setuid) (uid_t old_ruid /* or fsuid */ , | 1472 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, |
1416 | uid_t old_euid, uid_t old_suid, int flags); | 1473 | int flags); |
1417 | int (*task_setgid) (gid_t id0, gid_t id1, gid_t id2, int flags); | 1474 | int (*task_setgid) (gid_t id0, gid_t id1, gid_t id2, int flags); |
1418 | int (*task_setpgid) (struct task_struct *p, pid_t pgid); | 1475 | int (*task_setpgid) (struct task_struct *p, pid_t pgid); |
1419 | int (*task_getpgid) (struct task_struct *p); | 1476 | int (*task_getpgid) (struct task_struct *p); |
@@ -1433,8 +1490,7 @@ struct security_operations { | |||
1433 | int (*task_wait) (struct task_struct *p); | 1490 | int (*task_wait) (struct task_struct *p); |
1434 | int (*task_prctl) (int option, unsigned long arg2, | 1491 | int (*task_prctl) (int option, unsigned long arg2, |
1435 | unsigned long arg3, unsigned long arg4, | 1492 | unsigned long arg3, unsigned long arg4, |
1436 | unsigned long arg5, long *rc_p); | 1493 | unsigned long arg5); |
1437 | void (*task_reparent_to_init) (struct task_struct *p); | ||
1438 | void (*task_to_inode) (struct task_struct *p, struct inode *inode); | 1494 | void (*task_to_inode) (struct task_struct *p, struct inode *inode); |
1439 | 1495 | ||
1440 | int (*ipc_permission) (struct kern_ipc_perm *ipcp, short flag); | 1496 | int (*ipc_permission) (struct kern_ipc_perm *ipcp, short flag); |
@@ -1539,10 +1595,10 @@ struct security_operations { | |||
1539 | 1595 | ||
1540 | /* key management security hooks */ | 1596 | /* key management security hooks */ |
1541 | #ifdef CONFIG_KEYS | 1597 | #ifdef CONFIG_KEYS |
1542 | int (*key_alloc) (struct key *key, struct task_struct *tsk, unsigned long flags); | 1598 | int (*key_alloc) (struct key *key, const struct cred *cred, unsigned long flags); |
1543 | void (*key_free) (struct key *key); | 1599 | void (*key_free) (struct key *key); |
1544 | int (*key_permission) (key_ref_t key_ref, | 1600 | int (*key_permission) (key_ref_t key_ref, |
1545 | struct task_struct *context, | 1601 | const struct cred *cred, |
1546 | key_perm_t perm); | 1602 | key_perm_t perm); |
1547 | int (*key_getsecurity)(struct key *key, char **_buffer); | 1603 | int (*key_getsecurity)(struct key *key, char **_buffer); |
1548 | #endif /* CONFIG_KEYS */ | 1604 | #endif /* CONFIG_KEYS */ |
@@ -1568,15 +1624,12 @@ int security_capget(struct task_struct *target, | |||
1568 | kernel_cap_t *effective, | 1624 | kernel_cap_t *effective, |
1569 | kernel_cap_t *inheritable, | 1625 | kernel_cap_t *inheritable, |
1570 | kernel_cap_t *permitted); | 1626 | kernel_cap_t *permitted); |
1571 | int security_capset_check(struct task_struct *target, | 1627 | int security_capset(struct cred *new, const struct cred *old, |
1572 | kernel_cap_t *effective, | 1628 | const kernel_cap_t *effective, |
1573 | kernel_cap_t *inheritable, | 1629 | const kernel_cap_t *inheritable, |
1574 | kernel_cap_t *permitted); | 1630 | const kernel_cap_t *permitted); |
1575 | void security_capset_set(struct task_struct *target, | ||
1576 | kernel_cap_t *effective, | ||
1577 | kernel_cap_t *inheritable, | ||
1578 | kernel_cap_t *permitted); | ||
1579 | int security_capable(struct task_struct *tsk, int cap); | 1631 | int security_capable(struct task_struct *tsk, int cap); |
1632 | int security_capable_noaudit(struct task_struct *tsk, int cap); | ||
1580 | int security_acct(struct file *file); | 1633 | int security_acct(struct file *file); |
1581 | int security_sysctl(struct ctl_table *table, int op); | 1634 | int security_sysctl(struct ctl_table *table, int op); |
1582 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1635 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
@@ -1586,17 +1639,15 @@ int security_settime(struct timespec *ts, struct timezone *tz); | |||
1586 | int security_vm_enough_memory(long pages); | 1639 | int security_vm_enough_memory(long pages); |
1587 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); | 1640 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); |
1588 | int security_vm_enough_memory_kern(long pages); | 1641 | int security_vm_enough_memory_kern(long pages); |
1589 | int security_bprm_alloc(struct linux_binprm *bprm); | 1642 | int security_bprm_set_creds(struct linux_binprm *bprm); |
1590 | void security_bprm_free(struct linux_binprm *bprm); | ||
1591 | void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); | ||
1592 | void security_bprm_post_apply_creds(struct linux_binprm *bprm); | ||
1593 | int security_bprm_set(struct linux_binprm *bprm); | ||
1594 | int security_bprm_check(struct linux_binprm *bprm); | 1643 | int security_bprm_check(struct linux_binprm *bprm); |
1644 | void security_bprm_committing_creds(struct linux_binprm *bprm); | ||
1645 | void security_bprm_committed_creds(struct linux_binprm *bprm); | ||
1595 | int security_bprm_secureexec(struct linux_binprm *bprm); | 1646 | int security_bprm_secureexec(struct linux_binprm *bprm); |
1596 | int security_sb_alloc(struct super_block *sb); | 1647 | int security_sb_alloc(struct super_block *sb); |
1597 | void security_sb_free(struct super_block *sb); | 1648 | void security_sb_free(struct super_block *sb); |
1598 | int security_sb_copy_data(char *orig, char *copy); | 1649 | int security_sb_copy_data(char *orig, char *copy); |
1599 | int security_sb_kern_mount(struct super_block *sb, void *data); | 1650 | int security_sb_kern_mount(struct super_block *sb, int flags, void *data); |
1600 | int security_sb_show_options(struct seq_file *m, struct super_block *sb); | 1651 | int security_sb_show_options(struct seq_file *m, struct super_block *sb); |
1601 | int security_sb_statfs(struct dentry *dentry); | 1652 | int security_sb_statfs(struct dentry *dentry); |
1602 | int security_sb_mount(char *dev_name, struct path *path, | 1653 | int security_sb_mount(char *dev_name, struct path *path, |
@@ -1663,13 +1714,16 @@ int security_file_set_fowner(struct file *file); | |||
1663 | int security_file_send_sigiotask(struct task_struct *tsk, | 1714 | int security_file_send_sigiotask(struct task_struct *tsk, |
1664 | struct fown_struct *fown, int sig); | 1715 | struct fown_struct *fown, int sig); |
1665 | int security_file_receive(struct file *file); | 1716 | int security_file_receive(struct file *file); |
1666 | int security_dentry_open(struct file *file); | 1717 | int security_dentry_open(struct file *file, const struct cred *cred); |
1667 | int security_task_create(unsigned long clone_flags); | 1718 | int security_task_create(unsigned long clone_flags); |
1668 | int security_task_alloc(struct task_struct *p); | 1719 | void security_cred_free(struct cred *cred); |
1669 | void security_task_free(struct task_struct *p); | 1720 | int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); |
1721 | void security_commit_creds(struct cred *new, const struct cred *old); | ||
1722 | int security_kernel_act_as(struct cred *new, u32 secid); | ||
1723 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); | ||
1670 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); | 1724 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); |
1671 | int security_task_post_setuid(uid_t old_ruid, uid_t old_euid, | 1725 | int security_task_fix_setuid(struct cred *new, const struct cred *old, |
1672 | uid_t old_suid, int flags); | 1726 | int flags); |
1673 | int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags); | 1727 | int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags); |
1674 | int security_task_setpgid(struct task_struct *p, pid_t pgid); | 1728 | int security_task_setpgid(struct task_struct *p, pid_t pgid); |
1675 | int security_task_getpgid(struct task_struct *p); | 1729 | int security_task_getpgid(struct task_struct *p); |
@@ -1688,8 +1742,7 @@ int security_task_kill(struct task_struct *p, struct siginfo *info, | |||
1688 | int sig, u32 secid); | 1742 | int sig, u32 secid); |
1689 | int security_task_wait(struct task_struct *p); | 1743 | int security_task_wait(struct task_struct *p); |
1690 | int security_task_prctl(int option, unsigned long arg2, unsigned long arg3, | 1744 | int security_task_prctl(int option, unsigned long arg2, unsigned long arg3, |
1691 | unsigned long arg4, unsigned long arg5, long *rc_p); | 1745 | unsigned long arg4, unsigned long arg5); |
1692 | void security_task_reparent_to_init(struct task_struct *p); | ||
1693 | void security_task_to_inode(struct task_struct *p, struct inode *inode); | 1746 | void security_task_to_inode(struct task_struct *p, struct inode *inode); |
1694 | int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag); | 1747 | int security_ipc_permission(struct kern_ipc_perm *ipcp, short flag); |
1695 | void security_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid); | 1748 | void security_ipc_getsecid(struct kern_ipc_perm *ipcp, u32 *secid); |
@@ -1764,25 +1817,23 @@ static inline int security_capget(struct task_struct *target, | |||
1764 | return cap_capget(target, effective, inheritable, permitted); | 1817 | return cap_capget(target, effective, inheritable, permitted); |
1765 | } | 1818 | } |
1766 | 1819 | ||
1767 | static inline int security_capset_check(struct task_struct *target, | 1820 | static inline int security_capset(struct cred *new, |
1768 | kernel_cap_t *effective, | 1821 | const struct cred *old, |
1769 | kernel_cap_t *inheritable, | 1822 | const kernel_cap_t *effective, |
1770 | kernel_cap_t *permitted) | 1823 | const kernel_cap_t *inheritable, |
1824 | const kernel_cap_t *permitted) | ||
1771 | { | 1825 | { |
1772 | return cap_capset_check(target, effective, inheritable, permitted); | 1826 | return cap_capset(new, old, effective, inheritable, permitted); |
1773 | } | 1827 | } |
1774 | 1828 | ||
1775 | static inline void security_capset_set(struct task_struct *target, | 1829 | static inline int security_capable(struct task_struct *tsk, int cap) |
1776 | kernel_cap_t *effective, | ||
1777 | kernel_cap_t *inheritable, | ||
1778 | kernel_cap_t *permitted) | ||
1779 | { | 1830 | { |
1780 | cap_capset_set(target, effective, inheritable, permitted); | 1831 | return cap_capable(tsk, cap, SECURITY_CAP_AUDIT); |
1781 | } | 1832 | } |
1782 | 1833 | ||
1783 | static inline int security_capable(struct task_struct *tsk, int cap) | 1834 | static inline int security_capable_noaudit(struct task_struct *tsk, int cap) |
1784 | { | 1835 | { |
1785 | return cap_capable(tsk, cap); | 1836 | return cap_capable(tsk, cap, SECURITY_CAP_NOAUDIT); |
1786 | } | 1837 | } |
1787 | 1838 | ||
1788 | static inline int security_acct(struct file *file) | 1839 | static inline int security_acct(struct file *file) |
@@ -1835,32 +1886,22 @@ static inline int security_vm_enough_memory_kern(long pages) | |||
1835 | return cap_vm_enough_memory(current->mm, pages); | 1886 | return cap_vm_enough_memory(current->mm, pages); |
1836 | } | 1887 | } |
1837 | 1888 | ||
1838 | static inline int security_bprm_alloc(struct linux_binprm *bprm) | 1889 | static inline int security_bprm_set_creds(struct linux_binprm *bprm) |
1839 | { | ||
1840 | return 0; | ||
1841 | } | ||
1842 | |||
1843 | static inline void security_bprm_free(struct linux_binprm *bprm) | ||
1844 | { } | ||
1845 | |||
1846 | static inline void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe) | ||
1847 | { | 1890 | { |
1848 | cap_bprm_apply_creds(bprm, unsafe); | 1891 | return cap_bprm_set_creds(bprm); |
1849 | } | 1892 | } |
1850 | 1893 | ||
1851 | static inline void security_bprm_post_apply_creds(struct linux_binprm *bprm) | 1894 | static inline int security_bprm_check(struct linux_binprm *bprm) |
1852 | { | 1895 | { |
1853 | return; | 1896 | return 0; |
1854 | } | 1897 | } |
1855 | 1898 | ||
1856 | static inline int security_bprm_set(struct linux_binprm *bprm) | 1899 | static inline void security_bprm_committing_creds(struct linux_binprm *bprm) |
1857 | { | 1900 | { |
1858 | return cap_bprm_set_security(bprm); | ||
1859 | } | 1901 | } |
1860 | 1902 | ||
1861 | static inline int security_bprm_check(struct linux_binprm *bprm) | 1903 | static inline void security_bprm_committed_creds(struct linux_binprm *bprm) |
1862 | { | 1904 | { |
1863 | return 0; | ||
1864 | } | 1905 | } |
1865 | 1906 | ||
1866 | static inline int security_bprm_secureexec(struct linux_binprm *bprm) | 1907 | static inline int security_bprm_secureexec(struct linux_binprm *bprm) |
@@ -1881,7 +1922,7 @@ static inline int security_sb_copy_data(char *orig, char *copy) | |||
1881 | return 0; | 1922 | return 0; |
1882 | } | 1923 | } |
1883 | 1924 | ||
1884 | static inline int security_sb_kern_mount(struct super_block *sb, void *data) | 1925 | static inline int security_sb_kern_mount(struct super_block *sb, int flags, void *data) |
1885 | { | 1926 | { |
1886 | return 0; | 1927 | return 0; |
1887 | } | 1928 | } |
@@ -2177,7 +2218,8 @@ static inline int security_file_receive(struct file *file) | |||
2177 | return 0; | 2218 | return 0; |
2178 | } | 2219 | } |
2179 | 2220 | ||
2180 | static inline int security_dentry_open(struct file *file) | 2221 | static inline int security_dentry_open(struct file *file, |
2222 | const struct cred *cred) | ||
2181 | { | 2223 | { |
2182 | return 0; | 2224 | return 0; |
2183 | } | 2225 | } |
@@ -2187,13 +2229,31 @@ static inline int security_task_create(unsigned long clone_flags) | |||
2187 | return 0; | 2229 | return 0; |
2188 | } | 2230 | } |
2189 | 2231 | ||
2190 | static inline int security_task_alloc(struct task_struct *p) | 2232 | static inline void security_cred_free(struct cred *cred) |
2233 | { } | ||
2234 | |||
2235 | static inline int security_prepare_creds(struct cred *new, | ||
2236 | const struct cred *old, | ||
2237 | gfp_t gfp) | ||
2191 | { | 2238 | { |
2192 | return 0; | 2239 | return 0; |
2193 | } | 2240 | } |
2194 | 2241 | ||
2195 | static inline void security_task_free(struct task_struct *p) | 2242 | static inline void security_commit_creds(struct cred *new, |
2196 | { } | 2243 | const struct cred *old) |
2244 | { | ||
2245 | } | ||
2246 | |||
2247 | static inline int security_kernel_act_as(struct cred *cred, u32 secid) | ||
2248 | { | ||
2249 | return 0; | ||
2250 | } | ||
2251 | |||
2252 | static inline int security_kernel_create_files_as(struct cred *cred, | ||
2253 | struct inode *inode) | ||
2254 | { | ||
2255 | return 0; | ||
2256 | } | ||
2197 | 2257 | ||
2198 | static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, | 2258 | static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, |
2199 | int flags) | 2259 | int flags) |
@@ -2201,10 +2261,11 @@ static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, | |||
2201 | return 0; | 2261 | return 0; |
2202 | } | 2262 | } |
2203 | 2263 | ||
2204 | static inline int security_task_post_setuid(uid_t old_ruid, uid_t old_euid, | 2264 | static inline int security_task_fix_setuid(struct cred *new, |
2205 | uid_t old_suid, int flags) | 2265 | const struct cred *old, |
2266 | int flags) | ||
2206 | { | 2267 | { |
2207 | return cap_task_post_setuid(old_ruid, old_euid, old_suid, flags); | 2268 | return cap_task_fix_setuid(new, old, flags); |
2208 | } | 2269 | } |
2209 | 2270 | ||
2210 | static inline int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, | 2271 | static inline int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, |
@@ -2291,14 +2352,9 @@ static inline int security_task_wait(struct task_struct *p) | |||
2291 | static inline int security_task_prctl(int option, unsigned long arg2, | 2352 | static inline int security_task_prctl(int option, unsigned long arg2, |
2292 | unsigned long arg3, | 2353 | unsigned long arg3, |
2293 | unsigned long arg4, | 2354 | unsigned long arg4, |
2294 | unsigned long arg5, long *rc_p) | 2355 | unsigned long arg5) |
2295 | { | 2356 | { |
2296 | return cap_task_prctl(option, arg2, arg3, arg3, arg5, rc_p); | 2357 | return cap_task_prctl(option, arg2, arg3, arg3, arg5); |
2297 | } | ||
2298 | |||
2299 | static inline void security_task_reparent_to_init(struct task_struct *p) | ||
2300 | { | ||
2301 | cap_task_reparent_to_init(p); | ||
2302 | } | 2358 | } |
2303 | 2359 | ||
2304 | static inline void security_task_to_inode(struct task_struct *p, struct inode *inode) | 2360 | static inline void security_task_to_inode(struct task_struct *p, struct inode *inode) |
@@ -2721,19 +2777,84 @@ static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi | |||
2721 | 2777 | ||
2722 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ | 2778 | #endif /* CONFIG_SECURITY_NETWORK_XFRM */ |
2723 | 2779 | ||
2780 | #ifdef CONFIG_SECURITY_PATH | ||
2781 | int security_path_unlink(struct path *dir, struct dentry *dentry); | ||
2782 | int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode); | ||
2783 | int security_path_rmdir(struct path *dir, struct dentry *dentry); | ||
2784 | int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, | ||
2785 | unsigned int dev); | ||
2786 | int security_path_truncate(struct path *path, loff_t length, | ||
2787 | unsigned int time_attrs); | ||
2788 | int security_path_symlink(struct path *dir, struct dentry *dentry, | ||
2789 | const char *old_name); | ||
2790 | int security_path_link(struct dentry *old_dentry, struct path *new_dir, | ||
2791 | struct dentry *new_dentry); | ||
2792 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, | ||
2793 | struct path *new_dir, struct dentry *new_dentry); | ||
2794 | #else /* CONFIG_SECURITY_PATH */ | ||
2795 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) | ||
2796 | { | ||
2797 | return 0; | ||
2798 | } | ||
2799 | |||
2800 | static inline int security_path_mkdir(struct path *dir, struct dentry *dentry, | ||
2801 | int mode) | ||
2802 | { | ||
2803 | return 0; | ||
2804 | } | ||
2805 | |||
2806 | static inline int security_path_rmdir(struct path *dir, struct dentry *dentry) | ||
2807 | { | ||
2808 | return 0; | ||
2809 | } | ||
2810 | |||
2811 | static inline int security_path_mknod(struct path *dir, struct dentry *dentry, | ||
2812 | int mode, unsigned int dev) | ||
2813 | { | ||
2814 | return 0; | ||
2815 | } | ||
2816 | |||
2817 | static inline int security_path_truncate(struct path *path, loff_t length, | ||
2818 | unsigned int time_attrs) | ||
2819 | { | ||
2820 | return 0; | ||
2821 | } | ||
2822 | |||
2823 | static inline int security_path_symlink(struct path *dir, struct dentry *dentry, | ||
2824 | const char *old_name) | ||
2825 | { | ||
2826 | return 0; | ||
2827 | } | ||
2828 | |||
2829 | static inline int security_path_link(struct dentry *old_dentry, | ||
2830 | struct path *new_dir, | ||
2831 | struct dentry *new_dentry) | ||
2832 | { | ||
2833 | return 0; | ||
2834 | } | ||
2835 | |||
2836 | static inline int security_path_rename(struct path *old_dir, | ||
2837 | struct dentry *old_dentry, | ||
2838 | struct path *new_dir, | ||
2839 | struct dentry *new_dentry) | ||
2840 | { | ||
2841 | return 0; | ||
2842 | } | ||
2843 | #endif /* CONFIG_SECURITY_PATH */ | ||
2844 | |||
2724 | #ifdef CONFIG_KEYS | 2845 | #ifdef CONFIG_KEYS |
2725 | #ifdef CONFIG_SECURITY | 2846 | #ifdef CONFIG_SECURITY |
2726 | 2847 | ||
2727 | int security_key_alloc(struct key *key, struct task_struct *tsk, unsigned long flags); | 2848 | int security_key_alloc(struct key *key, const struct cred *cred, unsigned long flags); |
2728 | void security_key_free(struct key *key); | 2849 | void security_key_free(struct key *key); |
2729 | int security_key_permission(key_ref_t key_ref, | 2850 | int security_key_permission(key_ref_t key_ref, |
2730 | struct task_struct *context, key_perm_t perm); | 2851 | const struct cred *cred, key_perm_t perm); |
2731 | int security_key_getsecurity(struct key *key, char **_buffer); | 2852 | int security_key_getsecurity(struct key *key, char **_buffer); |
2732 | 2853 | ||
2733 | #else | 2854 | #else |
2734 | 2855 | ||
2735 | static inline int security_key_alloc(struct key *key, | 2856 | static inline int security_key_alloc(struct key *key, |
2736 | struct task_struct *tsk, | 2857 | const struct cred *cred, |
2737 | unsigned long flags) | 2858 | unsigned long flags) |
2738 | { | 2859 | { |
2739 | return 0; | 2860 | return 0; |
@@ -2744,7 +2865,7 @@ static inline void security_key_free(struct key *key) | |||
2744 | } | 2865 | } |
2745 | 2866 | ||
2746 | static inline int security_key_permission(key_ref_t key_ref, | 2867 | static inline int security_key_permission(key_ref_t key_ref, |
2747 | struct task_struct *context, | 2868 | const struct cred *cred, |
2748 | key_perm_t perm) | 2869 | key_perm_t perm) |
2749 | { | 2870 | { |
2750 | return 0; | 2871 | return 0; |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index dc50bcc282a8..b3dfa72f13b9 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -34,6 +34,7 @@ struct seq_operations { | |||
34 | 34 | ||
35 | #define SEQ_SKIP 1 | 35 | #define SEQ_SKIP 1 |
36 | 36 | ||
37 | char *mangle_path(char *s, char *p, char *esc); | ||
37 | int seq_open(struct file *, const struct seq_operations *); | 38 | int seq_open(struct file *, const struct seq_operations *); |
38 | ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); | 39 | ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); |
39 | loff_t seq_lseek(struct file *, loff_t, int); | 40 | loff_t seq_lseek(struct file *, loff_t, int); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 4e4f1277f3bf..feb3b939ec4b 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -158,6 +158,8 @@ | |||
158 | /* SH-SCI */ | 158 | /* SH-SCI */ |
159 | #define PORT_SCIFA 83 | 159 | #define PORT_SCIFA 83 |
160 | 160 | ||
161 | #define PORT_S3C6400 84 | ||
162 | |||
161 | #ifdef __KERNEL__ | 163 | #ifdef __KERNEL__ |
162 | 164 | ||
163 | #include <linux/compiler.h> | 165 | #include <linux/compiler.h> |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2725f4e5a9bf..cf2cb50f77d1 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -250,6 +250,9 @@ typedef unsigned char *sk_buff_data_t; | |||
250 | * @tc_verd: traffic control verdict | 250 | * @tc_verd: traffic control verdict |
251 | * @ndisc_nodetype: router type (from link layer) | 251 | * @ndisc_nodetype: router type (from link layer) |
252 | * @do_not_encrypt: set to prevent encryption of this frame | 252 | * @do_not_encrypt: set to prevent encryption of this frame |
253 | * @requeue: set to indicate that the wireless core should attempt | ||
254 | * a software retry on this frame if we failed to | ||
255 | * receive an ACK for it | ||
253 | * @dma_cookie: a cookie to one of several possible DMA operations | 256 | * @dma_cookie: a cookie to one of several possible DMA operations |
254 | * done by skb DMA functions | 257 | * done by skb DMA functions |
255 | * @secmark: security marking | 258 | * @secmark: security marking |
@@ -269,8 +272,9 @@ struct sk_buff { | |||
269 | struct dst_entry *dst; | 272 | struct dst_entry *dst; |
270 | struct rtable *rtable; | 273 | struct rtable *rtable; |
271 | }; | 274 | }; |
275 | #ifdef CONFIG_XFRM | ||
272 | struct sec_path *sp; | 276 | struct sec_path *sp; |
273 | 277 | #endif | |
274 | /* | 278 | /* |
275 | * This is the control buffer. It is free to use for every | 279 | * This is the control buffer. It is free to use for every |
276 | * layer. Please put your private variables there. If you | 280 | * layer. Please put your private variables there. If you |
@@ -325,6 +329,7 @@ struct sk_buff { | |||
325 | #endif | 329 | #endif |
326 | #if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) | 330 | #if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) |
327 | __u8 do_not_encrypt:1; | 331 | __u8 do_not_encrypt:1; |
332 | __u8 requeue:1; | ||
328 | #endif | 333 | #endif |
329 | /* 0/13/14 bit hole */ | 334 | /* 0/13/14 bit hole */ |
330 | 335 | ||
@@ -488,6 +493,19 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list, | |||
488 | } | 493 | } |
489 | 494 | ||
490 | /** | 495 | /** |
496 | * skb_queue_is_first - check if skb is the first entry in the queue | ||
497 | * @list: queue head | ||
498 | * @skb: buffer | ||
499 | * | ||
500 | * Returns true if @skb is the first buffer on the list. | ||
501 | */ | ||
502 | static inline bool skb_queue_is_first(const struct sk_buff_head *list, | ||
503 | const struct sk_buff *skb) | ||
504 | { | ||
505 | return (skb->prev == (struct sk_buff *) list); | ||
506 | } | ||
507 | |||
508 | /** | ||
491 | * skb_queue_next - return the next packet in the queue | 509 | * skb_queue_next - return the next packet in the queue |
492 | * @list: queue head | 510 | * @list: queue head |
493 | * @skb: current buffer | 511 | * @skb: current buffer |
@@ -506,6 +524,24 @@ static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list, | |||
506 | } | 524 | } |
507 | 525 | ||
508 | /** | 526 | /** |
527 | * skb_queue_prev - return the prev packet in the queue | ||
528 | * @list: queue head | ||
529 | * @skb: current buffer | ||
530 | * | ||
531 | * Return the prev packet in @list before @skb. It is only valid to | ||
532 | * call this if skb_queue_is_first() evaluates to false. | ||
533 | */ | ||
534 | static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list, | ||
535 | const struct sk_buff *skb) | ||
536 | { | ||
537 | /* This BUG_ON may seem severe, but if we just return then we | ||
538 | * are going to dereference garbage. | ||
539 | */ | ||
540 | BUG_ON(skb_queue_is_first(list, skb)); | ||
541 | return skb->prev; | ||
542 | } | ||
543 | |||
544 | /** | ||
509 | * skb_get - reference buffer | 545 | * skb_get - reference buffer |
510 | * @skb: buffer to reference | 546 | * @skb: buffer to reference |
511 | * | 547 | * |
@@ -1647,8 +1683,12 @@ extern int skb_splice_bits(struct sk_buff *skb, | |||
1647 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | 1683 | extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); |
1648 | extern void skb_split(struct sk_buff *skb, | 1684 | extern void skb_split(struct sk_buff *skb, |
1649 | struct sk_buff *skb1, const u32 len); | 1685 | struct sk_buff *skb1, const u32 len); |
1686 | extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, | ||
1687 | int shiftlen); | ||
1650 | 1688 | ||
1651 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); | 1689 | extern struct sk_buff *skb_segment(struct sk_buff *skb, int features); |
1690 | extern int skb_gro_receive(struct sk_buff **head, | ||
1691 | struct sk_buff *skb); | ||
1652 | 1692 | ||
1653 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 1693 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
1654 | int len, void *buffer) | 1694 | int len, void *buffer) |
@@ -1864,6 +1904,18 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu | |||
1864 | to->queue_mapping = from->queue_mapping; | 1904 | to->queue_mapping = from->queue_mapping; |
1865 | } | 1905 | } |
1866 | 1906 | ||
1907 | #ifdef CONFIG_XFRM | ||
1908 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | ||
1909 | { | ||
1910 | return skb->sp; | ||
1911 | } | ||
1912 | #else | ||
1913 | static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | ||
1914 | { | ||
1915 | return NULL; | ||
1916 | } | ||
1917 | #endif | ||
1918 | |||
1867 | static inline int skb_is_gso(const struct sk_buff *skb) | 1919 | static inline int skb_is_gso(const struct sk_buff *skb) |
1868 | { | 1920 | { |
1869 | return skb_shinfo(skb)->gso_size; | 1921 | return skb_shinfo(skb)->gso_size; |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 000da12b5cf0..f96d13c281e8 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -253,9 +253,9 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep, | |||
253 | * request comes from. | 253 | * request comes from. |
254 | */ | 254 | */ |
255 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) | 255 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) |
256 | extern void *__kmalloc_track_caller(size_t, gfp_t, void*); | 256 | extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long); |
257 | #define kmalloc_track_caller(size, flags) \ | 257 | #define kmalloc_track_caller(size, flags) \ |
258 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) | 258 | __kmalloc_track_caller(size, flags, _RET_IP_) |
259 | #else | 259 | #else |
260 | #define kmalloc_track_caller(size, flags) \ | 260 | #define kmalloc_track_caller(size, flags) \ |
261 | __kmalloc(size, flags) | 261 | __kmalloc(size, flags) |
@@ -271,10 +271,10 @@ extern void *__kmalloc_track_caller(size_t, gfp_t, void*); | |||
271 | * allocation request comes from. | 271 | * allocation request comes from. |
272 | */ | 272 | */ |
273 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) | 273 | #if defined(CONFIG_DEBUG_SLAB) || defined(CONFIG_SLUB) |
274 | extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); | 274 | extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long); |
275 | #define kmalloc_node_track_caller(size, flags, node) \ | 275 | #define kmalloc_node_track_caller(size, flags, node) \ |
276 | __kmalloc_node_track_caller(size, flags, node, \ | 276 | __kmalloc_node_track_caller(size, flags, node, \ |
277 | __builtin_return_address(0)) | 277 | _RET_IP_) |
278 | #else | 278 | #else |
279 | #define kmalloc_node_track_caller(size, flags, node) \ | 279 | #define kmalloc_node_track_caller(size, flags, node) \ |
280 | __kmalloc_node(size, flags, node) | 280 | __kmalloc_node(size, flags, node) |
@@ -285,7 +285,7 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *); | |||
285 | #define kmalloc_node_track_caller(size, flags, node) \ | 285 | #define kmalloc_node_track_caller(size, flags, node) \ |
286 | kmalloc_track_caller(size, flags) | 286 | kmalloc_track_caller(size, flags) |
287 | 287 | ||
288 | #endif /* DEBUG_SLAB */ | 288 | #endif /* CONFIG_NUMA */ |
289 | 289 | ||
290 | /* | 290 | /* |
291 | * Shortcuts | 291 | * Shortcuts |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 3f9a60043a97..6e7ba16ff454 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -146,6 +146,8 @@ static inline void smp_send_reschedule(int cpu) { } | |||
146 | }) | 146 | }) |
147 | #define smp_call_function_mask(mask, func, info, wait) \ | 147 | #define smp_call_function_mask(mask, func, info, wait) \ |
148 | (up_smp_call_function(func, info)) | 148 | (up_smp_call_function(func, info)) |
149 | #define smp_call_function_many(mask, func, info, wait) \ | ||
150 | (up_smp_call_function(func, info)) | ||
149 | static inline void init_call_single_data(void) | 151 | static inline void init_call_single_data(void) |
150 | { | 152 | { |
151 | } | 153 | } |
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h new file mode 100644 index 000000000000..1cbf0313adde --- /dev/null +++ b/include/linux/smsc911x.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /*************************************************************************** | ||
2 | * | ||
3 | * Copyright (C) 2004-2008 SMSC | ||
4 | * Copyright (C) 2005-2008 ARM | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version 2 | ||
9 | * of the License, or (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
19 | * | ||
20 | ***************************************************************************/ | ||
21 | #ifndef __LINUX_SMSC911X_H__ | ||
22 | #define __LINUX_SMSC911X_H__ | ||
23 | |||
24 | #include <linux/phy.h> | ||
25 | |||
26 | /* platform_device configuration data, should be assigned to | ||
27 | * the platform_device's dev.platform_data */ | ||
28 | struct smsc911x_platform_config { | ||
29 | unsigned int irq_polarity; | ||
30 | unsigned int irq_type; | ||
31 | unsigned int flags; | ||
32 | phy_interface_t phy_interface; | ||
33 | }; | ||
34 | |||
35 | /* Constants for platform_device irq polarity configuration */ | ||
36 | #define SMSC911X_IRQ_POLARITY_ACTIVE_LOW 0 | ||
37 | #define SMSC911X_IRQ_POLARITY_ACTIVE_HIGH 1 | ||
38 | |||
39 | /* Constants for platform_device irq type configuration */ | ||
40 | #define SMSC911X_IRQ_TYPE_OPEN_DRAIN 0 | ||
41 | #define SMSC911X_IRQ_TYPE_PUSH_PULL 1 | ||
42 | |||
43 | /* Constants for flags */ | ||
44 | #define SMSC911X_USE_16BIT (BIT(0)) | ||
45 | #define SMSC911X_USE_32BIT (BIT(1)) | ||
46 | |||
47 | #endif /* __LINUX_SMSC911X_H__ */ | ||
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 7a6e6bba4a71..aee3f1e1d1ce 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
@@ -216,6 +216,9 @@ enum | |||
216 | LINUX_MIB_TCPSPURIOUSRTOS, /* TCPSpuriousRTOs */ | 216 | LINUX_MIB_TCPSPURIOUSRTOS, /* TCPSpuriousRTOs */ |
217 | LINUX_MIB_TCPMD5NOTFOUND, /* TCPMD5NotFound */ | 217 | LINUX_MIB_TCPMD5NOTFOUND, /* TCPMD5NotFound */ |
218 | LINUX_MIB_TCPMD5UNEXPECTED, /* TCPMD5Unexpected */ | 218 | LINUX_MIB_TCPMD5UNEXPECTED, /* TCPMD5Unexpected */ |
219 | LINUX_MIB_SACKSHIFTED, | ||
220 | LINUX_MIB_SACKMERGED, | ||
221 | LINUX_MIB_SACKSHIFTFALLBACK, | ||
219 | __LINUX_MIB_MAX | 222 | __LINUX_MIB_MAX |
220 | }; | 223 | }; |
221 | 224 | ||
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index b106fd8e0d5c..1a8cecc4f38c 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -15,9 +15,17 @@ extern void save_stack_trace_tsk(struct task_struct *tsk, | |||
15 | struct stack_trace *trace); | 15 | struct stack_trace *trace); |
16 | 16 | ||
17 | extern void print_stack_trace(struct stack_trace *trace, int spaces); | 17 | extern void print_stack_trace(struct stack_trace *trace, int spaces); |
18 | |||
19 | #ifdef CONFIG_USER_STACKTRACE_SUPPORT | ||
20 | extern void save_stack_trace_user(struct stack_trace *trace); | ||
21 | #else | ||
22 | # define save_stack_trace_user(trace) do { } while (0) | ||
23 | #endif | ||
24 | |||
18 | #else | 25 | #else |
19 | # define save_stack_trace(trace) do { } while (0) | 26 | # define save_stack_trace(trace) do { } while (0) |
20 | # define save_stack_trace_tsk(tsk, trace) do { } while (0) | 27 | # define save_stack_trace_tsk(tsk, trace) do { } while (0) |
28 | # define save_stack_trace_user(trace) do { } while (0) | ||
21 | # define print_stack_trace(trace, spaces) do { } while (0) | 29 | # define print_stack_trace(trace, spaces) do { } while (0) |
22 | #endif | 30 | #endif |
23 | 31 | ||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 6f0ee1b84a4f..c39a21040dcb 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -58,6 +58,7 @@ struct rpc_clnt { | |||
58 | struct rpc_timeout cl_timeout_default; | 58 | struct rpc_timeout cl_timeout_default; |
59 | struct rpc_program * cl_program; | 59 | struct rpc_program * cl_program; |
60 | char cl_inline_name[32]; | 60 | char cl_inline_name[32]; |
61 | char *cl_principal; /* target to authenticate to */ | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | /* | 64 | /* |
@@ -108,6 +109,7 @@ struct rpc_create_args { | |||
108 | u32 version; | 109 | u32 version; |
109 | rpc_authflavor_t authflavor; | 110 | rpc_authflavor_t authflavor; |
110 | unsigned long flags; | 111 | unsigned long flags; |
112 | char *client_name; | ||
111 | }; | 113 | }; |
112 | 114 | ||
113 | /* Values for "flags" field */ | 115 | /* Values for "flags" field */ |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index 51b977a4ca20..cea764c2359f 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
@@ -15,6 +15,7 @@ struct rpc_pipe_ops { | |||
15 | ssize_t (*upcall)(struct file *, struct rpc_pipe_msg *, char __user *, size_t); | 15 | ssize_t (*upcall)(struct file *, struct rpc_pipe_msg *, char __user *, size_t); |
16 | ssize_t (*downcall)(struct file *, const char __user *, size_t); | 16 | ssize_t (*downcall)(struct file *, const char __user *, size_t); |
17 | void (*release_pipe)(struct inode *); | 17 | void (*release_pipe)(struct inode *); |
18 | int (*open_pipe)(struct inode *); | ||
18 | void (*destroy_msg)(struct rpc_pipe_msg *); | 19 | void (*destroy_msg)(struct rpc_pipe_msg *); |
19 | }; | 20 | }; |
20 | 21 | ||
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 6fd7b016517f..0127daca4354 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -139,14 +139,14 @@ static inline char *__svc_print_addr(struct sockaddr *addr, | |||
139 | { | 139 | { |
140 | switch (addr->sa_family) { | 140 | switch (addr->sa_family) { |
141 | case AF_INET: | 141 | case AF_INET: |
142 | snprintf(buf, len, "%u.%u.%u.%u, port=%u", | 142 | snprintf(buf, len, "%pI4, port=%u", |
143 | NIPQUAD(((struct sockaddr_in *) addr)->sin_addr), | 143 | &((struct sockaddr_in *)addr)->sin_addr, |
144 | ntohs(((struct sockaddr_in *) addr)->sin_port)); | 144 | ntohs(((struct sockaddr_in *) addr)->sin_port)); |
145 | break; | 145 | break; |
146 | 146 | ||
147 | case AF_INET6: | 147 | case AF_INET6: |
148 | snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", | 148 | snprintf(buf, len, "%pI6, port=%u", |
149 | NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), | 149 | &((struct sockaddr_in6 *)addr)->sin6_addr, |
150 | ntohs(((struct sockaddr_in6 *) addr)->sin6_port)); | 150 | ntohs(((struct sockaddr_in6 *) addr)->sin6_port)); |
151 | break; | 151 | break; |
152 | 152 | ||
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h index c9165d9771a8..ca7d725861fc 100644 --- a/include/linux/sunrpc/svcauth_gss.h +++ b/include/linux/sunrpc/svcauth_gss.h | |||
@@ -20,6 +20,7 @@ int gss_svc_init(void); | |||
20 | void gss_svc_shutdown(void); | 20 | void gss_svc_shutdown(void); |
21 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); | 21 | int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); |
22 | u32 svcauth_gss_flavor(struct auth_domain *dom); | 22 | u32 svcauth_gss_flavor(struct auth_domain *dom); |
23 | char *svc_gss_principal(struct svc_rqst *); | ||
23 | 24 | ||
24 | #endif /* __KERNEL__ */ | 25 | #endif /* __KERNEL__ */ |
25 | #endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */ | 26 | #endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index e4057d729f03..49e1eb454465 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -37,21 +37,6 @@ struct xdr_netobj { | |||
37 | typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); | 37 | typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * We're still requiring the BKL in the xdr code until it's been | ||
41 | * more carefully audited, at which point this wrapper will become | ||
42 | * unnecessary. | ||
43 | */ | ||
44 | static inline int rpc_call_xdrproc(kxdrproc_t xdrproc, void *rqstp, __be32 *data, void *obj) | ||
45 | { | ||
46 | int ret; | ||
47 | |||
48 | lock_kernel(); | ||
49 | ret = xdrproc(rqstp, data, obj); | ||
50 | unlock_kernel(); | ||
51 | return ret; | ||
52 | } | ||
53 | |||
54 | /* | ||
55 | * Basic structure for transmission/reception of a client XDR message. | 40 | * Basic structure for transmission/reception of a client XDR message. |
56 | * Features a header (for a linear buffer containing RPC headers | 41 | * Features a header (for a linear buffer containing RPC headers |
57 | * and the data payload for short messages), and then an array of | 42 | * and the data payload for short messages), and then an array of |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 4d80a118d538..11fc71d50c1e 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -76,8 +76,7 @@ struct rpc_rqst { | |||
76 | struct list_head rq_list; | 76 | struct list_head rq_list; |
77 | 77 | ||
78 | __u32 * rq_buffer; /* XDR encode buffer */ | 78 | __u32 * rq_buffer; /* XDR encode buffer */ |
79 | size_t rq_bufsize, | 79 | size_t rq_callsize, |
80 | rq_callsize, | ||
81 | rq_rcvsize; | 80 | rq_rcvsize; |
82 | 81 | ||
83 | struct xdr_buf rq_private_buf; /* The receive buffer | 82 | struct xdr_buf rq_private_buf; /* The receive buffer |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index b18ec5533e8c..325af1de0351 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -7,9 +7,31 @@ struct device; | |||
7 | struct dma_attrs; | 7 | struct dma_attrs; |
8 | struct scatterlist; | 8 | struct scatterlist; |
9 | 9 | ||
10 | /* | ||
11 | * Maximum allowable number of contiguous slabs to map, | ||
12 | * must be a power of 2. What is the appropriate value ? | ||
13 | * The complexity of {map,unmap}_single is linearly dependent on this value. | ||
14 | */ | ||
15 | #define IO_TLB_SEGSIZE 128 | ||
16 | |||
17 | |||
18 | /* | ||
19 | * log of the size of each IO TLB slab. The number of slabs is command line | ||
20 | * controllable. | ||
21 | */ | ||
22 | #define IO_TLB_SHIFT 11 | ||
23 | |||
10 | extern void | 24 | extern void |
11 | swiotlb_init(void); | 25 | swiotlb_init(void); |
12 | 26 | ||
27 | extern void *swiotlb_alloc_boot(size_t bytes, unsigned long nslabs); | ||
28 | extern void *swiotlb_alloc(unsigned order, unsigned long nslabs); | ||
29 | |||
30 | extern dma_addr_t swiotlb_phys_to_bus(phys_addr_t address); | ||
31 | extern phys_addr_t swiotlb_bus_to_phys(dma_addr_t address); | ||
32 | |||
33 | extern int swiotlb_arch_range_needs_mapping(void *ptr, size_t size); | ||
34 | |||
13 | extern void | 35 | extern void |
14 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 36 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
15 | dma_addr_t *dma_handle, gfp_t flags); | 37 | dma_addr_t *dma_handle, gfp_t flags); |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 9007313b5b71..998a55d80acf 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -53,47 +53,11 @@ | |||
53 | #ifndef _LINUX_TIMEX_H | 53 | #ifndef _LINUX_TIMEX_H |
54 | #define _LINUX_TIMEX_H | 54 | #define _LINUX_TIMEX_H |
55 | 55 | ||
56 | #include <linux/compiler.h> | ||
57 | #include <linux/time.h> | 56 | #include <linux/time.h> |
58 | 57 | ||
59 | #include <asm/param.h> | ||
60 | |||
61 | #define NTP_API 4 /* NTP API version */ | 58 | #define NTP_API 4 /* NTP API version */ |
62 | 59 | ||
63 | /* | 60 | /* |
64 | * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen | ||
65 | * for a slightly underdamped convergence characteristic. SHIFT_KH | ||
66 | * establishes the damping of the FLL and is chosen by wisdom and black | ||
67 | * art. | ||
68 | * | ||
69 | * MAXTC establishes the maximum time constant of the PLL. With the | ||
70 | * SHIFT_KG and SHIFT_KF values given and a time constant range from | ||
71 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, | ||
72 | * respectively. | ||
73 | */ | ||
74 | #define SHIFT_PLL 4 /* PLL frequency factor (shift) */ | ||
75 | #define SHIFT_FLL 2 /* FLL frequency factor (shift) */ | ||
76 | #define MAXTC 10 /* maximum time constant (shift) */ | ||
77 | |||
78 | /* | ||
79 | * SHIFT_USEC defines the scaling (shift) of the time_freq and | ||
80 | * time_tolerance variables, which represent the current frequency | ||
81 | * offset and maximum frequency tolerance. | ||
82 | */ | ||
83 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ | ||
84 | #define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC)) | ||
85 | #define PPM_SCALE_INV_SHIFT 19 | ||
86 | #define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \ | ||
87 | PPM_SCALE + 1) | ||
88 | |||
89 | #define MAXPHASE 500000000l /* max phase error (ns) */ | ||
90 | #define MAXFREQ 500000 /* max frequency error (ns/s) */ | ||
91 | #define MAXFREQ_SCALED ((s64)MAXFREQ << NTP_SCALE_SHIFT) | ||
92 | #define MINSEC 256 /* min interval between updates (s) */ | ||
93 | #define MAXSEC 2048 /* max interval between updates (s) */ | ||
94 | #define NTP_PHASE_LIMIT ((MAXPHASE / NSEC_PER_USEC) << 5) /* beyond max. dispersion */ | ||
95 | |||
96 | /* | ||
97 | * syscall interface - used (mainly by NTP daemon) | 61 | * syscall interface - used (mainly by NTP daemon) |
98 | * to discipline kernel clock oscillator | 62 | * to discipline kernel clock oscillator |
99 | */ | 63 | */ |
@@ -199,9 +163,46 @@ struct timex { | |||
199 | #define TIME_BAD TIME_ERROR /* bw compat */ | 163 | #define TIME_BAD TIME_ERROR /* bw compat */ |
200 | 164 | ||
201 | #ifdef __KERNEL__ | 165 | #ifdef __KERNEL__ |
166 | #include <linux/compiler.h> | ||
167 | #include <linux/types.h> | ||
168 | #include <linux/param.h> | ||
169 | |||
202 | #include <asm/timex.h> | 170 | #include <asm/timex.h> |
203 | 171 | ||
204 | /* | 172 | /* |
173 | * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen | ||
174 | * for a slightly underdamped convergence characteristic. SHIFT_KH | ||
175 | * establishes the damping of the FLL and is chosen by wisdom and black | ||
176 | * art. | ||
177 | * | ||
178 | * MAXTC establishes the maximum time constant of the PLL. With the | ||
179 | * SHIFT_KG and SHIFT_KF values given and a time constant range from | ||
180 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, | ||
181 | * respectively. | ||
182 | */ | ||
183 | #define SHIFT_PLL 4 /* PLL frequency factor (shift) */ | ||
184 | #define SHIFT_FLL 2 /* FLL frequency factor (shift) */ | ||
185 | #define MAXTC 10 /* maximum time constant (shift) */ | ||
186 | |||
187 | /* | ||
188 | * SHIFT_USEC defines the scaling (shift) of the time_freq and | ||
189 | * time_tolerance variables, which represent the current frequency | ||
190 | * offset and maximum frequency tolerance. | ||
191 | */ | ||
192 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ | ||
193 | #define PPM_SCALE (NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC)) | ||
194 | #define PPM_SCALE_INV_SHIFT 19 | ||
195 | #define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \ | ||
196 | PPM_SCALE + 1) | ||
197 | |||
198 | #define MAXPHASE 500000000l /* max phase error (ns) */ | ||
199 | #define MAXFREQ 500000 /* max frequency error (ns/s) */ | ||
200 | #define MAXFREQ_SCALED ((s64)MAXFREQ << NTP_SCALE_SHIFT) | ||
201 | #define MINSEC 256 /* min interval between updates (s) */ | ||
202 | #define MAXSEC 2048 /* max interval between updates (s) */ | ||
203 | #define NTP_PHASE_LIMIT ((MAXPHASE / NSEC_PER_USEC) << 5) /* beyond max. dispersion */ | ||
204 | |||
205 | /* | ||
205 | * kernel variables | 206 | * kernel variables |
206 | * Note: maximum error = NTP synch distance = dispersion + delay / 2; | 207 | * Note: maximum error = NTP synch distance = dispersion + delay / 2; |
207 | * estimated error = NTP dispersion. | 208 | * estimated error = NTP dispersion. |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 117f1b7405cf..0c5b5ac36d8e 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -49,7 +49,7 @@ | |||
49 | for_each_online_node(node) \ | 49 | for_each_online_node(node) \ |
50 | if (nr_cpus_node(node)) | 50 | if (nr_cpus_node(node)) |
51 | 51 | ||
52 | void arch_update_cpu_topology(void); | 52 | int arch_update_cpu_topology(void); |
53 | 53 | ||
54 | /* Conform to ACPI 2.0 SLIT distance definitions */ | 54 | /* Conform to ACPI 2.0 SLIT distance definitions */ |
55 | #define LOCAL_DISTANCE 10 | 55 | #define LOCAL_DISTANCE 10 |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index c5bb39c7a770..757005458366 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -24,8 +24,12 @@ struct tracepoint { | |||
24 | const char *name; /* Tracepoint name */ | 24 | const char *name; /* Tracepoint name */ |
25 | int state; /* State. */ | 25 | int state; /* State. */ |
26 | void **funcs; | 26 | void **funcs; |
27 | } __attribute__((aligned(8))); | 27 | } __attribute__((aligned(32))); /* |
28 | 28 | * Aligned on 32 bytes because it is | |
29 | * globally visible and gcc happily | ||
30 | * align these on the structure size. | ||
31 | * Keep in sync with vmlinux.lds.h. | ||
32 | */ | ||
29 | 33 | ||
30 | #define TPPROTO(args...) args | 34 | #define TPPROTO(args...) args |
31 | #define TPARGS(args...) args | 35 | #define TPARGS(args...) args |
@@ -40,14 +44,14 @@ struct tracepoint { | |||
40 | do { \ | 44 | do { \ |
41 | void **it_func; \ | 45 | void **it_func; \ |
42 | \ | 46 | \ |
43 | rcu_read_lock_sched(); \ | 47 | rcu_read_lock_sched_notrace(); \ |
44 | it_func = rcu_dereference((tp)->funcs); \ | 48 | it_func = rcu_dereference((tp)->funcs); \ |
45 | if (it_func) { \ | 49 | if (it_func) { \ |
46 | do { \ | 50 | do { \ |
47 | ((void(*)(proto))(*it_func))(args); \ | 51 | ((void(*)(proto))(*it_func))(args); \ |
48 | } while (*(++it_func)); \ | 52 | } while (*(++it_func)); \ |
49 | } \ | 53 | } \ |
50 | rcu_read_unlock_sched(); \ | 54 | rcu_read_unlock_sched_notrace(); \ |
51 | } while (0) | 55 | } while (0) |
52 | 56 | ||
53 | /* | 57 | /* |
@@ -55,35 +59,40 @@ struct tracepoint { | |||
55 | * not add unwanted padding between the beginning of the section and the | 59 | * not add unwanted padding between the beginning of the section and the |
56 | * structure. Force alignment to the same alignment as the section start. | 60 | * structure. Force alignment to the same alignment as the section start. |
57 | */ | 61 | */ |
58 | #define DEFINE_TRACE(name, proto, args) \ | 62 | #define DECLARE_TRACE(name, proto, args) \ |
63 | extern struct tracepoint __tracepoint_##name; \ | ||
59 | static inline void trace_##name(proto) \ | 64 | static inline void trace_##name(proto) \ |
60 | { \ | 65 | { \ |
61 | static const char __tpstrtab_##name[] \ | ||
62 | __attribute__((section("__tracepoints_strings"))) \ | ||
63 | = #name ":" #proto; \ | ||
64 | static struct tracepoint __tracepoint_##name \ | ||
65 | __attribute__((section("__tracepoints"), aligned(8))) = \ | ||
66 | { __tpstrtab_##name, 0, NULL }; \ | ||
67 | if (unlikely(__tracepoint_##name.state)) \ | 66 | if (unlikely(__tracepoint_##name.state)) \ |
68 | __DO_TRACE(&__tracepoint_##name, \ | 67 | __DO_TRACE(&__tracepoint_##name, \ |
69 | TPPROTO(proto), TPARGS(args)); \ | 68 | TPPROTO(proto), TPARGS(args)); \ |
70 | } \ | 69 | } \ |
71 | static inline int register_trace_##name(void (*probe)(proto)) \ | 70 | static inline int register_trace_##name(void (*probe)(proto)) \ |
72 | { \ | 71 | { \ |
73 | return tracepoint_probe_register(#name ":" #proto, \ | 72 | return tracepoint_probe_register(#name, (void *)probe); \ |
74 | (void *)probe); \ | ||
75 | } \ | 73 | } \ |
76 | static inline void unregister_trace_##name(void (*probe)(proto))\ | 74 | static inline int unregister_trace_##name(void (*probe)(proto)) \ |
77 | { \ | 75 | { \ |
78 | tracepoint_probe_unregister(#name ":" #proto, \ | 76 | return tracepoint_probe_unregister(#name, (void *)probe);\ |
79 | (void *)probe); \ | ||
80 | } | 77 | } |
81 | 78 | ||
79 | #define DEFINE_TRACE(name) \ | ||
80 | static const char __tpstrtab_##name[] \ | ||
81 | __attribute__((section("__tracepoints_strings"))) = #name; \ | ||
82 | struct tracepoint __tracepoint_##name \ | ||
83 | __attribute__((section("__tracepoints"), aligned(32))) = \ | ||
84 | { __tpstrtab_##name, 0, NULL } | ||
85 | |||
86 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) \ | ||
87 | EXPORT_SYMBOL_GPL(__tracepoint_##name) | ||
88 | #define EXPORT_TRACEPOINT_SYMBOL(name) \ | ||
89 | EXPORT_SYMBOL(__tracepoint_##name) | ||
90 | |||
82 | extern void tracepoint_update_probe_range(struct tracepoint *begin, | 91 | extern void tracepoint_update_probe_range(struct tracepoint *begin, |
83 | struct tracepoint *end); | 92 | struct tracepoint *end); |
84 | 93 | ||
85 | #else /* !CONFIG_TRACEPOINTS */ | 94 | #else /* !CONFIG_TRACEPOINTS */ |
86 | #define DEFINE_TRACE(name, proto, args) \ | 95 | #define DECLARE_TRACE(name, proto, args) \ |
87 | static inline void _do_trace_##name(struct tracepoint *tp, proto) \ | 96 | static inline void _do_trace_##name(struct tracepoint *tp, proto) \ |
88 | { } \ | 97 | { } \ |
89 | static inline void trace_##name(proto) \ | 98 | static inline void trace_##name(proto) \ |
@@ -92,8 +101,14 @@ extern void tracepoint_update_probe_range(struct tracepoint *begin, | |||
92 | { \ | 101 | { \ |
93 | return -ENOSYS; \ | 102 | return -ENOSYS; \ |
94 | } \ | 103 | } \ |
95 | static inline void unregister_trace_##name(void (*probe)(proto))\ | 104 | static inline int unregister_trace_##name(void (*probe)(proto)) \ |
96 | { } | 105 | { \ |
106 | return -ENOSYS; \ | ||
107 | } | ||
108 | |||
109 | #define DEFINE_TRACE(name) | ||
110 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) | ||
111 | #define EXPORT_TRACEPOINT_SYMBOL(name) | ||
97 | 112 | ||
98 | static inline void tracepoint_update_probe_range(struct tracepoint *begin, | 113 | static inline void tracepoint_update_probe_range(struct tracepoint *begin, |
99 | struct tracepoint *end) | 114 | struct tracepoint *end) |
@@ -112,6 +127,10 @@ extern int tracepoint_probe_register(const char *name, void *probe); | |||
112 | */ | 127 | */ |
113 | extern int tracepoint_probe_unregister(const char *name, void *probe); | 128 | extern int tracepoint_probe_unregister(const char *name, void *probe); |
114 | 129 | ||
130 | extern int tracepoint_probe_register_noupdate(const char *name, void *probe); | ||
131 | extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe); | ||
132 | extern void tracepoint_probe_update_all(void); | ||
133 | |||
115 | struct tracepoint_iter { | 134 | struct tracepoint_iter { |
116 | struct module *module; | 135 | struct module *module; |
117 | struct tracepoint *tracepoint; | 136 | struct tracepoint *tracepoint; |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 3b8121d4e36f..3f4954c55e53 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -325,7 +325,7 @@ extern struct class *tty_class; | |||
325 | * go away | 325 | * go away |
326 | */ | 326 | */ |
327 | 327 | ||
328 | extern inline struct tty_struct *tty_kref_get(struct tty_struct *tty) | 328 | static inline struct tty_struct *tty_kref_get(struct tty_struct *tty) |
329 | { | 329 | { |
330 | if (tty) | 330 | if (tty) |
331 | kref_get(&tty->kref); | 331 | kref_get(&tty->kref); |
@@ -442,6 +442,7 @@ extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | |||
442 | size_t size); | 442 | size_t size); |
443 | extern void tty_audit_exit(void); | 443 | extern void tty_audit_exit(void); |
444 | extern void tty_audit_fork(struct signal_struct *sig); | 444 | extern void tty_audit_fork(struct signal_struct *sig); |
445 | extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); | ||
445 | extern void tty_audit_push(struct tty_struct *tty); | 446 | extern void tty_audit_push(struct tty_struct *tty); |
446 | extern void tty_audit_push_task(struct task_struct *tsk, | 447 | extern void tty_audit_push_task(struct task_struct *tsk, |
447 | uid_t loginuid, u32 sessionid); | 448 | uid_t loginuid, u32 sessionid); |
@@ -450,6 +451,9 @@ static inline void tty_audit_add_data(struct tty_struct *tty, | |||
450 | unsigned char *data, size_t size) | 451 | unsigned char *data, size_t size) |
451 | { | 452 | { |
452 | } | 453 | } |
454 | static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) | ||
455 | { | ||
456 | } | ||
453 | static inline void tty_audit_exit(void) | 457 | static inline void tty_audit_exit(void) |
454 | { | 458 | { |
455 | } | 459 | } |
diff --git a/include/linux/types.h b/include/linux/types.h index 1d98330b1f2c..121f349cb7ec 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -135,19 +135,14 @@ typedef __s64 int64_t; | |||
135 | * | 135 | * |
136 | * Linux always considers sectors to be 512 bytes long independently | 136 | * Linux always considers sectors to be 512 bytes long independently |
137 | * of the devices real block size. | 137 | * of the devices real block size. |
138 | * | ||
139 | * blkcnt_t is the type of the inode's block count. | ||
138 | */ | 140 | */ |
139 | #ifdef CONFIG_LBD | 141 | #ifdef CONFIG_LBD |
140 | typedef u64 sector_t; | 142 | typedef u64 sector_t; |
141 | #else | ||
142 | typedef unsigned long sector_t; | ||
143 | #endif | ||
144 | |||
145 | /* | ||
146 | * The type of the inode's block count. | ||
147 | */ | ||
148 | #ifdef CONFIG_LSF | ||
149 | typedef u64 blkcnt_t; | 143 | typedef u64 blkcnt_t; |
150 | #else | 144 | #else |
145 | typedef unsigned long sector_t; | ||
151 | typedef unsigned long blkcnt_t; | 146 | typedef unsigned long blkcnt_t; |
152 | #endif | 147 | #endif |
153 | 148 | ||
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index fec6decfb983..6b58367d145e 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
@@ -78,7 +78,7 @@ static inline unsigned long __copy_from_user_nocache(void *to, | |||
78 | \ | 78 | \ |
79 | set_fs(KERNEL_DS); \ | 79 | set_fs(KERNEL_DS); \ |
80 | pagefault_disable(); \ | 80 | pagefault_disable(); \ |
81 | ret = __get_user(retval, (__force typeof(retval) __user *)(addr)); \ | 81 | ret = __copy_from_user_inatomic(&(retval), (__force typeof(retval) __user *)(addr), sizeof(retval)); \ |
82 | pagefault_enable(); \ | 82 | pagefault_enable(); \ |
83 | set_fs(old_fs); \ | 83 | set_fs(old_fs); \ |
84 | ret; \ | 84 | ret; \ |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 73a2f4eb1f7a..9b42baed3900 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -158,8 +158,12 @@ struct usb_ctrlrequest { | |||
158 | * (rarely) accepted by SET_DESCRIPTOR. | 158 | * (rarely) accepted by SET_DESCRIPTOR. |
159 | * | 159 | * |
160 | * Note that all multi-byte values here are encoded in little endian | 160 | * Note that all multi-byte values here are encoded in little endian |
161 | * byte order "on the wire". But when exposed through Linux-USB APIs, | 161 | * byte order "on the wire". Within the kernel and when exposed |
162 | * they've been converted to cpu byte order. | 162 | * through the Linux-USB APIs, they are not converted to cpu byte |
163 | * order; it is the responsibility of the client code to do this. | ||
164 | * The single exception is when device and configuration descriptors (but | ||
165 | * not other descriptors) are read from usbfs (i.e. /proc/bus/usb/BBB/DDD); | ||
166 | * in this case the fields are converted to host endianness by the kernel. | ||
163 | */ | 167 | */ |
164 | 168 | ||
165 | /* | 169 | /* |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index b5f41d4c2eec..315bcd375224 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -12,7 +12,7 @@ | |||
12 | struct user_namespace { | 12 | struct user_namespace { |
13 | struct kref kref; | 13 | struct kref kref; |
14 | struct hlist_head uidhash_table[UIDHASH_SZ]; | 14 | struct hlist_head uidhash_table[UIDHASH_SZ]; |
15 | struct user_struct *root_user; | 15 | struct user_struct *creator; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | extern struct user_namespace init_user_ns; | 18 | extern struct user_namespace init_user_ns; |
@@ -26,8 +26,7 @@ static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | |||
26 | return ns; | 26 | return ns; |
27 | } | 27 | } |
28 | 28 | ||
29 | extern struct user_namespace *copy_user_ns(int flags, | 29 | extern int create_user_ns(struct cred *new); |
30 | struct user_namespace *old_ns); | ||
31 | extern void free_user_ns(struct kref *kref); | 30 | extern void free_user_ns(struct kref *kref); |
32 | 31 | ||
33 | static inline void put_user_ns(struct user_namespace *ns) | 32 | static inline void put_user_ns(struct user_namespace *ns) |
@@ -43,13 +42,9 @@ static inline struct user_namespace *get_user_ns(struct user_namespace *ns) | |||
43 | return &init_user_ns; | 42 | return &init_user_ns; |
44 | } | 43 | } |
45 | 44 | ||
46 | static inline struct user_namespace *copy_user_ns(int flags, | 45 | static inline int create_user_ns(struct cred *new) |
47 | struct user_namespace *old_ns) | ||
48 | { | 46 | { |
49 | if (flags & CLONE_NEWUSER) | 47 | return -EINVAL; |
50 | return ERR_PTR(-EINVAL); | ||
51 | |||
52 | return old_ns; | ||
53 | } | 48 | } |
54 | 49 | ||
55 | static inline void put_user_ns(struct user_namespace *ns) | 50 | static inline void put_user_ns(struct user_namespace *ns) |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 4669d7e72e75..1f126e30766c 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -293,6 +293,7 @@ struct v4l2_pix_format { | |||
293 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ | 293 | #define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */ |
294 | #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ | 294 | #define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */ |
295 | #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ | 295 | #define V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */ |
296 | #define V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */ | ||
296 | #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ | 297 | #define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */ |
297 | #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */ | 298 | #define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16 YVU411 planar */ |
298 | #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */ | 299 | #define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */ |
@@ -304,6 +305,8 @@ struct v4l2_pix_format { | |||
304 | /* two planes -- one Y, one Cr + Cb interleaved */ | 305 | /* two planes -- one Y, one Cr + Cb interleaved */ |
305 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ | 306 | #define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ |
306 | #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ | 307 | #define V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */ |
308 | #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ | ||
309 | #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ | ||
307 | 310 | ||
308 | /* The following formats are not defined in the V4L2 specification */ | 311 | /* The following formats are not defined in the V4L2 specification */ |
309 | #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */ | 312 | #define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */ |
@@ -1050,7 +1053,7 @@ enum v4l2_mpeg_video_bitrate_mode { | |||
1050 | #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) | 1053 | #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) |
1051 | #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) | 1054 | #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) |
1052 | 1055 | ||
1053 | /* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */ | 1056 | /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ |
1054 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) | 1057 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) |
1055 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) | 1058 | #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) |
1056 | enum v4l2_mpeg_cx2341x_video_spatial_filter_mode { | 1059 | enum v4l2_mpeg_cx2341x_video_spatial_filter_mode { |
@@ -1117,6 +1120,12 @@ enum v4l2_exposure_auto_type { | |||
1117 | #define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11) | 1120 | #define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11) |
1118 | #define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12) | 1121 | #define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12) |
1119 | 1122 | ||
1123 | #define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13) | ||
1124 | #define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14) | ||
1125 | #define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+15) | ||
1126 | |||
1127 | #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16) | ||
1128 | |||
1120 | /* | 1129 | /* |
1121 | * T U N I N G | 1130 | * T U N I N G |
1122 | */ | 1131 | */ |
@@ -1369,6 +1378,7 @@ struct v4l2_streamparm { | |||
1369 | #define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ | 1378 | #define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ |
1370 | #define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver ID */ | 1379 | #define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver ID */ |
1371 | #define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ | 1380 | #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 */ | ||
1372 | 1382 | ||
1373 | struct v4l2_register { | 1383 | struct v4l2_register { |
1374 | __u32 match_type; /* Match type */ | 1384 | __u32 match_type; /* Match type */ |
@@ -1458,6 +1468,8 @@ struct v4l2_chip_ident { | |||
1458 | #define VIDIOC_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_chip_ident) | 1468 | #define VIDIOC_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_chip_ident) |
1459 | #endif | 1469 | #endif |
1460 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) | 1470 | #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 | ||
1472 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | ||
1461 | 1473 | ||
1462 | #ifdef __OLD_VIDIOC_ | 1474 | #ifdef __OLD_VIDIOC_ |
1463 | /* for compatibility, will go away some day */ | 1475 | /* for compatibility, will go away some day */ |
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h index c30c7bfbf39b..8726ff77763e 100644 --- a/include/linux/virtio_balloon.h +++ b/include/linux/virtio_balloon.h | |||
@@ -10,6 +10,9 @@ | |||
10 | /* The feature bitmap for virtio balloon */ | 10 | /* The feature bitmap for virtio balloon */ |
11 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ | 11 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ |
12 | 12 | ||
13 | /* Size of a PFN in the balloon interface. */ | ||
14 | #define VIRTIO_BALLOON_PFN_SHIFT 12 | ||
15 | |||
13 | struct virtio_balloon_config | 16 | struct virtio_balloon_config |
14 | { | 17 | { |
15 | /* Number of pages host wants Guest to give up. */ | 18 | /* Number of pages host wants Guest to give up. */ |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index 19a0da0dba41..7615ffcdd555 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
@@ -7,6 +7,17 @@ | |||
7 | /* The ID for virtio console */ | 7 | /* The ID for virtio console */ |
8 | #define VIRTIO_ID_CONSOLE 3 | 8 | #define VIRTIO_ID_CONSOLE 3 |
9 | 9 | ||
10 | /* Feature bits */ | ||
11 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ | ||
12 | |||
13 | struct virtio_console_config { | ||
14 | /* colums of the screens */ | ||
15 | __u16 cols; | ||
16 | /* rows of the screens */ | ||
17 | __u16 rows; | ||
18 | } __attribute__((packed)); | ||
19 | |||
20 | |||
10 | #ifdef __KERNEL__ | 21 | #ifdef __KERNEL__ |
11 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); | 22 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); |
12 | #endif /* __KERNEL__ */ | 23 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 5e33761b9b8a..5cdd0aa8bde9 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #define VIRTIO_NET_F_HOST_TSO6 12 /* Host can handle TSOv6 in. */ | 20 | #define VIRTIO_NET_F_HOST_TSO6 12 /* Host can handle TSOv6 in. */ |
21 | #define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */ | 21 | #define VIRTIO_NET_F_HOST_ECN 13 /* Host can handle TSO[6] w/ ECN in. */ |
22 | #define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */ | 22 | #define VIRTIO_NET_F_HOST_UFO 14 /* Host can handle UFO in. */ |
23 | #define VIRTIO_NET_F_MRG_RXBUF 15 /* Host can merge receive buffers. */ | ||
23 | 24 | ||
24 | struct virtio_net_config | 25 | struct virtio_net_config |
25 | { | 26 | { |
@@ -44,4 +45,12 @@ struct virtio_net_hdr | |||
44 | __u16 csum_start; /* Position to start checksumming from */ | 45 | __u16 csum_start; /* Position to start checksumming from */ |
45 | __u16 csum_offset; /* Offset after that to place checksum */ | 46 | __u16 csum_offset; /* Offset after that to place checksum */ |
46 | }; | 47 | }; |
48 | |||
49 | /* This is the version of the header to use when the MRG_RXBUF | ||
50 | * feature has been negotiated. */ | ||
51 | struct virtio_net_hdr_mrg_rxbuf { | ||
52 | struct virtio_net_hdr hdr; | ||
53 | __u16 num_buffers; /* Number of merged rx buffers */ | ||
54 | }; | ||
55 | |||
47 | #endif /* _LINUX_VIRTIO_NET_H */ | 56 | #endif /* _LINUX_VIRTIO_NET_H */ |
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h index cdef35742932..cd0fd5d181a6 100644 --- a/include/linux/virtio_pci.h +++ b/include/linux/virtio_pci.h | |||
@@ -53,4 +53,12 @@ | |||
53 | 53 | ||
54 | /* Virtio ABI version, this must match exactly */ | 54 | /* Virtio ABI version, this must match exactly */ |
55 | #define VIRTIO_PCI_ABI_VERSION 0 | 55 | #define VIRTIO_PCI_ABI_VERSION 0 |
56 | |||
57 | /* How many bits to shift physical queue address written to QUEUE_PFN. | ||
58 | * 12 is historical, and due to x86 page size. */ | ||
59 | #define VIRTIO_PCI_QUEUE_ADDR_SHIFT 12 | ||
60 | |||
61 | /* The alignment to use between consumer and producer parts of vring. | ||
62 | * x86 pagesize again. */ | ||
63 | #define VIRTIO_PCI_VRING_ALIGN 4096 | ||
56 | #endif | 64 | #endif |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index c4a598fb3826..71e03722fb59 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
@@ -83,7 +83,7 @@ struct vring { | |||
83 | * __u16 avail_idx; | 83 | * __u16 avail_idx; |
84 | * __u16 available[num]; | 84 | * __u16 available[num]; |
85 | * | 85 | * |
86 | * // Padding to the next page boundary. | 86 | * // Padding to the next align boundary. |
87 | * char pad[]; | 87 | * char pad[]; |
88 | * | 88 | * |
89 | * // A ring of used descriptor heads with free-running index. | 89 | * // A ring of used descriptor heads with free-running index. |
@@ -93,19 +93,19 @@ struct vring { | |||
93 | * }; | 93 | * }; |
94 | */ | 94 | */ |
95 | static inline void vring_init(struct vring *vr, unsigned int num, void *p, | 95 | static inline void vring_init(struct vring *vr, unsigned int num, void *p, |
96 | unsigned long pagesize) | 96 | unsigned long align) |
97 | { | 97 | { |
98 | vr->num = num; | 98 | vr->num = num; |
99 | vr->desc = p; | 99 | vr->desc = p; |
100 | vr->avail = p + num*sizeof(struct vring_desc); | 100 | vr->avail = p + num*sizeof(struct vring_desc); |
101 | vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + pagesize-1) | 101 | vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1) |
102 | & ~(pagesize - 1)); | 102 | & ~(align - 1)); |
103 | } | 103 | } |
104 | 104 | ||
105 | static inline unsigned vring_size(unsigned int num, unsigned long pagesize) | 105 | static inline unsigned vring_size(unsigned int num, unsigned long align) |
106 | { | 106 | { |
107 | return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) | 107 | return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) |
108 | + pagesize - 1) & ~(pagesize - 1)) | 108 | + align - 1) & ~(align - 1)) |
109 | + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num; | 109 | + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num; |
110 | } | 110 | } |
111 | 111 | ||
@@ -115,6 +115,7 @@ struct virtio_device; | |||
115 | struct virtqueue; | 115 | struct virtqueue; |
116 | 116 | ||
117 | struct virtqueue *vring_new_virtqueue(unsigned int num, | 117 | struct virtqueue *vring_new_virtqueue(unsigned int num, |
118 | unsigned int vring_align, | ||
118 | struct virtio_device *vdev, | 119 | struct virtio_device *vdev, |
119 | void *pages, | 120 | void *pages, |
120 | void (*notify)(struct virtqueue *vq), | 121 | void (*notify)(struct virtqueue *vq), |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 4bc1e6b86cb2..52f3abd453a1 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -199,6 +199,9 @@ enum { | |||
199 | #define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO | 199 | #define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO |
200 | XFRM_MSG_GETSPDINFO, | 200 | XFRM_MSG_GETSPDINFO, |
201 | #define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO | 201 | #define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO |
202 | |||
203 | XFRM_MSG_MAPPING, | ||
204 | #define XFRM_MSG_MAPPING XFRM_MSG_MAPPING | ||
202 | __XFRM_MSG_MAX | 205 | __XFRM_MSG_MAX |
203 | }; | 206 | }; |
204 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) | 207 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) |
@@ -438,6 +441,15 @@ struct xfrm_user_migrate { | |||
438 | __u16 new_family; | 441 | __u16 new_family; |
439 | }; | 442 | }; |
440 | 443 | ||
444 | struct xfrm_user_mapping { | ||
445 | struct xfrm_usersa_id id; | ||
446 | __u32 reqid; | ||
447 | xfrm_address_t old_saddr; | ||
448 | xfrm_address_t new_saddr; | ||
449 | __be16 old_sport; | ||
450 | __be16 new_sport; | ||
451 | }; | ||
452 | |||
441 | #ifndef __KERNEL__ | 453 | #ifndef __KERNEL__ |
442 | /* backwards compatibility for userspace */ | 454 | /* backwards compatibility for userspace */ |
443 | #define XFRMGRP_ACQUIRE 1 | 455 | #define XFRMGRP_ACQUIRE 1 |
@@ -464,6 +476,8 @@ enum xfrm_nlgroups { | |||
464 | #define XFRMNLGRP_REPORT XFRMNLGRP_REPORT | 476 | #define XFRMNLGRP_REPORT XFRMNLGRP_REPORT |
465 | XFRMNLGRP_MIGRATE, | 477 | XFRMNLGRP_MIGRATE, |
466 | #define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE | 478 | #define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE |
479 | XFRMNLGRP_MAPPING, | ||
480 | #define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING | ||
467 | __XFRMNLGRP_MAX | 481 | __XFRMNLGRP_MAX |
468 | }; | 482 | }; |
469 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) | 483 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) |