aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-09-09 21:14:47 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-09-09 21:14:47 -0400
commitd344c5e0856ad03278d8700b503762dbc8b86e12 (patch)
treea6d893a643470a3c2580a58f3228a55fa1fd1d82 /include/linux
parent010988e888a0abbe7118635c1b33d049caae6b29 (diff)
parent87fc767b832ef5a681a0ff9d203c3289bc3be2bf (diff)
Manual merge with Linus
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h45
-rw-r--r--include/linux/attribute_container.h12
-rw-r--r--include/linux/auxvec.h31
-rw-r--r--include/linux/bfs_fs.h23
-rw-r--r--include/linux/bio.h8
-rw-r--r--include/linux/blkdev.h10
-rw-r--r--include/linux/capability.h1
-rw-r--r--include/linux/compat.h3
-rw-r--r--include/linux/cpuset.h11
-rw-r--r--include/linux/crc16.h44
-rw-r--r--include/linux/crypto.h1
-rw-r--r--include/linux/dcache.h4
-rw-r--r--include/linux/dccp.h3
-rw-r--r--include/linux/dmi.h36
-rw-r--r--include/linux/efi.h14
-rw-r--r--include/linux/elf.h24
-rw-r--r--include/linux/ext2_fs.h3
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fb.h28
-rw-r--r--include/linux/file.h30
-rw-r--r--include/linux/firmware.h5
-rw-r--r--include/linux/fs.h17
-rw-r--r--include/linux/fuse.h259
-rw-r--r--include/linux/futex.h36
-rw-r--r--include/linux/gfp.h8
-rw-r--r--include/linux/hugetlb.h6
-rw-r--r--include/linux/hwmon-sysfs.h15
-rw-r--r--include/linux/hwmon-vid.h45
-rw-r--r--include/linux/hwmon.h35
-rw-r--r--include/linux/i2c-id.h192
-rw-r--r--include/linux/i2c-isa.h36
-rw-r--r--include/linux/i2c-pxa.h48
-rw-r--r--include/linux/i2c-sensor.h263
-rw-r--r--include/linux/i2c-vid.h111
-rw-r--r--include/linux/i2c.h206
-rw-r--r--include/linux/if_tun.h1
-rw-r--r--include/linux/in6.h36
-rw-r--r--include/linux/init_task.h18
-rw-r--r--include/linux/inotify.h1
-rw-r--r--include/linux/input.h25
-rw-r--r--include/linux/ioctl32.h22
-rw-r--r--include/linux/ipmi.h34
-rw-r--r--include/linux/ipv6.h15
-rw-r--r--include/linux/irq.h130
-rw-r--r--include/linux/isdn.h1
-rw-r--r--include/linux/jbd.h1
-rw-r--r--include/linux/klist.h16
-rw-r--r--include/linux/kprobes.h3
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/linkage.h7
-rw-r--r--include/linux/mempolicy.h4
-rw-r--r--include/linux/mmc/card.h15
-rw-r--r--include/linux/mmc/host.h30
-rw-r--r--include/linux/mmc/mmc.h2
-rw-r--r--include/linux/mmc/protocol.h7
-rw-r--r--include/linux/mmzone.h25
-rw-r--r--include/linux/msg.h1
-rw-r--r--include/linux/mv643xx.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h5
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_core.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_nat_rule.h5
-rw-r--r--include/linux/page-flags.h2
-rw-r--r--include/linux/pci.h519
-rw-r--r--include/linux/pci_ids.h4
-rw-r--r--include/linux/pci_regs.h448
-rw-r--r--include/linux/pipe_fs_i.h3
-rw-r--r--include/linux/pm.h14
-rw-r--r--include/linux/pnp.h2
-rw-r--r--include/linux/ptrace.h3
-rw-r--r--include/linux/raid/bitmap.h15
-rw-r--r--include/linux/raid/linear.h4
-rw-r--r--include/linux/raid/md_k.h81
-rw-r--r--include/linux/raid/md_p.h16
-rw-r--r--include/linux/raid/raid1.h13
-rw-r--r--include/linux/raid/raid5.h14
-rw-r--r--include/linux/raid_class.h59
-rw-r--r--include/linux/rcupdate.h4
-rw-r--r--include/linux/rcuref.h220
-rw-r--r--include/linux/relayfs_fs.h255
-rw-r--r--include/linux/sched.h33
-rw-r--r--include/linux/security.h180
-rw-r--r--include/linux/sem.h1
-rw-r--r--include/linux/serial_8250.h15
-rw-r--r--include/linux/serial_core.h7
-rw-r--r--include/linux/skbuff.h6
-rw-r--r--include/linux/slab.h16
-rw-r--r--include/linux/sonypi.h2
-rw-r--r--include/linux/sunrpc/cache.h1
-rw-r--r--include/linux/swap.h22
-rw-r--r--include/linux/swapops.h2
-rw-r--r--include/linux/sysctl.h6
-rw-r--r--include/linux/time.h1
-rw-r--r--include/linux/timer.h4
-rw-r--r--include/linux/timex.h23
-rw-r--r--include/linux/topology.h23
-rw-r--r--include/linux/transport_class.h11
-rw-r--r--include/linux/tty.h3
-rw-r--r--include/linux/usb.h11
-rw-r--r--include/linux/usb_isp116x.h30
-rw-r--r--include/linux/videodev.h3
-rw-r--r--include/linux/videodev2.h4
-rw-r--r--include/linux/vmalloc.h8
-rw-r--r--include/linux/wireless.h38
103 files changed, 2641 insertions, 1510 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index b46a5205ee7b..026c3c011dc0 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -41,7 +41,7 @@
41#include <asm/acpi.h> 41#include <asm/acpi.h>
42 42
43 43
44#ifdef CONFIG_ACPI_BOOT 44#ifdef CONFIG_ACPI
45 45
46enum acpi_irq_model_id { 46enum acpi_irq_model_id {
47 ACPI_IRQ_MODEL_PIC = 0, 47 ACPI_IRQ_MODEL_PIC = 0,
@@ -429,23 +429,13 @@ extern int pci_mmcfg_config_num;
429 429
430extern int sbf_port ; 430extern int sbf_port ;
431 431
432#else /*!CONFIG_ACPI_BOOT*/ 432#else /* !CONFIG_ACPI */
433 433
434#define acpi_mp_config 0 434#define acpi_mp_config 0
435 435
436static inline int acpi_boot_init(void) 436#endif /* !CONFIG_ACPI */
437{
438 return 0;
439}
440
441static inline int acpi_boot_table_init(void)
442{
443 return 0;
444}
445 437
446#endif /*!CONFIG_ACPI_BOOT*/ 438int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
447
448unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
449int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 439int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
450 440
451/* 441/*
@@ -455,7 +445,7 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
455 */ 445 */
456void acpi_unregister_gsi (u32 gsi); 446void acpi_unregister_gsi (u32 gsi);
457 447
458#ifdef CONFIG_ACPI_PCI 448#ifdef CONFIG_ACPI
459 449
460struct acpi_prt_entry { 450struct acpi_prt_entry {
461 struct list_head node; 451 struct list_head node;
@@ -489,7 +479,7 @@ struct acpi_pci_driver {
489int acpi_pci_register_driver(struct acpi_pci_driver *driver); 479int acpi_pci_register_driver(struct acpi_pci_driver *driver);
490void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); 480void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
491 481
492#endif /*CONFIG_ACPI_PCI*/ 482#endif /* CONFIG_ACPI */
493 483
494#ifdef CONFIG_ACPI_EC 484#ifdef CONFIG_ACPI_EC
495 485
@@ -498,20 +488,9 @@ extern int ec_write(u8 addr, u8 val);
498 488
499#endif /*CONFIG_ACPI_EC*/ 489#endif /*CONFIG_ACPI_EC*/
500 490
501#ifdef CONFIG_ACPI_INTERPRETER
502
503extern int acpi_blacklisted(void); 491extern int acpi_blacklisted(void);
504extern void acpi_bios_year(char *s); 492extern void acpi_bios_year(char *s);
505 493
506#else /*!CONFIG_ACPI_INTERPRETER*/
507
508static inline int acpi_blacklisted(void)
509{
510 return 0;
511}
512
513#endif /*!CONFIG_ACPI_INTERPRETER*/
514
515#define ACPI_CSTATE_LIMIT_DEFINED /* for driver builds */ 494#define ACPI_CSTATE_LIMIT_DEFINED /* for driver builds */
516#ifdef CONFIG_ACPI 495#ifdef CONFIG_ACPI
517 496
@@ -549,5 +528,17 @@ static inline int acpi_get_pxm(acpi_handle handle)
549 528
550extern int pnpacpi_disabled; 529extern int pnpacpi_disabled;
551 530
531#else /* CONFIG_ACPI */
532
533static inline int acpi_boot_init(void)
534{
535 return 0;
536}
537
538static inline int acpi_boot_table_init(void)
539{
540 return 0;
541}
542
552#endif /* CONFIG_ACPI */ 543#endif /* CONFIG_ACPI */
553#endif /*_LINUX_ACPI_H*/ 544#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index af1010b6dab7..93bfb0beb62a 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -11,10 +11,12 @@
11 11
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/klist.h>
15#include <linux/spinlock.h>
14 16
15struct attribute_container { 17struct attribute_container {
16 struct list_head node; 18 struct list_head node;
17 struct list_head containers; 19 struct klist containers;
18 struct class *class; 20 struct class *class;
19 struct class_device_attribute **attrs; 21 struct class_device_attribute **attrs;
20 int (*match)(struct attribute_container *, struct device *); 22 int (*match)(struct attribute_container *, struct device *);
@@ -62,12 +64,8 @@ int attribute_container_add_class_device_adapter(struct attribute_container *con
62 struct class_device *classdev); 64 struct class_device *classdev);
63void attribute_container_remove_attrs(struct class_device *classdev); 65void attribute_container_remove_attrs(struct class_device *classdev);
64void attribute_container_class_device_del(struct class_device *classdev); 66void attribute_container_class_device_del(struct class_device *classdev);
65 67struct attribute_container *attribute_container_classdev_to_container(struct class_device *);
66 68struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *);
67
68
69
70
71struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev); 69struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev);
72 70
73#endif 71#endif
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h
new file mode 100644
index 000000000000..9a7b374c9fb4
--- /dev/null
+++ b/include/linux/auxvec.h
@@ -0,0 +1,31 @@
1#ifndef _LINUX_AUXVEC_H
2#define _LINUX_AUXVEC_H
3
4#include <asm/auxvec.h>
5
6/* Symbolic values for the entries in the auxiliary table
7 put on the initial stack */
8#define AT_NULL 0 /* end of vector */
9#define AT_IGNORE 1 /* entry should be ignored */
10#define AT_EXECFD 2 /* file descriptor of program */
11#define AT_PHDR 3 /* program headers for program */
12#define AT_PHENT 4 /* size of program header entry */
13#define AT_PHNUM 5 /* number of program headers */
14#define AT_PAGESZ 6 /* system page size */
15#define AT_BASE 7 /* base address of interpreter */
16#define AT_FLAGS 8 /* flags */
17#define AT_ENTRY 9 /* entry point of program */
18#define AT_NOTELF 10 /* program is not ELF */
19#define AT_UID 11 /* real uid */
20#define AT_EUID 12 /* effective uid */
21#define AT_GID 13 /* real gid */
22#define AT_EGID 14 /* effective gid */
23#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
24#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
25#define AT_CLKTCK 17 /* frequency at which times() increments */
26
27#define AT_SECURE 23 /* secure mode boolean */
28
29#define AT_VECTOR_SIZE 42 /* Size of auxiliary table. */
30
31#endif /* _LINUX_AUXVEC_H */
diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h
index f7f0913cd110..c1237aa92e38 100644
--- a/include/linux/bfs_fs.h
+++ b/include/linux/bfs_fs.h
@@ -14,8 +14,9 @@
14#define BFS_INODES_PER_BLOCK 8 14#define BFS_INODES_PER_BLOCK 8
15 15
16/* SVR4 vnode type values (bfs_inode->i_vtype) */ 16/* SVR4 vnode type values (bfs_inode->i_vtype) */
17#define BFS_VDIR 2 17#define BFS_VDIR 2L
18#define BFS_VREG 1 18#define BFS_VREG 1L
19
19 20
20/* BFS inode layout on disk */ 21/* BFS inode layout on disk */
21struct bfs_inode { 22struct bfs_inode {
@@ -58,22 +59,22 @@ struct bfs_super_block {
58 __u32 s_padding[118]; 59 __u32 s_padding[118];
59}; 60};
60 61
61#define BFS_NZFILESIZE(ip) \
62 (((ip)->i_eoffset + 1) - (ip)->i_sblock * BFS_BSIZE)
63
64#define BFS_FILESIZE(ip) \
65 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
66
67#define BFS_FILEBLOCKS(ip) \
68 ((ip)->i_sblock == 0 ? 0 : ((ip)->i_eblock + 1) - (ip)->i_sblock)
69 62
70#define BFS_OFF2INO(offset) \ 63#define BFS_OFF2INO(offset) \
71 ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO) 64 ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO)
72 65
73#define BFS_INO2OFF(ino) \ 66#define BFS_INO2OFF(ino) \
74 ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) 67 ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
68#define BFS_NZFILESIZE(ip) \
69 ((cpu_to_le32((ip)->i_eoffset) + 1) - cpu_to_le32((ip)->i_sblock) * BFS_BSIZE)
70
71#define BFS_FILESIZE(ip) \
72 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
75 73
74#define BFS_FILEBLOCKS(ip) \
75 ((ip)->i_sblock == 0 ? 0 : (cpu_to_le32((ip)->i_eblock) + 1) - cpu_to_le32((ip)->i_sblock))
76#define BFS_UNCLEAN(bfs_sb, sb) \ 76#define BFS_UNCLEAN(bfs_sb, sb) \
77 ((bfs_sb->s_from != -1) && (bfs_sb->s_to != -1) && !(sb->s_flags & MS_RDONLY)) 77 ((cpu_to_le32(bfs_sb->s_from) != -1) && (cpu_to_le32(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
78
78 79
79#endif /* _LINUX_BFS_FS_H */ 80#endif /* _LINUX_BFS_FS_H */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 36ef29fa0d8b..cdaf03a14a51 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -111,7 +111,6 @@ struct bio {
111 void *bi_private; 111 void *bi_private;
112 112
113 bio_destructor_t *bi_destructor; /* destructor */ 113 bio_destructor_t *bi_destructor; /* destructor */
114 struct bio_set *bi_set; /* memory pools set */
115}; 114};
116 115
117/* 116/*
@@ -280,6 +279,7 @@ extern void bioset_free(struct bio_set *);
280extern struct bio *bio_alloc(unsigned int __nocast, int); 279extern struct bio *bio_alloc(unsigned int __nocast, int);
281extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); 280extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *);
282extern void bio_put(struct bio *); 281extern void bio_put(struct bio *);
282extern void bio_free(struct bio *, struct bio_set *);
283 283
284extern void bio_endio(struct bio *, unsigned int, int); 284extern void bio_endio(struct bio *, unsigned int, int);
285struct request_queue; 285struct request_queue;
@@ -295,7 +295,13 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
295extern int bio_get_nr_vecs(struct block_device *); 295extern int bio_get_nr_vecs(struct block_device *);
296extern struct bio *bio_map_user(struct request_queue *, struct block_device *, 296extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
297 unsigned long, unsigned int, int); 297 unsigned long, unsigned int, int);
298struct sg_iovec;
299extern struct bio *bio_map_user_iov(struct request_queue *,
300 struct block_device *,
301 struct sg_iovec *, int, int);
298extern void bio_unmap_user(struct bio *); 302extern void bio_unmap_user(struct bio *);
303extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
304 unsigned int);
299extern void bio_set_pages_dirty(struct bio *bio); 305extern void bio_set_pages_dirty(struct bio *bio);
300extern void bio_check_pages_dirty(struct bio *bio); 306extern void bio_check_pages_dirty(struct bio *bio);
301extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 307extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 19bd8e7e11bf..aefa26fbae8a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -563,10 +563,12 @@ extern void blk_sync_queue(struct request_queue *q);
563extern void __blk_stop_queue(request_queue_t *q); 563extern void __blk_stop_queue(request_queue_t *q);
564extern void blk_run_queue(request_queue_t *); 564extern void blk_run_queue(request_queue_t *);
565extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); 565extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
566extern struct request *blk_rq_map_user(request_queue_t *, int, void __user *, unsigned int); 566extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int);
567extern int blk_rq_unmap_user(struct request *, struct bio *, unsigned int); 567extern int blk_rq_unmap_user(struct bio *, unsigned int);
568extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *); 568extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int);
569 569extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int);
570extern int blk_execute_rq(request_queue_t *, struct gendisk *,
571 struct request *, int);
570static inline request_queue_t *bdev_get_queue(struct block_device *bdev) 572static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
571{ 573{
572 return bdev->bd_disk->queue; 574 return bdev->bd_disk->queue;
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 8d139f4acf23..6b4618902d3d 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -233,6 +233,7 @@ typedef __u32 kernel_cap_t;
233/* Allow enabling/disabling tagged queuing on SCSI controllers and sending 233/* Allow enabling/disabling tagged queuing on SCSI controllers and sending
234 arbitrary SCSI commands */ 234 arbitrary SCSI commands */
235/* Allow setting encryption key on loopback filesystem */ 235/* Allow setting encryption key on loopback filesystem */
236/* Allow setting zone reclaim policy */
236 237
237#define CAP_SYS_ADMIN 21 238#define CAP_SYS_ADMIN 21
238 239
diff --git a/include/linux/compat.h b/include/linux/compat.h
index b58b7d6f2fdb..f9ca534787e2 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -18,6 +18,9 @@
18#define compat_jiffies_to_clock_t(x) \ 18#define compat_jiffies_to_clock_t(x) \
19 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) 19 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
20 20
21typedef __compat_uid32_t compat_uid_t;
22typedef __compat_gid32_t compat_gid_t;
23
21struct rusage; 24struct rusage;
22 25
23struct compat_itimerspec { 26struct compat_itimerspec {
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 3438233305a3..24062a1dbf61 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -23,7 +23,8 @@ void cpuset_init_current_mems_allowed(void);
23void cpuset_update_current_mems_allowed(void); 23void cpuset_update_current_mems_allowed(void);
24void cpuset_restrict_to_mems_allowed(unsigned long *nodes); 24void cpuset_restrict_to_mems_allowed(unsigned long *nodes);
25int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); 25int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl);
26int cpuset_zone_allowed(struct zone *z); 26extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask);
27extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
27extern struct file_operations proc_cpuset_operations; 28extern struct file_operations proc_cpuset_operations;
28extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); 29extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);
29 30
@@ -48,7 +49,13 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
48 return 1; 49 return 1;
49} 50}
50 51
51static inline int cpuset_zone_allowed(struct zone *z) 52static inline int cpuset_zone_allowed(struct zone *z,
53 unsigned int __nocast gfp_mask)
54{
55 return 1;
56}
57
58static inline int cpuset_excl_nodes_overlap(const struct task_struct *p)
52{ 59{
53 return 1; 60 return 1;
54} 61}
diff --git a/include/linux/crc16.h b/include/linux/crc16.h
new file mode 100644
index 000000000000..bdedf825b04a
--- /dev/null
+++ b/include/linux/crc16.h
@@ -0,0 +1,44 @@
1/*
2 * crc16.h - CRC-16 routine
3 *
4 * Implements the standard CRC-16, as used with 1-wire devices:
5 * Width 16
6 * Poly 0x8005 (x^16 + x^15 + x^2 + 1)
7 * Init 0
8 *
9 * For 1-wire devices, the CRC is stored inverted, LSB-first
10 *
11 * Example buffer with the CRC attached:
12 * 31 32 33 34 35 36 37 38 39 C2 44
13 *
14 * The CRC over a buffer with the CRC attached is 0xB001.
15 * So, if (crc16(0, buf, size) == 0xB001) then the buffer is valid.
16 *
17 * Refer to "Application Note 937: Book of iButton Standards" for details.
18 * http://www.maxim-ic.com/appnotes.cfm/appnote_number/937
19 *
20 * Copyright (c) 2005 Ben Gardner <bgardner@wabtec.com>
21 *
22 * This source code is licensed under the GNU General Public License,
23 * Version 2. See the file COPYING for more details.
24 */
25
26#ifndef __CRC16_H
27#define __CRC16_H
28
29#include <linux/types.h>
30
31#define CRC16_INIT 0
32#define CRC16_VALID 0xb001
33
34extern u16 const crc16_table[256];
35
36extern u16 crc16(u16 crc, const u8 *buffer, size_t len);
37
38static inline u16 crc16_byte(u16 crc, const u8 data)
39{
40 return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff];
41}
42
43#endif /* __CRC16_H */
44
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 5e2bcc636a02..3c89df6e7768 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -45,6 +45,7 @@
45#define CRYPTO_TFM_MODE_CTR 0x00000008 45#define CRYPTO_TFM_MODE_CTR 0x00000008
46 46
47#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 47#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100
48#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200
48#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 49#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000
49#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 50#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000
50#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 51#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 50be290d24d2..ab04b4f9b0db 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -88,8 +88,9 @@ struct dentry {
88 * negative */ 88 * negative */
89 /* 89 /*
90 * The next three fields are touched by __d_lookup. Place them here 90 * The next three fields are touched by __d_lookup. Place them here
91 * so they all fit in a 16-byte range, with 16-byte alignment. 91 * so they all fit in a cache line.
92 */ 92 */
93 struct hlist_node d_hash; /* lookup hash list */
93 struct dentry *d_parent; /* parent directory */ 94 struct dentry *d_parent; /* parent directory */
94 struct qstr d_name; 95 struct qstr d_name;
95 96
@@ -103,7 +104,6 @@ struct dentry {
103 void *d_fsdata; /* fs-specific data */ 104 void *d_fsdata; /* fs-specific data */
104 struct rcu_head d_rcu; 105 struct rcu_head d_rcu;
105 struct dcookie_struct *d_cookie; /* cookie, if any */ 106 struct dcookie_struct *d_cookie; /* cookie, if any */
106 struct hlist_node d_hash; /* lookup hash list */
107 int d_mounted; 107 int d_mounted;
108 unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ 108 unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */
109}; 109};
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 007c290f74d4..8bf4bacb5051 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -432,7 +432,10 @@ struct dccp_sock {
432 struct ccid *dccps_hc_rx_ccid; 432 struct ccid *dccps_hc_rx_ccid;
433 struct ccid *dccps_hc_tx_ccid; 433 struct ccid *dccps_hc_tx_ccid;
434 struct dccp_options_received dccps_options_received; 434 struct dccp_options_received dccps_options_received;
435 struct timeval dccps_epoch;
435 enum dccp_role dccps_role:2; 436 enum dccp_role dccps_role:2;
437 __u8 dccps_hc_rx_insert_options:1;
438 __u8 dccps_hc_tx_insert_options:1;
436}; 439};
437 440
438static inline struct dccp_sock *dccp_sk(const struct sock *sk) 441static inline struct dccp_sock *dccp_sk(const struct sock *sk)
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 5e93e6dce9a4..c30175e8dec6 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -1,6 +1,8 @@
1#ifndef __DMI_H__ 1#ifndef __DMI_H__
2#define __DMI_H__ 2#define __DMI_H__
3 3
4#include <linux/list.h>
5
4enum dmi_field { 6enum dmi_field {
5 DMI_NONE, 7 DMI_NONE,
6 DMI_BIOS_VENDOR, 8 DMI_BIOS_VENDOR,
@@ -16,6 +18,24 @@ enum dmi_field {
16 DMI_STRING_MAX, 18 DMI_STRING_MAX,
17}; 19};
18 20
21enum dmi_device_type {
22 DMI_DEV_TYPE_ANY = 0,
23 DMI_DEV_TYPE_OTHER,
24 DMI_DEV_TYPE_UNKNOWN,
25 DMI_DEV_TYPE_VIDEO,
26 DMI_DEV_TYPE_SCSI,
27 DMI_DEV_TYPE_ETHERNET,
28 DMI_DEV_TYPE_TOKENRING,
29 DMI_DEV_TYPE_SOUND,
30 DMI_DEV_TYPE_IPMI = -1
31};
32
33struct dmi_header {
34 u8 type;
35 u8 length;
36 u16 handle;
37};
38
19/* 39/*
20 * DMI callbacks for problem boards 40 * DMI callbacks for problem boards
21 */ 41 */
@@ -26,22 +46,32 @@ struct dmi_strmatch {
26 46
27struct dmi_system_id { 47struct dmi_system_id {
28 int (*callback)(struct dmi_system_id *); 48 int (*callback)(struct dmi_system_id *);
29 char *ident; 49 const char *ident;
30 struct dmi_strmatch matches[4]; 50 struct dmi_strmatch matches[4];
31 void *driver_data; 51 void *driver_data;
32}; 52};
33 53
34#define DMI_MATCH(a,b) { a, b } 54#define DMI_MATCH(a, b) { a, b }
55
56struct dmi_device {
57 struct list_head list;
58 int type;
59 const char *name;
60 void *device_data; /* Type specific data */
61};
35 62
36#if defined(CONFIG_X86) && !defined(CONFIG_X86_64) 63#if defined(CONFIG_X86) && !defined(CONFIG_X86_64)
37 64
38extern int dmi_check_system(struct dmi_system_id *list); 65extern int dmi_check_system(struct dmi_system_id *list);
39extern char * dmi_get_system_info(int field); 66extern char * dmi_get_system_info(int field);
40 67extern struct dmi_device * dmi_find_device(int type, const char *name,
68 struct dmi_device *from);
41#else 69#else
42 70
43static inline int dmi_check_system(struct dmi_system_id *list) { return 0; } 71static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
44static inline char * dmi_get_system_info(int field) { return NULL; } 72static inline char * dmi_get_system_info(int field) { return NULL; }
73static struct dmi_device * dmi_find_device(int type, const char *name,
74 struct dmi_device *from) { return NULL; }
45 75
46#endif 76#endif
47 77
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 73781ec165b4..c7c5dd316182 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -91,11 +91,6 @@ typedef struct {
91 91
92#define EFI_PAGE_SHIFT 12 92#define EFI_PAGE_SHIFT 12
93 93
94/*
95 * For current x86 implementations of EFI, there is
96 * additional padding in the mem descriptors. This is not
97 * the case in ia64. Need to have this fixed in the f/w.
98 */
99typedef struct { 94typedef struct {
100 u32 type; 95 u32 type;
101 u32 pad; 96 u32 pad;
@@ -103,9 +98,6 @@ typedef struct {
103 u64 virt_addr; 98 u64 virt_addr;
104 u64 num_pages; 99 u64 num_pages;
105 u64 attribute; 100 u64 attribute;
106#if defined (__i386__)
107 u64 pad1;
108#endif
109} efi_memory_desc_t; 101} efi_memory_desc_t;
110 102
111typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg); 103typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg);
@@ -240,10 +232,12 @@ typedef struct {
240} efi_system_table_t; 232} efi_system_table_t;
241 233
242struct efi_memory_map { 234struct efi_memory_map {
243 efi_memory_desc_t *phys_map; 235 void *phys_map;
244 efi_memory_desc_t *map; 236 void *map;
237 void *map_end;
245 int nr_map; 238 int nr_map;
246 unsigned long desc_version; 239 unsigned long desc_version;
240 unsigned long desc_size;
247}; 241};
248 242
249/* 243/*
diff --git a/include/linux/elf.h b/include/linux/elf.h
index f5b3ba5a317d..ff955dbf510d 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -2,6 +2,7 @@
2#define _LINUX_ELF_H 2#define _LINUX_ELF_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/auxvec.h>
5#include <asm/elf.h> 6#include <asm/elf.h>
6 7
7#ifndef elf_read_implies_exec 8#ifndef elf_read_implies_exec
@@ -158,29 +159,6 @@ typedef __s64 Elf64_Sxword;
158#define ELF64_ST_BIND(x) ELF_ST_BIND(x) 159#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
159#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x) 160#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
160 161
161/* Symbolic values for the entries in the auxiliary table
162 put on the initial stack */
163#define AT_NULL 0 /* end of vector */
164#define AT_IGNORE 1 /* entry should be ignored */
165#define AT_EXECFD 2 /* file descriptor of program */
166#define AT_PHDR 3 /* program headers for program */
167#define AT_PHENT 4 /* size of program header entry */
168#define AT_PHNUM 5 /* number of program headers */
169#define AT_PAGESZ 6 /* system page size */
170#define AT_BASE 7 /* base address of interpreter */
171#define AT_FLAGS 8 /* flags */
172#define AT_ENTRY 9 /* entry point of program */
173#define AT_NOTELF 10 /* program is not ELF */
174#define AT_UID 11 /* real uid */
175#define AT_EUID 12 /* effective uid */
176#define AT_GID 13 /* real gid */
177#define AT_EGID 14 /* effective gid */
178#define AT_PLATFORM 15 /* string identifying CPU for optimizations */
179#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */
180#define AT_CLKTCK 17 /* frequency at which times() increments */
181
182#define AT_SECURE 23 /* secure mode boolean */
183
184typedef struct dynamic{ 162typedef struct dynamic{
185 Elf32_Sword d_tag; 163 Elf32_Sword d_tag;
186 union{ 164 union{
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index a657130ba03a..f7bd1c7ebefb 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -313,6 +313,9 @@ struct ext2_inode {
313#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ 313#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */
314#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ 314#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */
315#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ 315#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */
316#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */
317#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */
318
316 319
317#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt 320#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
318#define set_opt(o, opt) o |= EXT2_MOUNT_##opt 321#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index c16662836c58..c0272d73ab20 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -373,6 +373,8 @@ struct ext3_inode {
373#define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ 373#define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */
374#define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */ 374#define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */
375#define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ 375#define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */
376#define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
377#define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
376 378
377/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ 379/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
378#ifndef _LINUX_EXT2_FS_H 380#ifndef _LINUX_EXT2_FS_H
diff --git a/include/linux/fb.h b/include/linux/fb.h
index bc24beeed971..82e39cd0c4fb 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -107,6 +107,8 @@
107#define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */ 107#define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */
108#define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */ 108#define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */
109#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */ 109#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */
110#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
111#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
110#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ 112#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
111#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ 113#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
112#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ 114#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
@@ -495,6 +497,9 @@ struct fb_cursor_user {
495#define FB_EVENT_BLANK 0x08 497#define FB_EVENT_BLANK 0x08
496/* Private modelist is to be replaced */ 498/* Private modelist is to be replaced */
497#define FB_EVENT_NEW_MODELIST 0x09 499#define FB_EVENT_NEW_MODELIST 0x09
500/* The resolution of the passed in fb_info about to change and
501 all vc's should be changed */
502#define FB_EVENT_MODE_CHANGE_ALL 0x0A
498 503
499struct fb_event { 504struct fb_event {
500 struct fb_info *info; 505 struct fb_info *info;
@@ -820,13 +825,29 @@ extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx,
820 u32 height, u32 shift_high, u32 shift_low, u32 mod); 825 u32 height, u32 shift_high, u32 shift_low, u32 mod);
821extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height); 826extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height);
822extern void fb_set_suspend(struct fb_info *info, int state); 827extern void fb_set_suspend(struct fb_info *info, int state);
823extern int fb_get_color_depth(struct fb_var_screeninfo *var); 828extern int fb_get_color_depth(struct fb_var_screeninfo *var,
829 struct fb_fix_screeninfo *fix);
824extern int fb_get_options(char *name, char **option); 830extern int fb_get_options(char *name, char **option);
825extern int fb_new_modelist(struct fb_info *info); 831extern int fb_new_modelist(struct fb_info *info);
826 832
827extern struct fb_info *registered_fb[FB_MAX]; 833extern struct fb_info *registered_fb[FB_MAX];
828extern int num_registered_fb; 834extern int num_registered_fb;
829 835
836static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
837 u8 *src, u32 s_pitch, u32 height)
838{
839 int i, j;
840
841 d_pitch -= s_pitch;
842
843 for (i = height; i--; ) {
844 /* s_pitch is a few bytes at the most, memcpy is suboptimal */
845 for (j = 0; j < s_pitch; j++)
846 *dst++ = *src++;
847 dst += d_pitch;
848 }
849}
850
830/* drivers/video/fbsysfs.c */ 851/* drivers/video/fbsysfs.c */
831extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); 852extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
832extern void framebuffer_release(struct fb_info *info); 853extern void framebuffer_release(struct fb_info *info);
@@ -856,8 +877,11 @@ extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var,
856extern int fb_validate_mode(const struct fb_var_screeninfo *var, 877extern int fb_validate_mode(const struct fb_var_screeninfo *var,
857 struct fb_info *info); 878 struct fb_info *info);
858extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var); 879extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var);
859extern void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs); 880extern const unsigned char *fb_firmware_edid(struct device *device);
881extern void fb_edid_to_monspecs(unsigned char *edid,
882 struct fb_monspecs *specs);
860extern void fb_destroy_modedb(struct fb_videomode *modedb); 883extern void fb_destroy_modedb(struct fb_videomode *modedb);
884extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb);
861 885
862/* drivers/video/modedb.c */ 886/* drivers/video/modedb.c */
863#define VESA_MODEDB_SIZE 34 887#define VESA_MODEDB_SIZE 34
diff --git a/include/linux/file.h b/include/linux/file.h
index 5206beb9a80e..f5bbd4c508b3 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -9,6 +9,7 @@
9#include <linux/posix_types.h> 9#include <linux/posix_types.h>
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <linux/spinlock.h> 11#include <linux/spinlock.h>
12#include <linux/rcupdate.h>
12 13
13/* 14/*
14 * The default fd array needs to be at least BITS_PER_LONG, 15 * The default fd array needs to be at least BITS_PER_LONG,
@@ -16,23 +17,33 @@
16 */ 17 */
17#define NR_OPEN_DEFAULT BITS_PER_LONG 18#define NR_OPEN_DEFAULT BITS_PER_LONG
18 19
20struct fdtable {
21 unsigned int max_fds;
22 int max_fdset;
23 int next_fd;
24 struct file ** fd; /* current fd array */
25 fd_set *close_on_exec;
26 fd_set *open_fds;
27 struct rcu_head rcu;
28 struct files_struct *free_files;
29 struct fdtable *next;
30};
31
19/* 32/*
20 * Open file table structure 33 * Open file table structure
21 */ 34 */
22struct files_struct { 35struct files_struct {
23 atomic_t count; 36 atomic_t count;
24 spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */ 37 spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */
25 int max_fds; 38 struct fdtable *fdt;
26 int max_fdset; 39 struct fdtable fdtab;
27 int next_fd;
28 struct file ** fd; /* current fd array */
29 fd_set *close_on_exec;
30 fd_set *open_fds;
31 fd_set close_on_exec_init; 40 fd_set close_on_exec_init;
32 fd_set open_fds_init; 41 fd_set open_fds_init;
33 struct file * fd_array[NR_OPEN_DEFAULT]; 42 struct file * fd_array[NR_OPEN_DEFAULT];
34}; 43};
35 44
45#define files_fdtable(files) (rcu_dereference((files)->fdt))
46
36extern void FASTCALL(__fput(struct file *)); 47extern void FASTCALL(__fput(struct file *));
37extern void FASTCALL(fput(struct file *)); 48extern void FASTCALL(fput(struct file *));
38 49
@@ -59,13 +70,16 @@ extern fd_set *alloc_fdset(int);
59extern void free_fdset(fd_set *, int); 70extern void free_fdset(fd_set *, int);
60 71
61extern int expand_files(struct files_struct *, int nr); 72extern int expand_files(struct files_struct *, int nr);
73extern void free_fdtable(struct fdtable *fdt);
74extern void __init files_defer_init(void);
62 75
63static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 76static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
64{ 77{
65 struct file * file = NULL; 78 struct file * file = NULL;
79 struct fdtable *fdt = files_fdtable(files);
66 80
67 if (fd < files->max_fds) 81 if (fd < fdt->max_fds)
68 file = files->fd[fd]; 82 file = rcu_dereference(fdt->fd[fd]);
69 return file; 83 return file;
70} 84}
71 85
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 886255b69bb9..2063c0839d4f 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -3,6 +3,9 @@
3#include <linux/module.h> 3#include <linux/module.h>
4#include <linux/types.h> 4#include <linux/types.h>
5#define FIRMWARE_NAME_MAX 30 5#define FIRMWARE_NAME_MAX 30
6#define FW_ACTION_NOHOTPLUG 0
7#define FW_ACTION_HOTPLUG 1
8
6struct firmware { 9struct firmware {
7 size_t size; 10 size_t size;
8 u8 *data; 11 u8 *data;
@@ -11,7 +14,7 @@ struct device;
11int request_firmware(const struct firmware **fw, const char *name, 14int request_firmware(const struct firmware **fw, const char *name,
12 struct device *device); 15 struct device *device);
13int request_firmware_nowait( 16int request_firmware_nowait(
14 struct module *module, 17 struct module *module, int hotplug,
15 const char *name, struct device *device, void *context, 18 const char *name, struct device *device, void *context,
16 void (*cont)(const struct firmware *fw, void *context)); 19 void (*cont)(const struct firmware *fw, void *context));
17 20
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 67e6732d4fdc..7f61227827d7 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,6 +9,7 @@
9#include <linux/config.h> 9#include <linux/config.h>
10#include <linux/limits.h> 10#include <linux/limits.h>
11#include <linux/ioctl.h> 11#include <linux/ioctl.h>
12#include <linux/rcuref.h>
12 13
13/* 14/*
14 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change 15 * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
@@ -69,6 +70,7 @@ extern int dir_notify_enable;
69#define READ 0 70#define READ 0
70#define WRITE 1 71#define WRITE 1
71#define READA 2 /* read-ahead - don't block if no resources */ 72#define READA 2 /* read-ahead - don't block if no resources */
73#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
72#define SPECIAL 4 /* For non-blockdevice requests in request queue */ 74#define SPECIAL 4 /* For non-blockdevice requests in request queue */
73#define READ_SYNC (READ | (1 << BIO_RW_SYNC)) 75#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
74#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) 76#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
@@ -281,19 +283,9 @@ struct iattr {
281 struct timespec ia_atime; 283 struct timespec ia_atime;
282 struct timespec ia_mtime; 284 struct timespec ia_mtime;
283 struct timespec ia_ctime; 285 struct timespec ia_ctime;
284 unsigned int ia_attr_flags;
285}; 286};
286 287
287/* 288/*
288 * This is the inode attributes flag definitions
289 */
290#define ATTR_FLAG_SYNCRONOUS 1 /* Syncronous write */
291#define ATTR_FLAG_NOATIME 2 /* Don't update atime */
292#define ATTR_FLAG_APPEND 4 /* Append-only file */
293#define ATTR_FLAG_IMMUTABLE 8 /* Immutable file */
294#define ATTR_FLAG_NODIRATIME 16 /* Don't update atime for directory */
295
296/*
297 * Includes for diskquotas. 289 * Includes for diskquotas.
298 */ 290 */
299#include <linux/quota.h> 291#include <linux/quota.h>
@@ -594,7 +586,6 @@ struct file {
594 unsigned int f_uid, f_gid; 586 unsigned int f_uid, f_gid;
595 struct file_ra_state f_ra; 587 struct file_ra_state f_ra;
596 588
597 size_t f_maxcount;
598 unsigned long f_version; 589 unsigned long f_version;
599 void *f_security; 590 void *f_security;
600 591
@@ -607,12 +598,13 @@ struct file {
607 spinlock_t f_ep_lock; 598 spinlock_t f_ep_lock;
608#endif /* #ifdef CONFIG_EPOLL */ 599#endif /* #ifdef CONFIG_EPOLL */
609 struct address_space *f_mapping; 600 struct address_space *f_mapping;
601 struct rcu_head f_rcuhead;
610}; 602};
611extern spinlock_t files_lock; 603extern spinlock_t files_lock;
612#define file_list_lock() spin_lock(&files_lock); 604#define file_list_lock() spin_lock(&files_lock);
613#define file_list_unlock() spin_unlock(&files_lock); 605#define file_list_unlock() spin_unlock(&files_lock);
614 606
615#define get_file(x) atomic_inc(&(x)->f_count) 607#define get_file(x) rcuref_inc(&(x)->f_count)
616#define file_count(x) atomic_read(&(x)->f_count) 608#define file_count(x) atomic_read(&(x)->f_count)
617 609
618#define MAX_NON_LFS ((1UL<<31) - 1) 610#define MAX_NON_LFS ((1UL<<31) - 1)
@@ -1291,6 +1283,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
1291/* fs/open.c */ 1283/* fs/open.c */
1292 1284
1293extern int do_truncate(struct dentry *, loff_t start); 1285extern int do_truncate(struct dentry *, loff_t start);
1286extern long do_sys_open(const char __user *filename, int flags, int mode);
1294extern struct file *filp_open(const char *, int, int); 1287extern struct file *filp_open(const char *, int, int);
1295extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); 1288extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
1296extern int filp_close(struct file *, fl_owner_t id); 1289extern int filp_close(struct file *, fl_owner_t id);
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
new file mode 100644
index 000000000000..acbeb96a3353
--- /dev/null
+++ b/include/linux/fuse.h
@@ -0,0 +1,259 @@
1/*
2 FUSE: Filesystem in Userspace
3 Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu>
4
5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING.
7*/
8
9/* This file defines the kernel interface of FUSE */
10
11#include <asm/types.h>
12
13/** Version number of this interface */
14#define FUSE_KERNEL_VERSION 7
15
16/** Minor version number of this interface */
17#define FUSE_KERNEL_MINOR_VERSION 2
18
19/** The node ID of the root inode */
20#define FUSE_ROOT_ID 1
21
22/** The major number of the fuse character device */
23#define FUSE_MAJOR 10
24
25/** The minor number of the fuse character device */
26#define FUSE_MINOR 229
27
28/* Make sure all structures are padded to 64bit boundary, so 32bit
29 userspace works under 64bit kernels */
30
31struct fuse_attr {
32 __u64 ino;
33 __u64 size;
34 __u64 blocks;
35 __u64 atime;
36 __u64 mtime;
37 __u64 ctime;
38 __u32 atimensec;
39 __u32 mtimensec;
40 __u32 ctimensec;
41 __u32 mode;
42 __u32 nlink;
43 __u32 uid;
44 __u32 gid;
45 __u32 rdev;
46};
47
48struct fuse_kstatfs {
49 __u64 blocks;
50 __u64 bfree;
51 __u64 bavail;
52 __u64 files;
53 __u64 ffree;
54 __u32 bsize;
55 __u32 namelen;
56};
57
58#define FATTR_MODE (1 << 0)
59#define FATTR_UID (1 << 1)
60#define FATTR_GID (1 << 2)
61#define FATTR_SIZE (1 << 3)
62#define FATTR_ATIME (1 << 4)
63#define FATTR_MTIME (1 << 5)
64#define FATTR_CTIME (1 << 6)
65
66/**
67 * Flags returned by the OPEN request
68 *
69 * FOPEN_DIRECT_IO: bypass page cache for this open file
70 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
71 */
72#define FOPEN_DIRECT_IO (1 << 0)
73#define FOPEN_KEEP_CACHE (1 << 1)
74
75enum fuse_opcode {
76 FUSE_LOOKUP = 1,
77 FUSE_FORGET = 2, /* no reply */
78 FUSE_GETATTR = 3,
79 FUSE_SETATTR = 4,
80 FUSE_READLINK = 5,
81 FUSE_SYMLINK = 6,
82 FUSE_MKNOD = 8,
83 FUSE_MKDIR = 9,
84 FUSE_UNLINK = 10,
85 FUSE_RMDIR = 11,
86 FUSE_RENAME = 12,
87 FUSE_LINK = 13,
88 FUSE_OPEN = 14,
89 FUSE_READ = 15,
90 FUSE_WRITE = 16,
91 FUSE_STATFS = 17,
92 FUSE_RELEASE = 18,
93 FUSE_FSYNC = 20,
94 FUSE_SETXATTR = 21,
95 FUSE_GETXATTR = 22,
96 FUSE_LISTXATTR = 23,
97 FUSE_REMOVEXATTR = 24,
98 FUSE_FLUSH = 25,
99 FUSE_INIT = 26,
100 FUSE_OPENDIR = 27,
101 FUSE_READDIR = 28,
102 FUSE_RELEASEDIR = 29,
103 FUSE_FSYNCDIR = 30
104};
105
106/* Conservative buffer size for the client */
107#define FUSE_MAX_IN 8192
108
109#define FUSE_NAME_MAX 1024
110#define FUSE_SYMLINK_MAX 4096
111#define FUSE_XATTR_SIZE_MAX 4096
112
113struct fuse_entry_out {
114 __u64 nodeid; /* Inode ID */
115 __u64 generation; /* Inode generation: nodeid:gen must
116 be unique for the fs's lifetime */
117 __u64 entry_valid; /* Cache timeout for the name */
118 __u64 attr_valid; /* Cache timeout for the attributes */
119 __u32 entry_valid_nsec;
120 __u32 attr_valid_nsec;
121 struct fuse_attr attr;
122};
123
124struct fuse_forget_in {
125 __u64 nlookup;
126};
127
128struct fuse_attr_out {
129 __u64 attr_valid; /* Cache timeout for the attributes */
130 __u32 attr_valid_nsec;
131 __u32 dummy;
132 struct fuse_attr attr;
133};
134
135struct fuse_mknod_in {
136 __u32 mode;
137 __u32 rdev;
138};
139
140struct fuse_mkdir_in {
141 __u32 mode;
142 __u32 padding;
143};
144
145struct fuse_rename_in {
146 __u64 newdir;
147};
148
149struct fuse_link_in {
150 __u64 oldnodeid;
151};
152
153struct fuse_setattr_in {
154 __u32 valid;
155 __u32 padding;
156 struct fuse_attr attr;
157};
158
159struct fuse_open_in {
160 __u32 flags;
161 __u32 padding;
162};
163
164struct fuse_open_out {
165 __u64 fh;
166 __u32 open_flags;
167 __u32 padding;
168};
169
170struct fuse_release_in {
171 __u64 fh;
172 __u32 flags;
173 __u32 padding;
174};
175
176struct fuse_flush_in {
177 __u64 fh;
178 __u32 flush_flags;
179 __u32 padding;
180};
181
182struct fuse_read_in {
183 __u64 fh;
184 __u64 offset;
185 __u32 size;
186 __u32 padding;
187};
188
189struct fuse_write_in {
190 __u64 fh;
191 __u64 offset;
192 __u32 size;
193 __u32 write_flags;
194};
195
196struct fuse_write_out {
197 __u32 size;
198 __u32 padding;
199};
200
201struct fuse_statfs_out {
202 struct fuse_kstatfs st;
203};
204
205struct fuse_fsync_in {
206 __u64 fh;
207 __u32 fsync_flags;
208 __u32 padding;
209};
210
211struct fuse_setxattr_in {
212 __u32 size;
213 __u32 flags;
214};
215
216struct fuse_getxattr_in {
217 __u32 size;
218 __u32 padding;
219};
220
221struct fuse_getxattr_out {
222 __u32 size;
223 __u32 padding;
224};
225
226struct fuse_init_in_out {
227 __u32 major;
228 __u32 minor;
229};
230
231struct fuse_in_header {
232 __u32 len;
233 __u32 opcode;
234 __u64 unique;
235 __u64 nodeid;
236 __u32 uid;
237 __u32 gid;
238 __u32 pid;
239 __u32 padding;
240};
241
242struct fuse_out_header {
243 __u32 len;
244 __s32 error;
245 __u64 unique;
246};
247
248struct fuse_dirent {
249 __u64 ino;
250 __u64 off;
251 __u32 namelen;
252 __u32 type;
253 char name[0];
254};
255
256#define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name)
257#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
258#define FUSE_DIRENT_SIZE(d) \
259 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
diff --git a/include/linux/futex.h b/include/linux/futex.h
index 65d6cfdb6d39..10f96c31971e 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -4,14 +4,40 @@
4/* Second argument to futex syscall */ 4/* Second argument to futex syscall */
5 5
6 6
7#define FUTEX_WAIT (0) 7#define FUTEX_WAIT 0
8#define FUTEX_WAKE (1) 8#define FUTEX_WAKE 1
9#define FUTEX_FD (2) 9#define FUTEX_FD 2
10#define FUTEX_REQUEUE (3) 10#define FUTEX_REQUEUE 3
11#define FUTEX_CMP_REQUEUE (4) 11#define FUTEX_CMP_REQUEUE 4
12#define FUTEX_WAKE_OP 5
12 13
13long do_futex(unsigned long uaddr, int op, int val, 14long do_futex(unsigned long uaddr, int op, int val,
14 unsigned long timeout, unsigned long uaddr2, int val2, 15 unsigned long timeout, unsigned long uaddr2, int val2,
15 int val3); 16 int val3);
16 17
18#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
19#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
20#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */
21#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */
22#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */
23
24#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */
25
26#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */
27#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */
28#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */
29#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */
30#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */
31#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */
32
33/* FUTEX_WAKE_OP will perform atomically
34 int oldval = *(int *)UADDR2;
35 *(int *)UADDR2 = oldval OP OPARG;
36 if (oldval CMP CMPARG)
37 wake UADDR2; */
38
39#define FUTEX_OP(op, oparg, cmp, cmparg) \
40 (((op & 0xf) << 28) | ((cmp & 0xf) << 24) \
41 | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
42
17#endif 43#endif
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 7c7400137e97..4dc990f3b5cc 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -40,6 +40,7 @@ struct vm_area_struct;
40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */ 40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */
41#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ 41#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */
42#define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ 42#define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */
43#define __GFP_HARDWALL 0x40000u /* Enforce hardwall cpuset memory allocs */
43 44
44#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ 45#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
45#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) 46#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1)
@@ -48,14 +49,15 @@ struct vm_area_struct;
48#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ 49#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
49 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ 50 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
50 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ 51 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
51 __GFP_NOMEMALLOC|__GFP_NORECLAIM) 52 __GFP_NOMEMALLOC|__GFP_NORECLAIM|__GFP_HARDWALL)
52 53
53#define GFP_ATOMIC (__GFP_HIGH) 54#define GFP_ATOMIC (__GFP_HIGH)
54#define GFP_NOIO (__GFP_WAIT) 55#define GFP_NOIO (__GFP_WAIT)
55#define GFP_NOFS (__GFP_WAIT | __GFP_IO) 56#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
56#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) 57#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
57#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS) 58#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
58#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGHMEM) 59#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
60 __GFP_HIGHMEM)
59 61
60/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some 62/* Flag - indicates that the buffer will be suitable for DMA. Ignored on some
61 platforms, used as appropriate on others */ 63 platforms, used as appropriate on others */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index f529d1442815..e670b0d13fe0 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -70,12 +70,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
70void hugetlb_prefault_arch_hook(struct mm_struct *mm); 70void hugetlb_prefault_arch_hook(struct mm_struct *mm);
71#endif 71#endif
72 72
73#ifndef ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE
74#define hugetlb_clean_stale_pgtable(pte) BUG()
75#else
76void hugetlb_clean_stale_pgtable(pte_t *pte);
77#endif
78
79#else /* !CONFIG_HUGETLB_PAGE */ 73#else /* !CONFIG_HUGETLB_PAGE */
80 74
81static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) 75static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h
index 1b5018a965f5..7eb4004b3601 100644
--- a/include/linux/hwmon-sysfs.h
+++ b/include/linux/hwmon-sysfs.h
@@ -33,4 +33,19 @@ struct sensor_device_attribute sensor_dev_attr_##_name = { \
33 .index = _index, \ 33 .index = _index, \
34} 34}
35 35
36struct sensor_device_attribute_2 {
37 struct device_attribute dev_attr;
38 u8 index;
39 u8 nr;
40};
41#define to_sensor_dev_attr_2(_dev_attr) \
42 container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr)
43
44#define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \
45struct sensor_device_attribute_2 sensor_dev_attr_##_name = { \
46 .dev_attr = __ATTR(_name,_mode,_show,_store), \
47 .index = _index, \
48 .nr = _nr, \
49}
50
36#endif /* _LINUX_HWMON_SYSFS_H */ 51#endif /* _LINUX_HWMON_SYSFS_H */
diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h
new file mode 100644
index 000000000000..cd4b7a042b86
--- /dev/null
+++ b/include/linux/hwmon-vid.h
@@ -0,0 +1,45 @@
1/*
2 hwmon-vid.h - VID/VRM/VRD voltage conversions
3
4 Originally part of lm_sensors
5 Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
6 With assistance from Trent Piepho <xyzzy@speakeasy.org>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#ifndef _LINUX_HWMON_VID_H
24#define _LINUX_HWMON_VID_H
25
26int vid_from_reg(int val, int vrm);
27int vid_which_vrm(void);
28
29/* vrm is the VRM/VRD document version multiplied by 10.
30 val is in mV to avoid floating point in the kernel.
31 Returned value is the 4-, 5- or 6-bit VID code.
32 Note that only VRM 9.x is supported for now. */
33static inline int vid_to_reg(int val, int vrm)
34{
35 switch (vrm) {
36 case 91: /* VRM 9.1 */
37 case 90: /* VRM 9.0 */
38 return ((val >= 1100) && (val <= 1850) ?
39 ((18499 - val * 10) / 25 + 5) / 10 : -1);
40 default:
41 return -1;
42 }
43}
44
45#endif /* _LINUX_HWMON_VID_H */
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
new file mode 100644
index 000000000000..0efd994c37f1
--- /dev/null
+++ b/include/linux/hwmon.h
@@ -0,0 +1,35 @@
1/*
2 hwmon.h - part of lm_sensors, Linux kernel modules for hardware monitoring
3
4 This file declares helper functions for the sysfs class "hwmon",
5 for use by sensors drivers.
6
7 Copyright (C) 2005 Mark M. Hoffman <mhoffman@lightlink.com>
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
12*/
13
14#ifndef _HWMON_H_
15#define _HWMON_H_
16
17#include <linux/device.h>
18
19struct class_device *hwmon_device_register(struct device *dev);
20
21void hwmon_device_unregister(struct class_device *cdev);
22
23/* Scale user input to sensible values */
24static inline int SENSORS_LIMIT(long value, long low, long high)
25{
26 if (value < low)
27 return low;
28 else if (value > high)
29 return high;
30 else
31 return value;
32}
33
34#endif
35
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 33f08258f22b..44f30876a1c9 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -1,6 +1,6 @@
1/* ------------------------------------------------------------------------- */ 1/* ------------------------------------------------------------------------- */
2/* */ 2/* */
3/* i2c.h - definitions for the i2c-bus interface */ 3/* i2c-id.h - identifier values for i2c drivers and adapters */
4/* */ 4/* */
5/* ------------------------------------------------------------------------- */ 5/* ------------------------------------------------------------------------- */
6/* Copyright (C) 1995-1999 Simon G. Vogl 6/* Copyright (C) 1995-1999 Simon G. Vogl
@@ -24,16 +24,6 @@
24#define LINUX_I2C_ID_H 24#define LINUX_I2C_ID_H
25 25
26/* 26/*
27 * This file is part of the i2c-bus package and contains the identifier
28 * values for drivers, adapters and other folk populating these serial
29 * worlds.
30 *
31 * These will change often (i.e. additions) , therefore this has been
32 * separated from the functional interface definitions of the i2c api.
33 *
34 */
35
36/*
37 * ---- Driver types ----------------------------------------------------- 27 * ---- Driver types -----------------------------------------------------
38 * device id name + number function description, i2c address(es) 28 * device id name + number function description, i2c address(es)
39 * 29 *
@@ -170,151 +160,113 @@
170 160
171/* 161/*
172 * ---- Adapter types ---------------------------------------------------- 162 * ---- Adapter types ----------------------------------------------------
173 *
174 * First, we distinguish between several algorithms to access the hardware
175 * interface types, as a PCF 8584 needs other care than a bit adapter.
176 */
177
178#define I2C_ALGO_NONE 0x000000
179#define I2C_ALGO_BIT 0x010000 /* bit style adapters */
180#define I2C_ALGO_PCF 0x020000 /* PCF 8584 style adapters */
181#define I2C_ALGO_ATI 0x030000 /* ATI video card */
182#define I2C_ALGO_SMBUS 0x040000
183#define I2C_ALGO_ISA 0x050000 /* lm_sensors ISA pseudo-adapter */
184#define I2C_ALGO_SAA7146 0x060000 /* SAA 7146 video decoder bus */
185#define I2C_ALGO_ACB 0x070000 /* ACCESS.bus algorithm */
186#define I2C_ALGO_IIC 0x080000 /* ITE IIC bus */
187#define I2C_ALGO_SAA7134 0x090000
188#define I2C_ALGO_MPC824X 0x0a0000 /* Motorola 8240 / 8245 */
189#define I2C_ALGO_IPMI 0x0b0000 /* IPMI dummy adapter */
190#define I2C_ALGO_IPMB 0x0c0000 /* IPMB adapter */
191#define I2C_ALGO_MPC107 0x0d0000
192#define I2C_ALGO_EC 0x100000 /* ACPI embedded controller */
193
194#define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */
195#define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */
196#define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */
197#define I2C_ALGO_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */
198#define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */
199#define I2C_ALGO_SGI 0x160000 /* SGI algorithm */
200
201#define I2C_ALGO_USB 0x170000 /* USB algorithm */
202#define I2C_ALGO_VIRT 0x180000 /* Virtual bus adapter */
203
204#define I2C_ALGO_MV64XXX 0x190000 /* Marvell mv64xxx i2c ctlr */
205#define I2C_ALGO_PCA 0x1a0000 /* PCA 9564 style adapters */
206#define I2C_ALGO_AU1550 0x1b0000 /* Au1550 PSC algorithm */
207
208#define I2C_ALGO_EXP 0x800000 /* experimental */
209
210#define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */
211#define I2C_ALGO_SHIFT 0x10 /* right shift to get index values */
212
213#define I2C_HW_ADAPS 0x10000 /* # adapter types */
214#define I2C_HW_MASK 0xffff
215
216
217/* hw specific modules that are defined per algorithm layer
218 */ 163 */
219 164
220/* --- Bit algorithm adapters */ 165/* --- Bit algorithm adapters */
221#define I2C_HW_B_LP 0x00 /* Parallel port Philips style adapter */ 166#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */
222#define I2C_HW_B_LPC 0x01 /* Parallel port, over control reg. */ 167#define I2C_HW_B_LPC 0x010001 /* Parallel port control reg. */
223#define I2C_HW_B_SER 0x02 /* Serial line interface */ 168#define I2C_HW_B_SER 0x010002 /* Serial line interface */
224#define I2C_HW_B_ELV 0x03 /* ELV Card */ 169#define I2C_HW_B_ELV 0x010003 /* ELV Card */
225#define I2C_HW_B_VELLE 0x04 /* Vellemann K8000 */ 170#define I2C_HW_B_VELLE 0x010004 /* Vellemann K8000 */
226#define I2C_HW_B_BT848 0x05 /* BT848 video boards */ 171#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */
227#define I2C_HW_B_WNV 0x06 /* Winnov Videums */ 172#define I2C_HW_B_WNV 0x010006 /* Winnov Videums */
228#define I2C_HW_B_VIA 0x07 /* Via vt82c586b */ 173#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */
229#define I2C_HW_B_HYDRA 0x08 /* Apple Hydra Mac I/O */ 174#define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */
230#define I2C_HW_B_G400 0x09 /* Matrox G400 */ 175#define I2C_HW_B_G400 0x010009 /* Matrox G400 */
231#define I2C_HW_B_I810 0x0a /* Intel I810 */ 176#define I2C_HW_B_I810 0x01000a /* Intel I810 */
232#define I2C_HW_B_VOO 0x0b /* 3dfx Voodoo 3 / Banshee */ 177#define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */
233#define I2C_HW_B_PPORT 0x0c /* Primitive parallel port adapter */ 178#define I2C_HW_B_PPORT 0x01000c /* Primitive parallel port adapter */
234#define I2C_HW_B_SAVG 0x0d /* Savage 4 */ 179#define I2C_HW_B_SAVG 0x01000d /* Savage 4 */
235#define I2C_HW_B_SCX200 0x0e /* Nat'l Semi SCx200 I2C */ 180#define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */
236#define I2C_HW_B_RIVA 0x10 /* Riva based graphics cards */ 181#define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */
237#define I2C_HW_B_IOC 0x11 /* IOC bit-wiggling */ 182#define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */
238#define I2C_HW_B_TSUNA 0x12 /* DEC Tsunami chipset */ 183#define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */
239#define I2C_HW_B_FRODO 0x13 /* 2d3D, Inc. SA-1110 Development Board */ 184#define I2C_HW_B_FRODO 0x010013 /* 2d3D SA-1110 Development Board */
240#define I2C_HW_B_OMAHA 0x14 /* Omaha I2C interface (ARM) */ 185#define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */
241#define I2C_HW_B_GUIDE 0x15 /* Guide bit-basher */ 186#define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */
242#define I2C_HW_B_IXP2000 0x16 /* GPIO on IXP2000 systems */ 187#define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */
243#define I2C_HW_B_IXP4XX 0x17 /* GPIO on IXP4XX systems */ 188#define I2C_HW_B_IXP4XX 0x010017 /* GPIO on IXP4XX systems */
244#define I2C_HW_B_S3VIA 0x18 /* S3Via ProSavage adapter */ 189#define I2C_HW_B_S3VIA 0x010018 /* S3Via ProSavage adapter */
245#define I2C_HW_B_ZR36067 0x19 /* Zoran-36057/36067 based boards */ 190#define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */
246#define I2C_HW_B_PCILYNX 0x1a /* TI PCILynx I2C adapter */ 191#define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */
247#define I2C_HW_B_CX2388x 0x1b /* connexant 2388x based tv cards */ 192#define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */
193#define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */
194#define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */
195#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */
248 196
249/* --- PCF 8584 based algorithms */ 197/* --- PCF 8584 based algorithms */
250#define I2C_HW_P_LP 0x00 /* Parallel port interface */ 198#define I2C_HW_P_LP 0x020000 /* Parallel port interface */
251#define I2C_HW_P_ISA 0x01 /* generic ISA Bus inteface card */ 199#define I2C_HW_P_ISA 0x020001 /* generic ISA Bus inteface card */
252#define I2C_HW_P_ELEK 0x02 /* Elektor ISA Bus inteface card */ 200#define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */
253 201
254/* --- PCA 9564 based algorithms */ 202/* --- PCA 9564 based algorithms */
255#define I2C_HW_A_ISA 0x00 /* generic ISA Bus interface card */ 203#define I2C_HW_A_ISA 0x1a0000 /* generic ISA Bus interface card */
256 204
257/* --- ACPI Embedded controller algorithms */ 205/* --- ACPI Embedded controller algorithms */
258#define I2C_HW_ACPI_EC 0x00 206#define I2C_HW_ACPI_EC 0x1f0000
259 207
260/* --- MPC824x PowerPC adapters */ 208/* --- MPC824x PowerPC adapters */
261#define I2C_HW_MPC824X 0x00 /* Motorola 8240 / 8245 */ 209#define I2C_HW_MPC824X 0x100001 /* Motorola 8240 / 8245 */
262 210
263/* --- MPC8xx PowerPC adapters */ 211/* --- MPC8xx PowerPC adapters */
264#define I2C_HW_MPC8XX_EPON 0x00 /* Eponymous MPC8xx I2C adapter */ 212#define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */
265 213
266/* --- ITE based algorithms */ 214/* --- ITE based algorithms */
267#define I2C_HW_I_IIC 0x00 /* controller on the ITE */ 215#define I2C_HW_I_IIC 0x080000 /* controller on the ITE */
268 216
269/* --- PowerPC on-chip adapters */ 217/* --- PowerPC on-chip adapters */
270#define I2C_HW_OCP 0x00 /* IBM on-chip I2C adapter */ 218#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */
271 219
272/* --- Broadcom SiByte adapters */ 220/* --- Broadcom SiByte adapters */
273#define I2C_HW_SIBYTE 0x00 221#define I2C_HW_SIBYTE 0x150000
274 222
275/* --- SGI adapters */ 223/* --- SGI adapters */
276#define I2C_HW_SGI_VINO 0x00 224#define I2C_HW_SGI_VINO 0x160000
277#define I2C_HW_SGI_MACE 0x01 225#define I2C_HW_SGI_MACE 0x160001
278 226
279/* --- XSCALE on-chip adapters */ 227/* --- XSCALE on-chip adapters */
280#define I2C_HW_IOP3XX 0x00 228#define I2C_HW_IOP3XX 0x140000
281 229
282/* --- Au1550 PSC adapters adapters */ 230/* --- Au1550 PSC adapters adapters */
283#define I2C_HW_AU1550_PSC 0x00 231#define I2C_HW_AU1550_PSC 0x1b0000
284 232
285/* --- SMBus only adapters */ 233/* --- SMBus only adapters */
286#define I2C_HW_SMBUS_PIIX4 0x00 234#define I2C_HW_SMBUS_PIIX4 0x040000
287#define I2C_HW_SMBUS_ALI15X3 0x01 235#define I2C_HW_SMBUS_ALI15X3 0x040001
288#define I2C_HW_SMBUS_VIA2 0x02 236#define I2C_HW_SMBUS_VIA2 0x040002
289#define I2C_HW_SMBUS_VOODOO3 0x03 237#define I2C_HW_SMBUS_VOODOO3 0x040003
290#define I2C_HW_SMBUS_I801 0x04 238#define I2C_HW_SMBUS_I801 0x040004
291#define I2C_HW_SMBUS_AMD756 0x05 239#define I2C_HW_SMBUS_AMD756 0x040005
292#define I2C_HW_SMBUS_SIS5595 0x06 240#define I2C_HW_SMBUS_SIS5595 0x040006
293#define I2C_HW_SMBUS_ALI1535 0x07 241#define I2C_HW_SMBUS_ALI1535 0x040007
294#define I2C_HW_SMBUS_SIS630 0x08 242#define I2C_HW_SMBUS_SIS630 0x040008
295#define I2C_HW_SMBUS_SIS96X 0x09 243#define I2C_HW_SMBUS_SIS96X 0x040009
296#define I2C_HW_SMBUS_AMD8111 0x0a 244#define I2C_HW_SMBUS_AMD8111 0x04000a
297#define I2C_HW_SMBUS_SCX200 0x0b 245#define I2C_HW_SMBUS_SCX200 0x04000b
298#define I2C_HW_SMBUS_NFORCE2 0x0c 246#define I2C_HW_SMBUS_NFORCE2 0x04000c
299#define I2C_HW_SMBUS_W9968CF 0x0d 247#define I2C_HW_SMBUS_W9968CF 0x04000d
300#define I2C_HW_SMBUS_OV511 0x0e /* OV511(+) USB 1.1 webcam ICs */ 248#define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */
301#define I2C_HW_SMBUS_OV518 0x0f /* OV518(+) USB 1.1 webcam ICs */ 249#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */
302#define I2C_HW_SMBUS_OV519 0x10 /* OV519 USB 1.1 webcam IC */ 250#define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */
303#define I2C_HW_SMBUS_OVFX2 0x11 /* Cypress/OmniVision FX2 webcam */ 251#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */
304 252
305/* --- ISA pseudo-adapter */ 253/* --- ISA pseudo-adapter */
306#define I2C_HW_ISA 0x00 254#define I2C_HW_ISA 0x050000
307 255
308/* --- IPMI pseudo-adapter */ 256/* --- IPMI pseudo-adapter */
309#define I2C_HW_IPMI 0x00 257#define I2C_HW_IPMI 0x0b0000
310 258
311/* --- IPMB adapter */ 259/* --- IPMB adapter */
312#define I2C_HW_IPMB 0x00 260#define I2C_HW_IPMB 0x0c0000
313 261
314/* --- MCP107 adapter */ 262/* --- MCP107 adapter */
315#define I2C_HW_MPC107 0x00 263#define I2C_HW_MPC107 0x0d0000
316 264
317/* --- Marvell mv64xxx i2c adapter */ 265/* --- Marvell mv64xxx i2c adapter */
318#define I2C_HW_MV64XXX 0x00 266#define I2C_HW_MV64XXX 0x190000
267
268/* --- Miscellaneous adapters */
269#define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */
270#define I2C_HW_SAA7134 0x090000 /* SAA7134 video decoder bus */
319 271
320#endif /* LINUX_I2C_ID_H */ 272#endif /* LINUX_I2C_ID_H */
diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h
new file mode 100644
index 000000000000..67e3598c4cec
--- /dev/null
+++ b/include/linux/i2c-isa.h
@@ -0,0 +1,36 @@
1/*
2 * i2c-isa.h - definitions for the i2c-isa pseudo-i2c-adapter interface
3 *
4 * Copyright (C) 2005 Jean Delvare <khali@linux-fr.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (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., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _LINUX_I2C_ISA_H
22#define _LINUX_I2C_ISA_H
23
24#include <linux/i2c.h>
25
26extern int i2c_isa_add_driver(struct i2c_driver *driver);
27extern int i2c_isa_del_driver(struct i2c_driver *driver);
28
29/* Detect whether we are on the isa bus. This is only useful to hybrid
30 (i2c+isa) drivers. */
31#define i2c_is_isa_adapter(adapptr) \
32 ((adapptr)->id == I2C_HW_ISA)
33#define i2c_is_isa_client(clientptr) \
34 i2c_is_isa_adapter((clientptr)->adapter)
35
36#endif /* _LINUX_I2C_ISA_H */
diff --git a/include/linux/i2c-pxa.h b/include/linux/i2c-pxa.h
new file mode 100644
index 000000000000..5f3eaf802223
--- /dev/null
+++ b/include/linux/i2c-pxa.h
@@ -0,0 +1,48 @@
1#ifndef _LINUX_I2C_ALGO_PXA_H
2#define _LINUX_I2C_ALGO_PXA_H
3
4struct i2c_eeprom_emu_watcher {
5 void (*write)(void *, unsigned int addr, unsigned char newval);
6};
7
8struct i2c_eeprom_emu_watch {
9 struct list_head node;
10 unsigned int start;
11 unsigned int end;
12 struct i2c_eeprom_emu_watcher *ops;
13 void *data;
14};
15
16#define I2C_EEPROM_EMU_SIZE (256)
17
18struct i2c_eeprom_emu {
19 unsigned int size;
20 unsigned int ptr;
21 unsigned int seen_start;
22 struct list_head watch;
23
24 unsigned char bytes[I2C_EEPROM_EMU_SIZE];
25};
26
27typedef enum i2c_slave_event_e {
28 I2C_SLAVE_EVENT_START_READ,
29 I2C_SLAVE_EVENT_START_WRITE,
30 I2C_SLAVE_EVENT_STOP
31} i2c_slave_event_t;
32
33struct i2c_slave_client {
34 void *data;
35 void (*event)(void *ptr, i2c_slave_event_t event);
36 int (*read) (void *ptr);
37 void (*write)(void *ptr, unsigned int val);
38};
39
40extern int i2c_eeprom_emu_addwatcher(struct i2c_eeprom_emu *, void *data,
41 unsigned int addr, unsigned int size,
42 struct i2c_eeprom_emu_watcher *);
43
44extern void i2c_eeprom_emu_delwatcher(struct i2c_eeprom_emu *, void *data, struct i2c_eeprom_emu_watcher *watcher);
45
46extern struct i2c_eeprom_emu *i2c_pxa_get_eeprom(void);
47
48#endif /* _LINUX_I2C_ALGO_PXA_H */
diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h
deleted file mode 100644
index 21b625204956..000000000000
--- a/include/linux/i2c-sensor.h
+++ /dev/null
@@ -1,263 +0,0 @@
1/*
2 i2c-sensor.h - Part of the i2c package
3 was originally sensors.h - Part of lm_sensors, Linux kernel modules
4 for hardware monitoring
5 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22#ifndef _LINUX_I2C_SENSOR_H
23#define _LINUX_I2C_SENSOR_H
24
25/* A structure containing detect information.
26 Force variables overrule all other variables; they force a detection on
27 that place. If a specific chip is given, the module blindly assumes this
28 chip type is present; if a general force (kind == 0) is given, the module
29 will still try to figure out what type of chip is present. This is useful
30 if for some reasons the detect for SMBus or ISA address space filled
31 fails.
32 probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values.
33 A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for
34 the ISA bus, -1 for any I2C bus), the second is the address.
35 kind: The kind of chip. 0 equals any chip.
36*/
37struct i2c_force_data {
38 unsigned short *force;
39 unsigned short kind;
40};
41
42/* A structure containing the detect information.
43 normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_ISA_END.
44 A list of I2C addresses which should normally be examined.
45 normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END.
46 A list of ISA addresses which should normally be examined.
47 probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values.
48 A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for
49 the ISA bus, -1 for any I2C bus), the second is the address. These
50 addresses are also probed, as if they were in the 'normal' list.
51 ignore: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values.
52 A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for
53 the ISA bus, -1 for any I2C bus), the second is the I2C address. These
54 addresses are never probed. This parameter overrules 'normal' and
55 'probe', but not the 'force' lists.
56 force_data: insmod parameters. A list, ending with an element of which
57 the force field is NULL.
58*/
59struct i2c_address_data {
60 unsigned short *normal_i2c;
61 unsigned int *normal_isa;
62 unsigned short *probe;
63 unsigned short *ignore;
64 struct i2c_force_data *forces;
65};
66
67#define SENSORS_MODULE_PARM_FORCE(name) \
68 I2C_CLIENT_MODULE_PARM(force_ ## name, \
69 "List of adapter,address pairs which are unquestionably" \
70 " assumed to contain a `" # name "' chip")
71
72
73/* This defines several insmod variables, and the addr_data structure */
74#define SENSORS_INSMOD \
75 I2C_CLIENT_MODULE_PARM(probe, \
76 "List of adapter,address pairs to scan additionally"); \
77 I2C_CLIENT_MODULE_PARM(ignore, \
78 "List of adapter,address pairs not to scan"); \
79 static struct i2c_address_data addr_data = { \
80 .normal_i2c = normal_i2c, \
81 .normal_isa = normal_isa, \
82 .probe = probe, \
83 .ignore = ignore, \
84 .forces = forces, \
85 }
86
87/* The following functions create an enum with the chip names as elements.
88 The first element of the enum is any_chip. These are the only macros
89 a module will want to use. */
90
91#define SENSORS_INSMOD_0 \
92 enum chips { any_chip }; \
93 I2C_CLIENT_MODULE_PARM(force, \
94 "List of adapter,address pairs to boldly assume " \
95 "to be present"); \
96 static struct i2c_force_data forces[] = {{force,any_chip},{NULL}}; \
97 SENSORS_INSMOD
98
99#define SENSORS_INSMOD_1(chip1) \
100 enum chips { any_chip, chip1 }; \
101 I2C_CLIENT_MODULE_PARM(force, \
102 "List of adapter,address pairs to boldly assume " \
103 "to be present"); \
104 SENSORS_MODULE_PARM_FORCE(chip1); \
105 static struct i2c_force_data forces[] = {{force,any_chip},\
106 {force_ ## chip1,chip1}, \
107 {NULL}}; \
108 SENSORS_INSMOD
109
110#define SENSORS_INSMOD_2(chip1,chip2) \
111 enum chips { any_chip, chip1, chip2 }; \
112 I2C_CLIENT_MODULE_PARM(force, \
113 "List of adapter,address pairs to boldly assume " \
114 "to be present"); \
115 SENSORS_MODULE_PARM_FORCE(chip1); \
116 SENSORS_MODULE_PARM_FORCE(chip2); \
117 static struct i2c_force_data forces[] = {{force,any_chip}, \
118 {force_ ## chip1,chip1}, \
119 {force_ ## chip2,chip2}, \
120 {NULL}}; \
121 SENSORS_INSMOD
122
123#define SENSORS_INSMOD_3(chip1,chip2,chip3) \
124 enum chips { any_chip, chip1, chip2, chip3 }; \
125 I2C_CLIENT_MODULE_PARM(force, \
126 "List of adapter,address pairs to boldly assume " \
127 "to be present"); \
128 SENSORS_MODULE_PARM_FORCE(chip1); \
129 SENSORS_MODULE_PARM_FORCE(chip2); \
130 SENSORS_MODULE_PARM_FORCE(chip3); \
131 static struct i2c_force_data forces[] = {{force,any_chip}, \
132 {force_ ## chip1,chip1}, \
133 {force_ ## chip2,chip2}, \
134 {force_ ## chip3,chip3}, \
135 {NULL}}; \
136 SENSORS_INSMOD
137
138#define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \
139 enum chips { any_chip, chip1, chip2, chip3, chip4 }; \
140 I2C_CLIENT_MODULE_PARM(force, \
141 "List of adapter,address pairs to boldly assume " \
142 "to be present"); \
143 SENSORS_MODULE_PARM_FORCE(chip1); \
144 SENSORS_MODULE_PARM_FORCE(chip2); \
145 SENSORS_MODULE_PARM_FORCE(chip3); \
146 SENSORS_MODULE_PARM_FORCE(chip4); \
147 static struct i2c_force_data forces[] = {{force,any_chip}, \
148 {force_ ## chip1,chip1}, \
149 {force_ ## chip2,chip2}, \
150 {force_ ## chip3,chip3}, \
151 {force_ ## chip4,chip4}, \
152 {NULL}}; \
153 SENSORS_INSMOD
154
155#define SENSORS_INSMOD_5(chip1,chip2,chip3,chip4,chip5) \
156 enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \
157 I2C_CLIENT_MODULE_PARM(force, \
158 "List of adapter,address pairs to boldly assume " \
159 "to be present"); \
160 SENSORS_MODULE_PARM_FORCE(chip1); \
161 SENSORS_MODULE_PARM_FORCE(chip2); \
162 SENSORS_MODULE_PARM_FORCE(chip3); \
163 SENSORS_MODULE_PARM_FORCE(chip4); \
164 SENSORS_MODULE_PARM_FORCE(chip5); \
165 static struct i2c_force_data forces[] = {{force,any_chip}, \
166 {force_ ## chip1,chip1}, \
167 {force_ ## chip2,chip2}, \
168 {force_ ## chip3,chip3}, \
169 {force_ ## chip4,chip4}, \
170 {force_ ## chip5,chip5}, \
171 {NULL}}; \
172 SENSORS_INSMOD
173
174#define SENSORS_INSMOD_6(chip1,chip2,chip3,chip4,chip5,chip6) \
175 enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \
176 I2C_CLIENT_MODULE_PARM(force, \
177 "List of adapter,address pairs to boldly assume " \
178 "to be present"); \
179 SENSORS_MODULE_PARM_FORCE(chip1); \
180 SENSORS_MODULE_PARM_FORCE(chip2); \
181 SENSORS_MODULE_PARM_FORCE(chip3); \
182 SENSORS_MODULE_PARM_FORCE(chip4); \
183 SENSORS_MODULE_PARM_FORCE(chip5); \
184 SENSORS_MODULE_PARM_FORCE(chip6); \
185 static struct i2c_force_data forces[] = {{force,any_chip}, \
186 {force_ ## chip1,chip1}, \
187 {force_ ## chip2,chip2}, \
188 {force_ ## chip3,chip3}, \
189 {force_ ## chip4,chip4}, \
190 {force_ ## chip5,chip5}, \
191 {force_ ## chip6,chip6}, \
192 {NULL}}; \
193 SENSORS_INSMOD
194
195#define SENSORS_INSMOD_7(chip1,chip2,chip3,chip4,chip5,chip6,chip7) \
196 enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7 }; \
197 I2C_CLIENT_MODULE_PARM(force, \
198 "List of adapter,address pairs to boldly assume " \
199 "to be present"); \
200 SENSORS_MODULE_PARM_FORCE(chip1); \
201 SENSORS_MODULE_PARM_FORCE(chip2); \
202 SENSORS_MODULE_PARM_FORCE(chip3); \
203 SENSORS_MODULE_PARM_FORCE(chip4); \
204 SENSORS_MODULE_PARM_FORCE(chip5); \
205 SENSORS_MODULE_PARM_FORCE(chip6); \
206 SENSORS_MODULE_PARM_FORCE(chip7); \
207 static struct i2c_force_data forces[] = {{force,any_chip}, \
208 {force_ ## chip1,chip1}, \
209 {force_ ## chip2,chip2}, \
210 {force_ ## chip3,chip3}, \
211 {force_ ## chip4,chip4}, \
212 {force_ ## chip5,chip5}, \
213 {force_ ## chip6,chip6}, \
214 {force_ ## chip7,chip7}, \
215 {NULL}}; \
216 SENSORS_INSMOD
217
218#define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \
219 enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8 }; \
220 I2C_CLIENT_MODULE_PARM(force, \
221 "List of adapter,address pairs to boldly assume " \
222 "to be present"); \
223 SENSORS_MODULE_PARM_FORCE(chip1); \
224 SENSORS_MODULE_PARM_FORCE(chip2); \
225 SENSORS_MODULE_PARM_FORCE(chip3); \
226 SENSORS_MODULE_PARM_FORCE(chip4); \
227 SENSORS_MODULE_PARM_FORCE(chip5); \
228 SENSORS_MODULE_PARM_FORCE(chip6); \
229 SENSORS_MODULE_PARM_FORCE(chip7); \
230 SENSORS_MODULE_PARM_FORCE(chip8); \
231 static struct i2c_force_data forces[] = {{force,any_chip}, \
232 {force_ ## chip1,chip1}, \
233 {force_ ## chip2,chip2}, \
234 {force_ ## chip3,chip3}, \
235 {force_ ## chip4,chip4}, \
236 {force_ ## chip5,chip5}, \
237 {force_ ## chip6,chip6}, \
238 {force_ ## chip7,chip7}, \
239 {force_ ## chip8,chip8}, \
240 {NULL}}; \
241 SENSORS_INSMOD
242
243/* Detect function. It iterates over all possible addresses itself. For
244 SMBus addresses, it will only call found_proc if some client is connected
245 to the SMBus (unless a 'force' matched); for ISA detections, this is not
246 done. */
247extern int i2c_detect(struct i2c_adapter *adapter,
248 struct i2c_address_data *address_data,
249 int (*found_proc) (struct i2c_adapter *, int, int));
250
251
252/* This macro is used to scale user-input to sensible values in almost all
253 chip drivers. */
254static inline int SENSORS_LIMIT(long value, long low, long high)
255{
256 if (value < low)
257 return low;
258 else if (value > high)
259 return high;
260 else
261 return value;
262}
263#endif /* def _LINUX_I2C_SENSOR_H */
diff --git a/include/linux/i2c-vid.h b/include/linux/i2c-vid.h
deleted file mode 100644
index 41d0635e0ba9..000000000000
--- a/include/linux/i2c-vid.h
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 i2c-vid.h - Part of lm_sensors, Linux kernel modules for hardware
3 monitoring
4 Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
5 With assistance from Trent Piepho <xyzzy@speakeasy.org>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/
21
22/*
23 This file contains common code for decoding VID pins.
24 This file is #included in various chip drivers in this directory.
25 As the user is unlikely to load more than one driver which
26 includes this code we don't worry about the wasted space.
27 Reference: VRM x.y DC-DC Converter Design Guidelines,
28 available at http://developer.intel.com
29*/
30
31/*
32 AMD Opteron processors don't follow the Intel VRM spec.
33 I'm going to "make up" 2.4 as the VRM spec for the Opterons.
34 No good reason just a mnemonic for the 24x Opteron processor
35 series
36
37 Opteron VID encoding is:
38
39 00000 = 1.550 V
40 00001 = 1.525 V
41 . . . .
42 11110 = 0.800 V
43 11111 = 0.000 V (off)
44 */
45
46/*
47 Legal val values 0x00 - 0x1f; except for VRD 10.0, 0x00 - 0x3f.
48 vrm is the Intel VRM document version.
49 Note: vrm version is scaled by 10 and the return value is scaled by 1000
50 to avoid floating point in the kernel.
51*/
52
53int i2c_which_vrm(void);
54
55#define DEFAULT_VRM 82
56
57static inline int vid_from_reg(int val, int vrm)
58{
59 int vid;
60
61 switch(vrm) {
62
63 case 0:
64 return 0;
65
66 case 100: /* VRD 10.0 */
67 if((val & 0x1f) == 0x1f)
68 return 0;
69 if((val & 0x1f) <= 0x09 || val == 0x0a)
70 vid = 10875 - (val & 0x1f) * 250;
71 else
72 vid = 18625 - (val & 0x1f) * 250;
73 if(val & 0x20)
74 vid -= 125;
75 vid /= 10; /* only return 3 dec. places for now */
76 return vid;
77
78 case 24: /* Opteron processor */
79 return(val == 0x1f ? 0 : 1550 - val * 25);
80
81 case 91: /* VRM 9.1 */
82 case 90: /* VRM 9.0 */
83 return(val == 0x1f ? 0 :
84 1850 - val * 25);
85
86 case 85: /* VRM 8.5 */
87 return((val & 0x10 ? 25 : 0) +
88 ((val & 0x0f) > 0x04 ? 2050 : 1250) -
89 ((val & 0x0f) * 50));
90
91 case 84: /* VRM 8.4 */
92 val &= 0x0f;
93 /* fall through */
94 default: /* VRM 8.2 */
95 return(val == 0x1f ? 0 :
96 val & 0x10 ? 5100 - (val) * 100 :
97 2050 - (val) * 50);
98 }
99}
100
101static inline int vid_to_reg(int val, int vrm)
102{
103 switch (vrm) {
104 case 91: /* VRM 9.1 */
105 case 90: /* VRM 9.0 */
106 return ((val >= 1100) && (val <= 1850) ?
107 ((18499 - val * 10) / 25 + 5) / 10 : -1);
108 default:
109 return -1;
110 }
111}
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index be837b13f297..be35332b67e6 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -34,6 +34,13 @@
34#include <linux/device.h> /* for struct device */ 34#include <linux/device.h> /* for struct device */
35#include <asm/semaphore.h> 35#include <asm/semaphore.h>
36 36
37/* --- For i2c-isa ---------------------------------------------------- */
38
39extern void i2c_adapter_dev_release(struct device *dev);
40extern struct device_driver i2c_adapter_driver;
41extern struct class i2c_adapter_class;
42extern struct bus_type i2c_bus_type;
43
37/* --- General options ------------------------------------------------ */ 44/* --- General options ------------------------------------------------ */
38 45
39struct i2c_msg; 46struct i2c_msg;
@@ -41,7 +48,6 @@ struct i2c_algorithm;
41struct i2c_adapter; 48struct i2c_adapter;
42struct i2c_client; 49struct i2c_client;
43struct i2c_driver; 50struct i2c_driver;
44struct i2c_client_address_data;
45union i2c_smbus_data; 51union i2c_smbus_data;
46 52
47/* 53/*
@@ -143,12 +149,9 @@ struct i2c_driver {
143 */ 149 */
144struct i2c_client { 150struct i2c_client {
145 unsigned int flags; /* div., see below */ 151 unsigned int flags; /* div., see below */
146 unsigned int addr; /* chip address - NOTE: 7bit */ 152 unsigned short addr; /* chip address - NOTE: 7bit */
147 /* addresses are stored in the */ 153 /* addresses are stored in the */
148 /* _LOWER_ 7 bits of this char */ 154 /* _LOWER_ 7 bits */
149 /* addr: unsigned int to make lm_sensors i2c-isa adapter work
150 more cleanly. It does not take any more memory space, due to
151 alignment considerations */
152 struct i2c_adapter *adapter; /* the adapter we sit on */ 155 struct i2c_adapter *adapter; /* the adapter we sit on */
153 struct i2c_driver *driver; /* and our access routines */ 156 struct i2c_driver *driver; /* and our access routines */
154 int usage_count; /* How many accesses currently */ 157 int usage_count; /* How many accesses currently */
@@ -160,6 +163,11 @@ struct i2c_client {
160}; 163};
161#define to_i2c_client(d) container_of(d, struct i2c_client, dev) 164#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
162 165
166static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
167{
168 return to_i2c_client(container_of(kobj, struct device, kobj));
169}
170
163static inline void *i2c_get_clientdata (struct i2c_client *dev) 171static inline void *i2c_get_clientdata (struct i2c_client *dev)
164{ 172{
165 return dev_get_drvdata (&dev->dev); 173 return dev_get_drvdata (&dev->dev);
@@ -170,13 +178,6 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
170 dev_set_drvdata (&dev->dev, data); 178 dev_set_drvdata (&dev->dev, data);
171} 179}
172 180
173#define I2C_DEVNAME(str) .name = str
174
175static inline char *i2c_clientname(struct i2c_client *c)
176{
177 return &c->name[0];
178}
179
180/* 181/*
181 * The following structs are for those who like to implement new bus drivers: 182 * The following structs are for those who like to implement new bus drivers:
182 * i2c_algorithm is the interface to a class of hardware solutions which can 183 * i2c_algorithm is the interface to a class of hardware solutions which can
@@ -184,9 +185,6 @@ static inline char *i2c_clientname(struct i2c_client *c)
184 * to name two of the most common. 185 * to name two of the most common.
185 */ 186 */
186struct i2c_algorithm { 187struct i2c_algorithm {
187 char name[32]; /* textual description */
188 unsigned int id;
189
190 /* If an adapter algorithm can't do I2C-level access, set master_xfer 188 /* If an adapter algorithm can't do I2C-level access, set master_xfer
191 to NULL. If an adapter algorithm can do SMBus access, set 189 to NULL. If an adapter algorithm can do SMBus access, set
192 smbus_xfer. If set to NULL, the SMBus protocol is simulated 190 smbus_xfer. If set to NULL, the SMBus protocol is simulated
@@ -214,8 +212,7 @@ struct i2c_algorithm {
214 */ 212 */
215struct i2c_adapter { 213struct i2c_adapter {
216 struct module *owner; 214 struct module *owner;
217 unsigned int id;/* == is algo->id | hwdep.struct->id, */ 215 unsigned int id;
218 /* for registered values see below */
219 unsigned int class; 216 unsigned int class;
220 struct i2c_algorithm *algo;/* the algorithm to access the bus */ 217 struct i2c_algorithm *algo;/* the algorithm to access the bus */
221 void *algo_data; 218 void *algo_data;
@@ -292,12 +289,11 @@ struct i2c_client_address_data {
292 unsigned short *normal_i2c; 289 unsigned short *normal_i2c;
293 unsigned short *probe; 290 unsigned short *probe;
294 unsigned short *ignore; 291 unsigned short *ignore;
295 unsigned short *force; 292 unsigned short **forces;
296}; 293};
297 294
298/* Internal numbers to terminate lists */ 295/* Internal numbers to terminate lists */
299#define I2C_CLIENT_END 0xfffeU 296#define I2C_CLIENT_END 0xfffeU
300#define I2C_CLIENT_ISA_END 0xfffefffeU
301 297
302/* The numbers to use to set I2C bus address */ 298/* The numbers to use to set I2C bus address */
303#define ANY_I2C_BUS 0xffff 299#define ANY_I2C_BUS 0xffff
@@ -356,10 +352,6 @@ extern int i2c_probe(struct i2c_adapter *adapter,
356 */ 352 */
357extern int i2c_control(struct i2c_client *,unsigned int, unsigned long); 353extern int i2c_control(struct i2c_client *,unsigned int, unsigned long);
358 354
359/* This call returns a unique low identifier for each registered adapter,
360 * or -1 if the adapter was not registered.
361 */
362extern int i2c_adapter_id(struct i2c_adapter *adap);
363extern struct i2c_adapter* i2c_get_adapter(int id); 355extern struct i2c_adapter* i2c_get_adapter(int id);
364extern void i2c_put_adapter(struct i2c_adapter *adap); 356extern void i2c_put_adapter(struct i2c_adapter *adap);
365 357
@@ -376,6 +368,12 @@ static inline int i2c_check_functionality(struct i2c_adapter *adap, u32 func)
376 return (func & i2c_get_functionality(adap)) == func; 368 return (func & i2c_get_functionality(adap)) == func;
377} 369}
378 370
371/* Return id number for a specific adapter */
372static inline int i2c_adapter_id(struct i2c_adapter *adap)
373{
374 return adap->nr;
375}
376
379/* 377/*
380 * I2C Message - used for pure i2c transaction, also from /dev interface 378 * I2C Message - used for pure i2c transaction, also from /dev interface
381 */ 379 */
@@ -510,9 +508,6 @@ union i2c_smbus_data {
510#define I2C_FUNCS 0x0705 /* Get the adapter functionality */ 508#define I2C_FUNCS 0x0705 /* Get the adapter functionality */
511#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ 509#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/
512#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */ 510#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */
513#if 0
514#define I2C_ACK_TEST 0x0710 /* See if a slave is at a specific address */
515#endif
516 511
517#define I2C_SMBUS 0x0720 /* SMBus-level access */ 512#define I2C_SMBUS 0x0720 /* SMBus-level access */
518 513
@@ -556,27 +551,148 @@ union i2c_smbus_data {
556 module_param_array(var, short, &var##_num, 0); \ 551 module_param_array(var, short, &var##_num, 0); \
557 MODULE_PARM_DESC(var,desc) 552 MODULE_PARM_DESC(var,desc)
558 553
559/* This is the one you want to use in your own modules */ 554#define I2C_CLIENT_MODULE_PARM_FORCE(name) \
555I2C_CLIENT_MODULE_PARM(force_##name, \
556 "List of adapter,address pairs which are " \
557 "unquestionably assumed to contain a `" \
558 # name "' chip")
559
560
561#define I2C_CLIENT_INSMOD_COMMON \
562I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \
563 "additionally"); \
564I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \
565 "scan"); \
566static struct i2c_client_address_data addr_data = { \
567 .normal_i2c = normal_i2c, \
568 .probe = probe, \
569 .ignore = ignore, \
570 .forces = forces, \
571}
572
573/* These are the ones you want to use in your own drivers. Pick the one
574 which matches the number of devices the driver differenciates between. */
560#define I2C_CLIENT_INSMOD \ 575#define I2C_CLIENT_INSMOD \
561 I2C_CLIENT_MODULE_PARM(probe, \
562 "List of adapter,address pairs to scan additionally"); \
563 I2C_CLIENT_MODULE_PARM(ignore, \
564 "List of adapter,address pairs not to scan"); \
565 I2C_CLIENT_MODULE_PARM(force, \ 576 I2C_CLIENT_MODULE_PARM(force, \
566 "List of adapter,address pairs to boldly assume " \ 577 "List of adapter,address pairs to boldly assume " \
567 "to be present"); \ 578 "to be present"); \
568 static struct i2c_client_address_data addr_data = { \ 579 static unsigned short *forces[] = { \
569 .normal_i2c = normal_i2c, \ 580 force, \
570 .probe = probe, \ 581 NULL \
571 .ignore = ignore, \ 582 }; \
572 .force = force, \ 583I2C_CLIENT_INSMOD_COMMON
573 } 584
574 585#define I2C_CLIENT_INSMOD_1(chip1) \
575/* Detect whether we are on the isa bus. If this returns true, all i2c 586enum chips { any_chip, chip1 }; \
576 access will fail! */ 587I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
577#define i2c_is_isa_client(clientptr) \ 588 "boldly assume to be present"); \
578 ((clientptr)->adapter->algo->id == I2C_ALGO_ISA) 589I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
579#define i2c_is_isa_adapter(adapptr) \ 590static unsigned short *forces[] = { force, force_##chip1, NULL }; \
580 ((adapptr)->algo->id == I2C_ALGO_ISA) 591I2C_CLIENT_INSMOD_COMMON
592
593#define I2C_CLIENT_INSMOD_2(chip1, chip2) \
594enum chips { any_chip, chip1, chip2 }; \
595I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
596 "boldly assume to be present"); \
597I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
598I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
599static unsigned short *forces[] = { force, force_##chip1, \
600 force_##chip2, NULL }; \
601I2C_CLIENT_INSMOD_COMMON
602
603#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \
604enum chips { any_chip, chip1, chip2, chip3 }; \
605I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
606 "boldly assume to be present"); \
607I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
608I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
609I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
610static unsigned short *forces[] = { force, force_##chip1, \
611 force_##chip2, force_##chip3, \
612 NULL }; \
613I2C_CLIENT_INSMOD_COMMON
614
615#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \
616enum chips { any_chip, chip1, chip2, chip3, chip4 }; \
617I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
618 "boldly assume to be present"); \
619I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
620I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
621I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
622I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
623static unsigned short *forces[] = { force, force_##chip1, \
624 force_##chip2, force_##chip3, \
625 force_##chip4, NULL}; \
626I2C_CLIENT_INSMOD_COMMON
627
628#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \
629enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \
630I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
631 "boldly assume to be present"); \
632I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
633I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
634I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
635I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
636I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
637static unsigned short *forces[] = { force, force_##chip1, \
638 force_##chip2, force_##chip3, \
639 force_##chip4, force_##chip5, \
640 NULL }; \
641I2C_CLIENT_INSMOD_COMMON
642
643#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \
644enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \
645I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
646 "boldly assume to be present"); \
647I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
648I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
649I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
650I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
651I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
652I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
653static unsigned short *forces[] = { force, force_##chip1, \
654 force_##chip2, force_##chip3, \
655 force_##chip4, force_##chip5, \
656 force_##chip6, NULL }; \
657I2C_CLIENT_INSMOD_COMMON
658
659#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \
660enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
661 chip7 }; \
662I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
663 "boldly assume to be present"); \
664I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
665I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
666I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
667I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
668I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
669I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
670I2C_CLIENT_MODULE_PARM_FORCE(chip7); \
671static unsigned short *forces[] = { force, force_##chip1, \
672 force_##chip2, force_##chip3, \
673 force_##chip4, force_##chip5, \
674 force_##chip6, force_##chip7, \
675 NULL }; \
676I2C_CLIENT_INSMOD_COMMON
677
678#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \
679enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \
680 chip7, chip8 }; \
681I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \
682 "boldly assume to be present"); \
683I2C_CLIENT_MODULE_PARM_FORCE(chip1); \
684I2C_CLIENT_MODULE_PARM_FORCE(chip2); \
685I2C_CLIENT_MODULE_PARM_FORCE(chip3); \
686I2C_CLIENT_MODULE_PARM_FORCE(chip4); \
687I2C_CLIENT_MODULE_PARM_FORCE(chip5); \
688I2C_CLIENT_MODULE_PARM_FORCE(chip6); \
689I2C_CLIENT_MODULE_PARM_FORCE(chip7); \
690I2C_CLIENT_MODULE_PARM_FORCE(chip8); \
691static unsigned short *forces[] = { force, force_##chip1, \
692 force_##chip2, force_##chip3, \
693 force_##chip4, force_##chip5, \
694 force_##chip6, force_##chip7, \
695 force_##chip8, NULL }; \
696I2C_CLIENT_INSMOD_COMMON
581 697
582#endif /* _LINUX_I2C_H */ 698#endif /* _LINUX_I2C_H */
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 096a85a58ae5..88aef7b86ef4 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -77,6 +77,7 @@ struct tun_struct {
77#define TUNSETIFF _IOW('T', 202, int) 77#define TUNSETIFF _IOW('T', 202, int)
78#define TUNSETPERSIST _IOW('T', 203, int) 78#define TUNSETPERSIST _IOW('T', 203, int)
79#define TUNSETOWNER _IOW('T', 204, int) 79#define TUNSETOWNER _IOW('T', 204, int)
80#define TUNSETLINK _IOW('T', 205, int)
80 81
81/* TUNSETIFF ifr flags */ 82/* TUNSETIFF ifr flags */
82#define IFF_TUN 0x0001 83#define IFF_TUN 0x0001
diff --git a/include/linux/in6.h b/include/linux/in6.h
index dcf5720ffcbb..bd32b79d6295 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -148,13 +148,13 @@ struct in6_flowlabel_req
148 */ 148 */
149 149
150#define IPV6_ADDRFORM 1 150#define IPV6_ADDRFORM 1
151#define IPV6_PKTINFO 2 151#define IPV6_2292PKTINFO 2
152#define IPV6_HOPOPTS 3 152#define IPV6_2292HOPOPTS 3
153#define IPV6_DSTOPTS 4 153#define IPV6_2292DSTOPTS 4
154#define IPV6_RTHDR 5 154#define IPV6_2292RTHDR 5
155#define IPV6_PKTOPTIONS 6 155#define IPV6_2292PKTOPTIONS 6
156#define IPV6_CHECKSUM 7 156#define IPV6_CHECKSUM 7
157#define IPV6_HOPLIMIT 8 157#define IPV6_2292HOPLIMIT 8
158#define IPV6_NEXTHOP 9 158#define IPV6_NEXTHOP 9
159#define IPV6_AUTHHDR 10 /* obsolete */ 159#define IPV6_AUTHHDR 10 /* obsolete */
160#define IPV6_FLOWINFO 11 160#define IPV6_FLOWINFO 11
@@ -198,4 +198,28 @@ struct in6_flowlabel_req
198 * MCAST_MSFILTER 48 198 * MCAST_MSFILTER 48
199 */ 199 */
200 200
201/* RFC3542 advanced socket options (50-67) */
202#define IPV6_RECVPKTINFO 50
203#define IPV6_PKTINFO 51
204#if 0
205#define IPV6_RECVPATHMTU 52
206#define IPV6_PATHMTU 53
207#define IPV6_DONTFRAG 54
208#define IPV6_USE_MIN_MTU 55
209#endif
210#define IPV6_RECVHOPOPTS 56
211#define IPV6_HOPOPTS 57
212#if 0
213#define IPV6_RECVRTHDRDSTOPTS 58 /* Unused, see net/ipv6/datagram.c */
214#endif
215#define IPV6_RTHDRDSTOPTS 59
216#define IPV6_RECVRTHDR 60
217#define IPV6_RTHDR 61
218#define IPV6_RECVDSTOPTS 62
219#define IPV6_DSTOPTS 63
220#define IPV6_RECVHOPLIMIT 64
221#define IPV6_HOPLIMIT 65
222#define IPV6_RECVTCLASS 66
223#define IPV6_TCLASS 67
224
201#endif 225#endif
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index c727c195a91a..68ab5f2ab9cd 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -2,17 +2,27 @@
2#define _LINUX__INIT_TASK_H 2#define _LINUX__INIT_TASK_H
3 3
4#include <linux/file.h> 4#include <linux/file.h>
5#include <linux/rcupdate.h>
5 6
6#define INIT_FILES \ 7#define INIT_FDTABLE \
7{ \ 8{ \
8 .count = ATOMIC_INIT(1), \
9 .file_lock = SPIN_LOCK_UNLOCKED, \
10 .max_fds = NR_OPEN_DEFAULT, \ 9 .max_fds = NR_OPEN_DEFAULT, \
11 .max_fdset = __FD_SETSIZE, \ 10 .max_fdset = __FD_SETSIZE, \
12 .next_fd = 0, \ 11 .next_fd = 0, \
13 .fd = &init_files.fd_array[0], \ 12 .fd = &init_files.fd_array[0], \
14 .close_on_exec = &init_files.close_on_exec_init, \ 13 .close_on_exec = &init_files.close_on_exec_init, \
15 .open_fds = &init_files.open_fds_init, \ 14 .open_fds = &init_files.open_fds_init, \
15 .rcu = RCU_HEAD_INIT, \
16 .free_files = NULL, \
17 .next = NULL, \
18}
19
20#define INIT_FILES \
21{ \
22 .count = ATOMIC_INIT(1), \
23 .file_lock = SPIN_LOCK_UNLOCKED, \
24 .fdt = &init_files.fdtab, \
25 .fdtab = INIT_FDTABLE, \
16 .close_on_exec_init = { { 0, } }, \ 26 .close_on_exec_init = { { 0, } }, \
17 .open_fds_init = { { 0, } }, \ 27 .open_fds_init = { { 0, } }, \
18 .fd_array = { NULL, } \ 28 .fd_array = { NULL, } \
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
index 93bb3afe646b..ee5b239092ed 100644
--- a/include/linux/inotify.h
+++ b/include/linux/inotify.h
@@ -47,6 +47,7 @@ struct inotify_event {
47#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ 47#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
48 48
49/* special flags */ 49/* special flags */
50#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
50#define IN_ISDIR 0x40000000 /* event occurred against dir */ 51#define IN_ISDIR 0x40000000 /* event occurred against dir */
51#define IN_ONESHOT 0x80000000 /* only send event once */ 52#define IN_ONESHOT 0x80000000 /* only send event once */
52 53
diff --git a/include/linux/input.h b/include/linux/input.h
index 227a497c0678..e8c296ff6257 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -66,6 +66,7 @@ struct input_absinfo {
66#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ 66#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */
67#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ 67#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */
68#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ 68#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
69#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
69 70
70#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ 71#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */
71#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ 72#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */
@@ -86,6 +87,7 @@ struct input_absinfo {
86#define EV_REL 0x02 87#define EV_REL 0x02
87#define EV_ABS 0x03 88#define EV_ABS 0x03
88#define EV_MSC 0x04 89#define EV_MSC 0x04
90#define EV_SW 0x05
89#define EV_LED 0x11 91#define EV_LED 0x11
90#define EV_SND 0x12 92#define EV_SND 0x12
91#define EV_REP 0x14 93#define EV_REP 0x14
@@ -559,6 +561,20 @@ struct input_absinfo {
559#define ABS_MAX 0x3f 561#define ABS_MAX 0x3f
560 562
561/* 563/*
564 * Switch events
565 */
566
567#define SW_0 0x00
568#define SW_1 0x01
569#define SW_2 0x02
570#define SW_3 0x03
571#define SW_4 0x04
572#define SW_5 0x05
573#define SW_6 0x06
574#define SW_7 0x07
575#define SW_MAX 0x0f
576
577/*
562 * Misc events 578 * Misc events
563 */ 579 */
564 580
@@ -832,6 +848,7 @@ struct input_dev {
832 unsigned long ledbit[NBITS(LED_MAX)]; 848 unsigned long ledbit[NBITS(LED_MAX)];
833 unsigned long sndbit[NBITS(SND_MAX)]; 849 unsigned long sndbit[NBITS(SND_MAX)];
834 unsigned long ffbit[NBITS(FF_MAX)]; 850 unsigned long ffbit[NBITS(FF_MAX)];
851 unsigned long swbit[NBITS(SW_MAX)];
835 int ff_effects_max; 852 int ff_effects_max;
836 853
837 unsigned int keycodemax; 854 unsigned int keycodemax;
@@ -852,6 +869,7 @@ struct input_dev {
852 unsigned long key[NBITS(KEY_MAX)]; 869 unsigned long key[NBITS(KEY_MAX)];
853 unsigned long led[NBITS(LED_MAX)]; 870 unsigned long led[NBITS(LED_MAX)];
854 unsigned long snd[NBITS(SND_MAX)]; 871 unsigned long snd[NBITS(SND_MAX)];
872 unsigned long sw[NBITS(SW_MAX)];
855 873
856 int absmax[ABS_MAX + 1]; 874 int absmax[ABS_MAX + 1];
857 int absmin[ABS_MAX + 1]; 875 int absmin[ABS_MAX + 1];
@@ -894,6 +912,7 @@ struct input_dev {
894#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 912#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
895#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 913#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
896#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 914#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
915#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
897 916
898#define INPUT_DEVICE_ID_MATCH_DEVICE\ 917#define INPUT_DEVICE_ID_MATCH_DEVICE\
899 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) 918 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
@@ -914,6 +933,7 @@ struct input_device_id {
914 unsigned long ledbit[NBITS(LED_MAX)]; 933 unsigned long ledbit[NBITS(LED_MAX)];
915 unsigned long sndbit[NBITS(SND_MAX)]; 934 unsigned long sndbit[NBITS(SND_MAX)];
916 unsigned long ffbit[NBITS(FF_MAX)]; 935 unsigned long ffbit[NBITS(FF_MAX)];
936 unsigned long swbit[NBITS(SW_MAX)];
917 937
918 unsigned long driver_info; 938 unsigned long driver_info;
919}; 939};
@@ -1006,6 +1026,11 @@ static inline void input_report_ff_status(struct input_dev *dev, unsigned int co
1006 input_event(dev, EV_FF_STATUS, code, value); 1026 input_event(dev, EV_FF_STATUS, code, value);
1007} 1027}
1008 1028
1029static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value)
1030{
1031 input_event(dev, EV_SW, code, !!value);
1032}
1033
1009static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) 1034static inline void input_regs(struct input_dev *dev, struct pt_regs *regs)
1010{ 1035{
1011 dev->regs = regs; 1036 dev->regs = regs;
diff --git a/include/linux/ioctl32.h b/include/linux/ioctl32.h
index e8c4af32b3bb..948809d99917 100644
--- a/include/linux/ioctl32.h
+++ b/include/linux/ioctl32.h
@@ -14,26 +14,4 @@ struct ioctl_trans {
14 struct ioctl_trans *next; 14 struct ioctl_trans *next;
15}; 15};
16 16
17/*
18 * Register an 32bit ioctl translation handler for ioctl cmd.
19 *
20 * handler == NULL: use 64bit ioctl handler.
21 * arguments to handler: fd: file descriptor
22 * cmd: ioctl command.
23 * arg: ioctl argument
24 * struct file *file: file descriptor pointer.
25 */
26
27#ifdef CONFIG_COMPAT
28extern int __deprecated register_ioctl32_conversion(unsigned int cmd,
29 ioctl_trans_handler_t handler);
30extern int __deprecated unregister_ioctl32_conversion(unsigned int cmd);
31
32#else
33
34#define register_ioctl32_conversion(cmd, handler) ({ 0; })
35#define unregister_ioctl32_conversion(cmd) ({ 0; })
36
37#endif
38
39#endif 17#endif
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 596ca6130159..938d55b813a5 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -35,6 +35,7 @@
35#define __LINUX_IPMI_H 35#define __LINUX_IPMI_H
36 36
37#include <linux/ipmi_msgdefs.h> 37#include <linux/ipmi_msgdefs.h>
38#include <linux/compiler.h>
38 39
39/* 40/*
40 * This file describes an interface to an IPMI driver. You have to 41 * This file describes an interface to an IPMI driver. You have to
@@ -241,7 +242,8 @@ struct ipmi_recv_msg
241 /* The user_msg_data is the data supplied when a message was 242 /* The user_msg_data is the data supplied when a message was
242 sent, if this is a response to a sent message. If this is 243 sent, if this is a response to a sent message. If this is
243 not a response to a sent message, then user_msg_data will 244 not a response to a sent message, then user_msg_data will
244 be NULL. */ 245 be NULL. If the user above is NULL, then this will be the
246 intf. */
245 void *user_msg_data; 247 void *user_msg_data;
246 248
247 /* Call this when done with the message. It will presumably free 249 /* Call this when done with the message. It will presumably free
@@ -298,13 +300,19 @@ void ipmi_get_version(ipmi_user_t user,
298 this user, so it will affect all users of this interface. This is 300 this user, so it will affect all users of this interface. This is
299 so some initialization code can come in and do the OEM-specific 301 so some initialization code can come in and do the OEM-specific
300 things it takes to determine your address (if not the BMC) and set 302 things it takes to determine your address (if not the BMC) and set
301 it for everyone else. */ 303 it for everyone else. Note that each channel can have its own address. */
302void ipmi_set_my_address(ipmi_user_t user, 304int ipmi_set_my_address(ipmi_user_t user,
303 unsigned char address); 305 unsigned int channel,
304unsigned char ipmi_get_my_address(ipmi_user_t user); 306 unsigned char address);
305void ipmi_set_my_LUN(ipmi_user_t user, 307int ipmi_get_my_address(ipmi_user_t user,
306 unsigned char LUN); 308 unsigned int channel,
307unsigned char ipmi_get_my_LUN(ipmi_user_t user); 309 unsigned char *address);
310int ipmi_set_my_LUN(ipmi_user_t user,
311 unsigned int channel,
312 unsigned char LUN);
313int ipmi_get_my_LUN(ipmi_user_t user,
314 unsigned int channel,
315 unsigned char *LUN);
308 316
309/* 317/*
310 * Like ipmi_request, but lets you specify the number of retries and 318 * Like ipmi_request, but lets you specify the number of retries and
@@ -585,6 +593,16 @@ struct ipmi_cmdspec
585 * things it takes to determine your address (if not the BMC) and set 593 * things it takes to determine your address (if not the BMC) and set
586 * it for everyone else. You should probably leave the LUN alone. 594 * it for everyone else. You should probably leave the LUN alone.
587 */ 595 */
596struct ipmi_channel_lun_address_set
597{
598 unsigned short channel;
599 unsigned char value;
600};
601#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set)
602#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set)
603#define IPMICTL_SET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set)
604#define IPMICTL_GET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set)
605/* Legacy interfaces, these only set IPMB 0. */
588#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int) 606#define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int)
589#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int) 607#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
590#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int) 608#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 3c7dbc6a0a70..6c5f7b39a4b0 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -189,6 +189,7 @@ struct inet6_skb_parm {
189 __u16 dst0; 189 __u16 dst0;
190 __u16 srcrt; 190 __u16 srcrt;
191 __u16 dst1; 191 __u16 dst1;
192 __u16 lastopt;
192}; 193};
193 194
194#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) 195#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
@@ -234,14 +235,20 @@ struct ipv6_pinfo {
234 /* pktoption flags */ 235 /* pktoption flags */
235 union { 236 union {
236 struct { 237 struct {
237 __u8 srcrt:2, 238 __u16 srcrt:2,
239 osrcrt:2,
238 rxinfo:1, 240 rxinfo:1,
241 rxoinfo:1,
239 rxhlim:1, 242 rxhlim:1,
243 rxohlim:1,
240 hopopts:1, 244 hopopts:1,
245 ohopopts:1,
241 dstopts:1, 246 dstopts:1,
242 rxflow:1; 247 odstopts:1,
248 rxflow:1,
249 rxtclass:1;
243 } bits; 250 } bits;
244 __u8 all; 251 __u16 all;
245 } rxopt; 252 } rxopt;
246 253
247 /* sockopt flags */ 254 /* sockopt flags */
@@ -250,6 +257,7 @@ struct ipv6_pinfo {
250 sndflow:1, 257 sndflow:1,
251 pmtudisc:2, 258 pmtudisc:2,
252 ipv6only:1; 259 ipv6only:1;
260 __u8 tclass;
253 261
254 __u32 dst_cookie; 262 __u32 dst_cookie;
255 263
@@ -263,6 +271,7 @@ struct ipv6_pinfo {
263 struct ipv6_txoptions *opt; 271 struct ipv6_txoptions *opt;
264 struct rt6_info *rt; 272 struct rt6_info *rt;
265 int hop_limit; 273 int hop_limit;
274 int tclass;
266 } cork; 275 } cork;
267}; 276};
268 277
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 069d3b84d311..69681c3b1f05 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -32,7 +32,12 @@
32#define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ 32#define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */
33#define IRQ_LEVEL 64 /* IRQ level triggered */ 33#define IRQ_LEVEL 64 /* IRQ level triggered */
34#define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ 34#define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */
35#define IRQ_PER_CPU 256 /* IRQ is per CPU */ 35#if defined(ARCH_HAS_IRQ_PER_CPU)
36# define IRQ_PER_CPU 256 /* IRQ is per CPU */
37# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
38#else
39# define CHECK_IRQ_PER_CPU(var) 0
40#endif
36 41
37/* 42/*
38 * Interrupt controller descriptor. This is all we need 43 * Interrupt controller descriptor. This is all we need
@@ -71,16 +76,139 @@ typedef struct irq_desc {
71 unsigned int irq_count; /* For detecting broken interrupts */ 76 unsigned int irq_count; /* For detecting broken interrupts */
72 unsigned int irqs_unhandled; 77 unsigned int irqs_unhandled;
73 spinlock_t lock; 78 spinlock_t lock;
79#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE)
80 unsigned int move_irq; /* Flag need to re-target intr dest*/
81#endif
74} ____cacheline_aligned irq_desc_t; 82} ____cacheline_aligned irq_desc_t;
75 83
76extern irq_desc_t irq_desc [NR_IRQS]; 84extern irq_desc_t irq_desc [NR_IRQS];
77 85
86/* Return a pointer to the irq descriptor for IRQ. */
87static inline irq_desc_t *
88irq_descp (int irq)
89{
90 return irq_desc + irq;
91}
92
78#include <asm/hw_irq.h> /* the arch dependent stuff */ 93#include <asm/hw_irq.h> /* the arch dependent stuff */
79 94
80extern int setup_irq(unsigned int irq, struct irqaction * new); 95extern int setup_irq(unsigned int irq, struct irqaction * new);
81 96
82#ifdef CONFIG_GENERIC_HARDIRQS 97#ifdef CONFIG_GENERIC_HARDIRQS
83extern cpumask_t irq_affinity[NR_IRQS]; 98extern cpumask_t irq_affinity[NR_IRQS];
99
100#ifdef CONFIG_SMP
101static inline void set_native_irq_info(int irq, cpumask_t mask)
102{
103 irq_affinity[irq] = mask;
104}
105#else
106static inline void set_native_irq_info(int irq, cpumask_t mask)
107{
108}
109#endif
110
111#ifdef CONFIG_SMP
112
113#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE)
114extern cpumask_t pending_irq_cpumask[NR_IRQS];
115
116static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
117{
118 irq_desc_t *desc = irq_desc + irq;
119 unsigned long flags;
120
121 spin_lock_irqsave(&desc->lock, flags);
122 desc->move_irq = 1;
123 pending_irq_cpumask[irq] = mask;
124 spin_unlock_irqrestore(&desc->lock, flags);
125}
126
127static inline void
128move_native_irq(int irq)
129{
130 cpumask_t tmp;
131 irq_desc_t *desc = irq_descp(irq);
132
133 if (likely (!desc->move_irq))
134 return;
135
136 desc->move_irq = 0;
137
138 if (likely(cpus_empty(pending_irq_cpumask[irq])))
139 return;
140
141 if (!desc->handler->set_affinity)
142 return;
143
144 /* note - we hold the desc->lock */
145 cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
146
147 /*
148 * If there was a valid mask to work with, please
149 * do the disable, re-program, enable sequence.
150 * This is *not* particularly important for level triggered
151 * but in a edge trigger case, we might be setting rte
152 * when an active trigger is comming in. This could
153 * cause some ioapics to mal-function.
154 * Being paranoid i guess!
155 */
156 if (unlikely(!cpus_empty(tmp))) {
157 desc->handler->disable(irq);
158 desc->handler->set_affinity(irq,tmp);
159 desc->handler->enable(irq);
160 }
161 cpus_clear(pending_irq_cpumask[irq]);
162}
163
164#ifdef CONFIG_PCI_MSI
165/*
166 * Wonder why these are dummies?
167 * For e.g the set_ioapic_affinity_vector() calls the set_ioapic_affinity_irq()
168 * counter part after translating the vector to irq info. We need to perform
169 * this operation on the real irq, when we dont use vector, i.e when
170 * pci_use_vector() is false.
171 */
172static inline void move_irq(int irq)
173{
174}
175
176static inline void set_irq_info(int irq, cpumask_t mask)
177{
178}
179
180#else // CONFIG_PCI_MSI
181
182static inline void move_irq(int irq)
183{
184 move_native_irq(irq);
185}
186
187static inline void set_irq_info(int irq, cpumask_t mask)
188{
189 set_native_irq_info(irq, mask);
190}
191#endif // CONFIG_PCI_MSI
192
193#else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE
194
195#define move_irq(x)
196#define move_native_irq(x)
197#define set_pending_irq(x,y)
198static inline void set_irq_info(int irq, cpumask_t mask)
199{
200 set_native_irq_info(irq, mask);
201}
202
203#endif // CONFIG_GENERIC_PENDING_IRQ
204
205#else // CONFIG_SMP
206
207#define move_irq(x)
208#define move_native_irq(x)
209
210#endif // CONFIG_SMP
211
84extern int no_irq_affinity; 212extern int no_irq_affinity;
85extern int noirqdebug_setup(char *str); 213extern int noirqdebug_setup(char *str);
86 214
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 862083eb58ab..53eaee96065b 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -150,7 +150,6 @@ typedef struct {
150#include <linux/errno.h> 150#include <linux/errno.h>
151#include <linux/fs.h> 151#include <linux/fs.h>
152#include <linux/major.h> 152#include <linux/major.h>
153#include <asm/segment.h>
154#include <asm/io.h> 153#include <asm/io.h>
155#include <linux/kernel.h> 154#include <linux/kernel.h>
156#include <linux/signal.h> 155#include <linux/signal.h>
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 593407e865b1..84321a4cac93 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -914,7 +914,6 @@ extern int journal_wipe (journal_t *, int);
914extern int journal_skip_recovery (journal_t *); 914extern int journal_skip_recovery (journal_t *);
915extern void journal_update_superblock (journal_t *, int); 915extern void journal_update_superblock (journal_t *, int);
916extern void __journal_abort_hard (journal_t *); 916extern void __journal_abort_hard (journal_t *);
917extern void __journal_abort_soft (journal_t *, int);
918extern void journal_abort (journal_t *, int); 917extern void journal_abort (journal_t *, int);
919extern int journal_errno (journal_t *); 918extern int journal_errno (journal_t *);
920extern void journal_ack_err (journal_t *); 919extern void journal_ack_err (journal_t *);
diff --git a/include/linux/klist.h b/include/linux/klist.h
index eebf5e5696ec..74071254c9d3 100644
--- a/include/linux/klist.h
+++ b/include/linux/klist.h
@@ -9,20 +9,25 @@
9 * This file is rleased under the GPL v2. 9 * This file is rleased under the GPL v2.
10 */ 10 */
11 11
12#ifndef _LINUX_KLIST_H
13#define _LINUX_KLIST_H
14
12#include <linux/spinlock.h> 15#include <linux/spinlock.h>
13#include <linux/completion.h> 16#include <linux/completion.h>
14#include <linux/kref.h> 17#include <linux/kref.h>
15#include <linux/list.h> 18#include <linux/list.h>
16 19
17 20struct klist_node;
18struct klist { 21struct klist {
19 spinlock_t k_lock; 22 spinlock_t k_lock;
20 struct list_head k_list; 23 struct list_head k_list;
24 void (*get)(struct klist_node *);
25 void (*put)(struct klist_node *);
21}; 26};
22 27
23 28
24extern void klist_init(struct klist * k); 29extern void klist_init(struct klist * k, void (*get)(struct klist_node *),
25 30 void (*put)(struct klist_node *));
26 31
27struct klist_node { 32struct klist_node {
28 struct klist * n_klist; 33 struct klist * n_klist;
@@ -31,8 +36,8 @@ struct klist_node {
31 struct completion n_removed; 36 struct completion n_removed;
32}; 37};
33 38
34extern void klist_add_tail(struct klist * k, struct klist_node * n); 39extern void klist_add_tail(struct klist_node * n, struct klist * k);
35extern void klist_add_head(struct klist * k, struct klist_node * n); 40extern void klist_add_head(struct klist_node * n, struct klist * k);
36 41
37extern void klist_del(struct klist_node * n); 42extern void klist_del(struct klist_node * n);
38extern void klist_remove(struct klist_node * n); 43extern void klist_remove(struct klist_node * n);
@@ -53,3 +58,4 @@ extern void klist_iter_init_node(struct klist * k, struct klist_iter * i,
53extern void klist_iter_exit(struct klist_iter * i); 58extern void klist_iter_exit(struct klist_iter * i);
54extern struct klist_node * klist_next(struct klist_iter * i); 59extern struct klist_node * klist_next(struct klist_iter * i);
55 60
61#endif
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index e050fc2d4c26..e30afdca7917 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -42,6 +42,9 @@
42#define KPROBE_REENTER 0x00000004 42#define KPROBE_REENTER 0x00000004
43#define KPROBE_HIT_SSDONE 0x00000008 43#define KPROBE_HIT_SSDONE 0x00000008
44 44
45/* Attach to insert probes on any functions which should be ignored*/
46#define __kprobes __attribute__((__section__(".kprobes.text")))
47
45struct kprobe; 48struct kprobe;
46struct pt_regs; 49struct pt_regs;
47struct kretprobe; 50struct kretprobe;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index fc05a9899288..022105c745fc 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -40,7 +40,6 @@
40#undef ATA_VERBOSE_DEBUG /* yet more debugging output */ 40#undef ATA_VERBOSE_DEBUG /* yet more debugging output */
41#undef ATA_IRQ_TRAP /* define to ack screaming irqs */ 41#undef ATA_IRQ_TRAP /* define to ack screaming irqs */
42#undef ATA_NDEBUG /* define to disable quick runtime checks */ 42#undef ATA_NDEBUG /* define to disable quick runtime checks */
43#undef ATA_ENABLE_ATAPI /* define to enable ATAPI support */
44#undef ATA_ENABLE_PATA /* define to enable PATA support in some 43#undef ATA_ENABLE_PATA /* define to enable PATA support in some
45 * low-level drivers */ 44 * low-level drivers */
46#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */ 45#undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */
@@ -450,6 +449,7 @@ struct pci_bits {
450 unsigned long val; 449 unsigned long val;
451}; 450};
452 451
452extern void ata_pci_host_stop (struct ata_host_set *host_set);
453extern struct ata_probe_ent * 453extern struct ata_probe_ent *
454ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); 454ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port);
455extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); 455extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index 338f7795d8a0..147eb01e0d4b 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -33,6 +33,13 @@
33 ALIGN; \ 33 ALIGN; \
34 name: 34 name:
35 35
36#define KPROBE_ENTRY(name) \
37 .section .kprobes.text, "ax"; \
38 .globl name; \
39 ALIGN; \
40 name:
41
42
36#endif 43#endif
37 44
38#define NORET_TYPE /**/ 45#define NORET_TYPE /**/
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 8480aef10e62..58385ee1c0ac 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -150,8 +150,12 @@ void mpol_free_shared_policy(struct shared_policy *p);
150struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, 150struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
151 unsigned long idx); 151 unsigned long idx);
152 152
153struct mempolicy *get_vma_policy(struct task_struct *task,
154 struct vm_area_struct *vma, unsigned long addr);
155
153extern void numa_default_policy(void); 156extern void numa_default_policy(void);
154extern void numa_policy_init(void); 157extern void numa_policy_init(void);
158extern struct mempolicy default_policy;
155 159
156#else 160#else
157 161
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index aefedf04b9bb..18fc77f682de 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -33,6 +33,13 @@ struct mmc_csd {
33 unsigned int capacity; 33 unsigned int capacity;
34}; 34};
35 35
36struct sd_scr {
37 unsigned char sda_vsn;
38 unsigned char bus_widths;
39#define SD_SCR_BUS_WIDTH_1 (1<<0)
40#define SD_SCR_BUS_WIDTH_4 (1<<2)
41};
42
36struct mmc_host; 43struct mmc_host;
37 44
38/* 45/*
@@ -47,19 +54,27 @@ struct mmc_card {
47#define MMC_STATE_PRESENT (1<<0) /* present in sysfs */ 54#define MMC_STATE_PRESENT (1<<0) /* present in sysfs */
48#define MMC_STATE_DEAD (1<<1) /* device no longer in stack */ 55#define MMC_STATE_DEAD (1<<1) /* device no longer in stack */
49#define MMC_STATE_BAD (1<<2) /* unrecognised device */ 56#define MMC_STATE_BAD (1<<2) /* unrecognised device */
57#define MMC_STATE_SDCARD (1<<3) /* is an SD card */
58#define MMC_STATE_READONLY (1<<4) /* card is read-only */
50 u32 raw_cid[4]; /* raw card CID */ 59 u32 raw_cid[4]; /* raw card CID */
51 u32 raw_csd[4]; /* raw card CSD */ 60 u32 raw_csd[4]; /* raw card CSD */
61 u32 raw_scr[2]; /* raw card SCR */
52 struct mmc_cid cid; /* card identification */ 62 struct mmc_cid cid; /* card identification */
53 struct mmc_csd csd; /* card specific */ 63 struct mmc_csd csd; /* card specific */
64 struct sd_scr scr; /* extra SD information */
54}; 65};
55 66
56#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) 67#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
57#define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD) 68#define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD)
58#define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) 69#define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD)
70#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD)
71#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
59 72
60#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) 73#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
61#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) 74#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD)
62#define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) 75#define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD)
76#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD)
77#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
63 78
64#define mmc_card_name(c) ((c)->cid.prod_name) 79#define mmc_card_name(c) ((c)->cid.prod_name)
65#define mmc_card_id(c) ((c)->dev.bus_id) 80#define mmc_card_id(c) ((c)->dev.bus_id)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 9a0893f3249e..c1f021eddffa 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -46,16 +46,28 @@ struct mmc_ios {
46#define MMC_BUSMODE_OPENDRAIN 1 46#define MMC_BUSMODE_OPENDRAIN 1
47#define MMC_BUSMODE_PUSHPULL 2 47#define MMC_BUSMODE_PUSHPULL 2
48 48
49 unsigned char chip_select; /* SPI chip select */
50
51#define MMC_CS_DONTCARE 0
52#define MMC_CS_HIGH 1
53#define MMC_CS_LOW 2
54
49 unsigned char power_mode; /* power supply mode */ 55 unsigned char power_mode; /* power supply mode */
50 56
51#define MMC_POWER_OFF 0 57#define MMC_POWER_OFF 0
52#define MMC_POWER_UP 1 58#define MMC_POWER_UP 1
53#define MMC_POWER_ON 2 59#define MMC_POWER_ON 2
60
61 unsigned char bus_width; /* data bus width */
62
63#define MMC_BUS_WIDTH_1 0
64#define MMC_BUS_WIDTH_4 2
54}; 65};
55 66
56struct mmc_host_ops { 67struct mmc_host_ops {
57 void (*request)(struct mmc_host *host, struct mmc_request *req); 68 void (*request)(struct mmc_host *host, struct mmc_request *req);
58 void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios); 69 void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios);
70 int (*get_ro)(struct mmc_host *host);
59}; 71};
60 72
61struct mmc_card; 73struct mmc_card;
@@ -70,6 +82,10 @@ struct mmc_host {
70 unsigned int f_max; 82 unsigned int f_max;
71 u32 ocr_avail; 83 u32 ocr_avail;
72 84
85 unsigned long caps; /* Host capabilities */
86
87#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */
88
73 /* host specific block data */ 89 /* host specific block data */
74 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 90 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
75 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ 91 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */
@@ -81,6 +97,10 @@ struct mmc_host {
81 struct mmc_ios ios; /* current io bus settings */ 97 struct mmc_ios ios; /* current io bus settings */
82 u32 ocr; /* the current OCR setting */ 98 u32 ocr; /* the current OCR setting */
83 99
100 unsigned int mode; /* current card mode of host */
101#define MMC_MODE_MMC 0
102#define MMC_MODE_SD 1
103
84 struct list_head cards; /* devices attached to this host */ 104 struct list_head cards; /* devices attached to this host */
85 105
86 wait_queue_head_t wq; 106 wait_queue_head_t wq;
@@ -89,6 +109,8 @@ struct mmc_host {
89 struct mmc_card *card_selected; /* the selected MMC card */ 109 struct mmc_card *card_selected; /* the selected MMC card */
90 110
91 struct work_struct detect; 111 struct work_struct detect;
112
113 unsigned long private[0] ____cacheline_aligned;
92}; 114};
93 115
94extern struct mmc_host *mmc_alloc_host(int extra, struct device *); 116extern struct mmc_host *mmc_alloc_host(int extra, struct device *);
@@ -96,14 +118,18 @@ extern int mmc_add_host(struct mmc_host *);
96extern void mmc_remove_host(struct mmc_host *); 118extern void mmc_remove_host(struct mmc_host *);
97extern void mmc_free_host(struct mmc_host *); 119extern void mmc_free_host(struct mmc_host *);
98 120
99#define mmc_priv(x) ((void *)((x) + 1)) 121static inline void *mmc_priv(struct mmc_host *host)
122{
123 return (void *)host->private;
124}
125
100#define mmc_dev(x) ((x)->dev) 126#define mmc_dev(x) ((x)->dev)
101#define mmc_hostname(x) ((x)->class_dev.class_id) 127#define mmc_hostname(x) ((x)->class_dev.class_id)
102 128
103extern int mmc_suspend_host(struct mmc_host *, pm_message_t); 129extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
104extern int mmc_resume_host(struct mmc_host *); 130extern int mmc_resume_host(struct mmc_host *);
105 131
106extern void mmc_detect_change(struct mmc_host *); 132extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
107extern void mmc_request_done(struct mmc_host *, struct mmc_request *); 133extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
108 134
109#endif 135#endif
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 0d35d4ffb360..1ab78e8d6c53 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -88,6 +88,8 @@ struct mmc_card;
88 88
89extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); 89extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
90extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); 90extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
91extern int mmc_wait_for_app_cmd(struct mmc_host *, unsigned int,
92 struct mmc_command *, int);
91 93
92extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card); 94extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card);
93 95
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h
index 896342817b97..f819cae92266 100644
--- a/include/linux/mmc/protocol.h
+++ b/include/linux/mmc/protocol.h
@@ -236,5 +236,12 @@ struct _mmc_csd {
236#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ 236#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */
237#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */ 237#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */
238 238
239
240/*
241 * SD bus widths
242 */
243#define SD_BUS_WIDTH_1 0
244#define SD_BUS_WIDTH_4 2
245
239#endif /* MMC_MMC_PROTOCOL_H */ 246#endif /* MMC_MMC_PROTOCOL_H */
240 247
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 6c90461ed99f..5ed471b58f4f 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -487,11 +487,27 @@ struct mem_section {
487 unsigned long section_mem_map; 487 unsigned long section_mem_map;
488}; 488};
489 489
490extern struct mem_section mem_section[NR_MEM_SECTIONS]; 490#ifdef CONFIG_SPARSEMEM_EXTREME
491#define SECTIONS_PER_ROOT (PAGE_SIZE / sizeof (struct mem_section))
492#else
493#define SECTIONS_PER_ROOT 1
494#endif
495
496#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT)
497#define NR_SECTION_ROOTS (NR_MEM_SECTIONS / SECTIONS_PER_ROOT)
498#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1)
499
500#ifdef CONFIG_SPARSEMEM_EXTREME
501extern struct mem_section *mem_section[NR_SECTION_ROOTS];
502#else
503extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT];
504#endif
491 505
492static inline struct mem_section *__nr_to_section(unsigned long nr) 506static inline struct mem_section *__nr_to_section(unsigned long nr)
493{ 507{
494 return &mem_section[nr]; 508 if (!mem_section[SECTION_NR_TO_ROOT(nr)])
509 return NULL;
510 return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK];
495} 511}
496 512
497/* 513/*
@@ -513,12 +529,12 @@ static inline struct page *__section_mem_map_addr(struct mem_section *section)
513 529
514static inline int valid_section(struct mem_section *section) 530static inline int valid_section(struct mem_section *section)
515{ 531{
516 return (section->section_mem_map & SECTION_MARKED_PRESENT); 532 return (section && (section->section_mem_map & SECTION_MARKED_PRESENT));
517} 533}
518 534
519static inline int section_has_mem_map(struct mem_section *section) 535static inline int section_has_mem_map(struct mem_section *section)
520{ 536{
521 return (section->section_mem_map & SECTION_HAS_MEM_MAP); 537 return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP));
522} 538}
523 539
524static inline int valid_section_nr(unsigned long nr) 540static inline int valid_section_nr(unsigned long nr)
@@ -572,6 +588,7 @@ static inline int pfn_valid(unsigned long pfn)
572void sparse_init(void); 588void sparse_init(void);
573#else 589#else
574#define sparse_init() do {} while (0) 590#define sparse_init() do {} while (0)
591#define sparse_index_init(_sec, _nid) do {} while (0)
575#endif /* CONFIG_SPARSEMEM */ 592#endif /* CONFIG_SPARSEMEM */
576 593
577#ifdef CONFIG_NODES_SPAN_OTHER_NODES 594#ifdef CONFIG_NODES_SPAN_OTHER_NODES
diff --git a/include/linux/msg.h b/include/linux/msg.h
index 2c4c6aa643ff..903e0ab8101f 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -77,6 +77,7 @@ struct msg_msg {
77/* one msq_queue structure for each present queue on the system */ 77/* one msq_queue structure for each present queue on the system */
78struct msg_queue { 78struct msg_queue {
79 struct kern_ipc_perm q_perm; 79 struct kern_ipc_perm q_perm;
80 int q_id;
80 time_t q_stime; /* last msgsnd time */ 81 time_t q_stime; /* last msgsnd time */
81 time_t q_rtime; /* last msgrcv time */ 82 time_t q_rtime; /* last msgrcv time */
82 time_t q_ctime; /* last change time */ 83 time_t q_ctime; /* last change time */
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index 5773ea42f6e4..0b08cd692201 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -980,7 +980,7 @@
980/* I2C Registers */ 980/* I2C Registers */
981/****************************************/ 981/****************************************/
982 982
983#define MV64XXX_I2C_CTLR_NAME "mv64xxx i2c" 983#define MV64XXX_I2C_CTLR_NAME "mv64xxx_i2c"
984#define MV64XXX_I2C_OFFSET 0xc000 984#define MV64XXX_I2C_OFFSET 0xc000
985#define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020 985#define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020
986 986
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 088742befe49..7e033e9271a8 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -263,6 +263,9 @@ struct ip_conntrack_expect
263 /* Unique ID */ 263 /* Unique ID */
264 unsigned int id; 264 unsigned int id;
265 265
266 /* Flags */
267 unsigned int flags;
268
266#ifdef CONFIG_IP_NF_NAT_NEEDED 269#ifdef CONFIG_IP_NF_NAT_NEEDED
267 /* This is the original per-proto part, used to map the 270 /* This is the original per-proto part, used to map the
268 * expected connection the way the recipient expects. */ 271 * expected connection the way the recipient expects. */
@@ -272,6 +275,8 @@ struct ip_conntrack_expect
272#endif 275#endif
273}; 276};
274 277
278#define IP_CT_EXPECT_PERMANENT 0x1
279
275static inline struct ip_conntrack * 280static inline struct ip_conntrack *
276tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash) 281tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash)
277{ 282{
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h
index dc4d2a0575de..907d4f5ca5dc 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_core.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h
@@ -52,7 +52,7 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb)
52 return ret; 52 return ret;
53} 53}
54 54
55extern void __ip_ct_expect_unlink_destroy(struct ip_conntrack_expect *exp); 55extern void ip_ct_unlink_expect(struct ip_conntrack_expect *exp);
56 56
57extern struct list_head *ip_conntrack_hash; 57extern struct list_head *ip_conntrack_hash;
58extern struct list_head ip_conntrack_expect_list; 58extern struct list_head ip_conntrack_expect_list;
diff --git a/include/linux/netfilter_ipv4/ip_nat_rule.h b/include/linux/netfilter_ipv4/ip_nat_rule.h
index fecd2a06dcd8..73b9552e6a89 100644
--- a/include/linux/netfilter_ipv4/ip_nat_rule.h
+++ b/include/linux/netfilter_ipv4/ip_nat_rule.h
@@ -19,5 +19,10 @@ extern unsigned int
19alloc_null_binding(struct ip_conntrack *conntrack, 19alloc_null_binding(struct ip_conntrack *conntrack,
20 struct ip_nat_info *info, 20 struct ip_nat_info *info,
21 unsigned int hooknum); 21 unsigned int hooknum);
22
23extern unsigned int
24alloc_null_binding_confirmed(struct ip_conntrack *conntrack,
25 struct ip_nat_info *info,
26 unsigned int hooknum);
22#endif 27#endif
23#endif /* _IP_NAT_RULE_H */ 28#endif /* _IP_NAT_RULE_H */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index f5a6695d4d21..f34767c5fc79 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -134,6 +134,7 @@ struct page_state {
134}; 134};
135 135
136extern void get_page_state(struct page_state *ret); 136extern void get_page_state(struct page_state *ret);
137extern void get_page_state_node(struct page_state *ret, int node);
137extern void get_full_page_state(struct page_state *ret); 138extern void get_full_page_state(struct page_state *ret);
138extern unsigned long __read_page_state(unsigned long offset); 139extern unsigned long __read_page_state(unsigned long offset);
139extern void __mod_page_state(unsigned long offset, unsigned long delta); 140extern void __mod_page_state(unsigned long offset, unsigned long delta);
@@ -194,6 +195,7 @@ extern void __mod_page_state(unsigned long offset, unsigned long delta);
194#define SetPageDirty(page) set_bit(PG_dirty, &(page)->flags) 195#define SetPageDirty(page) set_bit(PG_dirty, &(page)->flags)
195#define TestSetPageDirty(page) test_and_set_bit(PG_dirty, &(page)->flags) 196#define TestSetPageDirty(page) test_and_set_bit(PG_dirty, &(page)->flags)
196#define ClearPageDirty(page) clear_bit(PG_dirty, &(page)->flags) 197#define ClearPageDirty(page) clear_bit(PG_dirty, &(page)->flags)
198#define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags)
197#define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) 199#define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags)
198 200
199#define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) 201#define SetPageLRU(page) set_bit(PG_lru, &(page)->flags)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index bc4c40000c0d..7349058ed778 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -19,436 +19,10 @@
19 19
20#include <linux/mod_devicetable.h> 20#include <linux/mod_devicetable.h>
21 21
22/* 22/* Include the pci register defines */
23 * Under PCI, each device has 256 bytes of configuration address space, 23#include <linux/pci_regs.h>
24 * of which the first 64 bytes are standardized as follows:
25 */
26#define PCI_VENDOR_ID 0x00 /* 16 bits */
27#define PCI_DEVICE_ID 0x02 /* 16 bits */
28#define PCI_COMMAND 0x04 /* 16 bits */
29#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
30#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
31#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
32#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
33#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
34#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
35#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */
36#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */
37#define PCI_COMMAND_SERR 0x100 /* Enable SERR */
38#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */
39#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
40
41#define PCI_STATUS 0x06 /* 16 bits */
42#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
43#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
44#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
45#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */
46#define PCI_STATUS_PARITY 0x100 /* Detected parity error */
47#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */
48#define PCI_STATUS_DEVSEL_FAST 0x000
49#define PCI_STATUS_DEVSEL_MEDIUM 0x200
50#define PCI_STATUS_DEVSEL_SLOW 0x400
51#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
52#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */
53#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */
54#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */
55#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */
56
57#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8
58 revision */
59#define PCI_REVISION_ID 0x08 /* Revision ID */
60#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */
61#define PCI_CLASS_DEVICE 0x0a /* Device class */
62
63#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
64#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
65#define PCI_HEADER_TYPE 0x0e /* 8 bits */
66#define PCI_HEADER_TYPE_NORMAL 0
67#define PCI_HEADER_TYPE_BRIDGE 1
68#define PCI_HEADER_TYPE_CARDBUS 2
69
70#define PCI_BIST 0x0f /* 8 bits */
71#define PCI_BIST_CODE_MASK 0x0f /* Return result */
72#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
73#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
74
75/*
76 * Base addresses specify locations in memory or I/O space.
77 * Decoded size can be determined by writing a value of
78 * 0xffffffff to the register, and reading it back. Only
79 * 1 bits are decoded.
80 */
81#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
82#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */
83#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
84#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
85#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
86#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
87#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */
88#define PCI_BASE_ADDRESS_SPACE_IO 0x01
89#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
90#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
91#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */
92#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
93#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
94#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
95#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
96#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
97/* bit 1 is reserved if address_space = 1 */
98
99/* Header type 0 (normal devices) */
100#define PCI_CARDBUS_CIS 0x28
101#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
102#define PCI_SUBSYSTEM_ID 0x2e
103#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
104#define PCI_ROM_ADDRESS_ENABLE 0x01
105#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
106
107#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
108
109/* 0x35-0x3b are reserved */
110#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
111#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
112#define PCI_MIN_GNT 0x3e /* 8 bits */
113#define PCI_MAX_LAT 0x3f /* 8 bits */
114
115/* Header type 1 (PCI-to-PCI bridges) */
116#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */
117#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */
118#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */
119#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */
120#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */
121#define PCI_IO_LIMIT 0x1d
122#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
123#define PCI_IO_RANGE_TYPE_16 0x00
124#define PCI_IO_RANGE_TYPE_32 0x01
125#define PCI_IO_RANGE_MASK (~0x0fUL)
126#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
127#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
128#define PCI_MEMORY_LIMIT 0x22
129#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL
130#define PCI_MEMORY_RANGE_MASK (~0x0fUL)
131#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */
132#define PCI_PREF_MEMORY_LIMIT 0x26
133#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL
134#define PCI_PREF_RANGE_TYPE_32 0x00
135#define PCI_PREF_RANGE_TYPE_64 0x01
136#define PCI_PREF_RANGE_MASK (~0x0fUL)
137#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */
138#define PCI_PREF_LIMIT_UPPER32 0x2c
139#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */
140#define PCI_IO_LIMIT_UPPER16 0x32
141/* 0x34 same as for htype 0 */
142/* 0x35-0x3b is reserved */
143#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */
144/* 0x3c-0x3d are same as for htype 0 */
145#define PCI_BRIDGE_CONTROL 0x3e
146#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */
147#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */
148#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */
149#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */
150#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */
151#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */
152#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */
153
154/* Header type 2 (CardBus bridges) */
155#define PCI_CB_CAPABILITY_LIST 0x14
156/* 0x15 reserved */
157#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */
158#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */
159#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */
160#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */
161#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */
162#define PCI_CB_MEMORY_BASE_0 0x1c
163#define PCI_CB_MEMORY_LIMIT_0 0x20
164#define PCI_CB_MEMORY_BASE_1 0x24
165#define PCI_CB_MEMORY_LIMIT_1 0x28
166#define PCI_CB_IO_BASE_0 0x2c
167#define PCI_CB_IO_BASE_0_HI 0x2e
168#define PCI_CB_IO_LIMIT_0 0x30
169#define PCI_CB_IO_LIMIT_0_HI 0x32
170#define PCI_CB_IO_BASE_1 0x34
171#define PCI_CB_IO_BASE_1_HI 0x36
172#define PCI_CB_IO_LIMIT_1 0x38
173#define PCI_CB_IO_LIMIT_1_HI 0x3a
174#define PCI_CB_IO_RANGE_MASK (~0x03UL)
175/* 0x3c-0x3d are same as for htype 0 */
176#define PCI_CB_BRIDGE_CONTROL 0x3e
177#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */
178#define PCI_CB_BRIDGE_CTL_SERR 0x02
179#define PCI_CB_BRIDGE_CTL_ISA 0x04
180#define PCI_CB_BRIDGE_CTL_VGA 0x08
181#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20
182#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */
183#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */
184#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */
185#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
186#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
187#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40
188#define PCI_CB_SUBSYSTEM_ID 0x42
189#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */
190/* 0x48-0x7f reserved */
191
192/* Capability lists */
193
194#define PCI_CAP_LIST_ID 0 /* Capability ID */
195#define PCI_CAP_ID_PM 0x01 /* Power Management */
196#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */
197#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */
198#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */
199#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
200#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
201#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
202#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
203#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
204#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
205#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
206#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
207#define PCI_CAP_SIZEOF 4
208
209/* Power Management Registers */
210
211#define PCI_PM_PMC 2 /* PM Capabilities Register */
212#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */
213#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */
214#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */
215#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */
216#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */
217#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */
218#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */
219#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */
220#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */
221#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */
222#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */
223#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
224#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */
225#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
226#define PCI_PM_CTRL 4 /* PM control and status register */
227#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */
228#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */
229#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */
230#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */
231#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */
232#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */
233#define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */
234#define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */
235#define PCI_PM_DATA_REGISTER 7 /* (??) */
236#define PCI_PM_SIZEOF 8
237
238/* AGP registers */
239
240#define PCI_AGP_VERSION 2 /* BCD version number */
241#define PCI_AGP_RFU 3 /* Rest of capability flags */
242#define PCI_AGP_STATUS 4 /* Status register */
243#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */
244#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */
245#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */
246#define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */
247#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */
248#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */
249#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */
250#define PCI_AGP_COMMAND 8 /* Control register */
251#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */
252#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */
253#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */
254#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */
255#define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */
256#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */
257#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */
258#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */
259#define PCI_AGP_SIZEOF 12
260
261/* Vital Product Data */
262
263#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
264#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
265#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
266#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
267
268/* Slot Identification */
269
270#define PCI_SID_ESR 2 /* Expansion Slot Register */
271#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */
272#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
273#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */
274
275/* Message Signalled Interrupts registers */
276
277#define PCI_MSI_FLAGS 2 /* Various flags */
278#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */
279#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */
280#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */
281#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */
282#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */
283#define PCI_MSI_RFU 3 /* Rest of capability flags */
284#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
285#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
286#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
287#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
288#define PCI_MSI_MASK_BIT 16 /* Mask bits register */
289
290/* CompactPCI Hotswap Register */
291
292#define PCI_CHSWP_CSR 2 /* Control and Status Register */
293#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */
294#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */
295#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */
296#define PCI_CHSWP_LOO 0x08 /* LED On / Off */
297#define PCI_CHSWP_PI 0x30 /* Programming Interface */
298#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */
299#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */
300
301/* PCI-X registers */
302
303#define PCI_X_CMD 2 /* Modes & Features */
304#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */
305#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */
306#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */
307#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */
308#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */
309#define PCI_X_STATUS 4 /* PCI-X capabilities */
310#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */
311#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */
312#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */
313#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */
314#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */
315#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */
316#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */
317#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */
318#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */
319#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */
320#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
321#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
322#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
323
324/* PCI Express capability registers */
325
326#define PCI_EXP_FLAGS 2 /* Capabilities register */
327#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
328#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
329#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
330#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */
331#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
332#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
333#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
334#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */
335#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
336#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
337#define PCI_EXP_DEVCAP 4 /* Device capabilities */
338#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */
339#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */
340#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */
341#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */
342#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */
343#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */
344#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */
345#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */
346#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */
347#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */
348#define PCI_EXP_DEVCTL 8 /* Device Control */
349#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
350#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
351#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */
352#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */
353#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
354#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */
355#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */
356#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */
357#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */
358#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */
359#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */
360#define PCI_EXP_DEVSTA 10 /* Device Status */
361#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */
362#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */
363#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */
364#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */
365#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */
366#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
367#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
368#define PCI_EXP_LNKCTL 16 /* Link Control */
369#define PCI_EXP_LNKSTA 18 /* Link Status */
370#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
371#define PCI_EXP_SLTCTL 24 /* Slot Control */
372#define PCI_EXP_SLTSTA 26 /* Slot Status */
373#define PCI_EXP_RTCTL 28 /* Root Control */
374#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */
375#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */
376#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */
377#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */
378#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */
379#define PCI_EXP_RTCAP 30 /* Root Capabilities */
380#define PCI_EXP_RTSTA 32 /* Root Status */
381
382/* Extended Capabilities (PCI-X 2.0 and Express) */
383#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
384#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
385#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
386
387#define PCI_EXT_CAP_ID_ERR 1
388#define PCI_EXT_CAP_ID_VC 2
389#define PCI_EXT_CAP_ID_DSN 3
390#define PCI_EXT_CAP_ID_PWR 4
391
392/* Advanced Error Reporting */
393#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
394#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
395#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
396#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
397#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
398#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
399#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */
400#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */
401#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */
402#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
403#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
404#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
405#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
406 /* Same bits as above */
407#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
408 /* Same bits as above */
409#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */
410#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */
411#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */
412#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
413#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
414#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
415#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
416 /* Same bits as above */
417#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
418#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */
419#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
420#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
421#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
422#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
423#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
424#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
425#define PCI_ERR_ROOT_STATUS 48
426#define PCI_ERR_ROOT_COR_SRC 52
427#define PCI_ERR_ROOT_SRC 54
428
429/* Virtual Channel */
430#define PCI_VC_PORT_REG1 4
431#define PCI_VC_PORT_REG2 8
432#define PCI_VC_PORT_CTRL 12
433#define PCI_VC_PORT_STATUS 14
434#define PCI_VC_RES_CAP 16
435#define PCI_VC_RES_CTRL 20
436#define PCI_VC_RES_STATUS 26
437
438/* Power Budgeting */
439#define PCI_PWR_DSR 4 /* Data Select Register */
440#define PCI_PWR_DATA 8 /* Data Register */
441#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */
442#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */
443#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */
444#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
445#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */
446#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
447#define PCI_PWR_CAP 12 /* Capability */
448#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
449 24
450/* Include the ID list */ 25/* Include the ID list */
451
452#include <linux/pci_ids.h> 26#include <linux/pci_ids.h>
453 27
454/* 28/*
@@ -496,11 +70,12 @@ enum pci_mmap_state {
496 70
497typedef int __bitwise pci_power_t; 71typedef int __bitwise pci_power_t;
498 72
499#define PCI_D0 ((pci_power_t __force) 0) 73#define PCI_D0 ((pci_power_t __force) 0)
500#define PCI_D1 ((pci_power_t __force) 1) 74#define PCI_D1 ((pci_power_t __force) 1)
501#define PCI_D2 ((pci_power_t __force) 2) 75#define PCI_D2 ((pci_power_t __force) 2)
502#define PCI_D3hot ((pci_power_t __force) 3) 76#define PCI_D3hot ((pci_power_t __force) 3)
503#define PCI_D3cold ((pci_power_t __force) 4) 77#define PCI_D3cold ((pci_power_t __force) 4)
78#define PCI_UNKNOWN ((pci_power_t __force) 5)
504#define PCI_POWER_ERROR ((pci_power_t __force) -1) 79#define PCI_POWER_ERROR ((pci_power_t __force) -1)
505 80
506/* 81/*
@@ -562,11 +137,6 @@ struct pci_dev {
562 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ 137 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
563 int rom_attr_enabled; /* has display of the rom attribute been enabled? */ 138 int rom_attr_enabled; /* has display of the rom attribute been enabled? */
564 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ 139 struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */
565#ifdef CONFIG_PCI_NAMES
566#define PCI_NAME_SIZE 255
567#define PCI_NAME_HALF __stringify(43) /* less than half to handle slop */
568 char pretty_name[PCI_NAME_SIZE]; /* pretty name for users to see */
569#endif
570}; 140};
571 141
572#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) 142#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
@@ -582,15 +152,15 @@ struct pci_dev {
582 * 7-10 bridges: address space assigned to buses behind the bridge 152 * 7-10 bridges: address space assigned to buses behind the bridge
583 */ 153 */
584 154
585#define PCI_ROM_RESOURCE 6 155#define PCI_ROM_RESOURCE 6
586#define PCI_BRIDGE_RESOURCES 7 156#define PCI_BRIDGE_RESOURCES 7
587#define PCI_NUM_RESOURCES 11 157#define PCI_NUM_RESOURCES 11
588 158
589#ifndef PCI_BUS_NUM_RESOURCES 159#ifndef PCI_BUS_NUM_RESOURCES
590#define PCI_BUS_NUM_RESOURCES 8 160#define PCI_BUS_NUM_RESOURCES 8
591#endif 161#endif
592 162
593#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ 163#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */
594 164
595struct pci_bus { 165struct pci_bus {
596 struct list_head node; /* node in list of buses */ 166 struct list_head node; /* node in list of buses */
@@ -699,7 +269,7 @@ struct pci_driver {
699 * @dev_class_mask: the class mask for this device 269 * @dev_class_mask: the class mask for this device
700 * 270 *
701 * This macro is used to create a struct pci_device_id that matches a 271 * This macro is used to create a struct pci_device_id that matches a
702 * specific PCI class. The vendor, device, subvendor, and subdevice 272 * specific PCI class. The vendor, device, subvendor, and subdevice
703 * fields will be set to PCI_ANY_ID. 273 * fields will be set to PCI_ANY_ID.
704 */ 274 */
705#define PCI_DEVICE_CLASS(dev_class,dev_class_mask) \ 275#define PCI_DEVICE_CLASS(dev_class,dev_class_mask) \
@@ -707,7 +277,7 @@ struct pci_driver {
707 .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \ 277 .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
708 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID 278 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
709 279
710/* 280/*
711 * pci_module_init is obsolete, this stays here till we fix up all usages of it 281 * pci_module_init is obsolete, this stays here till we fix up all usages of it
712 * in the tree. 282 * in the tree.
713 */ 283 */
@@ -745,12 +315,13 @@ static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *s
745 pci_bus_add_devices(root_bus); 315 pci_bus_add_devices(root_bus);
746 return root_bus; 316 return root_bus;
747} 317}
318struct pci_bus *pci_create_bus(struct device *parent, int bus, struct pci_ops *ops, void *sysdata);
319struct pci_bus * pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr);
748int pci_scan_slot(struct pci_bus *bus, int devfn); 320int pci_scan_slot(struct pci_bus *bus, int devfn);
749struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); 321struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn);
322void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
750unsigned int pci_scan_child_bus(struct pci_bus *bus); 323unsigned int pci_scan_child_bus(struct pci_bus *bus);
751void pci_bus_add_device(struct pci_dev *dev); 324void pci_bus_add_device(struct pci_dev *dev);
752void pci_name_device(struct pci_dev *dev);
753char *pci_class_name(u32 class);
754void pci_read_bridge_bases(struct pci_bus *child); 325void pci_read_bridge_bases(struct pci_bus *child);
755struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); 326struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res);
756int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); 327int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
@@ -758,6 +329,7 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
758extern void pci_dev_put(struct pci_dev *dev); 329extern void pci_dev_put(struct pci_dev *dev);
759extern void pci_remove_bus(struct pci_bus *b); 330extern void pci_remove_bus(struct pci_bus *b);
760extern void pci_remove_bus_device(struct pci_dev *dev); 331extern void pci_remove_bus_device(struct pci_dev *dev);
332void pci_setup_cardbus(struct pci_bus *bus);
761 333
762/* Generic PCI functions exported to card drivers */ 334/* Generic PCI functions exported to card drivers */
763 335
@@ -815,13 +387,16 @@ void pci_set_master(struct pci_dev *dev);
815#define HAVE_PCI_SET_MWI 387#define HAVE_PCI_SET_MWI
816int pci_set_mwi(struct pci_dev *dev); 388int pci_set_mwi(struct pci_dev *dev);
817void pci_clear_mwi(struct pci_dev *dev); 389void pci_clear_mwi(struct pci_dev *dev);
390void pci_intx(struct pci_dev *dev, int enable);
818int pci_set_dma_mask(struct pci_dev *dev, u64 mask); 391int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
819int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); 392int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
393void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
820int pci_assign_resource(struct pci_dev *dev, int i); 394int pci_assign_resource(struct pci_dev *dev, int i);
395void pci_restore_bars(struct pci_dev *dev);
821 396
822/* ROM control related routines */ 397/* ROM control related routines */
823void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size); 398void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
824void __iomem *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); 399void __iomem __must_check *pci_map_rom_copy(struct pci_dev *pdev, size_t *size);
825void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); 400void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom);
826void pci_remove_rom(struct pci_dev *pdev); 401void pci_remove_rom(struct pci_dev *pdev);
827 402
@@ -865,6 +440,9 @@ const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_
865const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev); 440const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
866int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); 441int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
867 442
443void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *),
444 void *userdata);
445
868/* kmem_cache style wrapper around pci_alloc_consistent() */ 446/* kmem_cache style wrapper around pci_alloc_consistent() */
869 447
870#include <linux/dmapool.h> 448#include <linux/dmapool.h>
@@ -912,18 +490,26 @@ extern void pci_disable_msix(struct pci_dev *dev);
912extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); 490extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
913#endif 491#endif
914 492
915#endif /* CONFIG_PCI */ 493/*
916 494 * PCI domain support. Sometimes called PCI segment (eg by ACPI),
917/* Include architecture-dependent settings and functions */ 495 * a PCI domain is defined to be a set of PCI busses which share
496 * configuration space.
497 */
498#ifndef CONFIG_PCI_DOMAINS
499static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
500static inline int pci_proc_domain(struct pci_bus *bus)
501{
502 return 0;
503}
504#endif
918 505
919#include <asm/pci.h> 506#else /* CONFIG_PCI is not enabled */
920 507
921/* 508/*
922 * If the system does not have PCI, clearly these return errors. Define 509 * If the system does not have PCI, clearly these return errors. Define
923 * these as simple inline functions to avoid hair in drivers. 510 * these as simple inline functions to avoid hair in drivers.
924 */ 511 */
925 512
926#ifndef CONFIG_PCI
927#define _PCI_NOP(o,s,t) \ 513#define _PCI_NOP(o,s,t) \
928 static inline int pci_##o##_config_##s (struct pci_dev *dev, int where, t val) \ 514 static inline int pci_##o##_config_##s (struct pci_dev *dev, int where, t val) \
929 { return PCIBIOS_FUNC_NOT_SUPPORTED; } 515 { return PCIBIOS_FUNC_NOT_SUPPORTED; }
@@ -974,21 +560,11 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en
974 560
975#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 561#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
976 562
977#else 563#endif /* CONFIG_PCI */
978 564
979/* 565/* Include architecture-dependent settings and functions */
980 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 566
981 * a PCI domain is defined to be a set of PCI busses which share 567#include <asm/pci.h>
982 * configuration space.
983 */
984#ifndef CONFIG_PCI_DOMAINS
985static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
986static inline int pci_proc_domain(struct pci_bus *bus)
987{
988 return 0;
989}
990#endif
991#endif /* !CONFIG_PCI */
992 568
993/* these helpers provide future and backwards compatibility 569/* these helpers provide future and backwards compatibility
994 * for accessing popular PCI BAR info */ 570 * for accessing popular PCI BAR info */
@@ -1025,13 +601,6 @@ static inline char *pci_name(struct pci_dev *pdev)
1025 return pdev->dev.bus_id; 601 return pdev->dev.bus_id;
1026} 602}
1027 603
1028/* Some archs want to see the pretty pci name, so use this macro */
1029#ifdef CONFIG_PCI_NAMES
1030#define pci_pretty_name(dev) ((dev)->pretty_name)
1031#else
1032#define pci_pretty_name(dev) ""
1033#endif
1034
1035 604
1036/* Some archs don't want to expose struct resource to userland as-is 605/* Some archs don't want to expose struct resource to userland as-is
1037 * in sysfs and /proc 606 * in sysfs and /proc
@@ -1067,7 +636,7 @@ enum pci_fixup_pass {
1067 636
1068/* Anonymous variables would be nice... */ 637/* Anonymous variables would be nice... */
1069#define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, hook) \ 638#define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, hook) \
1070 static struct pci_fixup __pci_fixup_##name __attribute_used__ \ 639 static const struct pci_fixup __pci_fixup_##name __attribute_used__ \
1071 __attribute__((__section__(#section))) = { vendor, device, hook }; 640 __attribute__((__section__(#section))) = { vendor, device, hook };
1072#define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ 641#define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \
1073 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ 642 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index d513c1634006..ee0ab7a5f91b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1612,6 +1612,7 @@
1612#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 1612#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030
1613#define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180 1613#define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180
1614#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 1614#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108
1615#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3
1615 1616
1616#define PCI_VENDOR_ID_RICOH 0x1180 1617#define PCI_VENDOR_ID_RICOH 0x1180
1617#define PCI_DEVICE_ID_RICOH_RL5C465 0x0465 1618#define PCI_DEVICE_ID_RICOH_RL5C465 0x0465
@@ -2147,6 +2148,9 @@
2147#define PCI_DEVICE_ID_ENE_1420 0x1420 2148#define PCI_DEVICE_ID_ENE_1420 0x1420
2148#define PCI_VENDOR_ID_CHELSIO 0x1425 2149#define PCI_VENDOR_ID_CHELSIO 0x1425
2149 2150
2151#define PCI_VENDOR_ID_MIPS 0x153f
2152#define PCI_DEVICE_ID_SOC_IT 0x0001
2153
2150#define PCI_VENDOR_ID_SYBA 0x1592 2154#define PCI_VENDOR_ID_SYBA 0x1592
2151#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 2155#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
2152#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783 2156#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
new file mode 100644
index 000000000000..e2a089b051ed
--- /dev/null
+++ b/include/linux/pci_regs.h
@@ -0,0 +1,448 @@
1/*
2 * pci_regs.h
3 *
4 * PCI standard defines
5 * Copyright 1994, Drew Eckhardt
6 * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
7 *
8 * For more information, please consult the following manuals (look at
9 * http://www.pcisig.com/ for how to get them):
10 *
11 * PCI BIOS Specification
12 * PCI Local Bus Specification
13 * PCI to PCI Bridge Specification
14 * PCI System Design Guide
15 */
16
17#ifndef LINUX_PCI_REGS_H
18#define LINUX_PCI_REGS_H
19
20/*
21 * Under PCI, each device has 256 bytes of configuration address space,
22 * of which the first 64 bytes are standardized as follows:
23 */
24#define PCI_VENDOR_ID 0x00 /* 16 bits */
25#define PCI_DEVICE_ID 0x02 /* 16 bits */
26#define PCI_COMMAND 0x04 /* 16 bits */
27#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
28#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
29#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */
30#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */
31#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */
32#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */
33#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */
34#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */
35#define PCI_COMMAND_SERR 0x100 /* Enable SERR */
36#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */
37#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
38
39#define PCI_STATUS 0x06 /* 16 bits */
40#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */
41#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */
42#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */
43#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */
44#define PCI_STATUS_PARITY 0x100 /* Detected parity error */
45#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */
46#define PCI_STATUS_DEVSEL_FAST 0x000
47#define PCI_STATUS_DEVSEL_MEDIUM 0x200
48#define PCI_STATUS_DEVSEL_SLOW 0x400
49#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */
50#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */
51#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */
52#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */
53#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */
54
55#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */
56#define PCI_REVISION_ID 0x08 /* Revision ID */
57#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */
58#define PCI_CLASS_DEVICE 0x0a /* Device class */
59
60#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */
61#define PCI_LATENCY_TIMER 0x0d /* 8 bits */
62#define PCI_HEADER_TYPE 0x0e /* 8 bits */
63#define PCI_HEADER_TYPE_NORMAL 0
64#define PCI_HEADER_TYPE_BRIDGE 1
65#define PCI_HEADER_TYPE_CARDBUS 2
66
67#define PCI_BIST 0x0f /* 8 bits */
68#define PCI_BIST_CODE_MASK 0x0f /* Return result */
69#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */
70#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */
71
72/*
73 * Base addresses specify locations in memory or I/O space.
74 * Decoded size can be determined by writing a value of
75 * 0xffffffff to the register, and reading it back. Only
76 * 1 bits are decoded.
77 */
78#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
79#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */
80#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */
81#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */
82#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */
83#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */
84#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */
85#define PCI_BASE_ADDRESS_SPACE_IO 0x01
86#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
87#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
88#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */
89#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
90#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */
91#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */
92#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
93#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
94/* bit 1 is reserved if address_space = 1 */
95
96/* Header type 0 (normal devices) */
97#define PCI_CARDBUS_CIS 0x28
98#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
99#define PCI_SUBSYSTEM_ID 0x2e
100#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */
101#define PCI_ROM_ADDRESS_ENABLE 0x01
102#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
103
104#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */
105
106/* 0x35-0x3b are reserved */
107#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */
108#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */
109#define PCI_MIN_GNT 0x3e /* 8 bits */
110#define PCI_MAX_LAT 0x3f /* 8 bits */
111
112/* Header type 1 (PCI-to-PCI bridges) */
113#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */
114#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */
115#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */
116#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */
117#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */
118#define PCI_IO_LIMIT 0x1d
119#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
120#define PCI_IO_RANGE_TYPE_16 0x00
121#define PCI_IO_RANGE_TYPE_32 0x01
122#define PCI_IO_RANGE_MASK (~0x0fUL)
123#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
124#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
125#define PCI_MEMORY_LIMIT 0x22
126#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL
127#define PCI_MEMORY_RANGE_MASK (~0x0fUL)
128#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */
129#define PCI_PREF_MEMORY_LIMIT 0x26
130#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL
131#define PCI_PREF_RANGE_TYPE_32 0x00
132#define PCI_PREF_RANGE_TYPE_64 0x01
133#define PCI_PREF_RANGE_MASK (~0x0fUL)
134#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */
135#define PCI_PREF_LIMIT_UPPER32 0x2c
136#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */
137#define PCI_IO_LIMIT_UPPER16 0x32
138/* 0x34 same as for htype 0 */
139/* 0x35-0x3b is reserved */
140#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */
141/* 0x3c-0x3d are same as for htype 0 */
142#define PCI_BRIDGE_CONTROL 0x3e
143#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */
144#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */
145#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */
146#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */
147#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */
148#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */
149#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */
150
151/* Header type 2 (CardBus bridges) */
152#define PCI_CB_CAPABILITY_LIST 0x14
153/* 0x15 reserved */
154#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */
155#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */
156#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */
157#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */
158#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */
159#define PCI_CB_MEMORY_BASE_0 0x1c
160#define PCI_CB_MEMORY_LIMIT_0 0x20
161#define PCI_CB_MEMORY_BASE_1 0x24
162#define PCI_CB_MEMORY_LIMIT_1 0x28
163#define PCI_CB_IO_BASE_0 0x2c
164#define PCI_CB_IO_BASE_0_HI 0x2e
165#define PCI_CB_IO_LIMIT_0 0x30
166#define PCI_CB_IO_LIMIT_0_HI 0x32
167#define PCI_CB_IO_BASE_1 0x34
168#define PCI_CB_IO_BASE_1_HI 0x36
169#define PCI_CB_IO_LIMIT_1 0x38
170#define PCI_CB_IO_LIMIT_1_HI 0x3a
171#define PCI_CB_IO_RANGE_MASK (~0x03UL)
172/* 0x3c-0x3d are same as for htype 0 */
173#define PCI_CB_BRIDGE_CONTROL 0x3e
174#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */
175#define PCI_CB_BRIDGE_CTL_SERR 0x02
176#define PCI_CB_BRIDGE_CTL_ISA 0x04
177#define PCI_CB_BRIDGE_CTL_VGA 0x08
178#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20
179#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */
180#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */
181#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */
182#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
183#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
184#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40
185#define PCI_CB_SUBSYSTEM_ID 0x42
186#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */
187/* 0x48-0x7f reserved */
188
189/* Capability lists */
190
191#define PCI_CAP_LIST_ID 0 /* Capability ID */
192#define PCI_CAP_ID_PM 0x01 /* Power Management */
193#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */
194#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */
195#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */
196#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */
197#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */
198#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */
199#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
200#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
201#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
202#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
203#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
204#define PCI_CAP_SIZEOF 4
205
206/* Power Management Registers */
207
208#define PCI_PM_PMC 2 /* PM Capabilities Register */
209#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */
210#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */
211#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */
212#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */
213#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */
214#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */
215#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */
216#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */
217#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */
218#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */
219#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */
220#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */
221#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */
222#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */
223#define PCI_PM_CTRL 4 /* PM control and status register */
224#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */
225#define PCI_PM_CTRL_NO_SOFT_RESET 0x0004 /* No reset for D3hot->D0 */
226#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */
227#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */
228#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */
229#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */
230#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */
231#define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */
232#define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */
233#define PCI_PM_DATA_REGISTER 7 /* (??) */
234#define PCI_PM_SIZEOF 8
235
236/* AGP registers */
237
238#define PCI_AGP_VERSION 2 /* BCD version number */
239#define PCI_AGP_RFU 3 /* Rest of capability flags */
240#define PCI_AGP_STATUS 4 /* Status register */
241#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */
242#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */
243#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */
244#define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */
245#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */
246#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */
247#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */
248#define PCI_AGP_COMMAND 8 /* Control register */
249#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */
250#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */
251#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */
252#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */
253#define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */
254#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */
255#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */
256#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */
257#define PCI_AGP_SIZEOF 12
258
259/* Vital Product Data */
260
261#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */
262#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
263#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
264#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
265
266/* Slot Identification */
267
268#define PCI_SID_ESR 2 /* Expansion Slot Register */
269#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */
270#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */
271#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */
272
273/* Message Signalled Interrupts registers */
274
275#define PCI_MSI_FLAGS 2 /* Various flags */
276#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */
277#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */
278#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */
279#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */
280#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */
281#define PCI_MSI_RFU 3 /* Rest of capability flags */
282#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
283#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
284#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
285#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
286#define PCI_MSI_MASK_BIT 16 /* Mask bits register */
287
288/* CompactPCI Hotswap Register */
289
290#define PCI_CHSWP_CSR 2 /* Control and Status Register */
291#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */
292#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */
293#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */
294#define PCI_CHSWP_LOO 0x08 /* LED On / Off */
295#define PCI_CHSWP_PI 0x30 /* Programming Interface */
296#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */
297#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */
298
299/* PCI-X registers */
300
301#define PCI_X_CMD 2 /* Modes & Features */
302#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */
303#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */
304#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */
305#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */
306#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */
307#define PCI_X_STATUS 4 /* PCI-X capabilities */
308#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */
309#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */
310#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */
311#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */
312#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */
313#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */
314#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */
315#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */
316#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */
317#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */
318#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
319#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
320#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
321
322/* PCI Express capability registers */
323
324#define PCI_EXP_FLAGS 2 /* Capabilities register */
325#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */
326#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */
327#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */
328#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */
329#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
330#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
331#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
332#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */
333#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
334#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
335#define PCI_EXP_DEVCAP 4 /* Device capabilities */
336#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */
337#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */
338#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */
339#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */
340#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */
341#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */
342#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */
343#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */
344#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */
345#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */
346#define PCI_EXP_DEVCTL 8 /* Device Control */
347#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
348#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */
349#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */
350#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */
351#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
352#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */
353#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */
354#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */
355#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */
356#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */
357#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */
358#define PCI_EXP_DEVSTA 10 /* Device Status */
359#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */
360#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */
361#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */
362#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */
363#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */
364#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
365#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
366#define PCI_EXP_LNKCTL 16 /* Link Control */
367#define PCI_EXP_LNKSTA 18 /* Link Status */
368#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
369#define PCI_EXP_SLTCTL 24 /* Slot Control */
370#define PCI_EXP_SLTSTA 26 /* Slot Status */
371#define PCI_EXP_RTCTL 28 /* Root Control */
372#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */
373#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */
374#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */
375#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */
376#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */
377#define PCI_EXP_RTCAP 30 /* Root Capabilities */
378#define PCI_EXP_RTSTA 32 /* Root Status */
379
380/* Extended Capabilities (PCI-X 2.0 and Express) */
381#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
382#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
383#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
384
385#define PCI_EXT_CAP_ID_ERR 1
386#define PCI_EXT_CAP_ID_VC 2
387#define PCI_EXT_CAP_ID_DSN 3
388#define PCI_EXT_CAP_ID_PWR 4
389
390/* Advanced Error Reporting */
391#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
392#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
393#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
394#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
395#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
396#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
397#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */
398#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */
399#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */
400#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
401#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
402#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
403#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
404 /* Same bits as above */
405#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
406 /* Same bits as above */
407#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */
408#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */
409#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */
410#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
411#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
412#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
413#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
414 /* Same bits as above */
415#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
416#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */
417#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */
418#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */
419#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */
420#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */
421#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */
422#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */
423#define PCI_ERR_ROOT_STATUS 48
424#define PCI_ERR_ROOT_COR_SRC 52
425#define PCI_ERR_ROOT_SRC 54
426
427/* Virtual Channel */
428#define PCI_VC_PORT_REG1 4
429#define PCI_VC_PORT_REG2 8
430#define PCI_VC_PORT_CTRL 12
431#define PCI_VC_PORT_STATUS 14
432#define PCI_VC_RES_CAP 16
433#define PCI_VC_RES_CTRL 20
434#define PCI_VC_RES_STATUS 26
435
436/* Power Budgeting */
437#define PCI_PWR_DSR 4 /* Data Select Register */
438#define PCI_PWR_DATA 8 /* Data Register */
439#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */
440#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */
441#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */
442#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */
443#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */
444#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
445#define PCI_PWR_CAP 12 /* Capability */
446#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
447
448#endif /* LINUX_PCI_REGS_H */
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 36725e7c02c6..1767073df26f 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -39,9 +39,6 @@ struct pipe_inode_info {
39 39
40#define PIPE_SEM(inode) (&(inode).i_sem) 40#define PIPE_SEM(inode) (&(inode).i_sem)
41#define PIPE_WAIT(inode) (&(inode).i_pipe->wait) 41#define PIPE_WAIT(inode) (&(inode).i_pipe->wait)
42#define PIPE_BASE(inode) ((inode).i_pipe->base)
43#define PIPE_START(inode) ((inode).i_pipe->start)
44#define PIPE_LEN(inode) ((inode).i_pipe->len)
45#define PIPE_READERS(inode) ((inode).i_pipe->readers) 42#define PIPE_READERS(inode) ((inode).i_pipe->readers)
46#define PIPE_WRITERS(inode) ((inode).i_pipe->writers) 43#define PIPE_WRITERS(inode) ((inode).i_pipe->writers)
47#define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers) 44#define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers)
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 7aeb208ed713..5cfb07648eca 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -186,7 +186,9 @@ extern int pm_suspend(suspend_state_t state);
186 186
187struct device; 187struct device;
188 188
189typedef u32 __bitwise pm_message_t; 189typedef struct pm_message {
190 int event;
191} pm_message_t;
190 192
191/* 193/*
192 * There are 4 important states driver can be in: 194 * There are 4 important states driver can be in:
@@ -207,9 +209,13 @@ typedef u32 __bitwise pm_message_t;
207 * or something similar soon. 209 * or something similar soon.
208 */ 210 */
209 211
210#define PMSG_FREEZE ((__force pm_message_t) 3) 212#define PM_EVENT_ON 0
211#define PMSG_SUSPEND ((__force pm_message_t) 3) 213#define PM_EVENT_FREEZE 1
212#define PMSG_ON ((__force pm_message_t) 0) 214#define PM_EVENT_SUSPEND 2
215
216#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, })
217#define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, })
218#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, })
213 219
214struct dev_pm_info { 220struct dev_pm_info {
215 pm_message_t power_state; 221 pm_message_t power_state;
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 5ec2bd0c2848..aadbac29103c 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -443,7 +443,7 @@ static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; }
443#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) 443#define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg)
444#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) 444#define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg)
445 445
446#ifdef DEBUG 446#ifdef CONFIG_PNP_DEBUG
447#define pnp_dbg(format, arg...) printk(KERN_DEBUG "pnp: " format "\n" , ## arg) 447#define pnp_dbg(format, arg...) printk(KERN_DEBUG "pnp: " format "\n" , ## arg)
448#else 448#else
449#define pnp_dbg(format, arg...) do {} while (0) 449#define pnp_dbg(format, arg...) do {} while (0)
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index a373fc254df2..dc6f3647bfbc 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -20,6 +20,8 @@
20#define PTRACE_DETACH 0x11 20#define PTRACE_DETACH 0x11
21 21
22#define PTRACE_SYSCALL 24 22#define PTRACE_SYSCALL 24
23#define PTRACE_SYSEMU 31
24#define PTRACE_SYSEMU_SINGLESTEP 32
23 25
24/* 0x4200-0x4300 are reserved for architecture-independent additions. */ 26/* 0x4200-0x4300 are reserved for architecture-independent additions. */
25#define PTRACE_SETOPTIONS 0x4200 27#define PTRACE_SETOPTIONS 0x4200
@@ -88,6 +90,7 @@ extern void __ptrace_link(struct task_struct *child,
88 struct task_struct *new_parent); 90 struct task_struct *new_parent);
89extern void __ptrace_unlink(struct task_struct *child); 91extern void __ptrace_unlink(struct task_struct *child);
90extern void ptrace_untrace(struct task_struct *child); 92extern void ptrace_untrace(struct task_struct *child);
93extern int ptrace_may_attach(struct task_struct *task);
91 94
92static inline void ptrace_link(struct task_struct *child, 95static inline void ptrace_link(struct task_struct *child,
93 struct task_struct *new_parent) 96 struct task_struct *new_parent)
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 4bf1659f8aa8..9de99198caf1 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -7,7 +7,7 @@
7#define BITMAP_H 1 7#define BITMAP_H 1
8 8
9#define BITMAP_MAJOR 3 9#define BITMAP_MAJOR 3
10#define BITMAP_MINOR 38 10#define BITMAP_MINOR 39
11 11
12/* 12/*
13 * in-memory bitmap: 13 * in-memory bitmap:
@@ -147,8 +147,9 @@ typedef struct bitmap_super_s {
147 __u32 state; /* 48 bitmap state information */ 147 __u32 state; /* 48 bitmap state information */
148 __u32 chunksize; /* 52 the bitmap chunk size in bytes */ 148 __u32 chunksize; /* 52 the bitmap chunk size in bytes */
149 __u32 daemon_sleep; /* 56 seconds between disk flushes */ 149 __u32 daemon_sleep; /* 56 seconds between disk flushes */
150 __u32 write_behind; /* 60 number of outstanding write-behind writes */
150 151
151 __u8 pad[256 - 60]; /* set to zero */ 152 __u8 pad[256 - 64]; /* set to zero */
152} bitmap_super_t; 153} bitmap_super_t;
153 154
154/* notes: 155/* notes:
@@ -226,6 +227,9 @@ struct bitmap {
226 227
227 unsigned long flags; 228 unsigned long flags;
228 229
230 unsigned long max_write_behind; /* write-behind mode */
231 atomic_t behind_writes;
232
229 /* 233 /*
230 * the bitmap daemon - periodically wakes up and sweeps the bitmap 234 * the bitmap daemon - periodically wakes up and sweeps the bitmap
231 * file, cleaning up bits and flushing out pages to disk as necessary 235 * file, cleaning up bits and flushing out pages to disk as necessary
@@ -260,9 +264,10 @@ int bitmap_setallbits(struct bitmap *bitmap);
260void bitmap_write_all(struct bitmap *bitmap); 264void bitmap_write_all(struct bitmap *bitmap);
261 265
262/* these are exported */ 266/* these are exported */
263int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); 267int bitmap_startwrite(struct bitmap *bitmap, sector_t offset,
264void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, 268 unsigned long sectors, int behind);
265 int success); 269void bitmap_endwrite(struct bitmap *bitmap, sector_t offset,
270 unsigned long sectors, int success, int behind);
266int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); 271int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded);
267void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); 272void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
268void bitmap_close_sync(struct bitmap *bitmap); 273void bitmap_close_sync(struct bitmap *bitmap);
diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h
index e04c4fe45b53..7eaf290e10e7 100644
--- a/include/linux/raid/linear.h
+++ b/include/linux/raid/linear.h
@@ -14,8 +14,8 @@ typedef struct dev_info dev_info_t;
14struct linear_private_data 14struct linear_private_data
15{ 15{
16 dev_info_t **hash_table; 16 dev_info_t **hash_table;
17 dev_info_t *smallest; 17 sector_t hash_spacing;
18 int nr_zones; 18 int preshift; /* shift before dividing by hash_spacing */
19 dev_info_t disks[0]; 19 dev_info_t disks[0];
20}; 20};
21 21
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 8c14ba565a45..ebce949b1443 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -86,70 +86,6 @@ typedef struct mdk_rdev_s mdk_rdev_t;
86#define MAX_CHUNK_SIZE (4096*1024) 86#define MAX_CHUNK_SIZE (4096*1024)
87 87
88/* 88/*
89 * default readahead
90 */
91
92static inline int disk_faulty(mdp_disk_t * d)
93{
94 return d->state & (1 << MD_DISK_FAULTY);
95}
96
97static inline int disk_active(mdp_disk_t * d)
98{
99 return d->state & (1 << MD_DISK_ACTIVE);
100}
101
102static inline int disk_sync(mdp_disk_t * d)
103{
104 return d->state & (1 << MD_DISK_SYNC);
105}
106
107static inline int disk_spare(mdp_disk_t * d)
108{
109 return !disk_sync(d) && !disk_active(d) && !disk_faulty(d);
110}
111
112static inline int disk_removed(mdp_disk_t * d)
113{
114 return d->state & (1 << MD_DISK_REMOVED);
115}
116
117static inline void mark_disk_faulty(mdp_disk_t * d)
118{
119 d->state |= (1 << MD_DISK_FAULTY);
120}
121
122static inline void mark_disk_active(mdp_disk_t * d)
123{
124 d->state |= (1 << MD_DISK_ACTIVE);
125}
126
127static inline void mark_disk_sync(mdp_disk_t * d)
128{
129 d->state |= (1 << MD_DISK_SYNC);
130}
131
132static inline void mark_disk_spare(mdp_disk_t * d)
133{
134 d->state = 0;
135}
136
137static inline void mark_disk_removed(mdp_disk_t * d)
138{
139 d->state = (1 << MD_DISK_FAULTY) | (1 << MD_DISK_REMOVED);
140}
141
142static inline void mark_disk_inactive(mdp_disk_t * d)
143{
144 d->state &= ~(1 << MD_DISK_ACTIVE);
145}
146
147static inline void mark_disk_nonsync(mdp_disk_t * d)
148{
149 d->state &= ~(1 << MD_DISK_SYNC);
150}
151
152/*
153 * MD's 'extended' device 89 * MD's 'extended' device
154 */ 90 */
155struct mdk_rdev_s 91struct mdk_rdev_s
@@ -166,6 +102,7 @@ struct mdk_rdev_s
166 int sb_loaded; 102 int sb_loaded;
167 sector_t data_offset; /* start of data in array */ 103 sector_t data_offset; /* start of data in array */
168 sector_t sb_offset; 104 sector_t sb_offset;
105 int sb_size; /* bytes in the superblock */
169 int preferred_minor; /* autorun support */ 106 int preferred_minor; /* autorun support */
170 107
171 /* A device can be in one of three states based on two flags: 108 /* A device can be in one of three states based on two flags:
@@ -181,6 +118,9 @@ struct mdk_rdev_s
181 int faulty; /* if faulty do not issue IO requests */ 118 int faulty; /* if faulty do not issue IO requests */
182 int in_sync; /* device is a full member of the array */ 119 int in_sync; /* device is a full member of the array */
183 120
121 unsigned long flags; /* Should include faulty and in_sync here. */
122#define WriteMostly 4 /* Avoid reading if at all possible */
123
184 int desc_nr; /* descriptor index in the superblock */ 124 int desc_nr; /* descriptor index in the superblock */
185 int raid_disk; /* role of device in array */ 125 int raid_disk; /* role of device in array */
186 int saved_raid_disk; /* role that device used to have in the 126 int saved_raid_disk; /* role that device used to have in the
@@ -272,12 +212,19 @@ struct mddev_s
272 atomic_t writes_pending; 212 atomic_t writes_pending;
273 request_queue_t *queue; /* for plugging ... */ 213 request_queue_t *queue; /* for plugging ... */
274 214
215 atomic_t write_behind; /* outstanding async IO */
216 unsigned int max_write_behind; /* 0 = sync */
217
275 struct bitmap *bitmap; /* the bitmap for the device */ 218 struct bitmap *bitmap; /* the bitmap for the device */
276 struct file *bitmap_file; /* the bitmap file */ 219 struct file *bitmap_file; /* the bitmap file */
277 long bitmap_offset; /* offset from superblock of 220 long bitmap_offset; /* offset from superblock of
278 * start of bitmap. May be 221 * start of bitmap. May be
279 * negative, but not '0' 222 * negative, but not '0'
280 */ 223 */
224 long default_bitmap_offset; /* this is the offset to use when
225 * hot-adding a bitmap. It should
226 * eventually be settable by sysfs.
227 */
281 228
282 struct list_head all_mddevs; 229 struct list_head all_mddevs;
283}; 230};
@@ -314,6 +261,12 @@ struct mdk_personality_s
314 int (*resize) (mddev_t *mddev, sector_t sectors); 261 int (*resize) (mddev_t *mddev, sector_t sectors);
315 int (*reshape) (mddev_t *mddev, int raid_disks); 262 int (*reshape) (mddev_t *mddev, int raid_disks);
316 int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); 263 int (*reconfig) (mddev_t *mddev, int layout, int chunk_size);
264 /* quiesce moves between quiescence states
265 * 0 - fully active
266 * 1 - no new requests allowed
267 * others - reserved
268 */
269 void (*quiesce) (mddev_t *mddev, int state);
317}; 270};
318 271
319 272
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index dc65cd435494..c100fa5d4bfa 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -79,6 +79,11 @@
79#define MD_DISK_SYNC 2 /* disk is in sync with the raid set */ 79#define MD_DISK_SYNC 2 /* disk is in sync with the raid set */
80#define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */ 80#define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */
81 81
82#define MD_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config.
83 * read requests will only be sent here in
84 * dire need
85 */
86
82typedef struct mdp_device_descriptor_s { 87typedef struct mdp_device_descriptor_s {
83 __u32 number; /* 0 Device number in the entire set */ 88 __u32 number; /* 0 Device number in the entire set */
84 __u32 major; /* 1 Device major number */ 89 __u32 major; /* 1 Device major number */
@@ -193,7 +198,7 @@ struct mdp_superblock_1 {
193 198
194 __u64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/ 199 __u64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
195 __u32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */ 200 __u32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */
196 __u32 layout; /* only for raid5 currently */ 201 __u32 layout; /* only for raid5 and raid10 currently */
197 __u64 size; /* used size of component devices, in 512byte sectors */ 202 __u64 size; /* used size of component devices, in 512byte sectors */
198 203
199 __u32 chunksize; /* in 512byte sectors */ 204 __u32 chunksize; /* in 512byte sectors */
@@ -212,7 +217,9 @@ struct mdp_superblock_1 {
212 __u32 dev_number; /* permanent identifier of this device - not role in raid */ 217 __u32 dev_number; /* permanent identifier of this device - not role in raid */
213 __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ 218 __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */
214 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ 219 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
215 __u8 pad2[64-56]; /* set to 0 when writing */ 220 __u8 devflags; /* per-device flags. Only one defined...*/
221#define WriteMostly1 1 /* mask for writemostly flag in above */
222 __u8 pad2[64-57]; /* set to 0 when writing */
216 223
217 /* array state information - 64 bytes */ 224 /* array state information - 64 bytes */
218 __u64 utime; /* 40 bits second, 24 btes microseconds */ 225 __u64 utime; /* 40 bits second, 24 btes microseconds */
@@ -231,5 +238,10 @@ struct mdp_superblock_1 {
231 __u16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ 238 __u16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
232}; 239};
233 240
241/* feature_map bits */
242#define MD_FEATURE_BITMAP_OFFSET 1
243
244#define MD_FEATURE_ALL 1
245
234#endif 246#endif
235 247
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index 9d93cf12e890..60e19b667548 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -80,6 +80,9 @@ struct r1bio_s {
80 atomic_t remaining; /* 'have we finished' count, 80 atomic_t remaining; /* 'have we finished' count,
81 * used from IRQ handlers 81 * used from IRQ handlers
82 */ 82 */
83 atomic_t behind_remaining; /* number of write-behind ios remaining
84 * in this BehindIO request
85 */
83 sector_t sector; 86 sector_t sector;
84 int sectors; 87 int sectors;
85 unsigned long state; 88 unsigned long state;
@@ -107,4 +110,14 @@ struct r1bio_s {
107#define R1BIO_Uptodate 0 110#define R1BIO_Uptodate 0
108#define R1BIO_IsSync 1 111#define R1BIO_IsSync 1
109#define R1BIO_Degraded 2 112#define R1BIO_Degraded 2
113#define R1BIO_BehindIO 3
114/* For write-behind requests, we call bi_end_io when
115 * the last non-write-behind device completes, providing
116 * any write was successful. Otherwise we call when
117 * any write-behind write succeeds, otherwise we call
118 * with failure when last write completes (and all failed).
119 * Record that bi_end_io was called with this flag...
120 */
121#define R1BIO_Returned 4
122
110#endif 123#endif
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index d63ddcb4afad..176fc653c284 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -134,6 +134,7 @@ struct stripe_head {
134 unsigned long state; /* state flags */ 134 unsigned long state; /* state flags */
135 atomic_t count; /* nr of active thread/requests */ 135 atomic_t count; /* nr of active thread/requests */
136 spinlock_t lock; 136 spinlock_t lock;
137 int bm_seq; /* sequence number for bitmap flushes */
137 struct r5dev { 138 struct r5dev {
138 struct bio req; 139 struct bio req;
139 struct bio_vec vec; 140 struct bio_vec vec;
@@ -165,12 +166,13 @@ struct stripe_head {
165/* 166/*
166 * Stripe state 167 * Stripe state
167 */ 168 */
168#define STRIPE_ERROR 1
169#define STRIPE_HANDLE 2 169#define STRIPE_HANDLE 2
170#define STRIPE_SYNCING 3 170#define STRIPE_SYNCING 3
171#define STRIPE_INSYNC 4 171#define STRIPE_INSYNC 4
172#define STRIPE_PREREAD_ACTIVE 5 172#define STRIPE_PREREAD_ACTIVE 5
173#define STRIPE_DELAYED 6 173#define STRIPE_DELAYED 6
174#define STRIPE_DEGRADED 7
175#define STRIPE_BIT_DELAY 8
174 176
175/* 177/*
176 * Plugging: 178 * Plugging:
@@ -210,10 +212,20 @@ struct raid5_private_data {
210 212
211 struct list_head handle_list; /* stripes needing handling */ 213 struct list_head handle_list; /* stripes needing handling */
212 struct list_head delayed_list; /* stripes that have plugged requests */ 214 struct list_head delayed_list; /* stripes that have plugged requests */
215 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */
213 atomic_t preread_active_stripes; /* stripes with scheduled io */ 216 atomic_t preread_active_stripes; /* stripes with scheduled io */
214 217
215 char cache_name[20]; 218 char cache_name[20];
216 kmem_cache_t *slab_cache; /* for allocating stripes */ 219 kmem_cache_t *slab_cache; /* for allocating stripes */
220
221 int seq_flush, seq_write;
222 int quiesce;
223
224 int fullsync; /* set to 1 if a full sync is needed,
225 * (fresh device added).
226 * Cleared when a sync completes.
227 */
228
217 /* 229 /*
218 * Free stripes pool 230 * Free stripes pool
219 */ 231 */
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
new file mode 100644
index 000000000000..a71123c28272
--- /dev/null
+++ b/include/linux/raid_class.h
@@ -0,0 +1,59 @@
1/*
2 */
3#include <linux/transport_class.h>
4
5struct raid_template {
6 struct transport_container raid_attrs;
7};
8
9struct raid_function_template {
10 void *cookie;
11 int (*is_raid)(struct device *);
12 void (*get_resync)(struct device *);
13 void (*get_state)(struct device *);
14};
15
16enum raid_state {
17 RAID_ACTIVE = 1,
18 RAID_DEGRADED,
19 RAID_RESYNCING,
20 RAID_OFFLINE,
21};
22
23struct raid_data {
24 struct list_head component_list;
25 int component_count;
26 int level;
27 enum raid_state state;
28 int resync;
29};
30
31#define DEFINE_RAID_ATTRIBUTE(type, attr) \
32static inline void \
33raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \
34 struct class_device *cdev = \
35 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
36 struct raid_data *rd; \
37 BUG_ON(!cdev); \
38 rd = class_get_devdata(cdev); \
39 rd->attr = value; \
40} \
41static inline type \
42raid_get_##attr(struct raid_template *r, struct device *dev) { \
43 struct class_device *cdev = \
44 attribute_container_find_class_device(&r->raid_attrs.ac, dev);\
45 struct raid_data *rd; \
46 BUG_ON(!cdev); \
47 rd = class_get_devdata(cdev); \
48 return rd->attr; \
49}
50
51DEFINE_RAID_ATTRIBUTE(int, level)
52DEFINE_RAID_ATTRIBUTE(int, resync)
53DEFINE_RAID_ATTRIBUTE(enum raid_state, state)
54
55struct raid_template *raid_class_attach(struct raid_function_template *);
56void raid_class_release(struct raid_template *);
57
58void raid_component_add(struct raid_template *, struct device *,
59 struct device *);
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index fd276adf0fd5..4e65eb44adfd 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -52,8 +52,8 @@ struct rcu_head {
52 void (*func)(struct rcu_head *head); 52 void (*func)(struct rcu_head *head);
53}; 53};
54 54
55#define RCU_HEAD_INIT(head) { .next = NULL, .func = NULL } 55#define RCU_HEAD_INIT { .next = NULL, .func = NULL }
56#define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT(head) 56#define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT
57#define INIT_RCU_HEAD(ptr) do { \ 57#define INIT_RCU_HEAD(ptr) do { \
58 (ptr)->next = NULL; (ptr)->func = NULL; \ 58 (ptr)->next = NULL; (ptr)->func = NULL; \
59} while (0) 59} while (0)
diff --git a/include/linux/rcuref.h b/include/linux/rcuref.h
new file mode 100644
index 000000000000..e1adbba14b67
--- /dev/null
+++ b/include/linux/rcuref.h
@@ -0,0 +1,220 @@
1/*
2 * rcuref.h
3 *
4 * Reference counting for elements of lists/arrays protected by
5 * RCU.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 * Copyright (C) IBM Corporation, 2005
22 *
23 * Author: Dipankar Sarma <dipankar@in.ibm.com>
24 * Ravikiran Thirumalai <kiran_th@gmail.com>
25 *
26 * See Documentation/RCU/rcuref.txt for detailed user guide.
27 *
28 */
29
30#ifndef _RCUREF_H_
31#define _RCUREF_H_
32
33#ifdef __KERNEL__
34
35#include <linux/types.h>
36#include <linux/interrupt.h>
37#include <linux/spinlock.h>
38#include <asm/atomic.h>
39
40/*
41 * These APIs work on traditional atomic_t counters used in the
42 * kernel for reference counting. Under special circumstances
43 * where a lock-free get() operation races with a put() operation
44 * these APIs can be used. See Documentation/RCU/rcuref.txt.
45 */
46
47#ifdef __HAVE_ARCH_CMPXCHG
48
49/**
50 * rcuref_inc - increment refcount for object.
51 * @rcuref: reference counter in the object in question.
52 *
53 * This should be used only for objects where we use RCU and
54 * use the rcuref_inc_lf() api to acquire a reference
55 * in a lock-free reader-side critical section.
56 */
57static inline void rcuref_inc(atomic_t *rcuref)
58{
59 atomic_inc(rcuref);
60}
61
62/**
63 * rcuref_dec - decrement refcount for object.
64 * @rcuref: reference counter in the object in question.
65 *
66 * This should be used only for objects where we use RCU and
67 * use the rcuref_inc_lf() api to acquire a reference
68 * in a lock-free reader-side critical section.
69 */
70static inline void rcuref_dec(atomic_t *rcuref)
71{
72 atomic_dec(rcuref);
73}
74
75/**
76 * rcuref_dec_and_test - decrement refcount for object and test
77 * @rcuref: reference counter in the object.
78 * @release: pointer to the function that will clean up the object
79 * when the last reference to the object is released.
80 * This pointer is required.
81 *
82 * Decrement the refcount, and if 0, return 1. Else return 0.
83 *
84 * This should be used only for objects where we use RCU and
85 * use the rcuref_inc_lf() api to acquire a reference
86 * in a lock-free reader-side critical section.
87 */
88static inline int rcuref_dec_and_test(atomic_t *rcuref)
89{
90 return atomic_dec_and_test(rcuref);
91}
92
93/*
94 * cmpxchg is needed on UP too, if deletions to the list/array can happen
95 * in interrupt context.
96 */
97
98/**
99 * rcuref_inc_lf - Take reference to an object in a read-side
100 * critical section protected by RCU.
101 * @rcuref: reference counter in the object in question.
102 *
103 * Try and increment the refcount by 1. The increment might fail if
104 * the reference counter has been through a 1 to 0 transition and
105 * is no longer part of the lock-free list.
106 * Returns non-zero on successful increment and zero otherwise.
107 */
108static inline int rcuref_inc_lf(atomic_t *rcuref)
109{
110 int c, old;
111 c = atomic_read(rcuref);
112 while (c && (old = cmpxchg(&rcuref->counter, c, c + 1)) != c)
113 c = old;
114 return c;
115}
116
117#else /* !__HAVE_ARCH_CMPXCHG */
118
119extern spinlock_t __rcuref_hash[];
120
121/*
122 * Use a hash table of locks to protect the reference count
123 * since cmpxchg is not available in this arch.
124 */
125#ifdef CONFIG_SMP
126#define RCUREF_HASH_SIZE 4
127#define RCUREF_HASH(k) \
128 (&__rcuref_hash[(((unsigned long)k)>>8) & (RCUREF_HASH_SIZE-1)])
129#else
130#define RCUREF_HASH_SIZE 1
131#define RCUREF_HASH(k) &__rcuref_hash[0]
132#endif /* CONFIG_SMP */
133
134/**
135 * rcuref_inc - increment refcount for object.
136 * @rcuref: reference counter in the object in question.
137 *
138 * This should be used only for objects where we use RCU and
139 * use the rcuref_inc_lf() api to acquire a reference in a lock-free
140 * reader-side critical section.
141 */
142static inline void rcuref_inc(atomic_t *rcuref)
143{
144 unsigned long flags;
145 spin_lock_irqsave(RCUREF_HASH(rcuref), flags);
146 rcuref->counter += 1;
147 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
148}
149
150/**
151 * rcuref_dec - decrement refcount for object.
152 * @rcuref: reference counter in the object in question.
153 *
154 * This should be used only for objects where we use RCU and
155 * use the rcuref_inc_lf() api to acquire a reference in a lock-free
156 * reader-side critical section.
157 */
158static inline void rcuref_dec(atomic_t *rcuref)
159{
160 unsigned long flags;
161 spin_lock_irqsave(RCUREF_HASH(rcuref), flags);
162 rcuref->counter -= 1;
163 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
164}
165
166/**
167 * rcuref_dec_and_test - decrement refcount for object and test
168 * @rcuref: reference counter in the object.
169 * @release: pointer to the function that will clean up the object
170 * when the last reference to the object is released.
171 * This pointer is required.
172 *
173 * Decrement the refcount, and if 0, return 1. Else return 0.
174 *
175 * This should be used only for objects where we use RCU and
176 * use the rcuref_inc_lf() api to acquire a reference in a lock-free
177 * reader-side critical section.
178 */
179static inline int rcuref_dec_and_test(atomic_t *rcuref)
180{
181 unsigned long flags;
182 spin_lock_irqsave(RCUREF_HASH(rcuref), flags);
183 rcuref->counter--;
184 if (!rcuref->counter) {
185 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
186 return 1;
187 } else {
188 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
189 return 0;
190 }
191}
192
193/**
194 * rcuref_inc_lf - Take reference to an object of a lock-free collection
195 * by traversing a lock-free list/array.
196 * @rcuref: reference counter in the object in question.
197 *
198 * Try and increment the refcount by 1. The increment might fail if
199 * the reference counter has been through a 1 to 0 transition and
200 * object is no longer part of the lock-free list.
201 * Returns non-zero on successful increment and zero otherwise.
202 */
203static inline int rcuref_inc_lf(atomic_t *rcuref)
204{
205 int ret;
206 unsigned long flags;
207 spin_lock_irqsave(RCUREF_HASH(rcuref), flags);
208 if (rcuref->counter)
209 ret = rcuref->counter++;
210 else
211 ret = 0;
212 spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags);
213 return ret;
214}
215
216
217#endif /* !__HAVE_ARCH_CMPXCHG */
218
219#endif /* __KERNEL__ */
220#endif /* _RCUREF_H_ */
diff --git a/include/linux/relayfs_fs.h b/include/linux/relayfs_fs.h
new file mode 100644
index 000000000000..cfafc3e76bc2
--- /dev/null
+++ b/include/linux/relayfs_fs.h
@@ -0,0 +1,255 @@
1/*
2 * linux/include/linux/relayfs_fs.h
3 *
4 * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp
5 * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com)
6 *
7 * RelayFS definitions and declarations
8 */
9
10#ifndef _LINUX_RELAYFS_FS_H
11#define _LINUX_RELAYFS_FS_H
12
13#include <linux/config.h>
14#include <linux/types.h>
15#include <linux/sched.h>
16#include <linux/wait.h>
17#include <linux/list.h>
18#include <linux/fs.h>
19#include <linux/poll.h>
20#include <linux/kref.h>
21
22/*
23 * Tracks changes to rchan_buf struct
24 */
25#define RELAYFS_CHANNEL_VERSION 5
26
27/*
28 * Per-cpu relay channel buffer
29 */
30struct rchan_buf
31{
32 void *start; /* start of channel buffer */
33 void *data; /* start of current sub-buffer */
34 size_t offset; /* current offset into sub-buffer */
35 size_t subbufs_produced; /* count of sub-buffers produced */
36 size_t subbufs_consumed; /* count of sub-buffers consumed */
37 struct rchan *chan; /* associated channel */
38 wait_queue_head_t read_wait; /* reader wait queue */
39 struct work_struct wake_readers; /* reader wake-up work struct */
40 struct dentry *dentry; /* channel file dentry */
41 struct kref kref; /* channel buffer refcount */
42 struct page **page_array; /* array of current buffer pages */
43 unsigned int page_count; /* number of current buffer pages */
44 unsigned int finalized; /* buffer has been finalized */
45 size_t *padding; /* padding counts per sub-buffer */
46 size_t prev_padding; /* temporary variable */
47 size_t bytes_consumed; /* bytes consumed in cur read subbuf */
48 unsigned int cpu; /* this buf's cpu */
49} ____cacheline_aligned;
50
51/*
52 * Relay channel data structure
53 */
54struct rchan
55{
56 u32 version; /* the version of this struct */
57 size_t subbuf_size; /* sub-buffer size */
58 size_t n_subbufs; /* number of sub-buffers per buffer */
59 size_t alloc_size; /* total buffer size allocated */
60 struct rchan_callbacks *cb; /* client callbacks */
61 struct kref kref; /* channel refcount */
62 void *private_data; /* for user-defined data */
63 struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */
64};
65
66/*
67 * Relayfs inode
68 */
69struct relayfs_inode_info
70{
71 struct inode vfs_inode;
72 struct rchan_buf *buf;
73};
74
75static inline struct relayfs_inode_info *RELAYFS_I(struct inode *inode)
76{
77 return container_of(inode, struct relayfs_inode_info, vfs_inode);
78}
79
80/*
81 * Relay channel client callbacks
82 */
83struct rchan_callbacks
84{
85 /*
86 * subbuf_start - called on buffer-switch to a new sub-buffer
87 * @buf: the channel buffer containing the new sub-buffer
88 * @subbuf: the start of the new sub-buffer
89 * @prev_subbuf: the start of the previous sub-buffer
90 * @prev_padding: unused space at the end of previous sub-buffer
91 *
92 * The client should return 1 to continue logging, 0 to stop
93 * logging.
94 *
95 * NOTE: subbuf_start will also be invoked when the buffer is
96 * created, so that the first sub-buffer can be initialized
97 * if necessary. In this case, prev_subbuf will be NULL.
98 *
99 * NOTE: the client can reserve bytes at the beginning of the new
100 * sub-buffer by calling subbuf_start_reserve() in this callback.
101 */
102 int (*subbuf_start) (struct rchan_buf *buf,
103 void *subbuf,
104 void *prev_subbuf,
105 size_t prev_padding);
106
107 /*
108 * buf_mapped - relayfs buffer mmap notification
109 * @buf: the channel buffer
110 * @filp: relayfs file pointer
111 *
112 * Called when a relayfs file is successfully mmapped
113 */
114 void (*buf_mapped)(struct rchan_buf *buf,
115 struct file *filp);
116
117 /*
118 * buf_unmapped - relayfs buffer unmap notification
119 * @buf: the channel buffer
120 * @filp: relayfs file pointer
121 *
122 * Called when a relayfs file is successfully unmapped
123 */
124 void (*buf_unmapped)(struct rchan_buf *buf,
125 struct file *filp);
126};
127
128/*
129 * relayfs kernel API, fs/relayfs/relay.c
130 */
131
132struct rchan *relay_open(const char *base_filename,
133 struct dentry *parent,
134 size_t subbuf_size,
135 size_t n_subbufs,
136 struct rchan_callbacks *cb);
137extern void relay_close(struct rchan *chan);
138extern void relay_flush(struct rchan *chan);
139extern void relay_subbufs_consumed(struct rchan *chan,
140 unsigned int cpu,
141 size_t consumed);
142extern void relay_reset(struct rchan *chan);
143extern int relay_buf_full(struct rchan_buf *buf);
144
145extern size_t relay_switch_subbuf(struct rchan_buf *buf,
146 size_t length);
147extern struct dentry *relayfs_create_dir(const char *name,
148 struct dentry *parent);
149extern int relayfs_remove_dir(struct dentry *dentry);
150
151/**
152 * relay_write - write data into the channel
153 * @chan: relay channel
154 * @data: data to be written
155 * @length: number of bytes to write
156 *
157 * Writes data into the current cpu's channel buffer.
158 *
159 * Protects the buffer by disabling interrupts. Use this
160 * if you might be logging from interrupt context. Try
161 * __relay_write() if you know you won't be logging from
162 * interrupt context.
163 */
164static inline void relay_write(struct rchan *chan,
165 const void *data,
166 size_t length)
167{
168 unsigned long flags;
169 struct rchan_buf *buf;
170
171 local_irq_save(flags);
172 buf = chan->buf[smp_processor_id()];
173 if (unlikely(buf->offset + length > chan->subbuf_size))
174 length = relay_switch_subbuf(buf, length);
175 memcpy(buf->data + buf->offset, data, length);
176 buf->offset += length;
177 local_irq_restore(flags);
178}
179
180/**
181 * __relay_write - write data into the channel
182 * @chan: relay channel
183 * @data: data to be written
184 * @length: number of bytes to write
185 *
186 * Writes data into the current cpu's channel buffer.
187 *
188 * Protects the buffer by disabling preemption. Use
189 * relay_write() if you might be logging from interrupt
190 * context.
191 */
192static inline void __relay_write(struct rchan *chan,
193 const void *data,
194 size_t length)
195{
196 struct rchan_buf *buf;
197
198 buf = chan->buf[get_cpu()];
199 if (unlikely(buf->offset + length > buf->chan->subbuf_size))
200 length = relay_switch_subbuf(buf, length);
201 memcpy(buf->data + buf->offset, data, length);
202 buf->offset += length;
203 put_cpu();
204}
205
206/**
207 * relay_reserve - reserve slot in channel buffer
208 * @chan: relay channel
209 * @length: number of bytes to reserve
210 *
211 * Returns pointer to reserved slot, NULL if full.
212 *
213 * Reserves a slot in the current cpu's channel buffer.
214 * Does not protect the buffer at all - caller must provide
215 * appropriate synchronization.
216 */
217static inline void *relay_reserve(struct rchan *chan, size_t length)
218{
219 void *reserved;
220 struct rchan_buf *buf = chan->buf[smp_processor_id()];
221
222 if (unlikely(buf->offset + length > buf->chan->subbuf_size)) {
223 length = relay_switch_subbuf(buf, length);
224 if (!length)
225 return NULL;
226 }
227 reserved = buf->data + buf->offset;
228 buf->offset += length;
229
230 return reserved;
231}
232
233/**
234 * subbuf_start_reserve - reserve bytes at the start of a sub-buffer
235 * @buf: relay channel buffer
236 * @length: number of bytes to reserve
237 *
238 * Helper function used to reserve bytes at the beginning of
239 * a sub-buffer in the subbuf_start() callback.
240 */
241static inline void subbuf_start_reserve(struct rchan_buf *buf,
242 size_t length)
243{
244 BUG_ON(length >= buf->chan->subbuf_size - 1);
245 buf->offset = length;
246}
247
248/*
249 * exported relayfs file operations, fs/relayfs/inode.c
250 */
251
252extern struct file_operations relayfs_file_operations;
253
254#endif /* _LINUX_RELAYFS_FS_H */
255
diff --git a/include/linux/sched.h b/include/linux/sched.h
index dec5827c7742..c551e6a1447e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -35,6 +35,8 @@
35#include <linux/topology.h> 35#include <linux/topology.h>
36#include <linux/seccomp.h> 36#include <linux/seccomp.h>
37 37
38#include <linux/auxvec.h> /* For AT_VECTOR_SIZE */
39
38struct exec_domain; 40struct exec_domain;
39 41
40/* 42/*
@@ -176,6 +178,23 @@ extern void trap_init(void);
176extern void update_process_times(int user); 178extern void update_process_times(int user);
177extern void scheduler_tick(void); 179extern void scheduler_tick(void);
178 180
181#ifdef CONFIG_DETECT_SOFTLOCKUP
182extern void softlockup_tick(struct pt_regs *regs);
183extern void spawn_softlockup_task(void);
184extern void touch_softlockup_watchdog(void);
185#else
186static inline void softlockup_tick(struct pt_regs *regs)
187{
188}
189static inline void spawn_softlockup_task(void)
190{
191}
192static inline void touch_softlockup_watchdog(void)
193{
194}
195#endif
196
197
179/* Attach to any functions which should be ignored in wchan output. */ 198/* Attach to any functions which should be ignored in wchan output. */
180#define __sched __attribute__((__section__(".sched.text"))) 199#define __sched __attribute__((__section__(".sched.text")))
181/* Is this address in the __sched functions? */ 200/* Is this address in the __sched functions? */
@@ -244,7 +263,7 @@ struct mm_struct {
244 mm_counter_t _rss; 263 mm_counter_t _rss;
245 mm_counter_t _anon_rss; 264 mm_counter_t _anon_rss;
246 265
247 unsigned long saved_auxv[42]; /* for /proc/PID/auxv */ 266 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
248 267
249 unsigned dumpable:2; 268 unsigned dumpable:2;
250 cpumask_t cpu_vm_mask; 269 cpumask_t cpu_vm_mask;
@@ -545,13 +564,6 @@ struct sched_domain {
545 564
546extern void partition_sched_domains(cpumask_t *partition1, 565extern void partition_sched_domains(cpumask_t *partition1,
547 cpumask_t *partition2); 566 cpumask_t *partition2);
548#ifdef ARCH_HAS_SCHED_DOMAIN
549/* Useful helpers that arch setup code may use. Defined in kernel/sched.c */
550extern cpumask_t cpu_isolated_map;
551extern void init_sched_build_groups(struct sched_group groups[],
552 cpumask_t span, int (*group_fn)(int cpu));
553extern void cpu_attach_domain(struct sched_domain *sd, int cpu);
554#endif /* ARCH_HAS_SCHED_DOMAIN */
555#endif /* CONFIG_SMP */ 567#endif /* CONFIG_SMP */
556 568
557 569
@@ -592,6 +604,11 @@ extern int groups_search(struct group_info *group_info, gid_t grp);
592#define GROUP_AT(gi, i) \ 604#define GROUP_AT(gi, i) \
593 ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) 605 ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK])
594 606
607#ifdef ARCH_HAS_PREFETCH_SWITCH_STACK
608extern void prefetch_stack(struct task_struct*);
609#else
610static inline void prefetch_stack(struct task_struct *t) { }
611#endif
595 612
596struct audit_context; /* See audit.c */ 613struct audit_context; /* See audit.c */
597struct mempolicy; 614struct mempolicy;
diff --git a/include/linux/security.h b/include/linux/security.h
index 7aab6ab7c57f..55b02e1c73f4 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -250,29 +250,37 @@ struct swap_info_struct;
250 * @inode contains the inode structure. 250 * @inode contains the inode structure.
251 * Deallocate the inode security structure and set @inode->i_security to 251 * Deallocate the inode security structure and set @inode->i_security to
252 * NULL. 252 * NULL.
253 * @inode_init_security:
254 * Obtain the security attribute name suffix and value to set on a newly
255 * created inode and set up the incore security field for the new inode.
256 * This hook is called by the fs code as part of the inode creation
257 * transaction and provides for atomic labeling of the inode, unlike
258 * the post_create/mkdir/... hooks called by the VFS. The hook function
259 * is expected to allocate the name and value via kmalloc, with the caller
260 * being responsible for calling kfree after using them.
261 * If the security module does not use security attributes or does
262 * not wish to put a security attribute on this particular inode,
263 * then it should return -EOPNOTSUPP to skip this processing.
264 * @inode contains the inode structure of the newly created inode.
265 * @dir contains the inode structure of the parent directory.
266 * @name will be set to the allocated name suffix (e.g. selinux).
267 * @value will be set to the allocated attribute value.
268 * @len will be set to the length of the value.
269 * Returns 0 if @name and @value have been successfully set,
270 * -EOPNOTSUPP if no security attribute is needed, or
271 * -ENOMEM on memory allocation failure.
253 * @inode_create: 272 * @inode_create:
254 * Check permission to create a regular file. 273 * Check permission to create a regular file.
255 * @dir contains inode structure of the parent of the new file. 274 * @dir contains inode structure of the parent of the new file.
256 * @dentry contains the dentry structure for the file to be created. 275 * @dentry contains the dentry structure for the file to be created.
257 * @mode contains the file mode of the file to be created. 276 * @mode contains the file mode of the file to be created.
258 * Return 0 if permission is granted. 277 * Return 0 if permission is granted.
259 * @inode_post_create:
260 * Set the security attributes on a newly created regular file. This hook
261 * is called after a file has been successfully created.
262 * @dir contains the inode structure of the parent directory of the new file.
263 * @dentry contains the the dentry structure for the newly created file.
264 * @mode contains the file mode.
265 * @inode_link: 278 * @inode_link:
266 * Check permission before creating a new hard link to a file. 279 * Check permission before creating a new hard link to a file.
267 * @old_dentry contains the dentry structure for an existing link to the file. 280 * @old_dentry contains the dentry structure for an existing link to the file.
268 * @dir contains the inode structure of the parent directory of the new link. 281 * @dir contains the inode structure of the parent directory of the new link.
269 * @new_dentry contains the dentry structure for the new link. 282 * @new_dentry contains the dentry structure for the new link.
270 * Return 0 if permission is granted. 283 * Return 0 if permission is granted.
271 * @inode_post_link:
272 * Set security attributes for a new hard link to a file.
273 * @old_dentry contains the dentry structure for the existing link.
274 * @dir contains the inode structure of the parent directory of the new file.
275 * @new_dentry contains the dentry structure for the new file link.
276 * @inode_unlink: 284 * @inode_unlink:
277 * Check the permission to remove a hard link to a file. 285 * Check the permission to remove a hard link to a file.
278 * @dir contains the inode structure of parent directory of the file. 286 * @dir contains the inode structure of parent directory of the file.
@@ -284,13 +292,6 @@ struct swap_info_struct;
284 * @dentry contains the dentry structure of the symbolic link. 292 * @dentry contains the dentry structure of the symbolic link.
285 * @old_name contains the pathname of file. 293 * @old_name contains the pathname of file.
286 * Return 0 if permission is granted. 294 * Return 0 if permission is granted.
287 * @inode_post_symlink:
288 * @dir contains the inode structure of the parent directory of the new link.
289 * @dentry contains the dentry structure of new symbolic link.
290 * @old_name contains the pathname of file.
291 * Set security attributes for a newly created symbolic link. Note that
292 * @dentry->d_inode may be NULL, since the filesystem might not
293 * instantiate the dentry (e.g. NFS).
294 * @inode_mkdir: 295 * @inode_mkdir:
295 * Check permissions to create a new directory in the existing directory 296 * Check permissions to create a new directory in the existing directory
296 * associated with inode strcture @dir. 297 * associated with inode strcture @dir.
@@ -298,11 +299,6 @@ struct swap_info_struct;
298 * @dentry contains the dentry structure of new directory. 299 * @dentry contains the dentry structure of new directory.
299 * @mode contains the mode of new directory. 300 * @mode contains the mode of new directory.
300 * Return 0 if permission is granted. 301 * Return 0 if permission is granted.
301 * @inode_post_mkdir:
302 * Set security attributes on a newly created directory.
303 * @dir contains the inode structure of parent of the directory to be created.
304 * @dentry contains the dentry structure of new directory.
305 * @mode contains the mode of new directory.
306 * @inode_rmdir: 302 * @inode_rmdir:
307 * Check the permission to remove a directory. 303 * Check the permission to remove a directory.
308 * @dir contains the inode structure of parent of the directory to be removed. 304 * @dir contains the inode structure of parent of the directory to be removed.
@@ -318,13 +314,6 @@ struct swap_info_struct;
318 * @mode contains the mode of the new file. 314 * @mode contains the mode of the new file.
319 * @dev contains the the device number. 315 * @dev contains the the device number.
320 * Return 0 if permission is granted. 316 * Return 0 if permission is granted.
321 * @inode_post_mknod:
322 * Set security attributes on a newly created special file (or socket or
323 * fifo file created via the mknod system call).
324 * @dir contains the inode structure of parent of the new node.
325 * @dentry contains the dentry structure of the new node.
326 * @mode contains the mode of the new node.
327 * @dev contains the the device number.
328 * @inode_rename: 317 * @inode_rename:
329 * Check for permission to rename a file or directory. 318 * Check for permission to rename a file or directory.
330 * @old_dir contains the inode structure for parent of the old link. 319 * @old_dir contains the inode structure for parent of the old link.
@@ -332,12 +321,6 @@ struct swap_info_struct;
332 * @new_dir contains the inode structure for parent of the new link. 321 * @new_dir contains the inode structure for parent of the new link.
333 * @new_dentry contains the dentry structure of the new link. 322 * @new_dentry contains the dentry structure of the new link.
334 * Return 0 if permission is granted. 323 * Return 0 if permission is granted.
335 * @inode_post_rename:
336 * Set security attributes on a renamed file or directory.
337 * @old_dir contains the inode structure for parent of the old link.
338 * @old_dentry contains the dentry structure of the old link.
339 * @new_dir contains the inode structure for parent of the new link.
340 * @new_dentry contains the dentry structure of the new link.
341 * @inode_readlink: 324 * @inode_readlink:
342 * Check the permission to read the symbolic link. 325 * Check the permission to read the symbolic link.
343 * @dentry contains the dentry structure for the file link. 326 * @dentry contains the dentry structure for the file link.
@@ -1080,34 +1063,21 @@ struct security_operations {
1080 1063
1081 int (*inode_alloc_security) (struct inode *inode); 1064 int (*inode_alloc_security) (struct inode *inode);
1082 void (*inode_free_security) (struct inode *inode); 1065 void (*inode_free_security) (struct inode *inode);
1066 int (*inode_init_security) (struct inode *inode, struct inode *dir,
1067 char **name, void **value, size_t *len);
1083 int (*inode_create) (struct inode *dir, 1068 int (*inode_create) (struct inode *dir,
1084 struct dentry *dentry, int mode); 1069 struct dentry *dentry, int mode);
1085 void (*inode_post_create) (struct inode *dir,
1086 struct dentry *dentry, int mode);
1087 int (*inode_link) (struct dentry *old_dentry, 1070 int (*inode_link) (struct dentry *old_dentry,
1088 struct inode *dir, struct dentry *new_dentry); 1071 struct inode *dir, struct dentry *new_dentry);
1089 void (*inode_post_link) (struct dentry *old_dentry,
1090 struct inode *dir, struct dentry *new_dentry);
1091 int (*inode_unlink) (struct inode *dir, struct dentry *dentry); 1072 int (*inode_unlink) (struct inode *dir, struct dentry *dentry);
1092 int (*inode_symlink) (struct inode *dir, 1073 int (*inode_symlink) (struct inode *dir,
1093 struct dentry *dentry, const char *old_name); 1074 struct dentry *dentry, const char *old_name);
1094 void (*inode_post_symlink) (struct inode *dir,
1095 struct dentry *dentry,
1096 const char *old_name);
1097 int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, int mode); 1075 int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, int mode);
1098 void (*inode_post_mkdir) (struct inode *dir, struct dentry *dentry,
1099 int mode);
1100 int (*inode_rmdir) (struct inode *dir, struct dentry *dentry); 1076 int (*inode_rmdir) (struct inode *dir, struct dentry *dentry);
1101 int (*inode_mknod) (struct inode *dir, struct dentry *dentry, 1077 int (*inode_mknod) (struct inode *dir, struct dentry *dentry,
1102 int mode, dev_t dev); 1078 int mode, dev_t dev);
1103 void (*inode_post_mknod) (struct inode *dir, struct dentry *dentry,
1104 int mode, dev_t dev);
1105 int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry, 1079 int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry,
1106 struct inode *new_dir, struct dentry *new_dentry); 1080 struct inode *new_dir, struct dentry *new_dentry);
1107 void (*inode_post_rename) (struct inode *old_dir,
1108 struct dentry *old_dentry,
1109 struct inode *new_dir,
1110 struct dentry *new_dentry);
1111 int (*inode_readlink) (struct dentry *dentry); 1081 int (*inode_readlink) (struct dentry *dentry);
1112 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); 1082 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
1113 int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd); 1083 int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd);
@@ -1442,6 +1412,17 @@ static inline void security_inode_free (struct inode *inode)
1442 return; 1412 return;
1443 security_ops->inode_free_security (inode); 1413 security_ops->inode_free_security (inode);
1444} 1414}
1415
1416static inline int security_inode_init_security (struct inode *inode,
1417 struct inode *dir,
1418 char **name,
1419 void **value,
1420 size_t *len)
1421{
1422 if (unlikely (IS_PRIVATE (inode)))
1423 return -EOPNOTSUPP;
1424 return security_ops->inode_init_security (inode, dir, name, value, len);
1425}
1445 1426
1446static inline int security_inode_create (struct inode *dir, 1427static inline int security_inode_create (struct inode *dir,
1447 struct dentry *dentry, 1428 struct dentry *dentry,
@@ -1452,15 +1433,6 @@ static inline int security_inode_create (struct inode *dir,
1452 return security_ops->inode_create (dir, dentry, mode); 1433 return security_ops->inode_create (dir, dentry, mode);
1453} 1434}
1454 1435
1455static inline void security_inode_post_create (struct inode *dir,
1456 struct dentry *dentry,
1457 int mode)
1458{
1459 if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode)))
1460 return;
1461 security_ops->inode_post_create (dir, dentry, mode);
1462}
1463
1464static inline int security_inode_link (struct dentry *old_dentry, 1436static inline int security_inode_link (struct dentry *old_dentry,
1465 struct inode *dir, 1437 struct inode *dir,
1466 struct dentry *new_dentry) 1438 struct dentry *new_dentry)
@@ -1470,15 +1442,6 @@ static inline int security_inode_link (struct dentry *old_dentry,
1470 return security_ops->inode_link (old_dentry, dir, new_dentry); 1442 return security_ops->inode_link (old_dentry, dir, new_dentry);
1471} 1443}
1472 1444
1473static inline void security_inode_post_link (struct dentry *old_dentry,
1474 struct inode *dir,
1475 struct dentry *new_dentry)
1476{
1477 if (new_dentry->d_inode && unlikely (IS_PRIVATE (new_dentry->d_inode)))
1478 return;
1479 security_ops->inode_post_link (old_dentry, dir, new_dentry);
1480}
1481
1482static inline int security_inode_unlink (struct inode *dir, 1445static inline int security_inode_unlink (struct inode *dir,
1483 struct dentry *dentry) 1446 struct dentry *dentry)
1484{ 1447{
@@ -1496,15 +1459,6 @@ static inline int security_inode_symlink (struct inode *dir,
1496 return security_ops->inode_symlink (dir, dentry, old_name); 1459 return security_ops->inode_symlink (dir, dentry, old_name);
1497} 1460}
1498 1461
1499static inline void security_inode_post_symlink (struct inode *dir,
1500 struct dentry *dentry,
1501 const char *old_name)
1502{
1503 if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode)))
1504 return;
1505 security_ops->inode_post_symlink (dir, dentry, old_name);
1506}
1507
1508static inline int security_inode_mkdir (struct inode *dir, 1462static inline int security_inode_mkdir (struct inode *dir,
1509 struct dentry *dentry, 1463 struct dentry *dentry,
1510 int mode) 1464 int mode)
@@ -1514,15 +1468,6 @@ static inline int security_inode_mkdir (struct inode *dir,
1514 return security_ops->inode_mkdir (dir, dentry, mode); 1468 return security_ops->inode_mkdir (dir, dentry, mode);
1515} 1469}
1516 1470
1517static inline void security_inode_post_mkdir (struct inode *dir,
1518 struct dentry *dentry,
1519 int mode)
1520{
1521 if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode)))
1522 return;
1523 security_ops->inode_post_mkdir (dir, dentry, mode);
1524}
1525
1526static inline int security_inode_rmdir (struct inode *dir, 1471static inline int security_inode_rmdir (struct inode *dir,
1527 struct dentry *dentry) 1472 struct dentry *dentry)
1528{ 1473{
@@ -1540,15 +1485,6 @@ static inline int security_inode_mknod (struct inode *dir,
1540 return security_ops->inode_mknod (dir, dentry, mode, dev); 1485 return security_ops->inode_mknod (dir, dentry, mode, dev);
1541} 1486}
1542 1487
1543static inline void security_inode_post_mknod (struct inode *dir,
1544 struct dentry *dentry,
1545 int mode, dev_t dev)
1546{
1547 if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode)))
1548 return;
1549 security_ops->inode_post_mknod (dir, dentry, mode, dev);
1550}
1551
1552static inline int security_inode_rename (struct inode *old_dir, 1488static inline int security_inode_rename (struct inode *old_dir,
1553 struct dentry *old_dentry, 1489 struct dentry *old_dentry,
1554 struct inode *new_dir, 1490 struct inode *new_dir,
@@ -1561,18 +1497,6 @@ static inline int security_inode_rename (struct inode *old_dir,
1561 new_dir, new_dentry); 1497 new_dir, new_dentry);
1562} 1498}
1563 1499
1564static inline void security_inode_post_rename (struct inode *old_dir,
1565 struct dentry *old_dentry,
1566 struct inode *new_dir,
1567 struct dentry *new_dentry)
1568{
1569 if (unlikely (IS_PRIVATE (old_dentry->d_inode) ||
1570 (new_dentry->d_inode && IS_PRIVATE (new_dentry->d_inode))))
1571 return;
1572 security_ops->inode_post_rename (old_dir, old_dentry,
1573 new_dir, new_dentry);
1574}
1575
1576static inline int security_inode_readlink (struct dentry *dentry) 1500static inline int security_inode_readlink (struct dentry *dentry)
1577{ 1501{
1578 if (unlikely (IS_PRIVATE (dentry->d_inode))) 1502 if (unlikely (IS_PRIVATE (dentry->d_inode)))
@@ -2171,6 +2095,15 @@ static inline int security_inode_alloc (struct inode *inode)
2171 2095
2172static inline void security_inode_free (struct inode *inode) 2096static inline void security_inode_free (struct inode *inode)
2173{ } 2097{ }
2098
2099static inline int security_inode_init_security (struct inode *inode,
2100 struct inode *dir,
2101 char **name,
2102 void **value,
2103 size_t *len)
2104{
2105 return -EOPNOTSUPP;
2106}
2174 2107
2175static inline int security_inode_create (struct inode *dir, 2108static inline int security_inode_create (struct inode *dir,
2176 struct dentry *dentry, 2109 struct dentry *dentry,
@@ -2179,11 +2112,6 @@ static inline int security_inode_create (struct inode *dir,
2179 return 0; 2112 return 0;
2180} 2113}
2181 2114
2182static inline void security_inode_post_create (struct inode *dir,
2183 struct dentry *dentry,
2184 int mode)
2185{ }
2186
2187static inline int security_inode_link (struct dentry *old_dentry, 2115static inline int security_inode_link (struct dentry *old_dentry,
2188 struct inode *dir, 2116 struct inode *dir,
2189 struct dentry *new_dentry) 2117 struct dentry *new_dentry)
@@ -2191,11 +2119,6 @@ static inline int security_inode_link (struct dentry *old_dentry,
2191 return 0; 2119 return 0;
2192} 2120}
2193 2121
2194static inline void security_inode_post_link (struct dentry *old_dentry,
2195 struct inode *dir,
2196 struct dentry *new_dentry)
2197{ }
2198
2199static inline int security_inode_unlink (struct inode *dir, 2122static inline int security_inode_unlink (struct inode *dir,
2200 struct dentry *dentry) 2123 struct dentry *dentry)
2201{ 2124{
@@ -2209,11 +2132,6 @@ static inline int security_inode_symlink (struct inode *dir,
2209 return 0; 2132 return 0;
2210} 2133}
2211 2134
2212static inline void security_inode_post_symlink (struct inode *dir,
2213 struct dentry *dentry,
2214 const char *old_name)
2215{ }
2216
2217static inline int security_inode_mkdir (struct inode *dir, 2135static inline int security_inode_mkdir (struct inode *dir,
2218 struct dentry *dentry, 2136 struct dentry *dentry,
2219 int mode) 2137 int mode)
@@ -2221,11 +2139,6 @@ static inline int security_inode_mkdir (struct inode *dir,
2221 return 0; 2139 return 0;
2222} 2140}
2223 2141
2224static inline void security_inode_post_mkdir (struct inode *dir,
2225 struct dentry *dentry,
2226 int mode)
2227{ }
2228
2229static inline int security_inode_rmdir (struct inode *dir, 2142static inline int security_inode_rmdir (struct inode *dir,
2230 struct dentry *dentry) 2143 struct dentry *dentry)
2231{ 2144{
@@ -2239,11 +2152,6 @@ static inline int security_inode_mknod (struct inode *dir,
2239 return 0; 2152 return 0;
2240} 2153}
2241 2154
2242static inline void security_inode_post_mknod (struct inode *dir,
2243 struct dentry *dentry,
2244 int mode, dev_t dev)
2245{ }
2246
2247static inline int security_inode_rename (struct inode *old_dir, 2155static inline int security_inode_rename (struct inode *old_dir,
2248 struct dentry *old_dentry, 2156 struct dentry *old_dentry,
2249 struct inode *new_dir, 2157 struct inode *new_dir,
@@ -2252,12 +2160,6 @@ static inline int security_inode_rename (struct inode *old_dir,
2252 return 0; 2160 return 0;
2253} 2161}
2254 2162
2255static inline void security_inode_post_rename (struct inode *old_dir,
2256 struct dentry *old_dentry,
2257 struct inode *new_dir,
2258 struct dentry *new_dentry)
2259{ }
2260
2261static inline int security_inode_readlink (struct dentry *dentry) 2163static inline int security_inode_readlink (struct dentry *dentry)
2262{ 2164{
2263 return 0; 2165 return 0;
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 2d8516be9fd7..106f9757339a 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -88,6 +88,7 @@ struct sem {
88/* One sem_array data structure for each set of semaphores in the system. */ 88/* One sem_array data structure for each set of semaphores in the system. */
89struct sem_array { 89struct sem_array {
90 struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ 90 struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */
91 int sem_id;
91 time_t sem_otime; /* last semop time */ 92 time_t sem_otime; /* last semop time */
92 time_t sem_ctime; /* last change time */ 93 time_t sem_ctime; /* last change time */
93 struct sem *sem_base; /* ptr to first semaphore in array */ 94 struct sem *sem_base; /* ptr to first semaphore in array */
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index d8a023d804d4..317a979b24de 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -30,6 +30,21 @@ struct plat_serial8250_port {
30}; 30};
31 31
32/* 32/*
33 * Allocate 8250 platform device IDs. Nothing is implied by
34 * the numbering here, except for the legacy entry being -1.
35 */
36enum {
37 PLAT8250_DEV_LEGACY = -1,
38 PLAT8250_DEV_PLATFORM,
39 PLAT8250_DEV_PLATFORM1,
40 PLAT8250_DEV_FOURPORT,
41 PLAT8250_DEV_ACCENT,
42 PLAT8250_DEV_BOCA,
43 PLAT8250_DEV_HUB6,
44 PLAT8250_DEV_MCA,
45};
46
47/*
33 * This should be used by drivers which want to register 48 * This should be used by drivers which want to register
34 * their own 8250 ports without registering their own 49 * their own 8250 ports without registering their own
35 * platform device. Using these will make your driver 50 * platform device. Using these will make your driver
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index cf0f64ea2bc0..27db8da43aa4 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -385,11 +385,11 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
385/* 385/*
386 * The following are helper functions for the low level drivers. 386 * The following are helper functions for the low level drivers.
387 */ 387 */
388#ifdef SUPPORT_SYSRQ
389static inline int 388static inline int
390uart_handle_sysrq_char(struct uart_port *port, unsigned int ch, 389uart_handle_sysrq_char(struct uart_port *port, unsigned int ch,
391 struct pt_regs *regs) 390 struct pt_regs *regs)
392{ 391{
392#ifdef SUPPORT_SYSRQ
393 if (port->sysrq) { 393 if (port->sysrq) {
394 if (ch && time_before(jiffies, port->sysrq)) { 394 if (ch && time_before(jiffies, port->sysrq)) {
395 handle_sysrq(ch, regs, NULL); 395 handle_sysrq(ch, regs, NULL);
@@ -398,10 +398,11 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch,
398 } 398 }
399 port->sysrq = 0; 399 port->sysrq = 0;
400 } 400 }
401#endif
401 return 0; 402 return 0;
402} 403}
403#else 404#ifndef SUPPORT_SYSRQ
404#define uart_handle_sysrq_char(port,ch,regs) (0) 405#define uart_handle_sysrq_char(port,ch,regs) uart_handle_sysrq_char(port, 0, NULL)
405#endif 406#endif
406 407
407/* 408/*
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 42edce6abe23..2741c0c55e83 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1167,7 +1167,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
1167 1167
1168static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) 1168static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
1169{ 1169{
1170 if (len >= skb->len) 1170 if (likely(len >= skb->len))
1171 return 0; 1171 return 0;
1172 if (skb->ip_summed == CHECKSUM_HW) 1172 if (skb->ip_summed == CHECKSUM_HW)
1173 skb->ip_summed = CHECKSUM_NONE; 1173 skb->ip_summed = CHECKSUM_NONE;
@@ -1251,7 +1251,7 @@ extern void skb_add_mtu(int mtu);
1251 * This function converts the offset back to a struct timeval and stores 1251 * This function converts the offset back to a struct timeval and stores
1252 * it in stamp. 1252 * it in stamp.
1253 */ 1253 */
1254static inline void skb_get_timestamp(struct sk_buff *skb, struct timeval *stamp) 1254static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp)
1255{ 1255{
1256 stamp->tv_sec = skb->tstamp.off_sec; 1256 stamp->tv_sec = skb->tstamp.off_sec;
1257 stamp->tv_usec = skb->tstamp.off_usec; 1257 stamp->tv_usec = skb->tstamp.off_usec;
@@ -1270,7 +1270,7 @@ static inline void skb_get_timestamp(struct sk_buff *skb, struct timeval *stamp)
1270 * This function converts a struct timeval to an offset and stores 1270 * This function converts a struct timeval to an offset and stores
1271 * it in the skb. 1271 * it in the skb.
1272 */ 1272 */
1273static inline void skb_set_timestamp(struct sk_buff *skb, struct timeval *stamp) 1273static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp)
1274{ 1274{
1275 skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec; 1275 skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec;
1276 skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec; 1276 skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec;
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 80b2dfde2e80..42a6bea58af3 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -99,7 +99,21 @@ found:
99 return __kmalloc(size, flags); 99 return __kmalloc(size, flags);
100} 100}
101 101
102extern void *kcalloc(size_t, size_t, unsigned int __nocast); 102extern void *kzalloc(size_t, unsigned int __nocast);
103
104/**
105 * kcalloc - allocate memory for an array. The memory is set to zero.
106 * @n: number of elements.
107 * @size: element size.
108 * @flags: the type of memory to allocate.
109 */
110static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast flags)
111{
112 if (n != 0 && size > INT_MAX / n)
113 return NULL;
114 return kzalloc(n * size, flags);
115}
116
103extern void kfree(const void *); 117extern void kfree(const void *);
104extern unsigned int ksize(const void *); 118extern unsigned int ksize(const void *);
105 119
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index 768cbba617d0..f56d24734950 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -99,6 +99,8 @@
99#define SONYPI_EVENT_BATTERY_INSERT 57 99#define SONYPI_EVENT_BATTERY_INSERT 57
100#define SONYPI_EVENT_BATTERY_REMOVE 58 100#define SONYPI_EVENT_BATTERY_REMOVE 58
101#define SONYPI_EVENT_FNKEY_RELEASED 59 101#define SONYPI_EVENT_FNKEY_RELEASED 59
102#define SONYPI_EVENT_WIRELESS_ON 60
103#define SONYPI_EVENT_WIRELESS_OFF 61
102 104
103/* get/set brightness */ 105/* get/set brightness */
104#define SONYPI_IOCGBRT _IOR('v', 0, __u8) 106#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 6864063d1b9f..c4e3ea7cf154 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -60,6 +60,7 @@ struct cache_head {
60#define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ 60#define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */
61 61
62struct cache_detail { 62struct cache_detail {
63 struct module * owner;
63 int hash_size; 64 int hash_size;
64 struct cache_head ** hash_table; 65 struct cache_head ** hash_table;
65 rwlock_t hash_lock; 66 rwlock_t hash_lock;
diff --git a/include/linux/swap.h b/include/linux/swap.h
index bfe3e763ccf2..3c9ff0048153 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -107,6 +107,8 @@ enum {
107 SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ 107 SWP_USED = (1 << 0), /* is slot in swap_info[] used? */
108 SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ 108 SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */
109 SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), 109 SWP_ACTIVE = (SWP_USED | SWP_WRITEOK),
110 /* add others here before... */
111 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */
110}; 112};
111 113
112#define SWAP_CLUSTER_MAX 32 114#define SWAP_CLUSTER_MAX 32
@@ -116,16 +118,13 @@ enum {
116 118
117/* 119/*
118 * The in-memory structure used to track swap areas. 120 * The in-memory structure used to track swap areas.
119 * extent_list.prev points at the lowest-index extent. That list is
120 * sorted.
121 */ 121 */
122struct swap_info_struct { 122struct swap_info_struct {
123 unsigned int flags; 123 unsigned int flags;
124 spinlock_t sdev_lock; 124 int prio; /* swap priority */
125 struct file *swap_file; 125 struct file *swap_file;
126 struct block_device *bdev; 126 struct block_device *bdev;
127 struct list_head extent_list; 127 struct list_head extent_list;
128 int nr_extents;
129 struct swap_extent *curr_swap_extent; 128 struct swap_extent *curr_swap_extent;
130 unsigned old_block_size; 129 unsigned old_block_size;
131 unsigned short * swap_map; 130 unsigned short * swap_map;
@@ -133,10 +132,9 @@ struct swap_info_struct {
133 unsigned int highest_bit; 132 unsigned int highest_bit;
134 unsigned int cluster_next; 133 unsigned int cluster_next;
135 unsigned int cluster_nr; 134 unsigned int cluster_nr;
136 int prio; /* swap priority */ 135 unsigned int pages;
137 int pages; 136 unsigned int max;
138 unsigned long max; 137 unsigned int inuse_pages;
139 unsigned long inuse_pages;
140 int next; /* next entry on swap list */ 138 int next; /* next entry on swap list */
141}; 139};
142 140
@@ -222,13 +220,7 @@ extern int can_share_swap_page(struct page *);
222extern int remove_exclusive_swap_page(struct page *); 220extern int remove_exclusive_swap_page(struct page *);
223struct backing_dev_info; 221struct backing_dev_info;
224 222
225extern struct swap_list_t swap_list; 223extern spinlock_t swap_lock;
226extern spinlock_t swaplock;
227
228#define swap_list_lock() spin_lock(&swaplock)
229#define swap_list_unlock() spin_unlock(&swaplock)
230#define swap_device_lock(p) spin_lock(&p->sdev_lock)
231#define swap_device_unlock(p) spin_unlock(&p->sdev_lock)
232 224
233/* linux/mm/thrash.c */ 225/* linux/mm/thrash.c */
234extern struct mm_struct * swap_token_mm; 226extern struct mm_struct * swap_token_mm;
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index d4c7db35e708..87b9d14c710d 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -4,7 +4,7 @@
4 * the low-order bits. 4 * the low-order bits.
5 * 5 *
6 * We arrange the `type' and `offset' fields so that `type' is at the five 6 * We arrange the `type' and `offset' fields so that `type' is at the five
7 * high-order bits of the smp_entry_t and `offset' is right-aligned in the 7 * high-order bits of the swp_entry_t and `offset' is right-aligned in the
8 * remaining bits. 8 * remaining bits.
9 * 9 *
10 * swp_entry_t's are *never* stored anywhere in their arch-dependent format. 10 * swp_entry_t's are *never* stored anywhere in their arch-dependent format.
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index e82be96d4906..532a6c5c24e9 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -711,6 +711,7 @@ enum {
711 DEV_RAID=4, 711 DEV_RAID=4,
712 DEV_MAC_HID=5, 712 DEV_MAC_HID=5,
713 DEV_SCSI=6, 713 DEV_SCSI=6,
714 DEV_IPMI=7,
714}; 715};
715 716
716/* /proc/sys/dev/cdrom */ 717/* /proc/sys/dev/cdrom */
@@ -776,6 +777,11 @@ enum {
776 DEV_SCSI_LOGGING_LEVEL=1, 777 DEV_SCSI_LOGGING_LEVEL=1,
777}; 778};
778 779
780/* /proc/sys/dev/ipmi */
781enum {
782 DEV_IPMI_POWEROFF_POWERCYCLE=1,
783};
784
779/* /proc/sys/abi */ 785/* /proc/sys/abi */
780enum 786enum
781{ 787{
diff --git a/include/linux/time.h b/include/linux/time.h
index 5634497ff5df..c10d4c21c183 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -97,7 +97,6 @@ extern int do_settimeofday(struct timespec *tv);
97extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); 97extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz);
98extern void clock_was_set(void); // call when ever the clock is set 98extern void clock_was_set(void); // call when ever the clock is set
99extern int do_posix_clock_monotonic_gettime(struct timespec *tp); 99extern int do_posix_clock_monotonic_gettime(struct timespec *tp);
100extern long do_nanosleep(struct timespec *t);
101extern long do_utimes(char __user * filename, struct timeval * times); 100extern long do_utimes(char __user * filename, struct timeval * times);
102struct itimerval; 101struct itimerval;
103extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); 102extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue);
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 221f81ac2002..3340f3bd135d 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -32,6 +32,10 @@ extern struct timer_base_s __init_timer_base;
32 .magic = TIMER_MAGIC, \ 32 .magic = TIMER_MAGIC, \
33 } 33 }
34 34
35#define DEFINE_TIMER(_name, _function, _expires, _data) \
36 struct timer_list _name = \
37 TIMER_INITIALIZER(_function, _expires, _data)
38
35void fastcall init_timer(struct timer_list * timer); 39void fastcall init_timer(struct timer_list * timer);
36 40
37/*** 41/***
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 74fdd07d3792..7e050a2cc35b 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -260,6 +260,29 @@ extern long pps_calcnt; /* calibration intervals */
260extern long pps_errcnt; /* calibration errors */ 260extern long pps_errcnt; /* calibration errors */
261extern long pps_stbcnt; /* stability limit exceeded */ 261extern long pps_stbcnt; /* stability limit exceeded */
262 262
263/**
264 * ntp_clear - Clears the NTP state variables
265 *
266 * Must be called while holding a write on the xtime_lock
267 */
268static inline void ntp_clear(void)
269{
270 time_adjust = 0; /* stop active adjtime() */
271 time_status |= STA_UNSYNC;
272 time_maxerror = NTP_PHASE_LIMIT;
273 time_esterror = NTP_PHASE_LIMIT;
274}
275
276/**
277 * ntp_synced - Returns 1 if the NTP status is not UNSYNC
278 *
279 */
280static inline int ntp_synced(void)
281{
282 return !(time_status & STA_UNSYNC);
283}
284
285
263#ifdef CONFIG_TIME_INTERPOLATION 286#ifdef CONFIG_TIME_INTERPOLATION
264 287
265#define TIME_SOURCE_CPU 0 288#define TIME_SOURCE_CPU 0
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 0320225e96da..3df1d474e5c5 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -135,6 +135,29 @@
135} 135}
136#endif 136#endif
137 137
138/* sched_domains SD_ALLNODES_INIT for NUMA machines */
139#define SD_ALLNODES_INIT (struct sched_domain) { \
140 .span = CPU_MASK_NONE, \
141 .parent = NULL, \
142 .groups = NULL, \
143 .min_interval = 64, \
144 .max_interval = 64*num_online_cpus(), \
145 .busy_factor = 128, \
146 .imbalance_pct = 133, \
147 .cache_hot_time = (10*1000000), \
148 .cache_nice_tries = 1, \
149 .busy_idx = 3, \
150 .idle_idx = 3, \
151 .newidle_idx = 0, /* unused */ \
152 .wake_idx = 0, /* unused */ \
153 .forkexec_idx = 0, /* unused */ \
154 .per_cpu_gain = 100, \
155 .flags = SD_LOAD_BALANCE, \
156 .last_balance = jiffies, \
157 .balance_interval = 64, \
158 .nr_balance_failed = 0, \
159}
160
138#ifdef CONFIG_NUMA 161#ifdef CONFIG_NUMA
139#ifndef SD_NODE_INIT 162#ifndef SD_NODE_INIT
140#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! 163#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!!
diff --git a/include/linux/transport_class.h b/include/linux/transport_class.h
index 87d98d1faefb..1d6cc22e5f42 100644
--- a/include/linux/transport_class.h
+++ b/include/linux/transport_class.h
@@ -12,11 +12,16 @@
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/attribute_container.h> 13#include <linux/attribute_container.h>
14 14
15struct transport_container;
16
15struct transport_class { 17struct transport_class {
16 struct class class; 18 struct class class;
17 int (*setup)(struct device *); 19 int (*setup)(struct transport_container *, struct device *,
18 int (*configure)(struct device *); 20 struct class_device *);
19 int (*remove)(struct device *); 21 int (*configure)(struct transport_container *, struct device *,
22 struct class_device *);
23 int (*remove)(struct transport_container *, struct device *,
24 struct class_device *);
20}; 25};
21 26
22#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \ 27#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 59ff42c629ec..1267f88ece6e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -74,7 +74,8 @@ struct screen_info {
74 u16 vesapm_off; /* 0x30 */ 74 u16 vesapm_off; /* 0x30 */
75 u16 pages; /* 0x32 */ 75 u16 pages; /* 0x32 */
76 u16 vesa_attributes; /* 0x34 */ 76 u16 vesa_attributes; /* 0x34 */
77 /* 0x36 -- 0x3f reserved for future expansion */ 77 u32 capabilities; /* 0x36 */
78 /* 0x3a -- 0x3f reserved for future expansion */
78}; 79};
79 80
80extern struct screen_info screen_info; 81extern struct screen_info screen_info;
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 724637792996..4dbe580f9335 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -5,6 +5,7 @@
5#include <linux/usb_ch9.h> 5#include <linux/usb_ch9.h>
6 6
7#define USB_MAJOR 180 7#define USB_MAJOR 180
8#define USB_DEVICE_MAJOR 189
8 9
9 10
10#ifdef __KERNEL__ 11#ifdef __KERNEL__
@@ -349,6 +350,7 @@ struct usb_device {
349 char *manufacturer; 350 char *manufacturer;
350 char *serial; /* static strings from the device */ 351 char *serial; /* static strings from the device */
351 struct list_head filelist; 352 struct list_head filelist;
353 struct class_device *class_dev;
352 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 354 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
353 355
354 /* 356 /*
@@ -614,7 +616,6 @@ extern int usb_disabled(void);
614#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */ 616#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */
615#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ 617#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
616#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */ 618#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */
617#define URB_ASYNC_UNLINK 0x0010 /* usb_unlink_urb() returns asap */
618#define URB_NO_FSBR 0x0020 /* UHCI-specific */ 619#define URB_NO_FSBR 0x0020 /* UHCI-specific */
619#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */ 620#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */
620#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt needed */ 621#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt needed */
@@ -722,13 +723,7 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
722 * Initialization: 723 * Initialization:
723 * 724 *
724 * All URBs submitted must initialize the dev, pipe, transfer_flags (may be 725 * All URBs submitted must initialize the dev, pipe, transfer_flags (may be
725 * zero), and complete fields. 726 * zero), and complete fields. All URBs must also initialize
726 * The URB_ASYNC_UNLINK transfer flag affects later invocations of
727 * the usb_unlink_urb() routine. Note: Failure to set URB_ASYNC_UNLINK
728 * with usb_unlink_urb() is deprecated. For synchronous unlinks use
729 * usb_kill_urb() instead.
730 *
731 * All URBs must also initialize
732 * transfer_buffer and transfer_buffer_length. They may provide the 727 * transfer_buffer and transfer_buffer_length. They may provide the
733 * URB_SHORT_NOT_OK transfer flag, indicating that short reads are 728 * URB_SHORT_NOT_OK transfer flag, indicating that short reads are
734 * to be treated as errors; that flag is invalid for write requests. 729 * to be treated as errors; that flag is invalid for write requests.
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb_isp116x.h
index 5f5a9d9bd6c2..436dd8a2b64a 100644
--- a/include/linux/usb_isp116x.h
+++ b/include/linux/usb_isp116x.h
@@ -7,36 +7,18 @@
7struct isp116x_platform_data { 7struct isp116x_platform_data {
8 /* Enable internal resistors on downstream ports */ 8 /* Enable internal resistors on downstream ports */
9 unsigned sel15Kres:1; 9 unsigned sel15Kres:1;
10 /* Chip's internal clock won't be stopped in suspended state. 10 /* On-chip overcurrent detection */
11 Setting/unsetting this bit takes effect only if
12 'remote_wakeup_enable' below is not set. */
13 unsigned clknotstop:1;
14 /* On-chip overcurrent protection */
15 unsigned oc_enable:1; 11 unsigned oc_enable:1;
16 /* INT output polarity */ 12 /* INT output polarity */
17 unsigned int_act_high:1; 13 unsigned int_act_high:1;
18 /* INT edge or level triggered */ 14 /* INT edge or level triggered */
19 unsigned int_edge_triggered:1; 15 unsigned int_edge_triggered:1;
20 /* WAKEUP pin connected - NOT SUPPORTED */ 16 /* Enable wakeup by devices on usb bus (e.g. wakeup
21 /* unsigned remote_wakeup_connected:1; */ 17 by attachment/detachment or by device activity
22 /* Wakeup by devices on usb bus enabled */ 18 such as moving a mouse). When chosen, this option
19 prevents stopping internal clock, increasing
20 thereby power consumption in suspended state. */
23 unsigned remote_wakeup_enable:1; 21 unsigned remote_wakeup_enable:1;
24 /* Switch or not to switch (keep always powered) */
25 unsigned no_power_switching:1;
26 /* Ganged port power switching (0) or individual port
27 power switching (1) */
28 unsigned power_switching_mode:1;
29 /* Given port_power, msec/2 after power on till power good */
30 u8 potpg;
31 /* Hardware reset set/clear. If implemented, this function must:
32 if set == 0, deassert chip's HW reset pin
33 otherwise, assert chip's HW reset pin */
34 void (*reset) (struct device * dev, int set);
35 /* Hardware clock start/stop. If implemented, this function must:
36 if start == 0, stop the external clock
37 otherwise, start the external clock
38 */
39 void (*clock) (struct device * dev, int start);
40 /* Inter-io delay (ns). The chip is picky about access timings; it 22 /* Inter-io delay (ns). The chip is picky about access timings; it
41 expects at least: 23 expects at least:
42 150ns delay between consecutive accesses to DATA_REG, 24 150ns delay between consecutive accesses to DATA_REG,
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 9d6fbde3d29c..1cc8c31b7988 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/version.h>
7 6
8#define HAVE_V4L2 1 7#define HAVE_V4L2 1
9#include <linux/videodev2.h> 8#include <linux/videodev2.h>
@@ -29,7 +28,6 @@ struct video_device
29 void (*release)(struct video_device *vfd); 28 void (*release)(struct video_device *vfd);
30 29
31 30
32#if 1 /* to be removed in 2.7.x */
33 /* obsolete -- fops->owner is used instead */ 31 /* obsolete -- fops->owner is used instead */
34 struct module *owner; 32 struct module *owner;
35 /* dev->driver_data will be used instead some day. 33 /* dev->driver_data will be used instead some day.
@@ -37,7 +35,6 @@ struct video_device
37 * so the switch over will be transparent for you. 35 * so the switch over will be transparent for you.
38 * Or use {pci|usb}_{get|set}_drvdata() directly. */ 36 * Or use {pci|usb}_{get|set}_drvdata() directly. */
39 void *priv; 37 void *priv;
40#endif
41 38
42 /* for videodev.c intenal usage -- please don't touch */ 39 /* for videodev.c intenal usage -- please don't touch */
43 int users; /* video_exclusive_{open|close} ... */ 40 int users; /* video_exclusive_{open|close} ... */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index acbfc525576d..f623a33b9abe 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -270,7 +270,6 @@ struct v4l2_timecode
270/* The above is based on SMPTE timecodes */ 270/* The above is based on SMPTE timecodes */
271 271
272 272
273#if 1
274/* 273/*
275 * M P E G C O M P R E S S I O N P A R A M E T E R S 274 * M P E G C O M P R E S S I O N P A R A M E T E R S
276 * 275 *
@@ -357,7 +356,6 @@ struct v4l2_mpeg_compression {
357 /* I don't expect the above being perfect yet ;) */ 356 /* I don't expect the above being perfect yet ;) */
358 __u32 reserved_5[8]; 357 __u32 reserved_5[8];
359}; 358};
360#endif
361 359
362struct v4l2_jpegcompression 360struct v4l2_jpegcompression
363{ 361{
@@ -871,10 +869,8 @@ struct v4l2_streamparm
871#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) 869#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
872#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) 870#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
873#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) 871#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
874#if 1 /* experimental */
875#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) 872#define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression)
876#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) 873#define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression)
877#endif
878#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) 874#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
879#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) 875#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
880#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) 876#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 6409d9cf5965..b244f69ef682 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -10,6 +10,14 @@
10#define VM_MAP 0x00000004 /* vmap()ed pages */ 10#define VM_MAP 0x00000004 /* vmap()ed pages */
11/* bits [20..32] reserved for arch specific ioremap internals */ 11/* bits [20..32] reserved for arch specific ioremap internals */
12 12
13/*
14 * Maximum alignment for ioremap() regions.
15 * Can be overriden by arch-specific value.
16 */
17#ifndef IOREMAP_MAX_ORDER
18#define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */
19#endif
20
13struct vm_struct { 21struct vm_struct {
14 void *addr; 22 void *addr;
15 unsigned long size; 23 unsigned long size;
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index ae485f9c916e..a555a0f7a7b4 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * This file define a set of standard wireless extensions 2 * This file define a set of standard wireless extensions
3 * 3 *
4 * Version : 18 12.3.05 4 * Version : 19 18.3.05
5 * 5 *
6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> 6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
7 * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. 7 * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved.
@@ -69,8 +69,6 @@
69 69
70/***************************** INCLUDES *****************************/ 70/***************************** INCLUDES *****************************/
71 71
72/* To minimise problems in user space, I might remove those headers
73 * at some point. Jean II */
74#include <linux/types.h> /* for "caddr_t" et al */ 72#include <linux/types.h> /* for "caddr_t" et al */
75#include <linux/socket.h> /* for "struct sockaddr" et al */ 73#include <linux/socket.h> /* for "struct sockaddr" et al */
76#include <linux/if.h> /* for IFNAMSIZ and co... */ 74#include <linux/if.h> /* for IFNAMSIZ and co... */
@@ -82,7 +80,7 @@
82 * (there is some stuff that will be added in the future...) 80 * (there is some stuff that will be added in the future...)
83 * I just plan to increment with each new version. 81 * I just plan to increment with each new version.
84 */ 82 */
85#define WIRELESS_EXT 18 83#define WIRELESS_EXT 19
86 84
87/* 85/*
88 * Changes : 86 * Changes :
@@ -197,6 +195,15 @@
197 * related parameters (extensible up to 4096 parameter values) 195 * related parameters (extensible up to 4096 parameter values)
198 * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE, 196 * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
199 * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND 197 * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
198 *
199 * V18 to V19
200 * ----------
201 * - Remove (struct iw_point *)->pointer from events and streams
202 * - Remove header includes to help user space
203 * - Increase IW_ENCODING_TOKEN_MAX from 32 to 64
204 * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros
205 * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM
206 * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros
200 */ 207 */
201 208
202/**************************** CONSTANTS ****************************/ 209/**************************** CONSTANTS ****************************/
@@ -322,6 +329,7 @@
322/* The first and the last (range) */ 329/* The first and the last (range) */
323#define SIOCIWFIRST 0x8B00 330#define SIOCIWFIRST 0x8B00
324#define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ 331#define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */
332#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST)
325 333
326/* Even : get (world access), odd : set (root access) */ 334/* Even : get (world access), odd : set (root access) */
327#define IW_IS_SET(cmd) (!((cmd) & 0x1)) 335#define IW_IS_SET(cmd) (!((cmd) & 0x1))
@@ -366,6 +374,7 @@
366 * (struct iw_pmkid_cand) */ 374 * (struct iw_pmkid_cand) */
367 375
368#define IWEVFIRST 0x8C00 376#define IWEVFIRST 0x8C00
377#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
369 378
370/* ------------------------- PRIVATE INFO ------------------------- */ 379/* ------------------------- PRIVATE INFO ------------------------- */
371/* 380/*
@@ -427,12 +436,15 @@
427#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ 436#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */
428 437
429/* Statistics flags (bitmask in updated) */ 438/* Statistics flags (bitmask in updated) */
430#define IW_QUAL_QUAL_UPDATED 0x1 /* Value was updated since last read */ 439#define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */
431#define IW_QUAL_LEVEL_UPDATED 0x2 440#define IW_QUAL_LEVEL_UPDATED 0x02
432#define IW_QUAL_NOISE_UPDATED 0x4 441#define IW_QUAL_NOISE_UPDATED 0x04
442#define IW_QUAL_ALL_UPDATED 0x07
443#define IW_QUAL_DBM 0x08 /* Level + Noise are dBm */
433#define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ 444#define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */
434#define IW_QUAL_LEVEL_INVALID 0x20 445#define IW_QUAL_LEVEL_INVALID 0x20
435#define IW_QUAL_NOISE_INVALID 0x40 446#define IW_QUAL_NOISE_INVALID 0x40
447#define IW_QUAL_ALL_INVALID 0x70
436 448
437/* Frequency flags */ 449/* Frequency flags */
438#define IW_FREQ_AUTO 0x00 /* Let the driver decides */ 450#define IW_FREQ_AUTO 0x00 /* Let the driver decides */
@@ -443,7 +455,7 @@
443#define IW_MAX_ENCODING_SIZES 8 455#define IW_MAX_ENCODING_SIZES 8
444 456
445/* Maximum size of the encoding token in bytes */ 457/* Maximum size of the encoding token in bytes */
446#define IW_ENCODING_TOKEN_MAX 32 /* 256 bits (for now) */ 458#define IW_ENCODING_TOKEN_MAX 64 /* 512 bits (for now) */
447 459
448/* Flags for encoding (along with the token) */ 460/* Flags for encoding (along with the token) */
449#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */ 461#define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */
@@ -1039,12 +1051,16 @@ struct iw_event
1039#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ) 1051#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ)
1040#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32)) 1052#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32))
1041#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq)) 1053#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq))
1042#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point))
1043#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param)) 1054#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param))
1044#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr)) 1055#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr))
1045#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality)) 1056#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality))
1046 1057
1047/* Note : in the case of iw_point, the extra data will come at the 1058/* iw_point events are special. First, the payload (extra data) come at
1048 * end of the event */ 1059 * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
1060 * we omit the pointer, so start at an offset. */
1061#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
1062 (char *) NULL)
1063#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
1064 IW_EV_POINT_OFF)
1049 1065
1050#endif /* _LINUX_WIRELESS_H */ 1066#endif /* _LINUX_WIRELESS_H */