aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-12-06 17:31:30 -0500
committerLen Brown <len.brown@intel.com>2005-12-06 17:31:30 -0500
commit3d5271f9883cba7b54762bc4fe027d4172f06db7 (patch)
treeab8a881a14478598a0c8bda0d26c62cdccfffd6d /include/linux
parent378b2556f4e09fa6f87ff0cb5c4395ff28257d02 (diff)
parent9115a6c787596e687df03010d97fccc5e0762506 (diff)
Pull release into acpica branch
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acct.h9
-rw-r--r--include/linux/aio.h59
-rw-r--r--include/linux/ata.h41
-rw-r--r--include/linux/atmdev.h30
-rw-r--r--include/linux/audit.h4
-rw-r--r--include/linux/bfs_fs.h42
-rw-r--r--include/linux/bio.h8
-rw-r--r--include/linux/bitmap.h6
-rw-r--r--include/linux/bitops.h10
-rw-r--r--include/linux/blkdev.h52
-rw-r--r--include/linux/bootmem.h32
-rw-r--r--include/linux/buffer_head.h11
-rw-r--r--include/linux/cciss_ioctl.h2
-rw-r--r--include/linux/cm4000_cs.h66
-rw-r--r--include/linux/cn_proc.h127
-rw-r--r--include/linux/compat_ioctl.h90
-rw-r--r--include/linux/config.h4
-rw-r--r--include/linux/connector.h31
-rw-r--r--include/linux/console_struct.h2
-rw-r--r--include/linux/cpu.h13
-rw-r--r--include/linux/cpufreq.h1
-rw-r--r--include/linux/cpumask.h30
-rw-r--r--include/linux/cpuset.h5
-rw-r--r--include/linux/cyclomx.h2
-rw-r--r--include/linux/cycx_drv.h1
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/device.h146
-rw-r--r--include/linux/dmapool.h2
-rw-r--r--include/linux/dmi.h2
-rw-r--r--include/linux/dqblk_xfs.h20
-rw-r--r--include/linux/ds17287rtc.h67
-rw-r--r--include/linux/ds1742rtc.h53
-rw-r--r--include/linux/eeprom.h136
-rw-r--r--include/linux/elevator.h22
-rw-r--r--include/linux/etherdevice.h35
-rw-r--r--include/linux/ethtool.h11
-rw-r--r--include/linux/fb.h28
-rw-r--r--include/linux/file.h16
-rw-r--r--include/linux/fs.h39
-rw-r--r--include/linux/fs_enet_pd.h135
-rw-r--r--include/linux/fsl_devices.h15
-rw-r--r--include/linux/fuse.h30
-rw-r--r--include/linux/gameport.h1
-rw-r--r--include/linux/genetlink.h51
-rw-r--r--include/linux/genhd.h13
-rw-r--r--include/linux/gfp.h72
-rw-r--r--include/linux/hardirq.h2
-rw-r--r--include/linux/hdreg.h6
-rw-r--r--include/linux/hil.h483
-rw-r--r--include/linux/hil_mlc.h168
-rw-r--r--include/linux/hp_sdc.h300
-rw-r--r--include/linux/hugetlb.h9
-rw-r--r--include/linux/i2c-algo-bit.h4
-rw-r--r--include/linux/i2c-algo-pca.h2
-rw-r--r--include/linux/i2c-algo-pcf.h4
-rw-r--r--include/linux/i2c-dev.h2
-rw-r--r--include/linux/i2c-id.h23
-rw-r--r--include/linux/i2c.h39
-rw-r--r--include/linux/i2o.h16
-rw-r--r--include/linux/ibmtr.h4
-rw-r--r--include/linux/ide.h40
-rw-r--r--include/linux/idr.h9
-rw-r--r--include/linux/if_arp.h1
-rw-r--r--include/linux/if_ether.h6
-rw-r--r--include/linux/if_ppp.h7
-rw-r--r--include/linux/if_wanpipe_common.h2
-rw-r--r--include/linux/inetdevice.h12
-rw-r--r--include/linux/init_task.h1
-rw-r--r--include/linux/input.h29
-rw-r--r--include/linux/interrupt.h1
-rw-r--r--include/linux/ioport.h2
-rw-r--r--include/linux/ipmi.h5
-rw-r--r--include/linux/ipv6.h5
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/istallion.h2
-rw-r--r--include/linux/jbd.h26
-rw-r--r--include/linux/jffs2.h41
-rw-r--r--include/linux/jffs2_fs_i.h7
-rw-r--r--include/linux/jffs2_fs_sb.h19
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/kernel_stat.h8
-rw-r--r--include/linux/key-ui.h90
-rw-r--r--include/linux/key.h89
-rw-r--r--include/linux/kfifo.h4
-rw-r--r--include/linux/kobj_map.h2
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/kprobes.h40
-rw-r--r--include/linux/kthread.h12
-rw-r--r--include/linux/libata.h218
-rw-r--r--include/linux/list.h46
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/mbcache.h2
-rw-r--r--include/linux/memory.h96
-rw-r--r--include/linux/memory_hotplug.h104
-rw-r--r--include/linux/mempolicy.h13
-rw-r--r--include/linux/mempool.h9
-rw-r--r--include/linux/mii.h1
-rw-r--r--include/linux/mm.h197
-rw-r--r--include/linux/mmc/mmc.h4
-rw-r--r--include/linux/mmc/protocol.h4
-rw-r--r--include/linux/mmzone.h68
-rw-r--r--include/linux/mod_devicetable.h12
-rw-r--r--include/linux/module.h4
-rw-r--r--include/linux/mount.h29
-rw-r--r--include/linux/msdos_fs.h11
-rw-r--r--include/linux/mtd/bbm.h122
-rw-r--r--include/linux/mtd/blktrans.h4
-rw-r--r--include/linux/mtd/cfi.h50
-rw-r--r--include/linux/mtd/doc2000.h18
-rw-r--r--include/linux/mtd/flashchip.h14
-rw-r--r--include/linux/mtd/ftl.h6
-rw-r--r--include/linux/mtd/gen_probe.h4
-rw-r--r--include/linux/mtd/jedec.h20
-rw-r--r--include/linux/mtd/map.h17
-rw-r--r--include/linux/mtd/mtd.h37
-rw-r--r--include/linux/mtd/nand.h57
-rw-r--r--include/linux/mtd/onenand.h155
-rw-r--r--include/linux/mtd/onenand_regs.h180
-rw-r--r--include/linux/mtd/partitions.h20
-rw-r--r--include/linux/mtd/physmap.h12
-rw-r--r--include/linux/mtd/pmc551.h12
-rw-r--r--include/linux/mtd/xip.h20
-rw-r--r--include/linux/namei.h10
-rw-r--r--include/linux/namespace.h3
-rw-r--r--include/linux/net.h1
-rw-r--r--include/linux/netdevice.h103
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h159
-rw-r--r--include/linux/netfilter/nf_conntrack_ftp.h44
-rw-r--r--include/linux/netfilter/nf_conntrack_sctp.h27
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h56
-rw-r--r--include/linux/netfilter/nf_conntrack_tuple_common.h13
-rw-r--r--include/linux/netfilter/nfnetlink.h20
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h15
-rw-r--r--include/linux/netfilter_arp/arp_tables.h20
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h173
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_ftp.h39
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_icmp.h9
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_pptp.h125
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_protocol.h3
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_sctp.h21
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_tcp.h47
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_tuple.h18
-rw-r--r--include/linux/netfilter_ipv4/ip_nat.h4
-rw-r--r--include/linux/netfilter_ipv4/ip_nat_core.h12
-rw-r--r--include/linux/netfilter_ipv4/ipt_sctp.h12
-rw-r--r--include/linux/netfilter_ipv6.h1
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h27
-rw-r--r--include/linux/netlink.h26
-rw-r--r--include/linux/netpoll.h2
-rw-r--r--include/linux/nfs_fs.h30
-rw-r--r--include/linux/nfs_xdr.h65
-rw-r--r--include/linux/nfsd/nfsd.h2
-rw-r--r--include/linux/nfsd/syscall.h17
-rw-r--r--include/linux/nfsd/xdr3.h2
-rw-r--r--include/linux/nodemask.h20
-rw-r--r--include/linux/page-flags.h4
-rw-r--r--include/linux/pagemap.h19
-rw-r--r--include/linux/pci-acpi.h5
-rw-r--r--include/linux/pci.h20
-rw-r--r--include/linux/pci_ids.h607
-rw-r--r--include/linux/percpu.h2
-rw-r--r--include/linux/phonedev.h1
-rw-r--r--include/linux/phy.h3
-rw-r--r--include/linux/pkt_sched.h50
-rw-r--r--include/linux/platform_device.h61
-rw-r--r--include/linux/pm.h90
-rw-r--r--include/linux/pm_legacy.h56
-rw-r--r--include/linux/pnp.h2
-rw-r--r--include/linux/posix_acl.h6
-rw-r--r--include/linux/ppp-comp.h9
-rw-r--r--include/linux/preempt.h1
-rw-r--r--include/linux/proc_fs.h10
-rw-r--r--include/linux/ptrace.h2
-rw-r--r--include/linux/quota.h1
-rw-r--r--include/linux/quotaops.h12
-rw-r--r--include/linux/radix-tree.h5
-rw-r--r--include/linux/raid/bitmap.h11
-rw-r--r--include/linux/raid/md.h5
-rw-r--r--include/linux/raid/md_k.h40
-rw-r--r--include/linux/raid/raid1.h4
-rw-r--r--include/linux/raid/raid5.h2
-rw-r--r--include/linux/raid_class.h32
-rw-r--r--include/linux/rcupdate.h2
-rw-r--r--include/linux/reboot.h4
-rw-r--r--include/linux/reiserfs_fs.h2
-rw-r--r--include/linux/rio.h325
-rw-r--r--include/linux/rio_drv.h469
-rw-r--r--include/linux/rio_ids.h24
-rw-r--r--include/linux/rio_regs.h215
-rw-r--r--include/linux/rmap.h8
-rw-r--r--include/linux/rslib.h28
-rw-r--r--include/linux/rwsem-spinlock.h5
-rw-r--r--include/linux/scatterlist.h17
-rw-r--r--include/linux/sched.h119
-rw-r--r--include/linux/sdladrv.h4
-rw-r--r--include/linux/security.h92
-rw-r--r--include/linux/sem.h2
-rw-r--r--include/linux/serial.h1
-rw-r--r--include/linux/serial_8250.h3
-rw-r--r--include/linux/serial_core.h8
-rw-r--r--include/linux/serial_ip3106.h81
-rw-r--r--include/linux/shm.h1
-rw-r--r--include/linux/signal.h1
-rw-r--r--include/linux/skbuff.h139
-rw-r--r--include/linux/slab.h23
-rw-r--r--include/linux/smp_lock.h3
-rw-r--r--include/linux/spinlock.h31
-rw-r--r--include/linux/stallion.h2
-rw-r--r--include/linux/string.h2
-rw-r--r--include/linux/sunrpc/auth.h7
-rw-r--r--include/linux/sunrpc/debug.h3
-rw-r--r--include/linux/sunrpc/gss_api.h27
-rw-r--r--include/linux/sunrpc/gss_err.h10
-rw-r--r--include/linux/sunrpc/gss_krb5.h27
-rw-r--r--include/linux/sunrpc/gss_spkm3.h4
-rw-r--r--include/linux/sunrpc/msg_prot.h25
-rw-r--r--include/linux/sunrpc/svc.h3
-rw-r--r--include/linux/sunrpc/xdr.h6
-rw-r--r--include/linux/sunrpc/xprt.h227
-rw-r--r--include/linux/superhyway.h38
-rw-r--r--include/linux/suspend.h7
-rw-r--r--include/linux/swap.h12
-rw-r--r--include/linux/syscalls.h1
-rw-r--r--include/linux/sysctl.h70
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h2
-rw-r--r--include/linux/tcp.h16
-rw-r--r--include/linux/textsearch.h8
-rw-r--r--include/linux/thread_info.h47
-rw-r--r--include/linux/time.h2
-rw-r--r--include/linux/timer.h17
-rw-r--r--include/linux/timex.h7
-rw-r--r--include/linux/types.h11
-rw-r--r--include/linux/uinput.h13
-rw-r--r--include/linux/usb.h178
-rw-r--r--include/linux/usb_gadget.h12
-rw-r--r--include/linux/usb_otg.h13
-rw-r--r--include/linux/usbdevice_fs.h7
-rw-r--r--include/linux/videodev.h82
-rw-r--r--include/linux/videodev2.h208
-rw-r--r--include/linux/vmalloc.h10
-rw-r--r--include/linux/wait.h1
-rw-r--r--include/linux/wanpipe.h9
-rw-r--r--include/linux/x1205.h31
-rw-r--r--include/linux/zutil.h1
244 files changed, 6931 insertions, 2679 deletions
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 1993a3691768..9a66401073fc 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -16,6 +16,8 @@
16#define _LINUX_ACCT_H 16#define _LINUX_ACCT_H
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/jiffies.h>
20
19#include <asm/param.h> 21#include <asm/param.h>
20#include <asm/byteorder.h> 22#include <asm/byteorder.h>
21 23
@@ -117,12 +119,15 @@ struct acct_v3
117#include <linux/config.h> 119#include <linux/config.h>
118 120
119#ifdef CONFIG_BSD_PROCESS_ACCT 121#ifdef CONFIG_BSD_PROCESS_ACCT
122struct vfsmount;
120struct super_block; 123struct super_block;
124extern void acct_auto_close_mnt(struct vfsmount *m);
121extern void acct_auto_close(struct super_block *sb); 125extern void acct_auto_close(struct super_block *sb);
122extern void acct_process(long exitcode); 126extern void acct_process(long exitcode);
123extern void acct_update_integrals(struct task_struct *tsk); 127extern void acct_update_integrals(struct task_struct *tsk);
124extern void acct_clear_integrals(struct task_struct *tsk); 128extern void acct_clear_integrals(struct task_struct *tsk);
125#else 129#else
130#define acct_auto_close_mnt(x) do { } while (0)
126#define acct_auto_close(x) do { } while (0) 131#define acct_auto_close(x) do { } while (0)
127#define acct_process(x) do { } while (0) 132#define acct_process(x) do { } while (0)
128#define acct_update_integrals(x) do { } while (0) 133#define acct_update_integrals(x) do { } while (0)
@@ -162,13 +167,13 @@ typedef struct acct acct_t;
162#ifdef __KERNEL__ 167#ifdef __KERNEL__
163/* 168/*
164 * Yet another set of HZ to *HZ helper functions. 169 * Yet another set of HZ to *HZ helper functions.
165 * See <linux/times.h> for the original. 170 * See <linux/jiffies.h> for the original.
166 */ 171 */
167 172
168static inline u32 jiffies_to_AHZ(unsigned long x) 173static inline u32 jiffies_to_AHZ(unsigned long x)
169{ 174{
170#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 175#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0
171 return x / (HZ / USER_HZ); 176 return x / (HZ / AHZ);
172#else 177#else
173 u64 tmp = (u64)x * TICK_NSEC; 178 u64 tmp = (u64)x * TICK_NSEC;
174 do_div(tmp, (NSEC_PER_SEC / AHZ)); 179 do_div(tmp, (NSEC_PER_SEC / AHZ));
diff --git a/include/linux/aio.h b/include/linux/aio.h
index a4d5af907f90..49fd37629ee4 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -24,7 +24,12 @@ struct kioctx;
24#define KIOCB_SYNC_KEY (~0U) 24#define KIOCB_SYNC_KEY (~0U)
25 25
26/* ki_flags bits */ 26/* ki_flags bits */
27#define KIF_LOCKED 0 27/*
28 * This may be used for cancel/retry serialization in the future, but
29 * for now it's unused and we probably don't want modules to even
30 * think they can use it.
31 */
32/* #define KIF_LOCKED 0 */
28#define KIF_KICKED 1 33#define KIF_KICKED 1
29#define KIF_CANCELLED 2 34#define KIF_CANCELLED 2
30 35
@@ -43,6 +48,40 @@ struct kioctx;
43#define kiocbIsKicked(iocb) test_bit(KIF_KICKED, &(iocb)->ki_flags) 48#define kiocbIsKicked(iocb) test_bit(KIF_KICKED, &(iocb)->ki_flags)
44#define kiocbIsCancelled(iocb) test_bit(KIF_CANCELLED, &(iocb)->ki_flags) 49#define kiocbIsCancelled(iocb) test_bit(KIF_CANCELLED, &(iocb)->ki_flags)
45 50
51/* is there a better place to document function pointer methods? */
52/**
53 * ki_retry - iocb forward progress callback
54 * @kiocb: The kiocb struct to advance by performing an operation.
55 *
56 * This callback is called when the AIO core wants a given AIO operation
57 * to make forward progress. The kiocb argument describes the operation
58 * that is to be performed. As the operation proceeds, perhaps partially,
59 * ki_retry is expected to update the kiocb with progress made. Typically
60 * ki_retry is set in the AIO core and it itself calls file_operations
61 * helpers.
62 *
63 * ki_retry's return value determines when the AIO operation is completed
64 * and an event is generated in the AIO event ring. Except the special
65 * return values described below, the value that is returned from ki_retry
66 * is transferred directly into the completion ring as the operation's
67 * resulting status. Once this has happened ki_retry *MUST NOT* reference
68 * the kiocb pointer again.
69 *
70 * If ki_retry returns -EIOCBQUEUED it has made a promise that aio_complete()
71 * will be called on the kiocb pointer in the future. The AIO core will
72 * not ask the method again -- ki_retry must ensure forward progress.
73 * aio_complete() must be called once and only once in the future, multiple
74 * calls may result in undefined behaviour.
75 *
76 * If ki_retry returns -EIOCBRETRY it has made a promise that kick_iocb()
77 * will be called on the kiocb pointer in the future. This may happen
78 * through generic helpers that associate kiocb->ki_wait with a wait
79 * queue head that ki_retry uses via current->io_wait. It can also happen
80 * with custom tracking and manual calls to kick_iocb(), though that is
81 * discouraged. In either case, kick_iocb() must be called once and only
82 * once. ki_retry must ensure forward progress, the AIO core will wait
83 * indefinitely for kick_iocb() to be called.
84 */
46struct kiocb { 85struct kiocb {
47 struct list_head ki_run_list; 86 struct list_head ki_run_list;
48 long ki_flags; 87 long ki_flags;
@@ -85,7 +124,7 @@ struct kiocb {
85 (x)->ki_users = 1; \ 124 (x)->ki_users = 1; \
86 (x)->ki_key = KIOCB_SYNC_KEY; \ 125 (x)->ki_key = KIOCB_SYNC_KEY; \
87 (x)->ki_filp = (filp); \ 126 (x)->ki_filp = (filp); \
88 (x)->ki_ctx = &tsk->active_mm->default_kioctx; \ 127 (x)->ki_ctx = NULL; \
89 (x)->ki_cancel = NULL; \ 128 (x)->ki_cancel = NULL; \
90 (x)->ki_dtor = NULL; \ 129 (x)->ki_dtor = NULL; \
91 (x)->ki_obj.tsk = tsk; \ 130 (x)->ki_obj.tsk = tsk; \
@@ -144,6 +183,7 @@ struct kioctx {
144 struct list_head active_reqs; /* used for cancellation */ 183 struct list_head active_reqs; /* used for cancellation */
145 struct list_head run_list; /* used for kicked reqs */ 184 struct list_head run_list; /* used for kicked reqs */
146 185
186 /* sys_io_setup currently limits this to an unsigned int */
147 unsigned max_reqs; 187 unsigned max_reqs;
148 188
149 struct aio_ring_info ring_info; 189 struct aio_ring_info ring_info;
@@ -170,8 +210,15 @@ struct kioctx *lookup_ioctx(unsigned long ctx_id);
170int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, 210int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
171 struct iocb *iocb)); 211 struct iocb *iocb));
172 212
173#define get_ioctx(kioctx) do { if (unlikely(atomic_read(&(kioctx)->users) <= 0)) BUG(); atomic_inc(&(kioctx)->users); } while (0) 213#define get_ioctx(kioctx) do { \
174#define put_ioctx(kioctx) do { if (unlikely(atomic_dec_and_test(&(kioctx)->users))) __put_ioctx(kioctx); else if (unlikely(atomic_read(&(kioctx)->users) < 0)) BUG(); } while (0) 214 BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \
215 atomic_inc(&(kioctx)->users); \
216} while (0)
217#define put_ioctx(kioctx) do { \
218 BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \
219 if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \
220 __put_ioctx(kioctx); \
221} while (0)
175 222
176#define in_aio() !is_sync_wait(current->io_wait) 223#define in_aio() !is_sync_wait(current->io_wait)
177/* may be used for debugging */ 224/* may be used for debugging */
@@ -195,7 +242,7 @@ static inline struct kiocb *list_kiocb(struct list_head *h)
195} 242}
196 243
197/* for sysctl: */ 244/* for sysctl: */
198extern atomic_t aio_nr; 245extern unsigned long aio_nr;
199extern unsigned aio_max_nr; 246extern unsigned long aio_max_nr;
200 247
201#endif /* __LINUX__AIO_H */ 248#endif /* __LINUX__AIO_H */
diff --git a/include/linux/ata.h b/include/linux/ata.h
index a5b74efab067..d2873b732bb1 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -42,13 +42,18 @@ enum {
42 ATA_SECT_SIZE = 512, 42 ATA_SECT_SIZE = 512,
43 43
44 ATA_ID_WORDS = 256, 44 ATA_ID_WORDS = 256,
45 ATA_ID_PROD_OFS = 27,
46 ATA_ID_FW_REV_OFS = 23,
47 ATA_ID_SERNO_OFS = 10, 45 ATA_ID_SERNO_OFS = 10,
48 ATA_ID_MAJOR_VER = 80, 46 ATA_ID_FW_REV_OFS = 23,
49 ATA_ID_PIO_MODES = 64, 47 ATA_ID_PROD_OFS = 27,
48 ATA_ID_OLD_PIO_MODES = 51,
49 ATA_ID_FIELD_VALID = 53,
50 ATA_ID_MWDMA_MODES = 63, 50 ATA_ID_MWDMA_MODES = 63,
51 ATA_ID_PIO_MODES = 64,
52 ATA_ID_EIDE_DMA_MIN = 65,
53 ATA_ID_EIDE_PIO = 67,
54 ATA_ID_EIDE_PIO_IORDY = 68,
51 ATA_ID_UDMA_MODES = 88, 55 ATA_ID_UDMA_MODES = 88,
56 ATA_ID_MAJOR_VER = 80,
52 ATA_ID_PIO4 = (1 << 1), 57 ATA_ID_PIO4 = (1 << 1),
53 58
54 ATA_PCI_CTL_OFS = 2, 59 ATA_PCI_CTL_OFS = 2,
@@ -128,10 +133,15 @@ enum {
128 ATA_CMD_PIO_READ_EXT = 0x24, 133 ATA_CMD_PIO_READ_EXT = 0x24,
129 ATA_CMD_PIO_WRITE = 0x30, 134 ATA_CMD_PIO_WRITE = 0x30,
130 ATA_CMD_PIO_WRITE_EXT = 0x34, 135 ATA_CMD_PIO_WRITE_EXT = 0x34,
136 ATA_CMD_READ_MULTI = 0xC4,
137 ATA_CMD_READ_MULTI_EXT = 0x29,
138 ATA_CMD_WRITE_MULTI = 0xC5,
139 ATA_CMD_WRITE_MULTI_EXT = 0x39,
131 ATA_CMD_SET_FEATURES = 0xEF, 140 ATA_CMD_SET_FEATURES = 0xEF,
132 ATA_CMD_PACKET = 0xA0, 141 ATA_CMD_PACKET = 0xA0,
133 ATA_CMD_VERIFY = 0x40, 142 ATA_CMD_VERIFY = 0x40,
134 ATA_CMD_VERIFY_EXT = 0x42, 143 ATA_CMD_VERIFY_EXT = 0x42,
144 ATA_CMD_INIT_DEV_PARAMS = 0x91,
135 145
136 /* SETFEATURES stuff */ 146 /* SETFEATURES stuff */
137 SETFEATURES_XFER = 0x03, 147 SETFEATURES_XFER = 0x03,
@@ -146,14 +156,14 @@ enum {
146 XFER_MW_DMA_2 = 0x22, 156 XFER_MW_DMA_2 = 0x22,
147 XFER_MW_DMA_1 = 0x21, 157 XFER_MW_DMA_1 = 0x21,
148 XFER_MW_DMA_0 = 0x20, 158 XFER_MW_DMA_0 = 0x20,
159 XFER_SW_DMA_2 = 0x12,
160 XFER_SW_DMA_1 = 0x11,
161 XFER_SW_DMA_0 = 0x10,
149 XFER_PIO_4 = 0x0C, 162 XFER_PIO_4 = 0x0C,
150 XFER_PIO_3 = 0x0B, 163 XFER_PIO_3 = 0x0B,
151 XFER_PIO_2 = 0x0A, 164 XFER_PIO_2 = 0x0A,
152 XFER_PIO_1 = 0x09, 165 XFER_PIO_1 = 0x09,
153 XFER_PIO_0 = 0x08, 166 XFER_PIO_0 = 0x08,
154 XFER_SW_DMA_2 = 0x12,
155 XFER_SW_DMA_1 = 0x11,
156 XFER_SW_DMA_0 = 0x10,
157 XFER_PIO_SLOW = 0x00, 167 XFER_PIO_SLOW = 0x00,
158 168
159 /* ATAPI stuff */ 169 /* ATAPI stuff */
@@ -181,6 +191,7 @@ enum {
181 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ 191 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
182 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ 192 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
183 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 193 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
194 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
184}; 195};
185 196
186enum ata_tf_protocols { 197enum ata_tf_protocols {
@@ -250,7 +261,19 @@ struct ata_taskfile {
250 ((u64) (id)[(n) + 1] << 16) | \ 261 ((u64) (id)[(n) + 1] << 16) | \
251 ((u64) (id)[(n) + 0]) ) 262 ((u64) (id)[(n) + 0]) )
252 263
253static inline int atapi_cdb_len(u16 *dev_id) 264static inline int ata_id_current_chs_valid(const u16 *id)
265{
266 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
267 has not been issued to the device then the values of
268 id[54] to id[56] are vendor specific. */
269 return (id[53] & 0x01) && /* Current translation valid */
270 id[54] && /* cylinders in current translation */
271 id[55] && /* heads in current translation */
272 id[55] <= 16 &&
273 id[56]; /* sectors in current translation */
274}
275
276static inline int atapi_cdb_len(const u16 *dev_id)
254{ 277{
255 u16 tmp = dev_id[0] & 0x3; 278 u16 tmp = dev_id[0] & 0x3;
256 switch (tmp) { 279 switch (tmp) {
@@ -260,7 +283,7 @@ static inline int atapi_cdb_len(u16 *dev_id)
260 } 283 }
261} 284}
262 285
263static inline int is_atapi_taskfile(struct ata_taskfile *tf) 286static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
264{ 287{
265 return (tf->protocol == ATA_PROT_ATAPI) || 288 return (tf->protocol == ATA_PROT_ATAPI) ||
266 (tf->protocol == ATA_PROT_ATAPI_NODATA) || 289 (tf->protocol == ATA_PROT_ATAPI_NODATA) ||
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 9f374cfa1b05..b203ea82a0a8 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -7,7 +7,6 @@
7#define LINUX_ATMDEV_H 7#define LINUX_ATMDEV_H
8 8
9 9
10#include <linux/config.h>
11#include <linux/atmapi.h> 10#include <linux/atmapi.h>
12#include <linux/atm.h> 11#include <linux/atm.h>
13#include <linux/atmioc.h> 12#include <linux/atmioc.h>
@@ -76,6 +75,13 @@ struct atm_dev_stats {
76 /* set interface ESI */ 75 /* set interface ESI */
77#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc) 76#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
78 /* force interface ESI */ 77 /* force interface ESI */
78#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
79 /* register a LECS address */
80#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
81 /* unregister a LECS address */
82#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
83 /* retrieve LECS address(es) */
84
79#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc) 85#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
80 /* get AAL layer statistics */ 86 /* get AAL layer statistics */
81#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) 87#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
@@ -203,6 +209,7 @@ struct atm_cirange {
203 209
204#ifdef __KERNEL__ 210#ifdef __KERNEL__
205 211
212#include <linux/config.h>
206#include <linux/wait.h> /* wait_queue_head_t */ 213#include <linux/wait.h> /* wait_queue_head_t */
207#include <linux/time.h> /* struct timeval */ 214#include <linux/time.h> /* struct timeval */
208#include <linux/net.h> 215#include <linux/net.h>
@@ -267,7 +274,7 @@ enum {
267 274
268 275
269enum { 276enum {
270 ATM_DF_CLOSE, /* close device when last VCC is closed */ 277 ATM_DF_REMOVED, /* device was removed from atm_devs list */
271}; 278};
272 279
273 280
@@ -328,6 +335,8 @@ struct atm_dev_addr {
328 struct list_head entry; /* next address */ 335 struct list_head entry; /* next address */
329}; 336};
330 337
338enum atm_addr_type_t { ATM_ADDR_LOCAL, ATM_ADDR_LECS };
339
331struct atm_dev { 340struct atm_dev {
332 const struct atmdev_ops *ops; /* device operations; NULL if unused */ 341 const struct atmdev_ops *ops; /* device operations; NULL if unused */
333 const struct atmphy_ops *phy; /* PHY operations, may be undefined */ 342 const struct atmphy_ops *phy; /* PHY operations, may be undefined */
@@ -338,6 +347,7 @@ struct atm_dev {
338 void *phy_data; /* private PHY date */ 347 void *phy_data; /* private PHY date */
339 unsigned long flags; /* device flags (ATM_DF_*) */ 348 unsigned long flags; /* device flags (ATM_DF_*) */
340 struct list_head local; /* local ATM addresses */ 349 struct list_head local; /* local ATM addresses */
350 struct list_head lecs; /* LECS ATM addresses learned via ILMI */
341 unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */ 351 unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */
342 struct atm_cirange ci_range; /* VPI/VCI range */ 352 struct atm_cirange ci_range; /* VPI/VCI range */
343 struct k_atm_dev_stats stats; /* statistics */ 353 struct k_atm_dev_stats stats; /* statistics */
@@ -405,7 +415,6 @@ struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops,
405 int number,unsigned long *flags); /* number == -1: pick first available */ 415 int number,unsigned long *flags); /* number == -1: pick first available */
406struct atm_dev *atm_dev_lookup(int number); 416struct atm_dev *atm_dev_lookup(int number);
407void atm_dev_deregister(struct atm_dev *dev); 417void atm_dev_deregister(struct atm_dev *dev);
408void shutdown_atm_dev(struct atm_dev *dev);
409void vcc_insert_socket(struct sock *sk); 418void vcc_insert_socket(struct sock *sk);
410 419
411 420
@@ -447,18 +456,19 @@ static inline void atm_dev_hold(struct atm_dev *dev)
447 456
448static inline void atm_dev_put(struct atm_dev *dev) 457static inline void atm_dev_put(struct atm_dev *dev)
449{ 458{
450 atomic_dec(&dev->refcnt); 459 if (atomic_dec_and_test(&dev->refcnt)) {
451 460 BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags));
452 if ((atomic_read(&dev->refcnt) == 1) && 461 if (dev->ops->dev_close)
453 test_bit(ATM_DF_CLOSE,&dev->flags)) 462 dev->ops->dev_close(dev);
454 shutdown_atm_dev(dev); 463 kfree(dev);
464 }
455} 465}
456 466
457 467
458int atm_charge(struct atm_vcc *vcc,int truesize); 468int atm_charge(struct atm_vcc *vcc,int truesize);
459struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, 469struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
460 int gfp_flags); 470 gfp_t gfp_flags);
461int atm_pcr_goal(struct atm_trafprm *tp); 471int atm_pcr_goal(const struct atm_trafprm *tp);
462 472
463void vcc_release_async(struct atm_vcc *vcc, int reply); 473void vcc_release_async(struct atm_vcc *vcc, int reply);
464 474
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b2a2509bd7ea..da3c01955f3d 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -260,11 +260,11 @@ extern int audit_filter_user(struct netlink_skb_parms *cb, int type);
260#ifdef CONFIG_AUDIT 260#ifdef CONFIG_AUDIT
261/* These are defined in audit.c */ 261/* These are defined in audit.c */
262 /* Public API */ 262 /* Public API */
263extern void audit_log(struct audit_context *ctx, int gfp_mask, 263extern void audit_log(struct audit_context *ctx, gfp_t gfp_mask,
264 int type, const char *fmt, ...) 264 int type, const char *fmt, ...)
265 __attribute__((format(printf,4,5))); 265 __attribute__((format(printf,4,5)));
266 266
267extern struct audit_buffer *audit_log_start(struct audit_context *ctx, int gfp_mask, int type); 267extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
268extern void audit_log_format(struct audit_buffer *ab, 268extern void audit_log_format(struct audit_buffer *ab,
269 const char *fmt, ...) 269 const char *fmt, ...)
270 __attribute__((format(printf,2,3))); 270 __attribute__((format(printf,2,3)));
diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h
index c1237aa92e38..8ed6dfdcd783 100644
--- a/include/linux/bfs_fs.h
+++ b/include/linux/bfs_fs.h
@@ -20,19 +20,19 @@
20 20
21/* BFS inode layout on disk */ 21/* BFS inode layout on disk */
22struct bfs_inode { 22struct bfs_inode {
23 __u16 i_ino; 23 __le16 i_ino;
24 __u16 i_unused; 24 __u16 i_unused;
25 __u32 i_sblock; 25 __le32 i_sblock;
26 __u32 i_eblock; 26 __le32 i_eblock;
27 __u32 i_eoffset; 27 __le32 i_eoffset;
28 __u32 i_vtype; 28 __le32 i_vtype;
29 __u32 i_mode; 29 __le32 i_mode;
30 __s32 i_uid; 30 __le32 i_uid;
31 __s32 i_gid; 31 __le32 i_gid;
32 __u32 i_nlink; 32 __le32 i_nlink;
33 __u32 i_atime; 33 __le32 i_atime;
34 __u32 i_mtime; 34 __le32 i_mtime;
35 __u32 i_ctime; 35 __le32 i_ctime;
36 __u32 i_padding[4]; 36 __u32 i_padding[4];
37}; 37};
38 38
@@ -41,17 +41,17 @@ struct bfs_inode {
41#define BFS_DIRS_PER_BLOCK 32 41#define BFS_DIRS_PER_BLOCK 32
42 42
43struct bfs_dirent { 43struct bfs_dirent {
44 __u16 ino; 44 __le16 ino;
45 char name[BFS_NAMELEN]; 45 char name[BFS_NAMELEN];
46}; 46};
47 47
48/* BFS superblock layout on disk */ 48/* BFS superblock layout on disk */
49struct bfs_super_block { 49struct bfs_super_block {
50 __u32 s_magic; 50 __le32 s_magic;
51 __u32 s_start; 51 __le32 s_start;
52 __u32 s_end; 52 __le32 s_end;
53 __s32 s_from; 53 __le32 s_from;
54 __s32 s_to; 54 __le32 s_to;
55 __s32 s_bfrom; 55 __s32 s_bfrom;
56 __s32 s_bto; 56 __s32 s_bto;
57 char s_fsname[6]; 57 char s_fsname[6];
@@ -66,15 +66,15 @@ struct bfs_super_block {
66#define BFS_INO2OFF(ino) \ 66#define BFS_INO2OFF(ino) \
67 ((__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) \ 68#define BFS_NZFILESIZE(ip) \
69 ((cpu_to_le32((ip)->i_eoffset) + 1) - cpu_to_le32((ip)->i_sblock) * BFS_BSIZE) 69 ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
70 70
71#define BFS_FILESIZE(ip) \ 71#define BFS_FILESIZE(ip) \
72 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) 72 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
73 73
74#define BFS_FILEBLOCKS(ip) \ 74#define BFS_FILEBLOCKS(ip) \
75 ((ip)->i_sblock == 0 ? 0 : (cpu_to_le32((ip)->i_eblock) + 1) - cpu_to_le32((ip)->i_sblock)) 75 ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock))
76#define BFS_UNCLEAN(bfs_sb, sb) \ 76#define BFS_UNCLEAN(bfs_sb, sb) \
77 ((cpu_to_le32(bfs_sb->s_from) != -1) && (cpu_to_le32(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) 77 ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
78 78
79 79
80#endif /* _LINUX_BFS_FS_H */ 80#endif /* _LINUX_BFS_FS_H */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 6e1c79c8b6bf..685fd3720df5 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -276,8 +276,8 @@ extern void bio_pair_release(struct bio_pair *dbio);
276extern struct bio_set *bioset_create(int, int, int); 276extern struct bio_set *bioset_create(int, int, int);
277extern void bioset_free(struct bio_set *); 277extern void bioset_free(struct bio_set *);
278 278
279extern struct bio *bio_alloc(unsigned int __nocast, int); 279extern struct bio *bio_alloc(gfp_t, int);
280extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); 280extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *);
281extern void bio_put(struct bio *); 281extern void bio_put(struct bio *);
282extern void bio_free(struct bio *, struct bio_set *); 282extern void bio_free(struct bio *, struct bio_set *);
283 283
@@ -287,7 +287,7 @@ extern int bio_phys_segments(struct request_queue *, struct bio *);
287extern int bio_hw_segments(struct request_queue *, struct bio *); 287extern int bio_hw_segments(struct request_queue *, struct bio *);
288 288
289extern void __bio_clone(struct bio *, struct bio *); 289extern void __bio_clone(struct bio *, struct bio *);
290extern struct bio *bio_clone(struct bio *, unsigned int __nocast); 290extern struct bio *bio_clone(struct bio *, gfp_t);
291 291
292extern void bio_init(struct bio *); 292extern void bio_init(struct bio *);
293 293
@@ -301,7 +301,7 @@ extern struct bio *bio_map_user_iov(struct request_queue *,
301 struct sg_iovec *, int, int); 301 struct sg_iovec *, int, int);
302extern 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, 303extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
304 unsigned int); 304 gfp_t);
305extern void bio_set_pages_dirty(struct bio *bio); 305extern void bio_set_pages_dirty(struct bio *bio);
306extern void bio_check_pages_dirty(struct bio *bio); 306extern void bio_check_pages_dirty(struct bio *bio);
307extern 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/bitmap.h b/include/linux/bitmap.h
index 86dd5502b05c..7d8ff97b3e92 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -40,6 +40,8 @@
40 * bitmap_weight(src, nbits) Hamming Weight: number set bits 40 * bitmap_weight(src, nbits) Hamming Weight: number set bits
41 * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n 41 * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n
42 * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n 42 * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n
43 * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src)
44 * bitmap_bitremap(oldbit, old, new, nbits) newbit = map(old, new)(oldbit)
43 * bitmap_scnprintf(buf, len, src, nbits) Print bitmap src to buf 45 * bitmap_scnprintf(buf, len, src, nbits) Print bitmap src to buf
44 * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf 46 * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf
45 * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf 47 * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf
@@ -104,6 +106,10 @@ extern int bitmap_scnlistprintf(char *buf, unsigned int len,
104 const unsigned long *src, int nbits); 106 const unsigned long *src, int nbits);
105extern int bitmap_parselist(const char *buf, unsigned long *maskp, 107extern int bitmap_parselist(const char *buf, unsigned long *maskp,
106 int nmaskbits); 108 int nmaskbits);
109extern void bitmap_remap(unsigned long *dst, const unsigned long *src,
110 const unsigned long *old, const unsigned long *new, int bits);
111extern int bitmap_bitremap(int oldbit,
112 const unsigned long *old, const unsigned long *new, int bits);
107extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order); 113extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order);
108extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); 114extern void bitmap_release_region(unsigned long *bitmap, int pos, int order);
109extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); 115extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index cb3c3ef50f50..38c2fb7ebe09 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -84,6 +84,16 @@ static __inline__ int get_bitmask_order(unsigned int count)
84 return order; /* We could be slightly more clever with -1 here... */ 84 return order; /* We could be slightly more clever with -1 here... */
85} 85}
86 86
87static __inline__ int get_count_order(unsigned int count)
88{
89 int order;
90
91 order = fls(count) - 1;
92 if (count & (count - 1))
93 order++;
94 return order;
95}
96
87/* 97/*
88 * hweightN: returns the hamming weight (i.e. the number 98 * hweightN: returns the hamming weight (i.e. the number
89 * of bits set) of a N-bit word 99 * of bits set) of a N-bit word
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index efdc9b5bc05c..a33a31e71bbc 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -96,8 +96,8 @@ struct io_context {
96 96
97void put_io_context(struct io_context *ioc); 97void put_io_context(struct io_context *ioc);
98void exit_io_context(void); 98void exit_io_context(void);
99struct io_context *current_io_context(int gfp_flags); 99struct io_context *current_io_context(gfp_t gfp_flags);
100struct io_context *get_io_context(int gfp_flags); 100struct io_context *get_io_context(gfp_t gfp_flags);
101void copy_io_context(struct io_context **pdst, struct io_context **psrc); 101void copy_io_context(struct io_context **pdst, struct io_context **psrc);
102void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); 102void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
103 103
@@ -107,9 +107,9 @@ typedef void (rq_end_io_fn)(struct request *);
107struct request_list { 107struct request_list {
108 int count[2]; 108 int count[2];
109 int starved[2]; 109 int starved[2];
110 int elvpriv;
110 mempool_t *rq_pool; 111 mempool_t *rq_pool;
111 wait_queue_head_t wait[2]; 112 wait_queue_head_t wait[2];
112 wait_queue_head_t drain;
113}; 113};
114 114
115#define BLK_MAX_CDB 16 115#define BLK_MAX_CDB 16
@@ -203,6 +203,7 @@ struct request {
203enum rq_flag_bits { 203enum rq_flag_bits {
204 __REQ_RW, /* not set, read. set, write */ 204 __REQ_RW, /* not set, read. set, write */
205 __REQ_FAILFAST, /* no low level driver retries */ 205 __REQ_FAILFAST, /* no low level driver retries */
206 __REQ_SORTED, /* elevator knows about this request */
206 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ 207 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
207 __REQ_HARDBARRIER, /* may not be passed by drive either */ 208 __REQ_HARDBARRIER, /* may not be passed by drive either */
208 __REQ_CMD, /* is a regular fs rw request */ 209 __REQ_CMD, /* is a regular fs rw request */
@@ -210,6 +211,7 @@ enum rq_flag_bits {
210 __REQ_STARTED, /* drive already may have started this one */ 211 __REQ_STARTED, /* drive already may have started this one */
211 __REQ_DONTPREP, /* don't call prep for this one */ 212 __REQ_DONTPREP, /* don't call prep for this one */
212 __REQ_QUEUED, /* uses queueing */ 213 __REQ_QUEUED, /* uses queueing */
214 __REQ_ELVPRIV, /* elevator private data attached */
213 /* 215 /*
214 * for ATA/ATAPI devices 216 * for ATA/ATAPI devices
215 */ 217 */
@@ -235,6 +237,7 @@ enum rq_flag_bits {
235 237
236#define REQ_RW (1 << __REQ_RW) 238#define REQ_RW (1 << __REQ_RW)
237#define REQ_FAILFAST (1 << __REQ_FAILFAST) 239#define REQ_FAILFAST (1 << __REQ_FAILFAST)
240#define REQ_SORTED (1 << __REQ_SORTED)
238#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) 241#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
239#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) 242#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
240#define REQ_CMD (1 << __REQ_CMD) 243#define REQ_CMD (1 << __REQ_CMD)
@@ -242,6 +245,7 @@ enum rq_flag_bits {
242#define REQ_STARTED (1 << __REQ_STARTED) 245#define REQ_STARTED (1 << __REQ_STARTED)
243#define REQ_DONTPREP (1 << __REQ_DONTPREP) 246#define REQ_DONTPREP (1 << __REQ_DONTPREP)
244#define REQ_QUEUED (1 << __REQ_QUEUED) 247#define REQ_QUEUED (1 << __REQ_QUEUED)
248#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
245#define REQ_PC (1 << __REQ_PC) 249#define REQ_PC (1 << __REQ_PC)
246#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC) 250#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
247#define REQ_SENSE (1 << __REQ_SENSE) 251#define REQ_SENSE (1 << __REQ_SENSE)
@@ -333,6 +337,12 @@ struct request_queue
333 end_flush_fn *end_flush_fn; 337 end_flush_fn *end_flush_fn;
334 338
335 /* 339 /*
340 * Dispatch queue sorting
341 */
342 sector_t end_sector;
343 struct request *boundary_rq;
344
345 /*
336 * Auto-unplugging state 346 * Auto-unplugging state
337 */ 347 */
338 struct timer_list unplug_timer; 348 struct timer_list unplug_timer;
@@ -354,7 +364,7 @@ struct request_queue
354 * queue needs bounce pages for pages above this limit 364 * queue needs bounce pages for pages above this limit
355 */ 365 */
356 unsigned long bounce_pfn; 366 unsigned long bounce_pfn;
357 unsigned int bounce_gfp; 367 gfp_t bounce_gfp;
358 368
359 /* 369 /*
360 * various queue flags, see QUEUE_* below 370 * various queue flags, see QUEUE_* below
@@ -396,6 +406,7 @@ struct request_queue
396 406
397 atomic_t refcnt; 407 atomic_t refcnt;
398 408
409 unsigned int nr_sorted;
399 unsigned int in_flight; 410 unsigned int in_flight;
400 411
401 /* 412 /*
@@ -405,8 +416,6 @@ struct request_queue
405 unsigned int sg_reserved_size; 416 unsigned int sg_reserved_size;
406 int node; 417 int node;
407 418
408 struct list_head drain_list;
409
410 /* 419 /*
411 * reserved for flush operations 420 * reserved for flush operations
412 */ 421 */
@@ -434,7 +443,7 @@ enum {
434#define QUEUE_FLAG_DEAD 5 /* queue being torn down */ 443#define QUEUE_FLAG_DEAD 5 /* queue being torn down */
435#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ 444#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
436#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ 445#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
437#define QUEUE_FLAG_DRAIN 8 /* draining queue for sched switch */ 446#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
438#define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */ 447#define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */
439 448
440#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) 449#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
@@ -454,6 +463,7 @@ enum {
454#define blk_pm_request(rq) \ 463#define blk_pm_request(rq) \
455 ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) 464 ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME))
456 465
466#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED)
457#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) 467#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER)
458#define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH) 468#define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH)
459#define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH) 469#define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH)
@@ -550,7 +560,7 @@ extern void generic_make_request(struct bio *bio);
550extern void blk_put_request(struct request *); 560extern void blk_put_request(struct request *);
551extern void blk_end_sync_rq(struct request *rq); 561extern void blk_end_sync_rq(struct request *rq);
552extern void blk_attempt_remerge(request_queue_t *, struct request *); 562extern void blk_attempt_remerge(request_queue_t *, struct request *);
553extern struct request *blk_get_request(request_queue_t *, int, int); 563extern struct request *blk_get_request(request_queue_t *, int, gfp_t);
554extern void blk_insert_request(request_queue_t *, struct request *, int, void *); 564extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
555extern void blk_requeue_request(request_queue_t *, struct request *); 565extern void blk_requeue_request(request_queue_t *, struct request *);
556extern void blk_plug_device(request_queue_t *); 566extern void blk_plug_device(request_queue_t *);
@@ -565,7 +575,7 @@ extern void blk_run_queue(request_queue_t *);
565extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); 575extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
566extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); 576extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int);
567extern int blk_rq_unmap_user(struct bio *, unsigned int); 577extern int blk_rq_unmap_user(struct bio *, unsigned int);
568extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int); 578extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t);
569extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); 579extern 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 *, 580extern int blk_execute_rq(request_queue_t *, struct gendisk *,
571 struct request *, int); 581 struct request *, int);
@@ -611,12 +621,22 @@ extern void end_request(struct request *req, int uptodate);
611 621
612static inline void blkdev_dequeue_request(struct request *req) 622static inline void blkdev_dequeue_request(struct request *req)
613{ 623{
614 BUG_ON(list_empty(&req->queuelist)); 624 elv_dequeue_request(req->q, req);
625}
615 626
616 list_del_init(&req->queuelist); 627/*
628 * This should be in elevator.h, but that requires pulling in rq and q
629 */
630static inline void elv_dispatch_add_tail(struct request_queue *q,
631 struct request *rq)
632{
633 if (q->last_merge == rq)
634 q->last_merge = NULL;
635 q->nr_sorted--;
617 636
618 if (req->rl) 637 q->end_sector = rq_end_sector(rq);
619 elv_remove_request(req->q, req); 638 q->boundary_rq = rq;
639 list_add_tail(&rq->queuelist, &q->queue_head);
620} 640}
621 641
622/* 642/*
@@ -650,12 +670,10 @@ extern void blk_dump_rq_flags(struct request *, char *);
650extern void generic_unplug_device(request_queue_t *); 670extern void generic_unplug_device(request_queue_t *);
651extern void __generic_unplug_device(request_queue_t *); 671extern void __generic_unplug_device(request_queue_t *);
652extern long nr_blockdev_pages(void); 672extern long nr_blockdev_pages(void);
653extern void blk_wait_queue_drained(request_queue_t *, int);
654extern void blk_finish_queue_drain(request_queue_t *);
655 673
656int blk_get_queue(request_queue_t *); 674int blk_get_queue(request_queue_t *);
657request_queue_t *blk_alloc_queue(int gfp_mask); 675request_queue_t *blk_alloc_queue(gfp_t);
658request_queue_t *blk_alloc_queue_node(int,int); 676request_queue_t *blk_alloc_queue_node(gfp_t, int);
659#define blk_put_queue(q) blk_cleanup_queue((q)) 677#define blk_put_queue(q) blk_cleanup_queue((q))
660 678
661/* 679/*
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 82bd8842d11c..3b03b0b868dd 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -43,7 +43,7 @@ typedef struct bootmem_data {
43extern unsigned long __init bootmem_bootmap_pages (unsigned long); 43extern unsigned long __init bootmem_bootmap_pages (unsigned long);
44extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); 44extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend);
45extern void __init free_bootmem (unsigned long addr, unsigned long size); 45extern void __init free_bootmem (unsigned long addr, unsigned long size);
46extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); 46extern void * __init __alloc_bootmem_limit (unsigned long size, unsigned long align, unsigned long goal, unsigned long limit);
47#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 47#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
48extern void __init reserve_bootmem (unsigned long addr, unsigned long size); 48extern void __init reserve_bootmem (unsigned long addr, unsigned long size);
49#define alloc_bootmem(x) \ 49#define alloc_bootmem(x) \
@@ -54,6 +54,16 @@ extern void __init reserve_bootmem (unsigned long addr, unsigned long size);
54 __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) 54 __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
55#define alloc_bootmem_low_pages(x) \ 55#define alloc_bootmem_low_pages(x) \
56 __alloc_bootmem((x), PAGE_SIZE, 0) 56 __alloc_bootmem((x), PAGE_SIZE, 0)
57
58#define alloc_bootmem_limit(x, limit) \
59 __alloc_bootmem_limit((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit))
60#define alloc_bootmem_low_limit(x, limit) \
61 __alloc_bootmem_limit((x), SMP_CACHE_BYTES, 0, (limit))
62#define alloc_bootmem_pages_limit(x, limit) \
63 __alloc_bootmem_limit((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit))
64#define alloc_bootmem_low_pages_limit(x, limit) \
65 __alloc_bootmem_limit((x), PAGE_SIZE, 0, (limit))
66
57#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ 67#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
58extern unsigned long __init free_all_bootmem (void); 68extern unsigned long __init free_all_bootmem (void);
59 69
@@ -61,7 +71,7 @@ extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long f
61extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); 71extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size);
62extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); 72extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size);
63extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); 73extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat);
64extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal); 74extern void * __init __alloc_bootmem_node_limit (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit);
65#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 75#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
66#define alloc_bootmem_node(pgdat, x) \ 76#define alloc_bootmem_node(pgdat, x) \
67 __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) 77 __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
@@ -69,6 +79,14 @@ extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size,
69 __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) 79 __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
70#define alloc_bootmem_low_pages_node(pgdat, x) \ 80#define alloc_bootmem_low_pages_node(pgdat, x) \
71 __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0) 81 __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0)
82
83#define alloc_bootmem_node_limit(pgdat, x, limit) \
84 __alloc_bootmem_node_limit((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit))
85#define alloc_bootmem_pages_node_limit(pgdat, x, limit) \
86 __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit))
87#define alloc_bootmem_low_pages_node_limit(pgdat, x, limit) \
88 __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, 0, (limit))
89
72#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ 90#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
73 91
74#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP 92#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
@@ -105,5 +123,15 @@ extern void *__init alloc_large_system_hash(const char *tablename,
105#endif 123#endif
106extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ 124extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */
107 125
126static inline void *__alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal)
127{
128 return __alloc_bootmem_limit(size, align, goal, 0);
129}
130
131static inline void *__alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align,
132 unsigned long goal)
133{
134 return __alloc_bootmem_node_limit(pgdat, size, align, goal, 0);
135}
108 136
109#endif /* _LINUX_BOOTMEM_H */ 137#endif /* _LINUX_BOOTMEM_H */
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 90828493791f..1db061bb6b08 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -126,8 +126,8 @@ BUFFER_FNS(Eopnotsupp, eopnotsupp)
126/* If we *know* page->private refers to buffer_heads */ 126/* If we *know* page->private refers to buffer_heads */
127#define page_buffers(page) \ 127#define page_buffers(page) \
128 ({ \ 128 ({ \
129 BUG_ON(!PagePrivate(page)); \ 129 BUG_ON(!PagePrivate(page)); \
130 ((struct buffer_head *)(page)->private); \ 130 ((struct buffer_head *)page_private(page)); \
131 }) 131 })
132#define page_has_buffers(page) PagePrivate(page) 132#define page_has_buffers(page) PagePrivate(page)
133 133
@@ -172,7 +172,7 @@ void __brelse(struct buffer_head *);
172void __bforget(struct buffer_head *); 172void __bforget(struct buffer_head *);
173void __breadahead(struct block_device *, sector_t block, int size); 173void __breadahead(struct block_device *, sector_t block, int size);
174struct buffer_head *__bread(struct block_device *, sector_t block, int size); 174struct buffer_head *__bread(struct block_device *, sector_t block, int size);
175struct buffer_head *alloc_buffer_head(unsigned int __nocast gfp_flags); 175struct buffer_head *alloc_buffer_head(gfp_t gfp_flags);
176void free_buffer_head(struct buffer_head * bh); 176void free_buffer_head(struct buffer_head * bh);
177void FASTCALL(unlock_buffer(struct buffer_head *bh)); 177void FASTCALL(unlock_buffer(struct buffer_head *bh));
178void FASTCALL(__lock_buffer(struct buffer_head *bh)); 178void FASTCALL(__lock_buffer(struct buffer_head *bh));
@@ -188,8 +188,9 @@ extern int buffer_heads_over_limit;
188 * Generic address_space_operations implementations for buffer_head-backed 188 * Generic address_space_operations implementations for buffer_head-backed
189 * address_spaces. 189 * address_spaces.
190 */ 190 */
191int try_to_release_page(struct page * page, int gfp_mask); 191int try_to_release_page(struct page * page, gfp_t gfp_mask);
192int block_invalidatepage(struct page *page, unsigned long offset); 192int block_invalidatepage(struct page *page, unsigned long offset);
193int do_invalidatepage(struct page *page, unsigned long offset);
193int block_write_full_page(struct page *page, get_block_t *get_block, 194int block_write_full_page(struct page *page, get_block_t *get_block,
194 struct writeback_control *wbc); 195 struct writeback_control *wbc);
195int block_read_full_page(struct page*, get_block_t*); 196int block_read_full_page(struct page*, get_block_t*);
@@ -219,7 +220,7 @@ static inline void attach_page_buffers(struct page *page,
219{ 220{
220 page_cache_get(page); 221 page_cache_get(page);
221 SetPagePrivate(page); 222 SetPagePrivate(page);
222 page->private = (unsigned long)head; 223 set_page_private(page, (unsigned long)head);
223} 224}
224 225
225static inline void get_bh(struct buffer_head *bh) 226static inline void get_bh(struct buffer_head *bh)
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index 424d5e622b43..6e27f42e3a57 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -10,8 +10,8 @@
10typedef struct _cciss_pci_info_struct 10typedef struct _cciss_pci_info_struct
11{ 11{
12 unsigned char bus; 12 unsigned char bus;
13 unsigned short domain;
14 unsigned char dev_fn; 13 unsigned char dev_fn;
14 unsigned short domain;
15 __u32 board_id; 15 __u32 board_id;
16} cciss_pci_info_struct; 16} cciss_pci_info_struct;
17 17
diff --git a/include/linux/cm4000_cs.h b/include/linux/cm4000_cs.h
new file mode 100644
index 000000000000..605ebe24bb2e
--- /dev/null
+++ b/include/linux/cm4000_cs.h
@@ -0,0 +1,66 @@
1#ifndef _CM4000_H_
2#define _CM4000_H_
3
4#define MAX_ATR 33
5
6#define CM4000_MAX_DEV 4
7
8/* those two structures are passed via ioctl() from/to userspace. They are
9 * used by existing userspace programs, so I kepth the awkward "bIFSD" naming
10 * not to break compilation of userspace apps. -HW */
11
12typedef struct atreq {
13 int32_t atr_len;
14 unsigned char atr[64];
15 int32_t power_act;
16 unsigned char bIFSD;
17 unsigned char bIFSC;
18} atreq_t;
19
20
21/* what is particularly stupid in the original driver is the arch-dependant
22 * member sizes. This leads to CONFIG_COMPAT breakage, since 32bit userspace
23 * will lay out the structure members differently than the 64bit kernel.
24 *
25 * I've changed "ptsreq.protocol" from "unsigned long" to "u_int32_t".
26 * On 32bit this will make no difference. With 64bit kernels, it will make
27 * 32bit apps work, too.
28 */
29
30typedef struct ptsreq {
31 u_int32_t protocol; /*T=0: 2^0, T=1: 2^1*/
32 unsigned char flags;
33 unsigned char pts1;
34 unsigned char pts2;
35 unsigned char pts3;
36} ptsreq_t;
37
38#define CM_IOC_MAGIC 'c'
39#define CM_IOC_MAXNR 255
40
41#define CM_IOCGSTATUS _IOR (CM_IOC_MAGIC, 0, unsigned char *)
42#define CM_IOCGATR _IOWR(CM_IOC_MAGIC, 1, atreq_t *)
43#define CM_IOCSPTS _IOW (CM_IOC_MAGIC, 2, ptsreq_t *)
44#define CM_IOCSRDR _IO (CM_IOC_MAGIC, 3)
45#define CM_IOCARDOFF _IO (CM_IOC_MAGIC, 4)
46
47#define CM_IOSDBGLVL _IOW(CM_IOC_MAGIC, 250, int*)
48
49/* card and device states */
50#define CM_CARD_INSERTED 0x01
51#define CM_CARD_POWERED 0x02
52#define CM_ATR_PRESENT 0x04
53#define CM_ATR_VALID 0x08
54#define CM_STATE_VALID 0x0f
55/* extra info only from CM4000 */
56#define CM_NO_READER 0x10
57#define CM_BAD_CARD 0x20
58
59
60#ifdef __KERNEL__
61
62#define DEVICE_NAME "cmm"
63#define MODULE_NAME "cm4000_cs"
64
65#endif /* __KERNEL__ */
66#endif /* _CM4000_H_ */
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
new file mode 100644
index 000000000000..c948f678e04e
--- /dev/null
+++ b/include/linux/cn_proc.h
@@ -0,0 +1,127 @@
1/*
2 * cn_proc.h - process events connector
3 *
4 * Copyright (C) Matt Helsley, IBM Corp. 2005
5 * Based on cn_fork.h by Nguyen Anh Quynh and Guillaume Thouvenin
6 * Original copyright notice follows:
7 * Copyright (C) 2005 Nguyen Anh Quynh <aquynh@gmail.com>
8 * Copyright (C) 2005 Guillaume Thouvenin <guillaume.thouvenin@bull.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#ifndef CN_PROC_H
26#define CN_PROC_H
27
28#include <linux/types.h>
29#include <linux/connector.h>
30
31/*
32 * Userspace sends this enum to register with the kernel that it is listening
33 * for events on the connector.
34 */
35enum proc_cn_mcast_op {
36 PROC_CN_MCAST_LISTEN = 1,
37 PROC_CN_MCAST_IGNORE = 2
38};
39
40/*
41 * From the user's point of view, the process
42 * ID is the thread group ID and thread ID is the internal
43 * kernel "pid". So, fields are assigned as follow:
44 *
45 * In user space - In kernel space
46 *
47 * parent process ID = parent->tgid
48 * parent thread ID = parent->pid
49 * child process ID = child->tgid
50 * child thread ID = child->pid
51 */
52
53struct proc_event {
54 enum what {
55 /* Use successive bits so the enums can be used to record
56 * sets of events as well
57 */
58 PROC_EVENT_NONE = 0x00000000,
59 PROC_EVENT_FORK = 0x00000001,
60 PROC_EVENT_EXEC = 0x00000002,
61 PROC_EVENT_UID = 0x00000004,
62 PROC_EVENT_GID = 0x00000040,
63 /* "next" should be 0x00000400 */
64 /* "last" is the last process event: exit */
65 PROC_EVENT_EXIT = 0x80000000
66 } what;
67 __u32 cpu;
68 union { /* must be last field of proc_event struct */
69 struct {
70 __u32 err;
71 } ack;
72
73 struct fork_proc_event {
74 pid_t parent_pid;
75 pid_t parent_tgid;
76 pid_t child_pid;
77 pid_t child_tgid;
78 } fork;
79
80 struct exec_proc_event {
81 pid_t process_pid;
82 pid_t process_tgid;
83 } exec;
84
85 struct id_proc_event {
86 pid_t process_pid;
87 pid_t process_tgid;
88 union {
89 __u32 ruid; /* task uid */
90 __u32 rgid; /* task gid */
91 } r;
92 union {
93 __u32 euid;
94 __u32 egid;
95 } e;
96 } id;
97
98 struct exit_proc_event {
99 pid_t process_pid;
100 pid_t process_tgid;
101 __u32 exit_code, exit_signal;
102 } exit;
103 } event_data;
104};
105
106#ifdef __KERNEL__
107#ifdef CONFIG_PROC_EVENTS
108void proc_fork_connector(struct task_struct *task);
109void proc_exec_connector(struct task_struct *task);
110void proc_id_connector(struct task_struct *task, int which_id);
111void proc_exit_connector(struct task_struct *task);
112#else
113static inline void proc_fork_connector(struct task_struct *task)
114{}
115
116static inline void proc_exec_connector(struct task_struct *task)
117{}
118
119static inline void proc_id_connector(struct task_struct *task,
120 int which_id)
121{}
122
123static inline void proc_exit_connector(struct task_struct *task)
124{}
125#endif /* CONFIG_PROC_EVENTS */
126#endif /* __KERNEL__ */
127#endif /* CN_PROC_H */
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index ecb0d39c0798..119f9d064cc6 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -10,6 +10,10 @@
10#define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl) 10#define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)sys_ioctl)
11#endif 11#endif
12 12
13
14COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
15COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
16
13/* Big T */ 17/* Big T */
14COMPATIBLE_IOCTL(TCGETA) 18COMPATIBLE_IOCTL(TCGETA)
15COMPATIBLE_IOCTL(TCSETA) 19COMPATIBLE_IOCTL(TCSETA)
@@ -52,13 +56,6 @@ ULONG_IOCTL(TIOCSCTTY)
52COMPATIBLE_IOCTL(TIOCGPTN) 56COMPATIBLE_IOCTL(TIOCGPTN)
53COMPATIBLE_IOCTL(TIOCSPTLCK) 57COMPATIBLE_IOCTL(TIOCSPTLCK)
54COMPATIBLE_IOCTL(TIOCSERGETLSR) 58COMPATIBLE_IOCTL(TIOCSERGETLSR)
55/* Big F */
56COMPATIBLE_IOCTL(FBIOBLANK)
57COMPATIBLE_IOCTL(FBIOGET_VSCREENINFO)
58COMPATIBLE_IOCTL(FBIOPUT_VSCREENINFO)
59COMPATIBLE_IOCTL(FBIOPAN_DISPLAY)
60COMPATIBLE_IOCTL(FBIOGET_CON2FBMAP)
61COMPATIBLE_IOCTL(FBIOPUT_CON2FBMAP)
62/* Little f */ 59/* Little f */
63COMPATIBLE_IOCTL(FIOCLEX) 60COMPATIBLE_IOCTL(FIOCLEX)
64COMPATIBLE_IOCTL(FIONCLEX) 61COMPATIBLE_IOCTL(FIONCLEX)
@@ -81,6 +78,8 @@ COMPATIBLE_IOCTL(HDIO_DRIVE_CMD)
81COMPATIBLE_IOCTL(HDIO_DRIVE_TASK) 78COMPATIBLE_IOCTL(HDIO_DRIVE_TASK)
82COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE) 79COMPATIBLE_IOCTL(HDIO_SET_PIO_MODE)
83COMPATIBLE_IOCTL(HDIO_SET_NICE) 80COMPATIBLE_IOCTL(HDIO_SET_NICE)
81COMPATIBLE_IOCTL(HDIO_SET_KEEPSETTINGS)
82COMPATIBLE_IOCTL(HDIO_SCAN_HWIF)
84/* 0x02 -- Floppy ioctls */ 83/* 0x02 -- Floppy ioctls */
85COMPATIBLE_IOCTL(FDMSGON) 84COMPATIBLE_IOCTL(FDMSGON)
86COMPATIBLE_IOCTL(FDMSGOFF) 85COMPATIBLE_IOCTL(FDMSGOFF)
@@ -99,6 +98,7 @@ COMPATIBLE_IOCTL(FDTWADDLE)
99COMPATIBLE_IOCTL(FDFMTTRK) 98COMPATIBLE_IOCTL(FDFMTTRK)
100COMPATIBLE_IOCTL(FDRAWCMD) 99COMPATIBLE_IOCTL(FDRAWCMD)
101/* 0x12 */ 100/* 0x12 */
101COMPATIBLE_IOCTL(BLKRASET)
102COMPATIBLE_IOCTL(BLKROSET) 102COMPATIBLE_IOCTL(BLKROSET)
103COMPATIBLE_IOCTL(BLKROGET) 103COMPATIBLE_IOCTL(BLKROGET)
104COMPATIBLE_IOCTL(BLKRRPART) 104COMPATIBLE_IOCTL(BLKRRPART)
@@ -259,9 +259,18 @@ COMPATIBLE_IOCTL(RTC_RD_TIME)
259COMPATIBLE_IOCTL(RTC_SET_TIME) 259COMPATIBLE_IOCTL(RTC_SET_TIME)
260COMPATIBLE_IOCTL(RTC_WKALM_SET) 260COMPATIBLE_IOCTL(RTC_WKALM_SET)
261COMPATIBLE_IOCTL(RTC_WKALM_RD) 261COMPATIBLE_IOCTL(RTC_WKALM_RD)
262/*
263 * These two are only for the sbus rtc driver, but
264 * hwclock tries them on every rtc device first when
265 * running on sparc. On other architectures the entries
266 * are useless but harmless.
267 */
268COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
269COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
262/* Little m */ 270/* Little m */
263COMPATIBLE_IOCTL(MTIOCTOP) 271COMPATIBLE_IOCTL(MTIOCTOP)
264/* Socket level stuff */ 272/* Socket level stuff */
273COMPATIBLE_IOCTL(FIOQSIZE)
265COMPATIBLE_IOCTL(FIOSETOWN) 274COMPATIBLE_IOCTL(FIOSETOWN)
266COMPATIBLE_IOCTL(SIOCSPGRP) 275COMPATIBLE_IOCTL(SIOCSPGRP)
267COMPATIBLE_IOCTL(FIOGETOWN) 276COMPATIBLE_IOCTL(FIOGETOWN)
@@ -786,3 +795,70 @@ COMPATIBLE_IOCTL(HIDIOCGFLAG)
786COMPATIBLE_IOCTL(HIDIOCSFLAG) 795COMPATIBLE_IOCTL(HIDIOCSFLAG)
787COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX) 796COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX)
788COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO) 797COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO)
798/* dvb */
799COMPATIBLE_IOCTL(AUDIO_STOP)
800COMPATIBLE_IOCTL(AUDIO_PLAY)
801COMPATIBLE_IOCTL(AUDIO_PAUSE)
802COMPATIBLE_IOCTL(AUDIO_CONTINUE)
803COMPATIBLE_IOCTL(AUDIO_SELECT_SOURCE)
804COMPATIBLE_IOCTL(AUDIO_SET_MUTE)
805COMPATIBLE_IOCTL(AUDIO_SET_AV_SYNC)
806COMPATIBLE_IOCTL(AUDIO_SET_BYPASS_MODE)
807COMPATIBLE_IOCTL(AUDIO_CHANNEL_SELECT)
808COMPATIBLE_IOCTL(AUDIO_GET_STATUS)
809COMPATIBLE_IOCTL(AUDIO_GET_CAPABILITIES)
810COMPATIBLE_IOCTL(AUDIO_CLEAR_BUFFER)
811COMPATIBLE_IOCTL(AUDIO_SET_ID)
812COMPATIBLE_IOCTL(AUDIO_SET_MIXER)
813COMPATIBLE_IOCTL(AUDIO_SET_STREAMTYPE)
814COMPATIBLE_IOCTL(AUDIO_SET_EXT_ID)
815COMPATIBLE_IOCTL(AUDIO_SET_ATTRIBUTES)
816COMPATIBLE_IOCTL(AUDIO_SET_KARAOKE)
817COMPATIBLE_IOCTL(DMX_START)
818COMPATIBLE_IOCTL(DMX_STOP)
819COMPATIBLE_IOCTL(DMX_SET_FILTER)
820COMPATIBLE_IOCTL(DMX_SET_PES_FILTER)
821COMPATIBLE_IOCTL(DMX_SET_BUFFER_SIZE)
822COMPATIBLE_IOCTL(DMX_GET_PES_PIDS)
823COMPATIBLE_IOCTL(DMX_GET_CAPS)
824COMPATIBLE_IOCTL(DMX_SET_SOURCE)
825COMPATIBLE_IOCTL(DMX_GET_STC)
826COMPATIBLE_IOCTL(FE_GET_INFO)
827COMPATIBLE_IOCTL(FE_DISEQC_RESET_OVERLOAD)
828COMPATIBLE_IOCTL(FE_DISEQC_SEND_MASTER_CMD)
829COMPATIBLE_IOCTL(FE_DISEQC_RECV_SLAVE_REPLY)
830COMPATIBLE_IOCTL(FE_DISEQC_SEND_BURST)
831COMPATIBLE_IOCTL(FE_SET_TONE)
832COMPATIBLE_IOCTL(FE_SET_VOLTAGE)
833COMPATIBLE_IOCTL(FE_ENABLE_HIGH_LNB_VOLTAGE)
834COMPATIBLE_IOCTL(FE_READ_STATUS)
835COMPATIBLE_IOCTL(FE_READ_BER)
836COMPATIBLE_IOCTL(FE_READ_SIGNAL_STRENGTH)
837COMPATIBLE_IOCTL(FE_READ_SNR)
838COMPATIBLE_IOCTL(FE_READ_UNCORRECTED_BLOCKS)
839COMPATIBLE_IOCTL(FE_SET_FRONTEND)
840COMPATIBLE_IOCTL(FE_GET_FRONTEND)
841COMPATIBLE_IOCTL(FE_GET_EVENT)
842COMPATIBLE_IOCTL(FE_DISHNETWORK_SEND_LEGACY_CMD)
843COMPATIBLE_IOCTL(VIDEO_STOP)
844COMPATIBLE_IOCTL(VIDEO_PLAY)
845COMPATIBLE_IOCTL(VIDEO_FREEZE)
846COMPATIBLE_IOCTL(VIDEO_CONTINUE)
847COMPATIBLE_IOCTL(VIDEO_SELECT_SOURCE)
848COMPATIBLE_IOCTL(VIDEO_SET_BLANK)
849COMPATIBLE_IOCTL(VIDEO_GET_STATUS)
850COMPATIBLE_IOCTL(VIDEO_SET_DISPLAY_FORMAT)
851COMPATIBLE_IOCTL(VIDEO_FAST_FORWARD)
852COMPATIBLE_IOCTL(VIDEO_SLOWMOTION)
853COMPATIBLE_IOCTL(VIDEO_GET_CAPABILITIES)
854COMPATIBLE_IOCTL(VIDEO_CLEAR_BUFFER)
855COMPATIBLE_IOCTL(VIDEO_SET_ID)
856COMPATIBLE_IOCTL(VIDEO_SET_STREAMTYPE)
857COMPATIBLE_IOCTL(VIDEO_SET_FORMAT)
858COMPATIBLE_IOCTL(VIDEO_SET_SYSTEM)
859COMPATIBLE_IOCTL(VIDEO_SET_HIGHLIGHT)
860COMPATIBLE_IOCTL(VIDEO_SET_SPU)
861COMPATIBLE_IOCTL(VIDEO_GET_NAVI)
862COMPATIBLE_IOCTL(VIDEO_SET_ATTRIBUTES)
863COMPATIBLE_IOCTL(VIDEO_GET_SIZE)
864COMPATIBLE_IOCTL(VIDEO_GET_FRAME_RATE)
diff --git a/include/linux/config.h b/include/linux/config.h
index 9d1c14f7ad6d..a91f5e55b525 100644
--- a/include/linux/config.h
+++ b/include/linux/config.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_CONFIG_H 1#ifndef _LINUX_CONFIG_H
2#define _LINUX_CONFIG_H 2#define _LINUX_CONFIG_H
3 3/* This file is no longer in use and kept only for backward compatibility.
4 * autoconf.h is now included via -imacros on the commandline
5 */
4#include <linux/autoconf.h> 6#include <linux/autoconf.h>
5 7
6#endif 8#endif
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 96de26301f84..ad1a22c1c42e 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -27,6 +27,14 @@
27#define CN_IDX_CONNECTOR 0xffffffff 27#define CN_IDX_CONNECTOR 0xffffffff
28#define CN_VAL_CONNECTOR 0xffffffff 28#define CN_VAL_CONNECTOR 0xffffffff
29 29
30/*
31 * Process Events connector unique ids -- used for message routing
32 */
33#define CN_IDX_PROC 0x1
34#define CN_VAL_PROC 0x1
35#define CN_IDX_CIFS 0x2
36#define CN_VAL_CIFS 0x1
37
30#define CN_NETLINK_USERS 1 38#define CN_NETLINK_USERS 1
31 39
32/* 40/*
@@ -104,12 +112,19 @@ struct cn_queue_dev {
104 struct sock *nls; 112 struct sock *nls;
105}; 113};
106 114
107struct cn_callback { 115struct cn_callback_id {
108 unsigned char name[CN_CBQ_NAMELEN]; 116 unsigned char name[CN_CBQ_NAMELEN];
109
110 struct cb_id id; 117 struct cb_id id;
118};
119
120struct cn_callback_data {
121 void (*destruct_data) (void *);
122 void *ddata;
123
124 void *callback_priv;
111 void (*callback) (void *); 125 void (*callback) (void *);
112 void *priv; 126
127 void *free;
113}; 128};
114 129
115struct cn_callback_entry { 130struct cn_callback_entry {
@@ -118,8 +133,8 @@ struct cn_callback_entry {
118 struct work_struct work; 133 struct work_struct work;
119 struct cn_queue_dev *pdev; 134 struct cn_queue_dev *pdev;
120 135
121 void (*destruct_data) (void *); 136 struct cn_callback_id id;
122 void *ddata; 137 struct cn_callback_data data;
123 138
124 int seq, group; 139 int seq, group;
125 struct sock *nls; 140 struct sock *nls;
@@ -142,9 +157,9 @@ struct cn_dev {
142 157
143int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); 158int cn_add_callback(struct cb_id *, char *, void (*callback) (void *));
144void cn_del_callback(struct cb_id *); 159void cn_del_callback(struct cb_id *);
145int cn_netlink_send(struct cn_msg *, u32, int); 160int cn_netlink_send(struct cn_msg *, u32, gfp_t);
146 161
147int cn_queue_add_callback(struct cn_queue_dev *dev, struct cn_callback *cb); 162int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *));
148void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); 163void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
149 164
150struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); 165struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *);
@@ -152,6 +167,8 @@ void cn_queue_free_dev(struct cn_queue_dev *dev);
152 167
153int cn_cb_equal(struct cb_id *, struct cb_id *); 168int cn_cb_equal(struct cb_id *, struct cb_id *);
154 169
170void cn_queue_wrapper(void *data);
171
155extern int cn_already_initialized; 172extern int cn_already_initialized;
156 173
157#endif /* __KERNEL__ */ 174#endif /* __KERNEL__ */
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index 725be90ef55e..f8e5587a0f92 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -9,6 +9,8 @@
9 * to achieve effects such as fast scrolling by changing the origin. 9 * to achieve effects such as fast scrolling by changing the origin.
10 */ 10 */
11 11
12#include <linux/vt.h>
13
12struct vt_struct; 14struct vt_struct;
13 15
14#define NPAR 16 16#define NPAR 16
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 86980c68234a..0ed1d4853c69 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -32,6 +32,7 @@ struct cpu {
32}; 32};
33 33
34extern int register_cpu(struct cpu *, int, struct node *); 34extern int register_cpu(struct cpu *, int, struct node *);
35extern struct sys_device *get_cpu_sysdev(int cpu);
35#ifdef CONFIG_HOTPLUG_CPU 36#ifdef CONFIG_HOTPLUG_CPU
36extern void unregister_cpu(struct cpu *, struct node *); 37extern void unregister_cpu(struct cpu *, struct node *);
37#endif 38#endif
@@ -41,6 +42,7 @@ struct notifier_block;
41/* Need to know about CPUs going up/down? */ 42/* Need to know about CPUs going up/down? */
42extern int register_cpu_notifier(struct notifier_block *nb); 43extern int register_cpu_notifier(struct notifier_block *nb);
43extern void unregister_cpu_notifier(struct notifier_block *nb); 44extern void unregister_cpu_notifier(struct notifier_block *nb);
45extern int current_in_cpu_hotplug(void);
44 46
45int cpu_up(unsigned int cpu); 47int cpu_up(unsigned int cpu);
46 48
@@ -53,16 +55,19 @@ static inline int register_cpu_notifier(struct notifier_block *nb)
53static inline void unregister_cpu_notifier(struct notifier_block *nb) 55static inline void unregister_cpu_notifier(struct notifier_block *nb)
54{ 56{
55} 57}
58static inline int current_in_cpu_hotplug(void)
59{
60 return 0;
61}
56 62
57#endif /* CONFIG_SMP */ 63#endif /* CONFIG_SMP */
58extern struct sysdev_class cpu_sysdev_class; 64extern struct sysdev_class cpu_sysdev_class;
59 65
60#ifdef CONFIG_HOTPLUG_CPU 66#ifdef CONFIG_HOTPLUG_CPU
61/* Stop CPUs going up and down. */ 67/* Stop CPUs going up and down. */
62extern struct semaphore cpucontrol; 68extern void lock_cpu_hotplug(void);
63#define lock_cpu_hotplug() down(&cpucontrol) 69extern void unlock_cpu_hotplug(void);
64#define unlock_cpu_hotplug() up(&cpucontrol) 70extern int lock_cpu_hotplug_interruptible(void);
65#define lock_cpu_hotplug_interruptible() down_interruptible(&cpucontrol)
66#define hotcpu_notifier(fn, pri) { \ 71#define hotcpu_notifier(fn, pri) { \
67 static struct notifier_block fn##_nb = \ 72 static struct notifier_block fn##_nb = \
68 { .notifier_call = fn, .priority = pri }; \ 73 { .notifier_call = fn, .priority = pri }; \
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index ff7f80f48df1..d068176b7ad7 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -23,6 +23,7 @@
23#include <linux/completion.h> 23#include <linux/completion.h>
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25#include <linux/cpumask.h> 25#include <linux/cpumask.h>
26#include <asm/div64.h>
26 27
27#define CPUFREQ_NAME_LEN 16 28#define CPUFREQ_NAME_LEN 16
28 29
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index b15826f6e3a2..13e9f4a3ab26 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -12,6 +12,8 @@
12 * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c. 12 * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c.
13 * For details of cpulist_scnprintf() and cpulist_parse(), see 13 * For details of cpulist_scnprintf() and cpulist_parse(), see
14 * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. 14 * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c.
15 * For details of cpu_remap(), see bitmap_bitremap in lib/bitmap.c
16 * For details of cpus_remap(), see bitmap_remap in lib/bitmap.c.
15 * 17 *
16 * The available cpumask operations are: 18 * The available cpumask operations are:
17 * 19 *
@@ -50,6 +52,8 @@
50 * int cpumask_parse(ubuf, ulen, mask) Parse ascii string as cpumask 52 * int cpumask_parse(ubuf, ulen, mask) Parse ascii string as cpumask
51 * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing 53 * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing
52 * int cpulist_parse(buf, map) Parse ascii string as cpulist 54 * int cpulist_parse(buf, map) Parse ascii string as cpulist
55 * int cpu_remap(oldbit, old, new) newbit = map(old, new)(oldbit)
56 * int cpus_remap(dst, src, old, new) *dst = map(old, new)(src)
53 * 57 *
54 * for_each_cpu_mask(cpu, mask) for-loop cpu over mask 58 * for_each_cpu_mask(cpu, mask) for-loop cpu over mask
55 * 59 *
@@ -294,6 +298,22 @@ static inline int __cpulist_parse(const char *buf, cpumask_t *dstp, int nbits)
294 return bitmap_parselist(buf, dstp->bits, nbits); 298 return bitmap_parselist(buf, dstp->bits, nbits);
295} 299}
296 300
301#define cpu_remap(oldbit, old, new) \
302 __cpu_remap((oldbit), &(old), &(new), NR_CPUS)
303static inline int __cpu_remap(int oldbit,
304 const cpumask_t *oldp, const cpumask_t *newp, int nbits)
305{
306 return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
307}
308
309#define cpus_remap(dst, src, old, new) \
310 __cpus_remap(&(dst), &(src), &(old), &(new), NR_CPUS)
311static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp,
312 const cpumask_t *oldp, const cpumask_t *newp, int nbits)
313{
314 bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
315}
316
297#if NR_CPUS > 1 317#if NR_CPUS > 1
298#define for_each_cpu_mask(cpu, mask) \ 318#define for_each_cpu_mask(cpu, mask) \
299 for ((cpu) = first_cpu(mask); \ 319 for ((cpu) = first_cpu(mask); \
@@ -392,4 +412,14 @@ extern cpumask_t cpu_present_map;
392#define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) 412#define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map)
393#define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) 413#define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)
394 414
415/* Find the highest possible smp_processor_id() */
416#define highest_possible_processor_id() \
417({ \
418 unsigned int cpu, highest = 0; \
419 for_each_cpu_mask(cpu, cpu_possible_map) \
420 highest = cpu; \
421 highest; \
422})
423
424
395#endif /* __LINUX_CPUMASK_H */ 425#endif /* __LINUX_CPUMASK_H */
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 24062a1dbf61..6e2deef96b34 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -23,7 +23,7 @@ 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);
26extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask); 26extern int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask);
27extern int cpuset_excl_nodes_overlap(const struct task_struct *p); 27extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
28extern struct file_operations proc_cpuset_operations; 28extern struct file_operations proc_cpuset_operations;
29extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); 29extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer);
@@ -49,8 +49,7 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
49 return 1; 49 return 1;
50} 50}
51 51
52static inline int cpuset_zone_allowed(struct zone *z, 52static inline int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask)
53 unsigned int __nocast gfp_mask)
54{ 53{
55 return 1; 54 return 1;
56} 55}
diff --git a/include/linux/cyclomx.h b/include/linux/cyclomx.h
index 04fa7dff079c..300d704bdb9a 100644
--- a/include/linux/cyclomx.h
+++ b/include/linux/cyclomx.h
@@ -37,8 +37,6 @@
37#include <linux/cycx_x25.h> 37#include <linux/cycx_x25.h>
38#endif 38#endif
39 39
40#define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0)
41
42/* Adapter Data Space. 40/* Adapter Data Space.
43 * This structure is needed because we handle multiple cards, otherwise 41 * This structure is needed because we handle multiple cards, otherwise
44 * static data would do it. 42 * static data would do it.
diff --git a/include/linux/cycx_drv.h b/include/linux/cycx_drv.h
index 6621df86a748..12fe6b0bfcff 100644
--- a/include/linux/cycx_drv.h
+++ b/include/linux/cycx_drv.h
@@ -60,6 +60,5 @@ extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
60extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); 60extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len);
61extern int cycx_exec(void __iomem *addr); 61extern int cycx_exec(void __iomem *addr);
62 62
63extern void cycx_inten(struct cycx_hw *hw);
64extern void cycx_intr(struct cycx_hw *hw); 63extern void cycx_intr(struct cycx_hw *hw);
65#endif /* _CYCX_DRV_H */ 64#endif /* _CYCX_DRV_H */
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index ab04b4f9b0db..46a2ba617595 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -329,6 +329,7 @@ static inline int d_mountpoint(struct dentry *dentry)
329} 329}
330 330
331extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *); 331extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *);
332extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
332extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); 333extern struct dentry *lookup_create(struct nameidata *nd, int is_dir);
333 334
334extern int sysctl_vfs_cache_pressure; 335extern int sysctl_vfs_cache_pressure;
diff --git a/include/linux/device.h b/include/linux/device.h
index 06e5d42f2c7b..17cbc6db67b4 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -28,19 +28,6 @@
28#define BUS_ID_SIZE KOBJ_NAME_LEN 28#define BUS_ID_SIZE KOBJ_NAME_LEN
29 29
30 30
31enum {
32 SUSPEND_NOTIFY,
33 SUSPEND_SAVE_STATE,
34 SUSPEND_DISABLE,
35 SUSPEND_POWER_DOWN,
36};
37
38enum {
39 RESUME_POWER_ON,
40 RESUME_RESTORE_STATE,
41 RESUME_ENABLE,
42};
43
44struct device; 31struct device;
45struct device_driver; 32struct device_driver;
46struct class; 33struct class;
@@ -115,8 +102,8 @@ struct device_driver {
115 int (*probe) (struct device * dev); 102 int (*probe) (struct device * dev);
116 int (*remove) (struct device * dev); 103 int (*remove) (struct device * dev);
117 void (*shutdown) (struct device * dev); 104 void (*shutdown) (struct device * dev);
118 int (*suspend) (struct device * dev, pm_message_t state, u32 level); 105 int (*suspend) (struct device * dev, pm_message_t state);
119 int (*resume) (struct device * dev, u32 level); 106 int (*resume) (struct device * dev);
120}; 107};
121 108
122 109
@@ -190,7 +177,43 @@ struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store)
190extern int class_create_file(struct class *, const struct class_attribute *); 177extern int class_create_file(struct class *, const struct class_attribute *);
191extern void class_remove_file(struct class *, const struct class_attribute *); 178extern void class_remove_file(struct class *, const struct class_attribute *);
192 179
180struct class_device_attribute {
181 struct attribute attr;
182 ssize_t (*show)(struct class_device *, char * buf);
183 ssize_t (*store)(struct class_device *, const char * buf, size_t count);
184};
185
186#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \
187struct class_device_attribute class_device_attr_##_name = \
188 __ATTR(_name,_mode,_show,_store)
193 189
190extern int class_device_create_file(struct class_device *,
191 const struct class_device_attribute *);
192
193/**
194 * struct class_device - class devices
195 * @class: pointer to the parent class for this class device. This is required.
196 * @devt: for internal use by the driver core only.
197 * @node: for internal use by the driver core only.
198 * @kobj: for internal use by the driver core only.
199 * @devt_attr: for internal use by the driver core only.
200 * @dev: if set, a symlink to the struct device is created in the sysfs
201 * directory for this struct class device.
202 * @class_data: pointer to whatever you want to store here for this struct
203 * class_device. Use class_get_devdata() and class_set_devdata() to get and
204 * set this pointer.
205 * @parent: pointer to a struct class_device that is the parent of this struct
206 * class_device. If NULL, this class_device will show up at the root of the
207 * struct class in sysfs (which is probably what you want to have happen.)
208 * @release: pointer to a release function for this struct class_device. If
209 * set, this will be called instead of the class specific release function.
210 * Only use this if you want to override the default release function, like
211 * when you are nesting class_device structures.
212 * @hotplug: pointer to a hotplug function for this struct class_device. If
213 * set, this will be called instead of the class specific hotplug function.
214 * Only use this if you want to override the default hotplug function, like
215 * when you are nesting class_device structures.
216 */
194struct class_device { 217struct class_device {
195 struct list_head node; 218 struct list_head node;
196 219
@@ -198,9 +221,14 @@ struct class_device {
198 struct class * class; /* required */ 221 struct class * class; /* required */
199 dev_t devt; /* dev_t, creates the sysfs "dev" */ 222 dev_t devt; /* dev_t, creates the sysfs "dev" */
200 struct class_device_attribute *devt_attr; 223 struct class_device_attribute *devt_attr;
224 struct class_device_attribute uevent_attr;
201 struct device * dev; /* not necessary, but nice to have */ 225 struct device * dev; /* not necessary, but nice to have */
202 void * class_data; /* class-specific data */ 226 void * class_data; /* class-specific data */
227 struct class_device *parent; /* parent of this child device, if there is one */
203 228
229 void (*release)(struct class_device *dev);
230 int (*hotplug)(struct class_device *dev, char **envp,
231 int num_envp, char *buffer, int buffer_size);
204 char class_id[BUS_ID_SIZE]; /* unique to this class */ 232 char class_id[BUS_ID_SIZE]; /* unique to this class */
205}; 233};
206 234
@@ -228,18 +256,6 @@ extern int class_device_rename(struct class_device *, char *);
228extern struct class_device * class_device_get(struct class_device *); 256extern struct class_device * class_device_get(struct class_device *);
229extern void class_device_put(struct class_device *); 257extern void class_device_put(struct class_device *);
230 258
231struct class_device_attribute {
232 struct attribute attr;
233 ssize_t (*show)(struct class_device *, char * buf);
234 ssize_t (*store)(struct class_device *, const char * buf, size_t count);
235};
236
237#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \
238struct class_device_attribute class_device_attr_##_name = \
239 __ATTR(_name,_mode,_show,_store)
240
241extern int class_device_create_file(struct class_device *,
242 const struct class_device_attribute *);
243extern void class_device_remove_file(struct class_device *, 259extern void class_device_remove_file(struct class_device *,
244 const struct class_device_attribute *); 260 const struct class_device_attribute *);
245extern int class_device_create_bin_file(struct class_device *, 261extern int class_device_create_bin_file(struct class_device *,
@@ -251,8 +267,8 @@ struct class_interface {
251 struct list_head node; 267 struct list_head node;
252 struct class *class; 268 struct class *class;
253 269
254 int (*add) (struct class_device *); 270 int (*add) (struct class_device *, struct class_interface *);
255 void (*remove) (struct class_device *); 271 void (*remove) (struct class_device *, struct class_interface *);
256}; 272};
257 273
258extern int class_interface_register(struct class_interface *); 274extern int class_interface_register(struct class_interface *);
@@ -260,12 +276,29 @@ extern void class_interface_unregister(struct class_interface *);
260 276
261extern struct class *class_create(struct module *owner, char *name); 277extern struct class *class_create(struct module *owner, char *name);
262extern void class_destroy(struct class *cls); 278extern void class_destroy(struct class *cls);
263extern struct class_device *class_device_create(struct class *cls, dev_t devt, 279extern struct class_device *class_device_create(struct class *cls,
264 struct device *device, char *fmt, ...) 280 struct class_device *parent,
265 __attribute__((format(printf,4,5))); 281 dev_t devt,
282 struct device *device,
283 char *fmt, ...)
284 __attribute__((format(printf,5,6)));
266extern void class_device_destroy(struct class *cls, dev_t devt); 285extern void class_device_destroy(struct class *cls, dev_t devt);
267 286
268 287
288/* interface for exporting device attributes */
289struct device_attribute {
290 struct attribute attr;
291 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
292 char *buf);
293 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
294 const char *buf, size_t count);
295};
296
297#define DEVICE_ATTR(_name,_mode,_show,_store) \
298struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
299
300extern int device_create_file(struct device *device, struct device_attribute * entry);
301extern void device_remove_file(struct device * dev, struct device_attribute * attr);
269struct device { 302struct device {
270 struct klist klist_children; 303 struct klist klist_children;
271 struct klist_node knode_parent; /* node in sibling list */ 304 struct klist_node knode_parent; /* node in sibling list */
@@ -275,6 +308,7 @@ struct device {
275 308
276 struct kobject kobj; 309 struct kobject kobj;
277 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 310 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
311 struct device_attribute uevent_attr;
278 312
279 struct semaphore sem; /* semaphore to synchronize calls to 313 struct semaphore sem; /* semaphore to synchronize calls to
280 * its driver. 314 * its driver.
@@ -317,6 +351,11 @@ dev_set_drvdata (struct device *dev, void *data)
317 dev->driver_data = data; 351 dev->driver_data = data;
318} 352}
319 353
354static inline int device_is_registered(struct device *dev)
355{
356 return klist_node_attached(&dev->knode_bus);
357}
358
320/* 359/*
321 * High level routines for use by the bus drivers 360 * High level routines for use by the bus drivers
322 */ 361 */
@@ -338,23 +377,6 @@ extern int device_attach(struct device * dev);
338extern void driver_attach(struct device_driver * drv); 377extern void driver_attach(struct device_driver * drv);
339 378
340 379
341/* driverfs interface for exporting device attributes */
342
343struct device_attribute {
344 struct attribute attr;
345 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
346 char *buf);
347 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
348 const char *buf, size_t count);
349};
350
351#define DEVICE_ATTR(_name,_mode,_show,_store) \
352struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
353
354
355extern int device_create_file(struct device *device, struct device_attribute * entry);
356extern void device_remove_file(struct device * dev, struct device_attribute * attr);
357
358/* 380/*
359 * Platform "fixup" functions - allow the platform to have their say 381 * Platform "fixup" functions - allow the platform to have their say
360 * about devices and actions that the general device layer doesn't 382 * about devices and actions that the general device layer doesn't
@@ -374,32 +396,6 @@ extern struct device * get_device(struct device * dev);
374extern void put_device(struct device * dev); 396extern void put_device(struct device * dev);
375 397
376 398
377/* drivers/base/platform.c */
378
379struct platform_device {
380 const char * name;
381 u32 id;
382 struct device dev;
383 u32 num_resources;
384 struct resource * resource;
385};
386
387#define to_platform_device(x) container_of((x), struct platform_device, dev)
388
389extern int platform_device_register(struct platform_device *);
390extern void platform_device_unregister(struct platform_device *);
391
392extern struct bus_type platform_bus_type;
393extern struct device platform_bus;
394
395extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int);
396extern int platform_get_irq(struct platform_device *, unsigned int);
397extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *);
398extern int platform_get_irq_byname(struct platform_device *, char *);
399extern int platform_add_devices(struct platform_device **, int);
400
401extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int);
402
403/* drivers/base/power.c */ 399/* drivers/base/power.c */
404extern void device_shutdown(void); 400extern void device_shutdown(void);
405 401
diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h
index 4932ee5c77f0..76f12f46db7f 100644
--- a/include/linux/dmapool.h
+++ b/include/linux/dmapool.h
@@ -19,7 +19,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev,
19 19
20void dma_pool_destroy(struct dma_pool *pool); 20void dma_pool_destroy(struct dma_pool *pool);
21 21
22void *dma_pool_alloc(struct dma_pool *pool, unsigned int __nocast mem_flags, 22void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
23 dma_addr_t *handle); 23 dma_addr_t *handle);
24 24
25void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); 25void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr);
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index a415f1d93e9a..05f4132622fc 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -60,7 +60,7 @@ struct dmi_device {
60 void *device_data; /* Type specific data */ 60 void *device_data; /* Type specific data */
61}; 61};
62 62
63#if defined(CONFIG_X86) && !defined(CONFIG_X86_64) 63#if defined(CONFIG_X86_32)
64 64
65extern int dmi_check_system(struct dmi_system_id *list); 65extern int dmi_check_system(struct dmi_system_id *list);
66extern char * dmi_get_system_info(int field); 66extern char * dmi_get_system_info(int field);
diff --git a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h
index cb31719ee192..2fda1b2aabd9 100644
--- a/include/linux/dqblk_xfs.h
+++ b/include/linux/dqblk_xfs.h
@@ -1,22 +1,18 @@
1/* 1/*
2 * Copyright (c) 1995-2001,2004 Silicon Graphics, Inc. All Rights Reserved. 2 * Copyright (c) 1995-2001,2004 Silicon Graphics, Inc. All Rights Reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or
5 * under the terms of version 2.1 of the GNU Lesser General Public License 5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation. 6 * as published by the Free Software Foundation.
7 * 7 *
8 * This program is distributed in the hope that it will be useful, 8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details. 11 * GNU Lesser General Public License for more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License 13 * You should have received a copy of the GNU Lesset General Public License
14 * along with this program; if not, write to the Free Software 14 * along with this program; if not, write to the Free Software Foundation,
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 15 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 * USA
17 *
18 * Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
19 * Mountain View, CA 94043, USA, or: http://www.sgi.com
20 */ 16 */
21#ifndef _LINUX_DQBLK_XFS_H 17#ifndef _LINUX_DQBLK_XFS_H
22#define _LINUX_DQBLK_XFS_H 18#define _LINUX_DQBLK_XFS_H
@@ -32,7 +28,8 @@
32 28
33#define XQM_USRQUOTA 0 /* system call user quota type */ 29#define XQM_USRQUOTA 0 /* system call user quota type */
34#define XQM_GRPQUOTA 1 /* system call group quota type */ 30#define XQM_GRPQUOTA 1 /* system call group quota type */
35#define XQM_MAXQUOTAS 2 31#define XQM_PRJQUOTA 2 /* system call project quota type */
32#define XQM_MAXQUOTAS 3
36 33
37#define Q_XQUOTAON XQM_CMD(1) /* enable accounting/enforcement */ 34#define Q_XQUOTAON XQM_CMD(1) /* enable accounting/enforcement */
38#define Q_XQUOTAOFF XQM_CMD(2) /* disable accounting/enforcement */ 35#define Q_XQUOTAOFF XQM_CMD(2) /* disable accounting/enforcement */
@@ -40,6 +37,7 @@
40#define Q_XSETQLIM XQM_CMD(4) /* set disk limits */ 37#define Q_XSETQLIM XQM_CMD(4) /* set disk limits */
41#define Q_XGETQSTAT XQM_CMD(5) /* get quota subsystem status */ 38#define Q_XGETQSTAT XQM_CMD(5) /* get quota subsystem status */
42#define Q_XQUOTARM XQM_CMD(6) /* free disk space used by dquots */ 39#define Q_XQUOTARM XQM_CMD(6) /* free disk space used by dquots */
40#define Q_XQUOTASYNC XQM_CMD(7) /* delalloc flush, updates dquots */
43 41
44/* 42/*
45 * fs_disk_quota structure: 43 * fs_disk_quota structure:
diff --git a/include/linux/ds17287rtc.h b/include/linux/ds17287rtc.h
new file mode 100644
index 000000000000..c281ba42e28f
--- /dev/null
+++ b/include/linux/ds17287rtc.h
@@ -0,0 +1,67 @@
1/*
2 * ds17287rtc.h - register definitions for the ds1728[57] RTC / CMOS RAM
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * (C) 2003 Guido Guenther <agx@sigxcpu.org>
9 */
10#ifndef __LINUX_DS17287RTC_H
11#define __LINUX_DS17287RTC_H
12
13#include <linux/rtc.h> /* get the user-level API */
14#include <linux/spinlock.h> /* spinlock_t */
15#include <linux/mc146818rtc.h>
16
17/* Register A */
18#define DS_REGA_DV2 0x40 /* countdown chain */
19#define DS_REGA_DV1 0x20 /* oscillator enable */
20#define DS_REGA_DV0 0x10 /* bank select */
21
22/* bank 1 registers */
23#define DS_B1_MODEL 0x40 /* model number byte */
24#define DS_B1_SN1 0x41 /* serial number byte 1 */
25#define DS_B1_SN2 0x42 /* serial number byte 2 */
26#define DS_B1_SN3 0x43 /* serial number byte 3 */
27#define DS_B1_SN4 0x44 /* serial number byte 4 */
28#define DS_B1_SN5 0x45 /* serial number byte 5 */
29#define DS_B1_SN6 0x46 /* serial number byte 6 */
30#define DS_B1_CRC 0x47 /* CRC byte */
31#define DS_B1_CENTURY 0x48 /* Century byte */
32#define DS_B1_DALARM 0x49 /* date alarm */
33#define DS_B1_XCTRL4A 0x4a /* extendec control register 4a */
34#define DS_B1_XCTRL4B 0x4b /* extendec control register 4b */
35#define DS_B1_RTCADDR2 0x4e /* rtc address 2 */
36#define DS_B1_RTCADDR3 0x4f /* rtc address 3 */
37#define DS_B1_RAMLSB 0x50 /* extended ram LSB */
38#define DS_B1_RAMMSB 0x51 /* extended ram MSB */
39#define DS_B1_RAMDPORT 0x53 /* extended ram data port */
40
41/* register details */
42/* extended control register 4a */
43#define DS_XCTRL4A_VRT2 0x80 /* valid ram and time */
44#define DS_XCTRL4A_INCR 0x40 /* increment progress status */
45#define DS_XCTRL4A_BME 0x20 /* burst mode enable */
46#define DS_XCTRL4A_PAB 0x08 /* power active bar ctrl */
47#define DS_XCTRL4A_RF 0x04 /* ram clear flag */
48#define DS_XCTRL4A_WF 0x02 /* wake up alarm flag */
49#define DS_XCTRL4A_KF 0x01 /* kickstart flag */
50
51/* interrupt causes */
52#define DS_XCTRL4A_IFS (DS_XCTRL4A_RF|DS_XCTRL4A_WF|DS_XCTRL4A_KF)
53
54/* extended control register 4b */
55#define DS_XCTRL4B_ABE 0x80 /* auxiliary battery enable */
56#define DS_XCTRL4B_E32K 0x40 /* enable 32.768 kHz Output */
57#define DS_XCTRL4B_CS 0x20 /* crystal select */
58#define DS_XCTRL4B_RCE 0x10 /* ram clear enable */
59#define DS_XCTRL4B_PRS 0x08 /* PAB resec select */
60#define DS_XCTRL4B_RIE 0x04 /* ram clear interrupt enable */
61#define DS_XCTRL4B_WFE 0x02 /* wake up alarm interrupt enable */
62#define DS_XCTRL4B_KFE 0x01 /* kickstart interrupt enable */
63
64/* interrupt enable bits */
65#define DS_XCTRL4B_IFES (DS_XCTRL4B_RIE|DS_XCTRL4B_WFE|DS_XCTRL4B_KFE)
66
67#endif /* __LINUX_DS17287RTC_H */
diff --git a/include/linux/ds1742rtc.h b/include/linux/ds1742rtc.h
new file mode 100644
index 000000000000..a83cdd1cafc9
--- /dev/null
+++ b/include/linux/ds1742rtc.h
@@ -0,0 +1,53 @@
1/*
2 * ds1742rtc.h - register definitions for the Real-Time-Clock / CMOS RAM
3 *
4 * Copyright (C) 1999-2001 Toshiba Corporation
5 * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org)
6 *
7 * Permission is hereby granted to copy, modify and redistribute this code
8 * in terms of the GNU Library General Public License, Version 2 or later,
9 * at your option.
10 */
11#ifndef __LINUX_DS1742RTC_H
12#define __LINUX_DS1742RTC_H
13
14#include <asm/ds1742.h>
15
16#define RTC_BRAM_SIZE 0x800
17#define RTC_OFFSET 0x7f8
18
19/*
20 * Register summary
21 */
22#define RTC_CONTROL (RTC_OFFSET + 0)
23#define RTC_CENTURY (RTC_OFFSET + 0)
24#define RTC_SECONDS (RTC_OFFSET + 1)
25#define RTC_MINUTES (RTC_OFFSET + 2)
26#define RTC_HOURS (RTC_OFFSET + 3)
27#define RTC_DAY (RTC_OFFSET + 4)
28#define RTC_DATE (RTC_OFFSET + 5)
29#define RTC_MONTH (RTC_OFFSET + 6)
30#define RTC_YEAR (RTC_OFFSET + 7)
31
32#define RTC_CENTURY_MASK 0x3f
33#define RTC_SECONDS_MASK 0x7f
34#define RTC_DAY_MASK 0x07
35
36/*
37 * Bits in the Control/Century register
38 */
39#define RTC_WRITE 0x80
40#define RTC_READ 0x40
41
42/*
43 * Bits in the Seconds register
44 */
45#define RTC_STOP 0x80
46
47/*
48 * Bits in the Day register
49 */
50#define RTC_BATT_FLAG 0x80
51#define RTC_FREQ_TEST 0x40
52
53#endif /* __LINUX_DS1742RTC_H */
diff --git a/include/linux/eeprom.h b/include/linux/eeprom.h
deleted file mode 100644
index 38afd9da1dfe..000000000000
--- a/include/linux/eeprom.h
+++ /dev/null
@@ -1,136 +0,0 @@
1/* credit winbond-840.c
2 */
3#include <asm/io.h>
4struct eeprom_ops {
5 void (*set_cs)(void *ee);
6 void (*clear_cs)(void *ee);
7};
8
9#define EEPOL_EEDI 0x01
10#define EEPOL_EEDO 0x02
11#define EEPOL_EECLK 0x04
12#define EEPOL_EESEL 0x08
13
14struct eeprom {
15 void *dev;
16 struct eeprom_ops *ops;
17
18 void __iomem * addr;
19
20 unsigned ee_addr_bits;
21
22 unsigned eesel;
23 unsigned eeclk;
24 unsigned eedo;
25 unsigned eedi;
26 unsigned polarity;
27 unsigned ee_state;
28
29 spinlock_t *lock;
30 u32 *cache;
31};
32
33
34u8 eeprom_readb(struct eeprom *ee, unsigned address);
35void eeprom_read(struct eeprom *ee, unsigned address, u8 *bytes,
36 unsigned count);
37void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data);
38void eeprom_write(struct eeprom *ee, unsigned address, u8 *bytes,
39 unsigned count);
40
41/* The EEPROM commands include the alway-set leading bit. */
42enum EEPROM_Cmds {
43 EE_WriteCmd=(5 << 6), EE_ReadCmd=(6 << 6), EE_EraseCmd=(7 << 6),
44};
45
46void setup_ee_mem_bitbanger(struct eeprom *ee, void __iomem *memaddr, int eesel_bit, int eeclk_bit, int eedo_bit, int eedi_bit, unsigned polarity)
47{
48 ee->addr = memaddr;
49 ee->eesel = 1 << eesel_bit;
50 ee->eeclk = 1 << eeclk_bit;
51 ee->eedo = 1 << eedo_bit;
52 ee->eedi = 1 << eedi_bit;
53
54 ee->polarity = polarity;
55
56 *ee->cache = readl(ee->addr);
57}
58
59/* foo. put this in a .c file */
60static inline void eeprom_update(struct eeprom *ee, u32 mask, int pol)
61{
62 unsigned long flags;
63 u32 data;
64
65 spin_lock_irqsave(ee->lock, flags);
66 data = *ee->cache;
67
68 data &= ~mask;
69 if (pol)
70 data |= mask;
71
72 *ee->cache = data;
73//printk("update: %08x\n", data);
74 writel(data, ee->addr);
75 spin_unlock_irqrestore(ee->lock, flags);
76}
77
78void eeprom_clk_lo(struct eeprom *ee)
79{
80 int pol = !!(ee->polarity & EEPOL_EECLK);
81
82 eeprom_update(ee, ee->eeclk, pol);
83 udelay(2);
84}
85
86void eeprom_clk_hi(struct eeprom *ee)
87{
88 int pol = !!(ee->polarity & EEPOL_EECLK);
89
90 eeprom_update(ee, ee->eeclk, !pol);
91 udelay(2);
92}
93
94void eeprom_send_addr(struct eeprom *ee, unsigned address)
95{
96 int pol = !!(ee->polarity & EEPOL_EEDI);
97 unsigned i;
98 address |= 6 << 6;
99
100 /* Shift the read command bits out. */
101 for (i=0; i<11; i++) {
102 eeprom_update(ee, ee->eedi, ((address >> 10) & 1) ^ pol);
103 address <<= 1;
104 eeprom_clk_hi(ee);
105 eeprom_clk_lo(ee);
106 }
107 eeprom_update(ee, ee->eedi, pol);
108}
109
110u16 eeprom_readw(struct eeprom *ee, unsigned address)
111{
112 unsigned i;
113 u16 res = 0;
114
115 eeprom_clk_lo(ee);
116 eeprom_update(ee, ee->eesel, 1 ^ !!(ee->polarity & EEPOL_EESEL));
117 eeprom_send_addr(ee, address);
118
119 for (i=0; i<16; i++) {
120 u32 data;
121 eeprom_clk_hi(ee);
122 res <<= 1;
123 data = readl(ee->addr);
124//printk("eeprom_readw: %08x\n", data);
125 res |= !!(data & ee->eedo) ^ !!(ee->polarity & EEPOL_EEDO);
126 eeprom_clk_lo(ee);
127 }
128 eeprom_update(ee, ee->eesel, 0 ^ !!(ee->polarity & EEPOL_EESEL));
129
130 return res;
131}
132
133
134void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data)
135{
136}
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index ea6bbc2d7407..a74c27e460ba 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -8,18 +8,17 @@ typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struc
8 8
9typedef void (elevator_merged_fn) (request_queue_t *, struct request *); 9typedef void (elevator_merged_fn) (request_queue_t *, struct request *);
10 10
11typedef struct request *(elevator_next_req_fn) (request_queue_t *); 11typedef int (elevator_dispatch_fn) (request_queue_t *, int);
12 12
13typedef void (elevator_add_req_fn) (request_queue_t *, struct request *, int); 13typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
14typedef int (elevator_queue_empty_fn) (request_queue_t *); 14typedef int (elevator_queue_empty_fn) (request_queue_t *);
15typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *);
16typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *);
17typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); 15typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
18typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); 16typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
19typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); 17typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *);
20 18
21typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, int); 19typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t);
22typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); 20typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
21typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
23typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 22typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
24 23
25typedef int (elevator_init_fn) (request_queue_t *, elevator_t *); 24typedef int (elevator_init_fn) (request_queue_t *, elevator_t *);
@@ -31,10 +30,9 @@ struct elevator_ops
31 elevator_merged_fn *elevator_merged_fn; 30 elevator_merged_fn *elevator_merged_fn;
32 elevator_merge_req_fn *elevator_merge_req_fn; 31 elevator_merge_req_fn *elevator_merge_req_fn;
33 32
34 elevator_next_req_fn *elevator_next_req_fn; 33 elevator_dispatch_fn *elevator_dispatch_fn;
35 elevator_add_req_fn *elevator_add_req_fn; 34 elevator_add_req_fn *elevator_add_req_fn;
36 elevator_remove_req_fn *elevator_remove_req_fn; 35 elevator_activate_req_fn *elevator_activate_req_fn;
37 elevator_requeue_req_fn *elevator_requeue_req_fn;
38 elevator_deactivate_req_fn *elevator_deactivate_req_fn; 36 elevator_deactivate_req_fn *elevator_deactivate_req_fn;
39 37
40 elevator_queue_empty_fn *elevator_queue_empty_fn; 38 elevator_queue_empty_fn *elevator_queue_empty_fn;
@@ -81,15 +79,15 @@ struct elevator_queue
81/* 79/*
82 * block elevator interface 80 * block elevator interface
83 */ 81 */
82extern void elv_dispatch_sort(request_queue_t *, struct request *);
84extern void elv_add_request(request_queue_t *, struct request *, int, int); 83extern void elv_add_request(request_queue_t *, struct request *, int, int);
85extern void __elv_add_request(request_queue_t *, struct request *, int, int); 84extern void __elv_add_request(request_queue_t *, struct request *, int, int);
86extern int elv_merge(request_queue_t *, struct request **, struct bio *); 85extern int elv_merge(request_queue_t *, struct request **, struct bio *);
87extern void elv_merge_requests(request_queue_t *, struct request *, 86extern void elv_merge_requests(request_queue_t *, struct request *,
88 struct request *); 87 struct request *);
89extern void elv_merged_request(request_queue_t *, struct request *); 88extern void elv_merged_request(request_queue_t *, struct request *);
90extern void elv_remove_request(request_queue_t *, struct request *); 89extern void elv_dequeue_request(request_queue_t *, struct request *);
91extern void elv_requeue_request(request_queue_t *, struct request *); 90extern void elv_requeue_request(request_queue_t *, struct request *);
92extern void elv_deactivate_request(request_queue_t *, struct request *);
93extern int elv_queue_empty(request_queue_t *); 91extern int elv_queue_empty(request_queue_t *);
94extern struct request *elv_next_request(struct request_queue *q); 92extern struct request *elv_next_request(struct request_queue *q);
95extern struct request *elv_former_request(request_queue_t *, struct request *); 93extern struct request *elv_former_request(request_queue_t *, struct request *);
@@ -98,7 +96,7 @@ extern int elv_register_queue(request_queue_t *q);
98extern void elv_unregister_queue(request_queue_t *q); 96extern void elv_unregister_queue(request_queue_t *q);
99extern int elv_may_queue(request_queue_t *, int, struct bio *); 97extern int elv_may_queue(request_queue_t *, int, struct bio *);
100extern void elv_completed_request(request_queue_t *, struct request *); 98extern void elv_completed_request(request_queue_t *, struct request *);
101extern int elv_set_request(request_queue_t *, struct request *, struct bio *, int); 99extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t);
102extern void elv_put_request(request_queue_t *, struct request *); 100extern void elv_put_request(request_queue_t *, struct request *);
103 101
104/* 102/*
@@ -142,4 +140,6 @@ enum {
142 ELV_MQUEUE_MUST, 140 ELV_MQUEUE_MUST,
143}; 141};
144 142
143#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
144
145#endif 145#endif
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 4522c7186bf3..5f49a30eb6f2 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -48,8 +48,10 @@ static inline void eth_copy_and_sum (struct sk_buff *dest,
48} 48}
49 49
50/** 50/**
51 * is_zero_ether_addr - Determine if give Ethernet address is all 51 * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
52 * zeros. 52 * @addr: Pointer to a six-byte array containing the Ethernet address
53 *
54 * Return true if the address is all zeroes.
53 */ 55 */
54static inline int is_zero_ether_addr(const u8 *addr) 56static inline int is_zero_ether_addr(const u8 *addr)
55{ 57{
@@ -57,9 +59,7 @@ static inline int is_zero_ether_addr(const u8 *addr)
57} 59}
58 60
59/** 61/**
60 * is_multicast_ether_addr - Determine if the given Ethernet address is a 62 * is_multicast_ether_addr - Determine if the Ethernet address is a multicast.
61 * multicast address.
62 *
63 * @addr: Pointer to a six-byte array containing the Ethernet address 63 * @addr: Pointer to a six-byte array containing the Ethernet address
64 * 64 *
65 * Return true if the address is a multicast address. 65 * Return true if the address is a multicast address.
@@ -69,10 +69,15 @@ static inline int is_multicast_ether_addr(const u8 *addr)
69 return ((addr[0] != 0xff) && (0x01 & addr[0])); 69 return ((addr[0] != 0xff) && (0x01 & addr[0]));
70} 70}
71 71
72/**
73 * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast
74 * @addr: Pointer to a six-byte array containing the Ethernet address
75 *
76 * Return true if the address is the broadcast address.
77 */
72static inline int is_broadcast_ether_addr(const u8 *addr) 78static inline int is_broadcast_ether_addr(const u8 *addr)
73{ 79{
74 return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && 80 return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff;
75 (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
76} 81}
77 82
78/** 83/**
@@ -104,6 +109,22 @@ static inline void random_ether_addr(u8 *addr)
104 addr [0] &= 0xfe; /* clear multicast bit */ 109 addr [0] &= 0xfe; /* clear multicast bit */
105 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ 110 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
106} 111}
112
113/**
114 * compare_ether_addr - Compare two Ethernet addresses
115 * @addr1: Pointer to a six-byte array containing the Ethernet address
116 * @addr2: Pointer other six-byte array containing the Ethernet address
117 *
118 * Compare two ethernet addresses, returns 0 if equal
119 */
120static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
121{
122 const u16 *a = (const u16 *) addr1;
123 const u16 *b = (const u16 *) addr2;
124
125 BUILD_BUG_ON(ETH_ALEN != 6);
126 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
127}
107#endif /* __KERNEL__ */ 128#endif /* __KERNEL__ */
108 129
109#endif /* _LINUX_ETHERDEVICE_H */ 130#endif /* _LINUX_ETHERDEVICE_H */
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index ed1440ea4c91..93535f093216 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -269,6 +269,8 @@ u32 ethtool_op_get_tso(struct net_device *dev);
269int ethtool_op_set_tso(struct net_device *dev, u32 data); 269int ethtool_op_set_tso(struct net_device *dev, u32 data);
270int ethtool_op_get_perm_addr(struct net_device *dev, 270int ethtool_op_get_perm_addr(struct net_device *dev,
271 struct ethtool_perm_addr *addr, u8 *data); 271 struct ethtool_perm_addr *addr, u8 *data);
272u32 ethtool_op_get_ufo(struct net_device *dev);
273int ethtool_op_set_ufo(struct net_device *dev, u32 data);
272 274
273/** 275/**
274 * &ethtool_ops - Alter and report network device settings 276 * &ethtool_ops - Alter and report network device settings
@@ -298,6 +300,8 @@ int ethtool_op_get_perm_addr(struct net_device *dev,
298 * set_sg: Turn scatter-gather on or off 300 * set_sg: Turn scatter-gather on or off
299 * get_tso: Report whether TCP segmentation offload is enabled 301 * get_tso: Report whether TCP segmentation offload is enabled
300 * set_tso: Turn TCP segmentation offload on or off 302 * set_tso: Turn TCP segmentation offload on or off
303 * get_ufo: Report whether UDP fragmentation offload is enabled
304 * set_ufo: Turn UDP fragmentation offload on or off
301 * self_test: Run specified self-tests 305 * self_test: Run specified self-tests
302 * get_strings: Return a set of strings that describe the requested objects 306 * get_strings: Return a set of strings that describe the requested objects
303 * phys_id: Identify the device 307 * phys_id: Identify the device
@@ -364,6 +368,8 @@ struct ethtool_ops {
364 int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *); 368 int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *);
365 int (*begin)(struct net_device *); 369 int (*begin)(struct net_device *);
366 void (*complete)(struct net_device *); 370 void (*complete)(struct net_device *);
371 u32 (*get_ufo)(struct net_device *);
372 int (*set_ufo)(struct net_device *, u32);
367}; 373};
368 374
369/* CMDs currently supported */ 375/* CMDs currently supported */
@@ -400,6 +406,8 @@ struct ethtool_ops {
400#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ 406#define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */
401#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ 407#define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */
402#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ 408#define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */
409#define ETHTOOL_GUFO 0x00000021 /* Get UFO enable (ethtool_value) */
410#define ETHTOOL_SUFO 0x00000022 /* Set UFO enable (ethtool_value) */
403 411
404/* compatibility with older code */ 412/* compatibility with older code */
405#define SPARC_ETH_GSET ETHTOOL_GSET 413#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -445,10 +453,11 @@ struct ethtool_ops {
445 * it was foced up into this mode or autonegotiated. 453 * it was foced up into this mode or autonegotiated.
446 */ 454 */
447 455
448/* The forced speed, 10Mb, 100Mb, gigabit, 10GbE. */ 456/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
449#define SPEED_10 10 457#define SPEED_10 10
450#define SPEED_100 100 458#define SPEED_100 100
451#define SPEED_1000 1000 459#define SPEED_1000 1000
460#define SPEED_2500 2500
452#define SPEED_10000 10000 461#define SPEED_10000 10000
453 462
454/* Duplex, half or full. */ 463/* Duplex, half or full. */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index c698055266d0..04a58f33ec53 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -201,6 +201,14 @@ struct fb_bitfield {
201#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */ 201#define FB_VMODE_SMOOTH_XPAN 512 /* smooth xpan possible (internally used) */
202#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */ 202#define FB_VMODE_CONUPDATE 512 /* don't update x/yoffset */
203 203
204/*
205 * Display rotation support
206 */
207#define FB_ROTATE_UR 0
208#define FB_ROTATE_CW 1
209#define FB_ROTATE_UD 2
210#define FB_ROTATE_CCW 3
211
204#define PICOS2KHZ(a) (1000000000UL/(a)) 212#define PICOS2KHZ(a) (1000000000UL/(a))
205#define KHZ2PICOS(a) (1000000000UL/(a)) 213#define KHZ2PICOS(a) (1000000000UL/(a))
206 214
@@ -489,9 +497,9 @@ struct fb_cursor_user {
489#define FB_EVENT_MODE_DELETE 0x04 497#define FB_EVENT_MODE_DELETE 0x04
490/* A driver registered itself */ 498/* A driver registered itself */
491#define FB_EVENT_FB_REGISTERED 0x05 499#define FB_EVENT_FB_REGISTERED 0x05
492/* get console to framebuffer mapping */ 500/* CONSOLE-SPECIFIC: get console to framebuffer mapping */
493#define FB_EVENT_GET_CONSOLE_MAP 0x06 501#define FB_EVENT_GET_CONSOLE_MAP 0x06
494/* set console to framebuffer mapping */ 502/* CONSOLE-SPECIFIC: set console to framebuffer mapping */
495#define FB_EVENT_SET_CONSOLE_MAP 0x07 503#define FB_EVENT_SET_CONSOLE_MAP 0x07
496/* A display blank is requested */ 504/* A display blank is requested */
497#define FB_EVENT_BLANK 0x08 505#define FB_EVENT_BLANK 0x08
@@ -500,6 +508,12 @@ struct fb_cursor_user {
500/* The resolution of the passed in fb_info about to change and 508/* The resolution of the passed in fb_info about to change and
501 all vc's should be changed */ 509 all vc's should be changed */
502#define FB_EVENT_MODE_CHANGE_ALL 0x0A 510#define FB_EVENT_MODE_CHANGE_ALL 0x0A
511/* CONSOLE-SPECIFIC: set console rotation */
512#define FB_EVENT_SET_CON_ROTATE 0x0B
513/* CONSOLE-SPECIFIC: get console rotation */
514#define FB_EVENT_GET_CON_ROTATE 0x0C
515/* CONSOLE-SPECIFIC: rotate all consoles */
516#define FB_EVENT_SET_CON_ROTATE_ALL 0x0D
503 517
504struct fb_event { 518struct fb_event {
505 struct fb_info *info; 519 struct fb_info *info;
@@ -810,7 +824,6 @@ struct fb_info {
810extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); 824extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var);
811extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); 825extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var);
812extern int fb_blank(struct fb_info *info, int blank); 826extern int fb_blank(struct fb_info *info, int blank);
813extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor);
814extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); 827extern void cfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
815extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); 828extern void cfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
816extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image); 829extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image);
@@ -818,8 +831,8 @@ extern void cfb_imageblit(struct fb_info *info, const struct fb_image *image);
818/* drivers/video/fbmem.c */ 831/* drivers/video/fbmem.c */
819extern int register_framebuffer(struct fb_info *fb_info); 832extern int register_framebuffer(struct fb_info *fb_info);
820extern int unregister_framebuffer(struct fb_info *fb_info); 833extern int unregister_framebuffer(struct fb_info *fb_info);
821extern int fb_prepare_logo(struct fb_info *fb_info); 834extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
822extern int fb_show_logo(struct fb_info *fb_info); 835extern int fb_show_logo(struct fb_info *fb_info, int rotate);
823extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); 836extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
824extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, 837extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx,
825 u32 height, u32 shift_high, u32 shift_low, u32 mod); 838 u32 height, u32 shift_high, u32 shift_low, u32 mod);
@@ -829,6 +842,7 @@ extern int fb_get_color_depth(struct fb_var_screeninfo *var,
829 struct fb_fix_screeninfo *fix); 842 struct fb_fix_screeninfo *fix);
830extern int fb_get_options(char *name, char **option); 843extern int fb_get_options(char *name, char **option);
831extern int fb_new_modelist(struct fb_info *info); 844extern int fb_new_modelist(struct fb_info *info);
845extern int fb_con_duit(struct fb_info *info, int event, void *data);
832 846
833extern struct fb_info *registered_fb[FB_MAX]; 847extern struct fb_info *registered_fb[FB_MAX];
834extern int num_registered_fb; 848extern int num_registered_fb;
@@ -898,11 +912,13 @@ extern struct fb_videomode *fb_match_mode(struct fb_var_screeninfo *var,
898 struct list_head *head); 912 struct list_head *head);
899extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var, 913extern struct fb_videomode *fb_find_best_mode(struct fb_var_screeninfo *var,
900 struct list_head *head); 914 struct list_head *head);
901extern struct fb_videomode *fb_find_nearest_mode(struct fb_var_screeninfo *var, 915extern struct fb_videomode *fb_find_nearest_mode(struct fb_videomode *mode,
902 struct list_head *head); 916 struct list_head *head);
903extern void fb_destroy_modelist(struct list_head *head); 917extern void fb_destroy_modelist(struct list_head *head);
904extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num, 918extern void fb_videomode_to_modelist(struct fb_videomode *modedb, int num,
905 struct list_head *head); 919 struct list_head *head);
920extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs,
921 struct list_head *head);
906 922
907/* drivers/video/fbcmap.c */ 923/* drivers/video/fbcmap.c */
908extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); 924extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
diff --git a/include/linux/file.h b/include/linux/file.h
index f5bbd4c508b3..418b6101b59a 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -33,13 +33,13 @@ struct fdtable {
33 * Open file table structure 33 * Open file table structure
34 */ 34 */
35struct files_struct { 35struct files_struct {
36 atomic_t count; 36 atomic_t count;
37 spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */
38 struct fdtable *fdt; 37 struct fdtable *fdt;
39 struct fdtable fdtab; 38 struct fdtable fdtab;
40 fd_set close_on_exec_init; 39 fd_set close_on_exec_init;
41 fd_set open_fds_init; 40 fd_set open_fds_init;
42 struct file * fd_array[NR_OPEN_DEFAULT]; 41 struct file * fd_array[NR_OPEN_DEFAULT];
42 spinlock_t file_lock; /* Protects concurrent writers. Nests inside tsk->alloc_lock */
43}; 43};
44 44
45#define files_fdtable(files) (rcu_dereference((files)->fdt)) 45#define files_fdtable(files) (rcu_dereference((files)->fdt))
@@ -59,9 +59,9 @@ extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag));
59extern void put_filp(struct file *); 59extern void put_filp(struct file *);
60extern int get_unused_fd(void); 60extern int get_unused_fd(void);
61extern void FASTCALL(put_unused_fd(unsigned int fd)); 61extern void FASTCALL(put_unused_fd(unsigned int fd));
62struct kmem_cache_s; 62struct kmem_cache;
63extern void filp_ctor(void * objp, struct kmem_cache_s *cachep, unsigned long cflags); 63extern void filp_ctor(void * objp, struct kmem_cache *cachep, unsigned long cflags);
64extern void filp_dtor(void * objp, struct kmem_cache_s *cachep, unsigned long dflags); 64extern void filp_dtor(void * objp, struct kmem_cache *cachep, unsigned long dflags);
65 65
66extern struct file ** alloc_fd_array(int); 66extern struct file ** alloc_fd_array(int);
67extern void free_fd_array(struct file **, int); 67extern void free_fd_array(struct file **, int);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index e0b77c5af9a0..cc35b6ac778d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -104,6 +104,10 @@ extern int dir_notify_enable;
104#define MS_MOVE 8192 104#define MS_MOVE 8192
105#define MS_REC 16384 105#define MS_REC 16384
106#define MS_VERBOSE 32768 106#define MS_VERBOSE 32768
107#define MS_UNBINDABLE (1<<17) /* change to unbindable */
108#define MS_PRIVATE (1<<18) /* change to private */
109#define MS_SLAVE (1<<19) /* change to slave */
110#define MS_SHARED (1<<20) /* change to shared */
107#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ 111#define MS_POSIXACL (1<<16) /* VFS does not apply the umask */
108#define MS_ACTIVE (1<<30) 112#define MS_ACTIVE (1<<30)
109#define MS_NOUSER (1<<31) 113#define MS_NOUSER (1<<31)
@@ -264,6 +268,7 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
264#define ATTR_ATTR_FLAG 1024 268#define ATTR_ATTR_FLAG 1024
265#define ATTR_KILL_SUID 2048 269#define ATTR_KILL_SUID 2048
266#define ATTR_KILL_SGID 4096 270#define ATTR_KILL_SGID 4096
271#define ATTR_FILE 8192
267 272
268/* 273/*
269 * This is the Inode Attributes structure, used for notify_change(). It 274 * This is the Inode Attributes structure, used for notify_change(). It
@@ -283,6 +288,13 @@ struct iattr {
283 struct timespec ia_atime; 288 struct timespec ia_atime;
284 struct timespec ia_mtime; 289 struct timespec ia_mtime;
285 struct timespec ia_ctime; 290 struct timespec ia_ctime;
291
292 /*
293 * Not an attribute, but an auxilary info for filesystems wanting to
294 * implement an ftruncate() like method. NOTE: filesystem should
295 * check for (ia_valid & ATTR_FILE), and not for (ia_file != NULL).
296 */
297 struct file *ia_file;
286}; 298};
287 299
288/* 300/*
@@ -320,7 +332,7 @@ struct address_space_operations {
320 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ 332 /* Unfortunately this kludge is needed for FIBMAP. Don't use it */
321 sector_t (*bmap)(struct address_space *, sector_t); 333 sector_t (*bmap)(struct address_space *, sector_t);
322 int (*invalidatepage) (struct page *, unsigned long); 334 int (*invalidatepage) (struct page *, unsigned long);
323 int (*releasepage) (struct page *, int); 335 int (*releasepage) (struct page *, gfp_t);
324 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 336 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
325 loff_t offset, unsigned long nr_segs); 337 loff_t offset, unsigned long nr_segs);
326 struct page* (*get_xip_page)(struct address_space *, sector_t, 338 struct page* (*get_xip_page)(struct address_space *, sector_t,
@@ -574,7 +586,14 @@ struct file_ra_state {
574#define RA_FLAG_INCACHE 0x02 /* file is already in cache */ 586#define RA_FLAG_INCACHE 0x02 /* file is already in cache */
575 587
576struct file { 588struct file {
577 struct list_head f_list; 589 /*
590 * fu_list becomes invalid after file_free is called and queued via
591 * fu_rcuhead for RCU freeing
592 */
593 union {
594 struct list_head fu_list;
595 struct rcu_head fu_rcuhead;
596 } f_u;
578 struct dentry *f_dentry; 597 struct dentry *f_dentry;
579 struct vfsmount *f_vfsmnt; 598 struct vfsmount *f_vfsmnt;
580 struct file_operations *f_op; 599 struct file_operations *f_op;
@@ -598,7 +617,6 @@ struct file {
598 spinlock_t f_ep_lock; 617 spinlock_t f_ep_lock;
599#endif /* #ifdef CONFIG_EPOLL */ 618#endif /* #ifdef CONFIG_EPOLL */
600 struct address_space *f_mapping; 619 struct address_space *f_mapping;
601 struct rcu_head f_rcuhead;
602}; 620};
603extern spinlock_t files_lock; 621extern spinlock_t files_lock;
604#define file_list_lock() spin_lock(&files_lock); 622#define file_list_lock() spin_lock(&files_lock);
@@ -856,6 +874,7 @@ static inline void unlock_super(struct super_block * sb)
856/* 874/*
857 * VFS helper functions.. 875 * VFS helper functions..
858 */ 876 */
877extern int vfs_permission(struct nameidata *, int);
859extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); 878extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *);
860extern int vfs_mkdir(struct inode *, struct dentry *, int); 879extern int vfs_mkdir(struct inode *, struct dentry *, int);
861extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); 880extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t);
@@ -871,6 +890,11 @@ extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct de
871extern void dentry_unhash(struct dentry *dentry); 890extern void dentry_unhash(struct dentry *dentry);
872 891
873/* 892/*
893 * VFS file helper functions.
894 */
895extern int file_permission(struct file *, int);
896
897/*
874 * File types 898 * File types
875 * 899 *
876 * NOTE! These match bits 12..15 of stat.st_mode 900 * NOTE! These match bits 12..15 of stat.st_mode
@@ -1082,6 +1106,8 @@ int sync_inode(struct inode *inode, struct writeback_control *wbc);
1082 * @get_name: find the name for a given inode in a given directory 1106 * @get_name: find the name for a given inode in a given directory
1083 * @get_parent: find the parent of a given directory 1107 * @get_parent: find the parent of a given directory
1084 * @get_dentry: find a dentry for the inode given a file handle sub-fragment 1108 * @get_dentry: find a dentry for the inode given a file handle sub-fragment
1109 * @find_exported_dentry:
1110 * set by the exporting module to a standard helper function.
1085 * 1111 *
1086 * Description: 1112 * Description:
1087 * The export_operations structure provides a means for nfsd to communicate 1113 * The export_operations structure provides a means for nfsd to communicate
@@ -1233,7 +1259,12 @@ extern int unregister_filesystem(struct file_system_type *);
1233extern struct vfsmount *kern_mount(struct file_system_type *); 1259extern struct vfsmount *kern_mount(struct file_system_type *);
1234extern int may_umount_tree(struct vfsmount *); 1260extern int may_umount_tree(struct vfsmount *);
1235extern int may_umount(struct vfsmount *); 1261extern int may_umount(struct vfsmount *);
1262extern void umount_tree(struct vfsmount *, int, struct list_head *);
1263extern void release_mounts(struct list_head *);
1236extern long do_mount(char *, char *, char *, unsigned long, void *); 1264extern long do_mount(char *, char *, char *, unsigned long, void *);
1265extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);
1266extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *,
1267 struct vfsmount *);
1237 1268
1238extern int vfs_statfs(struct super_block *, struct kstatfs *); 1269extern int vfs_statfs(struct super_block *, struct kstatfs *);
1239 1270
@@ -1282,7 +1313,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
1282 1313
1283/* fs/open.c */ 1314/* fs/open.c */
1284 1315
1285extern int do_truncate(struct dentry *, loff_t start); 1316extern int do_truncate(struct dentry *, loff_t start, struct file *filp);
1286extern long do_sys_open(const char __user *filename, int flags, int mode); 1317extern long do_sys_open(const char __user *filename, int flags, int mode);
1287extern struct file *filp_open(const char *, int, int); 1318extern struct file *filp_open(const char *, int, int);
1288extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); 1319extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
new file mode 100644
index 000000000000..783c476b8674
--- /dev/null
+++ b/include/linux/fs_enet_pd.h
@@ -0,0 +1,135 @@
1/*
2 * Platform information definitions for the
3 * universal Freescale Ethernet driver.
4 *
5 * Copyright (c) 2003 Intracom S.A.
6 * by Pantelis Antoniou <panto@intracom.gr>
7 *
8 * 2005 (c) MontaVista Software, Inc.
9 * Vitaly Bordug <vbordug@ru.mvista.com>
10 *
11 * This file is licensed under the terms of the GNU General Public License
12 * version 2. This program is licensed "as is" without any warranty of any
13 * kind, whether express or implied.
14 */
15
16#ifndef FS_ENET_PD_H
17#define FS_ENET_PD_H
18
19#include <asm/types.h>
20
21#define FS_ENET_NAME "fs_enet"
22
23enum fs_id {
24 fsid_fec1,
25 fsid_fec2,
26 fsid_fcc1,
27 fsid_fcc2,
28 fsid_fcc3,
29 fsid_scc1,
30 fsid_scc2,
31 fsid_scc3,
32 fsid_scc4,
33};
34
35#define FS_MAX_INDEX 9
36
37static inline int fs_get_fec_index(enum fs_id id)
38{
39 if (id >= fsid_fec1 && id <= fsid_fec2)
40 return id - fsid_fec1;
41 return -1;
42}
43
44static inline int fs_get_fcc_index(enum fs_id id)
45{
46 if (id >= fsid_fcc1 && id <= fsid_fcc3)
47 return id - fsid_fcc1;
48 return -1;
49}
50
51static inline int fs_get_scc_index(enum fs_id id)
52{
53 if (id >= fsid_scc1 && id <= fsid_scc4)
54 return id - fsid_scc1;
55 return -1;
56}
57
58enum fs_mii_method {
59 fsmii_fixed,
60 fsmii_fec,
61 fsmii_bitbang,
62};
63
64enum fs_ioport {
65 fsiop_porta,
66 fsiop_portb,
67 fsiop_portc,
68 fsiop_portd,
69 fsiop_porte,
70};
71
72struct fs_mii_bus_info {
73 int method; /* mii method */
74 int id; /* the id of the mii_bus */
75 int disable_aneg; /* if the controller needs to negothiate speed & duplex */
76 int lpa; /* the default board-specific vallues will be applied otherwise */
77
78 union {
79 struct {
80 int duplex;
81 int speed;
82 } fixed;
83
84 struct {
85 /* nothing */
86 } fec;
87
88 struct {
89 /* nothing */
90 } scc;
91
92 struct {
93 int mdio_port; /* port & bit for MDIO */
94 int mdio_bit;
95 int mdc_port; /* port & bit for MDC */
96 int mdc_bit;
97 int delay; /* delay in us */
98 } bitbang;
99 } i;
100};
101
102struct fs_platform_info {
103
104 void(*init_ioports)(void);
105 /* device specific information */
106 int fs_no; /* controller index */
107
108 u32 cp_page; /* CPM page */
109 u32 cp_block; /* CPM sblock */
110
111 u32 clk_trx; /* some stuff for pins & mux configuration*/
112 u32 clk_route;
113 u32 clk_mask;
114
115 u32 mem_offset;
116 u32 dpram_offset;
117 u32 fcc_regs_c;
118
119 u32 device_flags;
120
121 int phy_addr; /* the phy address (-1 no phy) */
122 int phy_irq; /* the phy irq (if it exists) */
123
124 const struct fs_mii_bus_info *bus_info;
125
126 int rx_ring, tx_ring; /* number of buffers on rx */
127 __u8 macaddr[6]; /* mac address */
128 int rx_copybreak; /* limit we copy small frames */
129 int use_napi; /* use NAPI */
130 int napi_weight; /* NAPI weight */
131
132 int use_rmii; /* use RMII mode */
133};
134
135#endif
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 70f54af87b9f..934aa9bda481 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -4,7 +4,7 @@
4 * Definitions for any platform device related flags or structures for 4 * Definitions for any platform device related flags or structures for
5 * Freescale processor devices 5 * Freescale processor devices
6 * 6 *
7 * Maintainer: Kumar Gala (kumar.gala@freescale.com) 7 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
8 * 8 *
9 * Copyright 2004 Freescale Semiconductor, Inc 9 * Copyright 2004 Freescale Semiconductor, Inc
10 * 10 *
@@ -47,16 +47,21 @@
47struct gianfar_platform_data { 47struct gianfar_platform_data {
48 /* device specific information */ 48 /* device specific information */
49 u32 device_flags; 49 u32 device_flags;
50 u32 phy_reg_addr;
51 50
52 /* board specific information */ 51 /* board specific information */
53 u32 board_flags; 52 u32 board_flags;
54 u32 phy_flags; 53 const char *bus_id;
55 u32 phyid;
56 u32 interruptPHY;
57 u8 mac_addr[6]; 54 u8 mac_addr[6];
58}; 55};
59 56
57struct gianfar_mdio_data {
58 /* device specific information */
59 u32 paddr;
60
61 /* board specific information */
62 int irq[32];
63};
64
60/* Flags related to gianfar device features */ 65/* Flags related to gianfar device features */
61#define FSL_GIANFAR_DEV_HAS_GIGABIT 0x00000001 66#define FSL_GIANFAR_DEV_HAS_GIGABIT 0x00000001
62#define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 67#define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index acbeb96a3353..b76b558b03d4 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -14,7 +14,7 @@
14#define FUSE_KERNEL_VERSION 7 14#define FUSE_KERNEL_VERSION 7
15 15
16/** Minor version number of this interface */ 16/** Minor version number of this interface */
17#define FUSE_KERNEL_MINOR_VERSION 2 17#define FUSE_KERNEL_MINOR_VERSION 3
18 18
19/** The node ID of the root inode */ 19/** The node ID of the root inode */
20#define FUSE_ROOT_ID 1 20#define FUSE_ROOT_ID 1
@@ -61,7 +61,7 @@ struct fuse_kstatfs {
61#define FATTR_SIZE (1 << 3) 61#define FATTR_SIZE (1 << 3)
62#define FATTR_ATIME (1 << 4) 62#define FATTR_ATIME (1 << 4)
63#define FATTR_MTIME (1 << 5) 63#define FATTR_MTIME (1 << 5)
64#define FATTR_CTIME (1 << 6) 64#define FATTR_FH (1 << 6)
65 65
66/** 66/**
67 * Flags returned by the OPEN request 67 * Flags returned by the OPEN request
@@ -100,7 +100,9 @@ enum fuse_opcode {
100 FUSE_OPENDIR = 27, 100 FUSE_OPENDIR = 27,
101 FUSE_READDIR = 28, 101 FUSE_READDIR = 28,
102 FUSE_RELEASEDIR = 29, 102 FUSE_RELEASEDIR = 29,
103 FUSE_FSYNCDIR = 30 103 FUSE_FSYNCDIR = 30,
104 FUSE_ACCESS = 34,
105 FUSE_CREATE = 35
104}; 106};
105 107
106/* Conservative buffer size for the client */ 108/* Conservative buffer size for the client */
@@ -153,12 +155,25 @@ struct fuse_link_in {
153struct fuse_setattr_in { 155struct fuse_setattr_in {
154 __u32 valid; 156 __u32 valid;
155 __u32 padding; 157 __u32 padding;
156 struct fuse_attr attr; 158 __u64 fh;
159 __u64 size;
160 __u64 unused1;
161 __u64 atime;
162 __u64 mtime;
163 __u64 unused2;
164 __u32 atimensec;
165 __u32 mtimensec;
166 __u32 unused3;
167 __u32 mode;
168 __u32 unused4;
169 __u32 uid;
170 __u32 gid;
171 __u32 unused5;
157}; 172};
158 173
159struct fuse_open_in { 174struct fuse_open_in {
160 __u32 flags; 175 __u32 flags;
161 __u32 padding; 176 __u32 mode;
162}; 177};
163 178
164struct fuse_open_out { 179struct fuse_open_out {
@@ -223,6 +238,11 @@ struct fuse_getxattr_out {
223 __u32 padding; 238 __u32 padding;
224}; 239};
225 240
241struct fuse_access_in {
242 __u32 mask;
243 __u32 padding;
244};
245
226struct fuse_init_in_out { 246struct fuse_init_in_out {
227 __u32 major; 247 __u32 major;
228 __u32 minor; 248 __u32 minor;
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index cd623eccdbea..2401dea2b867 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -12,6 +12,7 @@
12#include <asm/io.h> 12#include <asm/io.h>
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/device.h> 14#include <linux/device.h>
15#include <linux/timer.h>
15 16
16struct gameport { 17struct gameport {
17 18
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
new file mode 100644
index 000000000000..84f12a41dc01
--- /dev/null
+++ b/include/linux/genetlink.h
@@ -0,0 +1,51 @@
1#ifndef __LINUX_GENERIC_NETLINK_H
2#define __LINUX_GENERIC_NETLINK_H
3
4#include <linux/netlink.h>
5
6#define GENL_NAMSIZ 16 /* length of family name */
7
8#define GENL_MIN_ID NLMSG_MIN_TYPE
9#define GENL_MAX_ID 1023
10
11struct genlmsghdr {
12 __u8 cmd;
13 __u8 version;
14 __u16 reserved;
15};
16
17#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
18
19/*
20 * List of reserved static generic netlink identifiers:
21 */
22#define GENL_ID_GENERATE 0
23#define GENL_ID_CTRL NLMSG_MIN_TYPE
24
25/**************************************************************************
26 * Controller
27 **************************************************************************/
28
29enum {
30 CTRL_CMD_UNSPEC,
31 CTRL_CMD_NEWFAMILY,
32 CTRL_CMD_DELFAMILY,
33 CTRL_CMD_GETFAMILY,
34 CTRL_CMD_NEWOPS,
35 CTRL_CMD_DELOPS,
36 CTRL_CMD_GETOPS,
37 __CTRL_CMD_MAX,
38};
39
40#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
41
42enum {
43 CTRL_ATTR_UNSPEC,
44 CTRL_ATTR_FAMILY_ID,
45 CTRL_ATTR_FAMILY_NAME,
46 __CTRL_ATTR_MAX,
47};
48
49#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
50
51#endif /* __LINUX_GENERIC_NETLINK_H */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 01796c41c951..eef5ccdcd731 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -78,7 +78,7 @@ struct hd_struct {
78 sector_t start_sect; 78 sector_t start_sect;
79 sector_t nr_sects; 79 sector_t nr_sects;
80 struct kobject kobj; 80 struct kobject kobj;
81 unsigned reads, read_sectors, writes, write_sectors; 81 unsigned ios[2], sectors[2]; /* READs and WRITEs */
82 int policy, partno; 82 int policy, partno;
83}; 83};
84 84
@@ -89,10 +89,10 @@ struct hd_struct {
89#define GENHD_FL_SUPPRESS_PARTITION_INFO 32 89#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
90 90
91struct disk_stats { 91struct disk_stats {
92 unsigned read_sectors, write_sectors; 92 unsigned sectors[2]; /* READs and WRITEs */
93 unsigned reads, writes; 93 unsigned ios[2];
94 unsigned read_merges, write_merges; 94 unsigned merges[2];
95 unsigned read_ticks, write_ticks; 95 unsigned ticks[2];
96 unsigned io_ticks; 96 unsigned io_ticks;
97 unsigned time_in_queue; 97 unsigned time_in_queue;
98}; 98};
@@ -119,7 +119,7 @@ struct gendisk {
119 int policy; 119 int policy;
120 120
121 atomic_t sync_io; /* RAID */ 121 atomic_t sync_io; /* RAID */
122 unsigned long stamp, stamp_idle; 122 unsigned long stamp;
123 int in_flight; 123 int in_flight;
124#ifdef CONFIG_SMP 124#ifdef CONFIG_SMP
125 struct disk_stats *dkstats; 125 struct disk_stats *dkstats;
@@ -132,6 +132,7 @@ struct gendisk {
132struct disk_attribute { 132struct disk_attribute {
133 struct attribute attr; 133 struct attribute attr;
134 ssize_t (*show)(struct gendisk *, char *); 134 ssize_t (*show)(struct gendisk *, char *);
135 ssize_t (*store)(struct gendisk *, const char *, size_t);
135}; 136};
136 137
137/* 138/*
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 4dc990f3b5cc..8b2eab90abb6 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -11,9 +11,16 @@ struct vm_area_struct;
11/* 11/*
12 * GFP bitmasks.. 12 * GFP bitmasks..
13 */ 13 */
14/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ 14/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low three bits) */
15#define __GFP_DMA 0x01u 15#define __GFP_DMA ((__force gfp_t)0x01u)
16#define __GFP_HIGHMEM 0x02u 16#define __GFP_HIGHMEM ((__force gfp_t)0x02u)
17#ifdef CONFIG_DMA_IS_DMA32
18#define __GFP_DMA32 ((__force gfp_t)0x01) /* ZONE_DMA is ZONE_DMA32 */
19#elif BITS_PER_LONG < 64
20#define __GFP_DMA32 ((__force gfp_t)0x00) /* ZONE_NORMAL is ZONE_DMA32 */
21#else
22#define __GFP_DMA32 ((__force gfp_t)0x04) /* Has own ZONE_DMA32 */
23#endif
17 24
18/* 25/*
19 * Action modifiers - doesn't change the zoning 26 * Action modifiers - doesn't change the zoning
@@ -26,30 +33,29 @@ struct vm_area_struct;
26 * 33 *
27 * __GFP_NORETRY: The VM implementation must not retry indefinitely. 34 * __GFP_NORETRY: The VM implementation must not retry indefinitely.
28 */ 35 */
29#define __GFP_WAIT 0x10u /* Can wait and reschedule? */ 36#define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */
30#define __GFP_HIGH 0x20u /* Should access emergency pools? */ 37#define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */
31#define __GFP_IO 0x40u /* Can start physical IO? */ 38#define __GFP_IO ((__force gfp_t)0x40u) /* Can start physical IO? */
32#define __GFP_FS 0x80u /* Can call down to low-level FS? */ 39#define __GFP_FS ((__force gfp_t)0x80u) /* Can call down to low-level FS? */
33#define __GFP_COLD 0x100u /* Cache-cold page required */ 40#define __GFP_COLD ((__force gfp_t)0x100u) /* Cache-cold page required */
34#define __GFP_NOWARN 0x200u /* Suppress page allocation failure warning */ 41#define __GFP_NOWARN ((__force gfp_t)0x200u) /* Suppress page allocation failure warning */
35#define __GFP_REPEAT 0x400u /* Retry the allocation. Might fail */ 42#define __GFP_REPEAT ((__force gfp_t)0x400u) /* Retry the allocation. Might fail */
36#define __GFP_NOFAIL 0x800u /* Retry for ever. Cannot fail */ 43#define __GFP_NOFAIL ((__force gfp_t)0x800u) /* Retry for ever. Cannot fail */
37#define __GFP_NORETRY 0x1000u /* Do not retry. Might fail */ 44#define __GFP_NORETRY ((__force gfp_t)0x1000u)/* Do not retry. Might fail */
38#define __GFP_NO_GROW 0x2000u /* Slab internal usage */ 45#define __GFP_NO_GROW ((__force gfp_t)0x2000u)/* Slab internal usage */
39#define __GFP_COMP 0x4000u /* Add compound page metadata */ 46#define __GFP_COMP ((__force gfp_t)0x4000u)/* Add compound page metadata */
40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */ 47#define __GFP_ZERO ((__force gfp_t)0x8000u)/* Return zeroed page on success */
41#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ 48#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */
42#define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ 49#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
43#define __GFP_HARDWALL 0x40000u /* Enforce hardwall cpuset memory allocs */
44 50
45#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ 51#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
46#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) 52#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
47 53
48/* if you forget to add the bitmask here kernel will crash, period */ 54/* if you forget to add the bitmask here kernel will crash, period */
49#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ 55#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
50 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ 56 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
51 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ 57 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
52 __GFP_NOMEMALLOC|__GFP_NORECLAIM|__GFP_HARDWALL) 58 __GFP_NOMEMALLOC|__GFP_HARDWALL)
53 59
54#define GFP_ATOMIC (__GFP_HIGH) 60#define GFP_ATOMIC (__GFP_HIGH)
55#define GFP_NOIO (__GFP_WAIT) 61#define GFP_NOIO (__GFP_WAIT)
@@ -64,6 +70,16 @@ struct vm_area_struct;
64 70
65#define GFP_DMA __GFP_DMA 71#define GFP_DMA __GFP_DMA
66 72
73/* 4GB DMA on some platforms */
74#define GFP_DMA32 __GFP_DMA32
75
76
77static inline int gfp_zone(gfp_t gfp)
78{
79 int zone = GFP_ZONEMASK & (__force int) gfp;
80 BUG_ON(zone >= GFP_ZONETYPES);
81 return zone;
82}
67 83
68/* 84/*
69 * There is only one page-allocator function, and two main namespaces to 85 * There is only one page-allocator function, and two main namespaces to
@@ -85,30 +101,30 @@ static inline void arch_free_page(struct page *page, int order) { }
85#endif 101#endif
86 102
87extern struct page * 103extern struct page *
88FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *)); 104FASTCALL(__alloc_pages(gfp_t, unsigned int, struct zonelist *));
89 105
90static inline struct page *alloc_pages_node(int nid, unsigned int __nocast gfp_mask, 106static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask,
91 unsigned int order) 107 unsigned int order)
92{ 108{
93 if (unlikely(order >= MAX_ORDER)) 109 if (unlikely(order >= MAX_ORDER))
94 return NULL; 110 return NULL;
95 111
96 return __alloc_pages(gfp_mask, order, 112 return __alloc_pages(gfp_mask, order,
97 NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK)); 113 NODE_DATA(nid)->node_zonelists + gfp_zone(gfp_mask));
98} 114}
99 115
100#ifdef CONFIG_NUMA 116#ifdef CONFIG_NUMA
101extern struct page *alloc_pages_current(unsigned int __nocast gfp_mask, unsigned order); 117extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order);
102 118
103static inline struct page * 119static inline struct page *
104alloc_pages(unsigned int __nocast gfp_mask, unsigned int order) 120alloc_pages(gfp_t gfp_mask, unsigned int order)
105{ 121{
106 if (unlikely(order >= MAX_ORDER)) 122 if (unlikely(order >= MAX_ORDER))
107 return NULL; 123 return NULL;
108 124
109 return alloc_pages_current(gfp_mask, order); 125 return alloc_pages_current(gfp_mask, order);
110} 126}
111extern struct page *alloc_page_vma(unsigned __nocast gfp_mask, 127extern struct page *alloc_page_vma(gfp_t gfp_mask,
112 struct vm_area_struct *vma, unsigned long addr); 128 struct vm_area_struct *vma, unsigned long addr);
113#else 129#else
114#define alloc_pages(gfp_mask, order) \ 130#define alloc_pages(gfp_mask, order) \
@@ -117,8 +133,8 @@ extern struct page *alloc_page_vma(unsigned __nocast gfp_mask,
117#endif 133#endif
118#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) 134#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
119 135
120extern unsigned long FASTCALL(__get_free_pages(unsigned int __nocast gfp_mask, unsigned int order)); 136extern unsigned long FASTCALL(__get_free_pages(gfp_t gfp_mask, unsigned int order));
121extern unsigned long FASTCALL(get_zeroed_page(unsigned int __nocast gfp_mask)); 137extern unsigned long FASTCALL(get_zeroed_page(gfp_t gfp_mask));
122 138
123#define __get_free_page(gfp_mask) \ 139#define __get_free_page(gfp_mask) \
124 __get_free_pages((gfp_mask),0) 140 __get_free_pages((gfp_mask),0)
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 5912874ca83c..71d2b8a723b9 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -90,6 +90,8 @@ extern void synchronize_irq(unsigned int irq);
90#define nmi_enter() irq_enter() 90#define nmi_enter() irq_enter()
91#define nmi_exit() sub_preempt_count(HARDIRQ_OFFSET) 91#define nmi_exit() sub_preempt_count(HARDIRQ_OFFSET)
92 92
93struct task_struct;
94
93#ifndef CONFIG_VIRT_CPU_ACCOUNTING 95#ifndef CONFIG_VIRT_CPU_ACCOUNTING
94static inline void account_user_vtime(struct task_struct *tsk) 96static inline void account_user_vtime(struct task_struct *tsk)
95{ 97{
diff --git a/include/linux/hdreg.h b/include/linux/hdreg.h
index b5d660089de4..2b54eac738ea 100644
--- a/include/linux/hdreg.h
+++ b/include/linux/hdreg.h
@@ -80,10 +80,12 @@
80/* 80/*
81 * Define standard taskfile in/out register 81 * Define standard taskfile in/out register
82 */ 82 */
83#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
84#define IDE_TASKFILE_STD_IN_FLAGS 0xFE 83#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
85#define IDE_HOB_STD_OUT_FLAGS 0x3C
86#define IDE_HOB_STD_IN_FLAGS 0x3C 84#define IDE_HOB_STD_IN_FLAGS 0x3C
85#ifndef __KERNEL__
86#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
87#define IDE_HOB_STD_OUT_FLAGS 0x3C
88#endif
87 89
88typedef unsigned char task_ioreg_t; 90typedef unsigned char task_ioreg_t;
89typedef unsigned long sata_ioreg_t; 91typedef unsigned long sata_ioreg_t;
diff --git a/include/linux/hil.h b/include/linux/hil.h
new file mode 100644
index 000000000000..13352d7d0caf
--- /dev/null
+++ b/include/linux/hil.h
@@ -0,0 +1,483 @@
1#ifndef _HIL_H_
2#define _HIL_H_
3
4/*
5 * Hewlett Packard Human Interface Loop (HP-HIL) Protocol -- header.
6 *
7 * Copyright (c) 2001 Brian S. Julin
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions, and the following disclaimer,
15 * without modification.
16 * 2. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
18 *
19 * Alternatively, this software may be distributed under the terms of the
20 * GNU General Public License ("GPL").
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
26 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 *
32 * References:
33 * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A
34 *
35 * A note of thanks to HP for providing and shipping reference materials
36 * free of charge to help in the development of HIL support for Linux.
37 *
38 */
39
40#include <asm/types.h>
41
42/* Physical constants relevant to raw loop/device timing.
43 */
44
45#define HIL_CLOCK 8MHZ
46#define HIL_EK1_CLOCK 30HZ
47#define HIL_EK2_CLOCK 60HZ
48
49#define HIL_TIMEOUT_DEV 5 /* ms */
50#define HIL_TIMEOUT_DEVS 10 /* ms */
51#define HIL_TIMEOUT_NORESP 10 /* ms */
52#define HIL_TIMEOUT_DEVS_DATA 16 /* ms */
53#define HIL_TIMEOUT_SELFTEST 200 /* ms */
54
55
56/* Actual wire line coding. These will only be useful if someone is
57 * implementing a software MLC to run HIL devices on a non-parisc machine.
58 */
59
60#define HIL_WIRE_PACKET_LEN 15
61enum hil_wire_bitpos {
62 HIL_WIRE_START = 0,
63 HIL_WIRE_ADDR2,
64 HIL_WIRE_ADDR1,
65 HIL_WIRE_ADDR0,
66 HIL_WIRE_COMMAND,
67 HIL_WIRE_DATA7,
68 HIL_WIRE_DATA6,
69 HIL_WIRE_DATA5,
70 HIL_WIRE_DATA4,
71 HIL_WIRE_DATA3,
72 HIL_WIRE_DATA2,
73 HIL_WIRE_DATA1,
74 HIL_WIRE_DATA0,
75 HIL_WIRE_PARITY,
76 HIL_WIRE_STOP
77};
78
79/* HP documentation uses these bit positions to refer to commands;
80 * we will call these "packets".
81 */
82enum hil_pkt_bitpos {
83 HIL_PKT_CMD = 0x00000800,
84 HIL_PKT_ADDR2 = 0x00000400,
85 HIL_PKT_ADDR1 = 0x00000200,
86 HIL_PKT_ADDR0 = 0x00000100,
87 HIL_PKT_ADDR_MASK = 0x00000700,
88 HIL_PKT_ADDR_SHIFT = 8,
89 HIL_PKT_DATA7 = 0x00000080,
90 HIL_PKT_DATA6 = 0x00000040,
91 HIL_PKT_DATA5 = 0x00000020,
92 HIL_PKT_DATA4 = 0x00000010,
93 HIL_PKT_DATA3 = 0x00000008,
94 HIL_PKT_DATA2 = 0x00000004,
95 HIL_PKT_DATA1 = 0x00000002,
96 HIL_PKT_DATA0 = 0x00000001,
97 HIL_PKT_DATA_MASK = 0x000000FF,
98 HIL_PKT_DATA_SHIFT = 0
99};
100
101/* The HIL MLC also has several error/status/control bits. We extend the
102 * "packet" to include these when direct access to the MLC is available,
103 * or emulate them in cases where they are not available.
104 *
105 * This way the device driver knows that the underlying MLC driver
106 * has had to deal with loop errors.
107 */
108enum hil_error_bitpos {
109 HIL_ERR_OB = 0x00000800, /* MLC is busy sending an auto-poll,
110 or we have filled up the output
111 buffer and must wait. */
112 HIL_ERR_INT = 0x00010000, /* A normal interrupt has occurred. */
113 HIL_ERR_NMI = 0x00020000, /* An NMI has occurred. */
114 HIL_ERR_LERR = 0x00040000, /* A poll didn't come back. */
115 HIL_ERR_PERR = 0x01000000, /* There was a Parity Error. */
116 HIL_ERR_FERR = 0x02000000, /* There was a Framing Error. */
117 HIL_ERR_FOF = 0x04000000 /* Input FIFO Overflowed. */
118};
119
120enum hil_control_bitpos {
121 HIL_CTRL_TEST = 0x00010000,
122 HIL_CTRL_IPF = 0x00040000,
123 HIL_CTRL_APE = 0x02000000
124};
125
126/* Bits 30,31 are unused, we use them to control write behavior. */
127#define HIL_DO_ALTER_CTRL 0x40000000 /* Write MSW of packet to control
128 before writing LSW to loop */
129#define HIL_CTRL_ONLY 0xc0000000 /* *Only* alter the control registers */
130
131/* This gives us a 32-bit "packet"
132 */
133typedef u32 hil_packet;
134
135
136/* HIL Loop commands
137 */
138enum hil_command {
139 HIL_CMD_IFC = 0x00, /* Interface Clear */
140 HIL_CMD_EPT = 0x01, /* Enter Pass-Thru Mode */
141 HIL_CMD_ELB = 0x02, /* Enter Loop-Back Mode */
142 HIL_CMD_IDD = 0x03, /* Identify and Describe */
143 HIL_CMD_DSR = 0x04, /* Device Soft Reset */
144 HIL_CMD_PST = 0x05, /* Perform Self Test */
145 HIL_CMD_RRG = 0x06, /* Read Register */
146 HIL_CMD_WRG = 0x07, /* Write Register */
147 HIL_CMD_ACF = 0x08, /* Auto Configure */
148 HIL_CMDID_ACF = 0x07, /* Auto Configure bits with incremented ID */
149 HIL_CMD_POL = 0x10, /* Poll */
150 HIL_CMDCT_POL = 0x0f, /* Poll command bits with item count */
151 HIL_CMD_RPL = 0x20, /* RePoll */
152 HIL_CMDCT_RPL = 0x0f, /* RePoll command bits with item count */
153 HIL_CMD_RNM = 0x30, /* Report Name */
154 HIL_CMD_RST = 0x31, /* Report Status */
155 HIL_CMD_EXD = 0x32, /* Extended Describe */
156 HIL_CMD_RSC = 0x33, /* Report Security Code */
157
158 /* 0x34 to 0x3c reserved for future use */
159
160 HIL_CMD_DKA = 0x3d, /* Disable Keyswitch Autorepeat */
161 HIL_CMD_EK1 = 0x3e, /* Enable Keyswitch Autorepeat 1 */
162 HIL_CMD_EK2 = 0x3f, /* Enable Keyswitch Autorepeat 2 */
163 HIL_CMD_PR1 = 0x40, /* Prompt1 */
164 HIL_CMD_PR2 = 0x41, /* Prompt2 */
165 HIL_CMD_PR3 = 0x42, /* Prompt3 */
166 HIL_CMD_PR4 = 0x43, /* Prompt4 */
167 HIL_CMD_PR5 = 0x44, /* Prompt5 */
168 HIL_CMD_PR6 = 0x45, /* Prompt6 */
169 HIL_CMD_PR7 = 0x46, /* Prompt7 */
170 HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */
171 HIL_CMD_AK1 = 0x48, /* Acknowlege1 */
172 HIL_CMD_AK2 = 0x49, /* Acknowlege2 */
173 HIL_CMD_AK3 = 0x4a, /* Acknowlege3 */
174 HIL_CMD_AK4 = 0x4b, /* Acknowlege4 */
175 HIL_CMD_AK5 = 0x4c, /* Acknowlege5 */
176 HIL_CMD_AK6 = 0x4d, /* Acknowlege6 */
177 HIL_CMD_AK7 = 0x4e, /* Acknowlege7 */
178 HIL_CMD_ACK = 0x4f, /* Acknowlege (General Purpose) */
179
180 /* 0x50 to 0x78 reserved for future use */
181 /* 0x80 to 0xEF device-specific commands */
182 /* 0xf0 to 0xf9 reserved for future use */
183
184 HIL_CMD_RIO = 0xfa, /* Register I/O Error */
185 HIL_CMD_SHR = 0xfb, /* System Hard Reset */
186 HIL_CMD_TER = 0xfc, /* Transmission Error */
187 HIL_CMD_CAE = 0xfd, /* Configuration Address Error */
188 HIL_CMD_DHR = 0xfe, /* Device Hard Reset */
189
190 /* 0xff is prohibited from use. */
191};
192
193
194/*
195 * Response "records" to HIL commands
196 */
197
198/* Device ID byte
199 */
200#define HIL_IDD_DID_TYPE_MASK 0xe0 /* Primary type bits */
201#define HIL_IDD_DID_TYPE_KB_INTEGRAL 0xa0 /* Integral keyboard */
202#define HIL_IDD_DID_TYPE_KB_ITF 0xc0 /* ITD keyboard */
203#define HIL_IDD_DID_TYPE_KB_RSVD 0xe0 /* Reserved keyboard type */
204#define HIL_IDD_DID_TYPE_KB_LANG_MASK 0x1f /* Keyboard locale bits */
205#define HIL_IDD_DID_KBLANG_USE_ESD 0x00 /* Use ESD Locale instead */
206#define HIL_IDD_DID_TYPE_ABS 0x80 /* Absolute Positioners */
207#define HIL_IDD_DID_ABS_RSVD1_MASK 0xf8 /* Reserved */
208#define HIL_IDD_DID_ABS_RSVD1 0x98
209#define HIL_IDD_DID_ABS_TABLET_MASK 0xf8 /* Tablets and digitizers */
210#define HIL_IDD_DID_ABS_TABLET 0x90
211#define HIL_IDD_DID_ABS_TSCREEN_MASK 0xfc /* Touch screens */
212#define HIL_IDD_DID_ABS_TSCREEN 0x8c
213#define HIL_IDD_DID_ABS_RSVD2_MASK 0xfc /* Reserved */
214#define HIL_IDD_DID_ABS_RSVD2 0x88
215#define HIL_IDD_DID_ABS_RSVD3_MASK 0xfc /* Reserved */
216#define HIL_IDD_DID_ABS_RSVD3 0x80
217#define HIL_IDD_DID_TYPE_REL 0x60 /* Relative Positioners */
218#define HIL_IDD_DID_REL_RSVD1_MASK 0xf0 /* Reserved */
219#define HIL_IDD_DID_REL_RSVD1 0x70
220#define HIL_IDD_DID_REL_RSVD2_MASK 0xfc /* Reserved */
221#define HIL_IDD_DID_REL_RSVD2 0x6c
222#define HIL_IDD_DID_REL_MOUSE_MASK 0xfc /* Mouse */
223#define HIL_IDD_DID_REL_MOUSE 0x68
224#define HIL_IDD_DID_REL_QUAD_MASK 0xf8 /* Other Quadrature Devices */
225#define HIL_IDD_DID_REL_QUAD 0x60
226#define HIL_IDD_DID_TYPE_CHAR 0x40 /* Character Entry */
227#define HIL_IDD_DID_CHAR_BARCODE_MASK 0xfc /* Barcode Reader */
228#define HIL_IDD_DID_CHAR_BARCODE 0x5c
229#define HIL_IDD_DID_CHAR_RSVD1_MASK 0xfc /* Reserved */
230#define HIL_IDD_DID_CHAR_RSVD1 0x58
231#define HIL_IDD_DID_CHAR_RSVD2_MASK 0xf8 /* Reserved */
232#define HIL_IDD_DID_CHAR_RSVD2 0x50
233#define HIL_IDD_DID_CHAR_RSVD3_MASK 0xf0 /* Reserved */
234#define HIL_IDD_DID_CHAR_RSVD3 0x40
235#define HIL_IDD_DID_TYPE_OTHER 0x20 /* Miscellaneous */
236#define HIL_IDD_DID_OTHER_RSVD1_MASK 0xf0 /* Reserved */
237#define HIL_IDD_DID_OTHER_RSVD1 0x30
238#define HIL_IDD_DID_OTHER_BARCODE_MASK 0xfc /* Tone Generator */
239#define HIL_IDD_DID_OTHER_BARCODE 0x2c
240#define HIL_IDD_DID_OTHER_RSVD2_MASK 0xfc /* Reserved */
241#define HIL_IDD_DID_OTHER_RSVD2 0x28
242#define HIL_IDD_DID_OTHER_RSVD3_MASK 0xf8 /* Reserved */
243#define HIL_IDD_DID_OTHER_RSVD3 0x20
244#define HIL_IDD_DID_TYPE_KEYPAD 0x00 /* Vectra Keyboard */
245
246/* IDD record header
247 */
248#define HIL_IDD_HEADER_AXSET_MASK 0x03 /* Number of axis in a set */
249#define HIL_IDD_HEADER_RSC 0x04 /* Supports RSC command */
250#define HIL_IDD_HEADER_EXD 0x08 /* Supports EXD command */
251#define HIL_IDD_HEADER_IOD 0x10 /* IOD byte to follow */
252#define HIL_IDD_HEADER_16BIT 0x20 /* 16 (vs. 8) bit resolution */
253#define HIL_IDD_HEADER_ABS 0x40 /* Reports Absolute Position */
254#define HIL_IDD_HEADER_2X_AXIS 0x80 /* Two sets of 1-3 axis */
255
256/* I/O Descriptor
257 */
258#define HIL_IDD_IOD_NBUTTON_MASK 0x07 /* Number of buttons */
259#define HIL_IDD_IOD_PROXIMITY 0x08 /* Proximity in/out events */
260#define HIL_IDD_IOD_PROMPT_MASK 0x70 /* Number of prompts/acks */
261#define HIL_IDD_IOD_PROMPT_SHIFT 4
262#define HIL_IDD_IOD_PROMPT 0x80 /* Generic prompt/ack */
263
264#define HIL_IDD_NUM_AXES_PER_SET(header_packet) \
265((header_packet) & HIL_IDD_HEADER_AXSET_MASK)
266
267#define HIL_IDD_NUM_AXSETS(header_packet) \
268(2 - !((header_packet) & HIL_IDD_HEADER_2X_AXIS))
269
270#define HIL_IDD_LEN(header_packet) \
271((4 - !(header_packet & HIL_IDD_HEADER_IOD) - \
272 2 * !(HIL_IDD_NUM_AXES_PER_SET(header_packet))) + \
273 2 * HIL_IDD_NUM_AXES_PER_SET(header_packet) * \
274 !!((header_packet) & HIL_IDD_HEADER_ABS))
275
276/* The following HIL_IDD_* macros assume you have an array of
277 * packets and/or unpacked 8-bit data in the order that they
278 * were received.
279 */
280
281#define HIL_IDD_AXIS_COUNTS_PER_M(header_ptr) \
282(!(HIL_IDD_NUM_AXSETS(*(header_ptr))) ? -1 : \
283(((*(header_ptr + 1) & HIL_PKT_DATA_MASK) + \
284 ((*(header_ptr + 2) & HIL_PKT_DATA_MASK)) << 8) \
285* ((*(header_ptr) & HIL_IDD_HEADER_16BIT) ? 100 : 1)))
286
287#define HIL_IDD_AXIS_MAX(header_ptr, __axnum) \
288((!(*(header_ptr) & HIL_IDD_HEADER_ABS) || \
289 (HIL_IDD_NUM_AXES_PER_SET(*(header_ptr)) <= __axnum)) ? 0 : \
290 ((HIL_PKT_DATA_MASK & *((header_ptr) + 3 + 2 * __axnum)) + \
291 ((HIL_PKT_DATA_MASK & *((header_ptr) + 4 + 2 * __axnum)) << 8)))
292
293#define HIL_IDD_IOD(header_ptr) \
294(*(header_ptr + HIL_IDD_LEN((*header_ptr)) - 1))
295
296#define HIL_IDD_HAS_GEN_PROMPT(header_ptr) \
297((*header_ptr & HIL_IDD_HEADER_IOD) && \
298 (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROMPT))
299
300#define HIL_IDD_HAS_GEN_PROXIMITY(header_ptr) \
301((*header_ptr & HIL_IDD_HEADER_IOD) && \
302 (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROXIMITY))
303
304#define HIL_IDD_NUM_BUTTONS(header_ptr) \
305((*header_ptr & HIL_IDD_HEADER_IOD) ? \
306 (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NBUTTON_MASK) : 0)
307
308#define HIL_IDD_NUM_PROMPTS(header_ptr) \
309((*header_ptr & HIL_IDD_HEADER_IOD) ? \
310 ((HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NPROMPT_MASK) \
311 >> HIL_IDD_IOD_PROMPT_SHIFT) : 0)
312
313/* The response to HIL EXD commands -- the "extended describe record" */
314#define HIL_EXD_HEADER_WRG 0x03 /* Supports type2 WRG */
315#define HIL_EXD_HEADER_WRG_TYPE1 0x01 /* Supports type1 WRG */
316#define HIL_EXD_HEADER_WRG_TYPE2 0x02 /* Supports type2 WRG */
317#define HIL_EXD_HEADER_RRG 0x04 /* Supports RRG command */
318#define HIL_EXD_HEADER_RNM 0x10 /* Supports RNM command */
319#define HIL_EXD_HEADER_RST 0x20 /* Supports RST command */
320#define HIL_EXD_HEADER_LOCALE 0x40 /* Contains locale code */
321
322#define HIL_EXD_NUM_RRG(header_ptr) \
323((*header_ptr & HIL_EXD_HEADER_RRG) ? \
324 (*(header_ptr + 1) & HIL_PKT_DATA_MASK) : 0)
325
326#define HIL_EXD_NUM_WWG(header_ptr) \
327((*header_ptr & HIL_EXD_HEADER_WRG) ? \
328 (*(header_ptr + 2 - !(*header_ptr & HIL_EXD_HEADER_RRG)) & \
329 HIL_PKT_DATA_MASK) : 0)
330
331#define HIL_EXD_LEN(header_ptr) \
332(!!(*header_ptr & HIL_EXD_HEADER_RRG) + \
333 !!(*header_ptr & HIL_EXD_HEADER_WRG) + \
334 !!(*header_ptr & HIL_EXD_HEADER_LOCALE) + \
335 2 * !!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) + 1)
336
337#define HIL_EXD_LOCALE(header_ptr) \
338(!(*header_ptr & HIL_EXD_HEADER_LOCALE) ? -1 : \
339 (*(header_ptr + HIL_EXD_LEN(header_ptr) - 1) & HIL_PKT_DATA_MASK))
340
341#define HIL_EXD_WRG_TYPE2_LEN(header_ptr) \
342(!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) ? -1 : \
343 (*(header_ptr + HIL_EXD_LEN(header_ptr) - 2 - \
344 !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) + \
345 ((*(header_ptr + HIL_EXD_LEN(header_ptr) - 1 - \
346 !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) << 8))
347
348/* Device locale codes. */
349
350/* Last defined locale code. Everything above this is "Reserved",
351 and note that this same table applies to the Device ID Byte where
352 keyboards may have a nationality code which is only 5 bits. */
353#define HIL_LOCALE_MAX 0x1f
354
355/* Map to hopefully useful strings. I was trying to make these look
356 like locale.aliases strings do; maybe that isn't the right table to
357 emulate. In either case, I didn't have much to work on. */
358#define HIL_LOCALE_MAP \
359"", /* 0x00 Reserved */ \
360"", /* 0x01 Reserved */ \
361"", /* 0x02 Reserved */ \
362"swiss.french", /* 0x03 Swiss/French */ \
363"portuguese", /* 0x04 Portuguese */ \
364"arabic", /* 0x05 Arabic */ \
365"hebrew", /* 0x06 Hebrew */ \
366"english.canadian", /* 0x07 Canadian English */ \
367"turkish", /* 0x08 Turkish */ \
368"greek", /* 0x09 Greek */ \
369"thai", /* 0x0a Thai (Thailand) */ \
370"italian", /* 0x0b Italian */ \
371"korean", /* 0x0c Hangul (Korea) */ \
372"dutch", /* 0x0d Dutch */ \
373"swedish", /* 0x0e Swedish */ \
374"german", /* 0x0f German */ \
375"chinese", /* 0x10 Chinese-PRC */ \
376"chinese", /* 0x11 Chinese-ROC */ \
377"swiss.french", /* 0x12 Swiss/French II */ \
378"spanish", /* 0x13 Spanish */ \
379"swiss.german", /* 0x14 Swiss/German II */ \
380"flemish", /* 0x15 Belgian (Flemish) */ \
381"finnish", /* 0x16 Finnish */ \
382"english.uk", /* 0x17 United Kingdom */ \
383"french.canadian", /* 0x18 French/Canadian */ \
384"swiss.german", /* 0x19 Swiss/German */ \
385"norwegian", /* 0x1a Norwegian */ \
386"french", /* 0x1b French */ \
387"danish", /* 0x1c Danish */ \
388"japanese", /* 0x1d Katakana */ \
389"spanish", /* 0x1e Latin American/Spanish*/\
390"english.us" /* 0x1f United States */ \
391
392
393/* HIL keycodes */
394#define HIL_KEYCODES_SET1_TBLSIZE 128
395#define HIL_KEYCODES_SET1 \
396 KEY_5, KEY_RESERVED, KEY_RIGHTALT, KEY_LEFTALT, \
397 KEY_RIGHTSHIFT, KEY_LEFTSHIFT, KEY_LEFTCTRL, KEY_SYSRQ, \
398 KEY_KP4, KEY_KP8, KEY_KP5, KEY_KP9, \
399 KEY_KP6, KEY_KP7, KEY_KPCOMMA, KEY_KPENTER, \
400 KEY_KP1, KEY_KPSLASH, KEY_KP2, KEY_KPPLUS, \
401 KEY_KP3, KEY_KPASTERISK, KEY_KP0, KEY_KPMINUS, \
402 KEY_B, KEY_V, KEY_C, KEY_X, \
403 KEY_Z, KEY_RESERVED, KEY_RESERVED, KEY_ESC, \
404 KEY_6, KEY_F10, KEY_3, KEY_F11, \
405 KEY_KPDOT, KEY_F9, KEY_TAB /*KP*/, KEY_F12, \
406 KEY_H, KEY_G, KEY_F, KEY_D, \
407 KEY_S, KEY_A, KEY_RESERVED, KEY_CAPSLOCK, \
408 KEY_U, KEY_Y, KEY_T, KEY_R, \
409 KEY_E, KEY_W, KEY_Q, KEY_TAB, \
410 KEY_7, KEY_6, KEY_5, KEY_4, \
411 KEY_3, KEY_2, KEY_1, KEY_GRAVE, \
412 KEY_F13, KEY_F14, KEY_F15, KEY_F16, \
413 KEY_F17, KEY_F18, KEY_F19, KEY_F20, \
414 KEY_MENU, KEY_F4, KEY_F3, KEY_F2, \
415 KEY_F1, KEY_VOLUMEUP, KEY_STOP, KEY_SENDFILE, \
416 KEY_SYSRQ, KEY_F5, KEY_F6, KEY_F7, \
417 KEY_F8, KEY_VOLUMEDOWN, KEY_DEL_EOL, KEY_DEL_EOS, \
418 KEY_8, KEY_9, KEY_0, KEY_MINUS, \
419 KEY_EQUAL, KEY_BACKSPACE, KEY_INS_LINE, KEY_DEL_LINE, \
420 KEY_I, KEY_O, KEY_P, KEY_LEFTBRACE, \
421 KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_INSERT, KEY_DELETE, \
422 KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \
423 KEY_APOSTROPHE, KEY_ENTER, KEY_HOME, KEY_PAGEUP, \
424 KEY_M, KEY_COMMA, KEY_DOT, KEY_SLASH, \
425 KEY_BACKSLASH, KEY_SELECT, KEY_102ND, KEY_PAGEDOWN, \
426 KEY_N, KEY_SPACE, KEY_NEXT, KEY_RESERVED, \
427 KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT
428
429
430#define HIL_KEYCODES_SET3_TBLSIZE 128
431#define HIL_KEYCODES_SET3 \
432 KEY_RESERVED, KEY_ESC, KEY_1, KEY_2, \
433 KEY_3, KEY_4, KEY_5, KEY_6, \
434 KEY_7, KEY_8, KEY_9, KEY_0, \
435 KEY_MINUS, KEY_EQUAL, KEY_BACKSPACE, KEY_TAB, \
436 KEY_Q, KEY_W, KEY_E, KEY_R, \
437 KEY_T, KEY_Y, KEY_U, KEY_I, \
438 KEY_O, KEY_P, KEY_LEFTBRACE, KEY_RIGHTBRACE, \
439 KEY_ENTER, KEY_LEFTCTRL, KEY_A, KEY_S, \
440 KEY_D, KEY_F, KEY_G, KEY_H, \
441 KEY_J, KEY_K, KEY_L, KEY_SEMICOLON, \
442 KEY_APOSTROPHE,KEY_GRAVE, KEY_LEFTSHIFT, KEY_BACKSLASH, \
443 KEY_Z, KEY_X, KEY_C, KEY_V, \
444 KEY_B, KEY_N, KEY_M, KEY_COMMA, \
445 KEY_DOT, KEY_SLASH, KEY_RIGHTSHIFT, KEY_KPASTERISK, \
446 KEY_LEFTALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, \
447 KEY_F2, KEY_F3, KEY_F4, KEY_F5, \
448 KEY_F6, KEY_F7, KEY_F8, KEY_F9, \
449 KEY_F10, KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_KP7, \
450 KEY_KP8, KEY_KP9, KEY_KPMINUS, KEY_KP4, \
451 KEY_KP5, KEY_KP6, KEY_KPPLUS, KEY_KP1, \
452 KEY_KP2, KEY_KP3, KEY_KP0, KEY_KPDOT, \
453 KEY_SYSRQ, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
454 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
455 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
456 KEY_UP, KEY_LEFT, KEY_DOWN, KEY_RIGHT, \
457 KEY_HOME, KEY_PAGEUP, KEY_END, KEY_PAGEDOWN, \
458 KEY_INSERT, KEY_DELETE, KEY_102ND, KEY_RESERVED, \
459 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
460 KEY_F1, KEY_F2, KEY_F3, KEY_F4, \
461 KEY_F5, KEY_F6, KEY_F7, KEY_F8, \
462 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, \
463 KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED
464
465
466/* Response to POL command, the "poll record header" */
467
468#define HIL_POL_NUM_AXES_MASK 0x03 /* Number of axis reported */
469#define HIL_POL_CTS 0x04 /* Device ready to receive data */
470#define HIL_POL_STATUS_PENDING 0x08 /* Device has status to report */
471#define HIL_POL_CHARTYPE_MASK 0x70 /* Type of character data to follow */
472#define HIL_POL_CHARTYPE_NONE 0x00 /* No character data to follow */
473#define HIL_POL_CHARTYPE_RSVD1 0x10 /* Reserved Set 1 */
474#define HIL_POL_CHARTYPE_ASCII 0x20 /* U.S. ASCII */
475#define HIL_POL_CHARTYPE_BINARY 0x30 /* Binary data */
476#define HIL_POL_CHARTYPE_SET1 0x40 /* Keycode Set 1 */
477#define HIL_POL_CHARTYPE_RSVD2 0x50 /* Reserved Set 2 */
478#define HIL_POL_CHARTYPE_SET2 0x60 /* Keycode Set 2 */
479#define HIL_POL_CHARTYPE_SET3 0x70 /* Keycode Set 3 */
480#define HIL_POL_AXIS_ALT 0x80 /* Data is from axis set 2 */
481
482
483#endif /* _HIL_H_ */
diff --git a/include/linux/hil_mlc.h b/include/linux/hil_mlc.h
new file mode 100644
index 000000000000..8df29ca48a13
--- /dev/null
+++ b/include/linux/hil_mlc.h
@@ -0,0 +1,168 @@
1/*
2 * HP Human Interface Loop Master Link Controller driver.
3 *
4 * Copyright (c) 2001 Brian S. Julin
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions, and the following disclaimer,
12 * without modification.
13 * 2. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * Alternatively, this software may be distributed under the terms of the
17 * GNU General Public License ("GPL").
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 *
29 * References:
30 * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A
31 *
32 */
33
34#include <linux/hil.h>
35#include <linux/time.h>
36#include <linux/interrupt.h>
37#include <asm/semaphore.h>
38#include <linux/serio.h>
39#include <linux/list.h>
40
41typedef struct hil_mlc hil_mlc;
42
43/* The HIL has a complicated state engine.
44 * We define the structure of nodes in the state engine here.
45 */
46enum hilse_act {
47 /* HILSE_OUT prepares to receive input if the next node
48 * is an IN or EXPECT, and then sends the given packet.
49 */
50 HILSE_OUT = 0,
51
52 /* HILSE_CTS checks if the loop is busy. */
53 HILSE_CTS,
54
55 /* HILSE_OUT_LAST sends the given command packet to
56 * the last configured/running device on the loop.
57 */
58 HILSE_OUT_LAST,
59
60 /* HILSE_OUT_DISC sends the given command packet to
61 * the next device past the last configured/running one.
62 */
63 HILSE_OUT_DISC,
64
65 /* HILSE_FUNC runs a callback function with given arguments.
66 * a positive return value causes the "ugly" branch to be taken.
67 */
68 HILSE_FUNC,
69
70 /* HILSE_IN simply expects any non-errored packet to arrive
71 * within arg usecs.
72 */
73 HILSE_IN = 0x100,
74
75 /* HILSE_EXPECT expects a particular packet to arrive
76 * within arg usecs, any other packet is considered an error.
77 */
78 HILSE_EXPECT,
79
80 /* HILSE_EXPECT_LAST as above but dev field should be last
81 * discovered/operational device.
82 */
83 HILSE_EXPECT_LAST,
84
85 /* HILSE_EXPECT_LAST as above but dev field should be first
86 * undiscovered/inoperational device.
87 */
88 HILSE_EXPECT_DISC
89};
90
91typedef int (hilse_func) (hil_mlc *mlc, int arg);
92struct hilse_node {
93 enum hilse_act act; /* How to process this node */
94 union {
95 hilse_func *func; /* Function to call if HILSE_FUNC */
96 hil_packet packet; /* Packet to send or to compare */
97 } object;
98 int arg; /* Timeout in usec or parm for func */
99 int good; /* Node to jump to on success */
100 int bad; /* Node to jump to on error */
101 int ugly; /* Node to jump to on timeout */
102};
103
104/* Methods for back-end drivers, e.g. hp_sdc_mlc */
105typedef int (hil_mlc_cts) (hil_mlc *mlc);
106typedef void (hil_mlc_out) (hil_mlc *mlc);
107typedef int (hil_mlc_in) (hil_mlc *mlc, suseconds_t timeout);
108
109struct hil_mlc_devinfo {
110 uint8_t idd[16]; /* Device ID Byte and Describe Record */
111 uint8_t rsc[16]; /* Security Code Header and Record */
112 uint8_t exd[16]; /* Extended Describe Record */
113 uint8_t rnm[16]; /* Device name as returned by RNM command */
114};
115
116struct hil_mlc_serio_map {
117 hil_mlc *mlc;
118 int di_revmap;
119 int didx;
120};
121
122/* How many (possibly old/detached) devices the we try to keep track of */
123#define HIL_MLC_DEVMEM 16
124
125struct hil_mlc {
126 struct list_head list; /* hil_mlc is organized as linked list */
127
128 rwlock_t lock;
129
130 void *priv; /* Data specific to a particular type of MLC */
131
132 int seidx; /* Current node in state engine */
133 int istarted, ostarted;
134
135 hil_mlc_cts *cts;
136 struct semaphore csem; /* Raised when loop idle */
137
138 hil_mlc_out *out;
139 struct semaphore osem; /* Raised when outpacket dispatched */
140 hil_packet opacket;
141
142 hil_mlc_in *in;
143 struct semaphore isem; /* Raised when a packet arrives */
144 hil_packet ipacket[16];
145 hil_packet imatch;
146 int icount;
147 struct timeval instart;
148 suseconds_t intimeout;
149
150 int ddi; /* Last operational device id */
151 int lcv; /* LCV to throttle loops */
152 struct timeval lcv_tv; /* Time loop was started */
153
154 int di_map[7]; /* Maps below items to live devs */
155 struct hil_mlc_devinfo di[HIL_MLC_DEVMEM];
156 struct serio *serio[HIL_MLC_DEVMEM];
157 struct hil_mlc_serio_map serio_map[HIL_MLC_DEVMEM];
158 hil_packet serio_opacket[HIL_MLC_DEVMEM];
159 int serio_oidx[HIL_MLC_DEVMEM];
160 struct hil_mlc_devinfo di_scratch; /* Temporary area */
161
162 int opercnt;
163
164 struct tasklet_struct *tasklet;
165};
166
167int hil_mlc_register(hil_mlc *mlc);
168int hil_mlc_unregister(hil_mlc *mlc);
diff --git a/include/linux/hp_sdc.h b/include/linux/hp_sdc.h
new file mode 100644
index 000000000000..debd71515312
--- /dev/null
+++ b/include/linux/hp_sdc.h
@@ -0,0 +1,300 @@
1/*
2 * HP i8042 System Device Controller -- header
3 *
4 * Copyright (c) 2001 Brian S. Julin
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions, and the following disclaimer,
12 * without modification.
13 * 2. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * Alternatively, this software may be distributed under the terms of the
17 * GNU General Public License ("GPL").
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 *
29 * References:
30 *
31 * HP-HIL Technical Reference Manual. Hewlett Packard Product No. 45918A
32 *
33 * System Device Controller Microprocessor Firmware Theory of Operation
34 * for Part Number 1820-4784 Revision B. Dwg No. A-1820-4784-2
35 *
36 */
37
38#ifndef _LINUX_HP_SDC_H
39#define _LINUX_HP_SDC_H
40
41#include <linux/interrupt.h>
42#include <linux/types.h>
43#include <linux/time.h>
44#include <linux/timer.h>
45#if defined(__hppa__)
46#include <asm/hardware.h>
47#endif
48
49
50/* No 4X status reads take longer than this (in usec).
51 */
52#define HP_SDC_MAX_REG_DELAY 20000
53
54typedef void (hp_sdc_irqhook) (int irq, void *dev_id,
55 uint8_t status, uint8_t data);
56
57int hp_sdc_request_timer_irq(hp_sdc_irqhook *callback);
58int hp_sdc_request_hil_irq(hp_sdc_irqhook *callback);
59int hp_sdc_request_cooked_irq(hp_sdc_irqhook *callback);
60int hp_sdc_release_timer_irq(hp_sdc_irqhook *callback);
61int hp_sdc_release_hil_irq(hp_sdc_irqhook *callback);
62int hp_sdc_release_cooked_irq(hp_sdc_irqhook *callback);
63
64typedef struct {
65 int actidx; /* Start of act. Acts are atomic WRT I/O to SDC */
66 int idx; /* Index within the act */
67 int endidx; /* transaction is over and done if idx == endidx */
68 uint8_t *seq; /* commands/data for the transaction */
69 union {
70 hp_sdc_irqhook *irqhook; /* Callback, isr or tasklet context */
71 struct semaphore *semaphore; /* Semaphore to sleep on. */
72 } act;
73} hp_sdc_transaction;
74int hp_sdc_enqueue_transaction(hp_sdc_transaction *this);
75int hp_sdc_dequeue_transaction(hp_sdc_transaction *this);
76
77/* The HP_SDC_ACT* values are peculiar to this driver.
78 * Nuance: never HP_SDC_ACT_DATAIN | HP_SDC_ACT_DEALLOC, use another
79 * act to perform the dealloc.
80 */
81#define HP_SDC_ACT_PRECMD 0x01 /* Send a command first */
82#define HP_SDC_ACT_DATAREG 0x02 /* Set data registers */
83#define HP_SDC_ACT_DATAOUT 0x04 /* Send data bytes */
84#define HP_SDC_ACT_POSTCMD 0x08 /* Send command after */
85#define HP_SDC_ACT_DATAIN 0x10 /* Collect data after */
86#define HP_SDC_ACT_DURING 0x1f
87#define HP_SDC_ACT_SEMAPHORE 0x20 /* Raise semaphore after */
88#define HP_SDC_ACT_CALLBACK 0x40 /* Pass data to IRQ handler */
89#define HP_SDC_ACT_DEALLOC 0x80 /* Destroy transaction after */
90#define HP_SDC_ACT_AFTER 0xe0
91#define HP_SDC_ACT_DEAD 0x60 /* Act timed out. */
92
93/* Rest of the flags are straightforward representation of the SDC interface */
94#define HP_SDC_STATUS_IBF 0x02 /* Input buffer full */
95
96#define HP_SDC_STATUS_IRQMASK 0xf0 /* Bits containing "level 1" irq */
97#define HP_SDC_STATUS_PERIODIC 0x10 /* Periodic 10ms timer */
98#define HP_SDC_STATUS_USERTIMER 0x20 /* "Special purpose" timer */
99#define HP_SDC_STATUS_TIMER 0x30 /* Both PERIODIC and USERTIMER */
100#define HP_SDC_STATUS_REG 0x40 /* Data from an i8042 register */
101#define HP_SDC_STATUS_HILCMD 0x50 /* Command from HIL MLC */
102#define HP_SDC_STATUS_HILDATA 0x60 /* Data from HIL MLC */
103#define HP_SDC_STATUS_PUP 0x70 /* Sucessful power-up self test */
104#define HP_SDC_STATUS_KCOOKED 0x80 /* Key from cooked kbd */
105#define HP_SDC_STATUS_KRPG 0xc0 /* Key from Repeat Gen */
106#define HP_SDC_STATUS_KMOD_SUP 0x10 /* Shift key is up */
107#define HP_SDC_STATUS_KMOD_CUP 0x20 /* Control key is up */
108
109#define HP_SDC_NMISTATUS_FHS 0x40 /* NMI is a fast handshake irq */
110
111/* Internal i8042 registers (there are more, but they are not too useful). */
112
113#define HP_SDC_USE 0x02 /* Resource usage (including OB bit) */
114#define HP_SDC_IM 0x04 /* Interrupt mask */
115#define HP_SDC_CFG 0x11 /* Configuration register */
116#define HP_SDC_KBLANGUAGE 0x12 /* Keyboard language */
117
118#define HP_SDC_D0 0x70 /* General purpose data buffer 0 */
119#define HP_SDC_D1 0x71 /* General purpose data buffer 1 */
120#define HP_SDC_D2 0x72 /* General purpose data buffer 2 */
121#define HP_SDC_D3 0x73 /* General purpose data buffer 3 */
122#define HP_SDC_VT1 0x74 /* Timer for voice 1 */
123#define HP_SDC_VT2 0x75 /* Timer for voice 2 */
124#define HP_SDC_VT3 0x76 /* Timer for voice 3 */
125#define HP_SDC_VT4 0x77 /* Timer for voice 4 */
126#define HP_SDC_KBN 0x78 /* Which HIL devs are Nimitz */
127#define HP_SDC_KBC 0x79 /* Which HIL devs are cooked kbds */
128#define HP_SDC_LPS 0x7a /* i8042's view of HIL status */
129#define HP_SDC_LPC 0x7b /* i8042's view of HIL "control" */
130#define HP_SDC_RSV 0x7c /* Reserved "for testing" */
131#define HP_SDC_LPR 0x7d /* i8042 count of HIL reconfigs */
132#define HP_SDC_XTD 0x7e /* "Extended Configuration" register */
133#define HP_SDC_STR 0x7f /* i8042 self-test result */
134
135/* Bitfields for above registers */
136#define HP_SDC_USE_LOOP 0x04 /* Command is currently on the loop. */
137
138#define HP_SDC_IM_MASK 0x1f /* these bits not part of cmd/status */
139#define HP_SDC_IM_FH 0x10 /* Mask the fast handshake irq */
140#define HP_SDC_IM_PT 0x08 /* Mask the periodic timer irq */
141#define HP_SDC_IM_TIMERS 0x04 /* Mask the MT/DT/CT irq */
142#define HP_SDC_IM_RESET 0x02 /* Mask the reset key irq */
143#define HP_SDC_IM_HIL 0x01 /* Mask the HIL MLC irq */
144
145#define HP_SDC_CFG_ROLLOVER 0x08 /* WTF is "N-key rollover"? */
146#define HP_SDC_CFG_KBD 0x10 /* There is a keyboard */
147#define HP_SDC_CFG_NEW 0x20 /* Supports/uses HIL MLC */
148#define HP_SDC_CFG_KBD_OLD 0x03 /* keyboard code for non-HIL */
149#define HP_SDC_CFG_KBD_NEW 0x07 /* keyboard code from HIL autoconfig */
150#define HP_SDC_CFG_REV 0x40 /* Code revision bit */
151#define HP_SDC_CFG_IDPROM 0x80 /* IDPROM present in kbd (not HIL) */
152
153#define HP_SDC_LPS_NDEV 0x07 /* # devices autoconfigured on HIL */
154#define HP_SDC_LPS_ACSUCC 0x08 /* loop autoconfigured successfully */
155#define HP_SDC_LPS_ACFAIL 0x80 /* last loop autoconfigure failed */
156
157#define HP_SDC_LPC_APE_IPF 0x01 /* HIL MLC APE/IPF (autopoll) set */
158#define HP_SDC_LPC_ARCONERR 0x02 /* i8042 autoreconfigs loop on err */
159#define HP_SDC_LPC_ARCQUIET 0x03 /* i8042 doesn't report autoreconfigs*/
160#define HP_SDC_LPC_COOK 0x10 /* i8042 cooks devices in _KBN */
161#define HP_SDC_LPC_RC 0x80 /* causes autoreconfig */
162
163#define HP_SDC_XTD_REV 0x07 /* contains revision code */
164#define HP_SDC_XTD_REV_STRINGS(val, str) \
165switch (val) { \
166 case 0x1: str = "1820-3712"; break; \
167 case 0x2: str = "1820-4379"; break; \
168 case 0x3: str = "1820-4784"; break; \
169 default: str = "unknown"; \
170};
171#define HP_SDC_XTD_BEEPER 0x08 /* TI SN76494 beeper available */
172#define HP_SDC_XTD_BBRTC 0x20 /* OKI MSM-58321 BBRTC present */
173
174#define HP_SDC_CMD_LOAD_RT 0x31 /* Load real time (from 8042) */
175#define HP_SDC_CMD_LOAD_FHS 0x36 /* Load the fast handshake timer */
176#define HP_SDC_CMD_LOAD_MT 0x38 /* Load the match timer */
177#define HP_SDC_CMD_LOAD_DT 0x3B /* Load the delay timer */
178#define HP_SDC_CMD_LOAD_CT 0x3E /* Load the cycle timer */
179
180#define HP_SDC_CMD_SET_IM 0x40 /* 010xxxxx == set irq mask */
181
182/* The documents provided do not explicitly state that all registers betweem
183 * 0x01 and 0x1f inclusive can be read by sending their register index as a
184 * command, but this is implied and appears to be the case.
185 */
186#define HP_SDC_CMD_READ_RAM 0x00 /* Load from i8042 RAM (autoinc) */
187#define HP_SDC_CMD_READ_USE 0x02 /* Undocumented! Load from usage reg */
188#define HP_SDC_CMD_READ_IM 0x04 /* Load current interrupt mask */
189#define HP_SDC_CMD_READ_KCC 0x11 /* Load primary kbd config code */
190#define HP_SDC_CMD_READ_KLC 0x12 /* Load primary kbd language code */
191#define HP_SDC_CMD_READ_T1 0x13 /* Load timer output buffer byte 1 */
192#define HP_SDC_CMD_READ_T2 0x14 /* Load timer output buffer byte 1 */
193#define HP_SDC_CMD_READ_T3 0x15 /* Load timer output buffer byte 1 */
194#define HP_SDC_CMD_READ_T4 0x16 /* Load timer output buffer byte 1 */
195#define HP_SDC_CMD_READ_T5 0x17 /* Load timer output buffer byte 1 */
196#define HP_SDC_CMD_READ_D0 0xf0 /* Load from i8042 RAM location 0x70 */
197#define HP_SDC_CMD_READ_D1 0xf1 /* Load from i8042 RAM location 0x71 */
198#define HP_SDC_CMD_READ_D2 0xf2 /* Load from i8042 RAM location 0x72 */
199#define HP_SDC_CMD_READ_D3 0xf3 /* Load from i8042 RAM location 0x73 */
200#define HP_SDC_CMD_READ_VT1 0xf4 /* Load from i8042 RAM location 0x74 */
201#define HP_SDC_CMD_READ_VT2 0xf5 /* Load from i8042 RAM location 0x75 */
202#define HP_SDC_CMD_READ_VT3 0xf6 /* Load from i8042 RAM location 0x76 */
203#define HP_SDC_CMD_READ_VT4 0xf7 /* Load from i8042 RAM location 0x77 */
204#define HP_SDC_CMD_READ_KBN 0xf8 /* Load from i8042 RAM location 0x78 */
205#define HP_SDC_CMD_READ_KBC 0xf9 /* Load from i8042 RAM location 0x79 */
206#define HP_SDC_CMD_READ_LPS 0xfa /* Load from i8042 RAM location 0x7a */
207#define HP_SDC_CMD_READ_LPC 0xfb /* Load from i8042 RAM location 0x7b */
208#define HP_SDC_CMD_READ_RSV 0xfc /* Load from i8042 RAM location 0x7c */
209#define HP_SDC_CMD_READ_LPR 0xfd /* Load from i8042 RAM location 0x7d */
210#define HP_SDC_CMD_READ_XTD 0xfe /* Load from i8042 RAM location 0x7e */
211#define HP_SDC_CMD_READ_STR 0xff /* Load from i8042 RAM location 0x7f */
212
213#define HP_SDC_CMD_SET_ARD 0xA0 /* Set emulated autorepeat delay */
214#define HP_SDC_CMD_SET_ARR 0xA2 /* Set emulated autorepeat rate */
215#define HP_SDC_CMD_SET_BELL 0xA3 /* Set voice 3 params for "beep" cmd */
216#define HP_SDC_CMD_SET_RPGR 0xA6 /* Set "RPG" irq rate (doesn't work) */
217#define HP_SDC_CMD_SET_RTMS 0xAD /* Set the RTC time (milliseconds) */
218#define HP_SDC_CMD_SET_RTD 0xAF /* Set the RTC time (days) */
219#define HP_SDC_CMD_SET_FHS 0xB2 /* Set fast handshake timer */
220#define HP_SDC_CMD_SET_MT 0xB4 /* Set match timer */
221#define HP_SDC_CMD_SET_DT 0xB7 /* Set delay timer */
222#define HP_SDC_CMD_SET_CT 0xBA /* Set cycle timer */
223#define HP_SDC_CMD_SET_RAMP 0xC1 /* Reset READ_RAM autoinc counter */
224#define HP_SDC_CMD_SET_D0 0xe0 /* Load to i8042 RAM location 0x70 */
225#define HP_SDC_CMD_SET_D1 0xe1 /* Load to i8042 RAM location 0x71 */
226#define HP_SDC_CMD_SET_D2 0xe2 /* Load to i8042 RAM location 0x72 */
227#define HP_SDC_CMD_SET_D3 0xe3 /* Load to i8042 RAM location 0x73 */
228#define HP_SDC_CMD_SET_VT1 0xe4 /* Load to i8042 RAM location 0x74 */
229#define HP_SDC_CMD_SET_VT2 0xe5 /* Load to i8042 RAM location 0x75 */
230#define HP_SDC_CMD_SET_VT3 0xe6 /* Load to i8042 RAM location 0x76 */
231#define HP_SDC_CMD_SET_VT4 0xe7 /* Load to i8042 RAM location 0x77 */
232#define HP_SDC_CMD_SET_KBN 0xe8 /* Load to i8042 RAM location 0x78 */
233#define HP_SDC_CMD_SET_KBC 0xe9 /* Load to i8042 RAM location 0x79 */
234#define HP_SDC_CMD_SET_LPS 0xea /* Load to i8042 RAM location 0x7a */
235#define HP_SDC_CMD_SET_LPC 0xeb /* Load to i8042 RAM location 0x7b */
236#define HP_SDC_CMD_SET_RSV 0xec /* Load to i8042 RAM location 0x7c */
237#define HP_SDC_CMD_SET_LPR 0xed /* Load to i8042 RAM location 0x7d */
238#define HP_SDC_CMD_SET_XTD 0xee /* Load to i8042 RAM location 0x7e */
239#define HP_SDC_CMD_SET_STR 0xef /* Load to i8042 RAM location 0x7f */
240
241#define HP_SDC_CMD_DO_RTCW 0xc2 /* i8042 RAM 0x70 --> RTC */
242#define HP_SDC_CMD_DO_RTCR 0xc3 /* RTC[0x70 0:3] --> irq/status/data */
243#define HP_SDC_CMD_DO_BEEP 0xc4 /* i8042 RAM 0x70-74 --> beeper,VT3 */
244#define HP_SDC_CMD_DO_HIL 0xc5 /* i8042 RAM 0x70-73 -->
245 HIL MLC R0,R1 i8042 HIL watchdog */
246
247/* Values used to (de)mangle input/output to/from the HIL MLC */
248#define HP_SDC_DATA 0x40 /* Data from an 8042 register */
249#define HP_SDC_HIL_CMD 0x50 /* Data from HIL MLC R1/8042 */
250#define HP_SDC_HIL_R1MASK 0x0f /* Contents of HIL MLC R1 0:3 */
251#define HP_SDC_HIL_AUTO 0x10 /* Set if POL results from i8042 */
252#define HP_SDC_HIL_ISERR 0x80 /* Has meaning as in next 4 values */
253#define HP_SDC_HIL_RC_DONE 0x80 /* i8042 auto-configured loop */
254#define HP_SDC_HIL_ERR 0x81 /* HIL MLC R2 had a bit set */
255#define HP_SDC_HIL_TO 0x82 /* i8042 HIL watchdog expired */
256#define HP_SDC_HIL_RC 0x84 /* i8042 is auto-configuring loop */
257#define HP_SDC_HIL_DAT 0x60 /* Data from HIL MLC R0 */
258
259
260typedef struct {
261 rwlock_t ibf_lock;
262 rwlock_t lock; /* user/tasklet lock */
263 rwlock_t rtq_lock; /* isr/tasklet lock */
264 rwlock_t hook_lock; /* isr/user lock for handler add/del */
265
266 unsigned int irq, nmi; /* Our IRQ lines */
267 unsigned long base_io, status_io, data_io; /* Our IO ports */
268
269 uint8_t im; /* Interrupt mask */
270 int set_im; /* Interrupt mask needs to be set. */
271
272 int ibf; /* Last known status of IBF flag */
273 uint8_t wi; /* current i8042 write index */
274 uint8_t r7[4]; /* current i8042[0x70 - 0x74] values */
275 uint8_t r11, r7e; /* Values from version/revision regs */
276
277 hp_sdc_irqhook *timer, *reg, *hil, *pup, *cooked;
278
279#define HP_SDC_QUEUE_LEN 16
280 hp_sdc_transaction *tq[HP_SDC_QUEUE_LEN]; /* All pending read/writes */
281
282 int rcurr, rqty; /* Current read transact in process */
283 struct timeval rtv; /* Time when current read started */
284 int wcurr; /* Current write transact in process */
285
286 int dev_err; /* carries status from registration */
287#if defined(__hppa__)
288 struct parisc_device *dev;
289#elif defined(__mc68000__)
290 void *dev;
291#else
292#error No support for device registration on this arch yet.
293#endif
294
295 struct timer_list kicker; /* Keeps below task alive */
296 struct tasklet_struct task;
297
298} hp_i8042_sdc;
299
300#endif /* _LINUX_HP_SDC_H */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index e670b0d13fe0..1056717ee501 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -16,7 +16,6 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
16int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 16int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
17int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); 17int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
18int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); 18int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int);
19void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
20void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); 19void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
21int hugetlb_prefault(struct address_space *, struct vm_area_struct *); 20int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
22int hugetlb_report_meminfo(char *); 21int hugetlb_report_meminfo(char *);
@@ -25,6 +24,8 @@ int is_hugepage_mem_enough(size_t);
25unsigned long hugetlb_total_pages(void); 24unsigned long hugetlb_total_pages(void);
26struct page *alloc_huge_page(void); 25struct page *alloc_huge_page(void);
27void free_huge_page(struct page *); 26void free_huge_page(struct page *);
27int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
28 unsigned long address, int write_access);
28 29
29extern unsigned long max_huge_pages; 30extern unsigned long max_huge_pages;
30extern const unsigned long hugetlb_zero, hugetlb_infinity; 31extern const unsigned long hugetlb_zero, hugetlb_infinity;
@@ -85,7 +86,6 @@ static inline unsigned long hugetlb_total_pages(void)
85#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) 86#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)
86#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) 87#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
87#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) 88#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; })
88#define zap_hugepage_range(vma, start, len) BUG()
89#define unmap_hugepage_range(vma, start, end) BUG() 89#define unmap_hugepage_range(vma, start, end) BUG()
90#define is_hugepage_mem_enough(size) 0 90#define is_hugepage_mem_enough(size) 0
91#define hugetlb_report_meminfo(buf) 0 91#define hugetlb_report_meminfo(buf) 0
@@ -99,10 +99,11 @@ static inline unsigned long hugetlb_total_pages(void)
99 do { } while (0) 99 do { } while (0)
100#define alloc_huge_page() ({ NULL; }) 100#define alloc_huge_page() ({ NULL; })
101#define free_huge_page(p) ({ (void)(p); BUG(); }) 101#define free_huge_page(p) ({ (void)(p); BUG(); })
102#define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; })
102 103
103#ifndef HPAGE_MASK 104#ifndef HPAGE_MASK
104#define HPAGE_MASK 0 /* Keep the compiler happy */ 105#define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */
105#define HPAGE_SIZE 0 106#define HPAGE_SIZE PAGE_SIZE
106#endif 107#endif
107 108
108#endif /* !CONFIG_HUGETLB_PAGE */ 109#endif /* !CONFIG_HUGETLB_PAGE */
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h
index 110904481238..c0e7fab28ce3 100644
--- a/include/linux/i2c-algo-bit.h
+++ b/include/linux/i2c-algo-bit.h
@@ -21,8 +21,6 @@
21/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even 21/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
22 Frodo Looijaard <frodol@dds.nl> */ 22 Frodo Looijaard <frodol@dds.nl> */
23 23
24/* $Id: i2c-algo-bit.h,v 1.10 2003/01/21 08:08:16 kmalkki Exp $ */
25
26#ifndef _LINUX_I2C_ALGO_BIT_H 24#ifndef _LINUX_I2C_ALGO_BIT_H
27#define _LINUX_I2C_ALGO_BIT_H 25#define _LINUX_I2C_ALGO_BIT_H
28 26
@@ -46,8 +44,6 @@ struct i2c_algo_bit_data {
46 int timeout; /* in jiffies */ 44 int timeout; /* in jiffies */
47}; 45};
48 46
49#define I2C_BIT_ADAP_MAX 16
50
51int i2c_bit_add_bus(struct i2c_adapter *); 47int i2c_bit_add_bus(struct i2c_adapter *);
52int i2c_bit_del_bus(struct i2c_adapter *); 48int i2c_bit_del_bus(struct i2c_adapter *);
53 49
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h
index 941b786c5732..226693e0d88b 100644
--- a/include/linux/i2c-algo-pca.h
+++ b/include/linux/i2c-algo-pca.h
@@ -9,8 +9,6 @@ struct i2c_algo_pca_data {
9 int (*wait_for_interrupt) (struct i2c_algo_pca_data *adap); 9 int (*wait_for_interrupt) (struct i2c_algo_pca_data *adap);
10}; 10};
11 11
12#define I2C_PCA_ADAP_MAX 16
13
14int i2c_pca_add_bus(struct i2c_adapter *); 12int i2c_pca_add_bus(struct i2c_adapter *);
15int i2c_pca_del_bus(struct i2c_adapter *); 13int i2c_pca_del_bus(struct i2c_adapter *);
16 14
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h
index 2a508562255f..18b0adf57a3d 100644
--- a/include/linux/i2c-algo-pcf.h
+++ b/include/linux/i2c-algo-pcf.h
@@ -22,8 +22,6 @@
22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even 22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
23 Frodo Looijaard <frodol@dds.nl> */ 23 Frodo Looijaard <frodol@dds.nl> */
24 24
25/* $Id: i2c-algo-pcf.h,v 1.8 2003/01/21 08:08:16 kmalkki Exp $ */
26
27#ifndef _LINUX_I2C_ALGO_PCF_H 25#ifndef _LINUX_I2C_ALGO_PCF_H
28#define _LINUX_I2C_ALGO_PCF_H 26#define _LINUX_I2C_ALGO_PCF_H
29 27
@@ -41,8 +39,6 @@ struct i2c_algo_pcf_data {
41 int timeout; 39 int timeout;
42}; 40};
43 41
44#define I2C_PCF_ADAP_MAX 16
45
46int i2c_pcf_add_bus(struct i2c_adapter *); 42int i2c_pcf_add_bus(struct i2c_adapter *);
47int i2c_pcf_del_bus(struct i2c_adapter *); 43int i2c_pcf_del_bus(struct i2c_adapter *);
48 44
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h
index 541695679762..81c229a0fbca 100644
--- a/include/linux/i2c-dev.h
+++ b/include/linux/i2c-dev.h
@@ -19,8 +19,6 @@
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20*/ 20*/
21 21
22/* $Id: i2c-dev.h,v 1.13 2003/01/21 08:08:16 kmalkki Exp $ */
23
24#ifndef _LINUX_I2C_DEV_H 22#ifndef _LINUX_I2C_DEV_H
25#define _LINUX_I2C_DEV_H 23#define _LINUX_I2C_DEV_H
26 24
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 44f30876a1c9..ef3b5632e63a 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -27,10 +27,10 @@
27 * ---- Driver types ----------------------------------------------------- 27 * ---- Driver types -----------------------------------------------------
28 * device id name + number function description, i2c address(es) 28 * device id name + number function description, i2c address(es)
29 * 29 *
30 * Range 1000-1999 range is defined in sensors/sensors.h 30 * Range 1000-1999 range is defined in sensors/sensors.h
31 * Range 0x100 - 0x1ff is for V4L2 Common Components 31 * Range 0x100 - 0x1ff is for V4L2 Common Components
32 * Range 0xf000 - 0xffff is reserved for local experimentation, and should 32 * Range 0xf000 - 0xffff is reserved for local experimentation, and should
33 * never be used in official drivers 33 * never be used in official drivers
34 */ 34 */
35 35
36#define I2C_DRIVERID_MSP3400 1 36#define I2C_DRIVERID_MSP3400 1
@@ -99,7 +99,16 @@
99#define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ 99#define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */
100#define I2C_DRIVERID_SAA7114H 64 /* video decoder */ 100#define I2C_DRIVERID_SAA7114H 64 /* video decoder */
101#define I2C_DRIVERID_DS1374 65 /* DS1374 real time clock */ 101#define I2C_DRIVERID_DS1374 65 /* DS1374 real time clock */
102 102#define I2C_DRIVERID_TDA9874 66 /* TV sound decoder */
103#define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */
104#define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */
105#define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */
106#define I2C_DRIVERID_CS53L32A 70 /* cs53l32a audio processor */
107#define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */
108#define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */
109#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */
110#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */
111#define I2C_DRIVERID_I2C_IR 75 /* I2C InfraRed on Video boards */
103 112
104#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ 113#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */
105#define I2C_DRIVERID_EXP1 0xF1 114#define I2C_DRIVERID_EXP1 0xF1
@@ -111,7 +120,7 @@
111#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 120#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
112#define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */ 121#define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */
113 122
114/* IDs -- Use DRIVERIDs 1000-1999 for sensors. 123/* IDs -- Use DRIVERIDs 1000-1999 for sensors.
115 These were originally in sensors.h in the lm_sensors package */ 124 These were originally in sensors.h in the lm_sensors package */
116#define I2C_DRIVERID_LM78 1002 125#define I2C_DRIVERID_LM78 1002
117#define I2C_DRIVERID_LM75 1003 126#define I2C_DRIVERID_LM75 1003
@@ -164,10 +173,7 @@
164 173
165/* --- Bit algorithm adapters */ 174/* --- Bit algorithm adapters */
166#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ 175#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */
167#define I2C_HW_B_LPC 0x010001 /* Parallel port control reg. */
168#define I2C_HW_B_SER 0x010002 /* Serial line interface */ 176#define I2C_HW_B_SER 0x010002 /* Serial line interface */
169#define I2C_HW_B_ELV 0x010003 /* ELV Card */
170#define I2C_HW_B_VELLE 0x010004 /* Vellemann K8000 */
171#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ 177#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */
172#define I2C_HW_B_WNV 0x010006 /* Winnov Videums */ 178#define I2C_HW_B_WNV 0x010006 /* Winnov Videums */
173#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ 179#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */
@@ -193,6 +199,7 @@
193#define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */ 199#define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */
194#define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ 200#define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */
195#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ 201#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */
202#define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */
196 203
197/* --- PCF 8584 based algorithms */ 204/* --- PCF 8584 based algorithms */
198#define I2C_HW_P_LP 0x020000 /* Parallel port interface */ 205#define I2C_HW_P_LP 0x020000 /* Parallel port interface */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 3d49a305bf88..5e19a7ba69b2 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -23,15 +23,15 @@
23/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and 23/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and
24 Frodo Looijaard <frodol@dds.nl> */ 24 Frodo Looijaard <frodol@dds.nl> */
25 25
26/* $Id: i2c.h,v 1.68 2003/01/21 08:08:16 kmalkki Exp $ */
27
28#ifndef _LINUX_I2C_H 26#ifndef _LINUX_I2C_H
29#define _LINUX_I2C_H 27#define _LINUX_I2C_H
30 28
31#include <linux/module.h> 29#include <linux/module.h>
32#include <linux/types.h> 30#include <linux/types.h>
33#include <linux/i2c-id.h> 31#include <linux/i2c-id.h>
32#include <linux/mod_devicetable.h>
34#include <linux/device.h> /* for struct device */ 33#include <linux/device.h> /* for struct device */
34#include <linux/sched.h> /* for completion */
35#include <asm/semaphore.h> 35#include <asm/semaphore.h>
36 36
37/* --- For i2c-isa ---------------------------------------------------- */ 37/* --- For i2c-isa ---------------------------------------------------- */
@@ -94,10 +94,10 @@ extern s32 i2c_smbus_write_byte_data(struct i2c_client * client,
94extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); 94extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
95extern s32 i2c_smbus_write_word_data(struct i2c_client * client, 95extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
96 u8 command, u16 value); 96 u8 command, u16 value);
97/* Returns the number of bytes transferred */
98extern s32 i2c_smbus_write_block_data(struct i2c_client * client, 97extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
99 u8 command, u8 length, 98 u8 command, u8 length,
100 u8 *values); 99 u8 *values);
100/* Returns the number of read bytes */
101extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 101extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
102 u8 command, u8 *values); 102 u8 command, u8 *values);
103 103
@@ -391,10 +391,6 @@ struct i2c_msg {
391#define I2C_FUNC_10BIT_ADDR 0x00000002 391#define I2C_FUNC_10BIT_ADDR 0x00000002
392#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ 392#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
393#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ 393#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */
394#define I2C_FUNC_SMBUS_READ_WORD_DATA_PEC 0x00000800 /* SMBus 2.0 */
395#define I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC 0x00001000 /* SMBus 2.0 */
396#define I2C_FUNC_SMBUS_PROC_CALL_PEC 0x00002000 /* SMBus 2.0 */
397#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL_PEC 0x00004000 /* SMBus 2.0 */
398#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ 394#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
399#define I2C_FUNC_SMBUS_QUICK 0x00010000 395#define I2C_FUNC_SMBUS_QUICK 0x00010000
400#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 396#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
@@ -410,8 +406,6 @@ struct i2c_msg {
410#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ 406#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
411#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ 407#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */
412#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */ 408#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 /* w/ 2-byte reg. addr. */
413#define I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC 0x40000000 /* SMBus 2.0 */
414#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC 0x80000000 /* SMBus 2.0 */
415 409
416#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \ 410#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | \
417 I2C_FUNC_SMBUS_WRITE_BYTE) 411 I2C_FUNC_SMBUS_WRITE_BYTE)
@@ -425,17 +419,6 @@ struct i2c_msg {
425 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) 419 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
426#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \ 420#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | \
427 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) 421 I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2)
428#define I2C_FUNC_SMBUS_BLOCK_DATA_PEC (I2C_FUNC_SMBUS_READ_BLOCK_DATA_PEC | \
429 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC)
430#define I2C_FUNC_SMBUS_WORD_DATA_PEC (I2C_FUNC_SMBUS_READ_WORD_DATA_PEC | \
431 I2C_FUNC_SMBUS_WRITE_WORD_DATA_PEC)
432
433#define I2C_FUNC_SMBUS_READ_BYTE_PEC I2C_FUNC_SMBUS_READ_BYTE_DATA
434#define I2C_FUNC_SMBUS_WRITE_BYTE_PEC I2C_FUNC_SMBUS_WRITE_BYTE_DATA
435#define I2C_FUNC_SMBUS_READ_BYTE_DATA_PEC I2C_FUNC_SMBUS_READ_WORD_DATA
436#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA_PEC I2C_FUNC_SMBUS_WRITE_WORD_DATA
437#define I2C_FUNC_SMBUS_BYTE_PEC I2C_FUNC_SMBUS_BYTE_DATA
438#define I2C_FUNC_SMBUS_BYTE_DATA_PEC I2C_FUNC_SMBUS_WORD_DATA
439 422
440#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \ 423#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | \
441 I2C_FUNC_SMBUS_BYTE | \ 424 I2C_FUNC_SMBUS_BYTE | \
@@ -443,20 +426,17 @@ struct i2c_msg {
443 I2C_FUNC_SMBUS_WORD_DATA | \ 426 I2C_FUNC_SMBUS_WORD_DATA | \
444 I2C_FUNC_SMBUS_PROC_CALL | \ 427 I2C_FUNC_SMBUS_PROC_CALL | \
445 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ 428 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
446 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA_PEC | \
447 I2C_FUNC_SMBUS_I2C_BLOCK) 429 I2C_FUNC_SMBUS_I2C_BLOCK)
448 430
449/* 431/*
450 * Data for SMBus Messages 432 * Data for SMBus Messages
451 */ 433 */
452#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ 434#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
453#define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */
454union i2c_smbus_data { 435union i2c_smbus_data {
455 __u8 byte; 436 __u8 byte;
456 __u16 word; 437 __u16 word;
457 __u8 block[I2C_SMBUS_BLOCK_MAX + 3]; /* block[0] is used for length */ 438 __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */
458 /* one more for read length in block process call */ 439 /* and one more for user-space compatibility */
459 /* and one more for PEC */
460}; 440};
461 441
462/* smbus_access read or write markers */ 442/* smbus_access read or write markers */
@@ -473,10 +453,6 @@ union i2c_smbus_data {
473#define I2C_SMBUS_BLOCK_DATA 5 453#define I2C_SMBUS_BLOCK_DATA 5
474#define I2C_SMBUS_I2C_BLOCK_DATA 6 454#define I2C_SMBUS_I2C_BLOCK_DATA 6
475#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ 455#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
476#define I2C_SMBUS_BLOCK_DATA_PEC 8 /* SMBus 2.0 */
477#define I2C_SMBUS_PROC_CALL_PEC 9 /* SMBus 2.0 */
478#define I2C_SMBUS_BLOCK_PROC_CALL_PEC 10 /* SMBus 2.0 */
479#define I2C_SMBUS_WORD_DATA_PEC 11 /* SMBus 2.0 */
480 456
481 457
482/* ----- commands for the ioctl like i2c_command call: 458/* ----- commands for the ioctl like i2c_command call:
@@ -506,11 +482,6 @@ union i2c_smbus_data {
506 482
507#define I2C_SMBUS 0x0720 /* SMBus-level access */ 483#define I2C_SMBUS 0x0720 /* SMBus-level access */
508 484
509/* ... algo-bit.c recognizes */
510#define I2C_UDELAY 0x0705 /* set delay in microsecs between each */
511 /* written byte (except address) */
512#define I2C_MDELAY 0x0706 /* millisec delay between written bytes */
513
514/* ----- I2C-DEV: char device interface stuff ------------------------- */ 485/* ----- I2C-DEV: char device interface stuff ------------------------- */
515 486
516#define I2C_MAJOR 89 /* Device major number */ 487#define I2C_MAJOR 89 /* Device major number */
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index bdc286ec947c..d79c8a4bc4f8 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -25,10 +25,14 @@
25/* How many different OSM's are we allowing */ 25/* How many different OSM's are we allowing */
26#define I2O_MAX_DRIVERS 8 26#define I2O_MAX_DRIVERS 8
27 27
28#include <asm/io.h>
29#include <asm/semaphore.h> /* Needed for MUTEX init macros */
30#include <linux/pci.h> 28#include <linux/pci.h>
31#include <linux/dma-mapping.h> 29#include <linux/dma-mapping.h>
30#include <linux/string.h>
31#include <linux/slab.h>
32#include <linux/workqueue.h> /* work_struct */
33
34#include <asm/io.h>
35#include <asm/semaphore.h> /* Needed for MUTEX init macros */
32 36
33/* message queue empty */ 37/* message queue empty */
34#define I2O_QUEUE_EMPTY 0xffffffff 38#define I2O_QUEUE_EMPTY 0xffffffff
@@ -66,8 +70,6 @@ struct i2o_device {
66 struct device device; 70 struct device device;
67 71
68 struct semaphore lock; /* device lock */ 72 struct semaphore lock; /* device lock */
69
70 struct class_device classdev; /* i2o device class */
71}; 73};
72 74
73/* 75/*
@@ -194,7 +196,7 @@ struct i2o_controller {
194 struct resource mem_resource; /* Mem resource allocated to the IOP */ 196 struct resource mem_resource; /* Mem resource allocated to the IOP */
195 197
196 struct device device; 198 struct device device;
197 struct class_device classdev; /* I2O controller class */ 199 struct class_device *classdev; /* I2O controller class device */
198 struct i2o_device *exec; /* Executive */ 200 struct i2o_device *exec; /* Executive */
199#if BITS_PER_LONG == 64 201#if BITS_PER_LONG == 64
200 spinlock_t context_list_lock; /* lock for context_list */ 202 spinlock_t context_list_lock; /* lock for context_list */
@@ -492,7 +494,7 @@ static inline int i2o_dma_map_sg(struct i2o_controller *c,
492 * Returns 0 on success or -ENOMEM on failure. 494 * Returns 0 on success or -ENOMEM on failure.
493 */ 495 */
494static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr, 496static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr,
495 size_t len, unsigned int gfp_mask) 497 size_t len, gfp_t gfp_mask)
496{ 498{
497 struct pci_dev *pdev = to_pci_dev(dev); 499 struct pci_dev *pdev = to_pci_dev(dev);
498 int dma_64 = 0; 500 int dma_64 = 0;
@@ -551,7 +553,7 @@ static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr)
551 * Returns the 0 on success or negative error code on failure. 553 * Returns the 0 on success or negative error code on failure.
552 */ 554 */
553static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr, 555static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr,
554 size_t len, unsigned int gfp_mask) 556 size_t len, gfp_t gfp_mask)
555{ 557{
556 i2o_dma_free(dev, addr); 558 i2o_dma_free(dev, addr);
557 559
diff --git a/include/linux/ibmtr.h b/include/linux/ibmtr.h
index 2ef0b21517fb..1c7a0dd5536a 100644
--- a/include/linux/ibmtr.h
+++ b/include/linux/ibmtr.h
@@ -7,8 +7,8 @@
7/* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ 7/* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */
8 8
9#define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ 9#define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */
10#define TR_RST_TIME (HZ/20) /* 5 on PC = 50 ms */ 10#define TR_RST_TIME (msecs_to_jiffies(50)) /* 5 on PC = 50 ms */
11#define TR_BUSY_INTERVAL (HZ/5) /* 5 on PC = 200 ms */ 11#define TR_BUSY_INTERVAL (msecs_to_jiffies(200)) /* 5 on PC = 200 ms */
12#define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ 12#define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */
13 13
14#define TR_ISA 1 14#define TR_ISA 1
diff --git a/include/linux/ide.h b/include/linux/ide.h
index a6dbb51ecd7b..a39c3c59789d 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -218,7 +218,7 @@ typedef enum { ide_unknown, ide_generic, ide_pci,
218 ide_rz1000, ide_trm290, 218 ide_rz1000, ide_trm290,
219 ide_cmd646, ide_cy82c693, ide_4drives, 219 ide_cmd646, ide_cy82c693, ide_4drives,
220 ide_pmac, ide_etrax100, ide_acorn, 220 ide_pmac, ide_etrax100, ide_acorn,
221 ide_forced 221 ide_au1xxx, ide_forced
222} hwif_chipset_t; 222} hwif_chipset_t;
223 223
224/* 224/*
@@ -230,6 +230,7 @@ typedef struct hw_regs_s {
230 int dma; /* our dma entry */ 230 int dma; /* our dma entry */
231 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ 231 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
232 hwif_chipset_t chipset; 232 hwif_chipset_t chipset;
233 struct device *dev;
233} hw_regs_t; 234} hw_regs_t;
234 235
235/* 236/*
@@ -266,6 +267,10 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
266 267
267#include <asm/ide.h> 268#include <asm/ide.h>
268 269
270#ifndef MAX_HWIFS
271#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
272#endif
273
269/* needed on alpha, x86/x86_64, ia64, mips, ppc32 and sh */ 274/* needed on alpha, x86/x86_64, ia64, mips, ppc32 and sh */
270#ifndef IDE_ARCH_OBSOLETE_DEFAULTS 275#ifndef IDE_ARCH_OBSOLETE_DEFAULTS
271# define ide_default_io_base(index) (0) 276# define ide_default_io_base(index) (0)
@@ -1084,9 +1089,11 @@ enum {
1084 1089
1085/* 1090/*
1086 * Subdrivers support. 1091 * Subdrivers support.
1092 *
1093 * The gendriver.owner field should be set to the module owner of this driver.
1094 * The gendriver.name field should be set to the name of this driver
1087 */ 1095 */
1088typedef struct ide_driver_s { 1096typedef struct ide_driver_s {
1089 struct module *owner;
1090 const char *version; 1097 const char *version;
1091 u8 media; 1098 u8 media;
1092 unsigned supports_dsc_overlap : 1; 1099 unsigned supports_dsc_overlap : 1;
@@ -1194,37 +1201,11 @@ extern u64 ide_get_error_location(ide_drive_t *, char *);
1194 */ 1201 */
1195typedef enum { 1202typedef enum {
1196 ide_wait, /* insert rq at end of list, and wait for it */ 1203 ide_wait, /* insert rq at end of list, and wait for it */
1197 ide_next, /* insert rq immediately after current request */
1198 ide_preempt, /* insert rq in front of current request */ 1204 ide_preempt, /* insert rq in front of current request */
1199 ide_head_wait, /* insert rq in front of current request and wait for it */ 1205 ide_head_wait, /* insert rq in front of current request and wait for it */
1200 ide_end /* insert rq at end of list, but don't wait for it */ 1206 ide_end /* insert rq at end of list, but don't wait for it */
1201} ide_action_t; 1207} ide_action_t;
1202 1208
1203/*
1204 * This function issues a special IDE device request
1205 * onto the request queue.
1206 *
1207 * If action is ide_wait, then the rq is queued at the end of the
1208 * request queue, and the function sleeps until it has been processed.
1209 * This is for use when invoked from an ioctl handler.
1210 *
1211 * If action is ide_preempt, then the rq is queued at the head of
1212 * the request queue, displacing the currently-being-processed
1213 * request and this function returns immediately without waiting
1214 * for the new rq to be completed. This is VERY DANGEROUS, and is
1215 * intended for careful use by the ATAPI tape/cdrom driver code.
1216 *
1217 * If action is ide_next, then the rq is queued immediately after
1218 * the currently-being-processed-request (if any), and the function
1219 * returns without waiting for the new rq to be completed. As above,
1220 * This is VERY DANGEROUS, and is intended for careful use by the
1221 * ATAPI tape/cdrom driver code.
1222 *
1223 * If action is ide_end, then the rq is queued at the end of the
1224 * request queue, and the function returns immediately without waiting
1225 * for the new rq to be completed. This is again intended for careful
1226 * use by the ATAPI tape/cdrom driver code.
1227 */
1228extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t); 1209extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t);
1229 1210
1230/* 1211/*
@@ -1324,7 +1305,8 @@ void ide_init_disk(struct gendisk *, ide_drive_t *);
1324extern int ideprobe_init(void); 1305extern int ideprobe_init(void);
1325 1306
1326extern void ide_scan_pcibus(int scan_direction) __init; 1307extern void ide_scan_pcibus(int scan_direction) __init;
1327extern int ide_pci_register_driver(struct pci_driver *driver); 1308extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner);
1309#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE)
1328extern void ide_pci_unregister_driver(struct pci_driver *driver); 1310extern void ide_pci_unregister_driver(struct pci_driver *driver);
1329void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); 1311void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *);
1330extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); 1312extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d);
diff --git a/include/linux/idr.h b/include/linux/idr.h
index ca3b7e462576..d37c8d808b0f 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -8,6 +8,10 @@
8 * Small id to pointer translation service avoiding fixed sized 8 * Small id to pointer translation service avoiding fixed sized
9 * tables. 9 * tables.
10 */ 10 */
11
12#ifndef __IDR_H__
13#define __IDR_H__
14
11#include <linux/types.h> 15#include <linux/types.h>
12#include <linux/bitops.h> 16#include <linux/bitops.h>
13 17
@@ -71,8 +75,11 @@ struct idr {
71 */ 75 */
72 76
73void *idr_find(struct idr *idp, int id); 77void *idr_find(struct idr *idp, int id);
74int idr_pre_get(struct idr *idp, unsigned gfp_mask); 78int idr_pre_get(struct idr *idp, gfp_t gfp_mask);
75int idr_get_new(struct idr *idp, void *ptr, int *id); 79int idr_get_new(struct idr *idp, void *ptr, int *id);
76int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); 80int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
77void idr_remove(struct idr *idp, int id); 81void idr_remove(struct idr *idp, int id);
82void idr_destroy(struct idr *idp);
78void idr_init(struct idr *idp); 83void idr_init(struct idr *idp);
84
85#endif /* __IDR_H__ */
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
index 0856548a2a08..a8b1a2071838 100644
--- a/include/linux/if_arp.h
+++ b/include/linux/if_arp.h
@@ -84,6 +84,7 @@
84#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */ 84#define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR */
85#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ 85#define ARPHRD_IEEE80211 801 /* IEEE 802.11 */
86#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ 86#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */
87#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */
87 88
88#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ 89#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
89#define ARPHRD_NONE 0xFFFE /* zero header length */ 90#define ARPHRD_NONE 0xFFFE /* zero header length */
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index fc2d4c8225aa..fe26d431de87 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -21,6 +21,8 @@
21#ifndef _LINUX_IF_ETHER_H 21#ifndef _LINUX_IF_ETHER_H
22#define _LINUX_IF_ETHER_H 22#define _LINUX_IF_ETHER_H
23 23
24#include <linux/types.h>
25
24/* 26/*
25 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble 27 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
26 * and FCS/CRC (frame check sequence). 28 * and FCS/CRC (frame check sequence).
@@ -100,7 +102,7 @@
100struct ethhdr { 102struct ethhdr {
101 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ 103 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
102 unsigned char h_source[ETH_ALEN]; /* source ether addr */ 104 unsigned char h_source[ETH_ALEN]; /* source ether addr */
103 unsigned short h_proto; /* packet type ID field */ 105 __be16 h_proto; /* packet type ID field */
104} __attribute__((packed)); 106} __attribute__((packed));
105 107
106#ifdef __KERNEL__ 108#ifdef __KERNEL__
@@ -111,7 +113,9 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
111 return (struct ethhdr *)skb->mac.raw; 113 return (struct ethhdr *)skb->mac.raw;
112} 114}
113 115
116#ifdef CONFIG_SYSCTL
114extern struct ctl_table ether_table[]; 117extern struct ctl_table ether_table[];
115#endif 118#endif
119#endif
116 120
117#endif /* _LINUX_IF_ETHER_H */ 121#endif /* _LINUX_IF_ETHER_H */
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
index 572aff7daa21..768372f07caa 100644
--- a/include/linux/if_ppp.h
+++ b/include/linux/if_ppp.h
@@ -21,7 +21,7 @@
21 */ 21 */
22 22
23/* 23/*
24 * ==FILEVERSION 20000724== 24 * ==FILEVERSION 20050812==
25 * 25 *
26 * NOTE TO MAINTAINERS: 26 * NOTE TO MAINTAINERS:
27 * If you modify this file at all, please set the above date. 27 * If you modify this file at all, please set the above date.
@@ -35,6 +35,8 @@
35#ifndef _IF_PPP_H_ 35#ifndef _IF_PPP_H_
36#define _IF_PPP_H_ 36#define _IF_PPP_H_
37 37
38#include <linux/compiler.h>
39
38/* 40/*
39 * Packet sizes 41 * Packet sizes
40 */ 42 */
@@ -70,7 +72,8 @@
70#define SC_LOG_RAWIN 0x00080000 /* log all chars received */ 72#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
71#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */ 73#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
72#define SC_SYNC 0x00200000 /* synchronous serial mode */ 74#define SC_SYNC 0x00200000 /* synchronous serial mode */
73#define SC_MASK 0x0f200fff /* bits that user can change */ 75#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
76#define SC_MASK 0x0f600fff /* bits that user can change */
74 77
75/* state bits */ 78/* state bits */
76#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */ 79#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
diff --git a/include/linux/if_wanpipe_common.h b/include/linux/if_wanpipe_common.h
index f25fec8ee2ca..6e5461d69fdd 100644
--- a/include/linux/if_wanpipe_common.h
+++ b/include/linux/if_wanpipe_common.h
@@ -17,8 +17,6 @@
17#ifndef _WANPIPE_SOCK_DRIVER_COMMON_H 17#ifndef _WANPIPE_SOCK_DRIVER_COMMON_H
18#define _WANPIPE_SOCK_DRIVER_COMMON_H 18#define _WANPIPE_SOCK_DRIVER_COMMON_H
19 19
20#include <linux/version.h>
21
22typedef struct { 20typedef struct {
23 struct net_device *slave; 21 struct net_device *slave;
24 atomic_t packet_sent; 22 atomic_t packet_sent;
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 7e1e15f934f3..fd7af86151b1 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -142,13 +142,21 @@ static __inline__ int bad_mask(u32 mask, u32 addr)
142 142
143#define endfor_ifa(in_dev) } 143#define endfor_ifa(in_dev) }
144 144
145static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev)
146{
147 struct in_device *in_dev = dev->ip_ptr;
148 if (in_dev)
149 in_dev = rcu_dereference(in_dev);
150 return in_dev;
151}
152
145static __inline__ struct in_device * 153static __inline__ struct in_device *
146in_dev_get(const struct net_device *dev) 154in_dev_get(const struct net_device *dev)
147{ 155{
148 struct in_device *in_dev; 156 struct in_device *in_dev;
149 157
150 rcu_read_lock(); 158 rcu_read_lock();
151 in_dev = dev->ip_ptr; 159 in_dev = __in_dev_get_rcu(dev);
152 if (in_dev) 160 if (in_dev)
153 atomic_inc(&in_dev->refcnt); 161 atomic_inc(&in_dev->refcnt);
154 rcu_read_unlock(); 162 rcu_read_unlock();
@@ -156,7 +164,7 @@ in_dev_get(const struct net_device *dev)
156} 164}
157 165
158static __inline__ struct in_device * 166static __inline__ struct in_device *
159__in_dev_get(const struct net_device *dev) 167__in_dev_get_rtnl(const struct net_device *dev)
160{ 168{
161 return (struct in_device*)dev->ip_ptr; 169 return (struct in_device*)dev->ip_ptr;
162} 170}
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 68ab5f2ab9cd..dcfd2ecccb5d 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -51,7 +51,6 @@
51 .page_table_lock = SPIN_LOCK_UNLOCKED, \ 51 .page_table_lock = SPIN_LOCK_UNLOCKED, \
52 .mmlist = LIST_HEAD_INIT(name.mmlist), \ 52 .mmlist = LIST_HEAD_INIT(name.mmlist), \
53 .cpu_vm_mask = CPU_MASK_ALL, \ 53 .cpu_vm_mask = CPU_MASK_ALL, \
54 .default_kioctx = INIT_KIOCTX(name.default_kioctx, name), \
55} 54}
56 55
57#define INIT_SIGNALS(sig) { \ 56#define INIT_SIGNALS(sig) { \
diff --git a/include/linux/input.h b/include/linux/input.h
index e8c296ff6257..3c5823368ddb 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -12,6 +12,7 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/device.h>
15#else 16#else
16#include <sys/time.h> 17#include <sys/time.h>
17#include <sys/ioctl.h> 18#include <sys/ioctl.h>
@@ -644,6 +645,7 @@ struct input_absinfo {
644#define BUS_ADB 0x17 645#define BUS_ADB 0x17
645#define BUS_I2C 0x18 646#define BUS_I2C 0x18
646#define BUS_HOST 0x19 647#define BUS_HOST 0x19
648#define BUS_GSC 0x1A
647 649
648/* 650/*
649 * Values describing the status of an effect 651 * Values describing the status of an effect
@@ -889,11 +891,15 @@ struct input_dev {
889 struct semaphore sem; /* serializes open and close operations */ 891 struct semaphore sem; /* serializes open and close operations */
890 unsigned int users; 892 unsigned int users;
891 893
892 struct device *dev; 894 struct class_device cdev;
895 struct device *dev; /* will be removed soon */
896
897 int dynalloc; /* temporarily */
893 898
894 struct list_head h_list; 899 struct list_head h_list;
895 struct list_head node; 900 struct list_head node;
896}; 901};
902#define to_input_dev(d) container_of(d, struct input_dev, cdev)
897 903
898/* 904/*
899 * Structure for hotplug & device<->driver matching. 905 * Structure for hotplug & device<->driver matching.
@@ -984,7 +990,24 @@ static inline void init_input_dev(struct input_dev *dev)
984 INIT_LIST_HEAD(&dev->node); 990 INIT_LIST_HEAD(&dev->node);
985} 991}
986 992
987void input_register_device(struct input_dev *); 993struct input_dev *input_allocate_device(void);
994
995static inline void input_free_device(struct input_dev *dev)
996{
997 kfree(dev);
998}
999
1000static inline struct input_dev *input_get_device(struct input_dev *dev)
1001{
1002 return to_input_dev(class_device_get(&dev->cdev));
1003}
1004
1005static inline void input_put_device(struct input_dev *dev)
1006{
1007 class_device_put(&dev->cdev);
1008}
1009
1010int input_register_device(struct input_dev *);
988void input_unregister_device(struct input_dev *); 1011void input_unregister_device(struct input_dev *);
989 1012
990void input_register_handler(struct input_handler *); 1013void input_register_handler(struct input_handler *);
@@ -1052,7 +1075,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
1052 dev->absbit[LONG(axis)] |= BIT(axis); 1075 dev->absbit[LONG(axis)] |= BIT(axis);
1053} 1076}
1054 1077
1055extern struct class *input_class; 1078extern struct class input_class;
1056 1079
1057#endif 1080#endif
1058#endif 1081#endif
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 0a90205184b0..41f150a3d2dd 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -9,6 +9,7 @@
9#include <linux/preempt.h> 9#include <linux/preempt.h>
10#include <linux/cpumask.h> 10#include <linux/cpumask.h>
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
12#include <linux/sched.h>
12#include <asm/atomic.h> 13#include <asm/atomic.h>
13#include <asm/ptrace.h> 14#include <asm/ptrace.h>
14#include <asm/system.h> 15#include <asm/system.h>
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 18d010bee635..cd6bd001ba4e 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -94,7 +94,7 @@ extern struct resource iomem_resource;
94extern int request_resource(struct resource *root, struct resource *new); 94extern int request_resource(struct resource *root, struct resource *new);
95extern struct resource * ____request_resource(struct resource *root, struct resource *new); 95extern struct resource * ____request_resource(struct resource *root, struct resource *new);
96extern int release_resource(struct resource *new); 96extern int release_resource(struct resource *new);
97extern int insert_resource(struct resource *parent, struct resource *new); 97extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new);
98extern int allocate_resource(struct resource *root, struct resource *new, 98extern int allocate_resource(struct resource *root, struct resource *new,
99 unsigned long size, 99 unsigned long size,
100 unsigned long min, unsigned long max, 100 unsigned long min, unsigned long max,
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 938d55b813a5..d6276e60b3bf 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -256,10 +256,7 @@ struct ipmi_recv_msg
256}; 256};
257 257
258/* Allocate and free the receive message. */ 258/* Allocate and free the receive message. */
259static inline void ipmi_free_recv_msg(struct ipmi_recv_msg *msg) 259void ipmi_free_recv_msg(struct ipmi_recv_msg *msg);
260{
261 msg->done(msg);
262}
263 260
264struct ipmi_user_hndl 261struct ipmi_user_hndl
265{ 262{
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index bb6f88e14061..e0b922785d98 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -372,8 +372,9 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
372#define inet_v6_ipv6only(__sk) 0 372#define inet_v6_ipv6only(__sk) 0
373#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ 373#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
374 374
375#define INET6_MATCH(__sk, __saddr, __daddr, __ports, __dif) \ 375#define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\
376 (((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ 376 (((__sk)->sk_hash == (__hash)) && \
377 ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \
377 ((__sk)->sk_family == AF_INET6) && \ 378 ((__sk)->sk_family == AF_INET6) && \
378 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ 379 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
379 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ 380 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 69681c3b1f05..c516382fbec2 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -10,6 +10,7 @@
10 */ 10 */
11 11
12#include <linux/config.h> 12#include <linux/config.h>
13#include <asm/smp.h> /* cpu_online_map */
13 14
14#if !defined(CONFIG_ARCH_S390) 15#if !defined(CONFIG_ARCH_S390)
15 16
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index 5f4ee646c119..1f996621bc9c 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -21,8 +21,6 @@
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */ 22 */
23 23
24#include <linux/version.h>
25
26/*****************************************************************************/ 24/*****************************************************************************/
27#ifndef _ISTALLION_H 25#ifndef _ISTALLION_H
28#define _ISTALLION_H 26#define _ISTALLION_H
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index de097269bd7f..dcde7adfdce5 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -16,8 +16,6 @@
16#ifndef _LINUX_JBD_H 16#ifndef _LINUX_JBD_H
17#define _LINUX_JBD_H 17#define _LINUX_JBD_H
18 18
19#if defined(CONFIG_JBD) || defined(CONFIG_JBD_MODULE) || !defined(__KERNEL__)
20
21/* Allow this file to be included directly into e2fsprogs */ 19/* Allow this file to be included directly into e2fsprogs */
22#ifndef __KERNEL__ 20#ifndef __KERNEL__
23#include "jfs_compat.h" 21#include "jfs_compat.h"
@@ -69,7 +67,7 @@ extern int journal_enable_debug;
69#define jbd_debug(f, a...) /**/ 67#define jbd_debug(f, a...) /**/
70#endif 68#endif
71 69
72extern void * __jbd_kmalloc (const char *where, size_t size, int flags, int retry); 70extern void * __jbd_kmalloc (const char *where, size_t size, gfp_t flags, int retry);
73#define jbd_kmalloc(size, flags) \ 71#define jbd_kmalloc(size, flags) \
74 __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) 72 __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry)
75#define jbd_rep_kmalloc(size, flags) \ 73#define jbd_rep_kmalloc(size, flags) \
@@ -611,6 +609,9 @@ struct transaction_s
611 * @j_revoke: The revoke table - maintains the list of revoked blocks in the 609 * @j_revoke: The revoke table - maintains the list of revoked blocks in the
612 * current transaction. 610 * current transaction.
613 * @j_revoke_table: alternate revoke tables for j_revoke 611 * @j_revoke_table: alternate revoke tables for j_revoke
612 * @j_wbuf: array of buffer_heads for journal_commit_transaction
613 * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the
614 * number that will fit in j_blocksize
614 * @j_private: An opaque pointer to fs-private information. 615 * @j_private: An opaque pointer to fs-private information.
615 */ 616 */
616 617
@@ -890,7 +891,7 @@ extern int journal_forget (handle_t *, struct buffer_head *);
890extern void journal_sync_buffer (struct buffer_head *); 891extern void journal_sync_buffer (struct buffer_head *);
891extern int journal_invalidatepage(journal_t *, 892extern int journal_invalidatepage(journal_t *,
892 struct page *, unsigned long); 893 struct page *, unsigned long);
893extern int journal_try_to_free_buffers(journal_t *, struct page *, int); 894extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t);
894extern int journal_stop(handle_t *); 895extern int journal_stop(handle_t *);
895extern int journal_flush (journal_t *); 896extern int journal_flush (journal_t *);
896extern void journal_lock_updates (journal_t *); 897extern void journal_lock_updates (journal_t *);
@@ -935,7 +936,7 @@ void journal_put_journal_head(struct journal_head *jh);
935 */ 936 */
936extern kmem_cache_t *jbd_handle_cache; 937extern kmem_cache_t *jbd_handle_cache;
937 938
938static inline handle_t *jbd_alloc_handle(unsigned int __nocast gfp_flags) 939static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags)
939{ 940{
940 return kmem_cache_alloc(jbd_handle_cache, gfp_flags); 941 return kmem_cache_alloc(jbd_handle_cache, gfp_flags);
941} 942}
@@ -1080,19 +1081,4 @@ extern int jbd_blocks_per_page(struct inode *inode);
1080 1081
1081#endif /* __KERNEL__ */ 1082#endif /* __KERNEL__ */
1082 1083
1083#endif /* CONFIG_JBD || CONFIG_JBD_MODULE || !__KERNEL__ */
1084
1085/*
1086 * Compatibility no-ops which allow the kernel to compile without CONFIG_JBD
1087 * go here.
1088 */
1089
1090#if defined(__KERNEL__) && !(defined(CONFIG_JBD) || defined(CONFIG_JBD_MODULE))
1091
1092#define J_ASSERT(expr) do {} while (0)
1093#define J_ASSERT_BH(bh, expr) do {} while (0)
1094#define buffer_jbd(bh) 0
1095#define journal_buffer_journal_lru(bh) 0
1096
1097#endif /* defined(__KERNEL__) && !defined(CONFIG_JBD) */
1098#endif /* _LINUX_JBD_H */ 1084#endif /* _LINUX_JBD_H */
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index 419fc953ac16..cf792bb3c726 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -5,10 +5,10 @@
5 * 5 *
6 * Created by David Woodhouse <dwmw2@infradead.org> 6 * Created by David Woodhouse <dwmw2@infradead.org>
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in the 8 * For licensing information, see the file 'LICENCE' in the
9 * jffs2 directory. 9 * jffs2 directory.
10 * 10 *
11 * $Id: jffs2.h,v 1.34 2004/11/16 20:36:14 dwmw2 Exp $ 11 * $Id: jffs2.h,v 1.38 2005/09/26 11:37:23 havasi Exp $
12 * 12 *
13 */ 13 */
14 14
@@ -28,6 +28,9 @@
28#define JFFS2_EMPTY_BITMASK 0xffff 28#define JFFS2_EMPTY_BITMASK 0xffff
29#define JFFS2_DIRTY_BITMASK 0x0000 29#define JFFS2_DIRTY_BITMASK 0x0000
30 30
31/* Summary node MAGIC marker */
32#define JFFS2_SUM_MAGIC 0x02851885
33
31/* We only allow a single char for length, and 0xFF is empty flash so 34/* We only allow a single char for length, and 0xFF is empty flash so
32 we don't want it confused with a real length. Hence max 254. 35 we don't want it confused with a real length. Hence max 254.
33*/ 36*/
@@ -43,8 +46,6 @@
43#define JFFS2_COMPR_COPY 0x04 46#define JFFS2_COMPR_COPY 0x04
44#define JFFS2_COMPR_DYNRUBIN 0x05 47#define JFFS2_COMPR_DYNRUBIN 0x05
45#define JFFS2_COMPR_ZLIB 0x06 48#define JFFS2_COMPR_ZLIB 0x06
46#define JFFS2_COMPR_LZO 0x07
47#define JFFS2_COMPR_LZARI 0x08
48/* Compatibility flags. */ 49/* Compatibility flags. */
49#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ 50#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
50#define JFFS2_NODE_ACCURATE 0x2000 51#define JFFS2_NODE_ACCURATE 0x2000
@@ -62,15 +63,17 @@
62#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) 63#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
63#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) 64#define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4)
64 65
66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
67
65// Maybe later... 68// Maybe later...
66//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) 69//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
67//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) 70//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
68 71
69 72
70#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at 73#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
71 mount time, don't wait for it to 74 mount time, don't wait for it to
72 happen later */ 75 happen later */
73#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific 76#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific
74 compression type */ 77 compression type */
75 78
76 79
@@ -101,7 +104,7 @@ struct jffs2_unknown_node
101struct jffs2_raw_dirent 104struct jffs2_raw_dirent
102{ 105{
103 jint16_t magic; 106 jint16_t magic;
104 jint16_t nodetype; /* == JFFS_NODETYPE_DIRENT */ 107 jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */
105 jint32_t totlen; 108 jint32_t totlen;
106 jint32_t hdr_crc; 109 jint32_t hdr_crc;
107 jint32_t pino; 110 jint32_t pino;
@@ -117,7 +120,7 @@ struct jffs2_raw_dirent
117} __attribute__((packed)); 120} __attribute__((packed));
118 121
119/* The JFFS2 raw inode structure: Used for storage on physical media. */ 122/* The JFFS2 raw inode structure: Used for storage on physical media. */
120/* The uid, gid, atime, mtime and ctime members could be longer, but 123/* The uid, gid, atime, mtime and ctime members could be longer, but
121 are left like this for space efficiency. If and when people decide 124 are left like this for space efficiency. If and when people decide
122 they really need them extended, it's simple enough to add support for 125 they really need them extended, it's simple enough to add support for
123 a new type of raw node. 126 a new type of raw node.
@@ -125,7 +128,7 @@ struct jffs2_raw_dirent
125struct jffs2_raw_inode 128struct jffs2_raw_inode
126{ 129{
127 jint16_t magic; /* A constant magic number. */ 130 jint16_t magic; /* A constant magic number. */
128 jint16_t nodetype; /* == JFFS_NODETYPE_INODE */ 131 jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */
129 jint32_t totlen; /* Total length of this node (inc data, etc.) */ 132 jint32_t totlen; /* Total length of this node (inc data, etc.) */
130 jint32_t hdr_crc; 133 jint32_t hdr_crc;
131 jint32_t ino; /* Inode number. */ 134 jint32_t ino; /* Inode number. */
@@ -148,9 +151,25 @@ struct jffs2_raw_inode
148 uint8_t data[0]; 151 uint8_t data[0];
149} __attribute__((packed)); 152} __attribute__((packed));
150 153
151union jffs2_node_union { 154struct jffs2_raw_summary
155{
156 jint16_t magic;
157 jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */
158 jint32_t totlen;
159 jint32_t hdr_crc;
160 jint32_t sum_num; /* number of sum entries*/
161 jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */
162 jint32_t padded; /* sum of the size of padding nodes */
163 jint32_t sum_crc; /* summary information crc */
164 jint32_t node_crc; /* node crc */
165 jint32_t sum[0]; /* inode summary info */
166} __attribute__((packed));
167
168union jffs2_node_union
169{
152 struct jffs2_raw_inode i; 170 struct jffs2_raw_inode i;
153 struct jffs2_raw_dirent d; 171 struct jffs2_raw_dirent d;
172 struct jffs2_raw_summary s;
154 struct jffs2_unknown_node u; 173 struct jffs2_unknown_node u;
155}; 174};
156 175
diff --git a/include/linux/jffs2_fs_i.h b/include/linux/jffs2_fs_i.h
index 6dbb1cce6646..ef85ab56302b 100644
--- a/include/linux/jffs2_fs_i.h
+++ b/include/linux/jffs2_fs_i.h
@@ -1,4 +1,4 @@
1/* $Id: jffs2_fs_i.h,v 1.17 2004/11/11 23:51:27 dwmw2 Exp $ */ 1/* $Id: jffs2_fs_i.h,v 1.19 2005/11/07 11:14:52 gleixner Exp $ */
2 2
3#ifndef _JFFS2_FS_I 3#ifndef _JFFS2_FS_I
4#define _JFFS2_FS_I 4#define _JFFS2_FS_I
@@ -25,13 +25,16 @@ struct jffs2_inode_info {
25 /* There may be one datanode which isn't referenced by any of the 25 /* There may be one datanode which isn't referenced by any of the
26 above fragments, if it contains a metadata update but no actual 26 above fragments, if it contains a metadata update but no actual
27 data - or if this is a directory inode */ 27 data - or if this is a directory inode */
28 /* This also holds the _only_ dnode for symlinks/device nodes, 28 /* This also holds the _only_ dnode for symlinks/device nodes,
29 etc. */ 29 etc. */
30 struct jffs2_full_dnode *metadata; 30 struct jffs2_full_dnode *metadata;
31 31
32 /* Directory entries */ 32 /* Directory entries */
33 struct jffs2_full_dirent *dents; 33 struct jffs2_full_dirent *dents;
34 34
35 /* The target path if this is the inode of a symlink */
36 unsigned char *target;
37
35 /* Some stuff we just have to keep in-core at all times, for each inode. */ 38 /* Some stuff we just have to keep in-core at all times, for each inode. */
36 struct jffs2_inode_cache *inocache; 39 struct jffs2_inode_cache *inocache;
37 40
diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h
index 1e21546622de..4bcfb5570221 100644
--- a/include/linux/jffs2_fs_sb.h
+++ b/include/linux/jffs2_fs_sb.h
@@ -1,4 +1,4 @@
1/* $Id: jffs2_fs_sb.h,v 1.52 2005/05/19 16:12:17 gleixner Exp $ */ 1/* $Id: jffs2_fs_sb.h,v 1.54 2005/09/21 13:37:34 dedekind Exp $ */
2 2
3#ifndef _JFFS2_FS_SB 3#ifndef _JFFS2_FS_SB
4#define _JFFS2_FS_SB 4#define _JFFS2_FS_SB
@@ -20,7 +20,7 @@
20struct jffs2_inodirty; 20struct jffs2_inodirty;
21 21
22/* A struct for the overall file system control. Pointers to 22/* A struct for the overall file system control. Pointers to
23 jffs2_sb_info structs are named `c' in the source code. 23 jffs2_sb_info structs are named `c' in the source code.
24 Nee jffs_control 24 Nee jffs_control
25*/ 25*/
26struct jffs2_sb_info { 26struct jffs2_sb_info {
@@ -35,7 +35,7 @@ struct jffs2_sb_info {
35 struct completion gc_thread_start; /* GC thread start completion */ 35 struct completion gc_thread_start; /* GC thread start completion */
36 struct completion gc_thread_exit; /* GC thread exit completion port */ 36 struct completion gc_thread_exit; /* GC thread exit completion port */
37 37
38 struct semaphore alloc_sem; /* Used to protect all the following 38 struct semaphore alloc_sem; /* Used to protect all the following
39 fields, and also to protect against 39 fields, and also to protect against
40 out-of-order writing of nodes. And GC. */ 40 out-of-order writing of nodes. And GC. */
41 uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER 41 uint32_t cleanmarker_size; /* Size of an _inline_ CLEANMARKER
@@ -64,7 +64,7 @@ struct jffs2_sb_info {
64 uint32_t nospc_dirty_size; 64 uint32_t nospc_dirty_size;
65 65
66 uint32_t nr_blocks; 66 uint32_t nr_blocks;
67 struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks 67 struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks
68 * from the offset (blocks[ofs / sector_size]) */ 68 * from the offset (blocks[ofs / sector_size]) */
69 struct jffs2_eraseblock *nextblock; /* The block we're currently filling */ 69 struct jffs2_eraseblock *nextblock; /* The block we're currently filling */
70 70
@@ -82,25 +82,26 @@ struct jffs2_sb_info {
82 struct list_head bad_list; /* Bad blocks. */ 82 struct list_head bad_list; /* Bad blocks. */
83 struct list_head bad_used_list; /* Bad blocks with valid data in. */ 83 struct list_head bad_used_list; /* Bad blocks with valid data in. */
84 84
85 spinlock_t erase_completion_lock; /* Protect free_list and erasing_list 85 spinlock_t erase_completion_lock; /* Protect free_list and erasing_list
86 against erase completion handler */ 86 against erase completion handler */
87 wait_queue_head_t erase_wait; /* For waiting for erases to complete */ 87 wait_queue_head_t erase_wait; /* For waiting for erases to complete */
88 88
89 wait_queue_head_t inocache_wq; 89 wait_queue_head_t inocache_wq;
90 struct jffs2_inode_cache **inocache_list; 90 struct jffs2_inode_cache **inocache_list;
91 spinlock_t inocache_lock; 91 spinlock_t inocache_lock;
92 92
93 /* Sem to allow jffs2_garbage_collect_deletion_dirent to 93 /* Sem to allow jffs2_garbage_collect_deletion_dirent to
94 drop the erase_completion_lock while it's holding a pointer 94 drop the erase_completion_lock while it's holding a pointer
95 to an obsoleted node. I don't like this. Alternatives welcomed. */ 95 to an obsoleted node. I don't like this. Alternatives welcomed. */
96 struct semaphore erase_free_sem; 96 struct semaphore erase_free_sem;
97 97
98 uint32_t wbuf_pagesize; /* 0 for NOR and other flashes with no wbuf */
99
98#ifdef CONFIG_JFFS2_FS_WRITEBUFFER 100#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
99 /* Write-behind buffer for NAND flash */ 101 /* Write-behind buffer for NAND flash */
100 unsigned char *wbuf; 102 unsigned char *wbuf;
101 uint32_t wbuf_ofs; 103 uint32_t wbuf_ofs;
102 uint32_t wbuf_len; 104 uint32_t wbuf_len;
103 uint32_t wbuf_pagesize;
104 struct jffs2_inodirty *wbuf_inodes; 105 struct jffs2_inodirty *wbuf_inodes;
105 106
106 struct rw_semaphore wbuf_sem; /* Protects the write buffer */ 107 struct rw_semaphore wbuf_sem; /* Protects the write buffer */
@@ -112,6 +113,8 @@ struct jffs2_sb_info {
112 uint32_t fsdata_len; 113 uint32_t fsdata_len;
113#endif 114#endif
114 115
116 struct jffs2_summary *summary; /* Summary information */
117
115 /* OS-private pointer for getting back to master superblock info */ 118 /* OS-private pointer for getting back to master superblock info */
116 void *os_priv; 119 void *os_priv;
117}; 120};
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4367ce4db52a..b1e407a4fbda 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -168,7 +168,7 @@ static inline void console_verbose(void)
168 168
169extern void bust_spinlocks(int yes); 169extern void bust_spinlocks(int yes);
170extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ 170extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
171extern int panic_timeout; 171extern __deprecated_for_modules int panic_timeout;
172extern int panic_on_oops; 172extern int panic_on_oops;
173extern int tainted; 173extern int tainted;
174extern const char *print_tainted(void); 174extern const char *print_tainted(void);
@@ -266,7 +266,6 @@ extern void dump_stack(void);
266 266
267/** 267/**
268 * container_of - cast a member of a structure out to the containing structure 268 * container_of - cast a member of a structure out to the containing structure
269 *
270 * @ptr: the pointer to the member. 269 * @ptr: the pointer to the member.
271 * @type: the type of the container struct this is embedded in. 270 * @type: the type of the container struct this is embedded in.
272 * @member: the name of the member within the struct. 271 * @member: the name of the member within the struct.
@@ -307,7 +306,7 @@ struct sysinfo {
307 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */ 306 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
308}; 307};
309 308
310/* Force a compilation error if condition is false */ 309/* Force a compilation error if condition is true */
311#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) 310#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
312 311
313#ifdef CONFIG_SYSCTL 312#ifdef CONFIG_SYSCTL
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index dba27749b428..a484572c302e 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -6,6 +6,7 @@
6#include <linux/smp.h> 6#include <linux/smp.h>
7#include <linux/threads.h> 7#include <linux/threads.h>
8#include <linux/percpu.h> 8#include <linux/percpu.h>
9#include <linux/cpumask.h>
9#include <asm/cputime.h> 10#include <asm/cputime.h>
10 11
11/* 12/*
@@ -43,11 +44,10 @@ extern unsigned long long nr_context_switches(void);
43 */ 44 */
44static inline int kstat_irqs(int irq) 45static inline int kstat_irqs(int irq)
45{ 46{
46 int i, sum=0; 47 int cpu, sum = 0;
47 48
48 for (i = 0; i < NR_CPUS; i++) 49 for_each_cpu(cpu)
49 if (cpu_possible(i)) 50 sum += kstat_cpu(cpu).irqs[irq];
50 sum += kstat_cpu(i).irqs[irq];
51 51
52 return sum; 52 return sum;
53} 53}
diff --git a/include/linux/key-ui.h b/include/linux/key-ui.h
index cc326174a808..e8b8a7a5c496 100644
--- a/include/linux/key-ui.h
+++ b/include/linux/key-ui.h
@@ -24,7 +24,8 @@ extern spinlock_t key_serial_lock;
24#define KEY_WRITE 0x04 /* require permission to update / modify */ 24#define KEY_WRITE 0x04 /* require permission to update / modify */
25#define KEY_SEARCH 0x08 /* require permission to search (keyring) or find (key) */ 25#define KEY_SEARCH 0x08 /* require permission to search (keyring) or find (key) */
26#define KEY_LINK 0x10 /* require permission to link */ 26#define KEY_LINK 0x10 /* require permission to link */
27#define KEY_ALL 0x1f /* all the above permissions */ 27#define KEY_SETATTR 0x20 /* require permission to change attributes */
28#define KEY_ALL 0x3f /* all the above permissions */
28 29
29/* 30/*
30 * the keyring payload contains a list of the keys to which the keyring is 31 * the keyring payload contains a list of the keys to which the keyring is
@@ -38,92 +39,21 @@ struct keyring_list {
38 struct key *keys[0]; 39 struct key *keys[0];
39}; 40};
40 41
41
42/* 42/*
43 * check to see whether permission is granted to use a key in the desired way 43 * check to see whether permission is granted to use a key in the desired way
44 */ 44 */
45static inline int key_permission(const struct key *key, key_perm_t perm) 45extern int key_task_permission(const key_ref_t key_ref,
46{ 46 struct task_struct *context,
47 key_perm_t kperm; 47 key_perm_t perm);
48
49 if (key->uid == current->fsuid)
50 kperm = key->perm >> 16;
51 else if (key->gid != -1 &&
52 key->perm & KEY_GRP_ALL &&
53 in_group_p(key->gid)
54 )
55 kperm = key->perm >> 8;
56 else
57 kperm = key->perm;
58
59 kperm = kperm & perm & KEY_ALL;
60
61 return kperm == perm;
62}
63
64/*
65 * check to see whether permission is granted to use a key in at least one of
66 * the desired ways
67 */
68static inline int key_any_permission(const struct key *key, key_perm_t perm)
69{
70 key_perm_t kperm;
71
72 if (key->uid == current->fsuid)
73 kperm = key->perm >> 16;
74 else if (key->gid != -1 &&
75 key->perm & KEY_GRP_ALL &&
76 in_group_p(key->gid)
77 )
78 kperm = key->perm >> 8;
79 else
80 kperm = key->perm;
81 48
82 kperm = kperm & perm & KEY_ALL; 49static inline int key_permission(const key_ref_t key_ref, key_perm_t perm)
83
84 return kperm != 0;
85}
86
87static inline int key_task_groups_search(struct task_struct *tsk, gid_t gid)
88{ 50{
89 int ret; 51 return key_task_permission(key_ref, current, perm);
90
91 task_lock(tsk);
92 ret = groups_search(tsk->group_info, gid);
93 task_unlock(tsk);
94 return ret;
95}
96
97static inline int key_task_permission(const struct key *key,
98 struct task_struct *context,
99 key_perm_t perm)
100{
101 key_perm_t kperm;
102
103 if (key->uid == context->fsuid) {
104 kperm = key->perm >> 16;
105 }
106 else if (key->gid != -1 &&
107 key->perm & KEY_GRP_ALL && (
108 key->gid == context->fsgid ||
109 key_task_groups_search(context, key->gid)
110 )
111 ) {
112 kperm = key->perm >> 8;
113 }
114 else {
115 kperm = key->perm;
116 }
117
118 kperm = kperm & perm & KEY_ALL;
119
120 return kperm == perm;
121
122} 52}
123 53
124extern struct key *lookup_user_key(struct task_struct *context, 54extern key_ref_t lookup_user_key(struct task_struct *context,
125 key_serial_t id, int create, int partial, 55 key_serial_t id, int create, int partial,
126 key_perm_t perm); 56 key_perm_t perm);
127 57
128extern long join_session_keyring(const char *name); 58extern long join_session_keyring(const char *name);
129 59
diff --git a/include/linux/key.h b/include/linux/key.h
index 970bbd916cf4..53513a3be53b 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -35,26 +35,37 @@ struct key;
35 35
36#undef KEY_DEBUGGING 36#undef KEY_DEBUGGING
37 37
38#define KEY_USR_VIEW 0x00010000 /* user can view a key's attributes */ 38#define KEY_POS_VIEW 0x01000000 /* possessor can view a key's attributes */
39#define KEY_USR_READ 0x00020000 /* user can read key payload / view keyring */ 39#define KEY_POS_READ 0x02000000 /* possessor can read key payload / view keyring */
40#define KEY_USR_WRITE 0x00040000 /* user can update key payload / add link to keyring */ 40#define KEY_POS_WRITE 0x04000000 /* possessor can update key payload / add link to keyring */
41#define KEY_USR_SEARCH 0x00080000 /* user can find a key in search / search a keyring */ 41#define KEY_POS_SEARCH 0x08000000 /* possessor can find a key in search / search a keyring */
42#define KEY_USR_LINK 0x00100000 /* user can create a link to a key/keyring */ 42#define KEY_POS_LINK 0x10000000 /* possessor can create a link to a key/keyring */
43#define KEY_USR_ALL 0x001f0000 43#define KEY_POS_SETATTR 0x20000000 /* possessor can set key attributes */
44#define KEY_POS_ALL 0x3f000000
45
46#define KEY_USR_VIEW 0x00010000 /* user permissions... */
47#define KEY_USR_READ 0x00020000
48#define KEY_USR_WRITE 0x00040000
49#define KEY_USR_SEARCH 0x00080000
50#define KEY_USR_LINK 0x00100000
51#define KEY_USR_SETATTR 0x00200000
52#define KEY_USR_ALL 0x003f0000
44 53
45#define KEY_GRP_VIEW 0x00000100 /* group permissions... */ 54#define KEY_GRP_VIEW 0x00000100 /* group permissions... */
46#define KEY_GRP_READ 0x00000200 55#define KEY_GRP_READ 0x00000200
47#define KEY_GRP_WRITE 0x00000400 56#define KEY_GRP_WRITE 0x00000400
48#define KEY_GRP_SEARCH 0x00000800 57#define KEY_GRP_SEARCH 0x00000800
49#define KEY_GRP_LINK 0x00001000 58#define KEY_GRP_LINK 0x00001000
50#define KEY_GRP_ALL 0x00001f00 59#define KEY_GRP_SETATTR 0x00002000
60#define KEY_GRP_ALL 0x00003f00
51 61
52#define KEY_OTH_VIEW 0x00000001 /* third party permissions... */ 62#define KEY_OTH_VIEW 0x00000001 /* third party permissions... */
53#define KEY_OTH_READ 0x00000002 63#define KEY_OTH_READ 0x00000002
54#define KEY_OTH_WRITE 0x00000004 64#define KEY_OTH_WRITE 0x00000004
55#define KEY_OTH_SEARCH 0x00000008 65#define KEY_OTH_SEARCH 0x00000008
56#define KEY_OTH_LINK 0x00000010 66#define KEY_OTH_LINK 0x00000010
57#define KEY_OTH_ALL 0x0000001f 67#define KEY_OTH_SETATTR 0x00000020
68#define KEY_OTH_ALL 0x0000003f
58 69
59struct seq_file; 70struct seq_file;
60struct user_struct; 71struct user_struct;
@@ -67,6 +78,38 @@ struct keyring_name;
67 78
68/*****************************************************************************/ 79/*****************************************************************************/
69/* 80/*
81 * key reference with possession attribute handling
82 *
83 * NOTE! key_ref_t is a typedef'd pointer to a type that is not actually
84 * defined. This is because we abuse the bottom bit of the reference to carry a
85 * flag to indicate whether the calling process possesses that key in one of
86 * its keyrings.
87 *
88 * the key_ref_t has been made a separate type so that the compiler can reject
89 * attempts to dereference it without proper conversion.
90 *
91 * the three functions are used to assemble and disassemble references
92 */
93typedef struct __key_reference_with_attributes *key_ref_t;
94
95static inline key_ref_t make_key_ref(const struct key *key,
96 unsigned long possession)
97{
98 return (key_ref_t) ((unsigned long) key | possession);
99}
100
101static inline struct key *key_ref_to_ptr(const key_ref_t key_ref)
102{
103 return (struct key *) ((unsigned long) key_ref & ~1UL);
104}
105
106static inline unsigned long is_key_possessed(const key_ref_t key_ref)
107{
108 return (unsigned long) key_ref & 1UL;
109}
110
111/*****************************************************************************/
112/*
70 * authentication token / access credential / keyring 113 * authentication token / access credential / keyring
71 * - types of key include: 114 * - types of key include:
72 * - keyrings 115 * - keyrings
@@ -80,6 +123,7 @@ struct key {
80 struct key_type *type; /* type of key */ 123 struct key_type *type; /* type of key */
81 struct rw_semaphore sem; /* change vs change sem */ 124 struct rw_semaphore sem; /* change vs change sem */
82 struct key_user *user; /* owner of this key */ 125 struct key_user *user; /* owner of this key */
126 void *security; /* security data for this key */
83 time_t expiry; /* time at which key expires (or 0) */ 127 time_t expiry; /* time at which key expires (or 0) */
84 uid_t uid; 128 uid_t uid;
85 gid_t gid; 129 gid_t gid;
@@ -215,20 +259,25 @@ static inline struct key *key_get(struct key *key)
215 return key; 259 return key;
216} 260}
217 261
262static inline void key_ref_put(key_ref_t key_ref)
263{
264 key_put(key_ref_to_ptr(key_ref));
265}
266
218extern struct key *request_key(struct key_type *type, 267extern struct key *request_key(struct key_type *type,
219 const char *description, 268 const char *description,
220 const char *callout_info); 269 const char *callout_info);
221 270
222extern int key_validate(struct key *key); 271extern int key_validate(struct key *key);
223 272
224extern struct key *key_create_or_update(struct key *keyring, 273extern key_ref_t key_create_or_update(key_ref_t keyring,
225 const char *type, 274 const char *type,
226 const char *description, 275 const char *description,
227 const void *payload, 276 const void *payload,
228 size_t plen, 277 size_t plen,
229 int not_in_quota); 278 int not_in_quota);
230 279
231extern int key_update(struct key *key, 280extern int key_update(key_ref_t key,
232 const void *payload, 281 const void *payload,
233 size_t plen); 282 size_t plen);
234 283
@@ -243,9 +292,9 @@ extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
243 292
244extern int keyring_clear(struct key *keyring); 293extern int keyring_clear(struct key *keyring);
245 294
246extern struct key *keyring_search(struct key *keyring, 295extern key_ref_t keyring_search(key_ref_t keyring,
247 struct key_type *type, 296 struct key_type *type,
248 const char *description); 297 const char *description);
249 298
250extern int keyring_add_key(struct key *keyring, 299extern int keyring_add_key(struct key *keyring,
251 struct key *key); 300 struct key *key);
@@ -285,6 +334,10 @@ extern void key_init(void);
285#define key_serial(k) 0 334#define key_serial(k) 0
286#define key_get(k) ({ NULL; }) 335#define key_get(k) ({ NULL; })
287#define key_put(k) do { } while(0) 336#define key_put(k) do { } while(0)
337#define key_ref_put(k) do { } while(0)
338#define make_key_ref(k) ({ NULL; })
339#define key_ref_to_ptr(k) ({ NULL; })
340#define is_key_possessed(k) 0
288#define alloc_uid_keyring(u) 0 341#define alloc_uid_keyring(u) 0
289#define switch_uid_keyring(u) do { } while(0) 342#define switch_uid_keyring(u) do { } while(0)
290#define __install_session_keyring(t, k) ({ NULL; }) 343#define __install_session_keyring(t, k) ({ NULL; })
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index c27cd428d269..48eccd865bd8 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -35,8 +35,8 @@ struct kfifo {
35}; 35};
36 36
37extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, 37extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size,
38 unsigned int __nocast gfp_mask, spinlock_t *lock); 38 gfp_t gfp_mask, spinlock_t *lock);
39extern struct kfifo *kfifo_alloc(unsigned int size, unsigned int __nocast gfp_mask, 39extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask,
40 spinlock_t *lock); 40 spinlock_t *lock);
41extern void kfifo_free(struct kfifo *fifo); 41extern void kfifo_free(struct kfifo *fifo);
42extern unsigned int __kfifo_put(struct kfifo *fifo, 42extern unsigned int __kfifo_put(struct kfifo *fifo,
diff --git a/include/linux/kobj_map.h b/include/linux/kobj_map.h
index b6cc10bf8dfc..cbe7d8008042 100644
--- a/include/linux/kobj_map.h
+++ b/include/linux/kobj_map.h
@@ -1,5 +1,7 @@
1#ifdef __KERNEL__ 1#ifdef __KERNEL__
2 2
3#include <asm/semaphore.h>
4
3typedef struct kobject *kobj_probe_t(dev_t, int *, void *); 5typedef struct kobject *kobj_probe_t(dev_t, int *, void *);
4struct kobj_map; 6struct kobj_map;
5 7
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 3b22304f12fd..7f7403aa4a41 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -65,7 +65,7 @@ extern void kobject_unregister(struct kobject *);
65extern struct kobject * kobject_get(struct kobject *); 65extern struct kobject * kobject_get(struct kobject *);
66extern void kobject_put(struct kobject *); 66extern void kobject_put(struct kobject *);
67 67
68extern char * kobject_get_path(struct kobject *, int); 68extern char * kobject_get_path(struct kobject *, gfp_t);
69 69
70struct kobj_type { 70struct kobj_type {
71 void (*release)(struct kobject *); 71 void (*release)(struct kobject *);
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index e30afdca7917..e373c4a9de53 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -33,6 +33,9 @@
33#include <linux/list.h> 33#include <linux/list.h>
34#include <linux/notifier.h> 34#include <linux/notifier.h>
35#include <linux/smp.h> 35#include <linux/smp.h>
36#include <linux/percpu.h>
37#include <linux/spinlock.h>
38#include <linux/rcupdate.h>
36 39
37#include <asm/kprobes.h> 40#include <asm/kprobes.h>
38 41
@@ -106,6 +109,9 @@ struct jprobe {
106 kprobe_opcode_t *entry; /* probe handling code to jump to */ 109 kprobe_opcode_t *entry; /* probe handling code to jump to */
107}; 110};
108 111
112DECLARE_PER_CPU(struct kprobe *, current_kprobe);
113DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
114
109#ifdef ARCH_SUPPORTS_KRETPROBES 115#ifdef ARCH_SUPPORTS_KRETPROBES
110extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs); 116extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs);
111#else /* ARCH_SUPPORTS_KRETPROBES */ 117#else /* ARCH_SUPPORTS_KRETPROBES */
@@ -142,17 +148,7 @@ struct kretprobe_instance {
142}; 148};
143 149
144#ifdef CONFIG_KPROBES 150#ifdef CONFIG_KPROBES
145/* Locks kprobe: irq must be disabled */ 151extern spinlock_t kretprobe_lock;
146void lock_kprobes(void);
147void unlock_kprobes(void);
148
149/* kprobe running now on this CPU? */
150static inline int kprobe_running(void)
151{
152 extern unsigned int kprobe_cpu;
153 return kprobe_cpu == smp_processor_id();
154}
155
156extern int arch_prepare_kprobe(struct kprobe *p); 152extern int arch_prepare_kprobe(struct kprobe *p);
157extern void arch_copy_kprobe(struct kprobe *p); 153extern void arch_copy_kprobe(struct kprobe *p);
158extern void arch_arm_kprobe(struct kprobe *p); 154extern void arch_arm_kprobe(struct kprobe *p);
@@ -163,10 +159,26 @@ extern void show_registers(struct pt_regs *regs);
163extern kprobe_opcode_t *get_insn_slot(void); 159extern kprobe_opcode_t *get_insn_slot(void);
164extern void free_insn_slot(kprobe_opcode_t *slot); 160extern void free_insn_slot(kprobe_opcode_t *slot);
165 161
166/* Get the kprobe at this addr (if any). Must have called lock_kprobes */ 162/* Get the kprobe at this addr (if any) - called with preemption disabled */
167struct kprobe *get_kprobe(void *addr); 163struct kprobe *get_kprobe(void *addr);
168struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk); 164struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk);
169 165
166/* kprobe_running() will just return the current_kprobe on this CPU */
167static inline struct kprobe *kprobe_running(void)
168{
169 return (__get_cpu_var(current_kprobe));
170}
171
172static inline void reset_current_kprobe(void)
173{
174 __get_cpu_var(current_kprobe) = NULL;
175}
176
177static inline struct kprobe_ctlblk *get_kprobe_ctlblk(void)
178{
179 return (&__get_cpu_var(kprobe_ctlblk));
180}
181
170int register_kprobe(struct kprobe *p); 182int register_kprobe(struct kprobe *p);
171void unregister_kprobe(struct kprobe *p); 183void unregister_kprobe(struct kprobe *p);
172int setjmp_pre_handler(struct kprobe *, struct pt_regs *); 184int setjmp_pre_handler(struct kprobe *, struct pt_regs *);
@@ -183,9 +195,9 @@ void add_rp_inst(struct kretprobe_instance *ri);
183void kprobe_flush_task(struct task_struct *tk); 195void kprobe_flush_task(struct task_struct *tk);
184void recycle_rp_inst(struct kretprobe_instance *ri); 196void recycle_rp_inst(struct kretprobe_instance *ri);
185#else /* CONFIG_KPROBES */ 197#else /* CONFIG_KPROBES */
186static inline int kprobe_running(void) 198static inline struct kprobe *kprobe_running(void)
187{ 199{
188 return 0; 200 return NULL;
189} 201}
190static inline int register_kprobe(struct kprobe *p) 202static inline int register_kprobe(struct kprobe *p)
191{ 203{
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 3fa786448db3..ebdd41fd1082 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -70,6 +70,18 @@ void kthread_bind(struct task_struct *k, unsigned int cpu);
70int kthread_stop(struct task_struct *k); 70int kthread_stop(struct task_struct *k);
71 71
72/** 72/**
73 * kthread_stop_sem: stop a thread created by kthread_create().
74 * @k: thread created by kthread_create().
75 * @s: semaphore that @k waits on while idle.
76 *
77 * Does essentially the same thing as kthread_stop() above, but wakes
78 * @k by calling up(@s).
79 *
80 * Returns the result of threadfn(), or -EINTR if wake_up_process()
81 * was never called. */
82int kthread_stop_sem(struct task_struct *k, struct semaphore *s);
83
84/**
73 * kthread_should_stop: should this kthread return now? 85 * kthread_should_stop: should this kthread return now?
74 * 86 *
75 * When someone calls kthread_stop on your kthread, it will be woken 87 * When someone calls kthread_stop on your kthread, it will be woken
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 022105c745fc..f2dbb684ce9e 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -29,6 +29,7 @@
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/pci.h> 31#include <linux/pci.h>
32#include <linux/dma-mapping.h>
32#include <asm/io.h> 33#include <asm/io.h>
33#include <linux/ata.h> 34#include <linux/ata.h>
34#include <linux/workqueue.h> 35#include <linux/workqueue.h>
@@ -58,6 +59,8 @@
58#define VPRINTK(fmt, args...) 59#define VPRINTK(fmt, args...)
59#endif /* ATA_DEBUG */ 60#endif /* ATA_DEBUG */
60 61
62#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args)
63
61#ifdef ATA_NDEBUG 64#ifdef ATA_NDEBUG
62#define assert(expr) 65#define assert(expr)
63#else 66#else
@@ -91,12 +94,13 @@ enum {
91 ATA_SHT_EMULATED = 1, 94 ATA_SHT_EMULATED = 1,
92 ATA_SHT_CMD_PER_LUN = 1, 95 ATA_SHT_CMD_PER_LUN = 1,
93 ATA_SHT_THIS_ID = -1, 96 ATA_SHT_THIS_ID = -1,
94 ATA_SHT_USE_CLUSTERING = 0, 97 ATA_SHT_USE_CLUSTERING = 1,
95 98
96 /* struct ata_device stuff */ 99 /* struct ata_device stuff */
97 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ 100 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */
98 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ 101 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */
99 ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ 102 ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */
103 ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */
100 104
101 ATA_DEV_UNKNOWN = 0, /* unknown device */ 105 ATA_DEV_UNKNOWN = 0, /* unknown device */
102 ATA_DEV_ATA = 1, /* ATA device */ 106 ATA_DEV_ATA = 1, /* ATA device */
@@ -117,6 +121,7 @@ enum {
117 ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ 121 ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */
118 ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once 122 ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once
119 * proper HSM is in place. */ 123 * proper HSM is in place. */
124 ATA_FLAG_DEBUGMSG = (1 << 10),
120 125
121 ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ 126 ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */
122 ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ 127 ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */
@@ -154,17 +159,32 @@ enum {
154 ATA_SHIFT_UDMA = 0, 159 ATA_SHIFT_UDMA = 0,
155 ATA_SHIFT_MWDMA = 8, 160 ATA_SHIFT_MWDMA = 8,
156 ATA_SHIFT_PIO = 11, 161 ATA_SHIFT_PIO = 11,
162
163 /* size of buffer to pad xfers ending on unaligned boundaries */
164 ATA_DMA_PAD_SZ = 4,
165 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE,
166
167 /* Masks for port functions */
168 ATA_PORT_PRIMARY = (1 << 0),
169 ATA_PORT_SECONDARY = (1 << 1),
157}; 170};
158 171
159enum pio_task_states { 172enum hsm_task_states {
160 PIO_ST_UNKNOWN, 173 HSM_ST_UNKNOWN,
161 PIO_ST_IDLE, 174 HSM_ST_IDLE,
162 PIO_ST_POLL, 175 HSM_ST_POLL,
163 PIO_ST_TMOUT, 176 HSM_ST_TMOUT,
164 PIO_ST, 177 HSM_ST,
165 PIO_ST_LAST, 178 HSM_ST_LAST,
166 PIO_ST_LAST_POLL, 179 HSM_ST_LAST_POLL,
167 PIO_ST_ERR, 180 HSM_ST_ERR,
181};
182
183enum ata_completion_errors {
184 AC_ERR_OTHER = (1 << 0),
185 AC_ERR_DEV = (1 << 1),
186 AC_ERR_ATA_BUS = (1 << 2),
187 AC_ERR_HOST_BUS = (1 << 3),
168}; 188};
169 189
170/* forward declarations */ 190/* forward declarations */
@@ -174,7 +194,7 @@ struct ata_port;
174struct ata_queued_cmd; 194struct ata_queued_cmd;
175 195
176/* typedefs */ 196/* typedefs */
177typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, u8 drv_stat); 197typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, unsigned int err_mask);
178 198
179struct ata_ioports { 199struct ata_ioports {
180 unsigned long cmd_addr; 200 unsigned long cmd_addr;
@@ -197,8 +217,8 @@ struct ata_ioports {
197struct ata_probe_ent { 217struct ata_probe_ent {
198 struct list_head node; 218 struct list_head node;
199 struct device *dev; 219 struct device *dev;
200 struct ata_port_operations *port_ops; 220 const struct ata_port_operations *port_ops;
201 Scsi_Host_Template *sht; 221 struct scsi_host_template *sht;
202 struct ata_ioports port[ATA_MAX_PORTS]; 222 struct ata_ioports port[ATA_MAX_PORTS];
203 unsigned int n_ports; 223 unsigned int n_ports;
204 unsigned int hard_port_no; 224 unsigned int hard_port_no;
@@ -220,7 +240,7 @@ struct ata_host_set {
220 void __iomem *mmio_base; 240 void __iomem *mmio_base;
221 unsigned int n_ports; 241 unsigned int n_ports;
222 void *private_data; 242 void *private_data;
223 struct ata_port_operations *ops; 243 const struct ata_port_operations *ops;
224 struct ata_port * ports[0]; 244 struct ata_port * ports[0];
225}; 245};
226 246
@@ -237,9 +257,12 @@ struct ata_queued_cmd {
237 unsigned long flags; /* ATA_QCFLAG_xxx */ 257 unsigned long flags; /* ATA_QCFLAG_xxx */
238 unsigned int tag; 258 unsigned int tag;
239 unsigned int n_elem; 259 unsigned int n_elem;
260 unsigned int orig_n_elem;
240 261
241 int dma_dir; 262 int dma_dir;
242 263
264 unsigned int pad_len;
265
243 unsigned int nsect; 266 unsigned int nsect;
244 unsigned int cursect; 267 unsigned int cursect;
245 268
@@ -250,9 +273,11 @@ struct ata_queued_cmd {
250 unsigned int cursg_ofs; 273 unsigned int cursg_ofs;
251 274
252 struct scatterlist sgent; 275 struct scatterlist sgent;
276 struct scatterlist pad_sgent;
253 void *buf_virt; 277 void *buf_virt;
254 278
255 struct scatterlist *sg; 279 /* DO NOT iterate over __sg manually, use ata_for_each_sg() */
280 struct scatterlist *__sg;
256 281
257 ata_qc_cb_t complete_fn; 282 ata_qc_cb_t complete_fn;
258 283
@@ -278,15 +303,18 @@ struct ata_device {
278 u8 xfer_mode; 303 u8 xfer_mode;
279 unsigned int xfer_shift; /* ATA_SHIFT_xxx */ 304 unsigned int xfer_shift; /* ATA_SHIFT_xxx */
280 305
281 /* cache info about current transfer mode */ 306 unsigned int multi_count; /* sectors count for
282 u8 xfer_protocol; /* taskfile xfer protocol */ 307 READ/WRITE MULTIPLE */
283 u8 read_cmd; /* opcode to use on read */ 308
284 u8 write_cmd; /* opcode to use on write */ 309 /* for CHS addressing */
310 u16 cylinders; /* Number of cylinders */
311 u16 heads; /* Number of heads */
312 u16 sectors; /* Number of sectors per track */
285}; 313};
286 314
287struct ata_port { 315struct ata_port {
288 struct Scsi_Host *host; /* our co-allocated scsi host */ 316 struct Scsi_Host *host; /* our co-allocated scsi host */
289 struct ata_port_operations *ops; 317 const struct ata_port_operations *ops;
290 unsigned long flags; /* ATA_FLAG_xxx */ 318 unsigned long flags; /* ATA_FLAG_xxx */
291 unsigned int id; /* unique id req'd by scsi midlyr */ 319 unsigned int id; /* unique id req'd by scsi midlyr */
292 unsigned int port_no; /* unique port #; from zero */ 320 unsigned int port_no; /* unique port #; from zero */
@@ -295,6 +323,9 @@ struct ata_port {
295 struct ata_prd *prd; /* our SG list */ 323 struct ata_prd *prd; /* our SG list */
296 dma_addr_t prd_dma; /* and its DMA mapping */ 324 dma_addr_t prd_dma; /* and its DMA mapping */
297 325
326 void *pad; /* array of DMA pad buffers */
327 dma_addr_t pad_dma;
328
298 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ 329 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */
299 330
300 u8 ctl; /* cache of ATA control register */ 331 u8 ctl; /* cache of ATA control register */
@@ -319,7 +350,7 @@ struct ata_port {
319 struct work_struct packet_task; 350 struct work_struct packet_task;
320 351
321 struct work_struct pio_task; 352 struct work_struct pio_task;
322 unsigned int pio_task_state; 353 unsigned int hsm_task_state;
323 unsigned long pio_task_timeout; 354 unsigned long pio_task_timeout;
324 355
325 void *private_data; 356 void *private_data;
@@ -333,13 +364,12 @@ struct ata_port_operations {
333 void (*set_piomode) (struct ata_port *, struct ata_device *); 364 void (*set_piomode) (struct ata_port *, struct ata_device *);
334 void (*set_dmamode) (struct ata_port *, struct ata_device *); 365 void (*set_dmamode) (struct ata_port *, struct ata_device *);
335 366
336 void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); 367 void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf);
337 void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); 368 void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
338 369
339 void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); 370 void (*exec_command)(struct ata_port *ap, const struct ata_taskfile *tf);
340 u8 (*check_status)(struct ata_port *ap); 371 u8 (*check_status)(struct ata_port *ap);
341 u8 (*check_altstatus)(struct ata_port *ap); 372 u8 (*check_altstatus)(struct ata_port *ap);
342 u8 (*check_err)(struct ata_port *ap);
343 void (*dev_select)(struct ata_port *ap, unsigned int device); 373 void (*dev_select)(struct ata_port *ap, unsigned int device);
344 374
345 void (*phy_reset) (struct ata_port *ap); 375 void (*phy_reset) (struct ata_port *ap);
@@ -372,14 +402,28 @@ struct ata_port_operations {
372}; 402};
373 403
374struct ata_port_info { 404struct ata_port_info {
375 Scsi_Host_Template *sht; 405 struct scsi_host_template *sht;
376 unsigned long host_flags; 406 unsigned long host_flags;
377 unsigned long pio_mask; 407 unsigned long pio_mask;
378 unsigned long mwdma_mask; 408 unsigned long mwdma_mask;
379 unsigned long udma_mask; 409 unsigned long udma_mask;
380 struct ata_port_operations *port_ops; 410 const struct ata_port_operations *port_ops;
411 void *private_data;
381}; 412};
382 413
414struct ata_timing {
415 unsigned short mode; /* ATA mode */
416 unsigned short setup; /* t1 */
417 unsigned short act8b; /* t2 for 8-bit I/O */
418 unsigned short rec8b; /* t2i for 8-bit I/O */
419 unsigned short cyc8b; /* t0 for 8-bit I/O */
420 unsigned short active; /* t2 or tD */
421 unsigned short recover; /* t2i or tK */
422 unsigned short cycle; /* t0 */
423 unsigned short udma; /* t2CYCTYP/2 */
424};
425
426#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin)
383 427
384extern void ata_port_probe(struct ata_port *); 428extern void ata_port_probe(struct ata_port *);
385extern void __sata_phy_reset(struct ata_port *ap); 429extern void __sata_phy_reset(struct ata_port *ap);
@@ -392,26 +436,28 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i
392 unsigned int n_ports); 436 unsigned int n_ports);
393extern void ata_pci_remove_one (struct pci_dev *pdev); 437extern void ata_pci_remove_one (struct pci_dev *pdev);
394#endif /* CONFIG_PCI */ 438#endif /* CONFIG_PCI */
395extern int ata_device_add(struct ata_probe_ent *ent); 439extern int ata_device_add(const struct ata_probe_ent *ent);
396extern int ata_scsi_detect(Scsi_Host_Template *sht); 440extern void ata_host_set_remove(struct ata_host_set *host_set);
441extern int ata_scsi_detect(struct scsi_host_template *sht);
397extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 442extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
398extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 443extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
399extern int ata_scsi_error(struct Scsi_Host *host); 444extern int ata_scsi_error(struct Scsi_Host *host);
400extern int ata_scsi_release(struct Scsi_Host *host); 445extern int ata_scsi_release(struct Scsi_Host *host);
401extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 446extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
447extern int ata_ratelimit(void);
448
402/* 449/*
403 * Default driver ops implementations 450 * Default driver ops implementations
404 */ 451 */
405extern void ata_tf_load(struct ata_port *ap, struct ata_taskfile *tf); 452extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
406extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 453extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
407extern void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp); 454extern void ata_tf_to_fis(const struct ata_taskfile *tf, u8 *fis, u8 pmp);
408extern void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf); 455extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
409extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device); 456extern void ata_noop_dev_select (struct ata_port *ap, unsigned int device);
410extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); 457extern void ata_std_dev_select (struct ata_port *ap, unsigned int device);
411extern u8 ata_check_status(struct ata_port *ap); 458extern u8 ata_check_status(struct ata_port *ap);
412extern u8 ata_altstatus(struct ata_port *ap); 459extern u8 ata_altstatus(struct ata_port *ap);
413extern u8 ata_chk_err(struct ata_port *ap); 460extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
414extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf);
415extern int ata_port_start (struct ata_port *ap); 461extern int ata_port_start (struct ata_port *ap);
416extern void ata_port_stop (struct ata_port *ap); 462extern void ata_port_stop (struct ata_port *ap);
417extern void ata_host_stop (struct ata_host_set *host_set); 463extern void ata_host_stop (struct ata_host_set *host_set);
@@ -422,8 +468,8 @@ extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf,
422 unsigned int buflen); 468 unsigned int buflen);
423extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, 469extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
424 unsigned int n_elem); 470 unsigned int n_elem);
425extern unsigned int ata_dev_classify(struct ata_taskfile *tf); 471extern unsigned int ata_dev_classify(const struct ata_taskfile *tf);
426extern void ata_dev_id_string(u16 *id, unsigned char *s, 472extern void ata_dev_id_string(const u16 *id, unsigned char *s,
427 unsigned int ofs, unsigned int len); 473 unsigned int ofs, unsigned int len);
428extern void ata_dev_config(struct ata_port *ap, unsigned int i); 474extern void ata_dev_config(struct ata_port *ap, unsigned int i);
429extern void ata_bmdma_setup (struct ata_queued_cmd *qc); 475extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
@@ -431,7 +477,7 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc);
431extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 477extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
432extern u8 ata_bmdma_status(struct ata_port *ap); 478extern u8 ata_bmdma_status(struct ata_port *ap);
433extern void ata_bmdma_irq_clear(struct ata_port *ap); 479extern void ata_bmdma_irq_clear(struct ata_port *ap);
434extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat); 480extern void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask);
435extern void ata_eng_timeout(struct ata_port *ap); 481extern void ata_eng_timeout(struct ata_port *ap);
436extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd, 482extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd,
437 void (*done)(struct scsi_cmnd *)); 483 void (*done)(struct scsi_cmnd *));
@@ -440,6 +486,32 @@ extern int ata_std_bios_param(struct scsi_device *sdev,
440 sector_t capacity, int geom[]); 486 sector_t capacity, int geom[]);
441extern int ata_scsi_slave_config(struct scsi_device *sdev); 487extern int ata_scsi_slave_config(struct scsi_device *sdev);
442 488
489/*
490 * Timing helpers
491 */
492extern int ata_timing_compute(struct ata_device *, unsigned short,
493 struct ata_timing *, int, int);
494extern void ata_timing_merge(const struct ata_timing *,
495 const struct ata_timing *, struct ata_timing *,
496 unsigned int);
497
498enum {
499 ATA_TIMING_SETUP = (1 << 0),
500 ATA_TIMING_ACT8B = (1 << 1),
501 ATA_TIMING_REC8B = (1 << 2),
502 ATA_TIMING_CYC8B = (1 << 3),
503 ATA_TIMING_8BIT = ATA_TIMING_ACT8B | ATA_TIMING_REC8B |
504 ATA_TIMING_CYC8B,
505 ATA_TIMING_ACTIVE = (1 << 4),
506 ATA_TIMING_RECOVER = (1 << 5),
507 ATA_TIMING_CYCLE = (1 << 6),
508 ATA_TIMING_UDMA = (1 << 7),
509 ATA_TIMING_ALL = ATA_TIMING_SETUP | ATA_TIMING_ACT8B |
510 ATA_TIMING_REC8B | ATA_TIMING_CYC8B |
511 ATA_TIMING_ACTIVE | ATA_TIMING_RECOVER |
512 ATA_TIMING_CYCLE | ATA_TIMING_UDMA,
513};
514
443 515
444#ifdef CONFIG_PCI 516#ifdef CONFIG_PCI
445struct pci_bits { 517struct pci_bits {
@@ -451,18 +523,43 @@ struct pci_bits {
451 523
452extern void ata_pci_host_stop (struct ata_host_set *host_set); 524extern void ata_pci_host_stop (struct ata_host_set *host_set);
453extern struct ata_probe_ent * 525extern struct ata_probe_ent *
454ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); 526ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
455extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); 527extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
456 528
457#endif /* CONFIG_PCI */ 529#endif /* CONFIG_PCI */
458 530
459 531
532static inline int
533ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
534{
535 if (sg == &qc->pad_sgent)
536 return 1;
537 if (qc->pad_len)
538 return 0;
539 if (((sg - qc->__sg) + 1) == qc->n_elem)
540 return 1;
541 return 0;
542}
543
544static inline struct scatterlist *
545ata_qc_next_sg(struct scatterlist *sg, struct ata_queued_cmd *qc)
546{
547 if (sg == &qc->pad_sgent)
548 return NULL;
549 if (++sg - qc->__sg < qc->n_elem)
550 return sg;
551 return qc->pad_len ? &qc->pad_sgent : NULL;
552}
553
554#define ata_for_each_sg(sg, qc) \
555 for (sg = qc->__sg; sg; sg = ata_qc_next_sg(sg, qc))
556
460static inline unsigned int ata_tag_valid(unsigned int tag) 557static inline unsigned int ata_tag_valid(unsigned int tag)
461{ 558{
462 return (tag < ATA_MAX_QUEUE) ? 1 : 0; 559 return (tag < ATA_MAX_QUEUE) ? 1 : 0;
463} 560}
464 561
465static inline unsigned int ata_dev_present(struct ata_device *dev) 562static inline unsigned int ata_dev_present(const struct ata_device *dev)
466{ 563{
467 return ((dev->class == ATA_DEV_ATA) || 564 return ((dev->class == ATA_DEV_ATA) ||
468 (dev->class == ATA_DEV_ATAPI)); 565 (dev->class == ATA_DEV_ATAPI));
@@ -565,6 +662,17 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns
565 tf->device = ATA_DEVICE_OBS | ATA_DEV1; 662 tf->device = ATA_DEVICE_OBS | ATA_DEV1;
566} 663}
567 664
665static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
666{
667 qc->__sg = NULL;
668 qc->flags = 0;
669 qc->cursect = qc->cursg = qc->cursg_ofs = 0;
670 qc->nsect = 0;
671 qc->nbytes = qc->curbytes = 0;
672
673 ata_tf_init(qc->ap, &qc->tf, qc->dev->devno);
674}
675
568 676
569/** 677/**
570 * ata_irq_on - Enable interrupts on a port. 678 * ata_irq_on - Enable interrupts on a port.
@@ -661,11 +769,41 @@ static inline unsigned int sata_dev_present(struct ata_port *ap)
661 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; 769 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
662} 770}
663 771
664static inline int ata_try_flush_cache(struct ata_device *dev) 772static inline int ata_try_flush_cache(const struct ata_device *dev)
665{ 773{
666 return ata_id_wcache_enabled(dev->id) || 774 return ata_id_wcache_enabled(dev->id) ||
667 ata_id_has_flush(dev->id) || 775 ata_id_has_flush(dev->id) ||
668 ata_id_has_flush_ext(dev->id); 776 ata_id_has_flush_ext(dev->id);
669} 777}
670 778
779static inline unsigned int ac_err_mask(u8 status)
780{
781 if (status & ATA_BUSY)
782 return AC_ERR_ATA_BUS;
783 if (status & (ATA_ERR | ATA_DF))
784 return AC_ERR_DEV;
785 return 0;
786}
787
788static inline unsigned int __ac_err_mask(u8 status)
789{
790 unsigned int mask = ac_err_mask(status);
791 if (mask == 0)
792 return AC_ERR_OTHER;
793 return mask;
794}
795
796static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev)
797{
798 ap->pad_dma = 0;
799 ap->pad = dma_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ,
800 &ap->pad_dma, GFP_KERNEL);
801 return (ap->pad == NULL) ? -ENOMEM : 0;
802}
803
804static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
805{
806 dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
807}
808
671#endif /* __LINUX_LIBATA_H__ */ 809#endif /* __LINUX_LIBATA_H__ */
diff --git a/include/linux/list.h b/include/linux/list.h
index e6ec59682274..fbfca73355a3 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -442,12 +442,14 @@ static inline void list_splice_init(struct list_head *list,
442 * as long as the traversal is guarded by rcu_read_lock(). 442 * as long as the traversal is guarded by rcu_read_lock().
443 */ 443 */
444#define list_for_each_rcu(pos, head) \ 444#define list_for_each_rcu(pos, head) \
445 for (pos = (head)->next; prefetch(pos->next), pos != (head); \ 445 for (pos = (head)->next; \
446 pos = rcu_dereference(pos->next)) 446 prefetch(rcu_dereference(pos)->next), pos != (head); \
447 pos = pos->next)
447 448
448#define __list_for_each_rcu(pos, head) \ 449#define __list_for_each_rcu(pos, head) \
449 for (pos = (head)->next; pos != (head); \ 450 for (pos = (head)->next; \
450 pos = rcu_dereference(pos->next)) 451 rcu_dereference(pos) != (head); \
452 pos = pos->next)
451 453
452/** 454/**
453 * list_for_each_safe_rcu - iterate over an rcu-protected list safe 455 * list_for_each_safe_rcu - iterate over an rcu-protected list safe
@@ -461,8 +463,9 @@ static inline void list_splice_init(struct list_head *list,
461 * as long as the traversal is guarded by rcu_read_lock(). 463 * as long as the traversal is guarded by rcu_read_lock().
462 */ 464 */
463#define list_for_each_safe_rcu(pos, n, head) \ 465#define list_for_each_safe_rcu(pos, n, head) \
464 for (pos = (head)->next, n = pos->next; pos != (head); \ 466 for (pos = (head)->next; \
465 pos = rcu_dereference(n), n = pos->next) 467 n = rcu_dereference(pos)->next, pos != (head); \
468 pos = n)
466 469
467/** 470/**
468 * list_for_each_entry_rcu - iterate over rcu list of given type 471 * list_for_each_entry_rcu - iterate over rcu list of given type
@@ -474,11 +477,11 @@ static inline void list_splice_init(struct list_head *list,
474 * the _rcu list-mutation primitives such as list_add_rcu() 477 * the _rcu list-mutation primitives such as list_add_rcu()
475 * as long as the traversal is guarded by rcu_read_lock(). 478 * as long as the traversal is guarded by rcu_read_lock().
476 */ 479 */
477#define list_for_each_entry_rcu(pos, head, member) \ 480#define list_for_each_entry_rcu(pos, head, member) \
478 for (pos = list_entry((head)->next, typeof(*pos), member); \ 481 for (pos = list_entry((head)->next, typeof(*pos), member); \
479 prefetch(pos->member.next), &pos->member != (head); \ 482 prefetch(rcu_dereference(pos)->member.next), \
480 pos = rcu_dereference(list_entry(pos->member.next, \ 483 &pos->member != (head); \
481 typeof(*pos), member))) 484 pos = list_entry(pos->member.next, typeof(*pos), member))
482 485
483 486
484/** 487/**
@@ -492,8 +495,9 @@ static inline void list_splice_init(struct list_head *list,
492 * as long as the traversal is guarded by rcu_read_lock(). 495 * as long as the traversal is guarded by rcu_read_lock().
493 */ 496 */
494#define list_for_each_continue_rcu(pos, head) \ 497#define list_for_each_continue_rcu(pos, head) \
495 for ((pos) = (pos)->next; prefetch((pos)->next), (pos) != (head); \ 498 for ((pos) = (pos)->next; \
496 (pos) = rcu_dereference((pos)->next)) 499 prefetch(rcu_dereference((pos))->next), (pos) != (head); \
500 (pos) = (pos)->next)
497 501
498/* 502/*
499 * Double linked lists with a single pointer list head. 503 * Double linked lists with a single pointer list head.
@@ -597,7 +601,7 @@ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
597 * or hlist_del_rcu(), running on this same list. 601 * or hlist_del_rcu(), running on this same list.
598 * However, it is perfectly legal to run concurrently with 602 * However, it is perfectly legal to run concurrently with
599 * the _rcu list-traversal primitives, such as 603 * the _rcu list-traversal primitives, such as
600 * hlist_for_each_rcu(), used to prevent memory-consistency 604 * hlist_for_each_entry_rcu(), used to prevent memory-consistency
601 * problems on Alpha CPUs. Regardless of the type of CPU, the 605 * problems on Alpha CPUs. Regardless of the type of CPU, the
602 * list-traversal primitive must be guarded by rcu_read_lock(). 606 * list-traversal primitive must be guarded by rcu_read_lock().
603 */ 607 */
@@ -646,7 +650,7 @@ static inline void hlist_add_after(struct hlist_node *n,
646 * or hlist_del_rcu(), running on this same list. 650 * or hlist_del_rcu(), running on this same list.
647 * However, it is perfectly legal to run concurrently with 651 * However, it is perfectly legal to run concurrently with
648 * the _rcu list-traversal primitives, such as 652 * the _rcu list-traversal primitives, such as
649 * hlist_for_each_rcu(), used to prevent memory-consistency 653 * hlist_for_each_entry_rcu(), used to prevent memory-consistency
650 * problems on Alpha CPUs. 654 * problems on Alpha CPUs.
651 */ 655 */
652static inline void hlist_add_before_rcu(struct hlist_node *n, 656static inline void hlist_add_before_rcu(struct hlist_node *n,
@@ -671,7 +675,7 @@ static inline void hlist_add_before_rcu(struct hlist_node *n,
671 * or hlist_del_rcu(), running on this same list. 675 * or hlist_del_rcu(), running on this same list.
672 * However, it is perfectly legal to run concurrently with 676 * However, it is perfectly legal to run concurrently with
673 * the _rcu list-traversal primitives, such as 677 * the _rcu list-traversal primitives, such as
674 * hlist_for_each_rcu(), used to prevent memory-consistency 678 * hlist_for_each_entry_rcu(), used to prevent memory-consistency
675 * problems on Alpha CPUs. 679 * problems on Alpha CPUs.
676 */ 680 */
677static inline void hlist_add_after_rcu(struct hlist_node *prev, 681static inline void hlist_add_after_rcu(struct hlist_node *prev,
@@ -695,10 +699,6 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
695 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ 699 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
696 pos = n) 700 pos = n)
697 701
698#define hlist_for_each_rcu(pos, head) \
699 for ((pos) = (head)->first; pos && ({ prefetch((pos)->next); 1; }); \
700 (pos) = rcu_dereference((pos)->next))
701
702/** 702/**
703 * hlist_for_each_entry - iterate over list of given type 703 * hlist_for_each_entry - iterate over list of given type
704 * @tpos: the type * to use as a loop counter. 704 * @tpos: the type * to use as a loop counter.
@@ -751,7 +751,7 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
751 751
752/** 752/**
753 * hlist_for_each_entry_rcu - iterate over rcu list of given type 753 * hlist_for_each_entry_rcu - iterate over rcu list of given type
754 * @pos: the type * to use as a loop counter. 754 * @tpos: the type * to use as a loop counter.
755 * @pos: the &struct hlist_node to use as a loop counter. 755 * @pos: the &struct hlist_node to use as a loop counter.
756 * @head: the head for your list. 756 * @head: the head for your list.
757 * @member: the name of the hlist_node within the struct. 757 * @member: the name of the hlist_node within the struct.
@@ -762,9 +762,9 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
762 */ 762 */
763#define hlist_for_each_entry_rcu(tpos, pos, head, member) \ 763#define hlist_for_each_entry_rcu(tpos, pos, head, member) \
764 for (pos = (head)->first; \ 764 for (pos = (head)->first; \
765 pos && ({ prefetch(pos->next); 1;}) && \ 765 rcu_dereference(pos) && ({ prefetch(pos->next); 1;}) && \
766 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ 766 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
767 pos = rcu_dereference(pos->next)) 767 pos = pos->next)
768 768
769#else 769#else
770#warning "don't include kernel headers in userspace" 770#warning "don't include kernel headers in userspace"
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 53fa51595443..40f63c9879d2 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -52,7 +52,7 @@ struct loop_device {
52 unsigned lo_blocksize; 52 unsigned lo_blocksize;
53 void *key_data; 53 void *key_data;
54 54
55 int old_gfp_mask; 55 gfp_t old_gfp_mask;
56 56
57 spinlock_t lo_lock; 57 spinlock_t lo_lock;
58 struct bio *lo_bio; 58 struct bio *lo_bio;
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h
index 9263d2db2d67..99e044b4efc6 100644
--- a/include/linux/mbcache.h
+++ b/include/linux/mbcache.h
@@ -22,7 +22,7 @@ struct mb_cache_entry {
22}; 22};
23 23
24struct mb_cache_op { 24struct mb_cache_op {
25 int (*free)(struct mb_cache_entry *, int); 25 int (*free)(struct mb_cache_entry *, gfp_t);
26}; 26};
27 27
28/* Functions on caches */ 28/* Functions on caches */
diff --git a/include/linux/memory.h b/include/linux/memory.h
new file mode 100644
index 000000000000..dc4081b6f161
--- /dev/null
+++ b/include/linux/memory.h
@@ -0,0 +1,96 @@
1/*
2 * include/linux/memory.h - generic memory definition
3 *
4 * This is mainly for topological representation. We define the
5 * basic "struct memory_block" here, which can be embedded in per-arch
6 * definitions or NUMA information.
7 *
8 * Basic handling of the devices is done in drivers/base/memory.c
9 * and system devices are handled in drivers/base/sys.c.
10 *
11 * Memory block are exported via sysfs in the class/memory/devices/
12 * directory.
13 *
14 */
15#ifndef _LINUX_MEMORY_H_
16#define _LINUX_MEMORY_H_
17
18#include <linux/sysdev.h>
19#include <linux/node.h>
20#include <linux/compiler.h>
21
22#include <asm/semaphore.h>
23
24struct memory_block {
25 unsigned long phys_index;
26 unsigned long state;
27 /*
28 * This serializes all state change requests. It isn't
29 * held during creation because the control files are
30 * created long after the critical areas during
31 * initialization.
32 */
33 struct semaphore state_sem;
34 int phys_device; /* to which fru does this belong? */
35 void *hw; /* optional pointer to fw/hw data */
36 int (*phys_callback)(struct memory_block *);
37 struct sys_device sysdev;
38};
39
40/* These states are exposed to userspace as text strings in sysfs */
41#define MEM_ONLINE (1<<0) /* exposed to userspace */
42#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */
43#define MEM_OFFLINE (1<<2) /* exposed to userspace */
44
45/*
46 * All of these states are currently kernel-internal for notifying
47 * kernel components and architectures.
48 *
49 * For MEM_MAPPING_INVALID, all notifier chains with priority >0
50 * are called before pfn_to_page() becomes invalid. The priority=0
51 * entry is reserved for the function that actually makes
52 * pfn_to_page() stop working. Any notifiers that want to be called
53 * after that should have priority <0.
54 */
55#define MEM_MAPPING_INVALID (1<<3)
56
57struct notifier_block;
58struct mem_section;
59
60#ifndef CONFIG_MEMORY_HOTPLUG
61static inline int memory_dev_init(void)
62{
63 return 0;
64}
65static inline int register_memory_notifier(struct notifier_block *nb)
66{
67 return 0;
68}
69static inline void unregister_memory_notifier(struct notifier_block *nb)
70{
71}
72#else
73extern int register_memory(struct memory_block *, struct mem_section *section, struct node *);
74extern int register_new_memory(struct mem_section *);
75extern int unregister_memory_section(struct mem_section *);
76extern int memory_dev_init(void);
77extern int register_memory_notifier(struct notifier_block *nb);
78extern void unregister_memory_notifier(struct notifier_block *nb);
79
80#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
81
82extern int invalidate_phys_mapping(unsigned long, unsigned long);
83struct notifier_block;
84
85extern int register_memory_notifier(struct notifier_block *nb);
86extern void unregister_memory_notifier(struct notifier_block *nb);
87
88#endif /* CONFIG_MEMORY_HOTPLUG */
89
90#define hotplug_memory_notifier(fn, pri) { \
91 static struct notifier_block fn##_mem_nb = \
92 { .notifier_call = fn, .priority = pri }; \
93 register_memory_notifier(&fn##_mem_nb); \
94}
95
96#endif /* _LINUX_MEMORY_H_ */
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
new file mode 100644
index 000000000000..01f03bc06eff
--- /dev/null
+++ b/include/linux/memory_hotplug.h
@@ -0,0 +1,104 @@
1#ifndef __LINUX_MEMORY_HOTPLUG_H
2#define __LINUX_MEMORY_HOTPLUG_H
3
4#include <linux/mmzone.h>
5#include <linux/spinlock.h>
6#include <linux/mmzone.h>
7#include <linux/notifier.h>
8
9#ifdef CONFIG_MEMORY_HOTPLUG
10/*
11 * pgdat resizing functions
12 */
13static inline
14void pgdat_resize_lock(struct pglist_data *pgdat, unsigned long *flags)
15{
16 spin_lock_irqsave(&pgdat->node_size_lock, *flags);
17}
18static inline
19void pgdat_resize_unlock(struct pglist_data *pgdat, unsigned long *flags)
20{
21 spin_unlock_irqrestore(&pgdat->node_size_lock, *flags);
22}
23static inline
24void pgdat_resize_init(struct pglist_data *pgdat)
25{
26 spin_lock_init(&pgdat->node_size_lock);
27}
28/*
29 * Zone resizing functions
30 */
31static inline unsigned zone_span_seqbegin(struct zone *zone)
32{
33 return read_seqbegin(&zone->span_seqlock);
34}
35static inline int zone_span_seqretry(struct zone *zone, unsigned iv)
36{
37 return read_seqretry(&zone->span_seqlock, iv);
38}
39static inline void zone_span_writelock(struct zone *zone)
40{
41 write_seqlock(&zone->span_seqlock);
42}
43static inline void zone_span_writeunlock(struct zone *zone)
44{
45 write_sequnlock(&zone->span_seqlock);
46}
47static inline void zone_seqlock_init(struct zone *zone)
48{
49 seqlock_init(&zone->span_seqlock);
50}
51extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages);
52extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
53extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
54/* need some defines for these for archs that don't support it */
55extern void online_page(struct page *page);
56/* VM interface that may be used by firmware interface */
57extern int add_memory(u64 start, u64 size);
58extern int remove_memory(u64 start, u64 size);
59extern int online_pages(unsigned long, unsigned long);
60
61/* reasonably generic interface to expand the physical pages in a zone */
62extern int __add_pages(struct zone *zone, unsigned long start_pfn,
63 unsigned long nr_pages);
64#else /* ! CONFIG_MEMORY_HOTPLUG */
65/*
66 * Stub functions for when hotplug is off
67 */
68static inline void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {}
69static inline void pgdat_resize_unlock(struct pglist_data *p, unsigned long *f) {}
70static inline void pgdat_resize_init(struct pglist_data *pgdat) {}
71
72static inline unsigned zone_span_seqbegin(struct zone *zone)
73{
74 return 0;
75}
76static inline int zone_span_seqretry(struct zone *zone, unsigned iv)
77{
78 return 0;
79}
80static inline void zone_span_writelock(struct zone *zone) {}
81static inline void zone_span_writeunlock(struct zone *zone) {}
82static inline void zone_seqlock_init(struct zone *zone) {}
83
84static inline int mhp_notimplemented(const char *func)
85{
86 printk(KERN_WARNING "%s() called, with CONFIG_MEMORY_HOTPLUG disabled\n", func);
87 dump_stack();
88 return -ENOSYS;
89}
90
91static inline int __add_pages(struct zone *zone, unsigned long start_pfn,
92 unsigned long nr_pages)
93{
94 return mhp_notimplemented(__FUNCTION__);
95}
96#endif /* ! CONFIG_MEMORY_HOTPLUG */
97static inline int __remove_pages(struct zone *zone, unsigned long start_pfn,
98 unsigned long nr_pages)
99{
100 printk(KERN_WARNING "%s() called, not yet supported\n", __FUNCTION__);
101 dump_stack();
102 return -ENOSYS;
103}
104#endif /* __LINUX_MEMORY_HOTPLUG_H */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 58385ee1c0ac..8b67cf837ca9 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -27,10 +27,10 @@
27 27
28#include <linux/config.h> 28#include <linux/config.h>
29#include <linux/mmzone.h> 29#include <linux/mmzone.h>
30#include <linux/bitmap.h>
31#include <linux/slab.h> 30#include <linux/slab.h>
32#include <linux/rbtree.h> 31#include <linux/rbtree.h>
33#include <linux/spinlock.h> 32#include <linux/spinlock.h>
33#include <linux/nodemask.h>
34 34
35struct vm_area_struct; 35struct vm_area_struct;
36 36
@@ -47,8 +47,7 @@ struct vm_area_struct;
47 * Locking policy for interlave: 47 * Locking policy for interlave:
48 * In process context there is no locking because only the process accesses 48 * In process context there is no locking because only the process accesses
49 * its own state. All vma manipulation is somewhat protected by a down_read on 49 * its own state. All vma manipulation is somewhat protected by a down_read on
50 * mmap_sem. For allocating in the interleave policy the page_table_lock 50 * mmap_sem.
51 * must be also aquired to protect il_next.
52 * 51 *
53 * Freeing policy: 52 * Freeing policy:
54 * When policy is MPOL_BIND v.zonelist is kmalloc'ed and must be kfree'd. 53 * When policy is MPOL_BIND v.zonelist is kmalloc'ed and must be kfree'd.
@@ -63,7 +62,7 @@ struct mempolicy {
63 union { 62 union {
64 struct zonelist *zonelist; /* bind */ 63 struct zonelist *zonelist; /* bind */
65 short preferred_node; /* preferred */ 64 short preferred_node; /* preferred */
66 DECLARE_BITMAP(nodes, MAX_NUMNODES); /* interleave */ 65 nodemask_t nodes; /* interleave */
67 /* undefined for default */ 66 /* undefined for default */
68 } v; 67 } v;
69}; 68};
@@ -155,6 +154,7 @@ struct mempolicy *get_vma_policy(struct task_struct *task,
155 154
156extern void numa_default_policy(void); 155extern void numa_default_policy(void);
157extern void numa_policy_init(void); 156extern void numa_policy_init(void);
157extern void numa_policy_rebind(const nodemask_t *old, const nodemask_t *new);
158extern struct mempolicy default_policy; 158extern struct mempolicy default_policy;
159 159
160#else 160#else
@@ -227,6 +227,11 @@ static inline void numa_default_policy(void)
227{ 227{
228} 228}
229 229
230static inline void numa_policy_rebind(const nodemask_t *old,
231 const nodemask_t *new)
232{
233}
234
230#endif /* CONFIG_NUMA */ 235#endif /* CONFIG_NUMA */
231#endif /* __KERNEL__ */ 236#endif /* __KERNEL__ */
232 237
diff --git a/include/linux/mempool.h b/include/linux/mempool.h
index 796220ce47cc..f2427d7394b0 100644
--- a/include/linux/mempool.h
+++ b/include/linux/mempool.h
@@ -6,7 +6,7 @@
6 6
7#include <linux/wait.h> 7#include <linux/wait.h>
8 8
9typedef void * (mempool_alloc_t)(unsigned int __nocast gfp_mask, void *pool_data); 9typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data);
10typedef void (mempool_free_t)(void *element, void *pool_data); 10typedef void (mempool_free_t)(void *element, void *pool_data);
11 11
12typedef struct mempool_s { 12typedef struct mempool_s {
@@ -26,17 +26,16 @@ extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
26extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, 26extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn,
27 mempool_free_t *free_fn, void *pool_data, int nid); 27 mempool_free_t *free_fn, void *pool_data, int nid);
28 28
29extern int mempool_resize(mempool_t *pool, int new_min_nr, 29extern int mempool_resize(mempool_t *pool, int new_min_nr, gfp_t gfp_mask);
30 unsigned int __nocast gfp_mask);
31extern void mempool_destroy(mempool_t *pool); 30extern void mempool_destroy(mempool_t *pool);
32extern void * mempool_alloc(mempool_t *pool, unsigned int __nocast gfp_mask); 31extern void * mempool_alloc(mempool_t *pool, gfp_t gfp_mask);
33extern void mempool_free(void *element, mempool_t *pool); 32extern void mempool_free(void *element, mempool_t *pool);
34 33
35/* 34/*
36 * A mempool_alloc_t and mempool_free_t that get the memory from 35 * A mempool_alloc_t and mempool_free_t that get the memory from
37 * a slab that is passed in through pool_data. 36 * a slab that is passed in through pool_data.
38 */ 37 */
39void *mempool_alloc_slab(unsigned int __nocast gfp_mask, void *pool_data); 38void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data);
40void mempool_free_slab(void *element, void *pool_data); 39void mempool_free_slab(void *element, void *pool_data);
41 40
42#endif /* _LINUX_MEMPOOL_H */ 41#endif /* _LINUX_MEMPOOL_H */
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 9b8d0476988a..68f5a0f392dd 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -158,6 +158,7 @@ extern int mii_link_ok (struct mii_if_info *mii);
158extern int mii_nway_restart (struct mii_if_info *mii); 158extern int mii_nway_restart (struct mii_if_info *mii);
159extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); 159extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
160extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); 160extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd);
161extern int mii_check_gmii_support(struct mii_if_info *mii);
161extern void mii_check_link (struct mii_if_info *mii); 162extern void mii_check_link (struct mii_if_info *mii);
162extern unsigned int mii_check_media (struct mii_if_info *mii, 163extern unsigned int mii_check_media (struct mii_if_info *mii,
163 unsigned int ok_to_print, 164 unsigned int ok_to_print,
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 097b3a3c693d..29f02d8513f6 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -144,7 +144,8 @@ extern unsigned int kobjsize(const void *objp);
144 144
145#define VM_GROWSDOWN 0x00000100 /* general info on the segment */ 145#define VM_GROWSDOWN 0x00000100 /* general info on the segment */
146#define VM_GROWSUP 0x00000200 146#define VM_GROWSUP 0x00000200
147#define VM_SHM 0x00000400 /* shared memory area, don't swap out */ 147#define VM_SHM 0x00000000 /* Means nothing: delete it later */
148#define VM_PFNMAP 0x00000400 /* Page-ranges managed without "struct page", just pure PFN */
148#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */ 149#define VM_DENYWRITE 0x00000800 /* ETXTBSY on write attempts.. */
149 150
150#define VM_EXECUTABLE 0x00001000 151#define VM_EXECUTABLE 0x00001000
@@ -157,11 +158,12 @@ extern unsigned int kobjsize(const void *objp);
157 158
158#define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */ 159#define VM_DONTCOPY 0x00020000 /* Do not copy this vma on fork */
159#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */ 160#define VM_DONTEXPAND 0x00040000 /* Cannot expand with mremap() */
160#define VM_RESERVED 0x00080000 /* Don't unmap it from swap_out */ 161#define VM_RESERVED 0x00080000 /* Count as reserved_vm like IO */
161#define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ 162#define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */
162#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ 163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
163#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ 164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */
164#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */ 165#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */
166#define VM_INCOMPLETE 0x02000000 /* Strange partial PFN mapping marker */
165 167
166#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 168#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
167#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 169#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
@@ -206,12 +208,6 @@ struct vm_operations_struct {
206struct mmu_gather; 208struct mmu_gather;
207struct inode; 209struct inode;
208 210
209#ifdef ARCH_HAS_ATOMIC_UNSIGNED
210typedef unsigned page_flags_t;
211#else
212typedef unsigned long page_flags_t;
213#endif
214
215/* 211/*
216 * Each physical page in the system has a struct page associated with 212 * Each physical page in the system has a struct page associated with
217 * it to keep track of whatever it is we are using the page for at the 213 * it to keep track of whatever it is we are using the page for at the
@@ -219,20 +215,25 @@ typedef unsigned long page_flags_t;
219 * a page. 215 * a page.
220 */ 216 */
221struct page { 217struct page {
222 page_flags_t flags; /* Atomic flags, some possibly 218 unsigned long flags; /* Atomic flags, some possibly
223 * updated asynchronously */ 219 * updated asynchronously */
224 atomic_t _count; /* Usage count, see below. */ 220 atomic_t _count; /* Usage count, see below. */
225 atomic_t _mapcount; /* Count of ptes mapped in mms, 221 atomic_t _mapcount; /* Count of ptes mapped in mms,
226 * to show when page is mapped 222 * to show when page is mapped
227 * & limit reverse map searches. 223 * & limit reverse map searches.
228 */ 224 */
229 unsigned long private; /* Mapping-private opaque data: 225 union {
226 unsigned long private; /* Mapping-private opaque data:
230 * usually used for buffer_heads 227 * usually used for buffer_heads
231 * if PagePrivate set; used for 228 * if PagePrivate set; used for
232 * swp_entry_t if PageSwapCache 229 * swp_entry_t if PageSwapCache
233 * When page is free, this indicates 230 * When page is free, this indicates
234 * order in the buddy system. 231 * order in the buddy system.
235 */ 232 */
233#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
234 spinlock_t ptl;
235#endif
236 } u;
236 struct address_space *mapping; /* If low bit clear, points to 237 struct address_space *mapping; /* If low bit clear, points to
237 * inode address_space, or NULL. 238 * inode address_space, or NULL.
238 * If page mapped as anonymous 239 * If page mapped as anonymous
@@ -260,6 +261,9 @@ struct page {
260#endif /* WANT_PAGE_VIRTUAL */ 261#endif /* WANT_PAGE_VIRTUAL */
261}; 262};
262 263
264#define page_private(page) ((page)->u.private)
265#define set_page_private(page, v) ((page)->u.private = (v))
266
263/* 267/*
264 * FIXME: take this include out, include page-flags.h in 268 * FIXME: take this include out, include page-flags.h in
265 * files which need it (119 of them) 269 * files which need it (119 of them)
@@ -309,41 +313,22 @@ struct page {
309 313
310extern void FASTCALL(__page_cache_release(struct page *)); 314extern void FASTCALL(__page_cache_release(struct page *));
311 315
312#ifdef CONFIG_HUGETLB_PAGE 316static inline int page_count(struct page *page)
313
314static inline int page_count(struct page *p)
315{ 317{
316 if (PageCompound(p)) 318 if (PageCompound(page))
317 p = (struct page *)p->private; 319 page = (struct page *)page_private(page);
318 return atomic_read(&(p)->_count) + 1; 320 return atomic_read(&page->_count) + 1;
319} 321}
320 322
321static inline void get_page(struct page *page) 323static inline void get_page(struct page *page)
322{ 324{
323 if (unlikely(PageCompound(page))) 325 if (unlikely(PageCompound(page)))
324 page = (struct page *)page->private; 326 page = (struct page *)page_private(page);
325 atomic_inc(&page->_count); 327 atomic_inc(&page->_count);
326} 328}
327 329
328void put_page(struct page *page); 330void put_page(struct page *page);
329 331
330#else /* CONFIG_HUGETLB_PAGE */
331
332#define page_count(p) (atomic_read(&(p)->_count) + 1)
333
334static inline void get_page(struct page *page)
335{
336 atomic_inc(&page->_count);
337}
338
339static inline void put_page(struct page *page)
340{
341 if (!PageReserved(page) && put_page_testzero(page))
342 __page_cache_release(page);
343}
344
345#endif /* CONFIG_HUGETLB_PAGE */
346
347/* 332/*
348 * Multiple processes may "see" the same page. E.g. for untouched 333 * Multiple processes may "see" the same page. E.g. for untouched
349 * mappings of /dev/null, all processes see the same page full of 334 * mappings of /dev/null, all processes see the same page full of
@@ -427,7 +412,7 @@ static inline void put_page(struct page *page)
427#endif 412#endif
428 413
429/* Page flags: | [SECTION] | [NODE] | ZONE | ... | FLAGS | */ 414/* Page flags: | [SECTION] | [NODE] | ZONE | ... | FLAGS | */
430#define SECTIONS_PGOFF ((sizeof(page_flags_t)*8) - SECTIONS_WIDTH) 415#define SECTIONS_PGOFF ((sizeof(unsigned long)*8) - SECTIONS_WIDTH)
431#define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) 416#define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH)
432#define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) 417#define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH)
433 418
@@ -587,7 +572,7 @@ static inline int PageAnon(struct page *page)
587static inline pgoff_t page_index(struct page *page) 572static inline pgoff_t page_index(struct page *page)
588{ 573{
589 if (unlikely(PageSwapCache(page))) 574 if (unlikely(PageSwapCache(page)))
590 return page->private; 575 return page_private(page);
591 return page->index; 576 return page->index;
592} 577}
593 578
@@ -680,9 +665,10 @@ struct zap_details {
680 unsigned long truncate_count; /* Compare vm_truncate_count */ 665 unsigned long truncate_count; /* Compare vm_truncate_count */
681}; 666};
682 667
668struct page *vm_normal_page(struct vm_area_struct *, unsigned long, pte_t);
683unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address, 669unsigned long zap_page_range(struct vm_area_struct *vma, unsigned long address,
684 unsigned long size, struct zap_details *); 670 unsigned long size, struct zap_details *);
685unsigned long unmap_vmas(struct mmu_gather **tlb, struct mm_struct *mm, 671unsigned long unmap_vmas(struct mmu_gather **tlb,
686 struct vm_area_struct *start_vma, unsigned long start_addr, 672 struct vm_area_struct *start_vma, unsigned long start_addr,
687 unsigned long end_addr, unsigned long *nr_accounted, 673 unsigned long end_addr, unsigned long *nr_accounted,
688 struct zap_details *); 674 struct zap_details *);
@@ -704,10 +690,6 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
704} 690}
705 691
706extern int vmtruncate(struct inode * inode, loff_t offset); 692extern int vmtruncate(struct inode * inode, loff_t offset);
707extern pud_t *FASTCALL(__pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address));
708extern pmd_t *FASTCALL(__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address));
709extern pte_t *FASTCALL(pte_alloc_kernel(struct mm_struct *mm, pmd_t *pmd, unsigned long address));
710extern pte_t *FASTCALL(pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long address));
711extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); 693extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
712extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); 694extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
713extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); 695extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);
@@ -723,6 +705,7 @@ void install_arg_page(struct vm_area_struct *, struct page *, unsigned long);
723 705
724int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, 706int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start,
725 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); 707 int len, int write, int force, struct page **pages, struct vm_area_struct **vmas);
708void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long);
726 709
727int __set_page_dirty_buffers(struct page *page); 710int __set_page_dirty_buffers(struct page *page);
728int __set_page_dirty_nobuffers(struct page *page); 711int __set_page_dirty_nobuffers(struct page *page);
@@ -747,7 +730,7 @@ extern unsigned long do_mremap(unsigned long addr,
747 * The callback will be passed nr_to_scan == 0 when the VM is querying the 730 * The callback will be passed nr_to_scan == 0 when the VM is querying the
748 * cache size, so a fastpath for that case is appropriate. 731 * cache size, so a fastpath for that case is appropriate.
749 */ 732 */
750typedef int (*shrinker_t)(int nr_to_scan, unsigned int gfp_mask); 733typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask);
751 734
752/* 735/*
753 * Add an aging callback. The int is the number of 'seeks' it takes 736 * Add an aging callback. The int is the number of 'seeks' it takes
@@ -759,38 +742,85 @@ struct shrinker;
759extern struct shrinker *set_shrinker(int, shrinker_t); 742extern struct shrinker *set_shrinker(int, shrinker_t);
760extern void remove_shrinker(struct shrinker *shrinker); 743extern void remove_shrinker(struct shrinker *shrinker);
761 744
762/* 745extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl));
763 * On a two-level or three-level page table, this ends up being trivial. Thus 746
764 * the inlining and the symmetry break with pte_alloc_map() that does all 747int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
765 * of this out-of-line. 748int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
766 */ 749int __pte_alloc(struct mm_struct *mm, pmd_t *pmd, unsigned long address);
750int __pte_alloc_kernel(pmd_t *pmd, unsigned long address);
751
767/* 752/*
768 * The following ifdef needed to get the 4level-fixup.h header to work. 753 * The following ifdef needed to get the 4level-fixup.h header to work.
769 * Remove it when 4level-fixup.h has been removed. 754 * Remove it when 4level-fixup.h has been removed.
770 */ 755 */
771#ifdef CONFIG_MMU 756#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK)
772#ifndef __ARCH_HAS_4LEVEL_HACK
773static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) 757static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
774{ 758{
775 if (pgd_none(*pgd)) 759 return (unlikely(pgd_none(*pgd)) && __pud_alloc(mm, pgd, address))?
776 return __pud_alloc(mm, pgd, address); 760 NULL: pud_offset(pgd, address);
777 return pud_offset(pgd, address);
778} 761}
779 762
780static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) 763static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
781{ 764{
782 if (pud_none(*pud)) 765 return (unlikely(pud_none(*pud)) && __pmd_alloc(mm, pud, address))?
783 return __pmd_alloc(mm, pud, address); 766 NULL: pmd_offset(pud, address);
784 return pmd_offset(pud, address);
785} 767}
786#endif 768#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */
787#endif /* CONFIG_MMU */ 769
770#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
771/*
772 * We tuck a spinlock to guard each pagetable page into its struct page,
773 * at page->private, with BUILD_BUG_ON to make sure that this will not
774 * overflow into the next struct page (as it might with DEBUG_SPINLOCK).
775 * When freeing, reset page->mapping so free_pages_check won't complain.
776 */
777#define __pte_lockptr(page) &((page)->u.ptl)
778#define pte_lock_init(_page) do { \
779 spin_lock_init(__pte_lockptr(_page)); \
780} while (0)
781#define pte_lock_deinit(page) ((page)->mapping = NULL)
782#define pte_lockptr(mm, pmd) ({(void)(mm); __pte_lockptr(pmd_page(*(pmd)));})
783#else
784/*
785 * We use mm->page_table_lock to guard all pagetable pages of the mm.
786 */
787#define pte_lock_init(page) do {} while (0)
788#define pte_lock_deinit(page) do {} while (0)
789#define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;})
790#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
791
792#define pte_offset_map_lock(mm, pmd, address, ptlp) \
793({ \
794 spinlock_t *__ptl = pte_lockptr(mm, pmd); \
795 pte_t *__pte = pte_offset_map(pmd, address); \
796 *(ptlp) = __ptl; \
797 spin_lock(__ptl); \
798 __pte; \
799})
800
801#define pte_unmap_unlock(pte, ptl) do { \
802 spin_unlock(ptl); \
803 pte_unmap(pte); \
804} while (0)
805
806#define pte_alloc_map(mm, pmd, address) \
807 ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
808 NULL: pte_offset_map(pmd, address))
809
810#define pte_alloc_map_lock(mm, pmd, address, ptlp) \
811 ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \
812 NULL: pte_offset_map_lock(mm, pmd, address, ptlp))
813
814#define pte_alloc_kernel(pmd, address) \
815 ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \
816 NULL: pte_offset_kernel(pmd, address))
788 817
789extern void free_area_init(unsigned long * zones_size); 818extern void free_area_init(unsigned long * zones_size);
790extern void free_area_init_node(int nid, pg_data_t *pgdat, 819extern void free_area_init_node(int nid, pg_data_t *pgdat,
791 unsigned long * zones_size, unsigned long zone_start_pfn, 820 unsigned long * zones_size, unsigned long zone_start_pfn,
792 unsigned long *zholes_size); 821 unsigned long *zholes_size);
793extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); 822extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long);
823extern void setup_per_zone_pages_min(void);
794extern void mem_init(void); 824extern void mem_init(void);
795extern void show_mem(void); 825extern void show_mem(void);
796extern void si_meminfo(struct sysinfo * val); 826extern void si_meminfo(struct sysinfo * val);
@@ -834,6 +864,7 @@ extern int split_vma(struct mm_struct *,
834extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *); 864extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
835extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *, 865extern void __vma_link_rb(struct mm_struct *, struct vm_area_struct *,
836 struct rb_node **, struct rb_node *); 866 struct rb_node **, struct rb_node *);
867extern void unlink_file_vma(struct vm_area_struct *);
837extern struct vm_area_struct *copy_vma(struct vm_area_struct **, 868extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
838 unsigned long addr, unsigned long len, pgoff_t pgoff); 869 unsigned long addr, unsigned long len, pgoff_t pgoff);
839extern void exit_mmap(struct mm_struct *); 870extern void exit_mmap(struct mm_struct *);
@@ -881,20 +912,23 @@ int write_one_page(struct page *page, int wait);
881 * turning readahead off */ 912 * turning readahead off */
882 913
883int do_page_cache_readahead(struct address_space *mapping, struct file *filp, 914int do_page_cache_readahead(struct address_space *mapping, struct file *filp,
884 unsigned long offset, unsigned long nr_to_read); 915 pgoff_t offset, unsigned long nr_to_read);
885int force_page_cache_readahead(struct address_space *mapping, struct file *filp, 916int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
886 unsigned long offset, unsigned long nr_to_read); 917 pgoff_t offset, unsigned long nr_to_read);
887unsigned long page_cache_readahead(struct address_space *mapping, 918unsigned long page_cache_readahead(struct address_space *mapping,
888 struct file_ra_state *ra, 919 struct file_ra_state *ra,
889 struct file *filp, 920 struct file *filp,
890 unsigned long offset, 921 pgoff_t offset,
891 unsigned long size); 922 unsigned long size);
892void handle_ra_miss(struct address_space *mapping, 923void handle_ra_miss(struct address_space *mapping,
893 struct file_ra_state *ra, pgoff_t offset); 924 struct file_ra_state *ra, pgoff_t offset);
894unsigned long max_sane_readahead(unsigned long nr); 925unsigned long max_sane_readahead(unsigned long nr);
895 926
896/* Do stack extension */ 927/* Do stack extension */
897extern int expand_stack(struct vm_area_struct * vma, unsigned long address); 928extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
929#ifdef CONFIG_IA64
930extern int expand_upwards(struct vm_area_struct *vma, unsigned long address);
931#endif
898 932
899/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ 933/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
900extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); 934extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
@@ -917,40 +951,29 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
917 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 951 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
918} 952}
919 953
920extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr); 954struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
955struct page *vmalloc_to_page(void *addr);
956unsigned long vmalloc_to_pfn(void *addr);
957int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
958 unsigned long pfn, unsigned long size, pgprot_t);
959int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
921 960
922extern struct page * vmalloc_to_page(void *addr); 961struct page *follow_page(struct vm_area_struct *, unsigned long address,
923extern unsigned long vmalloc_to_pfn(void *addr); 962 unsigned int foll_flags);
924extern struct page * follow_page(struct mm_struct *mm, unsigned long address, 963#define FOLL_WRITE 0x01 /* check pte is writable */
925 int write); 964#define FOLL_TOUCH 0x02 /* mark page accessed */
926extern int check_user_page_readable(struct mm_struct *mm, unsigned long address); 965#define FOLL_GET 0x04 /* do get_page on page */
927int remap_pfn_range(struct vm_area_struct *, unsigned long, 966#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */
928 unsigned long, unsigned long, pgprot_t);
929 967
930#ifdef CONFIG_PROC_FS 968#ifdef CONFIG_PROC_FS
931void __vm_stat_account(struct mm_struct *, unsigned long, struct file *, long); 969void vm_stat_account(struct mm_struct *, unsigned long, struct file *, long);
932#else 970#else
933static inline void __vm_stat_account(struct mm_struct *mm, 971static inline void vm_stat_account(struct mm_struct *mm,
934 unsigned long flags, struct file *file, long pages) 972 unsigned long flags, struct file *file, long pages)
935{ 973{
936} 974}
937#endif /* CONFIG_PROC_FS */ 975#endif /* CONFIG_PROC_FS */
938 976
939static inline void vm_stat_account(struct vm_area_struct *vma)
940{
941 __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
942 vma_pages(vma));
943}
944
945static inline void vm_stat_unaccount(struct vm_area_struct *vma)
946{
947 __vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
948 -vma_pages(vma));
949}
950
951/* update per process rss and vm hiwater data */
952extern void update_mem_hiwater(struct task_struct *tsk);
953
954#ifndef CONFIG_DEBUG_PAGEALLOC 977#ifndef CONFIG_DEBUG_PAGEALLOC
955static inline void 978static inline void
956kernel_map_pages(struct page *page, int numpages, int enable) 979kernel_map_pages(struct page *page, int numpages, int enable)
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 1ab78e8d6c53..aef6042f8f0b 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -50,7 +50,7 @@ struct mmc_command {
50#define MMC_ERR_INVALID 5 50#define MMC_ERR_INVALID 5
51 51
52 struct mmc_data *data; /* data segment associated with cmd */ 52 struct mmc_data *data; /* data segment associated with cmd */
53 struct mmc_request *mrq; /* assoicated request */ 53 struct mmc_request *mrq; /* associated request */
54}; 54};
55 55
56struct mmc_data { 56struct mmc_data {
@@ -68,7 +68,7 @@ struct mmc_data {
68 unsigned int bytes_xfered; 68 unsigned int bytes_xfered;
69 69
70 struct mmc_command *stop; /* stop command */ 70 struct mmc_command *stop; /* stop command */
71 struct mmc_request *mrq; /* assoicated request */ 71 struct mmc_request *mrq; /* associated request */
72 72
73 unsigned int sg_len; /* size of scatter list */ 73 unsigned int sg_len; /* size of scatter list */
74 struct scatterlist *sg; /* I/O scatter list */ 74 struct scatterlist *sg; /* I/O scatter list */
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h
index f819cae92266..a14dc306545b 100644
--- a/include/linux/mmc/protocol.h
+++ b/include/linux/mmc/protocol.h
@@ -63,7 +63,7 @@
63 /* class 5 */ 63 /* class 5 */
64#define MMC_ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */ 64#define MMC_ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */
65#define MMC_ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */ 65#define MMC_ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */
66#define MMC_ERASE 37 /* ac R1b */ 66#define MMC_ERASE 38 /* ac R1b */
67 67
68 /* class 9 */ 68 /* class 9 */
69#define MMC_FAST_IO 39 /* ac <Complex> R4 */ 69#define MMC_FAST_IO 39 /* ac <Complex> R4 */
@@ -74,7 +74,7 @@
74 74
75 /* class 8 */ 75 /* class 8 */
76#define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */ 76#define MMC_APP_CMD 55 /* ac [31:16] RCA R1 */
77#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1b */ 77#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1 */
78 78
79/* SD commands type argument response */ 79/* SD commands type argument response */
80 /* class 8 */ 80 /* class 8 */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 5ed471b58f4f..9f22090df7dd 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -12,6 +12,7 @@
12#include <linux/threads.h> 12#include <linux/threads.h>
13#include <linux/numa.h> 13#include <linux/numa.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/seqlock.h>
15#include <asm/atomic.h> 16#include <asm/atomic.h>
16 17
17/* Free memory management - zoned buddy allocator. */ 18/* Free memory management - zoned buddy allocator. */
@@ -70,10 +71,11 @@ struct per_cpu_pageset {
70#endif 71#endif
71 72
72#define ZONE_DMA 0 73#define ZONE_DMA 0
73#define ZONE_NORMAL 1 74#define ZONE_DMA32 1
74#define ZONE_HIGHMEM 2 75#define ZONE_NORMAL 2
76#define ZONE_HIGHMEM 3
75 77
76#define MAX_NR_ZONES 3 /* Sync this with ZONES_SHIFT */ 78#define MAX_NR_ZONES 4 /* Sync this with ZONES_SHIFT */
77#define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ 79#define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */
78 80
79 81
@@ -89,27 +91,18 @@ struct per_cpu_pageset {
89 * will be a maximum of 4 (2 ** 2) zonelists, for 3 modifiers there will 91 * will be a maximum of 4 (2 ** 2) zonelists, for 3 modifiers there will
90 * be 8 (2 ** 3) zonelists. GFP_ZONETYPES defines the number of possible 92 * be 8 (2 ** 3) zonelists. GFP_ZONETYPES defines the number of possible
91 * combinations of zone modifiers in "zone modifier space". 93 * combinations of zone modifiers in "zone modifier space".
94 *
95 * NOTE! Make sure this matches the zones in <linux/gfp.h>
92 */ 96 */
93#define GFP_ZONEMASK 0x03 97#define GFP_ZONEMASK 0x07
94/* 98#define GFP_ZONETYPES 5
95 * As an optimisation any zone modifier bits which are only valid when
96 * no other zone modifier bits are set (loners) should be placed in
97 * the highest order bits of this field. This allows us to reduce the
98 * extent of the zonelists thus saving space. For example in the case
99 * of three zone modifier bits, we could require up to eight zonelists.
100 * If the left most zone modifier is a "loner" then the highest valid
101 * zonelist would be four allowing us to allocate only five zonelists.
102 * Use the first form when the left most bit is not a "loner", otherwise
103 * use the second.
104 */
105/* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */
106#define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */
107 99
108/* 100/*
109 * On machines where it is needed (eg PCs) we divide physical memory 101 * On machines where it is needed (eg PCs) we divide physical memory
110 * into multiple physical zones. On a PC we have 3 zones: 102 * into multiple physical zones. On a PC we have 4 zones:
111 * 103 *
112 * ZONE_DMA < 16 MB ISA DMA capable memory 104 * ZONE_DMA < 16 MB ISA DMA capable memory
105 * ZONE_DMA32 0 MB Empty
113 * ZONE_NORMAL 16-896 MB direct mapped by the kernel 106 * ZONE_NORMAL 16-896 MB direct mapped by the kernel
114 * ZONE_HIGHMEM > 896 MB only page cache and user processes 107 * ZONE_HIGHMEM > 896 MB only page cache and user processes
115 */ 108 */
@@ -137,6 +130,10 @@ struct zone {
137 * free areas of different sizes 130 * free areas of different sizes
138 */ 131 */
139 spinlock_t lock; 132 spinlock_t lock;
133#ifdef CONFIG_MEMORY_HOTPLUG
134 /* see spanned/present_pages for more description */
135 seqlock_t span_seqlock;
136#endif
140 struct free_area free_area[MAX_ORDER]; 137 struct free_area free_area[MAX_ORDER];
141 138
142 139
@@ -220,6 +217,16 @@ struct zone {
220 /* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */ 217 /* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */
221 unsigned long zone_start_pfn; 218 unsigned long zone_start_pfn;
222 219
220 /*
221 * zone_start_pfn, spanned_pages and present_pages are all
222 * protected by span_seqlock. It is a seqlock because it has
223 * to be read outside of zone->lock, and it is done in the main
224 * allocator path. But, it is written quite infrequently.
225 *
226 * The lock is declared along with zone->lock because it is
227 * frequently read in proximity to zone->lock. It's good to
228 * give them a chance of being in the same cacheline.
229 */
223 unsigned long spanned_pages; /* total size, including holes */ 230 unsigned long spanned_pages; /* total size, including holes */
224 unsigned long present_pages; /* amount of memory (excluding holes) */ 231 unsigned long present_pages; /* amount of memory (excluding holes) */
225 232
@@ -273,6 +280,16 @@ typedef struct pglist_data {
273 struct page *node_mem_map; 280 struct page *node_mem_map;
274#endif 281#endif
275 struct bootmem_data *bdata; 282 struct bootmem_data *bdata;
283#ifdef CONFIG_MEMORY_HOTPLUG
284 /*
285 * Must be held any time you expect node_start_pfn, node_present_pages
286 * or node_spanned_pages stay constant. Holding this will also
287 * guarantee that any pfn_valid() stays that way.
288 *
289 * Nests above zone->lock and zone->size_seqlock.
290 */
291 spinlock_t node_size_lock;
292#endif
276 unsigned long node_start_pfn; 293 unsigned long node_start_pfn;
277 unsigned long node_present_pages; /* total number of physical pages */ 294 unsigned long node_present_pages; /* total number of physical pages */
278 unsigned long node_spanned_pages; /* total size of physical page 295 unsigned long node_spanned_pages; /* total size of physical page
@@ -293,6 +310,8 @@ typedef struct pglist_data {
293#endif 310#endif
294#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) 311#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr))
295 312
313#include <linux/memory_hotplug.h>
314
296extern struct pglist_data *pgdat_list; 315extern struct pglist_data *pgdat_list;
297 316
298void __get_zone_counts(unsigned long *active, unsigned long *inactive, 317void __get_zone_counts(unsigned long *active, unsigned long *inactive,
@@ -302,7 +321,7 @@ void get_zone_counts(unsigned long *active, unsigned long *inactive,
302void build_all_zonelists(void); 321void build_all_zonelists(void);
303void wakeup_kswapd(struct zone *zone, int order); 322void wakeup_kswapd(struct zone *zone, int order);
304int zone_watermark_ok(struct zone *z, int order, unsigned long mark, 323int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
305 int alloc_type, int can_try_harder, int gfp_high); 324 int classzone_idx, int alloc_flags);
306 325
307#ifdef CONFIG_HAVE_MEMORY_PRESENT 326#ifdef CONFIG_HAVE_MEMORY_PRESENT
308void memory_present(int nid, unsigned long start, unsigned long end); 327void memory_present(int nid, unsigned long start, unsigned long end);
@@ -406,7 +425,9 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *,
406 425
407#include <linux/topology.h> 426#include <linux/topology.h>
408/* Returns the number of the current Node. */ 427/* Returns the number of the current Node. */
428#ifndef numa_node_id
409#define numa_node_id() (cpu_to_node(raw_smp_processor_id())) 429#define numa_node_id() (cpu_to_node(raw_smp_processor_id()))
430#endif
410 431
411#ifndef CONFIG_NEED_MULTIPLE_NODES 432#ifndef CONFIG_NEED_MULTIPLE_NODES
412 433
@@ -426,12 +447,12 @@ extern struct pglist_data contig_page_data;
426#include <asm/sparsemem.h> 447#include <asm/sparsemem.h>
427#endif 448#endif
428 449
429#if BITS_PER_LONG == 32 || defined(ARCH_HAS_ATOMIC_UNSIGNED) 450#if BITS_PER_LONG == 32
430/* 451/*
431 * with 32 bit page->flags field, we reserve 8 bits for node/zone info. 452 * with 32 bit page->flags field, we reserve 9 bits for node/zone info.
432 * there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes. 453 * there are 4 zones (3 bits) and this leaves 9-3=6 bits for nodes.
433 */ 454 */
434#define FLAGS_RESERVED 8 455#define FLAGS_RESERVED 9
435 456
436#elif BITS_PER_LONG == 64 457#elif BITS_PER_LONG == 64
437/* 458/*
@@ -509,6 +530,7 @@ static inline struct mem_section *__nr_to_section(unsigned long nr)
509 return NULL; 530 return NULL;
510 return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; 531 return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK];
511} 532}
533extern int __section_nr(struct mem_section* ms);
512 534
513/* 535/*
514 * We use the lower bits of the mem_map pointer to store 536 * We use the lower bits of the mem_map pointer to store
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 47da39ba3f03..7b08c11ec4cc 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -183,7 +183,7 @@ struct of_device_id
183 char name[32]; 183 char name[32];
184 char type[32]; 184 char type[32];
185 char compatible[128]; 185 char compatible[128];
186#if __KERNEL__ 186#ifdef __KERNEL__
187 void *data; 187 void *data;
188#else 188#else
189 kernel_ulong_t data; 189 kernel_ulong_t data;
@@ -209,10 +209,11 @@ struct pcmcia_device_id {
209 /* for real multi-function devices */ 209 /* for real multi-function devices */
210 __u8 function; 210 __u8 function;
211 211
212 /* for pseude multi-function devices */ 212 /* for pseudo multi-function devices */
213 __u8 device_no; 213 __u8 device_no;
214 214
215 __u32 prod_id_hash[4]; 215 __u32 prod_id_hash[4]
216 __attribute__((aligned(sizeof(__u32))));
216 217
217 /* not matched against in kernelspace*/ 218 /* not matched against in kernelspace*/
218#ifdef __KERNEL__ 219#ifdef __KERNEL__
@@ -243,4 +244,9 @@ struct pcmcia_device_id {
243#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200 244#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200
244#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400 245#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400
245 246
247/* I2C */
248struct i2c_device_id {
249 __u16 id;
250};
251
246#endif /* LINUX_MOD_DEVICETABLE_H */ 252#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index f05372b7fe77..84d75f3a8aca 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -554,7 +554,9 @@ static inline void MODULE_PARM_(void) { }
554#ifdef MODULE 554#ifdef MODULE
555/* DEPRECATED: Do not use. */ 555/* DEPRECATED: Do not use. */
556#define MODULE_PARM(var,type) \ 556#define MODULE_PARM(var,type) \
557struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \ 557extern struct obsolete_modparm __parm_##var \
558__attribute__((section("__obsparm"))); \
559struct obsolete_modparm __parm_##var = \
558{ __stringify(var), type, &MODULE_PARM_ }; \ 560{ __stringify(var), type, &MODULE_PARM_ }; \
559__MODULE_PARM_TYPE(var, type); 561__MODULE_PARM_TYPE(var, type);
560#else 562#else
diff --git a/include/linux/mount.h b/include/linux/mount.h
index f8f39937e301..dd4e83eba933 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -17,12 +17,14 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19 19
20#define MNT_NOSUID 1 20#define MNT_NOSUID 0x01
21#define MNT_NODEV 2 21#define MNT_NODEV 0x02
22#define MNT_NOEXEC 4 22#define MNT_NOEXEC 0x04
23#define MNT_SHARED 0x10 /* if the vfsmount is a shared mount */
24#define MNT_UNBINDABLE 0x20 /* if the vfsmount is a unbindable mount */
25#define MNT_PNODE_MASK 0x30 /* propogation flag mask */
23 26
24struct vfsmount 27struct vfsmount {
25{
26 struct list_head mnt_hash; 28 struct list_head mnt_hash;
27 struct vfsmount *mnt_parent; /* fs we are mounted on */ 29 struct vfsmount *mnt_parent; /* fs we are mounted on */
28 struct dentry *mnt_mountpoint; /* dentry of mountpoint */ 30 struct dentry *mnt_mountpoint; /* dentry of mountpoint */
@@ -36,7 +38,12 @@ struct vfsmount
36 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ 38 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
37 struct list_head mnt_list; 39 struct list_head mnt_list;
38 struct list_head mnt_expire; /* link in fs-specific expiry list */ 40 struct list_head mnt_expire; /* link in fs-specific expiry list */
41 struct list_head mnt_share; /* circular list of shared mounts */
42 struct list_head mnt_slave_list;/* list of slave mounts */
43 struct list_head mnt_slave; /* slave list entry */
44 struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */
39 struct namespace *mnt_namespace; /* containing namespace */ 45 struct namespace *mnt_namespace; /* containing namespace */
46 int mnt_pinned;
40}; 47};
41 48
42static inline struct vfsmount *mntget(struct vfsmount *mnt) 49static inline struct vfsmount *mntget(struct vfsmount *mnt)
@@ -46,15 +53,9 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt)
46 return mnt; 53 return mnt;
47} 54}
48 55
49extern void __mntput(struct vfsmount *mnt); 56extern void mntput_no_expire(struct vfsmount *mnt);
50 57extern void mnt_pin(struct vfsmount *mnt);
51static inline void mntput_no_expire(struct vfsmount *mnt) 58extern void mnt_unpin(struct vfsmount *mnt);
52{
53 if (mnt) {
54 if (atomic_dec_and_test(&mnt->mnt_count))
55 __mntput(mnt);
56 }
57}
58 59
59static inline void mntput(struct vfsmount *mnt) 60static inline void mntput(struct vfsmount *mnt)
60{ 61{
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 9a3d27257984..941da5c016a0 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -282,6 +282,17 @@ static inline u8 fat_attr(struct inode *inode)
282 MSDOS_I(inode)->i_attrs; 282 MSDOS_I(inode)->i_attrs;
283} 283}
284 284
285static inline unsigned char fat_checksum(const __u8 *name)
286{
287 unsigned char s = name[0];
288 s = (s<<7) + (s>>1) + name[1]; s = (s<<7) + (s>>1) + name[2];
289 s = (s<<7) + (s>>1) + name[3]; s = (s<<7) + (s>>1) + name[4];
290 s = (s<<7) + (s>>1) + name[5]; s = (s<<7) + (s>>1) + name[6];
291 s = (s<<7) + (s>>1) + name[7]; s = (s<<7) + (s>>1) + name[8];
292 s = (s<<7) + (s>>1) + name[9]; s = (s<<7) + (s>>1) + name[10];
293 return s;
294}
295
285static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus) 296static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus)
286{ 297{
287 return ((sector_t)clus - FAT_START_ENT) * sbi->sec_per_clus 298 return ((sector_t)clus - FAT_START_ENT) * sbi->sec_per_clus
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
new file mode 100644
index 000000000000..7a7fbe87fef0
--- /dev/null
+++ b/include/linux/mtd/bbm.h
@@ -0,0 +1,122 @@
1/*
2 * linux/include/linux/mtd/bbm.h
3 *
4 * NAND family Bad Block Management (BBM) header file
5 * - Bad Block Table (BBT) implementation
6 *
7 * Copyright (c) 2005 Samsung Electronics
8 * Kyungmin Park <kyungmin.park@samsung.com>
9 *
10 * Copyright (c) 2000-2005
11 * Thomas Gleixner <tglx@linuxtronix.de>
12 *
13 */
14#ifndef __LINUX_MTD_BBM_H
15#define __LINUX_MTD_BBM_H
16
17/* The maximum number of NAND chips in an array */
18#define NAND_MAX_CHIPS 8
19
20/**
21 * struct nand_bbt_descr - bad block table descriptor
22 * @param options options for this descriptor
23 * @param pages the page(s) where we find the bbt, used with
24 * option BBT_ABSPAGE when bbt is searched,
25 * then we store the found bbts pages here.
26 * Its an array and supports up to 8 chips now
27 * @param offs offset of the pattern in the oob area of the page
28 * @param veroffs offset of the bbt version counter in the oob are of the page
29 * @param version version read from the bbt page during scan
30 * @param len length of the pattern, if 0 no pattern check is performed
31 * @param maxblocks maximum number of blocks to search for a bbt. This number of
32 * blocks is reserved at the end of the device
33 * where the tables are written.
34 * @param reserved_block_code if non-0, this pattern denotes a reserved
35 * (rather than bad) block in the stored bbt
36 * @param pattern pattern to identify bad block table or factory marked
37 * good / bad blocks, can be NULL, if len = 0
38 *
39 * Descriptor for the bad block table marker and the descriptor for the
40 * pattern which identifies good and bad blocks. The assumption is made
41 * that the pattern and the version count are always located in the oob area
42 * of the first block.
43 */
44struct nand_bbt_descr {
45 int options;
46 int pages[NAND_MAX_CHIPS];
47 int offs;
48 int veroffs;
49 uint8_t version[NAND_MAX_CHIPS];
50 int len;
51 int maxblocks;
52 int reserved_block_code;
53 uint8_t *pattern;
54};
55
56/* Options for the bad block table descriptors */
57
58/* The number of bits used per block in the bbt on the device */
59#define NAND_BBT_NRBITS_MSK 0x0000000F
60#define NAND_BBT_1BIT 0x00000001
61#define NAND_BBT_2BIT 0x00000002
62#define NAND_BBT_4BIT 0x00000004
63#define NAND_BBT_8BIT 0x00000008
64/* The bad block table is in the last good block of the device */
65#define NAND_BBT_LASTBLOCK 0x00000010
66/* The bbt is at the given page, else we must scan for the bbt */
67#define NAND_BBT_ABSPAGE 0x00000020
68/* The bbt is at the given page, else we must scan for the bbt */
69#define NAND_BBT_SEARCH 0x00000040
70/* bbt is stored per chip on multichip devices */
71#define NAND_BBT_PERCHIP 0x00000080
72/* bbt has a version counter at offset veroffs */
73#define NAND_BBT_VERSION 0x00000100
74/* Create a bbt if none axists */
75#define NAND_BBT_CREATE 0x00000200
76/* Search good / bad pattern through all pages of a block */
77#define NAND_BBT_SCANALLPAGES 0x00000400
78/* Scan block empty during good / bad block scan */
79#define NAND_BBT_SCANEMPTY 0x00000800
80/* Write bbt if neccecary */
81#define NAND_BBT_WRITE 0x00001000
82/* Read and write back block contents when writing bbt */
83#define NAND_BBT_SAVECONTENT 0x00002000
84/* Search good / bad pattern on the first and the second page */
85#define NAND_BBT_SCAN2NDPAGE 0x00004000
86
87/* The maximum number of blocks to scan for a bbt */
88#define NAND_BBT_SCAN_MAXBLOCKS 4
89
90/*
91 * Constants for oob configuration
92 */
93#define ONENAND_BADBLOCK_POS 0
94
95/**
96 * struct bbt_info - [GENERIC] Bad Block Table data structure
97 * @param bbt_erase_shift [INTERN] number of address bits in a bbt entry
98 * @param badblockpos [INTERN] position of the bad block marker in the oob area
99 * @param bbt [INTERN] bad block table pointer
100 * @param badblock_pattern [REPLACEABLE] bad block scan pattern used for initial bad block scan
101 * @param priv [OPTIONAL] pointer to private bbm date
102 */
103struct bbm_info {
104 int bbt_erase_shift;
105 int badblockpos;
106 int options;
107
108 uint8_t *bbt;
109
110 int (*isbad_bbt)(struct mtd_info *mtd, loff_t ofs, int allowbbt);
111
112 /* TODO Add more NAND specific fileds */
113 struct nand_bbt_descr *badblock_pattern;
114
115 void *priv;
116};
117
118/* OneNAND BBT interface */
119extern int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
120extern int onenand_default_bbt(struct mtd_info *mtd);
121
122#endif /* __LINUX_MTD_BBM_H */
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h
index 4ebc2e5a16e2..f46afec6fbf8 100644
--- a/include/linux/mtd/blktrans.h
+++ b/include/linux/mtd/blktrans.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: blktrans.h,v 1.5 2003/06/23 12:00:08 dwmw2 Exp $ 2 * $Id: blktrans.h,v 1.6 2005/11/07 11:14:54 gleixner Exp $
3 * 3 *
4 * (C) 2003 David Woodhouse <dwmw2@infradead.org> 4 * (C) 2003 David Woodhouse <dwmw2@infradead.org>
5 * 5 *
@@ -67,6 +67,6 @@ extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr);
67extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr); 67extern int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr);
68extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); 68extern int add_mtd_blktrans_dev(struct mtd_blktrans_dev *dev);
69extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev); 69extern int del_mtd_blktrans_dev(struct mtd_blktrans_dev *dev);
70 70
71 71
72#endif /* __MTD_TRANS_H__ */ 72#endif /* __MTD_TRANS_H__ */
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index e6b6a1c66bd5..23a568910341 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -1,14 +1,13 @@
1 1
2/* Common Flash Interface structures 2/* Common Flash Interface structures
3 * See http://support.intel.com/design/flash/technote/index.htm 3 * See http://support.intel.com/design/flash/technote/index.htm
4 * $Id: cfi.h,v 1.54 2005/06/06 23:04:36 tpoynor Exp $ 4 * $Id: cfi.h,v 1.57 2005/11/15 23:28:17 tpoynor Exp $
5 */ 5 */
6 6
7#ifndef __MTD_CFI_H__ 7#ifndef __MTD_CFI_H__
8#define __MTD_CFI_H__ 8#define __MTD_CFI_H__
9 9
10#include <linux/config.h> 10#include <linux/config.h>
11#include <linux/version.h>
12#include <linux/delay.h> 11#include <linux/delay.h>
13#include <linux/types.h> 12#include <linux/types.h>
14#include <linux/interrupt.h> 13#include <linux/interrupt.h>
@@ -82,8 +81,8 @@ static inline int cfi_interleave_supported(int i)
82} 81}
83 82
84 83
85/* NB: these values must represents the number of bytes needed to meet the 84/* NB: these values must represents the number of bytes needed to meet the
86 * device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes. 85 * device type (x8, x16, x32). Eg. a 32 bit device is 4 x 8 bytes.
87 * These numbers are used in calculations. 86 * These numbers are used in calculations.
88 */ 87 */
89#define CFI_DEVICETYPE_X8 (8 / 8) 88#define CFI_DEVICETYPE_X8 (8 / 8)
@@ -173,6 +172,15 @@ struct cfi_intelext_regioninfo {
173 struct cfi_intelext_blockinfo BlockTypes[1]; 172 struct cfi_intelext_blockinfo BlockTypes[1];
174} __attribute__((packed)); 173} __attribute__((packed));
175 174
175struct cfi_intelext_programming_regioninfo {
176 uint8_t ProgRegShift;
177 uint8_t Reserved1;
178 uint8_t ControlValid;
179 uint8_t Reserved2;
180 uint8_t ControlInvalid;
181 uint8_t Reserved3;
182} __attribute__((packed));
183
176/* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */ 184/* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */
177 185
178struct cfi_pri_amdstd { 186struct cfi_pri_amdstd {
@@ -250,7 +258,7 @@ static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs, int interleave, int
250/* 258/*
251 * Transforms the CFI command for the given geometry (bus width & interleave). 259 * Transforms the CFI command for the given geometry (bus width & interleave).
252 * It looks too long to be inline, but in the common case it should almost all 260 * It looks too long to be inline, but in the common case it should almost all
253 * get optimised away. 261 * get optimised away.
254 */ 262 */
255static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi) 263static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi)
256{ 264{
@@ -259,7 +267,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
259 unsigned long onecmd; 267 unsigned long onecmd;
260 int i; 268 int i;
261 269
262 /* We do it this way to give the compiler a fighting chance 270 /* We do it this way to give the compiler a fighting chance
263 of optimising away all the crap for 'bankwidth' larger than 271 of optimising away all the crap for 'bankwidth' larger than
264 an unsigned long, in the common case where that support is 272 an unsigned long, in the common case where that support is
265 disabled */ 273 disabled */
@@ -270,7 +278,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
270 wordwidth = map_bankwidth(map); 278 wordwidth = map_bankwidth(map);
271 words_per_bus = 1; 279 words_per_bus = 1;
272 } 280 }
273 281
274 chip_mode = map_bankwidth(map) / cfi_interleave(cfi); 282 chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
275 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); 283 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
276 284
@@ -289,7 +297,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
289 break; 297 break;
290 } 298 }
291 299
292 /* Now replicate it across the size of an unsigned long, or 300 /* Now replicate it across the size of an unsigned long, or
293 just to the bus width as appropriate */ 301 just to the bus width as appropriate */
294 switch (chips_per_word) { 302 switch (chips_per_word) {
295 default: BUG(); 303 default: BUG();
@@ -305,7 +313,7 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
305 ; 313 ;
306 } 314 }
307 315
308 /* And finally, for the multi-word case, replicate it 316 /* And finally, for the multi-word case, replicate it
309 in all words in the structure */ 317 in all words in the structure */
310 for (i=0; i < words_per_bus; i++) { 318 for (i=0; i < words_per_bus; i++) {
311 val.x[i] = onecmd; 319 val.x[i] = onecmd;
@@ -316,14 +324,14 @@ static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cf
316#define CMD(x) cfi_build_cmd((x), map, cfi) 324#define CMD(x) cfi_build_cmd((x), map, cfi)
317 325
318 326
319static inline unsigned char cfi_merge_status(map_word val, struct map_info *map, 327static inline unsigned long cfi_merge_status(map_word val, struct map_info *map,
320 struct cfi_private *cfi) 328 struct cfi_private *cfi)
321{ 329{
322 int wordwidth, words_per_bus, chip_mode, chips_per_word; 330 int wordwidth, words_per_bus, chip_mode, chips_per_word;
323 unsigned long onestat, res = 0; 331 unsigned long onestat, res = 0;
324 int i; 332 int i;
325 333
326 /* We do it this way to give the compiler a fighting chance 334 /* We do it this way to give the compiler a fighting chance
327 of optimising away all the crap for 'bankwidth' larger than 335 of optimising away all the crap for 'bankwidth' larger than
328 an unsigned long, in the common case where that support is 336 an unsigned long, in the common case where that support is
329 disabled */ 337 disabled */
@@ -334,7 +342,7 @@ static inline unsigned char cfi_merge_status(map_word val, struct map_info *map,
334 wordwidth = map_bankwidth(map); 342 wordwidth = map_bankwidth(map);
335 words_per_bus = 1; 343 words_per_bus = 1;
336 } 344 }
337 345
338 chip_mode = map_bankwidth(map) / cfi_interleave(cfi); 346 chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
339 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map); 347 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
340 348
@@ -418,6 +426,22 @@ static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr)
418 } 426 }
419} 427}
420 428
429static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr)
430{
431 map_word val = map_read(map, addr);
432
433 if (map_bankwidth_is_1(map)) {
434 return val.x[0] & 0xff;
435 } else if (map_bankwidth_is_2(map)) {
436 return cfi16_to_cpu(val.x[0]);
437 } else {
438 /* No point in a 64-bit byteswap since that would just be
439 swapping the responses from different chips, and we are
440 only interested in one chip (a representative sample) */
441 return cfi32_to_cpu(val.x[0]);
442 }
443}
444
421static inline void cfi_udelay(int us) 445static inline void cfi_udelay(int us)
422{ 446{
423 if (us >= 1000) { 447 if (us >= 1000) {
diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h
index 953e64fb8ac5..386a52cf8b1b 100644
--- a/include/linux/mtd/doc2000.h
+++ b/include/linux/mtd/doc2000.h
@@ -1,12 +1,12 @@
1/* 1/*
2 * Linux driver for Disk-On-Chip devices 2 * Linux driver for Disk-On-Chip devices
3 * 3 *
4 * Copyright (C) 1999 Machine Vision Holdings, Inc. 4 * Copyright (C) 1999 Machine Vision Holdings, Inc.
5 * Copyright (C) 2001-2003 David Woodhouse <dwmw2@infradead.org> 5 * Copyright (C) 2001-2003 David Woodhouse <dwmw2@infradead.org>
6 * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com> 6 * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com>
7 * Copyright (C) 2002-2003 SnapGear Inc 7 * Copyright (C) 2002-2003 SnapGear Inc
8 * 8 *
9 * $Id: doc2000.h,v 1.24 2005/01/05 12:40:38 dwmw2 Exp $ 9 * $Id: doc2000.h,v 1.25 2005/11/07 11:14:54 gleixner Exp $
10 * 10 *
11 * Released under GPL 11 * Released under GPL
12 */ 12 */
@@ -75,10 +75,10 @@
75#define DoC_Mplus_CtrlConfirm 0x1076 75#define DoC_Mplus_CtrlConfirm 0x1076
76#define DoC_Mplus_Power 0x1fff 76#define DoC_Mplus_Power 0x1fff
77 77
78/* How to access the device? 78/* How to access the device?
79 * On ARM, it'll be mmap'd directly with 32-bit wide accesses. 79 * On ARM, it'll be mmap'd directly with 32-bit wide accesses.
80 * On PPC, it's mmap'd and 16-bit wide. 80 * On PPC, it's mmap'd and 16-bit wide.
81 * Others use readb/writeb 81 * Others use readb/writeb
82 */ 82 */
83#if defined(__arm__) 83#if defined(__arm__)
84#define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)))) 84#define ReadDOC_(adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2))))
@@ -172,7 +172,7 @@ struct DiskOnChip {
172 unsigned long totlen; 172 unsigned long totlen;
173 unsigned char ChipID; /* Type of DiskOnChip */ 173 unsigned char ChipID; /* Type of DiskOnChip */
174 int ioreg; 174 int ioreg;
175 175
176 unsigned long mfr; /* Flash IDs - only one type of flash per device */ 176 unsigned long mfr; /* Flash IDs - only one type of flash per device */
177 unsigned long id; 177 unsigned long id;
178 int chipshift; 178 int chipshift;
@@ -180,10 +180,10 @@ struct DiskOnChip {
180 char pageadrlen; 180 char pageadrlen;
181 char interleave; /* Internal interleaving - Millennium Plus style */ 181 char interleave; /* Internal interleaving - Millennium Plus style */
182 unsigned long erasesize; 182 unsigned long erasesize;
183 183
184 int curfloor; 184 int curfloor;
185 int curchip; 185 int curchip;
186 186
187 int numchips; 187 int numchips;
188 struct Nand *chips; 188 struct Nand *chips;
189 struct mtd_info *nextdoc; 189 struct mtd_info *nextdoc;
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h
index 675776fa3e27..a293a3b78e05 100644
--- a/include/linux/mtd/flashchip.h
+++ b/include/linux/mtd/flashchip.h
@@ -1,12 +1,12 @@
1 1
2/* 2/*
3 * struct flchip definition 3 * struct flchip definition
4 * 4 *
5 * Contains information about the location and state of a given flash device 5 * Contains information about the location and state of a given flash device
6 * 6 *
7 * (C) 2000 Red Hat. GPLd. 7 * (C) 2000 Red Hat. GPLd.
8 * 8 *
9 * $Id: flashchip.h,v 1.17 2005/03/14 18:27:15 bjd Exp $ 9 * $Id: flashchip.h,v 1.18 2005/11/07 11:14:54 gleixner Exp $
10 * 10 *
11 */ 11 */
12 12
@@ -15,11 +15,11 @@
15 15
16/* For spinlocks. sched.h includes spinlock.h from whichever directory it 16/* For spinlocks. sched.h includes spinlock.h from whichever directory it
17 * happens to be in - so we don't have to care whether we're on 2.2, which 17 * happens to be in - so we don't have to care whether we're on 2.2, which
18 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h 18 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h
19 */ 19 */
20#include <linux/sched.h> 20#include <linux/sched.h>
21 21
22typedef enum { 22typedef enum {
23 FL_READY, 23 FL_READY,
24 FL_STATUS, 24 FL_STATUS,
25 FL_CFI_QUERY, 25 FL_CFI_QUERY,
@@ -45,7 +45,7 @@ typedef enum {
45 45
46 46
47 47
48/* NOTE: confusingly, this can be used to refer to more than one chip at a time, 48/* NOTE: confusingly, this can be used to refer to more than one chip at a time,
49 if they're interleaved. This can even refer to individual partitions on 49 if they're interleaved. This can even refer to individual partitions on
50 the same physical chip when present. */ 50 the same physical chip when present. */
51 51
diff --git a/include/linux/mtd/ftl.h b/include/linux/mtd/ftl.h
index 3678459b4535..d99609113307 100644
--- a/include/linux/mtd/ftl.h
+++ b/include/linux/mtd/ftl.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * $Id: ftl.h,v 1.6 2003/01/24 13:20:04 dwmw2 Exp $ 2 * $Id: ftl.h,v 1.7 2005/11/07 11:14:54 gleixner Exp $
3 * 3 *
4 * Derived from (and probably identical to): 4 * Derived from (and probably identical to):
5 * ftl.h 1.7 1999/10/25 20:23:17 5 * ftl.h 1.7 1999/10/25 20:23:17
6 * 6 *
@@ -12,7 +12,7 @@
12 * Software distributed under the License is distributed on an "AS IS" 12 * Software distributed under the License is distributed on an "AS IS"
13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 * the License for the specific language governing rights and 14 * the License for the specific language governing rights and
15 * limitations under the License. 15 * limitations under the License.
16 * 16 *
17 * The initial developer of the original code is David A. Hinds 17 * The initial developer of the original code is David A. Hinds
18 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds 18 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
diff --git a/include/linux/mtd/gen_probe.h b/include/linux/mtd/gen_probe.h
index 3d7bdec14f97..256e7342ed1e 100644
--- a/include/linux/mtd/gen_probe.h
+++ b/include/linux/mtd/gen_probe.h
@@ -1,14 +1,14 @@
1/* 1/*
2 * (C) 2001, 2001 Red Hat, Inc. 2 * (C) 2001, 2001 Red Hat, Inc.
3 * GPL'd 3 * GPL'd
4 * $Id: gen_probe.h,v 1.3 2004/10/20 22:10:33 dwmw2 Exp $ 4 * $Id: gen_probe.h,v 1.4 2005/11/07 11:14:54 gleixner Exp $
5 */ 5 */
6 6
7#ifndef __LINUX_MTD_GEN_PROBE_H__ 7#ifndef __LINUX_MTD_GEN_PROBE_H__
8#define __LINUX_MTD_GEN_PROBE_H__ 8#define __LINUX_MTD_GEN_PROBE_H__
9 9
10#include <linux/mtd/flashchip.h> 10#include <linux/mtd/flashchip.h>
11#include <linux/mtd/map.h> 11#include <linux/mtd/map.h>
12#include <linux/mtd/cfi.h> 12#include <linux/mtd/cfi.h>
13#include <linux/bitops.h> 13#include <linux/bitops.h>
14 14
diff --git a/include/linux/mtd/jedec.h b/include/linux/mtd/jedec.h
index 2ba0f700ddbc..9006feb218b9 100644
--- a/include/linux/mtd/jedec.h
+++ b/include/linux/mtd/jedec.h
@@ -1,13 +1,13 @@
1 1
2/* JEDEC Flash Interface. 2/* JEDEC Flash Interface.
3 * This is an older type of interface for self programming flash. It is 3 * This is an older type of interface for self programming flash. It is
4 * commonly use in older AMD chips and is obsolete compared with CFI. 4 * commonly use in older AMD chips and is obsolete compared with CFI.
5 * It is called JEDEC because the JEDEC association distributes the ID codes 5 * It is called JEDEC because the JEDEC association distributes the ID codes
6 * for the chips. 6 * for the chips.
7 * 7 *
8 * See the AMD flash databook for information on how to operate the interface. 8 * See the AMD flash databook for information on how to operate the interface.
9 * 9 *
10 * $Id: jedec.h,v 1.3 2003/05/21 11:51:01 dwmw2 Exp $ 10 * $Id: jedec.h,v 1.4 2005/11/07 11:14:54 gleixner Exp $
11 */ 11 */
12 12
13#ifndef __LINUX_MTD_JEDEC_H__ 13#ifndef __LINUX_MTD_JEDEC_H__
@@ -33,16 +33,16 @@ struct jedec_flash_chip
33 __u16 jedec; 33 __u16 jedec;
34 unsigned long size; 34 unsigned long size;
35 unsigned long sectorsize; 35 unsigned long sectorsize;
36 36
37 // *(__u8*)(base + (adder << addrshift)) = data << datashift 37 // *(__u8*)(base + (adder << addrshift)) = data << datashift
38 // Address size = size << addrshift 38 // Address size = size << addrshift
39 unsigned long base; // Byte 0 of the flash, will be unaligned 39 unsigned long base; // Byte 0 of the flash, will be unaligned
40 unsigned int datashift; // Useful for 32bit/16bit accesses 40 unsigned int datashift; // Useful for 32bit/16bit accesses
41 unsigned int addrshift; 41 unsigned int addrshift;
42 unsigned long offset; // linerized start. base==offset for unbanked, uninterleaved flash 42 unsigned long offset; // linerized start. base==offset for unbanked, uninterleaved flash
43 43
44 __u32 capabilities; 44 __u32 capabilities;
45 45
46 // These markers are filled in by the flash_chip_scan function 46 // These markers are filled in by the flash_chip_scan function
47 unsigned long start; 47 unsigned long start;
48 unsigned long length; 48 unsigned long length;
@@ -51,16 +51,16 @@ struct jedec_flash_chip
51struct jedec_private 51struct jedec_private
52{ 52{
53 unsigned long size; // Total size of all the devices 53 unsigned long size; // Total size of all the devices
54 54
55 /* Bank handling. If sum(bank_fill) == size then this is linear flash. 55 /* Bank handling. If sum(bank_fill) == size then this is linear flash.
56 Otherwise the mapping has holes in it. bank_fill may be used to 56 Otherwise the mapping has holes in it. bank_fill may be used to
57 find the holes, but in the common symetric case 57 find the holes, but in the common symetric case
58 bank_fill[0] == bank_fill[*], thus addresses may be computed 58 bank_fill[0] == bank_fill[*], thus addresses may be computed
59 mathmatically. bank_fill must be powers of two */ 59 mathmatically. bank_fill must be powers of two */
60 unsigned is_banked; 60 unsigned is_banked;
61 unsigned long bank_fill[MAX_JEDEC_CHIPS]; 61 unsigned long bank_fill[MAX_JEDEC_CHIPS];
62 62
63 struct jedec_flash_chip chips[MAX_JEDEC_CHIPS]; 63 struct jedec_flash_chip chips[MAX_JEDEC_CHIPS];
64}; 64};
65 65
66#endif 66#endif
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 142963f01d29..fedfbc8a287f 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -1,6 +1,6 @@
1 1
2/* Overhauled routines for dealing with different mmap regions of flash */ 2/* Overhauled routines for dealing with different mmap regions of flash */
3/* $Id: map.h,v 1.52 2005/05/25 10:29:41 gleixner Exp $ */ 3/* $Id: map.h,v 1.54 2005/11/07 11:14:54 gleixner Exp $ */
4 4
5#ifndef __LINUX_MTD_MAP_H__ 5#ifndef __LINUX_MTD_MAP_H__
6#define __LINUX_MTD_MAP_H__ 6#define __LINUX_MTD_MAP_H__
@@ -8,7 +8,10 @@
8#include <linux/config.h> 8#include <linux/config.h>
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/list.h> 10#include <linux/list.h>
11#include <linux/string.h>
12
11#include <linux/mtd/compatmac.h> 13#include <linux/mtd/compatmac.h>
14
12#include <asm/unaligned.h> 15#include <asm/unaligned.h>
13#include <asm/system.h> 16#include <asm/system.h>
14#include <asm/io.h> 17#include <asm/io.h>
@@ -167,14 +170,14 @@ typedef union {
167 to a chip probe routine -- either JEDEC or CFI probe or both -- via 170 to a chip probe routine -- either JEDEC or CFI probe or both -- via
168 do_map_probe(). If a chip is recognised, the probe code will invoke the 171 do_map_probe(). If a chip is recognised, the probe code will invoke the
169 appropriate chip driver (if present) and return a struct mtd_info. 172 appropriate chip driver (if present) and return a struct mtd_info.
170 At which point, you fill in the mtd->module with your own module 173 At which point, you fill in the mtd->module with your own module
171 address, and register it with the MTD core code. Or you could partition 174 address, and register it with the MTD core code. Or you could partition
172 it and register the partitions instead, or keep it for your own private 175 it and register the partitions instead, or keep it for your own private
173 use; whatever. 176 use; whatever.
174 177
175 The mtd->priv field will point to the struct map_info, and any further 178 The mtd->priv field will point to the struct map_info, and any further
176 private data required by the chip driver is linked from the 179 private data required by the chip driver is linked from the
177 mtd->priv->fldrv_priv field. This allows the map driver to get at 180 mtd->priv->fldrv_priv field. This allows the map driver to get at
178 the destructor function map->fldrv_destroy() when it's tired 181 the destructor function map->fldrv_destroy() when it's tired
179 of living. 182 of living.
180*/ 183*/
@@ -211,7 +214,7 @@ struct map_info {
211 If there is no cache to care about this can be set to NULL. */ 214 If there is no cache to care about this can be set to NULL. */
212 void (*inval_cache)(struct map_info *, unsigned long, ssize_t); 215 void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
213 216
214 /* set_vpp() must handle being reentered -- enable, enable, disable 217 /* set_vpp() must handle being reentered -- enable, enable, disable
215 must leave it enabled. */ 218 must leave it enabled. */
216 void (*set_vpp)(struct map_info *, int); 219 void (*set_vpp)(struct map_info *, int);
217 220
@@ -350,7 +353,7 @@ static inline map_word map_word_ff(struct map_info *map)
350{ 353{
351 map_word r; 354 map_word r;
352 int i; 355 int i;
353 356
354 if (map_bankwidth(map) < MAP_FF_LIMIT) { 357 if (map_bankwidth(map) < MAP_FF_LIMIT) {
355 int bw = 8 * map_bankwidth(map); 358 int bw = 8 * map_bankwidth(map);
356 r.x[0] = (1 << bw) - 1; 359 r.x[0] = (1 << bw) - 1;
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index c50c3f3927d9..b6f2fdae65c6 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: mtd.h,v 1.59 2005/04/11 10:19:02 gleixner Exp $ 2 * $Id: mtd.h,v 1.61 2005/11/07 11:14:54 gleixner Exp $
3 * 3 *
4 * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. 4 * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al.
5 * 5 *
@@ -14,7 +14,6 @@
14#endif 14#endif
15 15
16#include <linux/config.h> 16#include <linux/config.h>
17#include <linux/version.h>
18#include <linux/types.h> 17#include <linux/types.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <linux/uio.h> 19#include <linux/uio.h>
@@ -72,7 +71,17 @@ struct mtd_info {
72 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) 71 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
73 u_int32_t ecctype; 72 u_int32_t ecctype;
74 u_int32_t eccsize; 73 u_int32_t eccsize;
75 74
75 /*
76 * Reuse some of the above unused fields in the case of NOR flash
77 * with configurable programming regions to avoid modifying the
78 * user visible structure layout/size. Only valid when the
79 * MTD_PROGRAM_REGIONS flag is set.
80 * (Maybe we should have an union for those?)
81 */
82#define MTD_PROGREGION_SIZE(mtd) (mtd)->oobblock
83#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize
84#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype
76 85
77 // Kernel-only stuff starts here. 86 // Kernel-only stuff starts here.
78 char *name; 87 char *name;
@@ -80,13 +89,13 @@ struct mtd_info {
80 89
81 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) 90 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO)
82 struct nand_oobinfo oobinfo; 91 struct nand_oobinfo oobinfo;
83 u_int32_t oobavail; // Number of bytes in OOB area available for fs 92 u_int32_t oobavail; // Number of bytes in OOB area available for fs
84 93
85 /* Data for variable erase regions. If numeraseregions is zero, 94 /* Data for variable erase regions. If numeraseregions is zero,
86 * it means that the whole device has erasesize as given above. 95 * it means that the whole device has erasesize as given above.
87 */ 96 */
88 int numeraseregions; 97 int numeraseregions;
89 struct mtd_erase_region_info *eraseregions; 98 struct mtd_erase_region_info *eraseregions;
90 99
91 /* This really shouldn't be here. It can go away in 2.5 */ 100 /* This really shouldn't be here. It can go away in 2.5 */
92 u_int32_t bank_size; 101 u_int32_t bank_size;
@@ -109,10 +118,10 @@ struct mtd_info {
109 int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 118 int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
110 int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); 119 int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
111 120
112 /* 121 /*
113 * Methods to access the protection register area, present in some 122 * Methods to access the protection register area, present in some
114 * flash devices. The user data is one time programmable but the 123 * flash devices. The user data is one time programmable but the
115 * factory data is read only. 124 * factory data is read only.
116 */ 125 */
117 int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len); 126 int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len);
118 int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 127 int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
@@ -123,14 +132,14 @@ struct mtd_info {
123 132
124 /* kvec-based read/write methods. We need these especially for NAND flash, 133 /* kvec-based read/write methods. We need these especially for NAND flash,
125 with its limited number of write cycles per erase. 134 with its limited number of write cycles per erase.
126 NB: The 'count' parameter is the number of _vectors_, each of 135 NB: The 'count' parameter is the number of _vectors_, each of
127 which contains an (ofs, len) tuple. 136 which contains an (ofs, len) tuple.
128 */ 137 */
129 int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen); 138 int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
130 int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, 139 int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
131 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); 140 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
132 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); 141 int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
133 int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, 142 int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
134 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel); 143 size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
135 144
136 /* Sync */ 145 /* Sync */
@@ -194,7 +203,7 @@ int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
194#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args) 203#define MTD_WRITEECC(mtd, args...) (*(mtd->write_ecc))(mtd, args)
195#define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args) 204#define MTD_READOOB(mtd, args...) (*(mtd->read_oob))(mtd, args)
196#define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args) 205#define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args)
197#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0) 206#define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd); } while (0)
198 207
199 208
200#ifdef CONFIG_MTD_PARTITIONS 209#ifdef CONFIG_MTD_PARTITIONS
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9b5b76217584..da5e67b3fc70 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -5,7 +5,7 @@
5 * Steven J. Hill <sjhill@realitydiluted.com> 5 * Steven J. Hill <sjhill@realitydiluted.com>
6 * Thomas Gleixner <tglx@linutronix.de> 6 * Thomas Gleixner <tglx@linutronix.de>
7 * 7 *
8 * $Id: nand.h,v 1.73 2005/05/31 19:39:17 gleixner Exp $ 8 * $Id: nand.h,v 1.74 2005/09/15 13:58:50 vwool Exp $
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -24,7 +24,7 @@
24 * bat later if I did something naughty. 24 * bat later if I did something naughty.
25 * 10-11-2000 SJH Added private NAND flash structure for driver 25 * 10-11-2000 SJH Added private NAND flash structure for driver
26 * 10-24-2000 SJH Added prototype for 'nand_scan' function 26 * 10-24-2000 SJH Added prototype for 'nand_scan' function
27 * 10-29-2001 TG changed nand_chip structure to support 27 * 10-29-2001 TG changed nand_chip structure to support
28 * hardwarespecific function for accessing control lines 28 * hardwarespecific function for accessing control lines
29 * 02-21-2002 TG added support for different read/write adress and 29 * 02-21-2002 TG added support for different read/write adress and
30 * ready/busy line access function 30 * ready/busy line access function
@@ -36,21 +36,21 @@
36 * CONFIG_MTD_NAND_ECC_JFFS2 is not set 36 * CONFIG_MTD_NAND_ECC_JFFS2 is not set
37 * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC 37 * 08-10-2002 TG extensions to nand_chip structure to support HW-ECC
38 * 38 *
39 * 08-29-2002 tglx nand_chip structure: data_poi for selecting 39 * 08-29-2002 tglx nand_chip structure: data_poi for selecting
40 * internal / fs-driver buffer 40 * internal / fs-driver buffer
41 * support for 6byte/512byte hardware ECC 41 * support for 6byte/512byte hardware ECC
42 * read_ecc, write_ecc extended for different oob-layout 42 * read_ecc, write_ecc extended for different oob-layout
43 * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB, 43 * oob layout selections: NAND_NONE_OOB, NAND_JFFS2_OOB,
44 * NAND_YAFFS_OOB 44 * NAND_YAFFS_OOB
45 * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL 45 * 11-25-2002 tglx Added Manufacturer code FUJITSU, NATIONAL
46 * Split manufacturer and device ID structures 46 * Split manufacturer and device ID structures
47 * 47 *
48 * 02-08-2004 tglx added option field to nand structure for chip anomalities 48 * 02-08-2004 tglx added option field to nand structure for chip anomalities
49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id 49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id
50 * update of nand_chip structure description 50 * update of nand_chip structure description
51 * 01-17-2005 dmarlin added extended commands for AG-AND device and added option 51 * 01-17-2005 dmarlin added extended commands for AG-AND device and added option
52 * for BBT_AUTO_REFRESH. 52 * for BBT_AUTO_REFRESH.
53 * 01-20-2005 dmarlin added optional pointer to hardware specific callback for 53 * 01-20-2005 dmarlin added optional pointer to hardware specific callback for
54 * extra error status checks. 54 * extra error status checks.
55 */ 55 */
56#ifndef __LINUX_MTD_NAND_H 56#ifndef __LINUX_MTD_NAND_H
@@ -120,8 +120,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
120#define NAND_CMD_CACHEDPROG 0x15 120#define NAND_CMD_CACHEDPROG 0x15
121 121
122/* Extended commands for AG-AND device */ 122/* Extended commands for AG-AND device */
123/* 123/*
124 * Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but 124 * Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but
125 * there is no way to distinguish that from NAND_CMD_READ0 125 * there is no way to distinguish that from NAND_CMD_READ0
126 * until the remaining sequence of commands has been completed 126 * until the remaining sequence of commands has been completed
127 * so add a high order bit and mask it off in the command. 127 * so add a high order bit and mask it off in the command.
@@ -145,7 +145,7 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
145#define NAND_STATUS_READY 0x40 145#define NAND_STATUS_READY 0x40
146#define NAND_STATUS_WP 0x80 146#define NAND_STATUS_WP 0x80
147 147
148/* 148/*
149 * Constants for ECC_MODES 149 * Constants for ECC_MODES
150 */ 150 */
151 151
@@ -191,12 +191,12 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
191#define NAND_CACHEPRG 0x00000008 191#define NAND_CACHEPRG 0x00000008
192/* Chip has copy back function */ 192/* Chip has copy back function */
193#define NAND_COPYBACK 0x00000010 193#define NAND_COPYBACK 0x00000010
194/* AND Chip which has 4 banks and a confusing page / block 194/* AND Chip which has 4 banks and a confusing page / block
195 * assignment. See Renesas datasheet for further information */ 195 * assignment. See Renesas datasheet for further information */
196#define NAND_IS_AND 0x00000020 196#define NAND_IS_AND 0x00000020
197/* Chip has a array of 4 pages which can be read without 197/* Chip has a array of 4 pages which can be read without
198 * additional ready /busy waits */ 198 * additional ready /busy waits */
199#define NAND_4PAGE_ARRAY 0x00000040 199#define NAND_4PAGE_ARRAY 0x00000040
200/* Chip requires that BBT is periodically rewritten to prevent 200/* Chip requires that BBT is periodically rewritten to prevent
201 * bits from adjacent blocks from 'leaking' in altering data. 201 * bits from adjacent blocks from 'leaking' in altering data.
202 * This happens with the Renesas AG-AND chips, possibly others. */ 202 * This happens with the Renesas AG-AND chips, possibly others. */
@@ -219,8 +219,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
219/* Use a flash based bad block table. This option is passed to the 219/* Use a flash based bad block table. This option is passed to the
220 * default bad block table function. */ 220 * default bad block table function. */
221#define NAND_USE_FLASH_BBT 0x00010000 221#define NAND_USE_FLASH_BBT 0x00010000
222/* The hw ecc generator provides a syndrome instead a ecc value on read 222/* The hw ecc generator provides a syndrome instead a ecc value on read
223 * This can only work if we have the ecc bytes directly behind the 223 * This can only work if we have the ecc bytes directly behind the
224 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */ 224 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
225#define NAND_HWECC_SYNDROME 0x00020000 225#define NAND_HWECC_SYNDROME 0x00020000
226/* This option skips the bbt scan during initialization. */ 226/* This option skips the bbt scan during initialization. */
@@ -244,6 +244,7 @@ typedef enum {
244 FL_ERASING, 244 FL_ERASING,
245 FL_SYNCING, 245 FL_SYNCING,
246 FL_CACHEDPRG, 246 FL_CACHEDPRG,
247 FL_PM_SUSPENDED,
247} nand_state_t; 248} nand_state_t;
248 249
249/* Keep gcc happy */ 250/* Keep gcc happy */
@@ -251,7 +252,7 @@ struct nand_chip;
251 252
252/** 253/**
253 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices 254 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices
254 * @lock: protection lock 255 * @lock: protection lock
255 * @active: the mtd device which holds the controller currently 256 * @active: the mtd device which holds the controller currently
256 * @wq: wait queue to sleep on if a NAND operation is in progress 257 * @wq: wait queue to sleep on if a NAND operation is in progress
257 * used instead of the per chip wait queue when a hw controller is available 258 * used instead of the per chip wait queue when a hw controller is available
@@ -264,8 +265,8 @@ struct nand_hw_control {
264 265
265/** 266/**
266 * struct nand_chip - NAND Private Flash Chip Data 267 * struct nand_chip - NAND Private Flash Chip Data
267 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device 268 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device
268 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device 269 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device
269 * @read_byte: [REPLACEABLE] read one byte from the chip 270 * @read_byte: [REPLACEABLE] read one byte from the chip
270 * @write_byte: [REPLACEABLE] write one byte to the chip 271 * @write_byte: [REPLACEABLE] write one byte to the chip
271 * @read_word: [REPLACEABLE] read one word from the chip 272 * @read_word: [REPLACEABLE] read one word from the chip
@@ -288,7 +289,7 @@ struct nand_hw_control {
288 * be provided if a hardware ECC is available 289 * be provided if a hardware ECC is available
289 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support 290 * @erase_cmd: [INTERN] erase command write function, selectable due to AND support
290 * @scan_bbt: [REPLACEABLE] function to scan bad block table 291 * @scan_bbt: [REPLACEABLE] function to scan bad block table
291 * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines 292 * @eccmode: [BOARDSPECIFIC] mode of ecc, see defines
292 * @eccsize: [INTERN] databytes used per ecc-calculation 293 * @eccsize: [INTERN] databytes used per ecc-calculation
293 * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step 294 * @eccbytes: [INTERN] number of ecc bytes per ecc-calculation step
294 * @eccsteps: [INTERN] number of ecc calculation steps per page 295 * @eccsteps: [INTERN] number of ecc calculation steps per page
@@ -300,7 +301,7 @@ struct nand_hw_control {
300 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 301 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
301 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry 302 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
302 * @chip_shift: [INTERN] number of address bits in one chip 303 * @chip_shift: [INTERN] number of address bits in one chip
303 * @data_buf: [INTERN] internal buffer for one page + oob 304 * @data_buf: [INTERN] internal buffer for one page + oob
304 * @oob_buf: [INTERN] oob buffer for one eraseblock 305 * @oob_buf: [INTERN] oob buffer for one eraseblock
305 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized 306 * @oobdirty: [INTERN] indicates that oob_buf must be reinitialized
306 * @data_poi: [INTERN] pointer to a data buffer 307 * @data_poi: [INTERN] pointer to a data buffer
@@ -315,22 +316,22 @@ struct nand_hw_control {
315 * @bbt: [INTERN] bad block table pointer 316 * @bbt: [INTERN] bad block table pointer
316 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup 317 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash lookup
317 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor 318 * @bbt_md: [REPLACEABLE] bad block table mirror descriptor
318 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan 319 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan
319 * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices 320 * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices
320 * @priv: [OPTIONAL] pointer to private chip date 321 * @priv: [OPTIONAL] pointer to private chip date
321 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 322 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
322 * (determine if errors are correctable) 323 * (determine if errors are correctable)
323 */ 324 */
324 325
325struct nand_chip { 326struct nand_chip {
326 void __iomem *IO_ADDR_R; 327 void __iomem *IO_ADDR_R;
327 void __iomem *IO_ADDR_W; 328 void __iomem *IO_ADDR_W;
328 329
329 u_char (*read_byte)(struct mtd_info *mtd); 330 u_char (*read_byte)(struct mtd_info *mtd);
330 void (*write_byte)(struct mtd_info *mtd, u_char byte); 331 void (*write_byte)(struct mtd_info *mtd, u_char byte);
331 u16 (*read_word)(struct mtd_info *mtd); 332 u16 (*read_word)(struct mtd_info *mtd);
332 void (*write_word)(struct mtd_info *mtd, u16 word); 333 void (*write_word)(struct mtd_info *mtd, u16 word);
333 334
334 void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); 335 void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len);
335 void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len); 336 void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len);
336 int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len); 337 int (*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len);
@@ -395,7 +396,7 @@ struct nand_chip {
395 * @name: Identify the device type 396 * @name: Identify the device type
396 * @id: device ID code 397 * @id: device ID code
397 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0 398 * @pagesize: Pagesize in bytes. Either 256 or 512 or 0
398 * If the pagesize is 0, then the real pagesize 399 * If the pagesize is 0, then the real pagesize
399 * and the eraseize are determined from the 400 * and the eraseize are determined from the
400 * extended id bytes in the chip 401 * extended id bytes in the chip
401 * @erasesize: Size of an erase block in the flash device. 402 * @erasesize: Size of an erase block in the flash device.
@@ -424,7 +425,7 @@ struct nand_manufacturers {
424extern struct nand_flash_dev nand_flash_ids[]; 425extern struct nand_flash_dev nand_flash_ids[];
425extern struct nand_manufacturers nand_manuf_ids[]; 426extern struct nand_manufacturers nand_manuf_ids[];
426 427
427/** 428/**
428 * struct nand_bbt_descr - bad block table descriptor 429 * struct nand_bbt_descr - bad block table descriptor
429 * @options: options for this descriptor 430 * @options: options for this descriptor
430 * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE 431 * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE
@@ -435,14 +436,14 @@ extern struct nand_manufacturers nand_manuf_ids[];
435 * @version: version read from the bbt page during scan 436 * @version: version read from the bbt page during scan
436 * @len: length of the pattern, if 0 no pattern check is performed 437 * @len: length of the pattern, if 0 no pattern check is performed
437 * @maxblocks: maximum number of blocks to search for a bbt. This number of 438 * @maxblocks: maximum number of blocks to search for a bbt. This number of
438 * blocks is reserved at the end of the device where the tables are 439 * blocks is reserved at the end of the device where the tables are
439 * written. 440 * written.
440 * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than 441 * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than
441 * bad) block in the stored bbt 442 * bad) block in the stored bbt
442 * @pattern: pattern to identify bad block table or factory marked good / 443 * @pattern: pattern to identify bad block table or factory marked good /
443 * bad blocks, can be NULL, if len = 0 444 * bad blocks, can be NULL, if len = 0
444 * 445 *
445 * Descriptor for the bad block table marker and the descriptor for the 446 * Descriptor for the bad block table marker and the descriptor for the
446 * pattern which identifies good and bad blocks. The assumption is made 447 * pattern which identifies good and bad blocks. The assumption is made
447 * that the pattern and the version count are always located in the oob area 448 * that the pattern and the version count are always located in the oob area
448 * of the first block. 449 * of the first block.
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
new file mode 100644
index 000000000000..f1fd4215686a
--- /dev/null
+++ b/include/linux/mtd/onenand.h
@@ -0,0 +1,155 @@
1/*
2 * linux/include/linux/mtd/onenand.h
3 *
4 * Copyright (C) 2005 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com>
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 version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_MTD_ONENAND_H
13#define __LINUX_MTD_ONENAND_H
14
15#include <linux/spinlock.h>
16#include <linux/mtd/onenand_regs.h>
17#include <linux/mtd/bbm.h>
18
19#define MAX_BUFFERRAM 2
20#define MAX_ONENAND_PAGESIZE (2048 + 64)
21
22/* Scan and identify a OneNAND device */
23extern int onenand_scan(struct mtd_info *mtd, int max_chips);
24/* Free resources held by the OneNAND device */
25extern void onenand_release(struct mtd_info *mtd);
26
27/**
28 * onenand_state_t - chip states
29 * Enumeration for OneNAND flash chip state
30 */
31typedef enum {
32 FL_READY,
33 FL_READING,
34 FL_WRITING,
35 FL_ERASING,
36 FL_SYNCING,
37 FL_UNLOCKING,
38 FL_LOCKING,
39 FL_PM_SUSPENDED,
40} onenand_state_t;
41
42/**
43 * struct onenand_bufferram - OneNAND BufferRAM Data
44 * @param block block address in BufferRAM
45 * @param page page address in BufferRAM
46 * @param valid valid flag
47 */
48struct onenand_bufferram {
49 int block;
50 int page;
51 int valid;
52};
53
54/**
55 * struct onenand_chip - OneNAND Private Flash Chip Data
56 * @param base [BOARDSPECIFIC] address to access OneNAND
57 * @param chipsize [INTERN] the size of one chip for multichip arrays
58 * @param device_id [INTERN] device ID
59 * @param verstion_id [INTERN] version ID
60 * @param options [BOARDSPECIFIC] various chip options. They can partly be set to inform onenand_scan about
61 * @param erase_shift [INTERN] number of address bits in a block
62 * @param page_shift [INTERN] number of address bits in a page
63 * @param ppb_shift [INTERN] number of address bits in a pages per block
64 * @param page_mask [INTERN] a page per block mask
65 * @param bufferam_index [INTERN] BufferRAM index
66 * @param bufferam [INTERN] BufferRAM info
67 * @param readw [REPLACEABLE] hardware specific function for read short
68 * @param writew [REPLACEABLE] hardware specific function for write short
69 * @param command [REPLACEABLE] hardware specific function for writing commands to the chip
70 * @param wait [REPLACEABLE] hardware specific function for wait on ready
71 * @param read_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area
72 * @param write_bufferram [REPLACEABLE] hardware specific function for BufferRAM Area
73 * @param read_word [REPLACEABLE] hardware specific function for read register of OneNAND
74 * @param write_word [REPLACEABLE] hardware specific function for write register of OneNAND
75 * @param scan_bbt [REPLACEALBE] hardware specific function for scaning Bad block Table
76 * @param chip_lock [INTERN] spinlock used to protect access to this structure and the chip
77 * @param wq [INTERN] wait queue to sleep on if a OneNAND operation is in progress
78 * @param state [INTERN] the current state of the OneNAND device
79 * @param autooob [REPLACEABLE] the default (auto)placement scheme
80 * @param bbm [REPLACEABLE] pointer to Bad Block Management
81 * @param priv [OPTIONAL] pointer to private chip date
82 */
83struct onenand_chip {
84 void __iomem *base;
85 unsigned int chipsize;
86 unsigned int device_id;
87 unsigned int density_mask;
88 unsigned int options;
89
90 unsigned int erase_shift;
91 unsigned int page_shift;
92 unsigned int ppb_shift; /* Pages per block shift */
93 unsigned int page_mask;
94
95 unsigned int bufferram_index;
96 struct onenand_bufferram bufferram[MAX_BUFFERRAM];
97
98 int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len);
99 int (*wait)(struct mtd_info *mtd, int state);
100 int (*read_bufferram)(struct mtd_info *mtd, int area,
101 unsigned char *buffer, int offset, size_t count);
102 int (*write_bufferram)(struct mtd_info *mtd, int area,
103 const unsigned char *buffer, int offset, size_t count);
104 unsigned short (*read_word)(void __iomem *addr);
105 void (*write_word)(unsigned short value, void __iomem *addr);
106 void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
107 int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
108 int (*scan_bbt)(struct mtd_info *mtd);
109
110 spinlock_t chip_lock;
111 wait_queue_head_t wq;
112 onenand_state_t state;
113
114 struct nand_oobinfo *autooob;
115
116 void *bbm;
117
118 void *priv;
119};
120
121/*
122 * Helper macros
123 */
124#define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index)
125#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
126#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
127
128#define ONENAND_GET_SYS_CFG1(this) \
129 (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
130#define ONENAND_SET_SYS_CFG1(v, this) \
131 (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1))
132
133/*
134 * Options bits
135 */
136#define ONENAND_CONT_LOCK (0x0001)
137
138
139/*
140 * OneNAND Flash Manufacturer ID Codes
141 */
142#define ONENAND_MFR_SAMSUNG 0xec
143#define ONENAND_MFR_UNKNOWN 0x00
144
145/**
146 * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
147 * @param name: Manufacturer name
148 * @param id: manufacturer ID code of device.
149*/
150struct onenand_manufacturers {
151 int id;
152 char *name;
153};
154
155#endif /* __LINUX_MTD_ONENAND_H */
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
new file mode 100644
index 000000000000..d7832ef8ed63
--- /dev/null
+++ b/include/linux/mtd/onenand_regs.h
@@ -0,0 +1,180 @@
1/*
2 * linux/include/linux/mtd/onenand_regs.h
3 *
4 * OneNAND Register header file
5 *
6 * Copyright (C) 2005 Samsung Electronics
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 version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ONENAND_REG_H
14#define __ONENAND_REG_H
15
16/* Memory Address Map Translation (Word order) */
17#define ONENAND_MEMORY_MAP(x) ((x) << 1)
18
19/*
20 * External BufferRAM area
21 */
22#define ONENAND_BOOTRAM ONENAND_MEMORY_MAP(0x0000)
23#define ONENAND_DATARAM ONENAND_MEMORY_MAP(0x0200)
24#define ONENAND_SPARERAM ONENAND_MEMORY_MAP(0x8010)
25
26/*
27 * OneNAND Registers
28 */
29#define ONENAND_REG_MANUFACTURER_ID ONENAND_MEMORY_MAP(0xF000)
30#define ONENAND_REG_DEVICE_ID ONENAND_MEMORY_MAP(0xF001)
31#define ONENAND_REG_VERSION_ID ONENAND_MEMORY_MAP(0xF002)
32#define ONENAND_REG_DATA_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF003)
33#define ONENAND_REG_BOOT_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF004)
34#define ONENAND_REG_NUM_BUFFERS ONENAND_MEMORY_MAP(0xF005)
35#define ONENAND_REG_TECHNOLOGY ONENAND_MEMORY_MAP(0xF006)
36
37#define ONENAND_REG_START_ADDRESS1 ONENAND_MEMORY_MAP(0xF100)
38#define ONENAND_REG_START_ADDRESS2 ONENAND_MEMORY_MAP(0xF101)
39#define ONENAND_REG_START_ADDRESS3 ONENAND_MEMORY_MAP(0xF102)
40#define ONENAND_REG_START_ADDRESS4 ONENAND_MEMORY_MAP(0xF103)
41#define ONENAND_REG_START_ADDRESS5 ONENAND_MEMORY_MAP(0xF104)
42#define ONENAND_REG_START_ADDRESS6 ONENAND_MEMORY_MAP(0xF105)
43#define ONENAND_REG_START_ADDRESS7 ONENAND_MEMORY_MAP(0xF106)
44#define ONENAND_REG_START_ADDRESS8 ONENAND_MEMORY_MAP(0xF107)
45
46#define ONENAND_REG_START_BUFFER ONENAND_MEMORY_MAP(0xF200)
47#define ONENAND_REG_COMMAND ONENAND_MEMORY_MAP(0xF220)
48#define ONENAND_REG_SYS_CFG1 ONENAND_MEMORY_MAP(0xF221)
49#define ONENAND_REG_SYS_CFG2 ONENAND_MEMORY_MAP(0xF222)
50#define ONENAND_REG_CTRL_STATUS ONENAND_MEMORY_MAP(0xF240)
51#define ONENAND_REG_INTERRUPT ONENAND_MEMORY_MAP(0xF241)
52#define ONENAND_REG_START_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24C)
53#define ONENAND_REG_END_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24D)
54#define ONENAND_REG_WP_STATUS ONENAND_MEMORY_MAP(0xF24E)
55
56#define ONENAND_REG_ECC_STATUS ONENAND_MEMORY_MAP(0xFF00)
57#define ONENAND_REG_ECC_M0 ONENAND_MEMORY_MAP(0xFF01)
58#define ONENAND_REG_ECC_S0 ONENAND_MEMORY_MAP(0xFF02)
59#define ONENAND_REG_ECC_M1 ONENAND_MEMORY_MAP(0xFF03)
60#define ONENAND_REG_ECC_S1 ONENAND_MEMORY_MAP(0xFF04)
61#define ONENAND_REG_ECC_M2 ONENAND_MEMORY_MAP(0xFF05)
62#define ONENAND_REG_ECC_S2 ONENAND_MEMORY_MAP(0xFF06)
63#define ONENAND_REG_ECC_M3 ONENAND_MEMORY_MAP(0xFF07)
64#define ONENAND_REG_ECC_S3 ONENAND_MEMORY_MAP(0xFF08)
65
66/*
67 * Device ID Register F001h (R)
68 */
69#define ONENAND_DEVICE_DENSITY_SHIFT (4)
70#define ONENAND_DEVICE_IS_DDP (1 << 3)
71#define ONENAND_DEVICE_IS_DEMUX (1 << 2)
72#define ONENAND_DEVICE_VCC_MASK (0x3)
73
74#define ONENAND_DEVICE_DENSITY_512Mb (0x002)
75
76/*
77 * Version ID Register F002h (R)
78 */
79#define ONENAND_VERSION_PROCESS_SHIFT (8)
80
81/*
82 * Start Address 1 F100h (R/W)
83 */
84#define ONENAND_DDP_SHIFT (15)
85
86/*
87 * Start Address 8 F107h (R/W)
88 */
89#define ONENAND_FPA_MASK (0x3f)
90#define ONENAND_FPA_SHIFT (2)
91#define ONENAND_FSA_MASK (0x03)
92
93/*
94 * Start Buffer Register F200h (R/W)
95 */
96#define ONENAND_BSA_MASK (0x03)
97#define ONENAND_BSA_SHIFT (8)
98#define ONENAND_BSA_BOOTRAM (0 << 2)
99#define ONENAND_BSA_DATARAM0 (2 << 2)
100#define ONENAND_BSA_DATARAM1 (3 << 2)
101#define ONENAND_BSC_MASK (0x03)
102
103/*
104 * Command Register F220h (R/W)
105 */
106#define ONENAND_CMD_READ (0x00)
107#define ONENAND_CMD_READOOB (0x13)
108#define ONENAND_CMD_PROG (0x80)
109#define ONENAND_CMD_PROGOOB (0x1A)
110#define ONENAND_CMD_UNLOCK (0x23)
111#define ONENAND_CMD_LOCK (0x2A)
112#define ONENAND_CMD_LOCK_TIGHT (0x2C)
113#define ONENAND_CMD_ERASE (0x94)
114#define ONENAND_CMD_RESET (0xF0)
115#define ONENAND_CMD_READID (0x90)
116
117/* NOTE: Those are not *REAL* commands */
118#define ONENAND_CMD_BUFFERRAM (0x1978)
119
120/*
121 * System Configuration 1 Register F221h (R, R/W)
122 */
123#define ONENAND_SYS_CFG1_SYNC_READ (1 << 15)
124#define ONENAND_SYS_CFG1_BRL_7 (7 << 12)
125#define ONENAND_SYS_CFG1_BRL_6 (6 << 12)
126#define ONENAND_SYS_CFG1_BRL_5 (5 << 12)
127#define ONENAND_SYS_CFG1_BRL_4 (4 << 12)
128#define ONENAND_SYS_CFG1_BRL_3 (3 << 12)
129#define ONENAND_SYS_CFG1_BRL_10 (2 << 12)
130#define ONENAND_SYS_CFG1_BRL_9 (1 << 12)
131#define ONENAND_SYS_CFG1_BRL_8 (0 << 12)
132#define ONENAND_SYS_CFG1_BRL_SHIFT (12)
133#define ONENAND_SYS_CFG1_BL_32 (4 << 9)
134#define ONENAND_SYS_CFG1_BL_16 (3 << 9)
135#define ONENAND_SYS_CFG1_BL_8 (2 << 9)
136#define ONENAND_SYS_CFG1_BL_4 (1 << 9)
137#define ONENAND_SYS_CFG1_BL_CONT (0 << 9)
138#define ONENAND_SYS_CFG1_BL_SHIFT (9)
139#define ONENAND_SYS_CFG1_NO_ECC (1 << 8)
140#define ONENAND_SYS_CFG1_RDY (1 << 7)
141#define ONENAND_SYS_CFG1_INT (1 << 6)
142#define ONENAND_SYS_CFG1_IOBE (1 << 5)
143#define ONENAND_SYS_CFG1_RDY_CONF (1 << 4)
144
145/*
146 * Controller Status Register F240h (R)
147 */
148#define ONENAND_CTRL_ONGO (1 << 15)
149#define ONENAND_CTRL_LOCK (1 << 14)
150#define ONENAND_CTRL_LOAD (1 << 13)
151#define ONENAND_CTRL_PROGRAM (1 << 12)
152#define ONENAND_CTRL_ERASE (1 << 11)
153#define ONENAND_CTRL_ERROR (1 << 10)
154#define ONENAND_CTRL_RSTB (1 << 7)
155
156/*
157 * Interrupt Status Register F241h (R)
158 */
159#define ONENAND_INT_MASTER (1 << 15)
160#define ONENAND_INT_READ (1 << 7)
161#define ONENAND_INT_WRITE (1 << 6)
162#define ONENAND_INT_ERASE (1 << 5)
163#define ONENAND_INT_RESET (1 << 4)
164#define ONENAND_INT_CLEAR (0 << 0)
165
166/*
167 * NAND Flash Write Protection Status Register F24Eh (R)
168 */
169#define ONENAND_WP_US (1 << 2)
170#define ONENAND_WP_LS (1 << 1)
171#define ONENAND_WP_LTS (1 << 0)
172
173/*
174 * ECC Status Reigser FF00h (R)
175 */
176#define ONENAND_ECC_1BIT (1 << 0)
177#define ONENAND_ECC_2BIT (1 << 1)
178#define ONENAND_ECC_2BIT_ALL (0xAAAA)
179
180#endif /* __ONENAND_REG_H */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 50b2edfc8f11..b03f512d51b9 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * This code is GPL 6 * This code is GPL
7 * 7 *
8 * $Id: partitions.h,v 1.16 2004/11/16 18:34:40 dwmw2 Exp $ 8 * $Id: partitions.h,v 1.17 2005/11/07 11:14:55 gleixner Exp $
9 */ 9 */
10 10
11#ifndef MTD_PARTITIONS_H 11#ifndef MTD_PARTITIONS_H
@@ -16,25 +16,25 @@
16 16
17/* 17/*
18 * Partition definition structure: 18 * Partition definition structure:
19 * 19 *
20 * An array of struct partition is passed along with a MTD object to 20 * An array of struct partition is passed along with a MTD object to
21 * add_mtd_partitions() to create them. 21 * add_mtd_partitions() to create them.
22 * 22 *
23 * For each partition, these fields are available: 23 * For each partition, these fields are available:
24 * name: string that will be used to label the partition's MTD device. 24 * name: string that will be used to label the partition's MTD device.
25 * size: the partition size; if defined as MTDPART_SIZ_FULL, the partition 25 * size: the partition size; if defined as MTDPART_SIZ_FULL, the partition
26 * will extend to the end of the master MTD device. 26 * will extend to the end of the master MTD device.
27 * offset: absolute starting position within the master MTD device; if 27 * offset: absolute starting position within the master MTD device; if
28 * defined as MTDPART_OFS_APPEND, the partition will start where the 28 * defined as MTDPART_OFS_APPEND, the partition will start where the
29 * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block. 29 * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block.
30 * mask_flags: contains flags that have to be masked (removed) from the 30 * mask_flags: contains flags that have to be masked (removed) from the
31 * master MTD flag set for the corresponding MTD partition. 31 * master MTD flag set for the corresponding MTD partition.
32 * For example, to force a read-only partition, simply adding 32 * For example, to force a read-only partition, simply adding
33 * MTD_WRITEABLE to the mask_flags will do the trick. 33 * MTD_WRITEABLE to the mask_flags will do the trick.
34 * 34 *
35 * Note: writeable partitions require their size and offset be 35 * Note: writeable partitions require their size and offset be
36 * erasesize aligned (e.g. use MTDPART_OFS_NEXTBLK). 36 * erasesize aligned (e.g. use MTDPART_OFS_NEXTBLK).
37 */ 37 */
38 38
39struct mtd_partition { 39struct mtd_partition {
40 char *name; /* identifier string */ 40 char *name; /* identifier string */
@@ -66,7 +66,7 @@ struct mtd_part_parser {
66 66
67extern int register_mtd_parser(struct mtd_part_parser *parser); 67extern int register_mtd_parser(struct mtd_part_parser *parser);
68extern int deregister_mtd_parser(struct mtd_part_parser *parser); 68extern int deregister_mtd_parser(struct mtd_part_parser *parser);
69extern int parse_mtd_partitions(struct mtd_info *master, const char **types, 69extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
70 struct mtd_partition **pparts, unsigned long origin); 70 struct mtd_partition **pparts, unsigned long origin);
71 71
72#define put_partition_parser(p) do { module_put((p)->owner); } while(0) 72#define put_partition_parser(p) do { module_put((p)->owner); } while(0)
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index 05aa4970677f..c7b8bcdef013 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * For boards with physically mapped flash and using 2 * For boards with physically mapped flash and using
3 * drivers/mtd/maps/physmap.c mapping driver. 3 * drivers/mtd/maps/physmap.c mapping driver.
4 * 4 *
5 * $Id: physmap.h,v 1.3 2004/07/21 00:16:15 jwboyer Exp $ 5 * $Id: physmap.h,v 1.4 2005/11/07 11:14:55 gleixner Exp $
6 * 6 *
7 * Copyright (C) 2003 MontaVista Software Inc. 7 * Copyright (C) 2003 MontaVista Software Inc.
8 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net 8 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
@@ -18,7 +18,7 @@
18 18
19#include <linux/config.h> 19#include <linux/config.h>
20 20
21#if defined(CONFIG_MTD_PHYSMAP) 21#if defined(CONFIG_MTD_PHYSMAP)
22 22
23#include <linux/mtd/mtd.h> 23#include <linux/mtd/mtd.h>
24#include <linux/mtd/map.h> 24#include <linux/mtd/map.h>
@@ -44,12 +44,12 @@ static inline void physmap_configure(unsigned long addr, unsigned long size, int
44#if defined(CONFIG_MTD_PARTITIONS) 44#if defined(CONFIG_MTD_PARTITIONS)
45 45
46/* 46/*
47 * Machines that wish to do flash partition may want to call this function in 47 * Machines that wish to do flash partition may want to call this function in
48 * their setup routine. 48 * their setup routine.
49 * 49 *
50 * physmap_set_partitions(mypartitions, num_parts); 50 * physmap_set_partitions(mypartitions, num_parts);
51 * 51 *
52 * Note that one can always override this hard-coded partition with 52 * Note that one can always override this hard-coded partition with
53 * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS). 53 * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS).
54 */ 54 */
55void physmap_set_partitions(struct mtd_partition *parts, int num_parts); 55void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
diff --git a/include/linux/mtd/pmc551.h b/include/linux/mtd/pmc551.h
index 113e3087f68a..a7f6d20ad407 100644
--- a/include/linux/mtd/pmc551.h
+++ b/include/linux/mtd/pmc551.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: pmc551.h,v 1.5 2003/01/24 16:49:53 dwmw2 Exp $ 2 * $Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $
3 * 3 *
4 * PMC551 PCI Mezzanine Ram Device 4 * PMC551 PCI Mezzanine Ram Device
5 * 5 *
@@ -7,7 +7,7 @@
7 * Mark Ferrell 7 * Mark Ferrell
8 * Copyright 1999,2000 Nortel Networks 8 * Copyright 1999,2000 Nortel Networks
9 * 9 *
10 * License: 10 * License:
11 * As part of this driver was derrived from the slram.c driver it falls 11 * As part of this driver was derrived from the slram.c driver it falls
12 * under the same license, which is GNU General Public License v2 12 * under the same license, which is GNU General Public License v2
13 */ 13 */
@@ -17,7 +17,7 @@
17 17
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19 19
20#define PMC551_VERSION "$Id: pmc551.h,v 1.5 2003/01/24 16:49:53 dwmw2 Exp $\n"\ 20#define PMC551_VERSION "$Id: pmc551.h,v 1.6 2005/11/07 11:14:55 gleixner Exp $\n"\
21 "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n" 21 "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n"
22 22
23/* 23/*
@@ -30,7 +30,7 @@ struct mypriv {
30 u32 curr_map0; 30 u32 curr_map0;
31 u32 asize; 31 u32 asize;
32 struct mtd_info *nextpmc551; 32 struct mtd_info *nextpmc551;
33}; 33};
34 34
35/* 35/*
36 * Function Prototypes 36 * Function Prototypes
@@ -39,7 +39,7 @@ static int pmc551_erase(struct mtd_info *, struct erase_info *);
39static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t); 39static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t);
40static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf); 40static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf);
41static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *); 41static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *);
42static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); 42static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
43 43
44 44
45/* 45/*
@@ -50,7 +50,7 @@ static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_cha
50#endif 50#endif
51 51
52#ifndef PCI_DEVICE_ID_V3_SEMI_V370PDC 52#ifndef PCI_DEVICE_ID_V3_SEMI_V370PDC
53#define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200 53#define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200
54#endif 54#endif
55 55
56 56
diff --git a/include/linux/mtd/xip.h b/include/linux/mtd/xip.h
index 7b7deef6b180..220d50bb71cd 100644
--- a/include/linux/mtd/xip.h
+++ b/include/linux/mtd/xip.h
@@ -12,7 +12,7 @@
12 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
14 * 14 *
15 * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $ 15 * $Id: xip.h,v 1.5 2005/11/07 11:14:55 gleixner Exp $
16 */ 16 */
17 17
18#ifndef __LINUX_MTD_XIP_H__ 18#ifndef __LINUX_MTD_XIP_H__
@@ -23,19 +23,19 @@
23#ifdef CONFIG_MTD_XIP 23#ifdef CONFIG_MTD_XIP
24 24
25/* 25/*
26 * Function that are modifying the flash state away from array mode must
27 * obviously not be running from flash. The __xipram is therefore marking
28 * those functions so they get relocated to ram.
29 */
30#define __xipram __attribute__ ((__section__ (".data")))
31
32/*
33 * We really don't want gcc to guess anything. 26 * We really don't want gcc to guess anything.
34 * We absolutely _need_ proper inlining. 27 * We absolutely _need_ proper inlining.
35 */ 28 */
36#include <linux/compiler.h> 29#include <linux/compiler.h>
37 30
38/* 31/*
32 * Function that are modifying the flash state away from array mode must
33 * obviously not be running from flash. The __xipram is therefore marking
34 * those functions so they get relocated to ram.
35 */
36#define __xipram noinline __attribute__ ((__section__ (".data")))
37
38/*
39 * Each architecture has to provide the following macros. They must access 39 * Each architecture has to provide the following macros. They must access
40 * the hardware directly and not rely on any other (XIP) functions since they 40 * the hardware directly and not rely on any other (XIP) functions since they
41 * won't be available when used (flash not in array mode). 41 * won't be available when used (flash not in array mode).
@@ -60,9 +60,9 @@
60 * overflowing. 60 * overflowing.
61 * 61 *
62 * xip_iprefetch() 62 * xip_iprefetch()
63 * 63 *
64 * Macro to fill instruction prefetch 64 * Macro to fill instruction prefetch
65 * e.g. a series of nops: asm volatile (".rep 8; nop; .endr"); 65 * e.g. a series of nops: asm volatile (".rep 8; nop; .endr");
66 */ 66 */
67 67
68#include <asm/mtd-xip.h> 68#include <asm/mtd-xip.h>
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 7db67b008cac..455660eafba9 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -8,6 +8,7 @@ struct vfsmount;
8struct open_intent { 8struct open_intent {
9 int flags; 9 int flags;
10 int create_mode; 10 int create_mode;
11 struct file *file;
11}; 12};
12 13
13enum { MAX_NESTED_LINKS = 5 }; 14enum { MAX_NESTED_LINKS = 5 };
@@ -65,8 +66,15 @@ extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
65extern void path_release(struct nameidata *); 66extern void path_release(struct nameidata *);
66extern void path_release_on_umount(struct nameidata *); 67extern void path_release_on_umount(struct nameidata *);
67 68
69extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags);
70extern int path_lookup_open(const char *, unsigned lookup_flags, struct nameidata *, int open_flags);
71extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
72 int (*open)(struct inode *, struct file *));
73extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
74extern void release_open_intent(struct nameidata *);
75
68extern struct dentry * lookup_one_len(const char *, struct dentry *, int); 76extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
69extern struct dentry * lookup_hash(struct qstr *, struct dentry *); 77extern struct dentry * lookup_hash(struct nameidata *);
70 78
71extern int follow_down(struct vfsmount **, struct dentry **); 79extern int follow_down(struct vfsmount **, struct dentry **);
72extern int follow_up(struct vfsmount **, struct dentry **); 80extern int follow_up(struct vfsmount **, struct dentry **);
diff --git a/include/linux/namespace.h b/include/linux/namespace.h
index 0e5a86f13b2f..6731977c4c13 100644
--- a/include/linux/namespace.h
+++ b/include/linux/namespace.h
@@ -9,7 +9,8 @@ struct namespace {
9 atomic_t count; 9 atomic_t count;
10 struct vfsmount * root; 10 struct vfsmount * root;
11 struct list_head list; 11 struct list_head list;
12 struct rw_semaphore sem; 12 wait_queue_head_t poll;
13 int event;
13}; 14};
14 15
15extern int copy_namespace(int, struct task_struct *); 16extern int copy_namespace(int, struct task_struct *);
diff --git a/include/linux/net.h b/include/linux/net.h
index 4e981585a89a..d6a41e6577f6 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -71,6 +71,7 @@ typedef enum {
71 * @SOCK_RAW: raw socket 71 * @SOCK_RAW: raw socket
72 * @SOCK_RDM: reliably-delivered message 72 * @SOCK_RDM: reliably-delivered message
73 * @SOCK_SEQPACKET: sequential packet socket 73 * @SOCK_SEQPACKET: sequential packet socket
74 * @SOCK_DCCP: Datagram Congestion Control Protocol socket
74 * @SOCK_PACKET: linux specific way of getting packets at the dev level. 75 * @SOCK_PACKET: linux specific way of getting packets at the dev level.
75 * For writing rarp and other similar things on the user level. 76 * For writing rarp and other similar things on the user level.
76 * 77 *
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 7c717907896d..936f8b76114e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -265,6 +265,8 @@ struct net_device
265 * the interface. 265 * the interface.
266 */ 266 */
267 char name[IFNAMSIZ]; 267 char name[IFNAMSIZ];
268 /* device name hash chain */
269 struct hlist_node name_hlist;
268 270
269 /* 271 /*
270 * I/O specific fields 272 * I/O specific fields
@@ -292,6 +294,22 @@ struct net_device
292 294
293 /* ------- Fields preinitialized in Space.c finish here ------- */ 295 /* ------- Fields preinitialized in Space.c finish here ------- */
294 296
297 /* Net device features */
298 unsigned long features;
299#define NETIF_F_SG 1 /* Scatter/gather IO. */
300#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */
301#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
302#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */
303#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */
304#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */
305#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
306#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
307#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
308#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
309#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */
310#define NETIF_F_LLTX 4096 /* LockLess TX */
311#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/
312
295 struct net_device *next_sched; 313 struct net_device *next_sched;
296 314
297 /* Interface index. Unique device identifier */ 315 /* Interface index. Unique device identifier */
@@ -316,9 +334,6 @@ struct net_device
316 * will (read: may be cleaned up at will). 334 * will (read: may be cleaned up at will).
317 */ 335 */
318 336
319 /* These may be needed for future network-power-down code. */
320 unsigned long trans_start; /* Time (in jiffies) of last Tx */
321 unsigned long last_rx; /* Time of last Rx */
322 337
323 unsigned short flags; /* interface flags (a la BSD) */ 338 unsigned short flags; /* interface flags (a la BSD) */
324 unsigned short gflags; 339 unsigned short gflags;
@@ -328,15 +343,12 @@ struct net_device
328 unsigned mtu; /* interface MTU value */ 343 unsigned mtu; /* interface MTU value */
329 unsigned short type; /* interface hardware type */ 344 unsigned short type; /* interface hardware type */
330 unsigned short hard_header_len; /* hardware hdr length */ 345 unsigned short hard_header_len; /* hardware hdr length */
331 void *priv; /* pointer to private data */
332 346
333 struct net_device *master; /* Pointer to master device of a group, 347 struct net_device *master; /* Pointer to master device of a group,
334 * which this device is member of. 348 * which this device is member of.
335 */ 349 */
336 350
337 /* Interface address info. */ 351 /* Interface address info. */
338 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
339 unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */
340 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ 352 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */
341 unsigned char addr_len; /* hardware address length */ 353 unsigned char addr_len; /* hardware address length */
342 unsigned short dev_id; /* for shared network cards */ 354 unsigned short dev_id; /* for shared network cards */
@@ -346,8 +358,6 @@ struct net_device
346 int promiscuity; 358 int promiscuity;
347 int allmulti; 359 int allmulti;
348 360
349 int watchdog_timeo;
350 struct timer_list watchdog_timer;
351 361
352 /* Protocol specific pointers */ 362 /* Protocol specific pointers */
353 363
@@ -358,32 +368,62 @@ struct net_device
358 void *ec_ptr; /* Econet specific data */ 368 void *ec_ptr; /* Econet specific data */
359 void *ax25_ptr; /* AX.25 specific data */ 369 void *ax25_ptr; /* AX.25 specific data */
360 370
361 struct list_head poll_list; /* Link to poll list */ 371/*
372 * Cache line mostly used on receive path (including eth_type_trans())
373 */
374 struct list_head poll_list ____cacheline_aligned_in_smp;
375 /* Link to poll list */
376
377 int (*poll) (struct net_device *dev, int *quota);
362 int quota; 378 int quota;
363 int weight; 379 int weight;
380 unsigned long last_rx; /* Time of last Rx */
381 /* Interface address info used in eth_type_trans() */
382 unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast
383 because most packets are unicast) */
364 384
385 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
386
387/*
388 * Cache line mostly used on queue transmit path (qdisc)
389 */
390 /* device queue lock */
391 spinlock_t queue_lock ____cacheline_aligned_in_smp;
365 struct Qdisc *qdisc; 392 struct Qdisc *qdisc;
366 struct Qdisc *qdisc_sleeping; 393 struct Qdisc *qdisc_sleeping;
367 struct Qdisc *qdisc_ingress;
368 struct list_head qdisc_list; 394 struct list_head qdisc_list;
369 unsigned long tx_queue_len; /* Max frames per queue allowed */ 395 unsigned long tx_queue_len; /* Max frames per queue allowed */
370 396
371 /* ingress path synchronizer */ 397 /* ingress path synchronizer */
372 spinlock_t ingress_lock; 398 spinlock_t ingress_lock;
399 struct Qdisc *qdisc_ingress;
400
401/*
402 * One part is mostly used on xmit path (device)
403 */
373 /* hard_start_xmit synchronizer */ 404 /* hard_start_xmit synchronizer */
374 spinlock_t xmit_lock; 405 spinlock_t xmit_lock ____cacheline_aligned_in_smp;
375 /* cpu id of processor entered to hard_start_xmit or -1, 406 /* cpu id of processor entered to hard_start_xmit or -1,
376 if nobody entered there. 407 if nobody entered there.
377 */ 408 */
378 int xmit_lock_owner; 409 int xmit_lock_owner;
379 /* device queue lock */ 410 void *priv; /* pointer to private data */
380 spinlock_t queue_lock; 411 int (*hard_start_xmit) (struct sk_buff *skb,
412 struct net_device *dev);
413 /* These may be needed for future network-power-down code. */
414 unsigned long trans_start; /* Time (in jiffies) of last Tx */
415
416 int watchdog_timeo; /* used by dev_watchdog() */
417 struct timer_list watchdog_timer;
418
419/*
420 * refcnt is a very hot point, so align it on SMP
421 */
381 /* Number of references to this device */ 422 /* Number of references to this device */
382 atomic_t refcnt; 423 atomic_t refcnt ____cacheline_aligned_in_smp;
424
383 /* delayed register/unregister */ 425 /* delayed register/unregister */
384 struct list_head todo_list; 426 struct list_head todo_list;
385 /* device name hash chain */
386 struct hlist_node name_hlist;
387 /* device index hash chain */ 427 /* device index hash chain */
388 struct hlist_node index_hlist; 428 struct hlist_node index_hlist;
389 429
@@ -396,21 +436,6 @@ struct net_device
396 NETREG_RELEASED, /* called free_netdev */ 436 NETREG_RELEASED, /* called free_netdev */
397 } reg_state; 437 } reg_state;
398 438
399 /* Net device features */
400 unsigned long features;
401#define NETIF_F_SG 1 /* Scatter/gather IO. */
402#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */
403#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
404#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */
405#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */
406#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */
407#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
408#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
409#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
410#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
411#define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */
412#define NETIF_F_LLTX 4096 /* LockLess TX */
413
414 /* Called after device is detached from network. */ 439 /* Called after device is detached from network. */
415 void (*uninit)(struct net_device *dev); 440 void (*uninit)(struct net_device *dev);
416 /* Called after last user reference disappears. */ 441 /* Called after last user reference disappears. */
@@ -419,10 +444,7 @@ struct net_device
419 /* Pointers to interface service routines. */ 444 /* Pointers to interface service routines. */
420 int (*open)(struct net_device *dev); 445 int (*open)(struct net_device *dev);
421 int (*stop)(struct net_device *dev); 446 int (*stop)(struct net_device *dev);
422 int (*hard_start_xmit) (struct sk_buff *skb,
423 struct net_device *dev);
424#define HAVE_NETDEV_POLL 447#define HAVE_NETDEV_POLL
425 int (*poll) (struct net_device *dev, int *quota);
426 int (*hard_header) (struct sk_buff *skb, 448 int (*hard_header) (struct sk_buff *skb,
427 struct net_device *dev, 449 struct net_device *dev,
428 unsigned short type, 450 unsigned short type,
@@ -852,11 +874,9 @@ static inline void netif_rx_complete(struct net_device *dev)
852 874
853static inline void netif_poll_disable(struct net_device *dev) 875static inline void netif_poll_disable(struct net_device *dev)
854{ 876{
855 while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { 877 while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state))
856 /* No hurry. */ 878 /* No hurry. */
857 current->state = TASK_INTERRUPTIBLE; 879 schedule_timeout_interruptible(1);
858 schedule_timeout(1);
859 }
860} 880}
861 881
862static inline void netif_poll_enable(struct net_device *dev) 882static inline void netif_poll_enable(struct net_device *dev)
@@ -907,6 +927,13 @@ extern int netdev_max_backlog;
907extern int weight_p; 927extern int weight_p;
908extern int netdev_set_master(struct net_device *dev, struct net_device *master); 928extern int netdev_set_master(struct net_device *dev, struct net_device *master);
909extern int skb_checksum_help(struct sk_buff *skb, int inward); 929extern int skb_checksum_help(struct sk_buff *skb, int inward);
930#ifdef CONFIG_BUG
931extern void netdev_rx_csum_fault(struct net_device *dev);
932#else
933static inline void netdev_rx_csum_fault(struct net_device *dev)
934{
935}
936#endif
910/* rx skb timestamps */ 937/* rx skb timestamps */
911extern void net_enable_timestamp(void); 938extern void net_enable_timestamp(void);
912extern void net_disable_timestamp(void); 939extern void net_disable_timestamp(void);
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
new file mode 100644
index 000000000000..6d39b518486b
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -0,0 +1,159 @@
1#ifndef _NF_CONNTRACK_COMMON_H
2#define _NF_CONNTRACK_COMMON_H
3/* Connection state tracking for netfilter. This is separated from,
4 but required by, the NAT layer; it can also be used by an iptables
5 extension. */
6enum ip_conntrack_info
7{
8 /* Part of an established connection (either direction). */
9 IP_CT_ESTABLISHED,
10
11 /* Like NEW, but related to an existing connection, or ICMP error
12 (in either direction). */
13 IP_CT_RELATED,
14
15 /* Started a new connection to track (only
16 IP_CT_DIR_ORIGINAL); may be a retransmission. */
17 IP_CT_NEW,
18
19 /* >= this indicates reply direction */
20 IP_CT_IS_REPLY,
21
22 /* Number of distinct IP_CT types (no NEW in reply dirn). */
23 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
24};
25
26/* Bitset representing status of connection. */
27enum ip_conntrack_status {
28 /* It's an expected connection: bit 0 set. This bit never changed */
29 IPS_EXPECTED_BIT = 0,
30 IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
31
32 /* We've seen packets both ways: bit 1 set. Can be set, not unset. */
33 IPS_SEEN_REPLY_BIT = 1,
34 IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
35
36 /* Conntrack should never be early-expired. */
37 IPS_ASSURED_BIT = 2,
38 IPS_ASSURED = (1 << IPS_ASSURED_BIT),
39
40 /* Connection is confirmed: originating packet has left box */
41 IPS_CONFIRMED_BIT = 3,
42 IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
43
44 /* Connection needs src nat in orig dir. This bit never changed. */
45 IPS_SRC_NAT_BIT = 4,
46 IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
47
48 /* Connection needs dst nat in orig dir. This bit never changed. */
49 IPS_DST_NAT_BIT = 5,
50 IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
51
52 /* Both together. */
53 IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
54
55 /* Connection needs TCP sequence adjusted. */
56 IPS_SEQ_ADJUST_BIT = 6,
57 IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
58
59 /* NAT initialization bits. */
60 IPS_SRC_NAT_DONE_BIT = 7,
61 IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
62
63 IPS_DST_NAT_DONE_BIT = 8,
64 IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
65
66 /* Both together */
67 IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
68
69 /* Connection is dying (removed from lists), can not be unset. */
70 IPS_DYING_BIT = 9,
71 IPS_DYING = (1 << IPS_DYING_BIT),
72};
73
74/* Connection tracking event bits */
75enum ip_conntrack_events
76{
77 /* New conntrack */
78 IPCT_NEW_BIT = 0,
79 IPCT_NEW = (1 << IPCT_NEW_BIT),
80
81 /* Expected connection */
82 IPCT_RELATED_BIT = 1,
83 IPCT_RELATED = (1 << IPCT_RELATED_BIT),
84
85 /* Destroyed conntrack */
86 IPCT_DESTROY_BIT = 2,
87 IPCT_DESTROY = (1 << IPCT_DESTROY_BIT),
88
89 /* Timer has been refreshed */
90 IPCT_REFRESH_BIT = 3,
91 IPCT_REFRESH = (1 << IPCT_REFRESH_BIT),
92
93 /* Status has changed */
94 IPCT_STATUS_BIT = 4,
95 IPCT_STATUS = (1 << IPCT_STATUS_BIT),
96
97 /* Update of protocol info */
98 IPCT_PROTOINFO_BIT = 5,
99 IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT),
100
101 /* Volatile protocol info */
102 IPCT_PROTOINFO_VOLATILE_BIT = 6,
103 IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT),
104
105 /* New helper for conntrack */
106 IPCT_HELPER_BIT = 7,
107 IPCT_HELPER = (1 << IPCT_HELPER_BIT),
108
109 /* Update of helper info */
110 IPCT_HELPINFO_BIT = 8,
111 IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT),
112
113 /* Volatile helper info */
114 IPCT_HELPINFO_VOLATILE_BIT = 9,
115 IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT),
116
117 /* NAT info */
118 IPCT_NATINFO_BIT = 10,
119 IPCT_NATINFO = (1 << IPCT_NATINFO_BIT),
120
121 /* Counter highest bit has been set */
122 IPCT_COUNTER_FILLING_BIT = 11,
123 IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT),
124};
125
126enum ip_conntrack_expect_events {
127 IPEXP_NEW_BIT = 0,
128 IPEXP_NEW = (1 << IPEXP_NEW_BIT),
129};
130
131#ifdef __KERNEL__
132struct ip_conntrack_counter
133{
134 u_int32_t packets;
135 u_int32_t bytes;
136};
137
138struct ip_conntrack_stat
139{
140 unsigned int searched;
141 unsigned int found;
142 unsigned int new;
143 unsigned int invalid;
144 unsigned int ignore;
145 unsigned int delete;
146 unsigned int delete_list;
147 unsigned int insert;
148 unsigned int insert_failed;
149 unsigned int drop;
150 unsigned int early_drop;
151 unsigned int error;
152 unsigned int expect_new;
153 unsigned int expect_create;
154 unsigned int expect_delete;
155};
156
157#endif /* __KERNEL__ */
158
159#endif /* _NF_CONNTRACK_COMMON_H */
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
new file mode 100644
index 000000000000..ad4a41c9ce93
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_ftp.h
@@ -0,0 +1,44 @@
1#ifndef _NF_CONNTRACK_FTP_H
2#define _NF_CONNTRACK_FTP_H
3/* FTP tracking. */
4
5/* This enum is exposed to userspace */
6enum ip_ct_ftp_type
7{
8 /* PORT command from client */
9 IP_CT_FTP_PORT,
10 /* PASV response from server */
11 IP_CT_FTP_PASV,
12 /* EPRT command from client */
13 IP_CT_FTP_EPRT,
14 /* EPSV response from server */
15 IP_CT_FTP_EPSV,
16};
17
18#ifdef __KERNEL__
19
20#define FTP_PORT 21
21
22#define NUM_SEQ_TO_REMEMBER 2
23/* This structure exists only once per master */
24struct ip_ct_ftp_master {
25 /* Valid seq positions for cmd matching after newline */
26 u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
27 /* 0 means seq_match_aft_nl not set */
28 int seq_aft_nl_num[IP_CT_DIR_MAX];
29};
30
31struct ip_conntrack_expect;
32
33/* For NAT to hook in when we find a packet which describes what other
34 * connection we should expect. */
35extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb,
36 enum ip_conntrack_info ctinfo,
37 enum ip_ct_ftp_type type,
38 unsigned int matchoff,
39 unsigned int matchlen,
40 struct ip_conntrack_expect *exp,
41 u32 *seq);
42#endif /* __KERNEL__ */
43
44#endif /* _NF_CONNTRACK_FTP_H */
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h
new file mode 100644
index 000000000000..b8994d9fd1a9
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_sctp.h
@@ -0,0 +1,27 @@
1#ifndef _NF_CONNTRACK_SCTP_H
2#define _NF_CONNTRACK_SCTP_H
3/* SCTP tracking. */
4
5#include <linux/netfilter/nf_conntrack_tuple_common.h>
6
7enum sctp_conntrack {
8 SCTP_CONNTRACK_NONE,
9 SCTP_CONNTRACK_CLOSED,
10 SCTP_CONNTRACK_COOKIE_WAIT,
11 SCTP_CONNTRACK_COOKIE_ECHOED,
12 SCTP_CONNTRACK_ESTABLISHED,
13 SCTP_CONNTRACK_SHUTDOWN_SENT,
14 SCTP_CONNTRACK_SHUTDOWN_RECD,
15 SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
16 SCTP_CONNTRACK_MAX
17};
18
19struct ip_ct_sctp
20{
21 enum sctp_conntrack state;
22
23 u_int32_t vtag[IP_CT_DIR_MAX];
24 u_int32_t ttag[IP_CT_DIR_MAX];
25};
26
27#endif /* _NF_CONNTRACK_SCTP_H */
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
new file mode 100644
index 000000000000..b2feeffde384
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -0,0 +1,56 @@
1#ifndef _NF_CONNTRACK_TCP_H
2#define _NF_CONNTRACK_TCP_H
3/* TCP tracking. */
4
5/* This is exposed to userspace (ctnetlink) */
6enum tcp_conntrack {
7 TCP_CONNTRACK_NONE,
8 TCP_CONNTRACK_SYN_SENT,
9 TCP_CONNTRACK_SYN_RECV,
10 TCP_CONNTRACK_ESTABLISHED,
11 TCP_CONNTRACK_FIN_WAIT,
12 TCP_CONNTRACK_CLOSE_WAIT,
13 TCP_CONNTRACK_LAST_ACK,
14 TCP_CONNTRACK_TIME_WAIT,
15 TCP_CONNTRACK_CLOSE,
16 TCP_CONNTRACK_LISTEN,
17 TCP_CONNTRACK_MAX,
18 TCP_CONNTRACK_IGNORE
19};
20
21/* Window scaling is advertised by the sender */
22#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
23
24/* SACK is permitted by the sender */
25#define IP_CT_TCP_FLAG_SACK_PERM 0x02
26
27/* This sender sent FIN first */
28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x03
29
30#ifdef __KERNEL__
31
32struct ip_ct_tcp_state {
33 u_int32_t td_end; /* max of seq + len */
34 u_int32_t td_maxend; /* max of ack + max(win, 1) */
35 u_int32_t td_maxwin; /* max(win) */
36 u_int8_t td_scale; /* window scale factor */
37 u_int8_t loose; /* used when connection picked up from the middle */
38 u_int8_t flags; /* per direction options */
39};
40
41struct ip_ct_tcp
42{
43 struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */
44 u_int8_t state; /* state of the connection (enum tcp_conntrack) */
45 /* For detecting stale connections */
46 u_int8_t last_dir; /* Direction of the last packet (enum ip_conntrack_dir) */
47 u_int8_t retrans; /* Number of retransmitted packets */
48 u_int8_t last_index; /* Index of the last packet */
49 u_int32_t last_seq; /* Last sequence number seen in dir */
50 u_int32_t last_ack; /* Last sequence number seen in opposite dir */
51 u_int32_t last_end; /* Last seq + len */
52};
53
54#endif /* __KERNEL__ */
55
56#endif /* _NF_CONNTRACK_TCP_H */
diff --git a/include/linux/netfilter/nf_conntrack_tuple_common.h b/include/linux/netfilter/nf_conntrack_tuple_common.h
new file mode 100644
index 000000000000..8e145f0d61cb
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_tuple_common.h
@@ -0,0 +1,13 @@
1#ifndef _NF_CONNTRACK_TUPLE_COMMON_H
2#define _NF_CONNTRACK_TUPLE_COMMON_H
3
4enum ip_conntrack_dir
5{
6 IP_CT_DIR_ORIGINAL,
7 IP_CT_DIR_REPLY,
8 IP_CT_DIR_MAX
9};
10
11#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
12
13#endif /* _NF_CONNTRACK_TUPLE_COMMON_H */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 1d5b10ae2399..934a2479f160 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -41,11 +41,15 @@ enum nfnetlink_groups {
41struct nfattr 41struct nfattr
42{ 42{
43 u_int16_t nfa_len; 43 u_int16_t nfa_len;
44 u_int16_t nfa_type; 44 u_int16_t nfa_type; /* we use 15 bits for the type, and the highest
45 * bit to indicate whether the payload is nested */
45} __attribute__ ((packed)); 46} __attribute__ ((packed));
46 47
47/* FIXME: Shamelessly copy and pasted from rtnetlink.h, it's time 48/* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from
48 * to put this in a generic file */ 49 * rtnetlink.h, it's time to put this in a generic file */
50
51#define NFNL_NFA_NEST 0x8000
52#define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff)
49 53
50#define NFA_ALIGNTO 4 54#define NFA_ALIGNTO 4
51#define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) 55#define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1))
@@ -59,7 +63,7 @@ struct nfattr
59#define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) 63#define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0))
60#define NFA_NEST(skb, type) \ 64#define NFA_NEST(skb, type) \
61({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ 65({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \
62 NFA_PUT(skb, type, 0, NULL); \ 66 NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \
63 __start; }) 67 __start; })
64#define NFA_NEST_END(skb, start) \ 68#define NFA_NEST_END(skb, start) \
65({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ 69({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \
@@ -108,7 +112,6 @@ struct nfnl_callback
108{ 112{
109 int (*call)(struct sock *nl, struct sk_buff *skb, 113 int (*call)(struct sock *nl, struct sk_buff *skb,
110 struct nlmsghdr *nlh, struct nfattr *cda[], int *errp); 114 struct nlmsghdr *nlh, struct nfattr *cda[], int *errp);
111 kernel_cap_t cap_required; /* capabilities required for this msg */
112 u_int16_t attr_count; /* number of nfattr's */ 115 u_int16_t attr_count; /* number of nfattr's */
113}; 116};
114 117
@@ -142,7 +145,7 @@ extern void nfnl_unlock(void);
142extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n); 145extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n);
143extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n); 146extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n);
144 147
145extern int nfattr_parse(struct nfattr *tb[], int maxattr, 148extern void nfattr_parse(struct nfattr *tb[], int maxattr,
146 struct nfattr *nfa, int len); 149 struct nfattr *nfa, int len);
147 150
148#define nfattr_parse_nested(tb, max, nfa) \ 151#define nfattr_parse_nested(tb, max, nfa) \
@@ -150,11 +153,14 @@ extern int nfattr_parse(struct nfattr *tb[], int maxattr,
150 153
151#define nfattr_bad_size(tb, max, cta_min) \ 154#define nfattr_bad_size(tb, max, cta_min) \
152({ int __i, __res = 0; \ 155({ int __i, __res = 0; \
153 for (__i=0; __i<max; __i++) \ 156 for (__i=0; __i<max; __i++) { \
157 if (!cta_min[__i]) \
158 continue; \
154 if (tb[__i] && NFA_PAYLOAD(tb[__i]) < cta_min[__i]){ \ 159 if (tb[__i] && NFA_PAYLOAD(tb[__i]) < cta_min[__i]){ \
155 __res = 1; \ 160 __res = 1; \
156 break; \ 161 break; \
157 } \ 162 } \
163 } \
158 __res; \ 164 __res; \
159}) 165})
160 166
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index 5c55751c78e4..116fcaced909 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -70,15 +70,24 @@ enum ctattr_l4proto {
70 70
71enum ctattr_protoinfo { 71enum ctattr_protoinfo {
72 CTA_PROTOINFO_UNSPEC, 72 CTA_PROTOINFO_UNSPEC,
73 CTA_PROTOINFO_TCP_STATE, 73 CTA_PROTOINFO_TCP,
74 __CTA_PROTOINFO_MAX 74 __CTA_PROTOINFO_MAX
75}; 75};
76#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) 76#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1)
77 77
78enum ctattr_protoinfo_tcp {
79 CTA_PROTOINFO_TCP_UNSPEC,
80 CTA_PROTOINFO_TCP_STATE,
81 __CTA_PROTOINFO_TCP_MAX
82};
83#define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1)
84
78enum ctattr_counters { 85enum ctattr_counters {
79 CTA_COUNTERS_UNSPEC, 86 CTA_COUNTERS_UNSPEC,
80 CTA_COUNTERS_PACKETS, 87 CTA_COUNTERS_PACKETS, /* old 64bit counters */
81 CTA_COUNTERS_BYTES, 88 CTA_COUNTERS_BYTES, /* old 64bit counters */
89 CTA_COUNTERS32_PACKETS,
90 CTA_COUNTERS32_BYTES,
82 __CTA_COUNTERS_MAX 91 __CTA_COUNTERS_MAX
83}; 92};
84#define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) 93#define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1)
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index d759a637bded..e98a870a20be 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -68,7 +68,8 @@ struct arpt_entry_target
68 u_int16_t target_size; 68 u_int16_t target_size;
69 69
70 /* Used by userspace */ 70 /* Used by userspace */
71 char name[ARPT_FUNCTION_MAXNAMELEN]; 71 char name[ARPT_FUNCTION_MAXNAMELEN-1];
72 u_int8_t revision;
72 } user; 73 } user;
73 struct { 74 struct {
74 u_int16_t target_size; 75 u_int16_t target_size;
@@ -148,7 +149,9 @@ struct arpt_entry
148 149
149#define ARPT_SO_GET_INFO (ARPT_BASE_CTL) 150#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
150#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1) 151#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
151#define ARPT_SO_GET_MAX ARPT_SO_GET_ENTRIES 152/* #define ARPT_SO_GET_REVISION_MATCH (ARPT_BASE_CTL + 2)*/
153#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
154#define ARPT_SO_GET_MAX ARPT_SO_GET_REVISION_TARGET
152 155
153/* CONTINUE verdict for targets */ 156/* CONTINUE verdict for targets */
154#define ARPT_CONTINUE 0xFFFFFFFF 157#define ARPT_CONTINUE 0xFFFFFFFF
@@ -236,6 +239,15 @@ struct arpt_get_entries
236 struct arpt_entry entrytable[0]; 239 struct arpt_entry entrytable[0];
237}; 240};
238 241
242/* The argument to ARPT_SO_GET_REVISION_*. Returns highest revision
243 * kernel supports, if >= revision. */
244struct arpt_get_revision
245{
246 char name[ARPT_FUNCTION_MAXNAMELEN-1];
247
248 u_int8_t revision;
249};
250
239/* Standard return verdict, or do jump. */ 251/* Standard return verdict, or do jump. */
240#define ARPT_STANDARD_TARGET "" 252#define ARPT_STANDARD_TARGET ""
241/* Error verdict. */ 253/* Error verdict. */
@@ -274,7 +286,9 @@ struct arpt_target
274{ 286{
275 struct list_head list; 287 struct list_head list;
276 288
277 const char name[ARPT_FUNCTION_MAXNAMELEN]; 289 const char name[ARPT_FUNCTION_MAXNAMELEN-1];
290
291 u_int8_t revision;
278 292
279 /* Returns verdict. */ 293 /* Returns verdict. */
280 unsigned int (*target)(struct sk_buff **pskb, 294 unsigned int (*target)(struct sk_buff **pskb,
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index bace72a76cc4..b3432ab59a17 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -1,128 +1,7 @@
1#ifndef _IP_CONNTRACK_H 1#ifndef _IP_CONNTRACK_H
2#define _IP_CONNTRACK_H 2#define _IP_CONNTRACK_H
3/* Connection state tracking for netfilter. This is separated from,
4 but required by, the NAT layer; it can also be used by an iptables
5 extension. */
6enum ip_conntrack_info
7{
8 /* Part of an established connection (either direction). */
9 IP_CT_ESTABLISHED,
10
11 /* Like NEW, but related to an existing connection, or ICMP error
12 (in either direction). */
13 IP_CT_RELATED,
14
15 /* Started a new connection to track (only
16 IP_CT_DIR_ORIGINAL); may be a retransmission. */
17 IP_CT_NEW,
18
19 /* >= this indicates reply direction */
20 IP_CT_IS_REPLY,
21
22 /* Number of distinct IP_CT types (no NEW in reply dirn). */
23 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
24};
25
26/* Bitset representing status of connection. */
27enum ip_conntrack_status {
28 /* It's an expected connection: bit 0 set. This bit never changed */
29 IPS_EXPECTED_BIT = 0,
30 IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
31
32 /* We've seen packets both ways: bit 1 set. Can be set, not unset. */
33 IPS_SEEN_REPLY_BIT = 1,
34 IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
35
36 /* Conntrack should never be early-expired. */
37 IPS_ASSURED_BIT = 2,
38 IPS_ASSURED = (1 << IPS_ASSURED_BIT),
39
40 /* Connection is confirmed: originating packet has left box */
41 IPS_CONFIRMED_BIT = 3,
42 IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
43
44 /* Connection needs src nat in orig dir. This bit never changed. */
45 IPS_SRC_NAT_BIT = 4,
46 IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
47
48 /* Connection needs dst nat in orig dir. This bit never changed. */
49 IPS_DST_NAT_BIT = 5,
50 IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
51
52 /* Both together. */
53 IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
54
55 /* Connection needs TCP sequence adjusted. */
56 IPS_SEQ_ADJUST_BIT = 6,
57 IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
58
59 /* NAT initialization bits. */
60 IPS_SRC_NAT_DONE_BIT = 7,
61 IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
62
63 IPS_DST_NAT_DONE_BIT = 8,
64 IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
65
66 /* Both together */
67 IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
68
69 /* Connection is dying (removed from lists), can not be unset. */
70 IPS_DYING_BIT = 9,
71 IPS_DYING = (1 << IPS_DYING_BIT),
72};
73
74/* Connection tracking event bits */
75enum ip_conntrack_events
76{
77 /* New conntrack */
78 IPCT_NEW_BIT = 0,
79 IPCT_NEW = (1 << IPCT_NEW_BIT),
80
81 /* Expected connection */
82 IPCT_RELATED_BIT = 1,
83 IPCT_RELATED = (1 << IPCT_RELATED_BIT),
84 3
85 /* Destroyed conntrack */ 4#include <linux/netfilter/nf_conntrack_common.h>
86 IPCT_DESTROY_BIT = 2,
87 IPCT_DESTROY = (1 << IPCT_DESTROY_BIT),
88
89 /* Timer has been refreshed */
90 IPCT_REFRESH_BIT = 3,
91 IPCT_REFRESH = (1 << IPCT_REFRESH_BIT),
92
93 /* Status has changed */
94 IPCT_STATUS_BIT = 4,
95 IPCT_STATUS = (1 << IPCT_STATUS_BIT),
96
97 /* Update of protocol info */
98 IPCT_PROTOINFO_BIT = 5,
99 IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT),
100
101 /* Volatile protocol info */
102 IPCT_PROTOINFO_VOLATILE_BIT = 6,
103 IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT),
104
105 /* New helper for conntrack */
106 IPCT_HELPER_BIT = 7,
107 IPCT_HELPER = (1 << IPCT_HELPER_BIT),
108
109 /* Update of helper info */
110 IPCT_HELPINFO_BIT = 8,
111 IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT),
112
113 /* Volatile helper info */
114 IPCT_HELPINFO_VOLATILE_BIT = 9,
115 IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT),
116
117 /* NAT info */
118 IPCT_NATINFO_BIT = 10,
119 IPCT_NATINFO = (1 << IPCT_NATINFO_BIT),
120};
121
122enum ip_conntrack_expect_events {
123 IPEXP_NEW_BIT = 0,
124 IPEXP_NEW = (1 << IPEXP_NEW_BIT),
125};
126 5
127#ifdef __KERNEL__ 6#ifdef __KERNEL__
128#include <linux/config.h> 7#include <linux/config.h>
@@ -190,12 +69,6 @@ do { \
190#define IP_NF_ASSERT(x) 69#define IP_NF_ASSERT(x)
191#endif 70#endif
192 71
193struct ip_conntrack_counter
194{
195 u_int64_t packets;
196 u_int64_t bytes;
197};
198
199struct ip_conntrack_helper; 72struct ip_conntrack_helper;
200 73
201struct ip_conntrack 74struct ip_conntrack
@@ -332,11 +205,28 @@ extern void need_ip_conntrack(void);
332extern int invert_tuplepr(struct ip_conntrack_tuple *inverse, 205extern int invert_tuplepr(struct ip_conntrack_tuple *inverse,
333 const struct ip_conntrack_tuple *orig); 206 const struct ip_conntrack_tuple *orig);
334 207
208extern void __ip_ct_refresh_acct(struct ip_conntrack *ct,
209 enum ip_conntrack_info ctinfo,
210 const struct sk_buff *skb,
211 unsigned long extra_jiffies,
212 int do_acct);
213
214/* Refresh conntrack for this many jiffies and do accounting */
215static inline void ip_ct_refresh_acct(struct ip_conntrack *ct,
216 enum ip_conntrack_info ctinfo,
217 const struct sk_buff *skb,
218 unsigned long extra_jiffies)
219{
220 __ip_ct_refresh_acct(ct, ctinfo, skb, extra_jiffies, 1);
221}
222
335/* Refresh conntrack for this many jiffies */ 223/* Refresh conntrack for this many jiffies */
336extern void ip_ct_refresh_acct(struct ip_conntrack *ct, 224static inline void ip_ct_refresh(struct ip_conntrack *ct,
337 enum ip_conntrack_info ctinfo, 225 const struct sk_buff *skb,
338 const struct sk_buff *skb, 226 unsigned long extra_jiffies)
339 unsigned long extra_jiffies); 227{
228 __ip_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0);
229}
340 230
341/* These are for NAT. Icky. */ 231/* These are for NAT. Icky. */
342/* Update TCP window tracking data when NAT mangles the packet */ 232/* Update TCP window tracking data when NAT mangles the packet */
@@ -405,25 +295,6 @@ static inline int is_dying(struct ip_conntrack *ct)
405 295
406extern unsigned int ip_conntrack_htable_size; 296extern unsigned int ip_conntrack_htable_size;
407 297
408struct ip_conntrack_stat
409{
410 unsigned int searched;
411 unsigned int found;
412 unsigned int new;
413 unsigned int invalid;
414 unsigned int ignore;
415 unsigned int delete;
416 unsigned int delete_list;
417 unsigned int insert;
418 unsigned int insert_failed;
419 unsigned int drop;
420 unsigned int early_drop;
421 unsigned int error;
422 unsigned int expect_new;
423 unsigned int expect_create;
424 unsigned int expect_delete;
425};
426
427#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) 298#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++)
428 299
429#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS 300#ifdef CONFIG_IP_NF_CONNTRACK_EVENTS
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h
index 5f06429b9047..63811934de4d 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h
@@ -1,43 +1,6 @@
1#ifndef _IP_CONNTRACK_FTP_H 1#ifndef _IP_CONNTRACK_FTP_H
2#define _IP_CONNTRACK_FTP_H 2#define _IP_CONNTRACK_FTP_H
3/* FTP tracking. */
4 3
5#ifdef __KERNEL__ 4#include <linux/netfilter/nf_conntrack_ftp.h>
6 5
7#define FTP_PORT 21
8
9#endif /* __KERNEL__ */
10
11enum ip_ct_ftp_type
12{
13 /* PORT command from client */
14 IP_CT_FTP_PORT,
15 /* PASV response from server */
16 IP_CT_FTP_PASV,
17 /* EPRT command from client */
18 IP_CT_FTP_EPRT,
19 /* EPSV response from server */
20 IP_CT_FTP_EPSV,
21};
22
23#define NUM_SEQ_TO_REMEMBER 2
24/* This structure exists only once per master */
25struct ip_ct_ftp_master {
26 /* Valid seq positions for cmd matching after newline */
27 u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
28 /* 0 means seq_match_aft_nl not set */
29 int seq_aft_nl_num[IP_CT_DIR_MAX];
30};
31
32struct ip_conntrack_expect;
33
34/* For NAT to hook in when we find a packet which describes what other
35 * connection we should expect. */
36extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb,
37 enum ip_conntrack_info ctinfo,
38 enum ip_ct_ftp_type type,
39 unsigned int matchoff,
40 unsigned int matchlen,
41 struct ip_conntrack_expect *exp,
42 u32 *seq);
43#endif /* _IP_CONNTRACK_FTP_H */ 6#endif /* _IP_CONNTRACK_FTP_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_icmp.h b/include/linux/netfilter_ipv4/ip_conntrack_icmp.h
index f1664abbe392..eed5ee3e4744 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_icmp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_icmp.h
@@ -1,11 +1,6 @@
1#ifndef _IP_CONNTRACK_ICMP_H 1#ifndef _IP_CONNTRACK_ICMP_H
2#define _IP_CONNTRACK_ICMP_H 2#define _IP_CONNTRACK_ICMP_H
3/* ICMP tracking. */
4#include <asm/atomic.h>
5 3
6struct ip_ct_icmp 4#include <net/netfilter/ipv4/nf_conntrack_icmp.h>
7{ 5
8 /* Optimization: when number in == number out, forget immediately. */
9 atomic_t count;
10};
11#endif /* _IP_CONNTRACK_ICMP_H */ 6#endif /* _IP_CONNTRACK_ICMP_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
index 389e3851d52f..816144c75de0 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
@@ -60,8 +60,8 @@ struct ip_ct_pptp_expect {
60 60
61struct pptp_pkt_hdr { 61struct pptp_pkt_hdr {
62 __u16 packetLength; 62 __u16 packetLength;
63 __u16 packetType; 63 __be16 packetType;
64 __u32 magicCookie; 64 __be32 magicCookie;
65}; 65};
66 66
67/* PptpControlMessageType values */ 67/* PptpControlMessageType values */
@@ -93,7 +93,7 @@ struct pptp_pkt_hdr {
93#define PPTP_REMOVE_DEVICE_ERROR 6 93#define PPTP_REMOVE_DEVICE_ERROR 6
94 94
95struct PptpControlHeader { 95struct PptpControlHeader {
96 __u16 messageType; 96 __be16 messageType;
97 __u16 reserved; 97 __u16 reserved;
98}; 98};
99 99
@@ -106,13 +106,13 @@ struct PptpControlHeader {
106#define PPTP_BEARER_CAP_DIGITAL 0x2 106#define PPTP_BEARER_CAP_DIGITAL 0x2
107 107
108struct PptpStartSessionRequest { 108struct PptpStartSessionRequest {
109 __u16 protocolVersion; 109 __be16 protocolVersion;
110 __u8 reserved1; 110 __u8 reserved1;
111 __u8 reserved2; 111 __u8 reserved2;
112 __u32 framingCapability; 112 __be32 framingCapability;
113 __u32 bearerCapability; 113 __be32 bearerCapability;
114 __u16 maxChannels; 114 __be16 maxChannels;
115 __u16 firmwareRevision; 115 __be16 firmwareRevision;
116 __u8 hostName[64]; 116 __u8 hostName[64];
117 __u8 vendorString[64]; 117 __u8 vendorString[64];
118}; 118};
@@ -125,13 +125,13 @@ struct PptpStartSessionRequest {
125#define PPTP_START_UNKNOWN_PROTOCOL 5 125#define PPTP_START_UNKNOWN_PROTOCOL 5
126 126
127struct PptpStartSessionReply { 127struct PptpStartSessionReply {
128 __u16 protocolVersion; 128 __be16 protocolVersion;
129 __u8 resultCode; 129 __u8 resultCode;
130 __u8 generalErrorCode; 130 __u8 generalErrorCode;
131 __u32 framingCapability; 131 __be32 framingCapability;
132 __u32 bearerCapability; 132 __be32 bearerCapability;
133 __u16 maxChannels; 133 __be16 maxChannels;
134 __u16 firmwareRevision; 134 __be16 firmwareRevision;
135 __u8 hostName[64]; 135 __u8 hostName[64];
136 __u8 vendorString[64]; 136 __u8 vendorString[64];
137}; 137};
@@ -155,7 +155,7 @@ struct PptpStopSessionReply {
155}; 155};
156 156
157struct PptpEchoRequest { 157struct PptpEchoRequest {
158 __u32 identNumber; 158 __be32 identNumber;
159}; 159};
160 160
161/* PptpEchoReplyResultCode */ 161/* PptpEchoReplyResultCode */
@@ -163,7 +163,7 @@ struct PptpEchoRequest {
163#define PPTP_ECHO_GENERAL_ERROR 2 163#define PPTP_ECHO_GENERAL_ERROR 2
164 164
165struct PptpEchoReply { 165struct PptpEchoReply {
166 __u32 identNumber; 166 __be32 identNumber;
167 __u8 resultCode; 167 __u8 resultCode;
168 __u8 generalErrorCode; 168 __u8 generalErrorCode;
169 __u16 reserved; 169 __u16 reserved;
@@ -180,16 +180,16 @@ struct PptpEchoReply {
180#define PPTP_DONT_CARE_BEARER_TYPE 3 180#define PPTP_DONT_CARE_BEARER_TYPE 3
181 181
182struct PptpOutCallRequest { 182struct PptpOutCallRequest {
183 __u16 callID; 183 __be16 callID;
184 __u16 callSerialNumber; 184 __be16 callSerialNumber;
185 __u32 minBPS; 185 __be32 minBPS;
186 __u32 maxBPS; 186 __be32 maxBPS;
187 __u32 bearerType; 187 __be32 bearerType;
188 __u32 framingType; 188 __be32 framingType;
189 __u16 packetWindow; 189 __be16 packetWindow;
190 __u16 packetProcDelay; 190 __be16 packetProcDelay;
191 __u16 reserved1; 191 __u16 reserved1;
192 __u16 phoneNumberLength; 192 __be16 phoneNumberLength;
193 __u16 reserved2; 193 __u16 reserved2;
194 __u8 phoneNumber[64]; 194 __u8 phoneNumber[64];
195 __u8 subAddress[64]; 195 __u8 subAddress[64];
@@ -205,24 +205,24 @@ struct PptpOutCallRequest {
205#define PPTP_OUTCALL_DONT_ACCEPT 7 205#define PPTP_OUTCALL_DONT_ACCEPT 7
206 206
207struct PptpOutCallReply { 207struct PptpOutCallReply {
208 __u16 callID; 208 __be16 callID;
209 __u16 peersCallID; 209 __be16 peersCallID;
210 __u8 resultCode; 210 __u8 resultCode;
211 __u8 generalErrorCode; 211 __u8 generalErrorCode;
212 __u16 causeCode; 212 __be16 causeCode;
213 __u32 connectSpeed; 213 __be32 connectSpeed;
214 __u16 packetWindow; 214 __be16 packetWindow;
215 __u16 packetProcDelay; 215 __be16 packetProcDelay;
216 __u32 physChannelID; 216 __be32 physChannelID;
217}; 217};
218 218
219struct PptpInCallRequest { 219struct PptpInCallRequest {
220 __u16 callID; 220 __be16 callID;
221 __u16 callSerialNumber; 221 __be16 callSerialNumber;
222 __u32 callBearerType; 222 __be32 callBearerType;
223 __u32 physChannelID; 223 __be32 physChannelID;
224 __u16 dialedNumberLength; 224 __be16 dialedNumberLength;
225 __u16 dialingNumberLength; 225 __be16 dialingNumberLength;
226 __u8 dialedNumber[64]; 226 __u8 dialedNumber[64];
227 __u8 dialingNumber[64]; 227 __u8 dialingNumber[64];
228 __u8 subAddress[64]; 228 __u8 subAddress[64];
@@ -234,61 +234,54 @@ struct PptpInCallRequest {
234#define PPTP_INCALL_DONT_ACCEPT 3 234#define PPTP_INCALL_DONT_ACCEPT 3
235 235
236struct PptpInCallReply { 236struct PptpInCallReply {
237 __u16 callID; 237 __be16 callID;
238 __u16 peersCallID; 238 __be16 peersCallID;
239 __u8 resultCode; 239 __u8 resultCode;
240 __u8 generalErrorCode; 240 __u8 generalErrorCode;
241 __u16 packetWindow; 241 __be16 packetWindow;
242 __u16 packetProcDelay; 242 __be16 packetProcDelay;
243 __u16 reserved; 243 __u16 reserved;
244}; 244};
245 245
246struct PptpInCallConnected { 246struct PptpInCallConnected {
247 __u16 peersCallID; 247 __be16 peersCallID;
248 __u16 reserved; 248 __u16 reserved;
249 __u32 connectSpeed; 249 __be32 connectSpeed;
250 __u16 packetWindow; 250 __be16 packetWindow;
251 __u16 packetProcDelay; 251 __be16 packetProcDelay;
252 __u32 callFramingType; 252 __be32 callFramingType;
253}; 253};
254 254
255struct PptpClearCallRequest { 255struct PptpClearCallRequest {
256 __u16 callID; 256 __be16 callID;
257 __u16 reserved; 257 __u16 reserved;
258}; 258};
259 259
260struct PptpCallDisconnectNotify { 260struct PptpCallDisconnectNotify {
261 __u16 callID; 261 __be16 callID;
262 __u8 resultCode; 262 __u8 resultCode;
263 __u8 generalErrorCode; 263 __u8 generalErrorCode;
264 __u16 causeCode; 264 __be16 causeCode;
265 __u16 reserved; 265 __u16 reserved;
266 __u8 callStatistics[128]; 266 __u8 callStatistics[128];
267}; 267};
268 268
269struct PptpWanErrorNotify { 269struct PptpWanErrorNotify {
270 __u16 peersCallID; 270 __be16 peersCallID;
271 __u16 reserved; 271 __u16 reserved;
272 __u32 crcErrors; 272 __be32 crcErrors;
273 __u32 framingErrors; 273 __be32 framingErrors;
274 __u32 hardwareOverRuns; 274 __be32 hardwareOverRuns;
275 __u32 bufferOverRuns; 275 __be32 bufferOverRuns;
276 __u32 timeoutErrors; 276 __be32 timeoutErrors;
277 __u32 alignmentErrors; 277 __be32 alignmentErrors;
278}; 278};
279 279
280struct PptpSetLinkInfo { 280struct PptpSetLinkInfo {
281 __u16 peersCallID; 281 __be16 peersCallID;
282 __u16 reserved; 282 __u16 reserved;
283 __u32 sendAccm; 283 __be32 sendAccm;
284 __u32 recvAccm; 284 __be32 recvAccm;
285};
286
287
288struct pptp_priv_data {
289 __u16 call_id;
290 __u16 mcall_id;
291 __u16 pcall_id;
292}; 285};
293 286
294union pptp_ctrl_union { 287union pptp_ctrl_union {
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h
index b6b99be8632a..2c76b879e3dc 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h
@@ -52,6 +52,9 @@ struct ip_conntrack_protocol
52 int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa, 52 int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa,
53 const struct ip_conntrack *ct); 53 const struct ip_conntrack *ct);
54 54
55 /* convert nfnetlink attributes to protoinfo */
56 int (*from_nfattr)(struct nfattr *tb[], struct ip_conntrack *ct);
57
55 int (*tuple_to_nfattr)(struct sk_buff *skb, 58 int (*tuple_to_nfattr)(struct sk_buff *skb,
56 const struct ip_conntrack_tuple *t); 59 const struct ip_conntrack_tuple *t);
57 int (*nfattr_to_tuple)(struct nfattr *tb[], 60 int (*nfattr_to_tuple)(struct nfattr *tb[],
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sctp.h b/include/linux/netfilter_ipv4/ip_conntrack_sctp.h
index 7a8d869321f7..4099a041a32a 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_sctp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_sctp.h
@@ -1,25 +1,6 @@
1#ifndef _IP_CONNTRACK_SCTP_H 1#ifndef _IP_CONNTRACK_SCTP_H
2#define _IP_CONNTRACK_SCTP_H 2#define _IP_CONNTRACK_SCTP_H
3/* SCTP tracking. */
4 3
5enum sctp_conntrack { 4#include <linux/netfilter/nf_conntrack_sctp.h>
6 SCTP_CONNTRACK_NONE,
7 SCTP_CONNTRACK_CLOSED,
8 SCTP_CONNTRACK_COOKIE_WAIT,
9 SCTP_CONNTRACK_COOKIE_ECHOED,
10 SCTP_CONNTRACK_ESTABLISHED,
11 SCTP_CONNTRACK_SHUTDOWN_SENT,
12 SCTP_CONNTRACK_SHUTDOWN_RECD,
13 SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
14 SCTP_CONNTRACK_MAX
15};
16
17struct ip_ct_sctp
18{
19 enum sctp_conntrack state;
20
21 u_int32_t vtag[IP_CT_DIR_MAX];
22 u_int32_t ttag[IP_CT_DIR_MAX];
23};
24 5
25#endif /* _IP_CONNTRACK_SCTP_H */ 6#endif /* _IP_CONNTRACK_SCTP_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tcp.h b/include/linux/netfilter_ipv4/ip_conntrack_tcp.h
index 16da044d97a7..876b8fb17e68 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_tcp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_tcp.h
@@ -1,51 +1,6 @@
1#ifndef _IP_CONNTRACK_TCP_H 1#ifndef _IP_CONNTRACK_TCP_H
2#define _IP_CONNTRACK_TCP_H 2#define _IP_CONNTRACK_TCP_H
3/* TCP tracking. */
4 3
5enum tcp_conntrack { 4#include <linux/netfilter/nf_conntrack_tcp.h>
6 TCP_CONNTRACK_NONE,
7 TCP_CONNTRACK_SYN_SENT,
8 TCP_CONNTRACK_SYN_RECV,
9 TCP_CONNTRACK_ESTABLISHED,
10 TCP_CONNTRACK_FIN_WAIT,
11 TCP_CONNTRACK_CLOSE_WAIT,
12 TCP_CONNTRACK_LAST_ACK,
13 TCP_CONNTRACK_TIME_WAIT,
14 TCP_CONNTRACK_CLOSE,
15 TCP_CONNTRACK_LISTEN,
16 TCP_CONNTRACK_MAX,
17 TCP_CONNTRACK_IGNORE
18};
19
20/* Window scaling is advertised by the sender */
21#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
22
23/* SACK is permitted by the sender */
24#define IP_CT_TCP_FLAG_SACK_PERM 0x02
25
26/* This sender sent FIN first */
27#define IP_CT_TCP_FLAG_CLOSE_INIT 0x03
28
29struct ip_ct_tcp_state {
30 u_int32_t td_end; /* max of seq + len */
31 u_int32_t td_maxend; /* max of ack + max(win, 1) */
32 u_int32_t td_maxwin; /* max(win) */
33 u_int8_t td_scale; /* window scale factor */
34 u_int8_t loose; /* used when connection picked up from the middle */
35 u_int8_t flags; /* per direction options */
36};
37
38struct ip_ct_tcp
39{
40 struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */
41 u_int8_t state; /* state of the connection (enum tcp_conntrack) */
42 /* For detecting stale connections */
43 u_int8_t last_dir; /* Direction of the last packet (enum ip_conntrack_dir) */
44 u_int8_t retrans; /* Number of retransmitted packets */
45 u_int8_t last_index; /* Index of the last packet */
46 u_int32_t last_seq; /* Last sequence number seen in dir */
47 u_int32_t last_ack; /* Last sequence number seen in opposite dir */
48 u_int32_t last_end; /* Last seq + len */
49};
50 5
51#endif /* _IP_CONNTRACK_TCP_H */ 6#endif /* _IP_CONNTRACK_TCP_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
index 14dc0f7b6556..2fdabdb4c0ef 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
@@ -1,6 +1,9 @@
1#ifndef _IP_CONNTRACK_TUPLE_H 1#ifndef _IP_CONNTRACK_TUPLE_H
2#define _IP_CONNTRACK_TUPLE_H 2#define _IP_CONNTRACK_TUPLE_H
3 3
4#include <linux/types.h>
5#include <linux/netfilter/nf_conntrack_tuple_common.h>
6
4/* A `tuple' is a structure containing the information to uniquely 7/* A `tuple' is a structure containing the information to uniquely
5 identify a connection. ie. if two packets have the same tuple, they 8 identify a connection. ie. if two packets have the same tuple, they
6 are in the same connection; if not, they are not. 9 are in the same connection; if not, they are not.
@@ -17,7 +20,7 @@ union ip_conntrack_manip_proto
17 u_int16_t all; 20 u_int16_t all;
18 21
19 struct { 22 struct {
20 u_int16_t port; 23 __be16 port;
21 } tcp; 24 } tcp;
22 struct { 25 struct {
23 u_int16_t port; 26 u_int16_t port;
@@ -29,7 +32,7 @@ union ip_conntrack_manip_proto
29 u_int16_t port; 32 u_int16_t port;
30 } sctp; 33 } sctp;
31 struct { 34 struct {
32 u_int16_t key; /* key is 32bit, pptp only uses 16 */ 35 __be16 key; /* key is 32bit, pptp only uses 16 */
33 } gre; 36 } gre;
34}; 37};
35 38
@@ -65,7 +68,7 @@ struct ip_conntrack_tuple
65 u_int16_t port; 68 u_int16_t port;
66 } sctp; 69 } sctp;
67 struct { 70 struct {
68 u_int16_t key; /* key is 32bit, 71 __be16 key; /* key is 32bit,
69 * pptp only uses 16 */ 72 * pptp only uses 16 */
70 } gre; 73 } gre;
71 } u; 74 } u;
@@ -86,13 +89,6 @@ struct ip_conntrack_tuple
86 (tuple)->dst.u.all = 0; \ 89 (tuple)->dst.u.all = 0; \
87 } while (0) 90 } while (0)
88 91
89enum ip_conntrack_dir
90{
91 IP_CT_DIR_ORIGINAL,
92 IP_CT_DIR_REPLY,
93 IP_CT_DIR_MAX
94};
95
96#ifdef __KERNEL__ 92#ifdef __KERNEL__
97 93
98#define DUMP_TUPLE(tp) \ 94#define DUMP_TUPLE(tp) \
@@ -101,8 +97,6 @@ DEBUGP("tuple %p: %u %u.%u.%u.%u:%hu -> %u.%u.%u.%u:%hu\n", \
101 NIPQUAD((tp)->src.ip), ntohs((tp)->src.u.all), \ 97 NIPQUAD((tp)->src.ip), ntohs((tp)->src.u.all), \
102 NIPQUAD((tp)->dst.ip), ntohs((tp)->dst.u.all)) 98 NIPQUAD((tp)->dst.ip), ntohs((tp)->dst.u.all))
103 99
104#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
105
106/* If we're the first tuple, it's the original dir. */ 100/* If we're the first tuple, it's the original dir. */
107#define DIRECTION(h) ((enum ip_conntrack_dir)(h)->tuple.dst.dir) 101#define DIRECTION(h) ((enum ip_conntrack_dir)(h)->tuple.dst.dir)
108 102
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
index e201ec6e9905..41a107de17cf 100644
--- a/include/linux/netfilter_ipv4/ip_nat.h
+++ b/include/linux/netfilter_ipv4/ip_nat.h
@@ -58,10 +58,6 @@ extern rwlock_t ip_nat_lock;
58struct ip_nat_info 58struct ip_nat_info
59{ 59{
60 struct list_head bysource; 60 struct list_head bysource;
61
62 /* Helper (NULL if none). */
63 struct ip_nat_helper *helper;
64
65 struct ip_nat_seq seq[IP_CT_DIR_MAX]; 61 struct ip_nat_seq seq[IP_CT_DIR_MAX];
66}; 62};
67 63
diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h
index 3b50eb91f007..30db23f06b03 100644
--- a/include/linux/netfilter_ipv4/ip_nat_core.h
+++ b/include/linux/netfilter_ipv4/ip_nat_core.h
@@ -5,16 +5,14 @@
5 5
6/* This header used to share core functionality between the standalone 6/* This header used to share core functionality between the standalone
7 NAT module, and the compatibility layer's use of NAT for masquerading. */ 7 NAT module, and the compatibility layer's use of NAT for masquerading. */
8extern int ip_nat_init(void);
9extern void ip_nat_cleanup(void);
10 8
11extern unsigned int nat_packet(struct ip_conntrack *ct, 9extern unsigned int ip_nat_packet(struct ip_conntrack *ct,
12 enum ip_conntrack_info conntrackinfo, 10 enum ip_conntrack_info conntrackinfo,
13 unsigned int hooknum, 11 unsigned int hooknum,
14 struct sk_buff **pskb); 12 struct sk_buff **pskb);
15 13
16extern int icmp_reply_translation(struct sk_buff **pskb, 14extern int ip_nat_icmp_reply_translation(struct sk_buff **pskb,
17 struct ip_conntrack *ct, 15 struct ip_conntrack *ct,
18 enum ip_nat_manip_type manip, 16 enum ip_nat_manip_type manip,
19 enum ip_conntrack_dir dir); 17 enum ip_conntrack_dir dir);
20#endif /* _IP_NAT_CORE_H */ 18#endif /* _IP_NAT_CORE_H */
diff --git a/include/linux/netfilter_ipv4/ipt_sctp.h b/include/linux/netfilter_ipv4/ipt_sctp.h
index e93a9ec99fc2..80b3dbacd193 100644
--- a/include/linux/netfilter_ipv4/ipt_sctp.h
+++ b/include/linux/netfilter_ipv4/ipt_sctp.h
@@ -7,8 +7,6 @@
7 7
8#define IPT_SCTP_VALID_FLAGS 0x07 8#define IPT_SCTP_VALID_FLAGS 0x07
9 9
10#define ELEMCOUNT(x) (sizeof(x)/sizeof(x[0]))
11
12 10
13struct ipt_sctp_flag_info { 11struct ipt_sctp_flag_info {
14 u_int8_t chunktype; 12 u_int8_t chunktype;
@@ -59,21 +57,21 @@ struct ipt_sctp_info {
59#define SCTP_CHUNKMAP_RESET(chunkmap) \ 57#define SCTP_CHUNKMAP_RESET(chunkmap) \
60 do { \ 58 do { \
61 int i; \ 59 int i; \
62 for (i = 0; i < ELEMCOUNT(chunkmap); i++) \ 60 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
63 chunkmap[i] = 0; \ 61 chunkmap[i] = 0; \
64 } while (0) 62 } while (0)
65 63
66#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \ 64#define SCTP_CHUNKMAP_SET_ALL(chunkmap) \
67 do { \ 65 do { \
68 int i; \ 66 int i; \
69 for (i = 0; i < ELEMCOUNT(chunkmap); i++) \ 67 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
70 chunkmap[i] = ~0; \ 68 chunkmap[i] = ~0; \
71 } while (0) 69 } while (0)
72 70
73#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \ 71#define SCTP_CHUNKMAP_COPY(destmap, srcmap) \
74 do { \ 72 do { \
75 int i; \ 73 int i; \
76 for (i = 0; i < ELEMCOUNT(chunkmap); i++) \ 74 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \
77 destmap[i] = srcmap[i]; \ 75 destmap[i] = srcmap[i]; \
78 } while (0) 76 } while (0)
79 77
@@ -81,7 +79,7 @@ struct ipt_sctp_info {
81({ \ 79({ \
82 int i; \ 80 int i; \
83 int flag = 1; \ 81 int flag = 1; \
84 for (i = 0; i < ELEMCOUNT(chunkmap); i++) { \ 82 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
85 if (chunkmap[i]) { \ 83 if (chunkmap[i]) { \
86 flag = 0; \ 84 flag = 0; \
87 break; \ 85 break; \
@@ -94,7 +92,7 @@ struct ipt_sctp_info {
94({ \ 92({ \
95 int i; \ 93 int i; \
96 int flag = 1; \ 94 int flag = 1; \
97 for (i = 0; i < ELEMCOUNT(chunkmap); i++) { \ 95 for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \
98 if (chunkmap[i] != ~0) { \ 96 if (chunkmap[i] != ~0) { \
99 flag = 0; \ 97 flag = 0; \
100 break; \ 98 break; \
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index edcc2c6eb5c7..53b2983f6278 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -59,6 +59,7 @@
59 59
60enum nf_ip6_hook_priorities { 60enum nf_ip6_hook_priorities {
61 NF_IP6_PRI_FIRST = INT_MIN, 61 NF_IP6_PRI_FIRST = INT_MIN,
62 NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
62 NF_IP6_PRI_SELINUX_FIRST = -225, 63 NF_IP6_PRI_SELINUX_FIRST = -225,
63 NF_IP6_PRI_CONNTRACK = -200, 64 NF_IP6_PRI_CONNTRACK = -200,
64 NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD = -175, 65 NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 59f70b34e029..2efc046d9e94 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -57,7 +57,8 @@ struct ip6t_entry_match
57 u_int16_t match_size; 57 u_int16_t match_size;
58 58
59 /* Used by userspace */ 59 /* Used by userspace */
60 char name[IP6T_FUNCTION_MAXNAMELEN]; 60 char name[IP6T_FUNCTION_MAXNAMELEN-1];
61 u_int8_t revision;
61 } user; 62 } user;
62 struct { 63 struct {
63 u_int16_t match_size; 64 u_int16_t match_size;
@@ -80,7 +81,8 @@ struct ip6t_entry_target
80 u_int16_t target_size; 81 u_int16_t target_size;
81 82
82 /* Used by userspace */ 83 /* Used by userspace */
83 char name[IP6T_FUNCTION_MAXNAMELEN]; 84 char name[IP6T_FUNCTION_MAXNAMELEN-1];
85 u_int8_t revision;
84 } user; 86 } user;
85 struct { 87 struct {
86 u_int16_t target_size; 88 u_int16_t target_size;
@@ -161,7 +163,9 @@ struct ip6t_entry
161 163
162#define IP6T_SO_GET_INFO (IP6T_BASE_CTL) 164#define IP6T_SO_GET_INFO (IP6T_BASE_CTL)
163#define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1) 165#define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1)
164#define IP6T_SO_GET_MAX IP6T_SO_GET_ENTRIES 166#define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 2)
167#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 3)
168#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
165 169
166/* CONTINUE verdict for targets */ 170/* CONTINUE verdict for targets */
167#define IP6T_CONTINUE 0xFFFFFFFF 171#define IP6T_CONTINUE 0xFFFFFFFF
@@ -291,6 +295,15 @@ struct ip6t_get_entries
291 struct ip6t_entry entrytable[0]; 295 struct ip6t_entry entrytable[0];
292}; 296};
293 297
298/* The argument to IP6T_SO_GET_REVISION_*. Returns highest revision
299 * kernel supports, if >= revision. */
300struct ip6t_get_revision
301{
302 char name[IP6T_FUNCTION_MAXNAMELEN-1];
303
304 u_int8_t revision;
305};
306
294/* Standard return verdict, or do jump. */ 307/* Standard return verdict, or do jump. */
295#define IP6T_STANDARD_TARGET "" 308#define IP6T_STANDARD_TARGET ""
296/* Error verdict. */ 309/* Error verdict. */
@@ -352,7 +365,9 @@ struct ip6t_match
352{ 365{
353 struct list_head list; 366 struct list_head list;
354 367
355 const char name[IP6T_FUNCTION_MAXNAMELEN]; 368 const char name[IP6T_FUNCTION_MAXNAMELEN-1];
369
370 u_int8_t revision;
356 371
357 /* Return true or false: return FALSE and set *hotdrop = 1 to 372 /* Return true or false: return FALSE and set *hotdrop = 1 to
358 force immediate packet drop. */ 373 force immediate packet drop. */
@@ -387,7 +402,9 @@ struct ip6t_target
387{ 402{
388 struct list_head list; 403 struct list_head list;
389 404
390 const char name[IP6T_FUNCTION_MAXNAMELEN]; 405 const char name[IP6T_FUNCTION_MAXNAMELEN-1];
406
407 u_int8_t revision;
391 408
392 /* Returns verdict. Argument order changed since 2.6.9, as this 409 /* Returns verdict. Argument order changed since 2.6.9, as this
393 must now handle non-linear skbs, using skb_copy_bits and 410 must now handle non-linear skbs, using skb_copy_bits and
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index bdebdc564506..6a2ccf78a356 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -71,7 +71,8 @@ struct nlmsghdr
71 71
72#define NLMSG_ALIGNTO 4 72#define NLMSG_ALIGNTO 4
73#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) ) 73#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
74#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(sizeof(struct nlmsghdr))) 74#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
75#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
75#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len)) 76#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
76#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) 77#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
77#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ 78#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
@@ -86,6 +87,8 @@ struct nlmsghdr
86#define NLMSG_DONE 0x3 /* End of a dump */ 87#define NLMSG_DONE 0x3 /* End of a dump */
87#define NLMSG_OVERRUN 0x4 /* Data lost */ 88#define NLMSG_OVERRUN 0x4 /* Data lost */
88 89
90#define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */
91
89struct nlmsgerr 92struct nlmsgerr
90{ 93{
91 int error; 94 int error;
@@ -108,6 +111,25 @@ enum {
108 NETLINK_CONNECTED, 111 NETLINK_CONNECTED,
109}; 112};
110 113
114/*
115 * <------- NLA_HDRLEN ------> <-- NLA_ALIGN(payload)-->
116 * +---------------------+- - -+- - - - - - - - - -+- - -+
117 * | Header | Pad | Payload | Pad |
118 * | (struct nlattr) | ing | | ing |
119 * +---------------------+- - -+- - - - - - - - - -+- - -+
120 * <-------------- nlattr->nla_len -------------->
121 */
122
123struct nlattr
124{
125 __u16 nla_len;
126 __u16 nla_type;
127};
128
129#define NLA_ALIGNTO 4
130#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
131#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
132
111#ifdef __KERNEL__ 133#ifdef __KERNEL__
112 134
113#include <linux/capability.h> 135#include <linux/capability.h>
@@ -131,7 +153,7 @@ extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*
131extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 153extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
132extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); 154extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
133extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, 155extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid,
134 __u32 group, unsigned int __nocast allocation); 156 __u32 group, gfp_t allocation);
135extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); 157extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code);
136extern int netlink_register_notifier(struct notifier_block *nb); 158extern int netlink_register_notifier(struct notifier_block *nb);
137extern int netlink_unregister_notifier(struct notifier_block *nb); 159extern int netlink_unregister_notifier(struct notifier_block *nb);
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 5ade54a78dbb..ca5a8733000f 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -86,7 +86,7 @@ static inline void netpoll_poll_unlock(void *have)
86 86
87#else 87#else
88#define netpoll_rx(a) 0 88#define netpoll_rx(a) 0
89#define netpoll_poll_lock(a) 0 89#define netpoll_poll_lock(a) NULL
90#define netpoll_poll_unlock(a) 90#define netpoll_poll_unlock(a)
91#endif 91#endif
92 92
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 9a6047ff1b25..12787a9b0259 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -41,6 +41,10 @@
41#define NFS_MAX_FILE_IO_BUFFER_SIZE 32768 41#define NFS_MAX_FILE_IO_BUFFER_SIZE 32768
42#define NFS_DEF_FILE_IO_BUFFER_SIZE 4096 42#define NFS_DEF_FILE_IO_BUFFER_SIZE 4096
43 43
44/* Default timeout values */
45#define NFS_MAX_UDP_TIMEOUT (60*HZ)
46#define NFS_MAX_TCP_TIMEOUT (600*HZ)
47
44/* 48/*
45 * superblock magic number for NFS 49 * superblock magic number for NFS
46 */ 50 */
@@ -137,6 +141,7 @@ struct nfs_inode {
137 unsigned long attrtimeo_timestamp; 141 unsigned long attrtimeo_timestamp;
138 __u64 change_attr; /* v4 only */ 142 __u64 change_attr; /* v4 only */
139 143
144 unsigned long last_updated;
140 /* "Generation counter" for the attribute cache. This is 145 /* "Generation counter" for the attribute cache. This is
141 * bumped whenever we update the metadata on the 146 * bumped whenever we update the metadata on the
142 * server. 147 * server.
@@ -236,13 +241,17 @@ static inline int nfs_caches_unstable(struct inode *inode)
236 return atomic_read(&NFS_I(inode)->data_updates) != 0; 241 return atomic_read(&NFS_I(inode)->data_updates) != 0;
237} 242}
238 243
244static inline void nfs_mark_for_revalidate(struct inode *inode)
245{
246 spin_lock(&inode->i_lock);
247 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS;
248 spin_unlock(&inode->i_lock);
249}
250
239static inline void NFS_CACHEINV(struct inode *inode) 251static inline void NFS_CACHEINV(struct inode *inode)
240{ 252{
241 if (!nfs_caches_unstable(inode)) { 253 if (!nfs_caches_unstable(inode))
242 spin_lock(&inode->i_lock); 254 nfs_mark_for_revalidate(inode);
243 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS;
244 spin_unlock(&inode->i_lock);
245 }
246} 255}
247 256
248static inline int nfs_server_capable(struct inode *inode, int cap) 257static inline int nfs_server_capable(struct inode *inode, int cap)
@@ -276,7 +285,7 @@ static inline long nfs_save_change_attribute(struct inode *inode)
276static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr) 285static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr)
277{ 286{
278 return !nfs_caches_unstable(inode) 287 return !nfs_caches_unstable(inode)
279 && chattr == NFS_I(inode)->cache_change_attribute; 288 && time_after_eq(chattr, NFS_I(inode)->cache_change_attribute);
280} 289}
281 290
282/* 291/*
@@ -286,6 +295,7 @@ extern void nfs_zap_caches(struct inode *);
286extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 295extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
287 struct nfs_fattr *); 296 struct nfs_fattr *);
288extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); 297extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
298extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
289extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 299extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
290extern int nfs_permission(struct inode *, int, struct nameidata *); 300extern int nfs_permission(struct inode *, int, struct nameidata *);
291extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); 301extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *);
@@ -306,12 +316,18 @@ extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, st
306extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 316extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
307extern void put_nfs_open_context(struct nfs_open_context *ctx); 317extern void put_nfs_open_context(struct nfs_open_context *ctx);
308extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); 318extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
309extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, int mode); 319extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode);
310extern void nfs_file_clear_open_context(struct file *filp); 320extern void nfs_file_clear_open_context(struct file *filp);
311 321
312/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 322/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
313extern u32 root_nfs_parse_addr(char *name); /*__init*/ 323extern u32 root_nfs_parse_addr(char *name); /*__init*/
314 324
325static inline void nfs_fattr_init(struct nfs_fattr *fattr)
326{
327 fattr->valid = 0;
328 fattr->time_start = jiffies;
329}
330
315/* 331/*
316 * linux/fs/nfs/file.c 332 * linux/fs/nfs/file.c
317 */ 333 */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index a2bf6914ff1b..40718669b9c8 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -41,7 +41,7 @@ struct nfs_fattr {
41 __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */ 41 __u32 bitmap[2]; /* NFSv4 returned attribute bitmap */
42 __u64 change_attr; /* NFSv4 change attribute */ 42 __u64 change_attr; /* NFSv4 change attribute */
43 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */ 43 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
44 unsigned long timestamp; 44 unsigned long time_start;
45}; 45};
46 46
47#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */ 47#define NFS_ATTR_WCC 0x0001 /* pre-op WCC data */
@@ -96,12 +96,13 @@ struct nfs4_change_info {
96 u64 after; 96 u64 after;
97}; 97};
98 98
99struct nfs_seqid;
99/* 100/*
100 * Arguments to the open call. 101 * Arguments to the open call.
101 */ 102 */
102struct nfs_openargs { 103struct nfs_openargs {
103 const struct nfs_fh * fh; 104 const struct nfs_fh * fh;
104 __u32 seqid; 105 struct nfs_seqid * seqid;
105 int open_flags; 106 int open_flags;
106 __u64 clientid; 107 __u64 clientid;
107 __u32 id; 108 __u32 id;
@@ -123,6 +124,7 @@ struct nfs_openres {
123 struct nfs4_change_info cinfo; 124 struct nfs4_change_info cinfo;
124 __u32 rflags; 125 __u32 rflags;
125 struct nfs_fattr * f_attr; 126 struct nfs_fattr * f_attr;
127 struct nfs_fattr * dir_attr;
126 const struct nfs_server *server; 128 const struct nfs_server *server;
127 int delegation_type; 129 int delegation_type;
128 nfs4_stateid delegation; 130 nfs4_stateid delegation;
@@ -136,7 +138,7 @@ struct nfs_openres {
136struct nfs_open_confirmargs { 138struct nfs_open_confirmargs {
137 const struct nfs_fh * fh; 139 const struct nfs_fh * fh;
138 nfs4_stateid stateid; 140 nfs4_stateid stateid;
139 __u32 seqid; 141 struct nfs_seqid * seqid;
140}; 142};
141 143
142struct nfs_open_confirmres { 144struct nfs_open_confirmres {
@@ -148,13 +150,16 @@ struct nfs_open_confirmres {
148 */ 150 */
149struct nfs_closeargs { 151struct nfs_closeargs {
150 struct nfs_fh * fh; 152 struct nfs_fh * fh;
151 nfs4_stateid stateid; 153 nfs4_stateid * stateid;
152 __u32 seqid; 154 struct nfs_seqid * seqid;
153 int open_flags; 155 int open_flags;
156 const u32 * bitmask;
154}; 157};
155 158
156struct nfs_closeres { 159struct nfs_closeres {
157 nfs4_stateid stateid; 160 nfs4_stateid stateid;
161 struct nfs_fattr * fattr;
162 const struct nfs_server *server;
158}; 163};
159/* 164/*
160 * * Arguments to the lock,lockt, and locku call. 165 * * Arguments to the lock,lockt, and locku call.
@@ -164,30 +169,19 @@ struct nfs_lowner {
164 u32 id; 169 u32 id;
165}; 170};
166 171
167struct nfs_open_to_lock {
168 __u32 open_seqid;
169 nfs4_stateid open_stateid;
170 __u32 lock_seqid;
171 struct nfs_lowner lock_owner;
172};
173
174struct nfs_exist_lock {
175 nfs4_stateid stateid;
176 __u32 seqid;
177};
178
179struct nfs_lock_opargs { 172struct nfs_lock_opargs {
173 struct nfs_seqid * lock_seqid;
174 nfs4_stateid * lock_stateid;
175 struct nfs_seqid * open_seqid;
176 nfs4_stateid * open_stateid;
177 struct nfs_lowner lock_owner;
180 __u32 reclaim; 178 __u32 reclaim;
181 __u32 new_lock_owner; 179 __u32 new_lock_owner;
182 union {
183 struct nfs_open_to_lock *open_lock;
184 struct nfs_exist_lock *exist_lock;
185 } u;
186}; 180};
187 181
188struct nfs_locku_opargs { 182struct nfs_locku_opargs {
189 __u32 seqid; 183 struct nfs_seqid * seqid;
190 nfs4_stateid stateid; 184 nfs4_stateid * stateid;
191}; 185};
192 186
193struct nfs_lockargs { 187struct nfs_lockargs {
@@ -262,6 +256,7 @@ struct nfs_writeargs {
262 enum nfs3_stable_how stable; 256 enum nfs3_stable_how stable;
263 unsigned int pgbase; 257 unsigned int pgbase;
264 struct page ** pages; 258 struct page ** pages;
259 const u32 * bitmask;
265}; 260};
266 261
267struct nfs_writeverf { 262struct nfs_writeverf {
@@ -273,6 +268,7 @@ struct nfs_writeres {
273 struct nfs_fattr * fattr; 268 struct nfs_fattr * fattr;
274 struct nfs_writeverf * verf; 269 struct nfs_writeverf * verf;
275 __u32 count; 270 __u32 count;
271 const struct nfs_server *server;
276}; 272};
277 273
278/* 274/*
@@ -550,6 +546,7 @@ struct nfs4_create_res {
550 struct nfs_fh * fh; 546 struct nfs_fh * fh;
551 struct nfs_fattr * fattr; 547 struct nfs_fattr * fattr;
552 struct nfs4_change_info dir_cinfo; 548 struct nfs4_change_info dir_cinfo;
549 struct nfs_fattr * dir_fattr;
553}; 550};
554 551
555struct nfs4_fsinfo_arg { 552struct nfs4_fsinfo_arg {
@@ -571,8 +568,17 @@ struct nfs4_link_arg {
571 const struct nfs_fh * fh; 568 const struct nfs_fh * fh;
572 const struct nfs_fh * dir_fh; 569 const struct nfs_fh * dir_fh;
573 const struct qstr * name; 570 const struct qstr * name;
571 const u32 * bitmask;
572};
573
574struct nfs4_link_res {
575 const struct nfs_server * server;
576 struct nfs_fattr * fattr;
577 struct nfs4_change_info cinfo;
578 struct nfs_fattr * dir_attr;
574}; 579};
575 580
581
576struct nfs4_lookup_arg { 582struct nfs4_lookup_arg {
577 const struct nfs_fh * dir_fh; 583 const struct nfs_fh * dir_fh;
578 const struct qstr * name; 584 const struct qstr * name;
@@ -619,6 +625,13 @@ struct nfs4_readlink {
619struct nfs4_remove_arg { 625struct nfs4_remove_arg {
620 const struct nfs_fh * fh; 626 const struct nfs_fh * fh;
621 const struct qstr * name; 627 const struct qstr * name;
628 const u32 * bitmask;
629};
630
631struct nfs4_remove_res {
632 const struct nfs_server * server;
633 struct nfs4_change_info cinfo;
634 struct nfs_fattr * dir_attr;
622}; 635};
623 636
624struct nfs4_rename_arg { 637struct nfs4_rename_arg {
@@ -626,11 +639,15 @@ struct nfs4_rename_arg {
626 const struct nfs_fh * new_dir; 639 const struct nfs_fh * new_dir;
627 const struct qstr * old_name; 640 const struct qstr * old_name;
628 const struct qstr * new_name; 641 const struct qstr * new_name;
642 const u32 * bitmask;
629}; 643};
630 644
631struct nfs4_rename_res { 645struct nfs4_rename_res {
646 const struct nfs_server * server;
632 struct nfs4_change_info old_cinfo; 647 struct nfs4_change_info old_cinfo;
648 struct nfs_fattr * old_fattr;
633 struct nfs4_change_info new_cinfo; 649 struct nfs4_change_info new_cinfo;
650 struct nfs_fattr * new_fattr;
634}; 651};
635 652
636struct nfs4_setclientid { 653struct nfs4_setclientid {
@@ -722,7 +739,7 @@ struct nfs_rpc_ops {
722 int (*write) (struct nfs_write_data *); 739 int (*write) (struct nfs_write_data *);
723 int (*commit) (struct nfs_write_data *); 740 int (*commit) (struct nfs_write_data *);
724 int (*create) (struct inode *, struct dentry *, 741 int (*create) (struct inode *, struct dentry *,
725 struct iattr *, int); 742 struct iattr *, int, struct nameidata *);
726 int (*remove) (struct inode *, struct qstr *); 743 int (*remove) (struct inode *, struct qstr *);
727 int (*unlink_setup) (struct rpc_message *, 744 int (*unlink_setup) (struct rpc_message *,
728 struct dentry *, struct qstr *); 745 struct dentry *, struct qstr *);
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 6d5a24f3fc6d..51c231a1e5a6 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -60,7 +60,7 @@ typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
60extern struct svc_program nfsd_program; 60extern struct svc_program nfsd_program;
61extern struct svc_version nfsd_version2, nfsd_version3, 61extern struct svc_version nfsd_version2, nfsd_version3,
62 nfsd_version4; 62 nfsd_version4;
63 63extern struct svc_serv *nfsd_serv;
64/* 64/*
65 * Function prototypes. 65 * Function prototypes.
66 */ 66 */
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index e65c9db6d13f..781efbf94ed3 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -39,6 +39,21 @@
39#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ 39#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
40#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ 40#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
41 41
42/*
43 * Macros used to set version
44 */
45#define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v)))
46#define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v)))
47#define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v)))
48
49#if defined(CONFIG_NFSD_V4)
50#define NFSCTL_VERALL (0x1c /* 0b011100 */)
51#elif defined(CONFIG_NFSD_V3)
52#define NFSCTL_VERALL (0x0c /* 0b001100 */)
53#else
54#define NFSCTL_VERALL (0x04 /* 0b000100 */)
55#endif
56
42/* SVC */ 57/* SVC */
43struct nfsctl_svc { 58struct nfsctl_svc {
44 unsigned short svc_port; 59 unsigned short svc_port;
@@ -120,6 +135,8 @@ extern int exp_delclient(struct nfsctl_client *ncp);
120extern int exp_export(struct nfsctl_export *nxp); 135extern int exp_export(struct nfsctl_export *nxp);
121extern int exp_unexport(struct nfsctl_export *nxp); 136extern int exp_unexport(struct nfsctl_export *nxp);
122 137
138extern unsigned int nfsd_versbits;
139
123#endif /* __KERNEL__ */ 140#endif /* __KERNEL__ */
124 141
125#endif /* NFSD_SYSCALL_H */ 142#endif /* NFSD_SYSCALL_H */
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 21e18ce7ca63..3c2a71b43bac 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -42,7 +42,7 @@ struct nfsd3_writeargs {
42 __u64 offset; 42 __u64 offset;
43 __u32 count; 43 __u32 count;
44 int stable; 44 int stable;
45 int len; 45 __u32 len;
46 struct kvec vec[RPCSVC_MAXPAGES]; 46 struct kvec vec[RPCSVC_MAXPAGES];
47 int vlen; 47 int vlen;
48}; 48};
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index e96fe9062500..4726ef7ba8e8 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -12,6 +12,8 @@
12 * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c. 12 * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c.
13 * For details of nodelist_scnprintf() and nodelist_parse(), see 13 * For details of nodelist_scnprintf() and nodelist_parse(), see
14 * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. 14 * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c.
15 * For details of node_remap(), see bitmap_bitremap in lib/bitmap.c.
16 * For details of nodes_remap(), see bitmap_remap in lib/bitmap.c.
15 * 17 *
16 * The available nodemask operations are: 18 * The available nodemask operations are:
17 * 19 *
@@ -52,6 +54,8 @@
52 * int nodemask_parse(ubuf, ulen, mask) Parse ascii string as nodemask 54 * int nodemask_parse(ubuf, ulen, mask) Parse ascii string as nodemask
53 * int nodelist_scnprintf(buf, len, mask) Format nodemask as list for printing 55 * int nodelist_scnprintf(buf, len, mask) Format nodemask as list for printing
54 * int nodelist_parse(buf, map) Parse ascii string as nodelist 56 * int nodelist_parse(buf, map) Parse ascii string as nodelist
57 * int node_remap(oldbit, old, new) newbit = map(old, new)(oldbit)
58 * int nodes_remap(dst, src, old, new) *dst = map(old, new)(dst)
55 * 59 *
56 * for_each_node_mask(node, mask) for-loop node over mask 60 * for_each_node_mask(node, mask) for-loop node over mask
57 * 61 *
@@ -307,6 +311,22 @@ static inline int __nodelist_parse(const char *buf, nodemask_t *dstp, int nbits)
307 return bitmap_parselist(buf, dstp->bits, nbits); 311 return bitmap_parselist(buf, dstp->bits, nbits);
308} 312}
309 313
314#define node_remap(oldbit, old, new) \
315 __node_remap((oldbit), &(old), &(new), MAX_NUMNODES)
316static inline int __node_remap(int oldbit,
317 const nodemask_t *oldp, const nodemask_t *newp, int nbits)
318{
319 return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
320}
321
322#define nodes_remap(dst, src, old, new) \
323 __nodes_remap(&(dst), &(src), &(old), &(new), MAX_NUMNODES)
324static inline void __nodes_remap(nodemask_t *dstp, const nodemask_t *srcp,
325 const nodemask_t *oldp, const nodemask_t *newp, int nbits)
326{
327 bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
328}
329
310#if MAX_NUMNODES > 1 330#if MAX_NUMNODES > 1
311#define for_each_node_mask(node, mask) \ 331#define for_each_node_mask(node, mask) \
312 for ((node) = first_node(mask); \ 332 for ((node) = first_node(mask); \
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index f34767c5fc79..343083fec258 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -287,11 +287,7 @@ extern void __mod_page_state(unsigned long offset, unsigned long delta);
287#define ClearPageReclaim(page) clear_bit(PG_reclaim, &(page)->flags) 287#define ClearPageReclaim(page) clear_bit(PG_reclaim, &(page)->flags)
288#define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) 288#define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags)
289 289
290#ifdef CONFIG_HUGETLB_PAGE
291#define PageCompound(page) test_bit(PG_compound, &(page)->flags) 290#define PageCompound(page) test_bit(PG_compound, &(page)->flags)
292#else
293#define PageCompound(page) 0
294#endif
295#define SetPageCompound(page) set_bit(PG_compound, &(page)->flags) 291#define SetPageCompound(page) set_bit(PG_compound, &(page)->flags)
296#define ClearPageCompound(page) clear_bit(PG_compound, &(page)->flags) 292#define ClearPageCompound(page) clear_bit(PG_compound, &(page)->flags)
297 293
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index d9a25647a295..ee700c6eb442 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -19,18 +19,19 @@
19#define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ 19#define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */
20#define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ 20#define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */
21 21
22static inline unsigned int __nocast mapping_gfp_mask(struct address_space * mapping) 22static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
23{ 23{
24 return mapping->flags & __GFP_BITS_MASK; 24 return (__force gfp_t)mapping->flags & __GFP_BITS_MASK;
25} 25}
26 26
27/* 27/*
28 * This is non-atomic. Only to be used before the mapping is activated. 28 * This is non-atomic. Only to be used before the mapping is activated.
29 * Probably needs a barrier... 29 * Probably needs a barrier...
30 */ 30 */
31static inline void mapping_set_gfp_mask(struct address_space *m, int mask) 31static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
32{ 32{
33 m->flags = (m->flags & ~__GFP_BITS_MASK) | mask; 33 m->flags = (m->flags & ~(__force unsigned long)__GFP_BITS_MASK) |
34 (__force unsigned long)mask;
34} 35}
35 36
36/* 37/*
@@ -52,12 +53,12 @@ void release_pages(struct page **pages, int nr, int cold);
52 53
53static inline struct page *page_cache_alloc(struct address_space *x) 54static inline struct page *page_cache_alloc(struct address_space *x)
54{ 55{
55 return alloc_pages(mapping_gfp_mask(x)|__GFP_NORECLAIM, 0); 56 return alloc_pages(mapping_gfp_mask(x), 0);
56} 57}
57 58
58static inline struct page *page_cache_alloc_cold(struct address_space *x) 59static inline struct page *page_cache_alloc_cold(struct address_space *x)
59{ 60{
60 return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD|__GFP_NORECLAIM, 0); 61 return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0);
61} 62}
62 63
63typedef int filler_t(void *, struct page *); 64typedef int filler_t(void *, struct page *);
@@ -69,7 +70,7 @@ extern struct page * find_lock_page(struct address_space *mapping,
69extern struct page * find_trylock_page(struct address_space *mapping, 70extern struct page * find_trylock_page(struct address_space *mapping,
70 unsigned long index); 71 unsigned long index);
71extern struct page * find_or_create_page(struct address_space *mapping, 72extern struct page * find_or_create_page(struct address_space *mapping,
72 unsigned long index, unsigned int gfp_mask); 73 unsigned long index, gfp_t gfp_mask);
73unsigned find_get_pages(struct address_space *mapping, pgoff_t start, 74unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
74 unsigned int nr_pages, struct page **pages); 75 unsigned int nr_pages, struct page **pages);
75unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, 76unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index,
@@ -92,9 +93,9 @@ extern int read_cache_pages(struct address_space *mapping,
92 struct list_head *pages, filler_t *filler, void *data); 93 struct list_head *pages, filler_t *filler, void *data);
93 94
94int add_to_page_cache(struct page *page, struct address_space *mapping, 95int add_to_page_cache(struct page *page, struct address_space *mapping,
95 unsigned long index, int gfp_mask); 96 unsigned long index, gfp_t gfp_mask);
96int add_to_page_cache_lru(struct page *page, struct address_space *mapping, 97int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
97 unsigned long index, int gfp_mask); 98 unsigned long index, gfp_t gfp_mask);
98extern void remove_from_page_cache(struct page *page); 99extern void remove_from_page_cache(struct page *page);
99extern void __remove_from_page_cache(struct page *page); 100extern void __remove_from_page_cache(struct page *page);
100 101
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 857126a36ecc..4877e35ae202 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -47,14 +47,15 @@
47 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) 47 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL)
48 48
49#ifdef CONFIG_ACPI 49#ifdef CONFIG_ACPI
50extern acpi_status pci_osc_control_set(u32 flags); 50extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags);
51extern acpi_status pci_osc_support_set(u32 flags); 51extern acpi_status pci_osc_support_set(u32 flags);
52#else 52#else
53#if !defined(acpi_status) 53#if !defined(acpi_status)
54typedef u32 acpi_status; 54typedef u32 acpi_status;
55#define AE_ERROR (acpi_status) (0x0001) 55#define AE_ERROR (acpi_status) (0x0001)
56#endif 56#endif
57static inline acpi_status pci_osc_control_set(u32 flags) {return AE_ERROR;} 57static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
58{return AE_ERROR;}
58static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;} 59static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;}
59#endif 60#endif
60 61
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 7349058ed778..de690ca73d58 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -132,6 +132,7 @@ struct pci_dev {
132 unsigned int is_enabled:1; /* pci_enable_device has been called */ 132 unsigned int is_enabled:1; /* pci_enable_device has been called */
133 unsigned int is_busmaster:1; /* device is busmaster */ 133 unsigned int is_busmaster:1; /* device is busmaster */
134 unsigned int no_msi:1; /* device may not use msi */ 134 unsigned int no_msi:1; /* device may not use msi */
135 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */
135 136
136 u32 saved_config_space[16]; /* config space saved at suspend time */ 137 u32 saved_config_space[16]; /* config space saved at suspend time */
137 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ 138 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
@@ -235,7 +236,6 @@ struct module;
235struct pci_driver { 236struct pci_driver {
236 struct list_head node; 237 struct list_head node;
237 char *name; 238 char *name;
238 struct module *owner;
239 const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */ 239 const struct pci_device_id *id_table; /* must be non-NULL for probe to be called */
240 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ 240 int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
241 void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ 241 void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
@@ -337,6 +337,7 @@ struct pci_dev *pci_find_device (unsigned int vendor, unsigned int device, const
337struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int device, const struct pci_dev *from); 337struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int device, const struct pci_dev *from);
338struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 338struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
339int pci_find_capability (struct pci_dev *dev, int cap); 339int pci_find_capability (struct pci_dev *dev, int cap);
340int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
340int pci_find_ext_capability (struct pci_dev *dev, int cap); 341int pci_find_ext_capability (struct pci_dev *dev, int cap);
341struct pci_bus * pci_find_next_bus(const struct pci_bus *from); 342struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
342 343
@@ -431,8 +432,13 @@ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
431 void *alignf_data); 432 void *alignf_data);
432void pci_enable_bridges(struct pci_bus *bus); 433void pci_enable_bridges(struct pci_bus *bus);
433 434
434/* New-style probing supporting hot-pluggable devices */ 435/* Proper probing supporting hot-pluggable devices */
435int pci_register_driver(struct pci_driver *); 436int __pci_register_driver(struct pci_driver *, struct module *);
437static inline int pci_register_driver(struct pci_driver *driver)
438{
439 return __pci_register_driver(driver, THIS_MODULE);
440}
441
436void pci_unregister_driver(struct pci_driver *); 442void pci_unregister_driver(struct pci_driver *);
437void pci_remove_behind_bridge(struct pci_dev *); 443void pci_remove_behind_bridge(struct pci_dev *);
438struct pci_driver *pci_dev_driver(const struct pci_dev *); 444struct pci_driver *pci_dev_driver(const struct pci_dev *);
@@ -490,6 +496,9 @@ extern void pci_disable_msix(struct pci_dev *dev);
490extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); 496extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
491#endif 497#endif
492 498
499extern void pci_block_user_cfg_access(struct pci_dev *dev);
500extern void pci_unblock_user_cfg_access(struct pci_dev *dev);
501
493/* 502/*
494 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 503 * PCI domain support. Sometimes called PCI segment (eg by ACPI),
495 * a PCI domain is defined to be a set of PCI busses which share 504 * a PCI domain is defined to be a set of PCI busses which share
@@ -543,9 +552,11 @@ static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
543static inline void pci_disable_device(struct pci_dev *dev) { } 552static inline void pci_disable_device(struct pci_dev *dev) { }
544static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; } 553static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return -EIO; }
545static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;} 554static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY;}
555static inline int __pci_register_driver(struct pci_driver *drv, struct module *owner) { return 0;}
546static inline int pci_register_driver(struct pci_driver *drv) { return 0;} 556static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
547static inline void pci_unregister_driver(struct pci_driver *drv) { } 557static inline void pci_unregister_driver(struct pci_driver *drv) { }
548static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } 558static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
559static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
549static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; } 560static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
550static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } 561static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
551 562
@@ -560,6 +571,9 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en
560 571
561#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 572#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
562 573
574static inline void pci_block_user_cfg_access(struct pci_dev *dev) { }
575static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { }
576
563#endif /* CONFIG_PCI */ 577#endif /* CONFIG_PCI */
564 578
565/* Include architecture-dependent settings and functions */ 579/* Include architecture-dependent settings and functions */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c49d28eca561..1e737e269db9 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -96,6 +96,9 @@
96#define PCI_CLASS_SERIAL_ACCESS 0x0c01 96#define PCI_CLASS_SERIAL_ACCESS 0x0c01
97#define PCI_CLASS_SERIAL_SSA 0x0c02 97#define PCI_CLASS_SERIAL_SSA 0x0c02
98#define PCI_CLASS_SERIAL_USB 0x0c03 98#define PCI_CLASS_SERIAL_USB 0x0c03
99#define PCI_CLASS_SERIAL_USB_UHCI 0x0c0300
100#define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310
101#define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320
99#define PCI_CLASS_SERIAL_FIBER 0x0c04 102#define PCI_CLASS_SERIAL_FIBER 0x0c04
100#define PCI_CLASS_SERIAL_SMBUS 0x0c05 103#define PCI_CLASS_SERIAL_SMBUS 0x0c05
101 104
@@ -132,9 +135,6 @@
132 135
133#define PCI_VENDOR_ID_COMPAQ 0x0e11 136#define PCI_VENDOR_ID_COMPAQ 0x0e11
134#define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508 137#define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508
135#define PCI_DEVICE_ID_COMPAQ_1280 0x3033
136#define PCI_DEVICE_ID_COMPAQ_TRIFLEX 0x4000
137#define PCI_DEVICE_ID_COMPAQ_6010 0x6010
138#define PCI_DEVICE_ID_COMPAQ_TACHYON 0xa0fc 138#define PCI_DEVICE_ID_COMPAQ_TACHYON 0xa0fc
139#define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10 139#define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10
140#define PCI_DEVICE_ID_COMPAQ_NETEL100 0xae32 140#define PCI_DEVICE_ID_COMPAQ_NETEL100 0xae32
@@ -185,6 +185,7 @@
185#define PCI_DEVICE_ID_LSI_61C102 0x0901 185#define PCI_DEVICE_ID_LSI_61C102 0x0901
186#define PCI_DEVICE_ID_LSI_63C815 0x1000 186#define PCI_DEVICE_ID_LSI_63C815 0x1000
187#define PCI_DEVICE_ID_LSI_SAS1064 0x0050 187#define PCI_DEVICE_ID_LSI_SAS1064 0x0050
188#define PCI_DEVICE_ID_LSI_SAS1064R 0x0411
188#define PCI_DEVICE_ID_LSI_SAS1066 0x005E 189#define PCI_DEVICE_ID_LSI_SAS1066 0x005E
189#define PCI_DEVICE_ID_LSI_SAS1068 0x0054 190#define PCI_DEVICE_ID_LSI_SAS1068 0x0054
190#define PCI_DEVICE_ID_LSI_SAS1064A 0x005C 191#define PCI_DEVICE_ID_LSI_SAS1064A 0x005C
@@ -273,7 +274,6 @@
273#define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050 274#define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050
274#define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051 275#define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051
275#define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052 276#define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052
276#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452
277#define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053 277#define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053
278#define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054 278#define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054
279#define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055 279#define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055
@@ -281,8 +281,6 @@
281#define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057 281#define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057
282#define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058 282#define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058
283/* Rage128 M4 */ 283/* Rage128 M4 */
284#define PCI_DEVICE_ID_ATI_RADEON_LE 0x4d45
285#define PCI_DEVICE_ID_ATI_RADEON_LF 0x4d46
286/* Radeon R100 */ 284/* Radeon R100 */
287#define PCI_DEVICE_ID_ATI_RADEON_QD 0x5144 285#define PCI_DEVICE_ID_ATI_RADEON_QD 0x5144
288#define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145 286#define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145
@@ -303,32 +301,22 @@
303#define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157 301#define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157
304#define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158 302#define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158
305/* Radeon NV-100 */ 303/* Radeon NV-100 */
306#define PCI_DEVICE_ID_ATI_RADEON_N1 0x5159
307#define PCI_DEVICE_ID_ATI_RADEON_N2 0x515a
308/* Radeon RV250 (9000) */ 304/* Radeon RV250 (9000) */
309#define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964 305#define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964
310#define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965 306#define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965
311#define PCI_DEVICE_ID_ATI_RADEON_If 0x4966 307#define PCI_DEVICE_ID_ATI_RADEON_If 0x4966
312#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967 308#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967
313/* Radeon RV280 (9200) */ 309/* Radeon RV280 (9200) */
314#define PCI_DEVICE_ID_ATI_RADEON_Y_ 0x5960
315#define PCI_DEVICE_ID_ATI_RADEON_Ya 0x5961 310#define PCI_DEVICE_ID_ATI_RADEON_Ya 0x5961
316#define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964 311#define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964
317/* Radeon R300 (9500) */ 312/* Radeon R300 (9500) */
318#define PCI_DEVICE_ID_ATI_RADEON_AD 0x4144
319/* Radeon R300 (9700) */ 313/* Radeon R300 (9700) */
320#define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44 314#define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44
321#define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45 315#define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45
322#define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46 316#define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46
323#define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47 317#define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47
324#define PCI_DEVICE_ID_ATI_RADEON_AE 0x4145
325#define PCI_DEVICE_ID_ATI_RADEON_AF 0x4146
326/* Radeon R350 (9800) */ 318/* Radeon R350 (9800) */
327#define PCI_DEVICE_ID_ATI_RADEON_NH 0x4e48
328#define PCI_DEVICE_ID_ATI_RADEON_NI 0x4e49
329/* Radeon RV350 (9600) */ 319/* Radeon RV350 (9600) */
330#define PCI_DEVICE_ID_ATI_RADEON_AP 0x4150
331#define PCI_DEVICE_ID_ATI_RADEON_AR 0x4152
332/* Radeon M6 */ 320/* Radeon M6 */
333#define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59 321#define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59
334#define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a 322#define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a
@@ -341,10 +329,6 @@
341#define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4c66 329#define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4c66
342#define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4c67 330#define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4c67
343/* Radeon */ 331/* Radeon */
344#define PCI_DEVICE_ID_ATI_RADEON_RA 0x5144
345#define PCI_DEVICE_ID_ATI_RADEON_RB 0x5145
346#define PCI_DEVICE_ID_ATI_RADEON_RC 0x5146
347#define PCI_DEVICE_ID_ATI_RADEON_RD 0x5147
348/* RadeonIGP */ 332/* RadeonIGP */
349#define PCI_DEVICE_ID_ATI_RS100 0xcab0 333#define PCI_DEVICE_ID_ATI_RS100 0xcab0
350#define PCI_DEVICE_ID_ATI_RS200 0xcab2 334#define PCI_DEVICE_ID_ATI_RS200 0xcab2
@@ -392,6 +376,7 @@
392#define PCI_DEVICE_ID_NS_87560_USB 0x0012 376#define PCI_DEVICE_ID_NS_87560_USB 0x0012
393#define PCI_DEVICE_ID_NS_83815 0x0020 377#define PCI_DEVICE_ID_NS_83815 0x0020
394#define PCI_DEVICE_ID_NS_83820 0x0022 378#define PCI_DEVICE_ID_NS_83820 0x0022
379#define PCI_DEVICE_ID_NS_SATURN 0x0035
395#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 380#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500
396#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 381#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501
397#define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502 382#define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502
@@ -402,6 +387,7 @@
402#define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511 387#define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511
403#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515 388#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515
404#define PCI_DEVICE_ID_NS_87410 0xd001 389#define PCI_DEVICE_ID_NS_87410 0xd001
390#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
405 391
406#define PCI_VENDOR_ID_TSENG 0x100c 392#define PCI_VENDOR_ID_TSENG 0x100c
407#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202 393#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202
@@ -444,45 +430,29 @@
444#define PCI_DEVICE_ID_CIRRUS_5465 0x00d6 430#define PCI_DEVICE_ID_CIRRUS_5465 0x00d6
445#define PCI_DEVICE_ID_CIRRUS_6729 0x1100 431#define PCI_DEVICE_ID_CIRRUS_6729 0x1100
446#define PCI_DEVICE_ID_CIRRUS_6832 0x1110 432#define PCI_DEVICE_ID_CIRRUS_6832 0x1110
447#define PCI_DEVICE_ID_CIRRUS_7542 0x1200
448#define PCI_DEVICE_ID_CIRRUS_7543 0x1202 433#define PCI_DEVICE_ID_CIRRUS_7543 0x1202
449#define PCI_DEVICE_ID_CIRRUS_7541 0x1204
450#define PCI_DEVICE_ID_CIRRUS_4610 0x6001 434#define PCI_DEVICE_ID_CIRRUS_4610 0x6001
451#define PCI_DEVICE_ID_CIRRUS_4612 0x6003 435#define PCI_DEVICE_ID_CIRRUS_4612 0x6003
452#define PCI_DEVICE_ID_CIRRUS_4615 0x6004 436#define PCI_DEVICE_ID_CIRRUS_4615 0x6004
453#define PCI_DEVICE_ID_CIRRUS_4281 0x6005
454 437
455#define PCI_VENDOR_ID_IBM 0x1014 438#define PCI_VENDOR_ID_IBM 0x1014
456#define PCI_DEVICE_ID_IBM_FIRE_CORAL 0x000a
457#define PCI_DEVICE_ID_IBM_TR 0x0018 439#define PCI_DEVICE_ID_IBM_TR 0x0018
458#define PCI_DEVICE_ID_IBM_82G2675 0x001d
459#define PCI_DEVICE_ID_IBM_MCA 0x0020
460#define PCI_DEVICE_ID_IBM_82351 0x0022
461#define PCI_DEVICE_ID_IBM_PYTHON 0x002d
462#define PCI_DEVICE_ID_IBM_SERVERAID 0x002e
463#define PCI_DEVICE_ID_IBM_TR_WAKE 0x003e 440#define PCI_DEVICE_ID_IBM_TR_WAKE 0x003e
464#define PCI_DEVICE_ID_IBM_MPIC 0x0046
465#define PCI_DEVICE_ID_IBM_3780IDSP 0x007d
466#define PCI_DEVICE_ID_IBM_CHUKAR 0x0096
467#define PCI_DEVICE_ID_IBM_CPC710_PCI64 0x00fc 441#define PCI_DEVICE_ID_IBM_CPC710_PCI64 0x00fc
468#define PCI_DEVICE_ID_IBM_CPC710_PCI32 0x0105
469#define PCI_DEVICE_ID_IBM_405GP 0x0156
470#define PCI_DEVICE_ID_IBM_SNIPE 0x0180 442#define PCI_DEVICE_ID_IBM_SNIPE 0x0180
471#define PCI_DEVICE_ID_IBM_SERVERAIDI960 0x01bd
472#define PCI_DEVICE_ID_IBM_CITRINE 0x028C 443#define PCI_DEVICE_ID_IBM_CITRINE 0x028C
473#define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166 444#define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166
474#define PCI_DEVICE_ID_IBM_MPIC_2 0xffff 445#define PCI_DEVICE_ID_IBM_OBSIDIAN 0x02BD
475#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031 446#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031
476#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219 447#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219
477#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A 448#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A
478#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251 449#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251
479#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 450#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252
480 451
481#define PCI_VENDOR_ID_COMPEX2 0x101a // pci.ids says "AT&T GIS (NCR)" 452#define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */
482#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 453#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005
483 454
484#define PCI_VENDOR_ID_WD 0x101c 455#define PCI_VENDOR_ID_WD 0x101c
485#define PCI_DEVICE_ID_WD_7197 0x3296
486#define PCI_DEVICE_ID_WD_90C 0xc24a 456#define PCI_DEVICE_ID_WD_90C 0xc24a
487 457
488#define PCI_VENDOR_ID_AMI 0x101e 458#define PCI_VENDOR_ID_AMI 0x101e
@@ -499,33 +469,18 @@
499#define PCI_DEVICE_ID_AMD_FE_GATE_7006 0x7006 469#define PCI_DEVICE_ID_AMD_FE_GATE_7006 0x7006
500#define PCI_DEVICE_ID_AMD_FE_GATE_7007 0x7007 470#define PCI_DEVICE_ID_AMD_FE_GATE_7007 0x7007
501#define PCI_DEVICE_ID_AMD_FE_GATE_700C 0x700C 471#define PCI_DEVICE_ID_AMD_FE_GATE_700C 0x700C
502#define PCI_DEVICE_ID_AMD_FE_GATE_700D 0x700D
503#define PCI_DEVICE_ID_AMD_FE_GATE_700E 0x700E 472#define PCI_DEVICE_ID_AMD_FE_GATE_700E 0x700E
504#define PCI_DEVICE_ID_AMD_FE_GATE_700F 0x700F
505#define PCI_DEVICE_ID_AMD_COBRA_7400 0x7400
506#define PCI_DEVICE_ID_AMD_COBRA_7401 0x7401 473#define PCI_DEVICE_ID_AMD_COBRA_7401 0x7401
507#define PCI_DEVICE_ID_AMD_COBRA_7403 0x7403
508#define PCI_DEVICE_ID_AMD_COBRA_7404 0x7404
509#define PCI_DEVICE_ID_AMD_VIPER_7408 0x7408
510#define PCI_DEVICE_ID_AMD_VIPER_7409 0x7409 474#define PCI_DEVICE_ID_AMD_VIPER_7409 0x7409
511#define PCI_DEVICE_ID_AMD_VIPER_740B 0x740B 475#define PCI_DEVICE_ID_AMD_VIPER_740B 0x740B
512#define PCI_DEVICE_ID_AMD_VIPER_740C 0x740C
513#define PCI_DEVICE_ID_AMD_VIPER_7410 0x7410 476#define PCI_DEVICE_ID_AMD_VIPER_7410 0x7410
514#define PCI_DEVICE_ID_AMD_VIPER_7411 0x7411 477#define PCI_DEVICE_ID_AMD_VIPER_7411 0x7411
515#define PCI_DEVICE_ID_AMD_VIPER_7413 0x7413 478#define PCI_DEVICE_ID_AMD_VIPER_7413 0x7413
516#define PCI_DEVICE_ID_AMD_VIPER_7414 0x7414 479#define PCI_DEVICE_ID_AMD_VIPER_7440 0x7440
517#define PCI_DEVICE_ID_AMD_OPUS_7440 0x7440
518# define PCI_DEVICE_ID_AMD_VIPER_7440 PCI_DEVICE_ID_AMD_OPUS_7440
519#define PCI_DEVICE_ID_AMD_OPUS_7441 0x7441 480#define PCI_DEVICE_ID_AMD_OPUS_7441 0x7441
520# define PCI_DEVICE_ID_AMD_VIPER_7441 PCI_DEVICE_ID_AMD_OPUS_7441
521#define PCI_DEVICE_ID_AMD_OPUS_7443 0x7443 481#define PCI_DEVICE_ID_AMD_OPUS_7443 0x7443
522# define PCI_DEVICE_ID_AMD_VIPER_7443 PCI_DEVICE_ID_AMD_OPUS_7443 482#define PCI_DEVICE_ID_AMD_VIPER_7443 0x7443
523#define PCI_DEVICE_ID_AMD_OPUS_7445 0x7445 483#define PCI_DEVICE_ID_AMD_OPUS_7445 0x7445
524#define PCI_DEVICE_ID_AMD_OPUS_7448 0x7448
525# define PCI_DEVICE_ID_AMD_VIPER_7448 PCI_DEVICE_ID_AMD_OPUS_7448
526#define PCI_DEVICE_ID_AMD_OPUS_7449 0x7449
527# define PCI_DEVICE_ID_AMD_VIPER_7449 PCI_DEVICE_ID_AMD_OPUS_7449
528#define PCI_DEVICE_ID_AMD_8111_LAN 0x7462
529#define PCI_DEVICE_ID_AMD_8111_LPC 0x7468 484#define PCI_DEVICE_ID_AMD_8111_LPC 0x7468
530#define PCI_DEVICE_ID_AMD_8111_IDE 0x7469 485#define PCI_DEVICE_ID_AMD_8111_IDE 0x7469
531#define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a 486#define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a
@@ -534,6 +489,8 @@
534#define PCI_DEVICE_ID_AMD_8151_0 0x7454 489#define PCI_DEVICE_ID_AMD_8151_0 0x7454
535#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450 490#define PCI_DEVICE_ID_AMD_8131_APIC 0x7450
536 491
492#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
493
537#define PCI_VENDOR_ID_TRIDENT 0x1023 494#define PCI_VENDOR_ID_TRIDENT 0x1023
538#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 495#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000
539#define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001 496#define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001
@@ -559,12 +516,14 @@
559#define PCI_VENDOR_ID_DELL 0x1028 516#define PCI_VENDOR_ID_DELL 0x1028
560#define PCI_DEVICE_ID_DELL_RACIII 0x0008 517#define PCI_DEVICE_ID_DELL_RACIII 0x0008
561#define PCI_DEVICE_ID_DELL_RAC4 0x0012 518#define PCI_DEVICE_ID_DELL_RAC4 0x0012
519#define PCI_DEVICE_ID_DELL_PERC5 0x0015
562 520
563#define PCI_VENDOR_ID_MATROX 0x102B 521#define PCI_VENDOR_ID_MATROX 0x102B
564#define PCI_DEVICE_ID_MATROX_MGA_2 0x0518 522#define PCI_DEVICE_ID_MATROX_MGA_2 0x0518
565#define PCI_DEVICE_ID_MATROX_MIL 0x0519 523#define PCI_DEVICE_ID_MATROX_MIL 0x0519
566#define PCI_DEVICE_ID_MATROX_MYS 0x051A 524#define PCI_DEVICE_ID_MATROX_MYS 0x051A
567#define PCI_DEVICE_ID_MATROX_MIL_2 0x051b 525#define PCI_DEVICE_ID_MATROX_MIL_2 0x051b
526#define PCI_DEVICE_ID_MATROX_MYS_AGP 0x051e
568#define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f 527#define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f
569#define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10 528#define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10
570#define PCI_DEVICE_ID_MATROX_G100_MM 0x1000 529#define PCI_DEVICE_ID_MATROX_G100_MM 0x1000
@@ -582,7 +541,6 @@
582#define PCI_DEVICE_ID_CT_65550 0x00e0 541#define PCI_DEVICE_ID_CT_65550 0x00e0
583#define PCI_DEVICE_ID_CT_65554 0x00e4 542#define PCI_DEVICE_ID_CT_65554 0x00e4
584#define PCI_DEVICE_ID_CT_65555 0x00e5 543#define PCI_DEVICE_ID_CT_65555 0x00e5
585#define PCI_DEVICE_ID_CT_69000 0x00c0
586 544
587#define PCI_VENDOR_ID_MIRO 0x1031 545#define PCI_VENDOR_ID_MIRO 0x1031
588#define PCI_DEVICE_ID_MIRO_36050 0x5601 546#define PCI_DEVICE_ID_MIRO_36050 0x5601
@@ -636,7 +594,6 @@
636#define PCI_DEVICE_ID_SI_550 0x0550 594#define PCI_DEVICE_ID_SI_550 0x0550
637#define PCI_DEVICE_ID_SI_540_VGA 0x5300 595#define PCI_DEVICE_ID_SI_540_VGA 0x5300
638#define PCI_DEVICE_ID_SI_550_VGA 0x5315 596#define PCI_DEVICE_ID_SI_550_VGA 0x5315
639#define PCI_DEVICE_ID_SI_601 0x0601
640#define PCI_DEVICE_ID_SI_620 0x0620 597#define PCI_DEVICE_ID_SI_620 0x0620
641#define PCI_DEVICE_ID_SI_630 0x0630 598#define PCI_DEVICE_ID_SI_630 0x0630
642#define PCI_DEVICE_ID_SI_633 0x0633 599#define PCI_DEVICE_ID_SI_633 0x0633
@@ -647,30 +604,23 @@
647#define PCI_DEVICE_ID_SI_648 0x0648 604#define PCI_DEVICE_ID_SI_648 0x0648
648#define PCI_DEVICE_ID_SI_650 0x0650 605#define PCI_DEVICE_ID_SI_650 0x0650
649#define PCI_DEVICE_ID_SI_651 0x0651 606#define PCI_DEVICE_ID_SI_651 0x0651
650#define PCI_DEVICE_ID_SI_652 0x0652
651#define PCI_DEVICE_ID_SI_655 0x0655 607#define PCI_DEVICE_ID_SI_655 0x0655
652#define PCI_DEVICE_ID_SI_661 0x0661 608#define PCI_DEVICE_ID_SI_661 0x0661
653#define PCI_DEVICE_ID_SI_730 0x0730 609#define PCI_DEVICE_ID_SI_730 0x0730
654#define PCI_DEVICE_ID_SI_733 0x0733 610#define PCI_DEVICE_ID_SI_733 0x0733
655#define PCI_DEVICE_ID_SI_630_VGA 0x6300 611#define PCI_DEVICE_ID_SI_630_VGA 0x6300
656#define PCI_DEVICE_ID_SI_730_VGA 0x7300
657#define PCI_DEVICE_ID_SI_735 0x0735 612#define PCI_DEVICE_ID_SI_735 0x0735
658#define PCI_DEVICE_ID_SI_740 0x0740 613#define PCI_DEVICE_ID_SI_740 0x0740
659#define PCI_DEVICE_ID_SI_741 0x0741 614#define PCI_DEVICE_ID_SI_741 0x0741
660#define PCI_DEVICE_ID_SI_745 0x0745 615#define PCI_DEVICE_ID_SI_745 0x0745
661#define PCI_DEVICE_ID_SI_746 0x0746 616#define PCI_DEVICE_ID_SI_746 0x0746
662#define PCI_DEVICE_ID_SI_748 0x0748
663#define PCI_DEVICE_ID_SI_750 0x0750
664#define PCI_DEVICE_ID_SI_751 0x0751
665#define PCI_DEVICE_ID_SI_752 0x0752
666#define PCI_DEVICE_ID_SI_755 0x0755 617#define PCI_DEVICE_ID_SI_755 0x0755
667#define PCI_DEVICE_ID_SI_760 0x0760 618#define PCI_DEVICE_ID_SI_760 0x0760
668#define PCI_DEVICE_ID_SI_900 0x0900 619#define PCI_DEVICE_ID_SI_900 0x0900
669#define PCI_DEVICE_ID_SI_961 0x0961 620#define PCI_DEVICE_ID_SI_961 0x0961
670#define PCI_DEVICE_ID_SI_962 0x0962 621#define PCI_DEVICE_ID_SI_962 0x0962
671#define PCI_DEVICE_ID_SI_963 0x0963 622#define PCI_DEVICE_ID_SI_963 0x0963
672#define PCI_DEVICE_ID_SI_5107 0x5107 623#define PCI_DEVICE_ID_SI_965 0x0965
673#define PCI_DEVICE_ID_SI_5300 0x5300
674#define PCI_DEVICE_ID_SI_5511 0x5511 624#define PCI_DEVICE_ID_SI_5511 0x5511
675#define PCI_DEVICE_ID_SI_5513 0x5513 625#define PCI_DEVICE_ID_SI_5513 0x5513
676#define PCI_DEVICE_ID_SI_5518 0x5518 626#define PCI_DEVICE_ID_SI_5518 0x5518
@@ -682,10 +632,6 @@
682#define PCI_DEVICE_ID_SI_5597 0x5597 632#define PCI_DEVICE_ID_SI_5597 0x5597
683#define PCI_DEVICE_ID_SI_5598 0x5598 633#define PCI_DEVICE_ID_SI_5598 0x5598
684#define PCI_DEVICE_ID_SI_5600 0x5600 634#define PCI_DEVICE_ID_SI_5600 0x5600
685#define PCI_DEVICE_ID_SI_6300 0x6300
686#define PCI_DEVICE_ID_SI_6306 0x6306
687#define PCI_DEVICE_ID_SI_6326 0x6326
688#define PCI_DEVICE_ID_SI_7001 0x7001
689#define PCI_DEVICE_ID_SI_7012 0x7012 635#define PCI_DEVICE_ID_SI_7012 0x7012
690#define PCI_DEVICE_ID_SI_7013 0x7013 636#define PCI_DEVICE_ID_SI_7013 0x7013
691#define PCI_DEVICE_ID_SI_7016 0x7016 637#define PCI_DEVICE_ID_SI_7016 0x7016
@@ -706,23 +652,19 @@
706#define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049 652#define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049
707#define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A 653#define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A
708#define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B 654#define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B
709#define PCI_DEVICE_ID_HP_PCI_LBA 0x1054
710#define PCI_DEVICE_ID_HP_REO_SBA 0x10f0
711#define PCI_DEVICE_ID_HP_REO_IOC 0x10f1 655#define PCI_DEVICE_ID_HP_REO_IOC 0x10f1
712#define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b 656#define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b
713#define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223 657#define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223
714#define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226 658#define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226
715#define PCI_DEVICE_ID_HP_DIVA_POWERBAR 0x1227 659#define PCI_DEVICE_ID_HP_DIVA_POWERBAR 0x1227
716#define PCI_DEVICE_ID_HP_ZX1_SBA 0x1229
717#define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a 660#define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a
718#define PCI_DEVICE_ID_HP_PCIX_LBA 0x122e 661#define PCI_DEVICE_ID_HP_PCIX_LBA 0x122e
719#define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c 662#define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c
720#define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282 663#define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282
721#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 664#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290
722#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301 665#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301
723#define PCI_DEVICE_ID_HP_CISS 0x3210 666#define PCI_DEVICE_ID_HP_DIVA_HURRICANE 0x132a
724#define PCI_DEVICE_ID_HP_CISSA 0x3220 667#define PCI_DEVICE_ID_HP_CISSA 0x3220
725#define PCI_DEVICE_ID_HP_CISSB 0x3222
726#define PCI_DEVICE_ID_HP_CISSC 0x3230 668#define PCI_DEVICE_ID_HP_CISSC 0x3230
727#define PCI_DEVICE_ID_HP_CISSD 0x3238 669#define PCI_DEVICE_ID_HP_CISSD 0x3238
728#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 670#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
@@ -730,8 +672,6 @@
730#define PCI_VENDOR_ID_PCTECH 0x1042 672#define PCI_VENDOR_ID_PCTECH 0x1042
731#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 673#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000
732#define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001 674#define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001
733#define PCI_DEVICE_ID_PCTECH_SAMURAI_0 0x3000
734#define PCI_DEVICE_ID_PCTECH_SAMURAI_1 0x3010
735#define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020 675#define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020
736 676
737#define PCI_VENDOR_ID_ASUSTEK 0x1043 677#define PCI_VENDOR_ID_ASUSTEK 0x1043
@@ -741,24 +681,15 @@
741#define PCI_DEVICE_ID_DPT 0xa400 681#define PCI_DEVICE_ID_DPT 0xa400
742 682
743#define PCI_VENDOR_ID_OPTI 0x1045 683#define PCI_VENDOR_ID_OPTI 0x1045
744#define PCI_DEVICE_ID_OPTI_92C178 0xc178
745#define PCI_DEVICE_ID_OPTI_82C557 0xc557
746#define PCI_DEVICE_ID_OPTI_82C558 0xc558 684#define PCI_DEVICE_ID_OPTI_82C558 0xc558
747#define PCI_DEVICE_ID_OPTI_82C621 0xc621 685#define PCI_DEVICE_ID_OPTI_82C621 0xc621
748#define PCI_DEVICE_ID_OPTI_82C700 0xc700 686#define PCI_DEVICE_ID_OPTI_82C700 0xc700
749#define PCI_DEVICE_ID_OPTI_82C701 0xc701
750#define PCI_DEVICE_ID_OPTI_82C814 0xc814
751#define PCI_DEVICE_ID_OPTI_82C822 0xc822
752#define PCI_DEVICE_ID_OPTI_82C861 0xc861
753#define PCI_DEVICE_ID_OPTI_82C825 0xd568 687#define PCI_DEVICE_ID_OPTI_82C825 0xd568
754 688
755#define PCI_VENDOR_ID_ELSA 0x1048 689#define PCI_VENDOR_ID_ELSA 0x1048
756#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 690#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
757#define PCI_DEVICE_ID_ELSA_QS3000 0x3000 691#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
758 692
759#define PCI_VENDOR_ID_SGS 0x104a
760#define PCI_DEVICE_ID_SGS_2000 0x0008
761#define PCI_DEVICE_ID_SGS_1764 0x0009
762 693
763#define PCI_VENDOR_ID_BUSLOGIC 0x104B 694#define PCI_VENDOR_ID_BUSLOGIC 0x104B
764#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 695#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140
@@ -766,9 +697,10 @@
766#define PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT 0x8130 697#define PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT 0x8130
767 698
768#define PCI_VENDOR_ID_TI 0x104c 699#define PCI_VENDOR_ID_TI 0x104c
769#define PCI_DEVICE_ID_TI_TVP4010 0x3d04
770#define PCI_DEVICE_ID_TI_TVP4020 0x3d07 700#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
771#define PCI_DEVICE_ID_TI_4450 0x8011 701#define PCI_DEVICE_ID_TI_4450 0x8011
702#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031
703#define PCI_DEVICE_ID_TI_X515 0x8036
772#define PCI_DEVICE_ID_TI_1130 0xac12 704#define PCI_DEVICE_ID_TI_1130 0xac12
773#define PCI_DEVICE_ID_TI_1031 0xac13 705#define PCI_DEVICE_ID_TI_1031 0xac13
774#define PCI_DEVICE_ID_TI_1131 0xac15 706#define PCI_DEVICE_ID_TI_1131 0xac15
@@ -785,22 +717,23 @@
785#define PCI_DEVICE_ID_TI_4451 0xac42 717#define PCI_DEVICE_ID_TI_4451 0xac42
786#define PCI_DEVICE_ID_TI_4510 0xac44 718#define PCI_DEVICE_ID_TI_4510 0xac44
787#define PCI_DEVICE_ID_TI_4520 0xac46 719#define PCI_DEVICE_ID_TI_4520 0xac46
720#define PCI_DEVICE_ID_TI_7510 0xac47
721#define PCI_DEVICE_ID_TI_7610 0xac48
722#define PCI_DEVICE_ID_TI_7410 0xac49
788#define PCI_DEVICE_ID_TI_1410 0xac50 723#define PCI_DEVICE_ID_TI_1410 0xac50
789#define PCI_DEVICE_ID_TI_1420 0xac51 724#define PCI_DEVICE_ID_TI_1420 0xac51
790#define PCI_DEVICE_ID_TI_1451A 0xac52 725#define PCI_DEVICE_ID_TI_1451A 0xac52
791#define PCI_DEVICE_ID_TI_1620 0xac54 726#define PCI_DEVICE_ID_TI_1620 0xac54
792#define PCI_DEVICE_ID_TI_1520 0xac55 727#define PCI_DEVICE_ID_TI_1520 0xac55
793#define PCI_DEVICE_ID_TI_1510 0xac56 728#define PCI_DEVICE_ID_TI_1510 0xac56
729#define PCI_DEVICE_ID_TI_X620 0xac8d
730#define PCI_DEVICE_ID_TI_X420 0xac8e
794 731
795#define PCI_VENDOR_ID_SONY 0x104d 732#define PCI_VENDOR_ID_SONY 0x104d
796#define PCI_DEVICE_ID_SONY_CXD3222 0x8039
797 733
798#define PCI_VENDOR_ID_OAK 0x104e
799#define PCI_DEVICE_ID_OAK_OTI107 0x0107
800 734
801/* Winbond have two vendor IDs! See 0x10ad as well */ 735/* Winbond have two vendor IDs! See 0x10ad as well */
802#define PCI_VENDOR_ID_WINBOND2 0x1050 736#define PCI_VENDOR_ID_WINBOND2 0x1050
803#define PCI_DEVICE_ID_WINBOND2_89C940 0x0940
804#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a 737#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a
805#define PCI_DEVICE_ID_WINBOND2_6692 0x6692 738#define PCI_DEVICE_ID_WINBOND2_6692 0x6692
806 739
@@ -809,19 +742,15 @@
809 742
810#define PCI_VENDOR_ID_EFAR 0x1055 743#define PCI_VENDOR_ID_EFAR 0x1055
811#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130 744#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130
812#define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460
813#define PCI_DEVICE_ID_EFAR_SLC90E66_2 0x9462
814#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463 745#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463
815 746
816#define PCI_VENDOR_ID_MOTOROLA 0x1057 747#define PCI_VENDOR_ID_MOTOROLA 0x1057
817#define PCI_VENDOR_ID_MOTOROLA_OOPS 0x1507
818#define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001 748#define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001
819#define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002 749#define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002
820#define PCI_DEVICE_ID_MOTOROLA_MPC107 0x0004 750#define PCI_DEVICE_ID_MOTOROLA_MPC107 0x0004
821#define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801 751#define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801
822#define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802 752#define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802
823#define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803 753#define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803
824#define PCI_DEVICE_ID_MOTOROLA_CPX8216 0x4806
825#define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b 754#define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b
826#define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803 755#define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803
827 756
@@ -832,33 +761,19 @@
832#define PCI_DEVICE_ID_PROMISE_20262 0x4d38 761#define PCI_DEVICE_ID_PROMISE_20262 0x4d38
833#define PCI_DEVICE_ID_PROMISE_20263 0x0D38 762#define PCI_DEVICE_ID_PROMISE_20263 0x0D38
834#define PCI_DEVICE_ID_PROMISE_20268 0x4d68 763#define PCI_DEVICE_ID_PROMISE_20268 0x4d68
835#define PCI_DEVICE_ID_PROMISE_20268R 0x6268
836#define PCI_DEVICE_ID_PROMISE_20269 0x4d69 764#define PCI_DEVICE_ID_PROMISE_20269 0x4d69
837#define PCI_DEVICE_ID_PROMISE_20270 0x6268 765#define PCI_DEVICE_ID_PROMISE_20270 0x6268
838#define PCI_DEVICE_ID_PROMISE_20271 0x6269 766#define PCI_DEVICE_ID_PROMISE_20271 0x6269
839#define PCI_DEVICE_ID_PROMISE_20275 0x1275 767#define PCI_DEVICE_ID_PROMISE_20275 0x1275
840#define PCI_DEVICE_ID_PROMISE_20276 0x5275 768#define PCI_DEVICE_ID_PROMISE_20276 0x5275
841#define PCI_DEVICE_ID_PROMISE_20277 0x7275 769#define PCI_DEVICE_ID_PROMISE_20277 0x7275
842#define PCI_DEVICE_ID_PROMISE_5300 0x5300
843 770
844#define PCI_VENDOR_ID_N9 0x105d
845#define PCI_DEVICE_ID_N9_I128 0x2309
846#define PCI_DEVICE_ID_N9_I128_2 0x2339
847#define PCI_DEVICE_ID_N9_I128_T2R 0x493d
848 771
849#define PCI_VENDOR_ID_UMC 0x1060 772#define PCI_VENDOR_ID_UMC 0x1060
850#define PCI_DEVICE_ID_UMC_UM8673F 0x0101 773#define PCI_DEVICE_ID_UMC_UM8673F 0x0101
851#define PCI_DEVICE_ID_UMC_UM8891A 0x0891
852#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a 774#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a
853#define PCI_DEVICE_ID_UMC_UM8886A 0x886a 775#define PCI_DEVICE_ID_UMC_UM8886A 0x886a
854#define PCI_DEVICE_ID_UMC_UM8881F 0x8881
855#define PCI_DEVICE_ID_UMC_UM8886F 0x8886
856#define PCI_DEVICE_ID_UMC_UM9017F 0x9017
857#define PCI_DEVICE_ID_UMC_UM8886N 0xe886
858#define PCI_DEVICE_ID_UMC_UM8891N 0xe891
859 776
860#define PCI_VENDOR_ID_X 0x1061
861#define PCI_DEVICE_ID_X_AGX016 0x0001
862 777
863#define PCI_VENDOR_ID_MYLEX 0x1069 778#define PCI_VENDOR_ID_MYLEX 0x1069
864#define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001 779#define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001
@@ -869,39 +784,32 @@
869#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 784#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56
870#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166 785#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166
871 786
872#define PCI_VENDOR_ID_PICOP 0x1066
873#define PCI_DEVICE_ID_PICOP_PT86C52X 0x0001
874#define PCI_DEVICE_ID_PICOP_PT80C524 0x8002
875 787
876#define PCI_VENDOR_ID_APPLE 0x106b 788#define PCI_VENDOR_ID_APPLE 0x106b
877#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 789#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001
878#define PCI_DEVICE_ID_APPLE_GC 0x0002
879#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e 790#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e
880#define PCI_DEVICE_ID_APPLE_UNI_N_FW 0x0018 791#define PCI_DEVICE_ID_APPLE_UNI_N_FW 0x0018
881#define PCI_DEVICE_ID_APPLE_KL_USB 0x0019
882#define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020 792#define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020
883#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC 0x0021 793#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC 0x0021
884#define PCI_DEVICE_ID_APPLE_KEYLARGO 0x0022
885#define PCI_DEVICE_ID_APPLE_UNI_N_GMACP 0x0024 794#define PCI_DEVICE_ID_APPLE_UNI_N_GMACP 0x0024
886#define PCI_DEVICE_ID_APPLE_KEYLARGO_P 0x0025
887#define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026
888#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 795#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027
889#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d 796#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d
890#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e 797#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e
891#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030
892#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 798#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032
893#define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033 799#define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033
894#define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 800#define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034
895#define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b 801#define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b
896#define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e
897#define PCI_DEVICE_ID_APPLE_K2_ATA100 0x0043 802#define PCI_DEVICE_ID_APPLE_K2_ATA100 0x0043
898#define PCI_DEVICE_ID_APPLE_U3_AGP 0x004b 803#define PCI_DEVICE_ID_APPLE_U3_AGP 0x004b
899#define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c 804#define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c
900#define PCI_DEVICE_ID_APPLE_SH_ATA 0x0050 805#define PCI_DEVICE_ID_APPLE_SH_ATA 0x0050
901#define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051 806#define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051
902#define PCI_DEVICE_ID_APPLE_SH_FW 0x0052
903#define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058 807#define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058
904#define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059 808#define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059
809#define PCI_DEVICE_ID_APPLE_IPID2_AGP 0x0066
810#define PCI_DEVICE_ID_APPLE_IPID2_ATA 0x0069
811#define PCI_DEVICE_ID_APPLE_IPID2_FW 0x006a
812#define PCI_DEVICE_ID_APPLE_IPID2_GMAC 0x006b
905#define PCI_DEVICE_ID_APPLE_TIGON3 0x1645 813#define PCI_DEVICE_ID_APPLE_TIGON3 0x1645
906 814
907#define PCI_VENDOR_ID_YAMAHA 0x1073 815#define PCI_VENDOR_ID_YAMAHA 0x1073
@@ -912,12 +820,9 @@
912#define PCI_DEVICE_ID_YAMAHA_744 0x0010 820#define PCI_DEVICE_ID_YAMAHA_744 0x0010
913#define PCI_DEVICE_ID_YAMAHA_754 0x0012 821#define PCI_DEVICE_ID_YAMAHA_754 0x0012
914 822
915#define PCI_VENDOR_ID_NEXGEN 0x1074
916#define PCI_DEVICE_ID_NEXGEN_82C501 0x4e78
917 823
918#define PCI_VENDOR_ID_QLOGIC 0x1077 824#define PCI_VENDOR_ID_QLOGIC 0x1077
919#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 825#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
920#define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022
921#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 826#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100
922#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 827#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200
923#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300 828#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300
@@ -935,32 +840,20 @@
935#define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001 840#define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001
936#define PCI_DEVICE_ID_CYRIX_5520 0x0002 841#define PCI_DEVICE_ID_CYRIX_5520 0x0002
937#define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100 842#define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100
938#define PCI_DEVICE_ID_CYRIX_5530_SMI 0x0101
939#define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102 843#define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102
940#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103 844#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103
941#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104 845#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104
942 846
943#define PCI_VENDOR_ID_LEADTEK 0x107d
944#define PCI_DEVICE_ID_LEADTEK_805 0x0000
945 847
946#define PCI_VENDOR_ID_INTERPHASE 0x107e
947#define PCI_DEVICE_ID_INTERPHASE_5526 0x0004
948#define PCI_DEVICE_ID_INTERPHASE_55x6 0x0005
949#define PCI_DEVICE_ID_INTERPHASE_5575 0x0008
950 848
951#define PCI_VENDOR_ID_CONTAQ 0x1080 849#define PCI_VENDOR_ID_CONTAQ 0x1080
952#define PCI_DEVICE_ID_CONTAQ_82C599 0x0600
953#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693 850#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693
954 851
955#define PCI_VENDOR_ID_FOREX 0x1083
956 852
957#define PCI_VENDOR_ID_OLICOM 0x108d 853#define PCI_VENDOR_ID_OLICOM 0x108d
958#define PCI_DEVICE_ID_OLICOM_OC3136 0x0001
959#define PCI_DEVICE_ID_OLICOM_OC2315 0x0011
960#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012 854#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012
961#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013 855#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013
962#define PCI_DEVICE_ID_OLICOM_OC2326 0x0014 856#define PCI_DEVICE_ID_OLICOM_OC2326 0x0014
963#define PCI_DEVICE_ID_OLICOM_OC6151 0x0021
964 857
965#define PCI_VENDOR_ID_SUN 0x108e 858#define PCI_VENDOR_ID_SUN 0x108e
966#define PCI_DEVICE_ID_SUN_EBUS 0x1000 859#define PCI_DEVICE_ID_SUN_EBUS 0x1000
@@ -976,51 +869,34 @@
976#define PCI_DEVICE_ID_SUN_SABRE 0xa000 869#define PCI_DEVICE_ID_SUN_SABRE 0xa000
977#define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001 870#define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001
978#define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801 871#define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801
872#define PCI_DEVICE_ID_SUN_CASSINI 0xabba
979 873
980#define PCI_VENDOR_ID_CMD 0x1095 874#define PCI_VENDOR_ID_CMD 0x1095
981#define PCI_DEVICE_ID_CMD_640 0x0640
982#define PCI_DEVICE_ID_CMD_643 0x0643 875#define PCI_DEVICE_ID_CMD_643 0x0643
983#define PCI_DEVICE_ID_CMD_646 0x0646 876#define PCI_DEVICE_ID_CMD_646 0x0646
984#define PCI_DEVICE_ID_CMD_647 0x0647
985#define PCI_DEVICE_ID_CMD_648 0x0648 877#define PCI_DEVICE_ID_CMD_648 0x0648
986#define PCI_DEVICE_ID_CMD_649 0x0649 878#define PCI_DEVICE_ID_CMD_649 0x0649
987#define PCI_DEVICE_ID_CMD_670 0x0670
988#define PCI_DEVICE_ID_CMD_680 0x0680
989 879
990#define PCI_DEVICE_ID_SII_680 0x0680 880#define PCI_DEVICE_ID_SII_680 0x0680
991#define PCI_DEVICE_ID_SII_3112 0x3112 881#define PCI_DEVICE_ID_SII_3112 0x3112
992#define PCI_DEVICE_ID_SII_1210SA 0x0240 882#define PCI_DEVICE_ID_SII_1210SA 0x0240
993 883
994#define PCI_VENDOR_ID_VISION 0x1098
995#define PCI_DEVICE_ID_VISION_QD8500 0x0001
996#define PCI_DEVICE_ID_VISION_QD8580 0x0002
997 884
998#define PCI_VENDOR_ID_BROOKTREE 0x109e 885#define PCI_VENDOR_ID_BROOKTREE 0x109e
999#define PCI_DEVICE_ID_BROOKTREE_848 0x0350
1000#define PCI_DEVICE_ID_BROOKTREE_849A 0x0351
1001#define PCI_DEVICE_ID_BROOKTREE_878_1 0x036e
1002#define PCI_DEVICE_ID_BROOKTREE_878 0x0878 886#define PCI_DEVICE_ID_BROOKTREE_878 0x0878
1003#define PCI_DEVICE_ID_BROOKTREE_879 0x0879 887#define PCI_DEVICE_ID_BROOKTREE_879 0x0879
1004#define PCI_DEVICE_ID_BROOKTREE_8474 0x8474
1005 888
1006#define PCI_VENDOR_ID_SIERRA 0x10a8
1007#define PCI_DEVICE_ID_SIERRA_STB 0x0000
1008 889
1009#define PCI_VENDOR_ID_SGI 0x10a9 890#define PCI_VENDOR_ID_SGI 0x10a9
1010#define PCI_DEVICE_ID_SGI_IOC3 0x0003 891#define PCI_DEVICE_ID_SGI_IOC3 0x0003
1011#define PCI_DEVICE_ID_SGI_IOC4 0x100a 892#define PCI_DEVICE_ID_SGI_IOC4 0x100a
1012#define PCI_VENDOR_ID_SGI_LITHIUM 0x1002 893#define PCI_VENDOR_ID_SGI_LITHIUM 0x1002
1013 894
1014#define PCI_VENDOR_ID_ACC 0x10aa
1015#define PCI_DEVICE_ID_ACC_2056 0x0000
1016 895
1017#define PCI_VENDOR_ID_WINBOND 0x10ad 896#define PCI_VENDOR_ID_WINBOND 0x10ad
1018#define PCI_DEVICE_ID_WINBOND_83769 0x0001
1019#define PCI_DEVICE_ID_WINBOND_82C105 0x0105 897#define PCI_DEVICE_ID_WINBOND_82C105 0x0105
1020#define PCI_DEVICE_ID_WINBOND_83C553 0x0565 898#define PCI_DEVICE_ID_WINBOND_83C553 0x0565
1021 899
1022#define PCI_VENDOR_ID_DATABOOK 0x10b3
1023#define PCI_DEVICE_ID_DATABOOK_87144 0xb106
1024 900
1025#define PCI_VENDOR_ID_PLX 0x10b5 901#define PCI_VENDOR_ID_PLX 0x10b5
1026#define PCI_DEVICE_ID_PLX_R685 0x1030 902#define PCI_DEVICE_ID_PLX_R685 0x1030
@@ -1031,33 +907,19 @@
1031#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151 907#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
1032#define PCI_DEVICE_ID_PLX_R753 0x1152 908#define PCI_DEVICE_ID_PLX_R753 0x1152
1033#define PCI_DEVICE_ID_PLX_OLITEC 0x1187 909#define PCI_DEVICE_ID_PLX_OLITEC 0x1187
1034#define PCI_DEVICE_ID_PLX_9030 0x9030
1035#define PCI_DEVICE_ID_PLX_9050 0x9050 910#define PCI_DEVICE_ID_PLX_9050 0x9050
1036#define PCI_DEVICE_ID_PLX_9060 0x9060
1037#define PCI_DEVICE_ID_PLX_9060ES 0x906E
1038#define PCI_DEVICE_ID_PLX_9060SD 0x906D
1039#define PCI_DEVICE_ID_PLX_9080 0x9080 911#define PCI_DEVICE_ID_PLX_9080 0x9080
1040#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 912#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001
1041 913
1042#define PCI_VENDOR_ID_MADGE 0x10b6 914#define PCI_VENDOR_ID_MADGE 0x10b6
1043#define PCI_DEVICE_ID_MADGE_MK2 0x0002 915#define PCI_DEVICE_ID_MADGE_MK2 0x0002
1044#define PCI_DEVICE_ID_MADGE_C155S 0x1001
1045 916
1046#define PCI_VENDOR_ID_3COM 0x10b7 917#define PCI_VENDOR_ID_3COM 0x10b7
1047#define PCI_DEVICE_ID_3COM_3C985 0x0001 918#define PCI_DEVICE_ID_3COM_3C985 0x0001
1048#define PCI_DEVICE_ID_3COM_3C940 0x1700 919#define PCI_DEVICE_ID_3COM_3C940 0x1700
1049#define PCI_DEVICE_ID_3COM_3C339 0x3390 920#define PCI_DEVICE_ID_3COM_3C339 0x3390
1050#define PCI_DEVICE_ID_3COM_3C359 0x3590 921#define PCI_DEVICE_ID_3COM_3C359 0x3590
1051#define PCI_DEVICE_ID_3COM_3C590 0x5900
1052#define PCI_DEVICE_ID_3COM_3C595TX 0x5950
1053#define PCI_DEVICE_ID_3COM_3C595T4 0x5951
1054#define PCI_DEVICE_ID_3COM_3C595MII 0x5952
1055#define PCI_DEVICE_ID_3COM_3C940B 0x80eb 922#define PCI_DEVICE_ID_3COM_3C940B 0x80eb
1056#define PCI_DEVICE_ID_3COM_3C900TPO 0x9000
1057#define PCI_DEVICE_ID_3COM_3C900COMBO 0x9001
1058#define PCI_DEVICE_ID_3COM_3C905TX 0x9050
1059#define PCI_DEVICE_ID_3COM_3C905T4 0x9051
1060#define PCI_DEVICE_ID_3COM_3C905B_TX 0x9055
1061#define PCI_DEVICE_ID_3COM_3CR990 0x9900 923#define PCI_DEVICE_ID_3COM_3CR990 0x9900
1062#define PCI_DEVICE_ID_3COM_3CR990_TX_95 0x9902 924#define PCI_DEVICE_ID_3COM_3CR990_TX_95 0x9902
1063#define PCI_DEVICE_ID_3COM_3CR990_TX_97 0x9903 925#define PCI_DEVICE_ID_3COM_3CR990_TX_97 0x9903
@@ -1067,24 +929,11 @@
1067#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909 929#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909
1068#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a 930#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a
1069 931
1070#define PCI_VENDOR_ID_SMC 0x10b8
1071#define PCI_DEVICE_ID_SMC_EPIC100 0x0005
1072 932
1073#define PCI_VENDOR_ID_AL 0x10b9 933#define PCI_VENDOR_ID_AL 0x10b9
1074#define PCI_DEVICE_ID_AL_M1445 0x1445
1075#define PCI_DEVICE_ID_AL_M1449 0x1449
1076#define PCI_DEVICE_ID_AL_M1451 0x1451
1077#define PCI_DEVICE_ID_AL_M1461 0x1461
1078#define PCI_DEVICE_ID_AL_M1489 0x1489
1079#define PCI_DEVICE_ID_AL_M1511 0x1511
1080#define PCI_DEVICE_ID_AL_M1513 0x1513
1081#define PCI_DEVICE_ID_AL_M1521 0x1521
1082#define PCI_DEVICE_ID_AL_M1523 0x1523
1083#define PCI_DEVICE_ID_AL_M1531 0x1531
1084#define PCI_DEVICE_ID_AL_M1533 0x1533 934#define PCI_DEVICE_ID_AL_M1533 0x1533
1085#define PCI_DEVICE_ID_AL_M1535 0x1535 935#define PCI_DEVICE_ID_AL_M1535 0x1535
1086#define PCI_DEVICE_ID_AL_M1541 0x1541 936#define PCI_DEVICE_ID_AL_M1541 0x1541
1087#define PCI_DEVICE_ID_AL_M1543 0x1543
1088#define PCI_DEVICE_ID_AL_M1563 0x1563 937#define PCI_DEVICE_ID_AL_M1563 0x1563
1089#define PCI_DEVICE_ID_AL_M1621 0x1621 938#define PCI_DEVICE_ID_AL_M1621 0x1621
1090#define PCI_DEVICE_ID_AL_M1631 0x1631 939#define PCI_DEVICE_ID_AL_M1631 0x1631
@@ -1097,49 +946,23 @@
1097#define PCI_DEVICE_ID_AL_M1681 0x1681 946#define PCI_DEVICE_ID_AL_M1681 0x1681
1098#define PCI_DEVICE_ID_AL_M1683 0x1683 947#define PCI_DEVICE_ID_AL_M1683 0x1683
1099#define PCI_DEVICE_ID_AL_M1689 0x1689 948#define PCI_DEVICE_ID_AL_M1689 0x1689
1100#define PCI_DEVICE_ID_AL_M3307 0x3307
1101#define PCI_DEVICE_ID_AL_M4803 0x5215
1102#define PCI_DEVICE_ID_AL_M5219 0x5219 949#define PCI_DEVICE_ID_AL_M5219 0x5219
1103#define PCI_DEVICE_ID_AL_M5228 0x5228 950#define PCI_DEVICE_ID_AL_M5228 0x5228
1104#define PCI_DEVICE_ID_AL_M5229 0x5229 951#define PCI_DEVICE_ID_AL_M5229 0x5229
1105#define PCI_DEVICE_ID_AL_M5237 0x5237
1106#define PCI_DEVICE_ID_AL_M5243 0x5243
1107#define PCI_DEVICE_ID_AL_M5451 0x5451 952#define PCI_DEVICE_ID_AL_M5451 0x5451
1108#define PCI_DEVICE_ID_AL_M7101 0x7101 953#define PCI_DEVICE_ID_AL_M7101 0x7101
1109 954
1110#define PCI_VENDOR_ID_MITSUBISHI 0x10ba
1111 955
1112#define PCI_VENDOR_ID_SURECOM 0x10bd
1113#define PCI_DEVICE_ID_SURECOM_NE34 0x0e34
1114 956
1115#define PCI_VENDOR_ID_NEOMAGIC 0x10c8 957#define PCI_VENDOR_ID_NEOMAGIC 0x10c8
1116#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2070 0x0001
1117#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128V 0x0002
1118#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZV 0x0003
1119#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_NM2160 0x0004
1120#define PCI_DEVICE_ID_NEOMAGIC_MAGICMEDIA_256AV 0x0005
1121#define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZVPLUS 0x0083
1122#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005 958#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005
1123#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006 959#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006
1124#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016 960#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016
1125 961
1126#define PCI_VENDOR_ID_ASP 0x10cd
1127#define PCI_DEVICE_ID_ASP_ABP940 0x1200
1128#define PCI_DEVICE_ID_ASP_ABP940U 0x1300
1129#define PCI_DEVICE_ID_ASP_ABP940UW 0x2300
1130
1131#define PCI_VENDOR_ID_MACRONIX 0x10d9
1132#define PCI_DEVICE_ID_MACRONIX_MX98713 0x0512
1133#define PCI_DEVICE_ID_MACRONIX_MX987x5 0x0531
1134 962
1135#define PCI_VENDOR_ID_TCONRAD 0x10da 963#define PCI_VENDOR_ID_TCONRAD 0x10da
1136#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508 964#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508
1137 965
1138#define PCI_VENDOR_ID_CERN 0x10dc
1139#define PCI_DEVICE_ID_CERN_SPSB_PMC 0x0001
1140#define PCI_DEVICE_ID_CERN_SPSB_PCI 0x0002
1141#define PCI_DEVICE_ID_CERN_HIPPI_DST 0x0021
1142#define PCI_DEVICE_ID_CERN_HIPPI_SRC 0x0022
1143 966
1144#define PCI_VENDOR_ID_NVIDIA 0x10de 967#define PCI_VENDOR_ID_NVIDIA 0x10de
1145#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 968#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020
@@ -1177,6 +1000,10 @@
1177#define PCI_DEVICE_ID_NVIDIA_CK8_AUDIO 0x008a 1000#define PCI_DEVICE_ID_NVIDIA_CK8_AUDIO 0x008a
1178#define PCI_DEVICE_ID_NVIDIA_NVENET_5 0x008c 1001#define PCI_DEVICE_ID_NVIDIA_NVENET_5 0x008c
1179#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA 0x008e 1002#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA 0x008e
1003#define PCI_DEVICE_ID_NVIDIA_GEFORCE_7800_GT 0x0090
1004#define PCI_DEVICE_ID_NVIDIA_GEFORCE_7800_GTX 0x0091
1005#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_7800 0x0098
1006#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_7800_GTX 0x0099
1180#define PCI_DEVICE_ID_NVIDIA_ITNT2 0x00A0 1007#define PCI_DEVICE_ID_NVIDIA_ITNT2 0x00A0
1181#define PCI_DEVICE_ID_GEFORCE_6800A 0x00c1 1008#define PCI_DEVICE_ID_GEFORCE_6800A 0x00c1
1182#define PCI_DEVICE_ID_GEFORCE_6800A_LE 0x00c2 1009#define PCI_DEVICE_ID_GEFORCE_6800A_LE 0x00c2
@@ -1185,7 +1012,6 @@
1185#define PCI_DEVICE_ID_QUADRO_FX_GO1400 0x00cc 1012#define PCI_DEVICE_ID_QUADRO_FX_GO1400 0x00cc
1186#define PCI_DEVICE_ID_QUADRO_FX_1400 0x00ce 1013#define PCI_DEVICE_ID_QUADRO_FX_1400 0x00ce
1187#define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1 1014#define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1
1188#define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da
1189#define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4 1015#define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4
1190#define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5 1016#define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5
1191#define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6 1017#define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6
@@ -1268,10 +1094,10 @@
1268#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 1094#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
1269#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 1095#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
1270#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E 1096#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E
1271#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x036F 1097#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E
1098#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F
1272#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 1099#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268
1273#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 1100#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269
1274#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B
1275#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 1101#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280
1276#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 1102#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281
1277#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282 1103#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282
@@ -1322,24 +1148,13 @@
1322#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1148#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1323 1149
1324#define PCI_VENDOR_ID_IMS 0x10e0 1150#define PCI_VENDOR_ID_IMS 0x10e0
1325#define PCI_DEVICE_ID_IMS_8849 0x8849
1326#define PCI_DEVICE_ID_IMS_TT128 0x9128 1151#define PCI_DEVICE_ID_IMS_TT128 0x9128
1327#define PCI_DEVICE_ID_IMS_TT3D 0x9135 1152#define PCI_DEVICE_ID_IMS_TT3D 0x9135
1328 1153
1329#define PCI_VENDOR_ID_TEKRAM2 0x10e1
1330#define PCI_DEVICE_ID_TEKRAM2_690c 0x690c
1331 1154
1332#define PCI_VENDOR_ID_TUNDRA 0x10e3
1333#define PCI_DEVICE_ID_TUNDRA_CA91C042 0x0000
1334 1155
1335#define PCI_VENDOR_ID_AMCC 0x10e8
1336#define PCI_DEVICE_ID_AMCC_MYRINET 0x8043
1337#define PCI_DEVICE_ID_AMCC_PARASTATION 0x8062
1338#define PCI_DEVICE_ID_AMCC_S5933 0x807d
1339#define PCI_DEVICE_ID_AMCC_S5933_HEPC3 0x809c
1340 1156
1341#define PCI_VENDOR_ID_INTERG 0x10ea 1157#define PCI_VENDOR_ID_INTERG 0x10ea
1342#define PCI_DEVICE_ID_INTERG_1680 0x1680
1343#define PCI_DEVICE_ID_INTERG_1682 0x1682 1158#define PCI_DEVICE_ID_INTERG_1682 0x1682
1344#define PCI_DEVICE_ID_INTERG_2000 0x2000 1159#define PCI_DEVICE_ID_INTERG_2000 0x2000
1345#define PCI_DEVICE_ID_INTERG_2010 0x2010 1160#define PCI_DEVICE_ID_INTERG_2010 0x2010
@@ -1347,32 +1162,23 @@
1347#define PCI_DEVICE_ID_INTERG_5050 0x5050 1162#define PCI_DEVICE_ID_INTERG_5050 0x5050
1348 1163
1349#define PCI_VENDOR_ID_REALTEK 0x10ec 1164#define PCI_VENDOR_ID_REALTEK 0x10ec
1350#define PCI_DEVICE_ID_REALTEK_8029 0x8029
1351#define PCI_DEVICE_ID_REALTEK_8129 0x8129
1352#define PCI_DEVICE_ID_REALTEK_8139 0x8139 1165#define PCI_DEVICE_ID_REALTEK_8139 0x8139
1353#define PCI_DEVICE_ID_REALTEK_8169 0x8169
1354 1166
1355#define PCI_VENDOR_ID_XILINX 0x10ee 1167#define PCI_VENDOR_ID_XILINX 0x10ee
1356#define PCI_DEVICE_ID_RME_DIGI96 0x3fc0 1168#define PCI_DEVICE_ID_RME_DIGI96 0x3fc0
1357#define PCI_DEVICE_ID_RME_DIGI96_8 0x3fc1 1169#define PCI_DEVICE_ID_RME_DIGI96_8 0x3fc1
1358#define PCI_DEVICE_ID_RME_DIGI96_8_PRO 0x3fc2 1170#define PCI_DEVICE_ID_RME_DIGI96_8_PRO 0x3fc2
1359#define PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST 0x3fc3 1171#define PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST 0x3fc3
1360#define PCI_DEVICE_ID_XILINX_HAMMERFALL 0x3fc4
1361#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 1172#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5
1362#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 1173#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6
1363#define PCI_DEVICE_ID_TURBOPAM 0x4020
1364 1174
1365#define PCI_VENDOR_ID_TRUEVISION 0x10fa
1366#define PCI_DEVICE_ID_TRUEVISION_T1000 0x000c
1367 1175
1368#define PCI_VENDOR_ID_INIT 0x1101 1176#define PCI_VENDOR_ID_INIT 0x1101
1369#define PCI_DEVICE_ID_INIT_320P 0x9100
1370#define PCI_DEVICE_ID_INIT_360P 0x9500
1371 1177
1372#define PCI_VENDOR_ID_CREATIVE 0x1102 // duplicate: ECTIVA 1178#define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */
1373#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 1179#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002
1374 1180
1375#define PCI_VENDOR_ID_ECTIVA 0x1102 // duplicate: CREATIVE 1181#define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */
1376#define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 1182#define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938
1377 1183
1378#define PCI_VENDOR_ID_TTI 0x1103 1184#define PCI_VENDOR_ID_TTI 0x1103
@@ -1382,7 +1188,7 @@
1382#define PCI_DEVICE_ID_TTI_HPT302 0x0006 1188#define PCI_DEVICE_ID_TTI_HPT302 0x0006
1383#define PCI_DEVICE_ID_TTI_HPT371 0x0007 1189#define PCI_DEVICE_ID_TTI_HPT371 0x0007
1384#define PCI_DEVICE_ID_TTI_HPT374 0x0008 1190#define PCI_DEVICE_ID_TTI_HPT374 0x0008
1385#define PCI_DEVICE_ID_TTI_HPT372N 0x0009 // apparently a 372N variant? 1191#define PCI_DEVICE_ID_TTI_HPT372N 0x0009 /* apparently a 372N variant? */
1386 1192
1387#define PCI_VENDOR_ID_VIA 0x1106 1193#define PCI_VENDOR_ID_VIA 0x1106
1388#define PCI_DEVICE_ID_VIA_8763_0 0x0198 1194#define PCI_DEVICE_ID_VIA_8763_0 0x0198
@@ -1393,38 +1199,28 @@
1393#define PCI_DEVICE_ID_VIA_3269_0 0x0269 1199#define PCI_DEVICE_ID_VIA_3269_0 0x0269
1394#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282 1200#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282
1395#define PCI_DEVICE_ID_VIA_8363_0 0x0305 1201#define PCI_DEVICE_ID_VIA_8363_0 0x0305
1202#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314
1396#define PCI_DEVICE_ID_VIA_8371_0 0x0391 1203#define PCI_DEVICE_ID_VIA_8371_0 0x0391
1397#define PCI_DEVICE_ID_VIA_8501_0 0x0501 1204#define PCI_DEVICE_ID_VIA_8501_0 0x0501
1398#define PCI_DEVICE_ID_VIA_82C505 0x0505
1399#define PCI_DEVICE_ID_VIA_82C561 0x0561 1205#define PCI_DEVICE_ID_VIA_82C561 0x0561
1400#define PCI_DEVICE_ID_VIA_82C586_1 0x0571 1206#define PCI_DEVICE_ID_VIA_82C586_1 0x0571
1401#define PCI_DEVICE_ID_VIA_82C576 0x0576 1207#define PCI_DEVICE_ID_VIA_82C576 0x0576
1402#define PCI_DEVICE_ID_VIA_82C585 0x0585
1403#define PCI_DEVICE_ID_VIA_82C586_0 0x0586 1208#define PCI_DEVICE_ID_VIA_82C586_0 0x0586
1404#define PCI_DEVICE_ID_VIA_82C595 0x0595
1405#define PCI_DEVICE_ID_VIA_82C596 0x0596 1209#define PCI_DEVICE_ID_VIA_82C596 0x0596
1406#define PCI_DEVICE_ID_VIA_82C597_0 0x0597 1210#define PCI_DEVICE_ID_VIA_82C597_0 0x0597
1407#define PCI_DEVICE_ID_VIA_82C598_0 0x0598 1211#define PCI_DEVICE_ID_VIA_82C598_0 0x0598
1408#define PCI_DEVICE_ID_VIA_8601_0 0x0601 1212#define PCI_DEVICE_ID_VIA_8601_0 0x0601
1409#define PCI_DEVICE_ID_VIA_8605_0 0x0605 1213#define PCI_DEVICE_ID_VIA_8605_0 0x0605
1410#define PCI_DEVICE_ID_VIA_82C680 0x0680
1411#define PCI_DEVICE_ID_VIA_82C686 0x0686 1214#define PCI_DEVICE_ID_VIA_82C686 0x0686
1412#define PCI_DEVICE_ID_VIA_82C691_0 0x0691 1215#define PCI_DEVICE_ID_VIA_82C691_0 0x0691
1413#define PCI_DEVICE_ID_VIA_82C693 0x0693
1414#define PCI_DEVICE_ID_VIA_82C693_1 0x0698
1415#define PCI_DEVICE_ID_VIA_82C926 0x0926
1416#define PCI_DEVICE_ID_VIA_82C576_1 0x1571 1216#define PCI_DEVICE_ID_VIA_82C576_1 0x1571
1417#define PCI_DEVICE_ID_VIA_82C595_97 0x1595
1418#define PCI_DEVICE_ID_VIA_82C586_2 0x3038 1217#define PCI_DEVICE_ID_VIA_82C586_2 0x3038
1419#define PCI_DEVICE_ID_VIA_82C586_3 0x3040 1218#define PCI_DEVICE_ID_VIA_82C586_3 0x3040
1420#define PCI_DEVICE_ID_VIA_6305 0x3044
1421#define PCI_DEVICE_ID_VIA_82C596_3 0x3050 1219#define PCI_DEVICE_ID_VIA_82C596_3 0x3050
1422#define PCI_DEVICE_ID_VIA_82C596B_3 0x3051 1220#define PCI_DEVICE_ID_VIA_82C596B_3 0x3051
1423#define PCI_DEVICE_ID_VIA_82C686_4 0x3057 1221#define PCI_DEVICE_ID_VIA_82C686_4 0x3057
1424#define PCI_DEVICE_ID_VIA_82C686_5 0x3058 1222#define PCI_DEVICE_ID_VIA_82C686_5 0x3058
1425#define PCI_DEVICE_ID_VIA_8233_5 0x3059 1223#define PCI_DEVICE_ID_VIA_8233_5 0x3059
1426#define PCI_DEVICE_ID_VIA_8233_7 0x3065
1427#define PCI_DEVICE_ID_VIA_82C686_6 0x3068
1428#define PCI_DEVICE_ID_VIA_8233_0 0x3074 1224#define PCI_DEVICE_ID_VIA_8233_0 0x3074
1429#define PCI_DEVICE_ID_VIA_8633_0 0x3091 1225#define PCI_DEVICE_ID_VIA_8633_0 0x3091
1430#define PCI_DEVICE_ID_VIA_8367_0 0x3099 1226#define PCI_DEVICE_ID_VIA_8367_0 0x3099
@@ -1440,40 +1236,26 @@
1440#define PCI_DEVICE_ID_VIA_8703_51_0 0x3148 1236#define PCI_DEVICE_ID_VIA_8703_51_0 0x3148
1441#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149 1237#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149
1442#define PCI_DEVICE_ID_VIA_XN266 0x3156 1238#define PCI_DEVICE_ID_VIA_XN266 0x3156
1239#define PCI_DEVICE_ID_VIA_6410 0x3164
1443#define PCI_DEVICE_ID_VIA_8754C_0 0x3168 1240#define PCI_DEVICE_ID_VIA_8754C_0 0x3168
1444#define PCI_DEVICE_ID_VIA_8235 0x3177 1241#define PCI_DEVICE_ID_VIA_8235 0x3177
1445#define PCI_DEVICE_ID_VIA_P4N333 0x3178
1446#define PCI_DEVICE_ID_VIA_8385_0 0x3188 1242#define PCI_DEVICE_ID_VIA_8385_0 0x3188
1447#define PCI_DEVICE_ID_VIA_8377_0 0x3189 1243#define PCI_DEVICE_ID_VIA_8377_0 0x3189
1448#define PCI_DEVICE_ID_VIA_8378_0 0x3205 1244#define PCI_DEVICE_ID_VIA_8378_0 0x3205
1449#define PCI_DEVICE_ID_VIA_8783_0 0x3208 1245#define PCI_DEVICE_ID_VIA_8783_0 0x3208
1450#define PCI_DEVICE_ID_VIA_P4M400 0x3209
1451#define PCI_DEVICE_ID_VIA_8237 0x3227 1246#define PCI_DEVICE_ID_VIA_8237 0x3227
1452#define PCI_DEVICE_ID_VIA_3296_0 0x0296 1247#define PCI_DEVICE_ID_VIA_3296_0 0x0296
1453#define PCI_DEVICE_ID_VIA_86C100A 0x6100
1454#define PCI_DEVICE_ID_VIA_8231 0x8231 1248#define PCI_DEVICE_ID_VIA_8231 0x8231
1455#define PCI_DEVICE_ID_VIA_8231_4 0x8235 1249#define PCI_DEVICE_ID_VIA_8231_4 0x8235
1456#define PCI_DEVICE_ID_VIA_8365_1 0x8305 1250#define PCI_DEVICE_ID_VIA_8365_1 0x8305
1457#define PCI_DEVICE_ID_VIA_8371_1 0x8391 1251#define PCI_DEVICE_ID_VIA_8371_1 0x8391
1458#define PCI_DEVICE_ID_VIA_8501_1 0x8501
1459#define PCI_DEVICE_ID_VIA_82C597_1 0x8597
1460#define PCI_DEVICE_ID_VIA_82C598_1 0x8598 1252#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
1461#define PCI_DEVICE_ID_VIA_8601_1 0x8601
1462#define PCI_DEVICE_ID_VIA_8505_1 0x8605
1463#define PCI_DEVICE_ID_VIA_8633_1 0xB091
1464#define PCI_DEVICE_ID_VIA_8367_1 0xB099
1465#define PCI_DEVICE_ID_VIA_P4X266_1 0xB101
1466#define PCI_DEVICE_ID_VIA_8615_1 0xB103
1467#define PCI_DEVICE_ID_VIA_8361_1 0xB112
1468#define PCI_DEVICE_ID_VIA_8235_1 0xB168
1469#define PCI_DEVICE_ID_VIA_838X_1 0xB188 1253#define PCI_DEVICE_ID_VIA_838X_1 0xB188
1470#define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198 1254#define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198
1471 1255
1472#define PCI_VENDOR_ID_SIEMENS 0x110A 1256#define PCI_VENDOR_ID_SIEMENS 0x110A
1473#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 1257#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102
1474 1258
1475#define PCI_VENDOR_ID_SMC2 0x1113
1476#define PCI_DEVICE_ID_SMC2_1211TX 0x1211
1477 1259
1478#define PCI_VENDOR_ID_VORTEX 0x1119 1260#define PCI_VENDOR_ID_VORTEX 0x1119
1479#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 1261#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000
@@ -1496,18 +1278,6 @@
1496#define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103 1278#define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103
1497#define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104 1279#define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104
1498#define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105 1280#define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105
1499#define PCI_DEVICE_ID_VORTEX_GDT6x17RP1 0x0110
1500#define PCI_DEVICE_ID_VORTEX_GDT6x27RP1 0x0111
1501#define PCI_DEVICE_ID_VORTEX_GDT6537RP1 0x0112
1502#define PCI_DEVICE_ID_VORTEX_GDT6557RP1 0x0113
1503#define PCI_DEVICE_ID_VORTEX_GDT6x11RP1 0x0114
1504#define PCI_DEVICE_ID_VORTEX_GDT6x21RP1 0x0115
1505#define PCI_DEVICE_ID_VORTEX_GDT6x17RP2 0x0120
1506#define PCI_DEVICE_ID_VORTEX_GDT6x27RP2 0x0121
1507#define PCI_DEVICE_ID_VORTEX_GDT6537RP2 0x0122
1508#define PCI_DEVICE_ID_VORTEX_GDT6557RP2 0x0123
1509#define PCI_DEVICE_ID_VORTEX_GDT6x11RP2 0x0124
1510#define PCI_DEVICE_ID_VORTEX_GDT6x21RP2 0x0125
1511 1281
1512#define PCI_VENDOR_ID_EF 0x111a 1282#define PCI_VENDOR_ID_EF 0x111a
1513#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 1283#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000
@@ -1519,21 +1289,15 @@
1519#define PCI_DEVICE_ID_IDT_IDT77201 0x0001 1289#define PCI_DEVICE_ID_IDT_IDT77201 0x0001
1520 1290
1521#define PCI_VENDOR_ID_FORE 0x1127 1291#define PCI_VENDOR_ID_FORE 0x1127
1522#define PCI_DEVICE_ID_FORE_PCA200PC 0x0210
1523#define PCI_DEVICE_ID_FORE_PCA200E 0x0300 1292#define PCI_DEVICE_ID_FORE_PCA200E 0x0300
1524 1293
1525#define PCI_VENDOR_ID_IMAGINGTECH 0x112f
1526#define PCI_DEVICE_ID_IMAGINGTECH_ICPCI 0x0000
1527 1294
1528#define PCI_VENDOR_ID_PHILIPS 0x1131 1295#define PCI_VENDOR_ID_PHILIPS 0x1131
1529#define PCI_DEVICE_ID_PHILIPS_SAA7145 0x7145
1530#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 1296#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146
1531#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 1297#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730
1532 1298
1533#define PCI_VENDOR_ID_EICON 0x1133 1299#define PCI_VENDOR_ID_EICON 0x1133
1534#define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001
1535#define PCI_DEVICE_ID_EICON_DIVA20 0xe002 1300#define PCI_DEVICE_ID_EICON_DIVA20 0xe002
1536#define PCI_DEVICE_ID_EICON_DIVA20PRO_U 0xe003
1537#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004 1301#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004
1538#define PCI_DEVICE_ID_EICON_DIVA201 0xe005 1302#define PCI_DEVICE_ID_EICON_DIVA201 0xe005
1539#define PCI_DEVICE_ID_EICON_DIVA202 0xe00b 1303#define PCI_DEVICE_ID_EICON_DIVA202 0xe00b
@@ -1545,35 +1309,17 @@
1545#define PCI_VENDOR_ID_ZIATECH 0x1138 1309#define PCI_VENDOR_ID_ZIATECH 0x1138
1546#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 1310#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550
1547 1311
1548#define PCI_VENDOR_ID_CYCLONE 0x113c
1549#define PCI_DEVICE_ID_CYCLONE_SDK 0x0001
1550 1312
1551#define PCI_VENDOR_ID_ALLIANCE 0x1142
1552#define PCI_DEVICE_ID_ALLIANCE_PROMOTIO 0x3210
1553#define PCI_DEVICE_ID_ALLIANCE_PROVIDEO 0x6422
1554#define PCI_DEVICE_ID_ALLIANCE_AT24 0x6424
1555#define PCI_DEVICE_ID_ALLIANCE_AT3D 0x643d
1556 1313
1557#define PCI_VENDOR_ID_SYSKONNECT 0x1148 1314#define PCI_VENDOR_ID_SYSKONNECT 0x1148
1558#define PCI_DEVICE_ID_SYSKONNECT_FP 0x4000
1559#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 1315#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200
1560#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300 1316#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300
1561#define PCI_DEVICE_ID_SYSKONNECT_YU 0x4320 1317#define PCI_DEVICE_ID_SYSKONNECT_YU 0x4320
1562#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400 1318#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400
1563#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500 1319#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500
1564 1320
1565#define PCI_VENDOR_ID_VMIC 0x114a
1566#define PCI_DEVICE_ID_VMIC_VME 0x7587
1567 1321
1568#define PCI_VENDOR_ID_DIGI 0x114f 1322#define PCI_VENDOR_ID_DIGI 0x114f
1569#define PCI_DEVICE_ID_DIGI_EPC 0x0002
1570#define PCI_DEVICE_ID_DIGI_RIGHTSWITCH 0x0003
1571#define PCI_DEVICE_ID_DIGI_XEM 0x0004
1572#define PCI_DEVICE_ID_DIGI_XR 0x0005
1573#define PCI_DEVICE_ID_DIGI_CX 0x0006
1574#define PCI_DEVICE_ID_DIGI_XRJ 0x0009
1575#define PCI_DEVICE_ID_DIGI_EPCJ 0x000a
1576#define PCI_DEVICE_ID_DIGI_XR_920 0x0027
1577#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070 1323#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
1578#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071 1324#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
1579#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072 1325#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
@@ -1583,23 +1329,15 @@
1583#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA 1329#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
1584#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB 1330#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB
1585 1331
1586#define PCI_VENDOR_ID_MUTECH 0x1159
1587#define PCI_DEVICE_ID_MUTECH_MV1000 0x0001
1588 1332
1589#define PCI_VENDOR_ID_XIRCOM 0x115d 1333#define PCI_VENDOR_ID_XIRCOM 0x115d
1590#define PCI_DEVICE_ID_XIRCOM_X3201_ETH 0x0003
1591#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101 1334#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101
1592#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103 1335#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103
1593 1336
1594#define PCI_VENDOR_ID_RENDITION 0x1163
1595#define PCI_DEVICE_ID_RENDITION_VERITE 0x0001
1596#define PCI_DEVICE_ID_RENDITION_VERITE2100 0x2000
1597 1337
1598#define PCI_VENDOR_ID_SERVERWORKS 0x1166 1338#define PCI_VENDOR_ID_SERVERWORKS 0x1166
1599#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 1339#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008
1600#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 1340#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009
1601#define PCI_DEVICE_ID_SERVERWORKS_CIOB30 0x0010
1602#define PCI_DEVICE_ID_SERVERWORKS_CMIC_HE 0x0011
1603#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 1341#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017
1604#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 1342#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200
1605#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 1343#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201
@@ -1609,13 +1347,7 @@
1609#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 1347#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213
1610#define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214 1348#define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214
1611#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217 1349#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217
1612#define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220
1613#define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB
1614#define PCI_DEVICE_ID_SERVERWORKS_CSB6USB 0x0221
1615#define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227 1350#define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227
1616#define PCI_DEVICE_ID_SERVERWORKS_GCLE 0x0225
1617#define PCI_DEVICE_ID_SERVERWORKS_GCLE2 0x0227
1618#define PCI_DEVICE_ID_SERVERWORKS_CSB5ISA 0x0230
1619 1351
1620#define PCI_VENDOR_ID_SBE 0x1176 1352#define PCI_VENDOR_ID_SBE 0x1176
1621#define PCI_DEVICE_ID_SBE_WANXL100 0x0301 1353#define PCI_DEVICE_ID_SBE_WANXL100 0x0301
@@ -1626,17 +1358,12 @@
1626#define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102 1358#define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102
1627#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103 1359#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103
1628#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105 1360#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105
1629#define PCI_DEVICE_ID_TOSHIBA_601 0x0601
1630#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a 1361#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a
1631#define PCI_DEVICE_ID_TOSHIBA_TOPIC95_A 0x0603
1632#define PCI_DEVICE_ID_TOSHIBA_TOPIC95_B 0x060a
1633#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f 1362#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f
1634#define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617 1363#define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617
1635 1364
1636#define PCI_VENDOR_ID_TOSHIBA_2 0x102f 1365#define PCI_VENDOR_ID_TOSHIBA_2 0x102f
1637#define PCI_DEVICE_ID_TOSHIBA_TX3927 0x000a
1638#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 1366#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030
1639#define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180
1640#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 1367#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108
1641#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 1368#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3
1642 1369
@@ -1651,7 +1378,6 @@
1651#define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00 1378#define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00
1652 1379
1653#define PCI_VENDOR_ID_ARTOP 0x1191 1380#define PCI_VENDOR_ID_ARTOP 0x1191
1654#define PCI_DEVICE_ID_ARTOP_ATP8400 0x0004
1655#define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005 1381#define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005
1656#define PCI_DEVICE_ID_ARTOP_ATP860 0x0006 1382#define PCI_DEVICE_ID_ARTOP_ATP860 0x0006
1657#define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007 1383#define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007
@@ -1664,16 +1390,11 @@
1664#define PCI_DEVICE_ID_ARTOP_AEC7612D 0x8040 1390#define PCI_DEVICE_ID_ARTOP_AEC7612D 0x8040
1665#define PCI_DEVICE_ID_ARTOP_AEC7612SUW 0x8050 1391#define PCI_DEVICE_ID_ARTOP_AEC7612SUW 0x8050
1666#define PCI_DEVICE_ID_ARTOP_8060 0x8060 1392#define PCI_DEVICE_ID_ARTOP_8060 0x8060
1667#define PCI_DEVICE_ID_ARTOP_AEC67160 0x8080
1668#define PCI_DEVICE_ID_ARTOP_AEC67160_2 0x8081
1669#define PCI_DEVICE_ID_ARTOP_AEC67162 0x808a
1670 1393
1671#define PCI_VENDOR_ID_ZEITNET 0x1193 1394#define PCI_VENDOR_ID_ZEITNET 0x1193
1672#define PCI_DEVICE_ID_ZEITNET_1221 0x0001 1395#define PCI_DEVICE_ID_ZEITNET_1221 0x0001
1673#define PCI_DEVICE_ID_ZEITNET_1225 0x0002 1396#define PCI_DEVICE_ID_ZEITNET_1225 0x0002
1674 1397
1675#define PCI_VENDOR_ID_OMEGA 0x119b
1676#define PCI_DEVICE_ID_OMEGA_82C092G 0x1221
1677 1398
1678#define PCI_VENDOR_ID_FUJITSU_ME 0x119e 1399#define PCI_VENDOR_ID_FUJITSU_ME 0x119e
1679#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001 1400#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001
@@ -1683,7 +1404,6 @@
1683#define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334 1404#define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334
1684 1405
1685#define PCI_VENDOR_ID_MARVELL 0x11ab 1406#define PCI_VENDOR_ID_MARVELL 0x11ab
1686#define PCI_DEVICE_ID_MARVELL_GT64011 0x4146
1687#define PCI_DEVICE_ID_MARVELL_GT64111 0x4146 1407#define PCI_DEVICE_ID_MARVELL_GT64111 0x4146
1688#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 1408#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430
1689#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 1409#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460
@@ -1691,53 +1411,35 @@
1691#define PCI_DEVICE_ID_MARVELL_GT96100 0x9652 1411#define PCI_DEVICE_ID_MARVELL_GT96100 0x9652
1692#define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653 1412#define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653
1693 1413
1694#define PCI_VENDOR_ID_LITEON 0x11ad
1695#define PCI_DEVICE_ID_LITEON_LNE100TX 0x0002
1696 1414
1697#define PCI_VENDOR_ID_V3 0x11b0 1415#define PCI_VENDOR_ID_V3 0x11b0
1698#define PCI_DEVICE_ID_V3_V960 0x0001 1416#define PCI_DEVICE_ID_V3_V960 0x0001
1699#define PCI_DEVICE_ID_V3_V350 0x0001
1700#define PCI_DEVICE_ID_V3_V961 0x0002
1701#define PCI_DEVICE_ID_V3_V351 0x0002 1417#define PCI_DEVICE_ID_V3_V351 0x0002
1702 1418
1703#define PCI_VENDOR_ID_NP 0x11bc
1704#define PCI_DEVICE_ID_NP_PCI_FDDI 0x0001
1705 1419
1706#define PCI_VENDOR_ID_ATT 0x11c1 1420#define PCI_VENDOR_ID_ATT 0x11c1
1707#define PCI_DEVICE_ID_ATT_L56XMF 0x0440
1708#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 1421#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480
1709 1422
1710#define PCI_VENDOR_ID_NEC2 0x11c3 /* NEC (2nd) */
1711 1423
1712#define PCI_VENDOR_ID_SPECIALIX 0x11cb 1424#define PCI_VENDOR_ID_SPECIALIX 0x11cb
1713#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 1425#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000
1714#define PCI_DEVICE_ID_SPECIALIX_XIO 0x4000
1715#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 1426#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000
1716#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 1427#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004
1717 1428
1718#define PCI_VENDOR_ID_AURAVISION 0x11d1
1719#define PCI_DEVICE_ID_AURAVISION_VXP524 0x01f7
1720 1429
1721#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 1430#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4
1722#define PCI_DEVICE_ID_AD1889JS 0x1889 1431#define PCI_DEVICE_ID_AD1889JS 0x1889
1723 1432
1724#define PCI_VENDOR_ID_IKON 0x11d5
1725#define PCI_DEVICE_ID_IKON_10115 0x0115
1726#define PCI_DEVICE_ID_IKON_10117 0x0117
1727 1433
1728#define PCI_VENDOR_ID_SEGA 0x11db
1729#define PCI_DEVICE_ID_SEGA_BBA 0x1234 1434#define PCI_DEVICE_ID_SEGA_BBA 0x1234
1730 1435
1731#define PCI_VENDOR_ID_ZORAN 0x11de 1436#define PCI_VENDOR_ID_ZORAN 0x11de
1732#define PCI_DEVICE_ID_ZORAN_36057 0x6057 1437#define PCI_DEVICE_ID_ZORAN_36057 0x6057
1733#define PCI_DEVICE_ID_ZORAN_36120 0x6120 1438#define PCI_DEVICE_ID_ZORAN_36120 0x6120
1734 1439
1735#define PCI_VENDOR_ID_KINETIC 0x11f4
1736#define PCI_DEVICE_ID_KINETIC_2915 0x2915
1737 1440
1738#define PCI_VENDOR_ID_COMPEX 0x11f6 1441#define PCI_VENDOR_ID_COMPEX 0x11f6
1739#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 1442#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112
1740#define PCI_DEVICE_ID_COMPEX_RL2000 0x1401
1741 1443
1742#define PCI_VENDOR_ID_RP 0x11fe 1444#define PCI_VENDOR_ID_RP 0x11fe
1743#define PCI_DEVICE_ID_RP32INTF 0x0001 1445#define PCI_DEVICE_ID_RP32INTF 0x0001
@@ -1751,7 +1453,6 @@
1751#define PCI_DEVICE_ID_RP16SNI 0x0009 1453#define PCI_DEVICE_ID_RP16SNI 0x0009
1752#define PCI_DEVICE_ID_RPP4 0x000A 1454#define PCI_DEVICE_ID_RPP4 0x000A
1753#define PCI_DEVICE_ID_RPP8 0x000B 1455#define PCI_DEVICE_ID_RPP8 0x000B
1754#define PCI_DEVICE_ID_RP8M 0x000C
1755#define PCI_DEVICE_ID_RP4M 0x000D 1456#define PCI_DEVICE_ID_RP4M 0x000D
1756#define PCI_DEVICE_ID_RP2_232 0x000E 1457#define PCI_DEVICE_ID_RP2_232 0x000E
1757#define PCI_DEVICE_ID_RP2_422 0x000F 1458#define PCI_DEVICE_ID_RP2_422 0x000F
@@ -1779,10 +1480,6 @@
1779#define PCI_DEVICE_ID_PC300_TE_M_2 0x0320 1480#define PCI_DEVICE_ID_PC300_TE_M_2 0x0320
1780#define PCI_DEVICE_ID_PC300_TE_M_1 0x0321 1481#define PCI_DEVICE_ID_PC300_TE_M_1 0x0321
1781 1482
1782/* Allied Telesyn */
1783#define PCI_VENDOR_ID_AT 0x1259
1784#define PCI_SUBDEVICE_ID_AT_2701FX 0x2703
1785
1786#define PCI_VENDOR_ID_ESSENTIAL 0x120f 1483#define PCI_VENDOR_ID_ESSENTIAL 0x120f
1787#define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001 1484#define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001
1788 1485
@@ -1799,10 +1496,7 @@
1799#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 1496#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005
1800#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009 1497#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
1801 1498
1802#define PCI_VENDOR_ID_SIGMADES 0x1236
1803#define PCI_DEVICE_ID_SIGMADES_6425 0x6401
1804 1499
1805#define PCI_VENDOR_ID_CCUBE 0x123f
1806 1500
1807#define PCI_VENDOR_ID_AVM 0x1244 1501#define PCI_VENDOR_ID_AVM 0x1244
1808#define PCI_DEVICE_ID_AVM_B1 0x0700 1502#define PCI_DEVICE_ID_AVM_B1 0x0700
@@ -1812,19 +1506,8 @@
1812#define PCI_DEVICE_ID_AVM_C2 0x1100 1506#define PCI_DEVICE_ID_AVM_C2 0x1100
1813#define PCI_DEVICE_ID_AVM_T1 0x1200 1507#define PCI_DEVICE_ID_AVM_T1 0x1200
1814 1508
1815#define PCI_VENDOR_ID_DIPIX 0x1246
1816 1509
1817#define PCI_VENDOR_ID_STALLION 0x124d 1510#define PCI_VENDOR_ID_STALLION 0x124d
1818#define PCI_DEVICE_ID_STALLION_ECHPCI832 0x0000
1819#define PCI_DEVICE_ID_STALLION_ECHPCI864 0x0002
1820#define PCI_DEVICE_ID_STALLION_EIOPCI 0x0003
1821
1822#define PCI_VENDOR_ID_OPTIBASE 0x1255
1823#define PCI_DEVICE_ID_OPTIBASE_FORGE 0x1110
1824#define PCI_DEVICE_ID_OPTIBASE_FUSION 0x1210
1825#define PCI_DEVICE_ID_OPTIBASE_VPLEX 0x2110
1826#define PCI_DEVICE_ID_OPTIBASE_VPLEXCC 0x2120
1827#define PCI_DEVICE_ID_OPTIBASE_VQUEST 0x2130
1828 1511
1829/* Allied Telesyn */ 1512/* Allied Telesyn */
1830#define PCI_VENDOR_ID_AT 0x1259 1513#define PCI_VENDOR_ID_AT 0x1259
@@ -1833,7 +1516,6 @@
1833 1516
1834#define PCI_VENDOR_ID_ESS 0x125d 1517#define PCI_VENDOR_ID_ESS 0x125d
1835#define PCI_DEVICE_ID_ESS_ESS1968 0x1968 1518#define PCI_DEVICE_ID_ESS_ESS1968 0x1968
1836#define PCI_DEVICE_ID_ESS_AUDIOPCI 0x1969
1837#define PCI_DEVICE_ID_ESS_ESS1978 0x1978 1519#define PCI_DEVICE_ID_ESS_ESS1978 0x1978
1838#define PCI_DEVICE_ID_ESS_ALLEGRO_1 0x1988 1520#define PCI_DEVICE_ID_ESS_ALLEGRO_1 0x1988
1839#define PCI_DEVICE_ID_ESS_ALLEGRO 0x1989 1521#define PCI_DEVICE_ID_ESS_ALLEGRO 0x1989
@@ -1846,11 +1528,7 @@
1846 1528
1847#define PCI_VENDOR_ID_SATSAGEM 0x1267 1529#define PCI_VENDOR_ID_SATSAGEM 0x1267
1848#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016 1530#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
1849#define PCI_DEVICE_ID_SATSAGEM_PCR2101 0x5352
1850#define PCI_DEVICE_ID_SATSAGEM_TELSATTURBO 0x5a4b
1851 1531
1852#define PCI_VENDOR_ID_HUGHES 0x1273
1853#define PCI_DEVICE_ID_HUGHES_DIRECPC 0x0002
1854 1532
1855#define PCI_VENDOR_ID_ENSONIQ 0x1274 1533#define PCI_VENDOR_ID_ENSONIQ 0x1274
1856#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880 1534#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880
@@ -1871,13 +1549,10 @@
1871#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 1549#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
1872 1550
1873/* formerly Platform Tech */ 1551/* formerly Platform Tech */
1874#define PCI_VENDOR_ID_ESS_OLD 0x1285
1875#define PCI_DEVICE_ID_ESS_ESS0100 0x0100 1552#define PCI_DEVICE_ID_ESS_ESS0100 0x0100
1876 1553
1877#define PCI_VENDOR_ID_ALTEON 0x12ae 1554#define PCI_VENDOR_ID_ALTEON 0x12ae
1878#define PCI_DEVICE_ID_ALTEON_ACENIC 0x0001
1879 1555
1880#define PCI_VENDOR_ID_USR 0x12B9
1881 1556
1882#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4 1557#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4
1883#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001 1558#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001
@@ -1892,8 +1567,6 @@
1892#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1 0x000A 1567#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1 0x000A
1893#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1 0x000B 1568#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1 0x000B
1894 1569
1895#define PCI_VENDOR_ID_PICTUREL 0x12c5
1896#define PCI_DEVICE_ID_PICTUREL_PCIVST 0x0081
1897 1570
1898#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 1571#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2
1899#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 1572#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018
@@ -1915,8 +1588,6 @@
1915#define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8 1588#define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8
1916#define PCI_DEVICE_ID_LML_33R10 0x8a02 1589#define PCI_DEVICE_ID_LML_33R10 0x8a02
1917 1590
1918#define PCI_VENDOR_ID_CBOARDS 0x1307
1919#define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001
1920 1591
1921#define PCI_VENDOR_ID_SIIG 0x131f 1592#define PCI_VENDOR_ID_SIIG 0x131f
1922#define PCI_SUBVENDOR_ID_SIIG 0x131f 1593#define PCI_SUBVENDOR_ID_SIIG 0x131f
@@ -1960,7 +1631,6 @@
1960#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 1631#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050
1961 1632
1962#define PCI_VENDOR_ID_RADISYS 0x1331 1633#define PCI_VENDOR_ID_RADISYS 0x1331
1963#define PCI_DEVICE_ID_RADISYS_ENP2611 0x0030
1964 1634
1965#define PCI_VENDOR_ID_DOMEX 0x134a 1635#define PCI_VENDOR_ID_DOMEX 0x134a
1966#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001 1636#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001
@@ -1968,8 +1638,6 @@
1968#define PCI_VENDOR_ID_QUATECH 0x135C 1638#define PCI_VENDOR_ID_QUATECH 0x135C
1969#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010 1639#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010
1970#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 1640#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
1971#define PCI_DEVICE_ID_QUATECH_DSC200 0x0030
1972#define PCI_DEVICE_ID_QUATECH_QSC200 0x0040
1973#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 1641#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050
1974#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 1642#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060
1975 1643
@@ -1988,7 +1656,6 @@
1988#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106 1656#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106
1989#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107 1657#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107
1990#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108 1658#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108
1991#define PCI_SUBDEVICE_ID_HYPERCOPE_PLEXUS 0x0109
1992 1659
1993#define PCI_VENDOR_ID_KAWASAKI 0x136b 1660#define PCI_VENDOR_ID_KAWASAKI 0x136b
1994#define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01 1661#define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01
@@ -2002,12 +1669,9 @@
2002#define PCI_DEVICE_ID_LMC_SSI 0x0005 1669#define PCI_DEVICE_ID_LMC_SSI 0x0005
2003#define PCI_DEVICE_ID_LMC_T1 0x0006 1670#define PCI_DEVICE_ID_LMC_T1 0x0006
2004 1671
2005#define PCI_VENDOR_ID_MARIAN 0x1382
2006#define PCI_DEVICE_ID_MARIAN_PRODIF_PLUS 0x2048
2007 1672
2008#define PCI_VENDOR_ID_NETGEAR 0x1385 1673#define PCI_VENDOR_ID_NETGEAR 0x1385
2009#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a 1674#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a
2010#define PCI_DEVICE_ID_NETGEAR_GA622 0x622a
2011 1675
2012#define PCI_VENDOR_ID_APPLICOM 0x1389 1676#define PCI_VENDOR_ID_APPLICOM 0x1389
2013#define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001 1677#define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001
@@ -2030,9 +1694,6 @@
2030#define PCI_DEVICE_ID_MOXA_CP134U 0x1340 1694#define PCI_DEVICE_ID_MOXA_CP134U 0x1340
2031#define PCI_DEVICE_ID_MOXA_C168 0x1680 1695#define PCI_DEVICE_ID_MOXA_C168 0x1680
2032#define PCI_DEVICE_ID_MOXA_CP168U 0x1681 1696#define PCI_DEVICE_ID_MOXA_CP168U 0x1681
2033#define PCI_DEVICE_ID_MOXA_CP204J 0x2040
2034#define PCI_DEVICE_ID_MOXA_C218 0x2180
2035#define PCI_DEVICE_ID_MOXA_C320 0x3200
2036 1697
2037#define PCI_VENDOR_ID_CCD 0x1397 1698#define PCI_VENDOR_ID_CCD 0x1397
2038#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 1699#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0
@@ -2053,9 +1714,7 @@
2053 1714
2054#define PCI_VENDOR_ID_MICROGATE 0x13c0 1715#define PCI_VENDOR_ID_MICROGATE 0x13c0
2055#define PCI_DEVICE_ID_MICROGATE_USC 0x0010 1716#define PCI_DEVICE_ID_MICROGATE_USC 0x0010
2056#define PCI_DEVICE_ID_MICROGATE_SCC 0x0020
2057#define PCI_DEVICE_ID_MICROGATE_SCA 0x0030 1717#define PCI_DEVICE_ID_MICROGATE_SCA 0x0030
2058#define PCI_DEVICE_ID_MICROGATE_USC2 0x0210
2059 1718
2060#define PCI_VENDOR_ID_3WARE 0x13C1 1719#define PCI_VENDOR_ID_3WARE 0x13C1
2061#define PCI_DEVICE_ID_3WARE_1000 0x1000 1720#define PCI_DEVICE_ID_3WARE_1000 0x1000
@@ -2106,10 +1765,6 @@
2106 1765
2107#define PCI_VENDOR_ID_SAMSUNG 0x144d 1766#define PCI_VENDOR_ID_SAMSUNG 0x144d
2108 1767
2109#define PCI_VENDOR_ID_AIRONET 0x14b9
2110#define PCI_DEVICE_ID_AIRONET_4800_1 0x0001
2111#define PCI_DEVICE_ID_AIRONET_4800 0x4500 // values switched? see
2112#define PCI_DEVICE_ID_AIRONET_4500 0x4800 // drivers/net/aironet4500_card.c
2113 1768
2114#define PCI_VENDOR_ID_TITAN 0x14D2 1769#define PCI_VENDOR_ID_TITAN 0x14D2
2115#define PCI_DEVICE_ID_TITAN_010L 0x8001 1770#define PCI_DEVICE_ID_TITAN_010L 0x8001
@@ -2128,8 +1783,6 @@
2128#define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400 1783#define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400
2129#define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402 1784#define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402
2130 1785
2131#define PCI_VENDOR_ID_SIPACKETS 0x14d9
2132#define PCI_DEVICE_ID_SP_HT 0x0010
2133 1786
2134#define PCI_VENDOR_ID_AFAVLAB 0x14db 1787#define PCI_VENDOR_ID_AFAVLAB 0x14db
2135#define PCI_DEVICE_ID_AFAVLAB_P028 0x2180 1788#define PCI_DEVICE_ID_AFAVLAB_P028 0x2180
@@ -2145,6 +1798,7 @@
2145#define PCI_DEVICE_ID_TIGON3_5704 0x1648 1798#define PCI_DEVICE_ID_TIGON3_5704 0x1648
2146#define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649 1799#define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649
2147#define PCI_DEVICE_ID_NX2_5706 0x164a 1800#define PCI_DEVICE_ID_NX2_5706 0x164a
1801#define PCI_DEVICE_ID_NX2_5708 0x164c
2148#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d 1802#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d
2149#define PCI_DEVICE_ID_TIGON3_5705 0x1653 1803#define PCI_DEVICE_ID_TIGON3_5705 0x1653
2150#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 1804#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
@@ -2152,11 +1806,13 @@
2152#define PCI_DEVICE_ID_TIGON3_5721 0x1659 1806#define PCI_DEVICE_ID_TIGON3_5721 0x1659
2153#define PCI_DEVICE_ID_TIGON3_5705M 0x165d 1807#define PCI_DEVICE_ID_TIGON3_5705M 0x165d
2154#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e 1808#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e
1809#define PCI_DEVICE_ID_TIGON3_5714 0x1668
2155#define PCI_DEVICE_ID_TIGON3_5780 0x166a 1810#define PCI_DEVICE_ID_TIGON3_5780 0x166a
2156#define PCI_DEVICE_ID_TIGON3_5780S 0x166b 1811#define PCI_DEVICE_ID_TIGON3_5780S 0x166b
2157#define PCI_DEVICE_ID_TIGON3_5705F 0x166e 1812#define PCI_DEVICE_ID_TIGON3_5705F 0x166e
2158#define PCI_DEVICE_ID_TIGON3_5750 0x1676 1813#define PCI_DEVICE_ID_TIGON3_5750 0x1676
2159#define PCI_DEVICE_ID_TIGON3_5751 0x1677 1814#define PCI_DEVICE_ID_TIGON3_5751 0x1677
1815#define PCI_DEVICE_ID_TIGON3_5715 0x1678
2160#define PCI_DEVICE_ID_TIGON3_5750M 0x167c 1816#define PCI_DEVICE_ID_TIGON3_5750M 0x167c
2161#define PCI_DEVICE_ID_TIGON3_5751M 0x167d 1817#define PCI_DEVICE_ID_TIGON3_5751M 0x167d
2162#define PCI_DEVICE_ID_TIGON3_5751F 0x167e 1818#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
@@ -2167,6 +1823,7 @@
2167#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 1823#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7
2168#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 1824#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
2169#define PCI_DEVICE_ID_NX2_5706S 0x16aa 1825#define PCI_DEVICE_ID_NX2_5706S 0x16aa
1826#define PCI_DEVICE_ID_NX2_5708S 0x16ac
2170#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 1827#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6
2171#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 1828#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7
2172#define PCI_DEVICE_ID_TIGON3_5781 0x16dd 1829#define PCI_DEVICE_ID_TIGON3_5781 0x16dd
@@ -2186,11 +1843,14 @@
2186#define PCI_DEVICE_ID_ENE_1211 0x1211 1843#define PCI_DEVICE_ID_ENE_1211 0x1211
2187#define PCI_DEVICE_ID_ENE_1225 0x1225 1844#define PCI_DEVICE_ID_ENE_1225 0x1225
2188#define PCI_DEVICE_ID_ENE_1410 0x1410 1845#define PCI_DEVICE_ID_ENE_1410 0x1410
1846#define PCI_DEVICE_ID_ENE_710 0x1411
1847#define PCI_DEVICE_ID_ENE_712 0x1412
2189#define PCI_DEVICE_ID_ENE_1420 0x1420 1848#define PCI_DEVICE_ID_ENE_1420 0x1420
1849#define PCI_DEVICE_ID_ENE_720 0x1421
1850#define PCI_DEVICE_ID_ENE_722 0x1422
1851
2190#define PCI_VENDOR_ID_CHELSIO 0x1425 1852#define PCI_VENDOR_ID_CHELSIO 0x1425
2191 1853
2192#define PCI_VENDOR_ID_MIPS 0x153f
2193#define PCI_DEVICE_ID_SOC_IT 0x0001
2194 1854
2195#define PCI_VENDOR_ID_SYBA 0x1592 1855#define PCI_VENDOR_ID_SYBA 0x1592
2196#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 1856#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
@@ -2210,15 +1870,7 @@
2210#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 1870#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274
2211 1871
2212#define PCI_VENDOR_ID_PDC 0x15e9 1872#define PCI_VENDOR_ID_PDC 0x15e9
2213#define PCI_DEVICE_ID_PDC_1841 0x1841
2214 1873
2215#define PCI_VENDOR_ID_MACROLINK 0x15ed
2216#define PCI_DEVICE_ID_MACROLINK_MCCS8 0x1000
2217#define PCI_DEVICE_ID_MACROLINK_MCCS 0x1001
2218#define PCI_DEVICE_ID_MACROLINK_MCCS8H 0x1002
2219#define PCI_DEVICE_ID_MACROLINK_MCCSH 0x1003
2220#define PCI_DEVICE_ID_MACROLINK_MCCR8 0x2000
2221#define PCI_DEVICE_ID_MACROLINK_MCCR 0x2001
2222 1874
2223#define PCI_VENDOR_ID_FARSITE 0x1619 1875#define PCI_VENDOR_ID_FARSITE 0x1619
2224#define PCI_DEVICE_ID_FARSITE_T2P 0x0400 1876#define PCI_DEVICE_ID_FARSITE_T2P 0x0400
@@ -2236,7 +1888,6 @@
2236#define PCI_DEVICE_ID_REVOLUTION 0x0044 1888#define PCI_DEVICE_ID_REVOLUTION 0x0044
2237 1889
2238#define PCI_VENDOR_ID_LINKSYS 0x1737 1890#define PCI_VENDOR_ID_LINKSYS 0x1737
2239#define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032
2240#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 1891#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
2241 1892
2242#define PCI_VENDOR_ID_ALTIMA 0x173b 1893#define PCI_VENDOR_ID_ALTIMA 0x173b
@@ -2251,7 +1902,6 @@
2251#define PCI_DEVICE_ID_HERC_WIN 0x5732 1902#define PCI_DEVICE_ID_HERC_WIN 0x5732
2252#define PCI_DEVICE_ID_HERC_UNI 0x5832 1903#define PCI_DEVICE_ID_HERC_UNI 0x5832
2253 1904
2254#define PCI_VENDOR_ID_INFINICON 0x1820
2255 1905
2256#define PCI_VENDOR_ID_SITECOM 0x182d 1906#define PCI_VENDOR_ID_SITECOM 0x182d
2257#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 1907#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069
@@ -2261,8 +1911,6 @@
2261#define PCI_VENDOR_ID_TDI 0x192E 1911#define PCI_VENDOR_ID_TDI 0x192E
2262#define PCI_DEVICE_ID_TDI_EHCI 0x0101 1912#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2263 1913
2264#define PCI_VENDOR_ID_SYMPHONY 0x1c1c
2265#define PCI_DEVICE_ID_SYMPHONY_101 0x0001
2266 1914
2267#define PCI_VENDOR_ID_TEKRAM 0x1de1 1915#define PCI_VENDOR_ID_TEKRAM 0x1de1
2268#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 1916#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29
@@ -2271,70 +1919,33 @@
2271#define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013 1919#define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013
2272 1920
2273#define PCI_VENDOR_ID_3DLABS 0x3d3d 1921#define PCI_VENDOR_ID_3DLABS 0x3d3d
2274#define PCI_DEVICE_ID_3DLABS_300SX 0x0001
2275#define PCI_DEVICE_ID_3DLABS_500TX 0x0002
2276#define PCI_DEVICE_ID_3DLABS_DELTA 0x0003
2277#define PCI_DEVICE_ID_3DLABS_PERMEDIA 0x0004
2278#define PCI_DEVICE_ID_3DLABS_MX 0x0006
2279#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 1922#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007
2280#define PCI_DEVICE_ID_3DLABS_GAMMA 0x0008
2281#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 1923#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009
2282 1924
2283#define PCI_VENDOR_ID_AVANCE 0x4005
2284#define PCI_DEVICE_ID_AVANCE_ALG2064 0x2064
2285#define PCI_DEVICE_ID_AVANCE_2302 0x2302
2286 1925
2287#define PCI_VENDOR_ID_AKS 0x416c 1926#define PCI_VENDOR_ID_AKS 0x416c
2288#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 1927#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
2289#define PCI_DEVICE_ID_AKS_CPC 0x0200
2290 1928
2291#define PCI_VENDOR_ID_REDCREEK 0x4916
2292#define PCI_DEVICE_ID_RC45 0x1960
2293 1929
2294#define PCI_VENDOR_ID_NETVIN 0x4a14
2295#define PCI_DEVICE_ID_NETVIN_NV5000SC 0x5000
2296 1930
2297#define PCI_VENDOR_ID_S3 0x5333 1931#define PCI_VENDOR_ID_S3 0x5333
2298#define PCI_DEVICE_ID_S3_PLATO_PXS 0x0551
2299#define PCI_DEVICE_ID_S3_ViRGE 0x5631
2300#define PCI_DEVICE_ID_S3_TRIO 0x8811 1932#define PCI_DEVICE_ID_S3_TRIO 0x8811
2301#define PCI_DEVICE_ID_S3_AURORA64VP 0x8812
2302#define PCI_DEVICE_ID_S3_TRIO64UVP 0x8814
2303#define PCI_DEVICE_ID_S3_ViRGE_VX 0x883d
2304#define PCI_DEVICE_ID_S3_868 0x8880 1933#define PCI_DEVICE_ID_S3_868 0x8880
2305#define PCI_DEVICE_ID_S3_928 0x88b0
2306#define PCI_DEVICE_ID_S3_864_1 0x88c0
2307#define PCI_DEVICE_ID_S3_864_2 0x88c1
2308#define PCI_DEVICE_ID_S3_964_1 0x88d0
2309#define PCI_DEVICE_ID_S3_964_2 0x88d1
2310#define PCI_DEVICE_ID_S3_968 0x88f0 1934#define PCI_DEVICE_ID_S3_968 0x88f0
2311#define PCI_DEVICE_ID_S3_TRIO64V2 0x8901
2312#define PCI_DEVICE_ID_S3_PLATO_PXG 0x8902
2313#define PCI_DEVICE_ID_S3_ViRGE_DXGX 0x8a01
2314#define PCI_DEVICE_ID_S3_ViRGE_GX2 0x8a10
2315#define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25 1935#define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25
2316#define PCI_DEVICE_ID_S3_ViRGE_MX 0x8c01
2317#define PCI_DEVICE_ID_S3_ViRGE_MXP 0x8c02
2318#define PCI_DEVICE_ID_S3_ViRGE_MXPMV 0x8c03
2319#define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04 1936#define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04
2320#define PCI_DEVICE_ID_S3_SONICVIBES 0xca00 1937#define PCI_DEVICE_ID_S3_SONICVIBES 0xca00
2321 1938
2322#define PCI_VENDOR_ID_DUNORD 0x5544 1939#define PCI_VENDOR_ID_DUNORD 0x5544
2323#define PCI_DEVICE_ID_DUNORD_I3000 0x0001 1940#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
2324 1941
1942
2325#define PCI_VENDOR_ID_DCI 0x6666 1943#define PCI_VENDOR_ID_DCI 0x6666
2326#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001 1944#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001
2327#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002 1945#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002
2328 1946
2329#define PCI_VENDOR_ID_DUNORD 0x5544
2330#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
2331
2332#define PCI_VENDOR_ID_GENROCO 0x5555
2333#define PCI_DEVICE_ID_GENROCO_HFP832 0x0003
2334
2335#define PCI_VENDOR_ID_INTEL 0x8086 1947#define PCI_VENDOR_ID_INTEL 0x8086
2336#define PCI_DEVICE_ID_INTEL_EESSC 0x0008 1948#define PCI_DEVICE_ID_INTEL_EESSC 0x0008
2337#define PCI_DEVICE_ID_INTEL_21145 0x0039
2338#define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320 1949#define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320
2339#define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321 1950#define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321
2340#define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 1951#define PCI_DEVICE_ID_INTEL_PXH_0 0x0329
@@ -2343,30 +1954,17 @@
2343#define PCI_DEVICE_ID_INTEL_82375 0x0482 1954#define PCI_DEVICE_ID_INTEL_82375 0x0482
2344#define PCI_DEVICE_ID_INTEL_82424 0x0483 1955#define PCI_DEVICE_ID_INTEL_82424 0x0483
2345#define PCI_DEVICE_ID_INTEL_82378 0x0484 1956#define PCI_DEVICE_ID_INTEL_82378 0x0484
2346#define PCI_DEVICE_ID_INTEL_82430 0x0486
2347#define PCI_DEVICE_ID_INTEL_82434 0x04a3
2348#define PCI_DEVICE_ID_INTEL_I960 0x0960 1957#define PCI_DEVICE_ID_INTEL_I960 0x0960
2349#define PCI_DEVICE_ID_INTEL_I960RM 0x0962 1958#define PCI_DEVICE_ID_INTEL_I960RM 0x0962
2350#define PCI_DEVICE_ID_INTEL_82562ET 0x1031
2351#define PCI_DEVICE_ID_INTEL_82801CAM 0x1038
2352#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130 1959#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130
2353#define PCI_DEVICE_ID_INTEL_82815_AB 0x1131
2354#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132 1960#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132
2355#define PCI_DEVICE_ID_INTEL_82559ER 0x1209
2356#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221 1961#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
2357#define PCI_DEVICE_ID_INTEL_82092AA_1 0x1222
2358#define PCI_DEVICE_ID_INTEL_7116 0x1223
2359#define PCI_DEVICE_ID_INTEL_7505_0 0x2550 1962#define PCI_DEVICE_ID_INTEL_7505_0 0x2550
2360#define PCI_DEVICE_ID_INTEL_7505_1 0x2552
2361#define PCI_DEVICE_ID_INTEL_7205_0 0x255d 1963#define PCI_DEVICE_ID_INTEL_7205_0 0x255d
2362#define PCI_DEVICE_ID_INTEL_82596 0x1226
2363#define PCI_DEVICE_ID_INTEL_82865 0x1227
2364#define PCI_DEVICE_ID_INTEL_82557 0x1229
2365#define PCI_DEVICE_ID_INTEL_82437 0x122d 1964#define PCI_DEVICE_ID_INTEL_82437 0x122d
2366#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e 1965#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e
2367#define PCI_DEVICE_ID_INTEL_82371FB_1 0x1230 1966#define PCI_DEVICE_ID_INTEL_82371FB_1 0x1230
2368#define PCI_DEVICE_ID_INTEL_82371MX 0x1234 1967#define PCI_DEVICE_ID_INTEL_82371MX 0x1234
2369#define PCI_DEVICE_ID_INTEL_82437MX 0x1235
2370#define PCI_DEVICE_ID_INTEL_82441 0x1237 1968#define PCI_DEVICE_ID_INTEL_82441 0x1237
2371#define PCI_DEVICE_ID_INTEL_82380FB 0x124b 1969#define PCI_DEVICE_ID_INTEL_82380FB 0x124b
2372#define PCI_DEVICE_ID_INTEL_82439 0x1250 1970#define PCI_DEVICE_ID_INTEL_82439 0x1250
@@ -2375,83 +1973,53 @@
2375#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 1973#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2376#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 1974#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2377#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 1975#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2378#define PCI_DEVICE_ID_INTEL_82801AA_2 0x2412
2379#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 1976#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
2380#define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415 1977#define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415
2381#define PCI_DEVICE_ID_INTEL_82801AA_6 0x2416 1978#define PCI_DEVICE_ID_INTEL_82801AA_6 0x2416
2382#define PCI_DEVICE_ID_INTEL_82801AA_8 0x2418 1979#define PCI_DEVICE_ID_INTEL_82801AA_8 0x2418
2383#define PCI_DEVICE_ID_INTEL_82801AB_0 0x2420 1980#define PCI_DEVICE_ID_INTEL_82801AB_0 0x2420
2384#define PCI_DEVICE_ID_INTEL_82801AB_1 0x2421 1981#define PCI_DEVICE_ID_INTEL_82801AB_1 0x2421
2385#define PCI_DEVICE_ID_INTEL_82801AB_2 0x2422
2386#define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423 1982#define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423
2387#define PCI_DEVICE_ID_INTEL_82801AB_5 0x2425 1983#define PCI_DEVICE_ID_INTEL_82801AB_5 0x2425
2388#define PCI_DEVICE_ID_INTEL_82801AB_6 0x2426 1984#define PCI_DEVICE_ID_INTEL_82801AB_6 0x2426
2389#define PCI_DEVICE_ID_INTEL_82801AB_8 0x2428 1985#define PCI_DEVICE_ID_INTEL_82801AB_8 0x2428
2390#define PCI_DEVICE_ID_INTEL_82801BA_0 0x2440 1986#define PCI_DEVICE_ID_INTEL_82801BA_0 0x2440
2391#define PCI_DEVICE_ID_INTEL_82801BA_1 0x2442
2392#define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443 1987#define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443
2393#define PCI_DEVICE_ID_INTEL_82801BA_3 0x2444
2394#define PCI_DEVICE_ID_INTEL_82801BA_4 0x2445 1988#define PCI_DEVICE_ID_INTEL_82801BA_4 0x2445
2395#define PCI_DEVICE_ID_INTEL_82801BA_5 0x2446
2396#define PCI_DEVICE_ID_INTEL_82801BA_6 0x2448 1989#define PCI_DEVICE_ID_INTEL_82801BA_6 0x2448
2397#define PCI_DEVICE_ID_INTEL_82801BA_7 0x2449
2398#define PCI_DEVICE_ID_INTEL_82801BA_8 0x244a 1990#define PCI_DEVICE_ID_INTEL_82801BA_8 0x244a
2399#define PCI_DEVICE_ID_INTEL_82801BA_9 0x244b 1991#define PCI_DEVICE_ID_INTEL_82801BA_9 0x244b
2400#define PCI_DEVICE_ID_INTEL_82801BA_10 0x244c 1992#define PCI_DEVICE_ID_INTEL_82801BA_10 0x244c
2401#define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e 1993#define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e
2402#define PCI_DEVICE_ID_INTEL_82801E_0 0x2450 1994#define PCI_DEVICE_ID_INTEL_82801E_0 0x2450
2403#define PCI_DEVICE_ID_INTEL_82801E_2 0x2452
2404#define PCI_DEVICE_ID_INTEL_82801E_3 0x2453
2405#define PCI_DEVICE_ID_INTEL_82801E_9 0x2459
2406#define PCI_DEVICE_ID_INTEL_82801E_11 0x245b 1995#define PCI_DEVICE_ID_INTEL_82801E_11 0x245b
2407#define PCI_DEVICE_ID_INTEL_82801E_13 0x245d
2408#define PCI_DEVICE_ID_INTEL_82801E_14 0x245e
2409#define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480 1996#define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480
2410#define PCI_DEVICE_ID_INTEL_82801CA_2 0x2482
2411#define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483 1997#define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483
2412#define PCI_DEVICE_ID_INTEL_82801CA_4 0x2484
2413#define PCI_DEVICE_ID_INTEL_82801CA_5 0x2485 1998#define PCI_DEVICE_ID_INTEL_82801CA_5 0x2485
2414#define PCI_DEVICE_ID_INTEL_82801CA_6 0x2486 1999#define PCI_DEVICE_ID_INTEL_82801CA_6 0x2486
2415#define PCI_DEVICE_ID_INTEL_82801CA_7 0x2487
2416#define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a 2000#define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a
2417#define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b 2001#define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b
2418#define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c 2002#define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c
2419#define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0 2003#define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0
2420#define PCI_DEVICE_ID_INTEL_82801DB_1 0x24c1 2004#define PCI_DEVICE_ID_INTEL_82801DB_1 0x24c1
2421#define PCI_DEVICE_ID_INTEL_82801DB_2 0x24c2
2422#define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3 2005#define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3
2423#define PCI_DEVICE_ID_INTEL_82801DB_4 0x24c4
2424#define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5 2006#define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5
2425#define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6 2007#define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6
2426#define PCI_DEVICE_ID_INTEL_82801DB_7 0x24c7
2427#define PCI_DEVICE_ID_INTEL_82801DB_9 0x24c9 2008#define PCI_DEVICE_ID_INTEL_82801DB_9 0x24c9
2428#define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca 2009#define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca
2429#define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb 2010#define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb
2430#define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc 2011#define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc
2431#define PCI_DEVICE_ID_INTEL_82801DB_13 0x24cd
2432#define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0 2012#define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0
2433#define PCI_DEVICE_ID_INTEL_82801EB_1 0x24d1 2013#define PCI_DEVICE_ID_INTEL_82801EB_1 0x24d1
2434#define PCI_DEVICE_ID_INTEL_82801EB_2 0x24d2
2435#define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3 2014#define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3
2436#define PCI_DEVICE_ID_INTEL_82801EB_4 0x24d4
2437#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5 2015#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5
2438#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6 2016#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6
2439#define PCI_DEVICE_ID_INTEL_82801EB_7 0x24d7
2440#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db 2017#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db
2441#define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd
2442#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1 2018#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1
2443#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2 2019#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2
2444#define PCI_DEVICE_ID_INTEL_ESB_3 0x25a3
2445#define PCI_DEVICE_ID_INTEL_ESB_31 0x25b0
2446#define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4 2020#define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4
2447#define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6 2021#define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6
2448#define PCI_DEVICE_ID_INTEL_ESB_6 0x25a7
2449#define PCI_DEVICE_ID_INTEL_ESB_7 0x25a9
2450#define PCI_DEVICE_ID_INTEL_ESB_8 0x25aa
2451#define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab 2022#define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab
2452#define PCI_DEVICE_ID_INTEL_ESB_11 0x25ac
2453#define PCI_DEVICE_ID_INTEL_ESB_12 0x25ad
2454#define PCI_DEVICE_ID_INTEL_ESB_13 0x25ae
2455#define PCI_DEVICE_ID_INTEL_82820_HB 0x2500 2023#define PCI_DEVICE_ID_INTEL_82820_HB 0x2500
2456#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501 2024#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501
2457#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530 2025#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530
@@ -2461,7 +2029,6 @@
2461#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570 2029#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570
2462#define PCI_DEVICE_ID_INTEL_82865_IG 0x2572 2030#define PCI_DEVICE_ID_INTEL_82865_IG 0x2572
2463#define PCI_DEVICE_ID_INTEL_82875_HB 0x2578 2031#define PCI_DEVICE_ID_INTEL_82875_HB 0x2578
2464#define PCI_DEVICE_ID_INTEL_82875_IG 0x257b
2465#define PCI_DEVICE_ID_INTEL_82915G_HB 0x2580 2032#define PCI_DEVICE_ID_INTEL_82915G_HB 0x2580
2466#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 2033#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582
2467#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 2034#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590
@@ -2471,80 +2038,23 @@
2471#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 2038#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
2472#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 2039#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641
2473#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 2040#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642
2474#define PCI_DEVICE_ID_INTEL_ICH6_3 0x2651
2475#define PCI_DEVICE_ID_INTEL_ICH6_4 0x2652
2476#define PCI_DEVICE_ID_INTEL_ICH6_5 0x2653
2477#define PCI_DEVICE_ID_INTEL_ICH6_6 0x2658
2478#define PCI_DEVICE_ID_INTEL_ICH6_7 0x2659
2479#define PCI_DEVICE_ID_INTEL_ICH6_8 0x265a
2480#define PCI_DEVICE_ID_INTEL_ICH6_9 0x265b
2481#define PCI_DEVICE_ID_INTEL_ICH6_10 0x265c
2482#define PCI_DEVICE_ID_INTEL_ICH6_11 0x2660
2483#define PCI_DEVICE_ID_INTEL_ICH6_12 0x2662
2484#define PCI_DEVICE_ID_INTEL_ICH6_13 0x2664
2485#define PCI_DEVICE_ID_INTEL_ICH6_14 0x2666
2486#define PCI_DEVICE_ID_INTEL_ICH6_15 0x2668
2487#define PCI_DEVICE_ID_INTEL_ICH6_16 0x266a 2041#define PCI_DEVICE_ID_INTEL_ICH6_16 0x266a
2488#define PCI_DEVICE_ID_INTEL_ICH6_17 0x266d 2042#define PCI_DEVICE_ID_INTEL_ICH6_17 0x266d
2489#define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e 2043#define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e
2490#define PCI_DEVICE_ID_INTEL_ICH6_19 0x266f 2044#define PCI_DEVICE_ID_INTEL_ICH6_19 0x266f
2491#define PCI_DEVICE_ID_INTEL_ESB2_0 0x2670 2045#define PCI_DEVICE_ID_INTEL_ESB2_0 0x2670
2492#define PCI_DEVICE_ID_INTEL_ESB2_1 0x2680
2493#define PCI_DEVICE_ID_INTEL_ESB2_2 0x2681
2494#define PCI_DEVICE_ID_INTEL_ESB2_3 0x2682
2495#define PCI_DEVICE_ID_INTEL_ESB2_4 0x2683
2496#define PCI_DEVICE_ID_INTEL_ESB2_5 0x2688
2497#define PCI_DEVICE_ID_INTEL_ESB2_6 0x2689
2498#define PCI_DEVICE_ID_INTEL_ESB2_7 0x268a
2499#define PCI_DEVICE_ID_INTEL_ESB2_8 0x268b
2500#define PCI_DEVICE_ID_INTEL_ESB2_9 0x268c
2501#define PCI_DEVICE_ID_INTEL_ESB2_10 0x2690
2502#define PCI_DEVICE_ID_INTEL_ESB2_11 0x2692
2503#define PCI_DEVICE_ID_INTEL_ESB2_12 0x2694
2504#define PCI_DEVICE_ID_INTEL_ESB2_13 0x2696
2505#define PCI_DEVICE_ID_INTEL_ESB2_14 0x2698 2046#define PCI_DEVICE_ID_INTEL_ESB2_14 0x2698
2506#define PCI_DEVICE_ID_INTEL_ESB2_15 0x2699
2507#define PCI_DEVICE_ID_INTEL_ESB2_16 0x269a
2508#define PCI_DEVICE_ID_INTEL_ESB2_17 0x269b 2047#define PCI_DEVICE_ID_INTEL_ESB2_17 0x269b
2509#define PCI_DEVICE_ID_INTEL_ESB2_18 0x269e 2048#define PCI_DEVICE_ID_INTEL_ESB2_18 0x269e
2510#define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8 2049#define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8
2511#define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9 2050#define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9
2512#define PCI_DEVICE_ID_INTEL_ICH7_2 0x27c0
2513#define PCI_DEVICE_ID_INTEL_ICH7_3 0x27c1
2514#define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0 2051#define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0
2515#define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd 2052#define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd
2516#define PCI_DEVICE_ID_INTEL_ICH7_5 0x27c4
2517#define PCI_DEVICE_ID_INTEL_ICH7_6 0x27c5
2518#define PCI_DEVICE_ID_INTEL_ICH7_7 0x27c8
2519#define PCI_DEVICE_ID_INTEL_ICH7_8 0x27c9
2520#define PCI_DEVICE_ID_INTEL_ICH7_9 0x27ca
2521#define PCI_DEVICE_ID_INTEL_ICH7_10 0x27cb
2522#define PCI_DEVICE_ID_INTEL_ICH7_11 0x27cc
2523#define PCI_DEVICE_ID_INTEL_ICH7_12 0x27d0
2524#define PCI_DEVICE_ID_INTEL_ICH7_13 0x27d2
2525#define PCI_DEVICE_ID_INTEL_ICH7_14 0x27d4
2526#define PCI_DEVICE_ID_INTEL_ICH7_15 0x27d6
2527#define PCI_DEVICE_ID_INTEL_ICH7_16 0x27d8
2528#define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da 2053#define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da
2529#define PCI_DEVICE_ID_INTEL_ICH7_18 0x27dc
2530#define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd 2054#define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd
2531#define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de 2055#define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de
2532#define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df 2056#define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df
2533#define PCI_DEVICE_ID_INTEL_ICH7_22 0x27e0
2534#define PCI_DEVICE_ID_INTEL_ICH7_23 0x27e2
2535#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2057#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2536#define PCI_DEVICE_ID_INTEL_ESB2_19 0x3500
2537#define PCI_DEVICE_ID_INTEL_ESB2_20 0x3501
2538#define PCI_DEVICE_ID_INTEL_ESB2_21 0x3504
2539#define PCI_DEVICE_ID_INTEL_ESB2_22 0x3505
2540#define PCI_DEVICE_ID_INTEL_ESB2_23 0x350c
2541#define PCI_DEVICE_ID_INTEL_ESB2_24 0x350d
2542#define PCI_DEVICE_ID_INTEL_ESB2_25 0x3510
2543#define PCI_DEVICE_ID_INTEL_ESB2_26 0x3511
2544#define PCI_DEVICE_ID_INTEL_ESB2_27 0x3514
2545#define PCI_DEVICE_ID_INTEL_ESB2_28 0x3515
2546#define PCI_DEVICE_ID_INTEL_ESB2_29 0x3518
2547#define PCI_DEVICE_ID_INTEL_ESB2_30 0x3519
2548#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2058#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2549#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2059#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
2550#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580 2060#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580
@@ -2558,7 +2068,6 @@
2558#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599 2068#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
2559#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a 2069#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
2560#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e 2070#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
2561#define PCI_DEVICE_ID_INTEL_80310 0x530d
2562#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 2071#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
2563#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010 2072#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
2564#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020 2073#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020
@@ -2583,22 +2092,15 @@
2583#define PCI_DEVICE_ID_INTEL_440MX_6 0x7196 2092#define PCI_DEVICE_ID_INTEL_440MX_6 0x7196
2584#define PCI_DEVICE_ID_INTEL_82443MX_0 0x7198 2093#define PCI_DEVICE_ID_INTEL_82443MX_0 0x7198
2585#define PCI_DEVICE_ID_INTEL_82443MX_1 0x7199 2094#define PCI_DEVICE_ID_INTEL_82443MX_1 0x7199
2586#define PCI_DEVICE_ID_INTEL_82443MX_2 0x719a
2587#define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b 2095#define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b
2588#define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0 2096#define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0
2589#define PCI_DEVICE_ID_INTEL_82443GX_1 0x71a1
2590#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2 2097#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2
2591#define PCI_DEVICE_ID_INTEL_82372FB_0 0x7600
2592#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 2098#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601
2593#define PCI_DEVICE_ID_INTEL_82372FB_2 0x7602
2594#define PCI_DEVICE_ID_INTEL_82372FB_3 0x7603
2595#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 2099#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4
2596#define PCI_DEVICE_ID_INTEL_82450GX 0x84c5
2597#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca 2100#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca
2598#define PCI_DEVICE_ID_INTEL_82454NX 0x84cb 2101#define PCI_DEVICE_ID_INTEL_82454NX 0x84cb
2599#define PCI_DEVICE_ID_INTEL_84460GX 0x84ea 2102#define PCI_DEVICE_ID_INTEL_84460GX 0x84ea
2600#define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500 2103#define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500
2601#define PCI_DEVICE_ID_INTEL_IXP2400 0x9001
2602#define PCI_DEVICE_ID_INTEL_IXP2800 0x9004 2104#define PCI_DEVICE_ID_INTEL_IXP2800 0x9004
2603#define PCI_DEVICE_ID_INTEL_S21152BB 0xb152 2105#define PCI_DEVICE_ID_INTEL_S21152BB 0xb152
2604 2106
@@ -2611,7 +2113,6 @@
2611#define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003 2113#define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003
2612 2114
2613#define PCI_VENDOR_ID_KTI 0x8e2e 2115#define PCI_VENDOR_ID_KTI 0x8e2e
2614#define PCI_DEVICE_ID_KTI_ET32P2 0x3000
2615 2116
2616#define PCI_VENDOR_ID_ADAPTEC 0x9004 2117#define PCI_VENDOR_ID_ADAPTEC 0x9004
2617#define PCI_DEVICE_ID_ADAPTEC_7810 0x1078 2118#define PCI_DEVICE_ID_ADAPTEC_7810 0x1078
@@ -2619,7 +2120,6 @@
2619#define PCI_DEVICE_ID_ADAPTEC_38602 0x3860 2120#define PCI_DEVICE_ID_ADAPTEC_38602 0x3860
2620#define PCI_DEVICE_ID_ADAPTEC_7850 0x5078 2121#define PCI_DEVICE_ID_ADAPTEC_7850 0x5078
2621#define PCI_DEVICE_ID_ADAPTEC_7855 0x5578 2122#define PCI_DEVICE_ID_ADAPTEC_7855 0x5578
2622#define PCI_DEVICE_ID_ADAPTEC_5800 0x5800
2623#define PCI_DEVICE_ID_ADAPTEC_3860 0x6038 2123#define PCI_DEVICE_ID_ADAPTEC_3860 0x6038
2624#define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075 2124#define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075
2625#define PCI_DEVICE_ID_ADAPTEC_7860 0x6078 2125#define PCI_DEVICE_ID_ADAPTEC_7860 0x6078
@@ -2639,7 +2139,6 @@
2639#define PCI_DEVICE_ID_ADAPTEC_7886 0x8678 2139#define PCI_DEVICE_ID_ADAPTEC_7886 0x8678
2640#define PCI_DEVICE_ID_ADAPTEC_7887 0x8778 2140#define PCI_DEVICE_ID_ADAPTEC_7887 0x8778
2641#define PCI_DEVICE_ID_ADAPTEC_7888 0x8878 2141#define PCI_DEVICE_ID_ADAPTEC_7888 0x8878
2642#define PCI_DEVICE_ID_ADAPTEC_1030 0x8b78
2643 2142
2644#define PCI_VENDOR_ID_ADAPTEC2 0x9005 2143#define PCI_VENDOR_ID_ADAPTEC2 0x9005
2645#define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010 2144#define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010
@@ -2657,10 +2156,9 @@
2657#define PCI_DEVICE_ID_ADAPTEC2_7899B 0x00c1 2156#define PCI_DEVICE_ID_ADAPTEC2_7899B 0x00c1
2658#define PCI_DEVICE_ID_ADAPTEC2_7899D 0x00c3 2157#define PCI_DEVICE_ID_ADAPTEC2_7899D 0x00c3
2659#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf 2158#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf
2159#define PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN 0x0500
2660#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503 2160#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503
2661 2161
2662#define PCI_VENDOR_ID_ATRONICS 0x907f
2663#define PCI_DEVICE_ID_ATRONICS_2015 0x2015
2664 2162
2665#define PCI_VENDOR_ID_HOLTEK 0x9412 2163#define PCI_VENDOR_ID_HOLTEK 0x9412
2666#define PCI_DEVICE_ID_HOLTEK_6565 0x6565 2164#define PCI_DEVICE_ID_HOLTEK_6565 0x6565
@@ -2679,6 +2177,7 @@
2679 2177
2680#define PCI_SUBVENDOR_ID_EXSYS 0xd84d 2178#define PCI_SUBVENDOR_ID_EXSYS 0xd84d
2681#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 2179#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014
2180#define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055
2682 2181
2683#define PCI_VENDOR_ID_TIGERJET 0xe159 2182#define PCI_VENDOR_ID_TIGERJET 0xe159
2684#define PCI_DEVICE_ID_TIGERJET_300 0x0001 2183#define PCI_DEVICE_ID_TIGERJET_300 0x0001
@@ -2692,7 +2191,3 @@
2692#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 2191#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897
2693#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 2192#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898
2694 2193
2695#define PCI_VENDOR_ID_ARK 0xedd8
2696#define PCI_DEVICE_ID_ARK_STING 0xa091
2697#define PCI_DEVICE_ID_ARK_STINGARK 0xa099
2698#define PCI_DEVICE_ID_ARK_2000MT 0xa0a1
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 5451eb1e781d..fb8d2d24e4bb 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -38,7 +38,7 @@ extern void free_percpu(const void *);
38 38
39#else /* CONFIG_SMP */ 39#else /* CONFIG_SMP */
40 40
41#define per_cpu_ptr(ptr, cpu) (ptr) 41#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
42 42
43static inline void *__alloc_percpu(size_t size, size_t align) 43static inline void *__alloc_percpu(size_t size, size_t align)
44{ 44{
diff --git a/include/linux/phonedev.h b/include/linux/phonedev.h
index d54049eed0c3..a0e31adf3abe 100644
--- a/include/linux/phonedev.h
+++ b/include/linux/phonedev.h
@@ -2,7 +2,6 @@
2#define __LINUX_PHONEDEV_H 2#define __LINUX_PHONEDEV_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/version.h>
6 5
7#ifdef __KERNEL__ 6#ifdef __KERNEL__
8 7
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 72cb67b66e0c..92a9696fdebe 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -72,6 +72,9 @@ struct mii_bus {
72 /* list of all PHYs on bus */ 72 /* list of all PHYs on bus */
73 struct phy_device *phy_map[PHY_MAX_ADDR]; 73 struct phy_device *phy_map[PHY_MAX_ADDR];
74 74
75 /* Phy addresses to be ignored when probing */
76 u32 phy_mask;
77
75 /* Pointer to an array of interrupts, each PHY's 78 /* Pointer to an array of interrupts, each PHY's
76 * interrupt at the index matching its address */ 79 * interrupt at the index matching its address */
77 int *irq; 80 int *irq;
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 60ffcb9c5791..e87b233615b3 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -93,6 +93,7 @@ struct tc_fifo_qopt
93/* PRIO section */ 93/* PRIO section */
94 94
95#define TCQ_PRIO_BANDS 16 95#define TCQ_PRIO_BANDS 16
96#define TCQ_MIN_PRIO_BANDS 2
96 97
97struct tc_prio_qopt 98struct tc_prio_qopt
98{ 99{
@@ -169,6 +170,7 @@ struct tc_red_qopt
169 unsigned char Scell_log; /* cell size for idle damping */ 170 unsigned char Scell_log; /* cell size for idle damping */
170 unsigned char flags; 171 unsigned char flags;
171#define TC_RED_ECN 1 172#define TC_RED_ECN 1
173#define TC_RED_HARDDROP 2
172}; 174};
173 175
174struct tc_red_xstats 176struct tc_red_xstats
@@ -194,38 +196,34 @@ enum
194 196
195#define TCA_GRED_MAX (__TCA_GRED_MAX - 1) 197#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
196 198
197#define TCA_SET_OFF TCA_GRED_PARMS
198struct tc_gred_qopt 199struct tc_gred_qopt
199{ 200{
200 __u32 limit; /* HARD maximal queue length (bytes) 201 __u32 limit; /* HARD maximal queue length (bytes) */
201*/ 202 __u32 qth_min; /* Min average length threshold (bytes) */
202 __u32 qth_min; /* Min average length threshold (bytes) 203 __u32 qth_max; /* Max average length threshold (bytes) */
203*/ 204 __u32 DP; /* upto 2^32 DPs */
204 __u32 qth_max; /* Max average length threshold (bytes) 205 __u32 backlog;
205*/ 206 __u32 qave;
206 __u32 DP; /* upto 2^32 DPs */ 207 __u32 forced;
207 __u32 backlog; 208 __u32 early;
208 __u32 qave; 209 __u32 other;
209 __u32 forced; 210 __u32 pdrop;
210 __u32 early; 211 __u8 Wlog; /* log(W) */
211 __u32 other; 212 __u8 Plog; /* log(P_max/(qth_max-qth_min)) */
212 __u32 pdrop; 213 __u8 Scell_log; /* cell size for idle damping */
213 214 __u8 prio; /* prio of this VQ */
214 unsigned char Wlog; /* log(W) */ 215 __u32 packets;
215 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ 216 __u32 bytesin;
216 unsigned char Scell_log; /* cell size for idle damping */
217 __u8 prio; /* prio of this VQ */
218 __u32 packets;
219 __u32 bytesin;
220}; 217};
218
221/* gred setup */ 219/* gred setup */
222struct tc_gred_sopt 220struct tc_gred_sopt
223{ 221{
224 __u32 DPs; 222 __u32 DPs;
225 __u32 def_DP; 223 __u32 def_DP;
226 __u8 grio; 224 __u8 grio;
227 __u8 pad1; 225 __u8 flags;
228 __u16 pad2; 226 __u16 pad1;
229}; 227};
230 228
231/* HTB section */ 229/* HTB section */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
new file mode 100644
index 000000000000..17e336f40b47
--- /dev/null
+++ b/include/linux/platform_device.h
@@ -0,0 +1,61 @@
1/*
2 * platform_device.h - generic, centralized driver model
3 *
4 * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
5 *
6 * This file is released under the GPLv2
7 *
8 * See Documentation/driver-model/ for more information.
9 */
10
11#ifndef _PLATFORM_DEVICE_H_
12#define _PLATFORM_DEVICE_H_
13
14#include <linux/device.h>
15
16struct platform_device {
17 const char * name;
18 u32 id;
19 struct device dev;
20 u32 num_resources;
21 struct resource * resource;
22};
23
24#define to_platform_device(x) container_of((x), struct platform_device, dev)
25
26extern int platform_device_register(struct platform_device *);
27extern void platform_device_unregister(struct platform_device *);
28
29extern struct bus_type platform_bus_type;
30extern struct device platform_bus;
31
32extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int);
33extern int platform_get_irq(struct platform_device *, unsigned int);
34extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *);
35extern int platform_get_irq_byname(struct platform_device *, char *);
36extern int platform_add_devices(struct platform_device **, int);
37
38extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int);
39
40extern struct platform_device *platform_device_alloc(const char *name, unsigned int id);
41extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
42extern int platform_device_add_data(struct platform_device *pdev, void *data, size_t size);
43extern int platform_device_add(struct platform_device *pdev);
44extern void platform_device_put(struct platform_device *pdev);
45
46struct platform_driver {
47 int (*probe)(struct platform_device *);
48 int (*remove)(struct platform_device *);
49 void (*shutdown)(struct platform_device *);
50 int (*suspend)(struct platform_device *, pm_message_t state);
51 int (*resume)(struct platform_device *);
52 struct device_driver driver;
53};
54
55extern int platform_driver_register(struct platform_driver *);
56extern void platform_driver_unregister(struct platform_driver *);
57
58#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
59#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
60
61#endif /* _PLATFORM_DEVICE_H_ */
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 5cfb07648eca..5be87ba3b7ac 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -94,55 +94,6 @@ struct pm_dev
94 struct list_head entry; 94 struct list_head entry;
95}; 95};
96 96
97#ifdef CONFIG_PM
98
99extern int pm_active;
100
101#define PM_IS_ACTIVE() (pm_active != 0)
102
103/*
104 * Register a device with power management
105 */
106struct pm_dev __deprecated *
107pm_register(pm_dev_t type, unsigned long id, pm_callback callback);
108
109/*
110 * Unregister a device with power management
111 */
112void __deprecated pm_unregister(struct pm_dev *dev);
113
114/*
115 * Unregister all devices with matching callback
116 */
117void __deprecated pm_unregister_all(pm_callback callback);
118
119/*
120 * Send a request to all devices
121 */
122int __deprecated pm_send_all(pm_request_t rqst, void *data);
123
124#else /* CONFIG_PM */
125
126#define PM_IS_ACTIVE() 0
127
128static inline struct pm_dev *pm_register(pm_dev_t type,
129 unsigned long id,
130 pm_callback callback)
131{
132 return NULL;
133}
134
135static inline void pm_unregister(struct pm_dev *dev) {}
136
137static inline void pm_unregister_all(pm_callback callback) {}
138
139static inline int pm_send_all(pm_request_t rqst, void *data)
140{
141 return 0;
142}
143
144#endif /* CONFIG_PM */
145
146/* Functions above this comment are list-based old-style power 97/* Functions above this comment are list-based old-style power
147 * managment. Please avoid using them. */ 98 * managment. Please avoid using them. */
148 99
@@ -170,6 +121,7 @@ typedef int __bitwise suspend_disk_method_t;
170 121
171struct pm_ops { 122struct pm_ops {
172 suspend_disk_method_t pm_disk_mode; 123 suspend_disk_method_t pm_disk_mode;
124 int (*valid)(suspend_state_t state);
173 int (*prepare)(suspend_state_t state); 125 int (*prepare)(suspend_state_t state);
174 int (*enter)(suspend_state_t state); 126 int (*enter)(suspend_state_t state);
175 int (*finish)(suspend_state_t state); 127 int (*finish)(suspend_state_t state);
@@ -219,10 +171,11 @@ typedef struct pm_message {
219 171
220struct dev_pm_info { 172struct dev_pm_info {
221 pm_message_t power_state; 173 pm_message_t power_state;
174 unsigned can_wakeup:1;
222#ifdef CONFIG_PM 175#ifdef CONFIG_PM
176 unsigned should_wakeup:1;
223 pm_message_t prev_state; 177 pm_message_t prev_state;
224 void * saved_state; 178 void * saved_state;
225 atomic_t pm_users;
226 struct device * pm_parent; 179 struct device * pm_parent;
227 struct list_head entry; 180 struct list_head entry;
228#endif 181#endif
@@ -236,13 +189,48 @@ extern void device_resume(void);
236 189
237#ifdef CONFIG_PM 190#ifdef CONFIG_PM
238extern int device_suspend(pm_message_t state); 191extern int device_suspend(pm_message_t state);
239#else 192
193#define device_set_wakeup_enable(dev,val) \
194 ((dev)->power.should_wakeup = !!(val))
195#define device_may_wakeup(dev) \
196 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
197
198extern int dpm_runtime_suspend(struct device *, pm_message_t);
199extern void dpm_runtime_resume(struct device *);
200
201#else /* !CONFIG_PM */
202
240static inline int device_suspend(pm_message_t state) 203static inline int device_suspend(pm_message_t state)
241{ 204{
242 return 0; 205 return 0;
243} 206}
207
208#define device_set_wakeup_enable(dev,val) do{}while(0)
209#define device_may_wakeup(dev) (0)
210
211static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
212{
213 return 0;
214}
215
216static inline void dpm_runtime_resume(struct device * dev)
217{
218
219}
220
244#endif 221#endif
245 222
223/* changes to device_may_wakeup take effect on the next pm state change.
224 * by default, devices should wakeup if they can.
225 */
226#define device_can_wakeup(dev) \
227 ((dev)->power.can_wakeup)
228#define device_init_wakeup(dev,val) \
229 do { \
230 device_can_wakeup(dev) = !!(val); \
231 device_set_wakeup_enable(dev,val); \
232 } while(0)
233
246#endif /* __KERNEL__ */ 234#endif /* __KERNEL__ */
247 235
248#endif /* _LINUX_PM_H */ 236#endif /* _LINUX_PM_H */
diff --git a/include/linux/pm_legacy.h b/include/linux/pm_legacy.h
new file mode 100644
index 000000000000..1252b45face1
--- /dev/null
+++ b/include/linux/pm_legacy.h
@@ -0,0 +1,56 @@
1#ifndef __LINUX_PM_LEGACY_H__
2#define __LINUX_PM_LEGACY_H__
3
4#include <linux/config.h>
5
6#ifdef CONFIG_PM_LEGACY
7
8extern int pm_active;
9
10#define PM_IS_ACTIVE() (pm_active != 0)
11
12/*
13 * Register a device with power management
14 */
15struct pm_dev __deprecated *
16pm_register(pm_dev_t type, unsigned long id, pm_callback callback);
17
18/*
19 * Unregister a device with power management
20 */
21void __deprecated pm_unregister(struct pm_dev *dev);
22
23/*
24 * Unregister all devices with matching callback
25 */
26void __deprecated pm_unregister_all(pm_callback callback);
27
28/*
29 * Send a request to all devices
30 */
31int __deprecated pm_send_all(pm_request_t rqst, void *data);
32
33#else /* CONFIG_PM_LEGACY */
34
35#define PM_IS_ACTIVE() 0
36
37static inline struct pm_dev *pm_register(pm_dev_t type,
38 unsigned long id,
39 pm_callback callback)
40{
41 return NULL;
42}
43
44static inline void pm_unregister(struct pm_dev *dev) {}
45
46static inline void pm_unregister_all(pm_callback callback) {}
47
48static inline int pm_send_all(pm_request_t rqst, void *data)
49{
50 return 0;
51}
52
53#endif /* CONFIG_PM_LEGACY */
54
55#endif /* __LINUX_PM_LEGACY_H__ */
56
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index aadbac29103c..584d57cb393a 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -353,7 +353,6 @@ struct pnp_protocol {
353int pnp_register_protocol(struct pnp_protocol *protocol); 353int pnp_register_protocol(struct pnp_protocol *protocol);
354void pnp_unregister_protocol(struct pnp_protocol *protocol); 354void pnp_unregister_protocol(struct pnp_protocol *protocol);
355int pnp_add_device(struct pnp_dev *dev); 355int pnp_add_device(struct pnp_dev *dev);
356void pnp_remove_device(struct pnp_dev *dev);
357int pnp_device_attach(struct pnp_dev *pnp_dev); 356int pnp_device_attach(struct pnp_dev *pnp_dev);
358void pnp_device_detach(struct pnp_dev *pnp_dev); 357void pnp_device_detach(struct pnp_dev *pnp_dev);
359extern struct list_head pnp_global; 358extern struct list_head pnp_global;
@@ -399,7 +398,6 @@ static inline int pnp_register_protocol(struct pnp_protocol *protocol) { return
399static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { } 398static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { }
400static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; } 399static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
401static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; } 400static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
402static inline void pnp_remove_device(struct pnp_dev *dev) { }
403static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } 401static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
404static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; } 402static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; }
405 403
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 4caedddaa033..4bc241290c24 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -71,11 +71,11 @@ posix_acl_release(struct posix_acl *acl)
71 71
72/* posix_acl.c */ 72/* posix_acl.c */
73 73
74extern struct posix_acl *posix_acl_alloc(int, unsigned int __nocast); 74extern struct posix_acl *posix_acl_alloc(int, gfp_t);
75extern struct posix_acl *posix_acl_clone(const struct posix_acl *, unsigned int __nocast); 75extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t);
76extern int posix_acl_valid(const struct posix_acl *); 76extern int posix_acl_valid(const struct posix_acl *);
77extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); 77extern int posix_acl_permission(struct inode *, const struct posix_acl *, int);
78extern struct posix_acl *posix_acl_from_mode(mode_t, unsigned int __nocast); 78extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t);
79extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); 79extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *);
80extern int posix_acl_create_masq(struct posix_acl *, mode_t *); 80extern int posix_acl_create_masq(struct posix_acl *, mode_t *);
81extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); 81extern int posix_acl_chmod_masq(struct posix_acl *, mode_t);
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h
index 7227e653b3be..e86a7a5cf355 100644
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
@@ -111,6 +111,8 @@ struct compressor {
111 111
112 /* Used in locking compressor modules */ 112 /* Used in locking compressor modules */
113 struct module *owner; 113 struct module *owner;
114 /* Extra skb space needed by the compressor algorithm */
115 unsigned int comp_extra;
114}; 116};
115 117
116/* 118/*
@@ -191,6 +193,13 @@ struct compressor {
191#define DEFLATE_CHK_SEQUENCE 0 193#define DEFLATE_CHK_SEQUENCE 0
192 194
193/* 195/*
196 * Definitions for MPPE.
197 */
198
199#define CI_MPPE 18 /* config option for MPPE */
200#define CILEN_MPPE 6 /* length of config option */
201
202/*
194 * Definitions for other, as yet unsupported, compression methods. 203 * Definitions for other, as yet unsupported, compression methods.
195 */ 204 */
196 205
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index dd98c54a23b4..d9a2f5254a51 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/config.h> 9#include <linux/config.h>
10#include <linux/thread_info.h>
10#include <linux/linkage.h> 11#include <linux/linkage.h>
11 12
12#ifdef CONFIG_DEBUG_PREEMPT 13#ifdef CONFIG_DEBUG_PREEMPT
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 0563581e3a02..74488e49166d 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -66,6 +66,7 @@ struct proc_dir_entry {
66 write_proc_t *write_proc; 66 write_proc_t *write_proc;
67 atomic_t count; /* use count */ 67 atomic_t count; /* use count */
68 int deleted; /* delete flag */ 68 int deleted; /* delete flag */
69 void *set;
69}; 70};
70 71
71struct kcore_list { 72struct kcore_list {
@@ -139,15 +140,12 @@ extern void proc_tty_unregister_driver(struct tty_driver *driver);
139/* 140/*
140 * proc_devtree.c 141 * proc_devtree.c
141 */ 142 */
143#ifdef CONFIG_PROC_DEVICETREE
142struct device_node; 144struct device_node;
145struct property;
143extern void proc_device_tree_init(void); 146extern void proc_device_tree_init(void);
144#ifdef CONFIG_PROC_DEVICETREE
145extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); 147extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
146#else /* !CONFIG_PROC_DEVICETREE */ 148extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);
147static inline void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *pde)
148{
149 return;
150}
151#endif /* CONFIG_PROC_DEVICETREE */ 149#endif /* CONFIG_PROC_DEVICETREE */
152 150
153extern struct proc_dir_entry *proc_symlink(const char *, 151extern struct proc_dir_entry *proc_symlink(const char *,
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index dc6f3647bfbc..b2b3dba1298d 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -78,6 +78,8 @@
78#include <linux/compiler.h> /* For unlikely. */ 78#include <linux/compiler.h> /* For unlikely. */
79#include <linux/sched.h> /* For struct task_struct. */ 79#include <linux/sched.h> /* For struct task_struct. */
80 80
81
82extern long arch_ptrace(struct task_struct *child, long request, long addr, long data);
81extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 83extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
82extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); 84extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
83extern int ptrace_attach(struct task_struct *tsk); 85extern int ptrace_attach(struct task_struct *tsk);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 700ead45084f..f33aeb22c26a 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -289,7 +289,6 @@ struct quota_info {
289 struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */ 289 struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */
290 struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ 290 struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */
291 struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ 291 struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */
292 struct vfsmount *mnt[MAXQUOTAS]; /* mountpoint entries of filesystems with quota files */
293 struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ 292 struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */
294 struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ 293 struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
295}; 294};
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index d211507ab246..4f34d3d60f2e 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -198,38 +198,38 @@ static __inline__ int DQUOT_OFF(struct super_block *sb)
198#define DQUOT_SYNC(sb) do { } while(0) 198#define DQUOT_SYNC(sb) do { } while(0)
199#define DQUOT_OFF(sb) do { } while(0) 199#define DQUOT_OFF(sb) do { } while(0)
200#define DQUOT_TRANSFER(inode, iattr) (0) 200#define DQUOT_TRANSFER(inode, iattr) (0)
201extern __inline__ int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) 201static inline int DQUOT_PREALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
202{ 202{
203 inode_add_bytes(inode, nr); 203 inode_add_bytes(inode, nr);
204 return 0; 204 return 0;
205} 205}
206 206
207extern __inline__ int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr) 207static inline int DQUOT_PREALLOC_SPACE(struct inode *inode, qsize_t nr)
208{ 208{
209 DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr); 209 DQUOT_PREALLOC_SPACE_NODIRTY(inode, nr);
210 mark_inode_dirty(inode); 210 mark_inode_dirty(inode);
211 return 0; 211 return 0;
212} 212}
213 213
214extern __inline__ int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr) 214static inline int DQUOT_ALLOC_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
215{ 215{
216 inode_add_bytes(inode, nr); 216 inode_add_bytes(inode, nr);
217 return 0; 217 return 0;
218} 218}
219 219
220extern __inline__ int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr) 220static inline int DQUOT_ALLOC_SPACE(struct inode *inode, qsize_t nr)
221{ 221{
222 DQUOT_ALLOC_SPACE_NODIRTY(inode, nr); 222 DQUOT_ALLOC_SPACE_NODIRTY(inode, nr);
223 mark_inode_dirty(inode); 223 mark_inode_dirty(inode);
224 return 0; 224 return 0;
225} 225}
226 226
227extern __inline__ void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr) 227static inline void DQUOT_FREE_SPACE_NODIRTY(struct inode *inode, qsize_t nr)
228{ 228{
229 inode_sub_bytes(inode, nr); 229 inode_sub_bytes(inode, nr);
230} 230}
231 231
232extern __inline__ void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr) 232static inline void DQUOT_FREE_SPACE(struct inode *inode, qsize_t nr)
233{ 233{
234 DQUOT_FREE_SPACE_NODIRTY(inode, nr); 234 DQUOT_FREE_SPACE_NODIRTY(inode, nr);
235 mark_inode_dirty(inode); 235 mark_inode_dirty(inode);
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 9c51917b1cce..36e5d269612f 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -24,7 +24,7 @@
24 24
25struct radix_tree_root { 25struct radix_tree_root {
26 unsigned int height; 26 unsigned int height;
27 unsigned int gfp_mask; 27 gfp_t gfp_mask;
28 struct radix_tree_node *rnode; 28 struct radix_tree_node *rnode;
29}; 29};
30 30
@@ -46,11 +46,12 @@ do { \
46 46
47int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); 47int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
48void *radix_tree_lookup(struct radix_tree_root *, unsigned long); 48void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
49void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
49void *radix_tree_delete(struct radix_tree_root *, unsigned long); 50void *radix_tree_delete(struct radix_tree_root *, unsigned long);
50unsigned int 51unsigned int
51radix_tree_gang_lookup(struct radix_tree_root *root, void **results, 52radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
52 unsigned long first_index, unsigned int max_items); 53 unsigned long first_index, unsigned int max_items);
53int radix_tree_preload(unsigned int __nocast gfp_mask); 54int radix_tree_preload(gfp_t gfp_mask);
54void radix_tree_init(void); 55void radix_tree_init(void);
55void *radix_tree_tag_set(struct radix_tree_root *root, 56void *radix_tree_tag_set(struct radix_tree_root *root,
56 unsigned long index, int tag); 57 unsigned long index, int tag);
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 9de99198caf1..899437802aea 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -6,7 +6,13 @@
6#ifndef BITMAP_H 6#ifndef BITMAP_H
7#define BITMAP_H 1 7#define BITMAP_H 1
8 8
9#define BITMAP_MAJOR 3 9#define BITMAP_MAJOR_LO 3
10/* version 4 insists the bitmap is in little-endian order
11 * with version 3, it is host-endian which is non-portable
12 */
13#define BITMAP_MAJOR_HI 4
14#define BITMAP_MAJOR_HOSTENDIAN 3
15
10#define BITMAP_MINOR 39 16#define BITMAP_MINOR 39
11 17
12/* 18/*
@@ -133,7 +139,8 @@ typedef __u16 bitmap_counter_t;
133/* use these for bitmap->flags and bitmap->sb->state bit-fields */ 139/* use these for bitmap->flags and bitmap->sb->state bit-fields */
134enum bitmap_state { 140enum bitmap_state {
135 BITMAP_ACTIVE = 0x001, /* the bitmap is in use */ 141 BITMAP_ACTIVE = 0x001, /* the bitmap is in use */
136 BITMAP_STALE = 0x002 /* the bitmap file is out of date or had -EIO */ 142 BITMAP_STALE = 0x002, /* the bitmap file is out of date or had -EIO */
143 BITMAP_HOSTENDIAN = 0x8000,
137}; 144};
138 145
139/* the superblock at the front of the bitmap file -- little endian */ 146/* the superblock at the front of the bitmap file -- little endian */
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index ffa316ce4dc8..13e7c4b62367 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -66,8 +66,10 @@
66 * and major_version/minor_version accordingly 66 * and major_version/minor_version accordingly
67 * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT 67 * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT
68 * in the super status byte 68 * in the super status byte
69 * >=3 means that bitmap superblock version 4 is supported, which uses
70 * little-ending representation rather than host-endian
69 */ 71 */
70#define MD_PATCHLEVEL_VERSION 2 72#define MD_PATCHLEVEL_VERSION 3
71 73
72extern int register_md_personality (int p_num, mdk_personality_t *p); 74extern int register_md_personality (int p_num, mdk_personality_t *p);
73extern int unregister_md_personality (int p_num); 75extern int unregister_md_personality (int p_num);
@@ -87,6 +89,7 @@ extern void md_print_devices (void);
87 89
88extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, 90extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
89 sector_t sector, int size, struct page *page); 91 sector_t sector, int size, struct page *page);
92extern void md_super_wait(mddev_t *mddev);
90extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, 93extern int sync_page_io(struct block_device *bdev, sector_t sector, int size,
91 struct page *page, int rw); 94 struct page *page, int rw);
92 95
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index ebce949b1443..46629a275ba9 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -105,6 +105,8 @@ struct mdk_rdev_s
105 int sb_size; /* bytes in the superblock */ 105 int sb_size; /* bytes in the superblock */
106 int preferred_minor; /* autorun support */ 106 int preferred_minor; /* autorun support */
107 107
108 struct kobject kobj;
109
108 /* A device can be in one of three states based on two flags: 110 /* A device can be in one of three states based on two flags:
109 * Not working: faulty==1 in_sync==0 111 * Not working: faulty==1 in_sync==0
110 * Fully working: faulty==0 in_sync==1 112 * Fully working: faulty==0 in_sync==1
@@ -115,11 +117,12 @@ struct mdk_rdev_s
115 * It can never have faulty==1, in_sync==1 117 * It can never have faulty==1, in_sync==1
116 * This reduces the burden of testing multiple flags in many cases 118 * This reduces the burden of testing multiple flags in many cases
117 */ 119 */
118 int faulty; /* if faulty do not issue IO requests */
119 int in_sync; /* device is a full member of the array */
120 120
121 unsigned long flags; /* Should include faulty and in_sync here. */ 121 unsigned long flags;
122#define Faulty 1 /* device is known to have a fault */
123#define In_sync 2 /* device is in_sync with rest of array */
122#define WriteMostly 4 /* Avoid reading if at all possible */ 124#define WriteMostly 4 /* Avoid reading if at all possible */
125#define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */
123 126
124 int desc_nr; /* descriptor index in the superblock */ 127 int desc_nr; /* descriptor index in the superblock */
125 int raid_disk; /* role of device in array */ 128 int raid_disk; /* role of device in array */
@@ -132,6 +135,9 @@ struct mdk_rdev_s
132 * only maintained for arrays that 135 * only maintained for arrays that
133 * support hot removal 136 * support hot removal
134 */ 137 */
138 atomic_t read_errors; /* number of consecutive read errors that
139 * we have tried to ignore.
140 */
135}; 141};
136 142
137typedef struct mdk_personality_s mdk_personality_t; 143typedef struct mdk_personality_s mdk_personality_t;
@@ -148,6 +154,8 @@ struct mddev_s
148 154
149 struct gendisk *gendisk; 155 struct gendisk *gendisk;
150 156
157 struct kobject kobj;
158
151 /* Superblock information */ 159 /* Superblock information */
152 int major_version, 160 int major_version,
153 minor_version, 161 minor_version,
@@ -171,6 +179,10 @@ struct mddev_s
171 sector_t resync_mark_cnt;/* blocks written at resync_mark */ 179 sector_t resync_mark_cnt;/* blocks written at resync_mark */
172 180
173 sector_t resync_max_sectors; /* may be set by personality */ 181 sector_t resync_max_sectors; /* may be set by personality */
182
183 sector_t resync_mismatches; /* count of sectors where
184 * parity/replica mismatch found
185 */
174 /* recovery/resync flags 186 /* recovery/resync flags
175 * NEEDED: we might need to start a resync/recover 187 * NEEDED: we might need to start a resync/recover
176 * RUNNING: a thread is running, or about to be started 188 * RUNNING: a thread is running, or about to be started
@@ -178,6 +190,8 @@ struct mddev_s
178 * ERR: and IO error was detected - abort the resync/recovery 190 * ERR: and IO error was detected - abort the resync/recovery
179 * INTR: someone requested a (clean) early abort. 191 * INTR: someone requested a (clean) early abort.
180 * DONE: thread is done and is waiting to be reaped 192 * DONE: thread is done and is waiting to be reaped
193 * REQUEST: user-space has requested a sync (used with SYNC)
194 * CHECK: user-space request for for check-only, no repair
181 */ 195 */
182#define MD_RECOVERY_RUNNING 0 196#define MD_RECOVERY_RUNNING 0
183#define MD_RECOVERY_SYNC 1 197#define MD_RECOVERY_SYNC 1
@@ -185,6 +199,8 @@ struct mddev_s
185#define MD_RECOVERY_INTR 3 199#define MD_RECOVERY_INTR 3
186#define MD_RECOVERY_DONE 4 200#define MD_RECOVERY_DONE 4
187#define MD_RECOVERY_NEEDED 5 201#define MD_RECOVERY_NEEDED 5
202#define MD_RECOVERY_REQUESTED 6
203#define MD_RECOVERY_CHECK 7
188 unsigned long recovery; 204 unsigned long recovery;
189 205
190 int in_sync; /* know to not need resync */ 206 int in_sync; /* know to not need resync */
@@ -195,6 +211,13 @@ struct mddev_s
195 int degraded; /* whether md should consider 211 int degraded; /* whether md should consider
196 * adding a spare 212 * adding a spare
197 */ 213 */
214 int barriers_work; /* initialised to true, cleared as soon
215 * as a barrier request to slave
216 * fails. Only supported
217 */
218 struct bio *biolist; /* bios that need to be retried
219 * because BIO_RW_BARRIER is not supported
220 */
198 221
199 atomic_t recovery_active; /* blocks scheduled, but not written */ 222 atomic_t recovery_active; /* blocks scheduled, but not written */
200 wait_queue_head_t recovery_wait; 223 wait_queue_head_t recovery_wait;
@@ -232,7 +255,7 @@ struct mddev_s
232 255
233static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev) 256static inline void rdev_dec_pending(mdk_rdev_t *rdev, mddev_t *mddev)
234{ 257{
235 int faulty = rdev->faulty; 258 int faulty = test_bit(Faulty, &rdev->flags);
236 if (atomic_dec_and_test(&rdev->nr_pending) && faulty) 259 if (atomic_dec_and_test(&rdev->nr_pending) && faulty)
237 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 260 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
238} 261}
@@ -270,6 +293,13 @@ struct mdk_personality_s
270}; 293};
271 294
272 295
296struct md_sysfs_entry {
297 struct attribute attr;
298 ssize_t (*show)(mddev_t *, char *);
299 ssize_t (*store)(mddev_t *, const char *, size_t);
300};
301
302
273static inline char * mdname (mddev_t * mddev) 303static inline char * mdname (mddev_t * mddev)
274{ 304{
275 return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; 305 return mddev->gendisk ? mddev->gendisk->disk_name : "mdX";
@@ -304,10 +334,8 @@ typedef struct mdk_thread_s {
304 mddev_t *mddev; 334 mddev_t *mddev;
305 wait_queue_head_t wqueue; 335 wait_queue_head_t wqueue;
306 unsigned long flags; 336 unsigned long flags;
307 struct completion *event;
308 struct task_struct *tsk; 337 struct task_struct *tsk;
309 unsigned long timeout; 338 unsigned long timeout;
310 const char *name;
311} mdk_thread_t; 339} mdk_thread_t;
312 340
313#define THREAD_WAKEUP 0 341#define THREAD_WAKEUP 0
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index 60e19b667548..292b98f2b408 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -110,7 +110,9 @@ struct r1bio_s {
110#define R1BIO_Uptodate 0 110#define R1BIO_Uptodate 0
111#define R1BIO_IsSync 1 111#define R1BIO_IsSync 1
112#define R1BIO_Degraded 2 112#define R1BIO_Degraded 2
113#define R1BIO_BehindIO 3 113#define R1BIO_BehindIO 3
114#define R1BIO_Barrier 4
115#define R1BIO_BarrierRetry 5
114/* For write-behind requests, we call bi_end_io when 116/* For write-behind requests, we call bi_end_io when
115 * the last non-write-behind device completes, providing 117 * the last non-write-behind device completes, providing
116 * any write was successful. Otherwise we call when 118 * any write was successful. Otherwise we call when
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index 176fc653c284..f025ba6fb14c 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -154,6 +154,8 @@ struct stripe_head {
154#define R5_Wantwrite 5 154#define R5_Wantwrite 5
155#define R5_Syncio 6 /* this io need to be accounted as resync io */ 155#define R5_Syncio 6 /* this io need to be accounted as resync io */
156#define R5_Overlap 7 /* There is a pending overlapping request on this block */ 156#define R5_Overlap 7 /* There is a pending overlapping request on this block */
157#define R5_ReadError 8 /* seen a read error here recently */
158#define R5_ReWrite 9 /* have tried to over-write the readerror */
157 159
158/* 160/*
159 * Write method 161 * Write method
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
index a71123c28272..48831eac2910 100644
--- a/include/linux/raid_class.h
+++ b/include/linux/raid_class.h
@@ -1,4 +1,9 @@
1/* 1/*
2 * raid_class.h - a generic raid visualisation class
3 *
4 * Copyright (c) 2005 - James Bottomley <James.Bottomley@steeleye.com>
5 *
6 * This file is licensed under GPLv2
2 */ 7 */
3#include <linux/transport_class.h> 8#include <linux/transport_class.h>
4 9
@@ -14,20 +19,35 @@ struct raid_function_template {
14}; 19};
15 20
16enum raid_state { 21enum raid_state {
17 RAID_ACTIVE = 1, 22 RAID_STATE_UNKNOWN = 0,
18 RAID_DEGRADED, 23 RAID_STATE_ACTIVE,
19 RAID_RESYNCING, 24 RAID_STATE_DEGRADED,
20 RAID_OFFLINE, 25 RAID_STATE_RESYNCING,
26 RAID_STATE_OFFLINE,
27};
28
29enum raid_level {
30 RAID_LEVEL_UNKNOWN = 0,
31 RAID_LEVEL_LINEAR,
32 RAID_LEVEL_0,
33 RAID_LEVEL_1,
34 RAID_LEVEL_3,
35 RAID_LEVEL_4,
36 RAID_LEVEL_5,
37 RAID_LEVEL_6,
21}; 38};
22 39
23struct raid_data { 40struct raid_data {
24 struct list_head component_list; 41 struct list_head component_list;
25 int component_count; 42 int component_count;
26 int level; 43 enum raid_level level;
27 enum raid_state state; 44 enum raid_state state;
28 int resync; 45 int resync;
29}; 46};
30 47
48/* resync complete goes from 0 to this */
49#define RAID_MAX_RESYNC (10000)
50
31#define DEFINE_RAID_ATTRIBUTE(type, attr) \ 51#define DEFINE_RAID_ATTRIBUTE(type, attr) \
32static inline void \ 52static inline void \
33raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \ 53raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \
@@ -48,7 +68,7 @@ raid_get_##attr(struct raid_template *r, struct device *dev) { \
48 return rd->attr; \ 68 return rd->attr; \
49} 69}
50 70
51DEFINE_RAID_ATTRIBUTE(int, level) 71DEFINE_RAID_ATTRIBUTE(enum raid_level, level)
52DEFINE_RAID_ATTRIBUTE(int, resync) 72DEFINE_RAID_ATTRIBUTE(int, resync)
53DEFINE_RAID_ATTRIBUTE(enum raid_state, state) 73DEFINE_RAID_ATTRIBUTE(enum raid_state, state)
54 74
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 4e65eb44adfd..cce25591eec2 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -94,6 +94,7 @@ struct rcu_data {
94 long batch; /* Batch # for current RCU batch */ 94 long batch; /* Batch # for current RCU batch */
95 struct rcu_head *nxtlist; 95 struct rcu_head *nxtlist;
96 struct rcu_head **nxttail; 96 struct rcu_head **nxttail;
97 long count; /* # of queued items */
97 struct rcu_head *curlist; 98 struct rcu_head *curlist;
98 struct rcu_head **curtail; 99 struct rcu_head **curtail;
99 struct rcu_head *donelist; 100 struct rcu_head *donelist;
@@ -274,6 +275,7 @@ static inline int rcu_pending(int cpu)
274extern void rcu_init(void); 275extern void rcu_init(void);
275extern void rcu_check_callbacks(int cpu, int user); 276extern void rcu_check_callbacks(int cpu, int user);
276extern void rcu_restart_cpu(int cpu); 277extern void rcu_restart_cpu(int cpu);
278extern long rcu_batches_completed(void);
277 279
278/* Exported interfaces */ 280/* Exported interfaces */
279extern void FASTCALL(call_rcu(struct rcu_head *head, 281extern void FASTCALL(call_rcu(struct rcu_head *head,
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 3b3266ff1a95..7ab2cdb83ef0 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -59,6 +59,10 @@ extern void machine_crash_shutdown(struct pt_regs *);
59 * Architecture independent implemenations of sys_reboot commands. 59 * Architecture independent implemenations of sys_reboot commands.
60 */ 60 */
61 61
62extern void kernel_restart_prepare(char *cmd);
63extern void kernel_halt_prepare(void);
64extern void kernel_power_off_prepare(void);
65
62extern void kernel_restart(char *cmd); 66extern void kernel_restart(char *cmd);
63extern void kernel_halt(void); 67extern void kernel_halt(void);
64extern void kernel_power_off(void); 68extern void kernel_power_off(void);
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index af00b10294cd..001ab82df051 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1972,7 +1972,7 @@ extern struct address_space_operations reiserfs_address_space_operations;
1972 1972
1973/* fix_nodes.c */ 1973/* fix_nodes.c */
1974#ifdef CONFIG_REISERFS_CHECK 1974#ifdef CONFIG_REISERFS_CHECK
1975void *reiserfs_kmalloc(size_t size, int flags, struct super_block *s); 1975void *reiserfs_kmalloc(size_t size, gfp_t flags, struct super_block *s);
1976void reiserfs_kfree(const void *vp, size_t size, struct super_block *s); 1976void reiserfs_kfree(const void *vp, size_t size, struct super_block *s);
1977#else 1977#else
1978static inline void *reiserfs_kmalloc(size_t size, int flags, 1978static inline void *reiserfs_kmalloc(size_t size, int flags,
diff --git a/include/linux/rio.h b/include/linux/rio.h
new file mode 100644
index 000000000000..c7e907faae9c
--- /dev/null
+++ b/include/linux/rio.h
@@ -0,0 +1,325 @@
1/*
2 * RapidIO interconnect services
3 * (RapidIO Interconnect Specification, http://www.rapidio.org)
4 *
5 * Copyright 2005 MontaVista Software, Inc.
6 * Matt Porter <mporter@kernel.crashing.org>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#ifndef LINUX_RIO_H
15#define LINUX_RIO_H
16
17#ifdef __KERNEL__
18
19#include <linux/types.h>
20#include <linux/config.h>
21#include <linux/ioport.h>
22#include <linux/list.h>
23#include <linux/errno.h>
24#include <linux/device.h>
25#include <linux/rio_regs.h>
26
27#define RIO_ANY_DESTID 0xff
28#define RIO_NO_HOPCOUNT -1
29
30#define RIO_MAX_MPORT_RESOURCES 16
31#define RIO_MAX_DEV_RESOURCES 16
32
33#define RIO_GLOBAL_TABLE 0xff /* Indicates access of a switch's
34 global routing table if it
35 has multiple (or per port)
36 tables */
37
38#define RIO_INVALID_ROUTE 0xff /* Indicates that a route table
39 entry is invalid (no route
40 exists for the device ID) */
41
42#ifdef CONFIG_RAPIDIO_8_BIT_TRANSPORT
43#define RIO_MAX_ROUTE_ENTRIES (1 << 8)
44#else
45#define RIO_MAX_ROUTE_ENTRIES (1 << 16)
46#endif
47
48#define RIO_MAX_MBOX 4
49#define RIO_MAX_MSG_SIZE 0x1000
50
51/*
52 * Error values that may be returned by RIO functions.
53 */
54#define RIO_SUCCESSFUL 0x00
55#define RIO_BAD_SIZE 0x81
56
57/*
58 * For RIO devices, the region numbers are assigned this way:
59 *
60 * 0 RapidIO outbound doorbells
61 * 1-15 RapidIO memory regions
62 *
63 * For RIO master ports, the region number are assigned this way:
64 *
65 * 0 RapidIO inbound doorbells
66 * 1 RapidIO inbound mailboxes
67 * 1 RapidIO outbound mailboxes
68 */
69#define RIO_DOORBELL_RESOURCE 0
70#define RIO_INB_MBOX_RESOURCE 1
71#define RIO_OUTB_MBOX_RESOURCE 2
72
73extern struct bus_type rio_bus_type;
74extern struct list_head rio_devices; /* list of all devices */
75
76struct rio_mport;
77
78/**
79 * struct rio_dev - RIO device info
80 * @global_list: Node in list of all RIO devices
81 * @net_list: Node in list of RIO devices in a network
82 * @net: Network this device is a part of
83 * @did: Device ID
84 * @vid: Vendor ID
85 * @device_rev: Device revision
86 * @asm_did: Assembly device ID
87 * @asm_vid: Assembly vendor ID
88 * @asm_rev: Assembly revision
89 * @efptr: Extended feature pointer
90 * @pef: Processing element features
91 * @swpinfo: Switch port info
92 * @src_ops: Source operation capabilities
93 * @dst_ops: Destination operation capabilities
94 * @dma_mask: Mask of bits of RIO address this device implements
95 * @rswitch: Pointer to &struct rio_switch if valid for this device
96 * @driver: Driver claiming this device
97 * @dev: Device model device
98 * @riores: RIO resources this device owns
99 * @destid: Network destination ID
100 */
101struct rio_dev {
102 struct list_head global_list; /* node in list of all RIO devices */
103 struct list_head net_list; /* node in per net list */
104 struct rio_net *net; /* RIO net this device resides in */
105 u16 did;
106 u16 vid;
107 u32 device_rev;
108 u16 asm_did;
109 u16 asm_vid;
110 u16 asm_rev;
111 u16 efptr;
112 u32 pef;
113 u32 swpinfo; /* Only used for switches */
114 u32 src_ops;
115 u32 dst_ops;
116 u64 dma_mask;
117 struct rio_switch *rswitch; /* RIO switch info */
118 struct rio_driver *driver; /* RIO driver claiming this device */
119 struct device dev; /* LDM device structure */
120 struct resource riores[RIO_MAX_DEV_RESOURCES];
121 u16 destid;
122};
123
124#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
125#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list)
126#define to_rio_dev(n) container_of(n, struct rio_dev, dev)
127
128/**
129 * struct rio_msg - RIO message event
130 * @res: Mailbox resource
131 * @mcback: Message event callback
132 */
133struct rio_msg {
134 struct resource *res;
135 void (*mcback) (struct rio_mport * mport, void *dev_id, int mbox, int slot);
136};
137
138/**
139 * struct rio_dbell - RIO doorbell event
140 * @node: Node in list of doorbell events
141 * @res: Doorbell resource
142 * @dinb: Doorbell event callback
143 * @dev_id: Device specific pointer to pass on event
144 */
145struct rio_dbell {
146 struct list_head node;
147 struct resource *res;
148 void (*dinb) (struct rio_mport *mport, void *dev_id, u16 src, u16 dst, u16 info);
149 void *dev_id;
150};
151
152/**
153 * struct rio_mport - RIO master port info
154 * @dbells: List of doorbell events
155 * @node: Node in global list of master ports
156 * @nnode: Node in network list of master ports
157 * @iores: I/O mem resource that this master port interface owns
158 * @riores: RIO resources that this master port interfaces owns
159 * @inb_msg: RIO inbound message event descriptors
160 * @outb_msg: RIO outbound message event descriptors
161 * @host_deviceid: Host device ID associated with this master port
162 * @ops: configuration space functions
163 * @id: Port ID, unique among all ports
164 * @index: Port index, unique among all port interfaces of the same type
165 * @name: Port name string
166 */
167struct rio_mport {
168 struct list_head dbells; /* list of doorbell events */
169 struct list_head node; /* node in global list of ports */
170 struct list_head nnode; /* node in net list of ports */
171 struct resource iores;
172 struct resource riores[RIO_MAX_MPORT_RESOURCES];
173 struct rio_msg inb_msg[RIO_MAX_MBOX];
174 struct rio_msg outb_msg[RIO_MAX_MBOX];
175 int host_deviceid; /* Host device ID */
176 struct rio_ops *ops; /* maintenance transaction functions */
177 unsigned char id; /* port ID, unique among all ports */
178 unsigned char index; /* port index, unique among all port
179 interfaces of the same type */
180 unsigned char name[40];
181};
182
183/**
184 * struct rio_net - RIO network info
185 * @node: Node in global list of RIO networks
186 * @devices: List of devices in this network
187 * @mports: List of master ports accessing this network
188 * @hport: Default port for accessing this network
189 * @id: RIO network ID
190 */
191struct rio_net {
192 struct list_head node; /* node in list of networks */
193 struct list_head devices; /* list of devices in this net */
194 struct list_head mports; /* list of ports accessing net */
195 struct rio_mport *hport; /* primary port for accessing net */
196 unsigned char id; /* RIO network ID */
197};
198
199/**
200 * struct rio_switch - RIO switch info
201 * @node: Node in global list of switches
202 * @switchid: Switch ID that is unique across a network
203 * @hopcount: Hopcount to this switch
204 * @destid: Associated destid in the path
205 * @route_table: Copy of switch routing table
206 * @add_entry: Callback for switch-specific route add function
207 * @get_entry: Callback for switch-specific route get function
208 */
209struct rio_switch {
210 struct list_head node;
211 u16 switchid;
212 u16 hopcount;
213 u16 destid;
214 u8 route_table[RIO_MAX_ROUTE_ENTRIES];
215 int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
216 u16 table, u16 route_destid, u8 route_port);
217 int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
218 u16 table, u16 route_destid, u8 * route_port);
219};
220
221/* Low-level architecture-dependent routines */
222
223/**
224 * struct rio_ops - Low-level RIO configuration space operations
225 * @lcread: Callback to perform local (master port) read of config space.
226 * @lcwrite: Callback to perform local (master port) write of config space.
227 * @cread: Callback to perform network read of config space.
228 * @cwrite: Callback to perform network write of config space.
229 * @dsend: Callback to send a doorbell message.
230 */
231struct rio_ops {
232 int (*lcread) (int index, u32 offset, int len, u32 * data);
233 int (*lcwrite) (int index, u32 offset, int len, u32 data);
234 int (*cread) (int index, u16 destid, u8 hopcount, u32 offset, int len,
235 u32 * data);
236 int (*cwrite) (int index, u16 destid, u8 hopcount, u32 offset, int len,
237 u32 data);
238 int (*dsend) (int index, u16 destid, u16 data);
239};
240
241#define RIO_RESOURCE_MEM 0x00000100
242#define RIO_RESOURCE_DOORBELL 0x00000200
243#define RIO_RESOURCE_MAILBOX 0x00000400
244
245#define RIO_RESOURCE_CACHEABLE 0x00010000
246#define RIO_RESOURCE_PCI 0x00020000
247
248#define RIO_RESOURCE_BUSY 0x80000000
249
250/**
251 * struct rio_driver - RIO driver info
252 * @node: Node in list of drivers
253 * @name: RIO driver name
254 * @id_table: RIO device ids to be associated with this driver
255 * @probe: RIO device inserted
256 * @remove: RIO device removed
257 * @suspend: RIO device suspended
258 * @resume: RIO device awakened
259 * @enable_wake: RIO device enable wake event
260 * @driver: LDM driver struct
261 *
262 * Provides info on a RIO device driver for insertion/removal and
263 * power management purposes.
264 */
265struct rio_driver {
266 struct list_head node;
267 char *name;
268 const struct rio_device_id *id_table;
269 int (*probe) (struct rio_dev * dev, const struct rio_device_id * id);
270 void (*remove) (struct rio_dev * dev);
271 int (*suspend) (struct rio_dev * dev, u32 state);
272 int (*resume) (struct rio_dev * dev);
273 int (*enable_wake) (struct rio_dev * dev, u32 state, int enable);
274 struct device_driver driver;
275};
276
277#define to_rio_driver(drv) container_of(drv,struct rio_driver, driver)
278
279/**
280 * struct rio_device_id - RIO device identifier
281 * @did: RIO device ID
282 * @vid: RIO vendor ID
283 * @asm_did: RIO assembly device ID
284 * @asm_vid: RIO assembly vendor ID
285 *
286 * Identifies a RIO device based on both the device/vendor IDs and
287 * the assembly device/vendor IDs.
288 */
289struct rio_device_id {
290 u16 did, vid;
291 u16 asm_did, asm_vid;
292};
293
294/**
295 * struct rio_route_ops - Per-switch route operations
296 * @vid: RIO vendor ID
297 * @did: RIO device ID
298 * @add_hook: Callback that adds a route entry
299 * @get_hook: Callback that gets a route entry
300 *
301 * Defines the operations that are necessary to manipulate the route
302 * tables for a particular RIO switch device.
303 */
304struct rio_route_ops {
305 u16 vid, did;
306 int (*add_hook) (struct rio_mport * mport, u16 destid, u8 hopcount,
307 u16 table, u16 route_destid, u8 route_port);
308 int (*get_hook) (struct rio_mport * mport, u16 destid, u8 hopcount,
309 u16 table, u16 route_destid, u8 * route_port);
310};
311
312/* Architecture and hardware-specific functions */
313extern int rio_init_mports(void);
314extern void rio_register_mport(struct rio_mport *);
315extern int rio_hw_add_outb_message(struct rio_mport *, struct rio_dev *, int,
316 void *, size_t);
317extern int rio_hw_add_inb_buffer(struct rio_mport *, int, void *);
318extern void *rio_hw_get_inb_message(struct rio_mport *, int);
319extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int);
320extern void rio_close_inb_mbox(struct rio_mport *, int);
321extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int);
322extern void rio_close_outb_mbox(struct rio_mport *, int);
323
324#endif /* __KERNEL__ */
325#endif /* LINUX_RIO_H */
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
new file mode 100644
index 000000000000..3bd7cce19e26
--- /dev/null
+++ b/include/linux/rio_drv.h
@@ -0,0 +1,469 @@
1/*
2 * RapidIO driver services
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef LINUX_RIO_DRV_H
14#define LINUX_RIO_DRV_H
15
16#ifdef __KERNEL__
17
18#include <linux/types.h>
19#include <linux/config.h>
20#include <linux/ioport.h>
21#include <linux/list.h>
22#include <linux/errno.h>
23#include <linux/device.h>
24#include <linux/rio.h>
25
26extern int __rio_local_read_config_32(struct rio_mport *port, u32 offset,
27 u32 * data);
28extern int __rio_local_write_config_32(struct rio_mport *port, u32 offset,
29 u32 data);
30extern int __rio_local_read_config_16(struct rio_mport *port, u32 offset,
31 u16 * data);
32extern int __rio_local_write_config_16(struct rio_mport *port, u32 offset,
33 u16 data);
34extern int __rio_local_read_config_8(struct rio_mport *port, u32 offset,
35 u8 * data);
36extern int __rio_local_write_config_8(struct rio_mport *port, u32 offset,
37 u8 data);
38
39extern int rio_mport_read_config_32(struct rio_mport *port, u16 destid,
40 u8 hopcount, u32 offset, u32 * data);
41extern int rio_mport_write_config_32(struct rio_mport *port, u16 destid,
42 u8 hopcount, u32 offset, u32 data);
43extern int rio_mport_read_config_16(struct rio_mport *port, u16 destid,
44 u8 hopcount, u32 offset, u16 * data);
45extern int rio_mport_write_config_16(struct rio_mport *port, u16 destid,
46 u8 hopcount, u32 offset, u16 data);
47extern int rio_mport_read_config_8(struct rio_mport *port, u16 destid,
48 u8 hopcount, u32 offset, u8 * data);
49extern int rio_mport_write_config_8(struct rio_mport *port, u16 destid,
50 u8 hopcount, u32 offset, u8 data);
51
52/**
53 * rio_local_read_config_32 - Read 32 bits from local configuration space
54 * @port: Master port
55 * @offset: Offset into local configuration space
56 * @data: Pointer to read data into
57 *
58 * Reads 32 bits of data from the specified offset within the local
59 * device's configuration space.
60 */
61static inline int rio_local_read_config_32(struct rio_mport *port, u32 offset,
62 u32 * data)
63{
64 return __rio_local_read_config_32(port, offset, data);
65}
66
67/**
68 * rio_local_write_config_32 - Write 32 bits to local configuration space
69 * @port: Master port
70 * @offset: Offset into local configuration space
71 * @data: Data to be written
72 *
73 * Writes 32 bits of data to the specified offset within the local
74 * device's configuration space.
75 */
76static inline int rio_local_write_config_32(struct rio_mport *port, u32 offset,
77 u32 data)
78{
79 return __rio_local_write_config_32(port, offset, data);
80}
81
82/**
83 * rio_local_read_config_16 - Read 16 bits from local configuration space
84 * @port: Master port
85 * @offset: Offset into local configuration space
86 * @data: Pointer to read data into
87 *
88 * Reads 16 bits of data from the specified offset within the local
89 * device's configuration space.
90 */
91static inline int rio_local_read_config_16(struct rio_mport *port, u32 offset,
92 u16 * data)
93{
94 return __rio_local_read_config_16(port, offset, data);
95}
96
97/**
98 * rio_local_write_config_16 - Write 16 bits to local configuration space
99 * @port: Master port
100 * @offset: Offset into local configuration space
101 * @data: Data to be written
102 *
103 * Writes 16 bits of data to the specified offset within the local
104 * device's configuration space.
105 */
106
107static inline int rio_local_write_config_16(struct rio_mport *port, u32 offset,
108 u16 data)
109{
110 return __rio_local_write_config_16(port, offset, data);
111}
112
113/**
114 * rio_local_read_config_8 - Read 8 bits from local configuration space
115 * @port: Master port
116 * @offset: Offset into local configuration space
117 * @data: Pointer to read data into
118 *
119 * Reads 8 bits of data from the specified offset within the local
120 * device's configuration space.
121 */
122static inline int rio_local_read_config_8(struct rio_mport *port, u32 offset,
123 u8 * data)
124{
125 return __rio_local_read_config_8(port, offset, data);
126}
127
128/**
129 * rio_local_write_config_8 - Write 8 bits to local configuration space
130 * @port: Master port
131 * @offset: Offset into local configuration space
132 * @data: Data to be written
133 *
134 * Writes 8 bits of data to the specified offset within the local
135 * device's configuration space.
136 */
137static inline int rio_local_write_config_8(struct rio_mport *port, u32 offset,
138 u8 data)
139{
140 return __rio_local_write_config_8(port, offset, data);
141}
142
143/**
144 * rio_read_config_32 - Read 32 bits from configuration space
145 * @rdev: RIO device
146 * @offset: Offset into device configuration space
147 * @data: Pointer to read data into
148 *
149 * Reads 32 bits of data from the specified offset within the
150 * RIO device's configuration space.
151 */
152static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset,
153 u32 * data)
154{
155 u8 hopcount = 0xff;
156 u16 destid = rdev->destid;
157
158 if (rdev->rswitch) {
159 destid = rdev->rswitch->destid;
160 hopcount = rdev->rswitch->hopcount;
161 }
162
163 return rio_mport_read_config_32(rdev->net->hport, destid, hopcount,
164 offset, data);
165};
166
167/**
168 * rio_write_config_32 - Write 32 bits to configuration space
169 * @rdev: RIO device
170 * @offset: Offset into device configuration space
171 * @data: Data to be written
172 *
173 * Writes 32 bits of data to the specified offset within the
174 * RIO device's configuration space.
175 */
176static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset,
177 u32 data)
178{
179 u8 hopcount = 0xff;
180 u16 destid = rdev->destid;
181
182 if (rdev->rswitch) {
183 destid = rdev->rswitch->destid;
184 hopcount = rdev->rswitch->hopcount;
185 }
186
187 return rio_mport_write_config_32(rdev->net->hport, destid, hopcount,
188 offset, data);
189};
190
191/**
192 * rio_read_config_16 - Read 16 bits from configuration space
193 * @rdev: RIO device
194 * @offset: Offset into device configuration space
195 * @data: Pointer to read data into
196 *
197 * Reads 16 bits of data from the specified offset within the
198 * RIO device's configuration space.
199 */
200static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset,
201 u16 * data)
202{
203 u8 hopcount = 0xff;
204 u16 destid = rdev->destid;
205
206 if (rdev->rswitch) {
207 destid = rdev->rswitch->destid;
208 hopcount = rdev->rswitch->hopcount;
209 }
210
211 return rio_mport_read_config_16(rdev->net->hport, destid, hopcount,
212 offset, data);
213};
214
215/**
216 * rio_write_config_16 - Write 16 bits to configuration space
217 * @rdev: RIO device
218 * @offset: Offset into device configuration space
219 * @data: Data to be written
220 *
221 * Writes 16 bits of data to the specified offset within the
222 * RIO device's configuration space.
223 */
224static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset,
225 u16 data)
226{
227 u8 hopcount = 0xff;
228 u16 destid = rdev->destid;
229
230 if (rdev->rswitch) {
231 destid = rdev->rswitch->destid;
232 hopcount = rdev->rswitch->hopcount;
233 }
234
235 return rio_mport_write_config_16(rdev->net->hport, destid, hopcount,
236 offset, data);
237};
238
239/**
240 * rio_read_config_8 - Read 8 bits from configuration space
241 * @rdev: RIO device
242 * @offset: Offset into device configuration space
243 * @data: Pointer to read data into
244 *
245 * Reads 8 bits of data from the specified offset within the
246 * RIO device's configuration space.
247 */
248static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data)
249{
250 u8 hopcount = 0xff;
251 u16 destid = rdev->destid;
252
253 if (rdev->rswitch) {
254 destid = rdev->rswitch->destid;
255 hopcount = rdev->rswitch->hopcount;
256 }
257
258 return rio_mport_read_config_8(rdev->net->hport, destid, hopcount,
259 offset, data);
260};
261
262/**
263 * rio_write_config_8 - Write 8 bits to configuration space
264 * @rdev: RIO device
265 * @offset: Offset into device configuration space
266 * @data: Data to be written
267 *
268 * Writes 8 bits of data to the specified offset within the
269 * RIO device's configuration space.
270 */
271static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data)
272{
273 u8 hopcount = 0xff;
274 u16 destid = rdev->destid;
275
276 if (rdev->rswitch) {
277 destid = rdev->rswitch->destid;
278 hopcount = rdev->rswitch->hopcount;
279 }
280
281 return rio_mport_write_config_8(rdev->net->hport, destid, hopcount,
282 offset, data);
283};
284
285extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid,
286 u16 data);
287
288/**
289 * rio_send_doorbell - Send a doorbell message to a device
290 * @rdev: RIO device
291 * @data: Doorbell message data
292 *
293 * Send a doorbell message to a RIO device. The doorbell message
294 * has a 16-bit info field provided by the @data argument.
295 */
296static inline int rio_send_doorbell(struct rio_dev *rdev, u16 data)
297{
298 return rio_mport_send_doorbell(rdev->net->hport, rdev->destid, data);
299};
300
301/**
302 * rio_init_mbox_res - Initialize a RIO mailbox resource
303 * @res: resource struct
304 * @start: start of mailbox range
305 * @end: end of mailbox range
306 *
307 * This function is used to initialize the fields of a resource
308 * for use as a mailbox resource. It initializes a range of
309 * mailboxes using the start and end arguments.
310 */
311static inline void rio_init_mbox_res(struct resource *res, int start, int end)
312{
313 memset(res, 0, sizeof(struct resource));
314 res->start = start;
315 res->end = end;
316 res->flags = RIO_RESOURCE_MAILBOX;
317}
318
319/**
320 * rio_init_dbell_res - Initialize a RIO doorbell resource
321 * @res: resource struct
322 * @start: start of doorbell range
323 * @end: end of doorbell range
324 *
325 * This function is used to initialize the fields of a resource
326 * for use as a doorbell resource. It initializes a range of
327 * doorbell messages using the start and end arguments.
328 */
329static inline void rio_init_dbell_res(struct resource *res, u16 start, u16 end)
330{
331 memset(res, 0, sizeof(struct resource));
332 res->start = start;
333 res->end = end;
334 res->flags = RIO_RESOURCE_DOORBELL;
335}
336
337/**
338 * RIO_DEVICE - macro used to describe a specific RIO device
339 * @vid: the 16 bit RIO vendor ID
340 * @did: the 16 bit RIO device ID
341 *
342 * This macro is used to create a struct rio_device_id that matches a
343 * specific device. The assembly vendor and assembly device fields
344 * will be set to %RIO_ANY_ID.
345 */
346#define RIO_DEVICE(dev,ven) \
347 .did = (dev), .vid = (ven), \
348 .asm_did = RIO_ANY_ID, .asm_vid = RIO_ANY_ID
349
350/* Mailbox management */
351extern int rio_request_outb_mbox(struct rio_mport *, void *, int, int,
352 void (*)(struct rio_mport *, void *,int, int));
353extern int rio_release_outb_mbox(struct rio_mport *, int);
354
355/**
356 * rio_add_outb_message - Add RIO message to an outbound mailbox queue
357 * @mport: RIO master port containing the outbound queue
358 * @rdev: RIO device the message is be sent to
359 * @mbox: The outbound mailbox queue
360 * @buffer: Pointer to the message buffer
361 * @len: Length of the message buffer
362 *
363 * Adds a RIO message buffer to an outbound mailbox queue for
364 * transmission. Returns 0 on success.
365 */
366static inline int rio_add_outb_message(struct rio_mport *mport,
367 struct rio_dev *rdev, int mbox,
368 void *buffer, size_t len)
369{
370 return rio_hw_add_outb_message(mport, rdev, mbox, buffer, len);
371}
372
373extern int rio_request_inb_mbox(struct rio_mport *, void *, int, int,
374 void (*)(struct rio_mport *, void *, int, int));
375extern int rio_release_inb_mbox(struct rio_mport *, int);
376
377/**
378 * rio_add_inb_buffer - Add buffer to an inbound mailbox queue
379 * @mport: Master port containing the inbound mailbox
380 * @mbox: The inbound mailbox number
381 * @buffer: Pointer to the message buffer
382 *
383 * Adds a buffer to an inbound mailbox queue for reception. Returns
384 * 0 on success.
385 */
386static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox,
387 void *buffer)
388{
389 return rio_hw_add_inb_buffer(mport, mbox, buffer);
390}
391
392/**
393 * rio_get_inb_message - Get A RIO message from an inbound mailbox queue
394 * @mport: Master port containing the inbound mailbox
395 * @mbox: The inbound mailbox number
396 * @buffer: Pointer to the message buffer
397 *
398 * Get a RIO message from an inbound mailbox queue. Returns 0 on success.
399 */
400static inline void *rio_get_inb_message(struct rio_mport *mport, int mbox)
401{
402 return rio_hw_get_inb_message(mport, mbox);
403}
404
405/* Doorbell management */
406extern int rio_request_inb_dbell(struct rio_mport *, void *, u16, u16,
407 void (*)(struct rio_mport *, void *, u16, u16, u16));
408extern int rio_release_inb_dbell(struct rio_mport *, u16, u16);
409extern struct resource *rio_request_outb_dbell(struct rio_dev *, u16, u16);
410extern int rio_release_outb_dbell(struct rio_dev *, struct resource *);
411
412/* Memory region management */
413int rio_claim_resource(struct rio_dev *, int);
414int rio_request_regions(struct rio_dev *, char *);
415void rio_release_regions(struct rio_dev *);
416int rio_request_region(struct rio_dev *, int, char *);
417void rio_release_region(struct rio_dev *, int);
418
419/* LDM support */
420int rio_register_driver(struct rio_driver *);
421void rio_unregister_driver(struct rio_driver *);
422struct rio_dev *rio_dev_get(struct rio_dev *);
423void rio_dev_put(struct rio_dev *);
424
425/**
426 * rio_name - Get the unique RIO device identifier
427 * @rdev: RIO device
428 *
429 * Get the unique RIO device identifier. Returns the device
430 * identifier string.
431 */
432static inline char *rio_name(struct rio_dev *rdev)
433{
434 return rdev->dev.bus_id;
435}
436
437/**
438 * rio_get_drvdata - Get RIO driver specific data
439 * @rdev: RIO device
440 *
441 * Get RIO driver specific data. Returns a pointer to the
442 * driver specific data.
443 */
444static inline void *rio_get_drvdata(struct rio_dev *rdev)
445{
446 return dev_get_drvdata(&rdev->dev);
447}
448
449/**
450 * rio_set_drvdata - Set RIO driver specific data
451 * @rdev: RIO device
452 * @data: Pointer to driver specific data
453 *
454 * Set RIO driver specific data. device struct driver data pointer
455 * is set to the @data argument.
456 */
457static inline void rio_set_drvdata(struct rio_dev *rdev, void *data)
458{
459 dev_set_drvdata(&rdev->dev, data);
460}
461
462/* Misc driver helpers */
463extern u16 rio_local_get_device_id(struct rio_mport *port);
464extern struct rio_dev *rio_get_device(u16 vid, u16 did, struct rio_dev *from);
465extern struct rio_dev *rio_get_asm(u16 vid, u16 did, u16 asm_vid, u16 asm_did,
466 struct rio_dev *from);
467
468#endif /* __KERNEL__ */
469#endif /* LINUX_RIO_DRV_H */
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
new file mode 100644
index 000000000000..919d4e07d54e
--- /dev/null
+++ b/include/linux/rio_ids.h
@@ -0,0 +1,24 @@
1/*
2 * RapidIO devices
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef LINUX_RIO_IDS_H
14#define LINUX_RIO_IDS_H
15
16#define RIO_ANY_ID 0xffff
17
18#define RIO_VID_FREESCALE 0x0002
19#define RIO_DID_MPC8560 0x0003
20
21#define RIO_VID_TUNDRA 0x000d
22#define RIO_DID_TSI500 0x0500
23
24#endif /* LINUX_RIO_IDS_H */
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
new file mode 100644
index 000000000000..326540f9b54e
--- /dev/null
+++ b/include/linux/rio_regs.h
@@ -0,0 +1,215 @@
1/*
2 * RapidIO register definitions
3 *
4 * Copyright 2005 MontaVista Software, Inc.
5 * Matt Porter <mporter@kernel.crashing.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef LINUX_RIO_REGS_H
14#define LINUX_RIO_REGS_H
15
16/*
17 * In RapidIO, each device has a 2MB configuration space that is
18 * accessed via maintenance transactions. Portions of configuration
19 * space are standardized and/or reserved.
20 */
21#define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */
22#define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */
23#define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */
24#define RIO_ASM_ID_MASK 0xffff0000 /* [I] Asm ID Mask */
25#define RIO_ASM_VEN_ID_MASK 0x0000ffff /* [I] Asm Vend Mask */
26
27#define RIO_ASM_INFO_CAR 0x0c /* [I] Assembly Information CAR */
28#define RIO_ASM_REV_MASK 0xffff0000 /* [I] Asm Rev Mask */
29#define RIO_EXT_FTR_PTR_MASK 0x0000ffff /* [I] EF_PTR Mask */
30
31#define RIO_PEF_CAR 0x10 /* [I] Processing Element Features CAR */
32#define RIO_PEF_BRIDGE 0x80000000 /* [I] Bridge */
33#define RIO_PEF_MEMORY 0x40000000 /* [I] MMIO */
34#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */
35#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */
36#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */
37#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */
38#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */
39#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */
40#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */
41#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */
42#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */
43#define RIO_PEF_EXT_FEATURES 0x00000008 /* [I] EFT_PTR valid */
44#define RIO_PEF_ADDR_66 0x00000004 /* [I] 66 bits */
45#define RIO_PEF_ADDR_50 0x00000002 /* [I] 50 bits */
46#define RIO_PEF_ADDR_34 0x00000001 /* [I] 34 bits */
47
48#define RIO_SWP_INFO_CAR 0x14 /* [I] Switch Port Information CAR */
49#define RIO_SWP_INFO_PORT_TOTAL_MASK 0x0000ff00 /* [I] Total number of ports */
50#define RIO_SWP_INFO_PORT_NUM_MASK 0x000000ff /* [I] Maintenance transaction port number */
51#define RIO_GET_TOTAL_PORTS(x) ((x & RIO_SWP_INFO_PORT_TOTAL_MASK) >> 8)
52
53#define RIO_SRC_OPS_CAR 0x18 /* [I] Source Operations CAR */
54#define RIO_SRC_OPS_READ 0x00008000 /* [I] Read op */
55#define RIO_SRC_OPS_WRITE 0x00004000 /* [I] Write op */
56#define RIO_SRC_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */
57#define RIO_SRC_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */
58#define RIO_SRC_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */
59#define RIO_SRC_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */
60#define RIO_SRC_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */
61#define RIO_SRC_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */
62#define RIO_SRC_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */
63#define RIO_SRC_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */
64#define RIO_SRC_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
65#define RIO_SRC_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
66
67#define RIO_DST_OPS_CAR 0x1c /* Destination Operations CAR */
68#define RIO_DST_OPS_READ 0x00008000 /* [I] Read op */
69#define RIO_DST_OPS_WRITE 0x00004000 /* [I] Write op */
70#define RIO_DST_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */
71#define RIO_DST_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */
72#define RIO_DST_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */
73#define RIO_DST_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */
74#define RIO_DST_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */
75#define RIO_DST_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */
76#define RIO_DST_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */
77#define RIO_DST_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */
78#define RIO_DST_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
79#define RIO_DST_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
80
81#define RIO_OPS_READ 0x00008000 /* [I] Read op */
82#define RIO_OPS_WRITE 0x00004000 /* [I] Write op */
83#define RIO_OPS_STREAM_WRITE 0x00002000 /* [I] Str-write op */
84#define RIO_OPS_WRITE_RESPONSE 0x00001000 /* [I] Write/resp op */
85#define RIO_OPS_DATA_MSG 0x00000800 /* [II] Data msg op */
86#define RIO_OPS_DOORBELL 0x00000400 /* [II] Doorbell op */
87#define RIO_OPS_ATOMIC_TST_SWP 0x00000100 /* [I] Atomic TAS op */
88#define RIO_OPS_ATOMIC_INC 0x00000080 /* [I] Atomic inc op */
89#define RIO_OPS_ATOMIC_DEC 0x00000040 /* [I] Atomic dec op */
90#define RIO_OPS_ATOMIC_SET 0x00000020 /* [I] Atomic set op */
91#define RIO_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
92#define RIO_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
93
94 /* 0x20-0x3c *//* Reserved */
95
96#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */
97#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */
98#define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */
99#define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */
100#define RIO_MBOX0_BUSY 0x10000000 /* [II] Mbox 0 busy */
101#define RIO_MBOX0_FAIL 0x08000000 /* [II] Mbox 0 fail */
102#define RIO_MBOX0_ERROR 0x04000000 /* [II] Mbox 0 error */
103#define RIO_MBOX1_AVAIL 0x00800000 /* [II] Mbox 1 avail */
104#define RIO_MBOX1_FULL 0x00200000 /* [II] Mbox 1 full */
105#define RIO_MBOX1_EMPTY 0x00200000 /* [II] Mbox 1 empty */
106#define RIO_MBOX1_BUSY 0x00100000 /* [II] Mbox 1 busy */
107#define RIO_MBOX1_FAIL 0x00080000 /* [II] Mbox 1 fail */
108#define RIO_MBOX1_ERROR 0x00040000 /* [II] Mbox 1 error */
109#define RIO_MBOX2_AVAIL 0x00008000 /* [II] Mbox 2 avail */
110#define RIO_MBOX2_FULL 0x00004000 /* [II] Mbox 2 full */
111#define RIO_MBOX2_EMPTY 0x00002000 /* [II] Mbox 2 empty */
112#define RIO_MBOX2_BUSY 0x00001000 /* [II] Mbox 2 busy */
113#define RIO_MBOX2_FAIL 0x00000800 /* [II] Mbox 2 fail */
114#define RIO_MBOX2_ERROR 0x00000400 /* [II] Mbox 2 error */
115#define RIO_MBOX3_AVAIL 0x00000080 /* [II] Mbox 3 avail */
116#define RIO_MBOX3_FULL 0x00000040 /* [II] Mbox 3 full */
117#define RIO_MBOX3_EMPTY 0x00000020 /* [II] Mbox 3 empty */
118#define RIO_MBOX3_BUSY 0x00000010 /* [II] Mbox 3 busy */
119#define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */
120#define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */
121
122#define RIO_WRITE_PORT_CSR 0x44 /* [I] Write Port CSR */
123#define RIO_DOORBELL_CSR 0x44 /* [II] Doorbell CSR */
124#define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */
125#define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */
126#define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */
127#define RIO_DOORBELL_BUSY 0x10000000 /* [II] Doorbell busy */
128#define RIO_DOORBELL_FAILED 0x08000000 /* [II] Doorbell failed */
129#define RIO_DOORBELL_ERROR 0x04000000 /* [II] Doorbell error */
130#define RIO_WRITE_PORT_AVAILABLE 0x00000080 /* [I] Write Port Available */
131#define RIO_WRITE_PORT_FULL 0x00000040 /* [I] Write Port Full */
132#define RIO_WRITE_PORT_EMPTY 0x00000020 /* [I] Write Port Empty */
133#define RIO_WRITE_PORT_BUSY 0x00000010 /* [I] Write Port Busy */
134#define RIO_WRITE_PORT_FAILED 0x00000008 /* [I] Write Port Failed */
135#define RIO_WRITE_PORT_ERROR 0x00000004 /* [I] Write Port Error */
136
137 /* 0x48 *//* Reserved */
138
139#define RIO_PELL_CTRL_CSR 0x4c /* [I] PE Logical Layer Control CSR */
140#define RIO_PELL_ADDR_66 0x00000004 /* [I] 66-bit addr */
141#define RIO_PELL_ADDR_50 0x00000002 /* [I] 50-bit addr */
142#define RIO_PELL_ADDR_34 0x00000001 /* [I] 34-bit addr */
143
144 /* 0x50-0x54 *//* Reserved */
145
146#define RIO_LCSH_BA 0x58 /* [I] LCS High Base Address */
147#define RIO_LCSL_BA 0x5c /* [I] LCS Base Address */
148
149#define RIO_DID_CSR 0x60 /* [III] Base Device ID CSR */
150
151 /* 0x64 *//* Reserved */
152
153#define RIO_HOST_DID_LOCK_CSR 0x68 /* [III] Host Base Device ID Lock CSR */
154#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */
155
156 /* 0x70-0xf8 *//* Reserved */
157 /* 0x100-0xfff8 *//* [I] Extended Features Space */
158 /* 0x10000-0xfffff8 *//* [I] Implementation-defined Space */
159
160/*
161 * Extended Features Space is a configuration space area where
162 * functionality is mapped into extended feature blocks via a
163 * singly linked list of extended feature pointers (EFT_PTR).
164 *
165 * Each extended feature block can be identified/located in
166 * Extended Features Space by walking the extended feature
167 * list starting with the Extended Feature Pointer located
168 * in the Assembly Information CAR.
169 *
170 * Extended Feature Blocks (EFBs) are identified with an assigned
171 * EFB ID. Extended feature block offsets in the definitions are
172 * relative to the offset of the EFB within the Extended Features
173 * Space.
174 */
175
176/* Helper macros to parse the Extended Feature Block header */
177#define RIO_EFB_PTR_MASK 0xffff0000
178#define RIO_EFB_ID_MASK 0x0000ffff
179#define RIO_GET_BLOCK_PTR(x) ((x & RIO_EFB_PTR_MASK) >> 16)
180#define RIO_GET_BLOCK_ID(x) (x & RIO_EFB_ID_MASK)
181
182/* Extended Feature Block IDs */
183#define RIO_EFB_PAR_EP_ID 0x0001 /* [IV] LP/LVDS EP Devices */
184#define RIO_EFB_PAR_EP_REC_ID 0x0002 /* [IV] LP/LVDS EP Recovery Devices */
185#define RIO_EFB_PAR_EP_FREE_ID 0x0003 /* [IV] LP/LVDS EP Free Devices */
186#define RIO_EFB_SER_EP_ID 0x0004 /* [VI] LP/Serial EP Devices */
187#define RIO_EFB_SER_EP_REC_ID 0x0005 /* [VI] LP/Serial EP Recovery Devices */
188#define RIO_EFB_SER_EP_FREE_ID 0x0006 /* [VI] LP/Serial EP Free Devices */
189
190/*
191 * Physical 8/16 LP-LVDS
192 * ID=0x0001, Generic End Point Devices
193 * ID=0x0002, Generic End Point Devices, software assisted recovery option
194 * ID=0x0003, Generic End Point Free Devices
195 *
196 * Physical LP-Serial
197 * ID=0x0004, Generic End Point Devices
198 * ID=0x0005, Generic End Point Devices, software assisted recovery option
199 * ID=0x0006, Generic End Point Free Devices
200 */
201#define RIO_PORT_MNT_HEADER 0x0000
202#define RIO_PORT_REQ_CTL_CSR 0x0020
203#define RIO_PORT_RSP_CTL_CSR 0x0024 /* 0x0001/0x0002 */
204#define RIO_PORT_GEN_CTL_CSR 0x003c
205#define RIO_PORT_GEN_HOST 0x80000000
206#define RIO_PORT_GEN_MASTER 0x40000000
207#define RIO_PORT_GEN_DISCOVERED 0x20000000
208#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */
209#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */
210#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */
211#define RIO_PORT_N_ERR_STS_CSR(x) (0x58 + x*0x20)
212#define PORT_N_ERR_STS_PORT_OK 0x00000002
213#define RIO_PORT_N_CTL_CSR(x) (0x5c + x*0x20)
214
215#endif /* LINUX_RIO_REGS_H */
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index e80fb7ee6efd..33261f1d2239 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -89,14 +89,14 @@ static inline void page_dup_rmap(struct page *page)
89/* 89/*
90 * Called from mm/vmscan.c to handle paging out 90 * Called from mm/vmscan.c to handle paging out
91 */ 91 */
92int page_referenced(struct page *, int is_locked, int ignore_token); 92int page_referenced(struct page *, int is_locked);
93int try_to_unmap(struct page *); 93int try_to_unmap(struct page *);
94 94
95/* 95/*
96 * Called from mm/filemap_xip.c to unmap empty zero page 96 * Called from mm/filemap_xip.c to unmap empty zero page
97 */ 97 */
98pte_t *page_check_address(struct page *, struct mm_struct *, unsigned long); 98pte_t *page_check_address(struct page *, struct mm_struct *,
99 99 unsigned long, spinlock_t **);
100 100
101/* 101/*
102 * Used by swapoff to help locate where page is expected in vma. 102 * Used by swapoff to help locate where page is expected in vma.
@@ -109,7 +109,7 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *);
109#define anon_vma_prepare(vma) (0) 109#define anon_vma_prepare(vma) (0)
110#define anon_vma_link(vma) do {} while (0) 110#define anon_vma_link(vma) do {} while (0)
111 111
112#define page_referenced(page,l,i) TestClearPageReferenced(page) 112#define page_referenced(page,l) TestClearPageReferenced(page)
113#define try_to_unmap(page) SWAP_FAIL 113#define try_to_unmap(page) SWAP_FAIL
114 114
115#endif /* CONFIG_MMU */ 115#endif /* CONFIG_MMU */
diff --git a/include/linux/rslib.h b/include/linux/rslib.h
index 980c8f74d8dc..ace25acfdc97 100644
--- a/include/linux/rslib.h
+++ b/include/linux/rslib.h
@@ -1,15 +1,15 @@
1/* 1/*
2 * include/linux/rslib.h 2 * include/linux/rslib.h
3 * 3 *
4 * Overview: 4 * Overview:
5 * Generic Reed Solomon encoder / decoder library 5 * Generic Reed Solomon encoder / decoder library
6 * 6 *
7 * Copyright (C) 2004 Thomas Gleixner (tglx@linutronix.de) 7 * Copyright (C) 2004 Thomas Gleixner (tglx@linutronix.de)
8 * 8 *
9 * RS code lifted from reed solomon library written by Phil Karn 9 * RS code lifted from reed solomon library written by Phil Karn
10 * Copyright 2002 Phil Karn, KA9Q 10 * Copyright 2002 Phil Karn, KA9Q
11 * 11 *
12 * $Id: rslib.h,v 1.3 2004/10/05 22:08:22 gleixner Exp $ 12 * $Id: rslib.h,v 1.4 2005/11/07 11:14:52 gleixner Exp $
13 * 13 *
14 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as 15 * it under the terms of the GNU General Public License version 2 as
@@ -21,20 +21,20 @@
21 21
22#include <linux/list.h> 22#include <linux/list.h>
23 23
24/** 24/**
25 * struct rs_control - rs control structure 25 * struct rs_control - rs control structure
26 * 26 *
27 * @mm: Bits per symbol 27 * @mm: Bits per symbol
28 * @nn: Symbols per block (= (1<<mm)-1) 28 * @nn: Symbols per block (= (1<<mm)-1)
29 * @alpha_to: log lookup table 29 * @alpha_to: log lookup table
30 * @index_of: Antilog lookup table 30 * @index_of: Antilog lookup table
31 * @genpoly: Generator polynomial 31 * @genpoly: Generator polynomial
32 * @nroots: Number of generator roots = number of parity symbols 32 * @nroots: Number of generator roots = number of parity symbols
33 * @fcr: First consecutive root, index form 33 * @fcr: First consecutive root, index form
34 * @prim: Primitive element, index form 34 * @prim: Primitive element, index form
35 * @iprim: prim-th root of 1, index form 35 * @iprim: prim-th root of 1, index form
36 * @gfpoly: The primitive generator polynominal 36 * @gfpoly: The primitive generator polynominal
37 * @users: Users of this structure 37 * @users: Users of this structure
38 * @list: List entry for the rs control list 38 * @list: List entry for the rs control list
39*/ 39*/
40struct rs_control { 40struct rs_control {
@@ -58,7 +58,7 @@ int encode_rs8(struct rs_control *rs, uint8_t *data, int len, uint16_t *par,
58 uint16_t invmsk); 58 uint16_t invmsk);
59#endif 59#endif
60#ifdef CONFIG_REED_SOLOMON_DEC8 60#ifdef CONFIG_REED_SOLOMON_DEC8
61int decode_rs8(struct rs_control *rs, uint8_t *data, uint16_t *par, int len, 61int decode_rs8(struct rs_control *rs, uint8_t *data, uint16_t *par, int len,
62 uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk, 62 uint16_t *s, int no_eras, int *eras_pos, uint16_t invmsk,
63 uint16_t *corr); 63 uint16_t *corr);
64#endif 64#endif
@@ -75,7 +75,7 @@ int decode_rs16(struct rs_control *rs, uint16_t *data, uint16_t *par, int len,
75#endif 75#endif
76 76
77/* Create or get a matching rs control structure */ 77/* Create or get a matching rs control structure */
78struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim, 78struct rs_control *init_rs(int symsize, int gfpoly, int fcr, int prim,
79 int nroots); 79 int nroots);
80 80
81/* Release a rs control structure */ 81/* Release a rs control structure */
@@ -87,9 +87,9 @@ void free_rs(struct rs_control *rs);
87 * @x: the value to reduce 87 * @x: the value to reduce
88 * 88 *
89 * where 89 * where
90 * rs->mm = number of bits per symbol 90 * rs->mm = number of bits per symbol
91 * rs->nn = (2^rs->mm) - 1 91 * rs->nn = (2^rs->mm) - 1
92 * 92 *
93 * Simple arithmetic modulo would return a wrong result for values 93 * Simple arithmetic modulo would return a wrong result for values
94 * >= 3 * rs->nn 94 * >= 3 * rs->nn
95*/ 95*/
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h
index b52a2af25f1f..f30f805080ae 100644
--- a/include/linux/rwsem-spinlock.h
+++ b/include/linux/rwsem-spinlock.h
@@ -61,5 +61,10 @@ extern void FASTCALL(__up_read(struct rw_semaphore *sem));
61extern void FASTCALL(__up_write(struct rw_semaphore *sem)); 61extern void FASTCALL(__up_write(struct rw_semaphore *sem));
62extern void FASTCALL(__downgrade_write(struct rw_semaphore *sem)); 62extern void FASTCALL(__downgrade_write(struct rw_semaphore *sem));
63 63
64static inline int rwsem_is_locked(struct rw_semaphore *sem)
65{
66 return (sem->activity != 0);
67}
68
64#endif /* __KERNEL__ */ 69#endif /* __KERNEL__ */
65#endif /* _LINUX_RWSEM_SPINLOCK_H */ 70#endif /* _LINUX_RWSEM_SPINLOCK_H */
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 7f717e95ae37..66ff545552f7 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -1,14 +1,23 @@
1#ifndef _LINUX_SCATTERLIST_H 1#ifndef _LINUX_SCATTERLIST_H
2#define _LINUX_SCATTERLIST_H 2#define _LINUX_SCATTERLIST_H
3 3
4static inline void sg_init_one(struct scatterlist *sg, 4#include <asm/scatterlist.h>
5 u8 *buf, unsigned int buflen) 5#include <linux/mm.h>
6{ 6#include <linux/string.h>
7 memset(sg, 0, sizeof(*sg));
8 7
8static inline void sg_set_buf(struct scatterlist *sg, void *buf,
9 unsigned int buflen)
10{
9 sg->page = virt_to_page(buf); 11 sg->page = virt_to_page(buf);
10 sg->offset = offset_in_page(buf); 12 sg->offset = offset_in_page(buf);
11 sg->length = buflen; 13 sg->length = buflen;
12} 14}
13 15
16static inline void sg_init_one(struct scatterlist *sg, void *buf,
17 unsigned int buflen)
18{
19 memset(sg, 0, sizeof(*sg));
20 sg_set_buf(sg, buf, buflen);
21}
22
14#endif /* _LINUX_SCATTERLIST_H */ 23#endif /* _LINUX_SCATTERLIST_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 49e617fa0f66..b0ad6f30679e 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -107,13 +107,25 @@ extern unsigned long nr_iowait(void);
107 107
108#include <asm/processor.h> 108#include <asm/processor.h>
109 109
110/*
111 * Task state bitmask. NOTE! These bits are also
112 * encoded in fs/proc/array.c: get_task_state().
113 *
114 * We have two separate sets of flags: task->state
115 * is about runnability, while task->exit_state are
116 * about the task exiting. Confusing, but this way
117 * modifying one set can't modify the other one by
118 * mistake.
119 */
110#define TASK_RUNNING 0 120#define TASK_RUNNING 0
111#define TASK_INTERRUPTIBLE 1 121#define TASK_INTERRUPTIBLE 1
112#define TASK_UNINTERRUPTIBLE 2 122#define TASK_UNINTERRUPTIBLE 2
113#define TASK_STOPPED 4 123#define TASK_STOPPED 4
114#define TASK_TRACED 8 124#define TASK_TRACED 8
125/* in tsk->exit_state */
115#define EXIT_ZOMBIE 16 126#define EXIT_ZOMBIE 16
116#define EXIT_DEAD 32 127#define EXIT_DEAD 32
128/* in tsk->state again */
117#define TASK_NONINTERACTIVE 64 129#define TASK_NONINTERACTIVE 64
118 130
119#define __set_task_state(tsk, state_value) \ 131#define __set_task_state(tsk, state_value) \
@@ -237,6 +249,36 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
237extern void arch_unmap_area(struct mm_struct *, unsigned long); 249extern void arch_unmap_area(struct mm_struct *, unsigned long);
238extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); 250extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
239 251
252#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
253/*
254 * The mm counters are not protected by its page_table_lock,
255 * so must be incremented atomically.
256 */
257#ifdef ATOMIC64_INIT
258#define set_mm_counter(mm, member, value) atomic64_set(&(mm)->_##member, value)
259#define get_mm_counter(mm, member) ((unsigned long)atomic64_read(&(mm)->_##member))
260#define add_mm_counter(mm, member, value) atomic64_add(value, &(mm)->_##member)
261#define inc_mm_counter(mm, member) atomic64_inc(&(mm)->_##member)
262#define dec_mm_counter(mm, member) atomic64_dec(&(mm)->_##member)
263typedef atomic64_t mm_counter_t;
264#else /* !ATOMIC64_INIT */
265/*
266 * The counters wrap back to 0 at 2^32 * PAGE_SIZE,
267 * that is, at 16TB if using 4kB page size.
268 */
269#define set_mm_counter(mm, member, value) atomic_set(&(mm)->_##member, value)
270#define get_mm_counter(mm, member) ((unsigned long)atomic_read(&(mm)->_##member))
271#define add_mm_counter(mm, member, value) atomic_add(value, &(mm)->_##member)
272#define inc_mm_counter(mm, member) atomic_inc(&(mm)->_##member)
273#define dec_mm_counter(mm, member) atomic_dec(&(mm)->_##member)
274typedef atomic_t mm_counter_t;
275#endif /* !ATOMIC64_INIT */
276
277#else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
278/*
279 * The mm counters are protected by its page_table_lock,
280 * so can be incremented directly.
281 */
240#define set_mm_counter(mm, member, value) (mm)->_##member = (value) 282#define set_mm_counter(mm, member, value) (mm)->_##member = (value)
241#define get_mm_counter(mm, member) ((mm)->_##member) 283#define get_mm_counter(mm, member) ((mm)->_##member)
242#define add_mm_counter(mm, member, value) (mm)->_##member += (value) 284#define add_mm_counter(mm, member, value) (mm)->_##member += (value)
@@ -244,6 +286,20 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
244#define dec_mm_counter(mm, member) (mm)->_##member-- 286#define dec_mm_counter(mm, member) (mm)->_##member--
245typedef unsigned long mm_counter_t; 287typedef unsigned long mm_counter_t;
246 288
289#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
290
291#define get_mm_rss(mm) \
292 (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss))
293#define update_hiwater_rss(mm) do { \
294 unsigned long _rss = get_mm_rss(mm); \
295 if ((mm)->hiwater_rss < _rss) \
296 (mm)->hiwater_rss = _rss; \
297} while (0)
298#define update_hiwater_vm(mm) do { \
299 if ((mm)->hiwater_vm < (mm)->total_vm) \
300 (mm)->hiwater_vm = (mm)->total_vm; \
301} while (0)
302
247struct mm_struct { 303struct mm_struct {
248 struct vm_area_struct * mmap; /* list of VMAs */ 304 struct vm_area_struct * mmap; /* list of VMAs */
249 struct rb_root mm_rb; 305 struct rb_root mm_rb;
@@ -267,15 +323,20 @@ struct mm_struct {
267 * by mmlist_lock 323 * by mmlist_lock
268 */ 324 */
269 325
326 /* Special counters, in some configurations protected by the
327 * page_table_lock, in other configurations by being atomic.
328 */
329 mm_counter_t _file_rss;
330 mm_counter_t _anon_rss;
331
332 unsigned long hiwater_rss; /* High-watermark of RSS usage */
333 unsigned long hiwater_vm; /* High-water virtual memory usage */
334
335 unsigned long total_vm, locked_vm, shared_vm, exec_vm;
336 unsigned long stack_vm, reserved_vm, def_flags, nr_ptes;
270 unsigned long start_code, end_code, start_data, end_data; 337 unsigned long start_code, end_code, start_data, end_data;
271 unsigned long start_brk, brk, start_stack; 338 unsigned long start_brk, brk, start_stack;
272 unsigned long arg_start, arg_end, env_start, env_end; 339 unsigned long arg_start, arg_end, env_start, env_end;
273 unsigned long total_vm, locked_vm, shared_vm;
274 unsigned long exec_vm, stack_vm, reserved_vm, def_flags, nr_ptes;
275
276 /* Special counters protected by the page_table_lock */
277 mm_counter_t _rss;
278 mm_counter_t _anon_rss;
279 340
280 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ 341 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
281 342
@@ -296,11 +357,6 @@ struct mm_struct {
296 /* aio bits */ 357 /* aio bits */
297 rwlock_t ioctx_list_lock; 358 rwlock_t ioctx_list_lock;
298 struct kioctx *ioctx_list; 359 struct kioctx *ioctx_list;
299
300 struct kioctx default_kioctx;
301
302 unsigned long hiwater_rss; /* High-water RSS usage */
303 unsigned long hiwater_vm; /* High-water virtual memory usage */
304}; 360};
305 361
306struct sighand_struct { 362struct sighand_struct {
@@ -883,7 +939,7 @@ extern int set_cpus_allowed(task_t *p, cpumask_t new_mask);
883#else 939#else
884static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask) 940static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
885{ 941{
886 if (!cpus_intersects(new_mask, cpu_online_map)) 942 if (!cpu_isset(0, new_mask))
887 return -EINVAL; 943 return -EINVAL;
888 return 0; 944 return 0;
889} 945}
@@ -1006,6 +1062,7 @@ extern int force_sig_info(int, struct siginfo *, struct task_struct *);
1006extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); 1062extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp);
1007extern int kill_pg_info(int, struct siginfo *, pid_t); 1063extern int kill_pg_info(int, struct siginfo *, pid_t);
1008extern int kill_proc_info(int, struct siginfo *, pid_t); 1064extern int kill_proc_info(int, struct siginfo *, pid_t);
1065extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t);
1009extern void do_notify_parent(struct task_struct *, int); 1066extern void do_notify_parent(struct task_struct *, int);
1010extern void force_sig(int, struct task_struct *); 1067extern void force_sig(int, struct task_struct *);
1011extern void force_sig_specific(int, struct task_struct *); 1068extern void force_sig_specific(int, struct task_struct *);
@@ -1026,6 +1083,11 @@ extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned lon
1026#define SEND_SIG_PRIV ((struct siginfo *) 1) 1083#define SEND_SIG_PRIV ((struct siginfo *) 1)
1027#define SEND_SIG_FORCED ((struct siginfo *) 2) 1084#define SEND_SIG_FORCED ((struct siginfo *) 2)
1028 1085
1086static inline int is_si_special(const struct siginfo *info)
1087{
1088 return info <= SEND_SIG_FORCED;
1089}
1090
1029/* True if we are on the alternate signal stack. */ 1091/* True if we are on the alternate signal stack. */
1030 1092
1031static inline int on_sig_stack(unsigned long sp) 1093static inline int on_sig_stack(unsigned long sp)
@@ -1153,7 +1215,7 @@ extern void unhash_process(struct task_struct *p);
1153/* 1215/*
1154 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring 1216 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring
1155 * subscriptions and synchronises with wait4(). Also used in procfs. Also 1217 * subscriptions and synchronises with wait4(). Also used in procfs. Also
1156 * pins the final release of task.io_context. 1218 * pins the final release of task.io_context. Also protects ->cpuset.
1157 * 1219 *
1158 * Nests both inside and outside of read_lock(&tasklist_lock). 1220 * Nests both inside and outside of read_lock(&tasklist_lock).
1159 * It must not be nested with write_lock_irq(&tasklist_lock), 1221 * It must not be nested with write_lock_irq(&tasklist_lock),
@@ -1169,32 +1231,49 @@ static inline void task_unlock(struct task_struct *p)
1169 spin_unlock(&p->alloc_lock); 1231 spin_unlock(&p->alloc_lock);
1170} 1232}
1171 1233
1234#ifndef __HAVE_THREAD_FUNCTIONS
1235
1236#define task_thread_info(task) (task)->thread_info
1237
1238static inline void setup_thread_stack(struct task_struct *p, struct task_struct *org)
1239{
1240 *task_thread_info(p) = *task_thread_info(org);
1241 task_thread_info(p)->task = p;
1242}
1243
1244static inline unsigned long *end_of_stack(struct task_struct *p)
1245{
1246 return (unsigned long *)(p->thread_info + 1);
1247}
1248
1249#endif
1250
1172/* set thread flags in other task's structures 1251/* set thread flags in other task's structures
1173 * - see asm/thread_info.h for TIF_xxxx flags available 1252 * - see asm/thread_info.h for TIF_xxxx flags available
1174 */ 1253 */
1175static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag) 1254static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag)
1176{ 1255{
1177 set_ti_thread_flag(tsk->thread_info,flag); 1256 set_ti_thread_flag(task_thread_info(tsk), flag);
1178} 1257}
1179 1258
1180static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag) 1259static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
1181{ 1260{
1182 clear_ti_thread_flag(tsk->thread_info,flag); 1261 clear_ti_thread_flag(task_thread_info(tsk), flag);
1183} 1262}
1184 1263
1185static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) 1264static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
1186{ 1265{
1187 return test_and_set_ti_thread_flag(tsk->thread_info,flag); 1266 return test_and_set_ti_thread_flag(task_thread_info(tsk), flag);
1188} 1267}
1189 1268
1190static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) 1269static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag)
1191{ 1270{
1192 return test_and_clear_ti_thread_flag(tsk->thread_info,flag); 1271 return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag);
1193} 1272}
1194 1273
1195static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) 1274static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag)
1196{ 1275{
1197 return test_ti_thread_flag(tsk->thread_info,flag); 1276 return test_ti_thread_flag(task_thread_info(tsk), flag);
1198} 1277}
1199 1278
1200static inline void set_tsk_need_resched(struct task_struct *tsk) 1279static inline void set_tsk_need_resched(struct task_struct *tsk)
@@ -1265,12 +1344,12 @@ extern void signal_wake_up(struct task_struct *t, int resume_stopped);
1265 1344
1266static inline unsigned int task_cpu(const struct task_struct *p) 1345static inline unsigned int task_cpu(const struct task_struct *p)
1267{ 1346{
1268 return p->thread_info->cpu; 1347 return task_thread_info(p)->cpu;
1269} 1348}
1270 1349
1271static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) 1350static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
1272{ 1351{
1273 p->thread_info->cpu = cpu; 1352 task_thread_info(p)->cpu = cpu;
1274} 1353}
1275 1354
1276#else 1355#else
diff --git a/include/linux/sdladrv.h b/include/linux/sdladrv.h
index 78f634007fc6..c85e103d5e7b 100644
--- a/include/linux/sdladrv.h
+++ b/include/linux/sdladrv.h
@@ -52,12 +52,8 @@ typedef struct sdlahw
52 52
53extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len); 53extern int sdla_setup (sdlahw_t* hw, void* sfm, unsigned len);
54extern int sdla_down (sdlahw_t* hw); 54extern int sdla_down (sdlahw_t* hw);
55extern int sdla_inten (sdlahw_t* hw);
56extern int sdla_intde (sdlahw_t* hw);
57extern int sdla_intack (sdlahw_t* hw);
58extern void S514_intack (sdlahw_t* hw, u32 int_status); 55extern void S514_intack (sdlahw_t* hw, u32 int_status);
59extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); 56extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status);
60extern int sdla_intr (sdlahw_t* hw);
61extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); 57extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr);
62extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, 58extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf,
63 unsigned len); 59 unsigned len);
diff --git a/include/linux/security.h b/include/linux/security.h
index 0e43460d374e..f7e0ae018712 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -30,6 +30,7 @@
30#include <linux/shm.h> 30#include <linux/shm.h>
31#include <linux/msg.h> 31#include <linux/msg.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/key.h>
33 34
34struct ctl_table; 35struct ctl_table;
35 36
@@ -385,6 +386,9 @@ struct swap_info_struct;
385 * NULL to request the size of the buffer required. @size indicates 386 * NULL to request the size of the buffer required. @size indicates
386 * the size of @buffer in bytes. Note that @name is the remainder 387 * the size of @buffer in bytes. Note that @name is the remainder
387 * of the attribute name after the security. prefix has been removed. 388 * of the attribute name after the security. prefix has been removed.
389 * @err is the return value from the preceding fs getxattr call,
390 * and can be used by the security module to determine whether it
391 * should try and canonicalize the attribute value.
388 * Return number of bytes used/required on success. 392 * Return number of bytes used/required on success.
389 * @inode_setsecurity: 393 * @inode_setsecurity:
390 * Set the security label associated with @name for @inode from the 394 * Set the security label associated with @name for @inode from the
@@ -785,6 +789,27 @@ struct swap_info_struct;
785 * @sk_free_security: 789 * @sk_free_security:
786 * Deallocate security structure. 790 * Deallocate security structure.
787 * 791 *
792 * Security hooks affecting all Key Management operations
793 *
794 * @key_alloc:
795 * Permit allocation of a key and assign security data. Note that key does
796 * not have a serial number assigned at this point.
797 * @key points to the key.
798 * Return 0 if permission is granted, -ve error otherwise.
799 * @key_free:
800 * Notification of destruction; free security data.
801 * @key points to the key.
802 * No return value.
803 * @key_permission:
804 * See whether a specific operational right is granted to a process on a
805 * key.
806 * @key_ref refers to the key (key pointer + possession attribute bit).
807 * @context points to the process to provide the context against which to
808 * evaluate the security data on the key.
809 * @perm describes the combination of permissions required of this key.
810 * Return 1 if permission granted, 0 if permission denied and -ve it the
811 * normal permissions model should be effected.
812 *
788 * Security hooks affecting all System V IPC operations. 813 * Security hooks affecting all System V IPC operations.
789 * 814 *
790 * @ipc_permission: 815 * @ipc_permission:
@@ -1091,7 +1116,7 @@ struct security_operations {
1091 int (*inode_getxattr) (struct dentry *dentry, char *name); 1116 int (*inode_getxattr) (struct dentry *dentry, char *name);
1092 int (*inode_listxattr) (struct dentry *dentry); 1117 int (*inode_listxattr) (struct dentry *dentry);
1093 int (*inode_removexattr) (struct dentry *dentry, char *name); 1118 int (*inode_removexattr) (struct dentry *dentry, char *name);
1094 int (*inode_getsecurity)(struct inode *inode, const char *name, void *buffer, size_t size); 1119 int (*inode_getsecurity)(struct inode *inode, const char *name, void *buffer, size_t size, int err);
1095 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); 1120 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags);
1096 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); 1121 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size);
1097 1122
@@ -1210,9 +1235,20 @@ struct security_operations {
1210 int (*socket_shutdown) (struct socket * sock, int how); 1235 int (*socket_shutdown) (struct socket * sock, int how);
1211 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); 1236 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb);
1212 int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); 1237 int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);
1213 int (*sk_alloc_security) (struct sock *sk, int family, int priority); 1238 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);
1214 void (*sk_free_security) (struct sock *sk); 1239 void (*sk_free_security) (struct sock *sk);
1215#endif /* CONFIG_SECURITY_NETWORK */ 1240#endif /* CONFIG_SECURITY_NETWORK */
1241
1242 /* key management security hooks */
1243#ifdef CONFIG_KEYS
1244 int (*key_alloc)(struct key *key);
1245 void (*key_free)(struct key *key);
1246 int (*key_permission)(key_ref_t key_ref,
1247 struct task_struct *context,
1248 key_perm_t perm);
1249
1250#endif /* CONFIG_KEYS */
1251
1216}; 1252};
1217 1253
1218/* global variables */ 1254/* global variables */
@@ -1580,11 +1616,11 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name)
1580 return security_ops->inode_removexattr (dentry, name); 1616 return security_ops->inode_removexattr (dentry, name);
1581} 1617}
1582 1618
1583static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size) 1619static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size, int err)
1584{ 1620{
1585 if (unlikely (IS_PRIVATE (inode))) 1621 if (unlikely (IS_PRIVATE (inode)))
1586 return 0; 1622 return 0;
1587 return security_ops->inode_getsecurity(inode, name, buffer, size); 1623 return security_ops->inode_getsecurity(inode, name, buffer, size, err);
1588} 1624}
1589 1625
1590static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) 1626static inline int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags)
@@ -2222,7 +2258,7 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name)
2222 return cap_inode_removexattr(dentry, name); 2258 return cap_inode_removexattr(dentry, name);
2223} 2259}
2224 2260
2225static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size) 2261static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size, int err)
2226{ 2262{
2227 return -EOPNOTSUPP; 2263 return -EOPNOTSUPP;
2228} 2264}
@@ -2634,8 +2670,7 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o
2634 return security_ops->socket_getpeersec(sock, optval, optlen, len); 2670 return security_ops->socket_getpeersec(sock, optval, optlen, len);
2635} 2671}
2636 2672
2637static inline int security_sk_alloc(struct sock *sk, int family, 2673static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
2638 unsigned int __nocast priority)
2639{ 2674{
2640 return security_ops->sk_alloc_security(sk, family, priority); 2675 return security_ops->sk_alloc_security(sk, family, priority);
2641} 2676}
@@ -2752,8 +2787,7 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o
2752 return -ENOPROTOOPT; 2787 return -ENOPROTOOPT;
2753} 2788}
2754 2789
2755static inline int security_sk_alloc(struct sock *sk, int family, 2790static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
2756 unsigned int __nocast priority)
2757{ 2791{
2758 return 0; 2792 return 0;
2759} 2793}
@@ -2763,5 +2797,45 @@ static inline void security_sk_free(struct sock *sk)
2763} 2797}
2764#endif /* CONFIG_SECURITY_NETWORK */ 2798#endif /* CONFIG_SECURITY_NETWORK */
2765 2799
2800#ifdef CONFIG_KEYS
2801#ifdef CONFIG_SECURITY
2802static inline int security_key_alloc(struct key *key)
2803{
2804 return security_ops->key_alloc(key);
2805}
2806
2807static inline void security_key_free(struct key *key)
2808{
2809 security_ops->key_free(key);
2810}
2811
2812static inline int security_key_permission(key_ref_t key_ref,
2813 struct task_struct *context,
2814 key_perm_t perm)
2815{
2816 return security_ops->key_permission(key_ref, context, perm);
2817}
2818
2819#else
2820
2821static inline int security_key_alloc(struct key *key)
2822{
2823 return 0;
2824}
2825
2826static inline void security_key_free(struct key *key)
2827{
2828}
2829
2830static inline int security_key_permission(key_ref_t key_ref,
2831 struct task_struct *context,
2832 key_perm_t perm)
2833{
2834 return 0;
2835}
2836
2837#endif
2838#endif /* CONFIG_KEYS */
2839
2766#endif /* ! __LINUX_SECURITY_H */ 2840#endif /* ! __LINUX_SECURITY_H */
2767 2841
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 106f9757339a..3c1f1120fe88 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -79,6 +79,8 @@ struct seminfo {
79 79
80#ifdef __KERNEL__ 80#ifdef __KERNEL__
81 81
82struct task_struct;
83
82/* One semaphore structure for each semaphore in the system. */ 84/* One semaphore structure for each semaphore in the system. */
83struct sem { 85struct sem {
84 int semval; /* current value */ 86 int semval; /* current value */
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 12cd9cf65e8f..33fc8cb8ddfb 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -11,6 +11,7 @@
11#define _LINUX_SERIAL_H 11#define _LINUX_SERIAL_H
12 12
13#ifdef __KERNEL__ 13#ifdef __KERNEL__
14#include <linux/types.h>
14#include <asm/page.h> 15#include <asm/page.h>
15 16
16/* 17/*
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 317a979b24de..cee302aefdb7 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -12,7 +12,7 @@
12#define _LINUX_SERIAL_8250_H 12#define _LINUX_SERIAL_8250_H
13 13
14#include <linux/serial_core.h> 14#include <linux/serial_core.h>
15#include <linux/device.h> 15#include <linux/platform_device.h>
16 16
17/* 17/*
18 * This is the platform device platform_data structure 18 * This is the platform device platform_data structure
@@ -42,6 +42,7 @@ enum {
42 PLAT8250_DEV_BOCA, 42 PLAT8250_DEV_BOCA,
43 PLAT8250_DEV_HUB6, 43 PLAT8250_DEV_HUB6,
44 PLAT8250_DEV_MCA, 44 PLAT8250_DEV_MCA,
45 PLAT8250_DEV_AU1X00,
45}; 46};
46 47
47/* 48/*
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 27db8da43aa4..e3710d7e260a 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -117,7 +117,12 @@
117#define PORT_M32R_SIO 68 117#define PORT_M32R_SIO 68
118 118
119/*Digi jsm */ 119/*Digi jsm */
120#define PORT_JSM 65 120#define PORT_JSM 69
121
122#define PORT_IP3106 70
123
124/* Hilscher netx */
125#define PORT_NETX 71
121 126
122#ifdef __KERNEL__ 127#ifdef __KERNEL__
123 128
@@ -209,6 +214,7 @@ struct uart_port {
209#define UPIO_HUB6 (1) 214#define UPIO_HUB6 (1)
210#define UPIO_MEM (2) 215#define UPIO_MEM (2)
211#define UPIO_MEM32 (3) 216#define UPIO_MEM32 (3)
217#define UPIO_AU (4) /* Au1x00 type IO */
212 218
213 unsigned int read_status_mask; /* driver specific */ 219 unsigned int read_status_mask; /* driver specific */
214 unsigned int ignore_status_mask; /* driver specific */ 220 unsigned int ignore_status_mask; /* driver specific */
diff --git a/include/linux/serial_ip3106.h b/include/linux/serial_ip3106.h
new file mode 100644
index 000000000000..f500ac602c5c
--- /dev/null
+++ b/include/linux/serial_ip3106.h
@@ -0,0 +1,81 @@
1/*
2 * Embedded Alley Solutions, source@embeddedalley.com.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef _LINUX_SERIAL_IP3106_H
20#define _LINUX_SERIAL_IP3106_H
21
22#include <linux/serial_core.h>
23#include <linux/device.h>
24
25#define IP3106_NR_PORTS 2
26
27struct ip3106_port {
28 struct uart_port port;
29 struct timer_list timer;
30 unsigned int old_status;
31};
32
33/* register offsets */
34#define IP3106_LCR 0
35#define IP3106_MCR 0x004
36#define IP3106_BAUD 0x008
37#define IP3106_CFG 0x00c
38#define IP3106_FIFO 0x028
39#define IP3106_ISTAT 0xfe0
40#define IP3106_IEN 0xfe4
41#define IP3106_ICLR 0xfe8
42#define IP3106_ISET 0xfec
43#define IP3106_PD 0xff4
44#define IP3106_MID 0xffc
45
46#define IP3106_UART_LCR_TXBREAK (1<<30)
47#define IP3106_UART_LCR_PAREVN 0x10000000
48#define IP3106_UART_LCR_PAREN 0x08000000
49#define IP3106_UART_LCR_2STOPB 0x04000000
50#define IP3106_UART_LCR_8BIT 0x01000000
51#define IP3106_UART_LCR_TX_RST 0x00040000
52#define IP3106_UART_LCR_RX_RST 0x00020000
53#define IP3106_UART_LCR_RX_NEXT 0x00010000
54
55#define IP3106_UART_MCR_SCR 0xFF000000
56#define IP3106_UART_MCR_DCD 0x00800000
57#define IP3106_UART_MCR_CTS 0x00100000
58#define IP3106_UART_MCR_LOOP 0x00000010
59#define IP3106_UART_MCR_RTS 0x00000002
60#define IP3106_UART_MCR_DTR 0x00000001
61
62#define IP3106_UART_INT_TX 0x00000080
63#define IP3106_UART_INT_EMPTY 0x00000040
64#define IP3106_UART_INT_RCVTO 0x00000020
65#define IP3106_UART_INT_RX 0x00000010
66#define IP3106_UART_INT_RXOVRN 0x00000008
67#define IP3106_UART_INT_FRERR 0x00000004
68#define IP3106_UART_INT_BREAK 0x00000002
69#define IP3106_UART_INT_PARITY 0x00000001
70#define IP3106_UART_INT_ALLRX 0x0000003F
71#define IP3106_UART_INT_ALLTX 0x000000C0
72
73#define IP3106_UART_FIFO_TXFIFO 0x001F0000
74#define IP3106_UART_FIFO_TXFIFO_STA (0x1f<<16)
75#define IP3106_UART_FIFO_RXBRK 0x00008000
76#define IP3106_UART_FIFO_RXFE 0x00004000
77#define IP3106_UART_FIFO_RXPAR 0x00002000
78#define IP3106_UART_FIFO_RXFIFO 0x00001F00
79#define IP3106_UART_FIFO_RBRTHR 0x000000FF
80
81#endif
diff --git a/include/linux/shm.h b/include/linux/shm.h
index 80113a1f60bc..a2c896ad0bef 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -92,6 +92,7 @@ struct shmid_kernel /* private to the kernel */
92#define SHM_DEST 01000 /* segment will be destroyed on last detach */ 92#define SHM_DEST 01000 /* segment will be destroyed on last detach */
93#define SHM_LOCKED 02000 /* segment will not be swapped */ 93#define SHM_LOCKED 02000 /* segment will not be swapped */
94#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ 94#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */
95#define SHM_NORESERVE 010000 /* don't check for reservations */
95 96
96#ifdef CONFIG_SYSVIPC 97#ifdef CONFIG_SYSVIPC
97long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); 98long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr);
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 7be18b5e2fb4..5dd5f02c5c5f 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -25,7 +25,6 @@
25 25
26struct sigqueue { 26struct sigqueue {
27 struct list_head list; 27 struct list_head list;
28 spinlock_t *lock;
29 int flags; 28 int flags;
30 siginfo_t info; 29 siginfo_t info;
31 struct user_struct *user; 30 struct user_struct *user;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2741c0c55e83..8c5d6001a923 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -137,6 +137,8 @@ struct skb_shared_info {
137 unsigned int nr_frags; 137 unsigned int nr_frags;
138 unsigned short tso_size; 138 unsigned short tso_size;
139 unsigned short tso_segs; 139 unsigned short tso_segs;
140 unsigned short ufo_size;
141 unsigned int ip6_frag_id;
140 struct sk_buff *frag_list; 142 struct sk_buff *frag_list;
141 skb_frag_t frags[MAX_SKB_FRAGS]; 143 skb_frag_t frags[MAX_SKB_FRAGS];
142}; 144};
@@ -155,8 +157,6 @@ struct skb_shared_info {
155#define SKB_DATAREF_SHIFT 16 157#define SKB_DATAREF_SHIFT 16
156#define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) 158#define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1)
157 159
158extern struct timeval skb_tv_base;
159
160struct skb_timeval { 160struct skb_timeval {
161 u32 off_sec; 161 u32 off_sec;
162 u32 off_usec; 162 u32 off_usec;
@@ -173,9 +173,8 @@ enum {
173 * struct sk_buff - socket buffer 173 * struct sk_buff - socket buffer
174 * @next: Next buffer in list 174 * @next: Next buffer in list
175 * @prev: Previous buffer in list 175 * @prev: Previous buffer in list
176 * @list: List we are on
177 * @sk: Socket we are owned by 176 * @sk: Socket we are owned by
178 * @tstamp: Time we arrived stored as offset to skb_tv_base 177 * @tstamp: Time we arrived
179 * @dev: Device we arrived on/are leaving by 178 * @dev: Device we arrived on/are leaving by
180 * @input_dev: Device we arrived on 179 * @input_dev: Device we arrived on
181 * @h: Transport layer header 180 * @h: Transport layer header
@@ -192,6 +191,7 @@ enum {
192 * @cloned: Head may be cloned (check refcnt to be sure) 191 * @cloned: Head may be cloned (check refcnt to be sure)
193 * @nohdr: Payload reference only, must not modify header 192 * @nohdr: Payload reference only, must not modify header
194 * @pkt_type: Packet class 193 * @pkt_type: Packet class
194 * @fclone: skbuff clone status
195 * @ip_summed: Driver fed us an IP checksum 195 * @ip_summed: Driver fed us an IP checksum
196 * @priority: Packet queueing priority 196 * @priority: Packet queueing priority
197 * @users: User count - see {datagram,tcp}.c 197 * @users: User count - see {datagram,tcp}.c
@@ -204,7 +204,9 @@ enum {
204 * @destructor: Destruct function 204 * @destructor: Destruct function
205 * @nfmark: Can be used for communication between hooks 205 * @nfmark: Can be used for communication between hooks
206 * @nfct: Associated connection, if any 206 * @nfct: Associated connection, if any
207 * @ipvs_property: skbuff is owned by ipvs
207 * @nfctinfo: Relationship of this skb to the connection 208 * @nfctinfo: Relationship of this skb to the connection
209 * @nfct_reasm: netfilter conntrack re-assembly pointer
208 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 210 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
209 * @tc_index: Traffic control index 211 * @tc_index: Traffic control index
210 * @tc_verd: traffic control verdict 212 * @tc_verd: traffic control verdict
@@ -263,15 +265,16 @@ struct sk_buff {
263 nohdr:1, 265 nohdr:1,
264 nfctinfo:3; 266 nfctinfo:3;
265 __u8 pkt_type:3, 267 __u8 pkt_type:3,
266 fclone:2; 268 fclone:2,
269 ipvs_property:1;
267 __be16 protocol; 270 __be16 protocol;
268 271
269 void (*destructor)(struct sk_buff *skb); 272 void (*destructor)(struct sk_buff *skb);
270#ifdef CONFIG_NETFILTER 273#ifdef CONFIG_NETFILTER
271 __u32 nfmark; 274 __u32 nfmark;
272 struct nf_conntrack *nfct; 275 struct nf_conntrack *nfct;
273#if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) 276#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
274 __u8 ipvs_property:1; 277 struct sk_buff *nfct_reasm;
275#endif 278#endif
276#ifdef CONFIG_BRIDGE_NETFILTER 279#ifdef CONFIG_BRIDGE_NETFILTER
277 struct nf_bridge_info *nf_bridge; 280 struct nf_bridge_info *nf_bridge;
@@ -304,37 +307,37 @@ struct sk_buff {
304 307
305extern void __kfree_skb(struct sk_buff *skb); 308extern void __kfree_skb(struct sk_buff *skb);
306extern struct sk_buff *__alloc_skb(unsigned int size, 309extern struct sk_buff *__alloc_skb(unsigned int size,
307 unsigned int __nocast priority, int fclone); 310 gfp_t priority, int fclone);
308static inline struct sk_buff *alloc_skb(unsigned int size, 311static inline struct sk_buff *alloc_skb(unsigned int size,
309 unsigned int __nocast priority) 312 gfp_t priority)
310{ 313{
311 return __alloc_skb(size, priority, 0); 314 return __alloc_skb(size, priority, 0);
312} 315}
313 316
314static inline struct sk_buff *alloc_skb_fclone(unsigned int size, 317static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
315 unsigned int __nocast priority) 318 gfp_t priority)
316{ 319{
317 return __alloc_skb(size, priority, 1); 320 return __alloc_skb(size, priority, 1);
318} 321}
319 322
320extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, 323extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp,
321 unsigned int size, 324 unsigned int size,
322 unsigned int __nocast priority); 325 gfp_t priority);
323extern void kfree_skbmem(struct sk_buff *skb); 326extern void kfree_skbmem(struct sk_buff *skb);
324extern struct sk_buff *skb_clone(struct sk_buff *skb, 327extern struct sk_buff *skb_clone(struct sk_buff *skb,
325 unsigned int __nocast priority); 328 gfp_t priority);
326extern struct sk_buff *skb_copy(const struct sk_buff *skb, 329extern struct sk_buff *skb_copy(const struct sk_buff *skb,
327 unsigned int __nocast priority); 330 gfp_t priority);
328extern struct sk_buff *pskb_copy(struct sk_buff *skb, 331extern struct sk_buff *pskb_copy(struct sk_buff *skb,
329 unsigned int __nocast gfp_mask); 332 gfp_t gfp_mask);
330extern int pskb_expand_head(struct sk_buff *skb, 333extern int pskb_expand_head(struct sk_buff *skb,
331 int nhead, int ntail, 334 int nhead, int ntail,
332 unsigned int __nocast gfp_mask); 335 gfp_t gfp_mask);
333extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, 336extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
334 unsigned int headroom); 337 unsigned int headroom);
335extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, 338extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
336 int newheadroom, int newtailroom, 339 int newheadroom, int newtailroom,
337 unsigned int __nocast priority); 340 gfp_t priority);
338extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); 341extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad);
339#define dev_kfree_skb(a) kfree_skb(a) 342#define dev_kfree_skb(a) kfree_skb(a)
340extern void skb_over_panic(struct sk_buff *skb, int len, 343extern void skb_over_panic(struct sk_buff *skb, int len,
@@ -342,6 +345,11 @@ extern void skb_over_panic(struct sk_buff *skb, int len,
342extern void skb_under_panic(struct sk_buff *skb, int len, 345extern void skb_under_panic(struct sk_buff *skb, int len,
343 void *here); 346 void *here);
344 347
348extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
349 int getfrag(void *from, char *to, int offset,
350 int len,int odd, struct sk_buff *skb),
351 void *from, int length);
352
345struct skb_seq_state 353struct skb_seq_state
346{ 354{
347 __u32 lower_offset; 355 __u32 lower_offset;
@@ -486,7 +494,7 @@ static inline int skb_shared(const struct sk_buff *skb)
486 * NULL is returned on a memory allocation failure. 494 * NULL is returned on a memory allocation failure.
487 */ 495 */
488static inline struct sk_buff *skb_share_check(struct sk_buff *skb, 496static inline struct sk_buff *skb_share_check(struct sk_buff *skb,
489 unsigned int __nocast pri) 497 gfp_t pri)
490{ 498{
491 might_sleep_if(pri & __GFP_WAIT); 499 might_sleep_if(pri & __GFP_WAIT);
492 if (skb_shared(skb)) { 500 if (skb_shared(skb)) {
@@ -518,7 +526,7 @@ static inline struct sk_buff *skb_share_check(struct sk_buff *skb,
518 * %NULL is returned on a memory allocation failure. 526 * %NULL is returned on a memory allocation failure.
519 */ 527 */
520static inline struct sk_buff *skb_unshare(struct sk_buff *skb, 528static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
521 unsigned int __nocast pri) 529 gfp_t pri)
522{ 530{
523 might_sleep_if(pri & __GFP_WAIT); 531 might_sleep_if(pri & __GFP_WAIT);
524 if (skb_cloned(skb)) { 532 if (skb_cloned(skb)) {
@@ -597,23 +605,23 @@ static inline void skb_queue_head_init(struct sk_buff_head *list)
597 */ 605 */
598 606
599/** 607/**
600 * __skb_queue_head - queue a buffer at the list head 608 * __skb_queue_after - queue a buffer at the list head
601 * @list: list to use 609 * @list: list to use
610 * @prev: place after this buffer
602 * @newsk: buffer to queue 611 * @newsk: buffer to queue
603 * 612 *
604 * Queue a buffer at the start of a list. This function takes no locks 613 * Queue a buffer int the middle of a list. This function takes no locks
605 * and you must therefore hold required locks before calling it. 614 * and you must therefore hold required locks before calling it.
606 * 615 *
607 * A buffer cannot be placed on two lists at the same time. 616 * A buffer cannot be placed on two lists at the same time.
608 */ 617 */
609extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk); 618static inline void __skb_queue_after(struct sk_buff_head *list,
610static inline void __skb_queue_head(struct sk_buff_head *list, 619 struct sk_buff *prev,
611 struct sk_buff *newsk) 620 struct sk_buff *newsk)
612{ 621{
613 struct sk_buff *prev, *next; 622 struct sk_buff *next;
614
615 list->qlen++; 623 list->qlen++;
616 prev = (struct sk_buff *)list; 624
617 next = prev->next; 625 next = prev->next;
618 newsk->next = next; 626 newsk->next = next;
619 newsk->prev = prev; 627 newsk->prev = prev;
@@ -621,6 +629,23 @@ static inline void __skb_queue_head(struct sk_buff_head *list,
621} 629}
622 630
623/** 631/**
632 * __skb_queue_head - queue a buffer at the list head
633 * @list: list to use
634 * @newsk: buffer to queue
635 *
636 * Queue a buffer at the start of a list. This function takes no locks
637 * and you must therefore hold required locks before calling it.
638 *
639 * A buffer cannot be placed on two lists at the same time.
640 */
641extern void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk);
642static inline void __skb_queue_head(struct sk_buff_head *list,
643 struct sk_buff *newsk)
644{
645 __skb_queue_after(list, (struct sk_buff *)list, newsk);
646}
647
648/**
624 * __skb_queue_tail - queue a buffer at the list tail 649 * __skb_queue_tail - queue a buffer at the list tail
625 * @list: list to use 650 * @list: list to use
626 * @newsk: buffer to queue 651 * @newsk: buffer to queue
@@ -1019,7 +1044,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
1019 * %NULL is returned in there is no free memory. 1044 * %NULL is returned in there is no free memory.
1020 */ 1045 */
1021static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 1046static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
1022 unsigned int __nocast gfp_mask) 1047 gfp_t gfp_mask)
1023{ 1048{
1024 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); 1049 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask);
1025 if (likely(skb)) 1050 if (likely(skb))
@@ -1132,8 +1157,8 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1132 * If there is no free memory -ENOMEM is returned, otherwise zero 1157 * If there is no free memory -ENOMEM is returned, otherwise zero
1133 * is returned and the old skb data released. 1158 * is returned and the old skb data released.
1134 */ 1159 */
1135extern int __skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp); 1160extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp);
1136static inline int skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp) 1161static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp)
1137{ 1162{
1138 return __skb_linearize(skb, gfp); 1163 return __skb_linearize(skb, gfp);
1139} 1164}
@@ -1197,6 +1222,11 @@ static inline void kunmap_skb_frag(void *vaddr)
1197 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ 1222 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \
1198 skb = skb->next) 1223 skb = skb->next)
1199 1224
1225#define skb_queue_reverse_walk(queue, skb) \
1226 for (skb = (queue)->prev; \
1227 prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \
1228 skb = skb->prev)
1229
1200 1230
1201extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, 1231extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags,
1202 int noblock, int *err); 1232 int noblock, int *err);
@@ -1205,8 +1235,7 @@ extern unsigned int datagram_poll(struct file *file, struct socket *sock,
1205extern int skb_copy_datagram_iovec(const struct sk_buff *from, 1235extern int skb_copy_datagram_iovec(const struct sk_buff *from,
1206 int offset, struct iovec *to, 1236 int offset, struct iovec *to,
1207 int size); 1237 int size);
1208extern int skb_copy_and_csum_datagram_iovec(const 1238extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
1209 struct sk_buff *skb,
1210 int hlen, 1239 int hlen,
1211 struct iovec *iov); 1240 struct iovec *iov);
1212extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); 1241extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
@@ -1255,10 +1284,6 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *
1255{ 1284{
1256 stamp->tv_sec = skb->tstamp.off_sec; 1285 stamp->tv_sec = skb->tstamp.off_sec;
1257 stamp->tv_usec = skb->tstamp.off_usec; 1286 stamp->tv_usec = skb->tstamp.off_usec;
1258 if (skb->tstamp.off_sec) {
1259 stamp->tv_sec += skb_tv_base.tv_sec;
1260 stamp->tv_usec += skb_tv_base.tv_usec;
1261 }
1262} 1287}
1263 1288
1264/** 1289/**
@@ -1272,12 +1297,36 @@ static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *
1272 */ 1297 */
1273static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) 1298static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp)
1274{ 1299{
1275 skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec; 1300 skb->tstamp.off_sec = stamp->tv_sec;
1276 skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec; 1301 skb->tstamp.off_usec = stamp->tv_usec;
1277} 1302}
1278 1303
1279extern void __net_timestamp(struct sk_buff *skb); 1304extern void __net_timestamp(struct sk_buff *skb);
1280 1305
1306extern unsigned int __skb_checksum_complete(struct sk_buff *skb);
1307
1308/**
1309 * skb_checksum_complete - Calculate checksum of an entire packet
1310 * @skb: packet to process
1311 *
1312 * This function calculates the checksum over the entire packet plus
1313 * the value of skb->csum. The latter can be used to supply the
1314 * checksum of a pseudo header as used by TCP/UDP. It returns the
1315 * checksum.
1316 *
1317 * For protocols that contain complete checksums such as ICMP/TCP/UDP,
1318 * this function can be used to verify that checksum on received
1319 * packets. In that case the function should return zero if the
1320 * checksum is correct. In particular, this function will return zero
1321 * if skb->ip_summed is CHECKSUM_UNNECESSARY which indicates that the
1322 * hardware has already verified the correctness of the checksum.
1323 */
1324static inline unsigned int skb_checksum_complete(struct sk_buff *skb)
1325{
1326 return skb->ip_summed != CHECKSUM_UNNECESSARY &&
1327 __skb_checksum_complete(skb);
1328}
1329
1281#ifdef CONFIG_NETFILTER 1330#ifdef CONFIG_NETFILTER
1282static inline void nf_conntrack_put(struct nf_conntrack *nfct) 1331static inline void nf_conntrack_put(struct nf_conntrack *nfct)
1283{ 1332{
@@ -1289,10 +1338,26 @@ static inline void nf_conntrack_get(struct nf_conntrack *nfct)
1289 if (nfct) 1338 if (nfct)
1290 atomic_inc(&nfct->use); 1339 atomic_inc(&nfct->use);
1291} 1340}
1341#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
1342static inline void nf_conntrack_get_reasm(struct sk_buff *skb)
1343{
1344 if (skb)
1345 atomic_inc(&skb->users);
1346}
1347static inline void nf_conntrack_put_reasm(struct sk_buff *skb)
1348{
1349 if (skb)
1350 kfree_skb(skb);
1351}
1352#endif
1292static inline void nf_reset(struct sk_buff *skb) 1353static inline void nf_reset(struct sk_buff *skb)
1293{ 1354{
1294 nf_conntrack_put(skb->nfct); 1355 nf_conntrack_put(skb->nfct);
1295 skb->nfct = NULL; 1356 skb->nfct = NULL;
1357#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
1358 nf_conntrack_put_reasm(skb->nfct_reasm);
1359 skb->nfct_reasm = NULL;
1360#endif
1296} 1361}
1297 1362
1298#ifdef CONFIG_BRIDGE_NETFILTER 1363#ifdef CONFIG_BRIDGE_NETFILTER
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1f356f3bbc64..d1ea4051b996 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -9,7 +9,7 @@
9 9
10#if defined(__KERNEL__) 10#if defined(__KERNEL__)
11 11
12typedef struct kmem_cache_s kmem_cache_t; 12typedef struct kmem_cache kmem_cache_t;
13 13
14#include <linux/config.h> /* kmalloc_sizes.h needs CONFIG_ options */ 14#include <linux/config.h> /* kmalloc_sizes.h needs CONFIG_ options */
15#include <linux/gfp.h> 15#include <linux/gfp.h>
@@ -61,11 +61,11 @@ extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned lo
61 void (*)(void *, kmem_cache_t *, unsigned long)); 61 void (*)(void *, kmem_cache_t *, unsigned long));
62extern int kmem_cache_destroy(kmem_cache_t *); 62extern int kmem_cache_destroy(kmem_cache_t *);
63extern int kmem_cache_shrink(kmem_cache_t *); 63extern int kmem_cache_shrink(kmem_cache_t *);
64extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); 64extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t);
65extern void kmem_cache_free(kmem_cache_t *, void *); 65extern void kmem_cache_free(kmem_cache_t *, void *);
66extern unsigned int kmem_cache_size(kmem_cache_t *); 66extern unsigned int kmem_cache_size(kmem_cache_t *);
67extern const char *kmem_cache_name(kmem_cache_t *); 67extern const char *kmem_cache_name(kmem_cache_t *);
68extern kmem_cache_t *kmem_find_general_cachep(size_t size, unsigned int __nocast gfpflags); 68extern kmem_cache_t *kmem_find_general_cachep(size_t size, gfp_t gfpflags);
69 69
70/* Size description struct for general caches. */ 70/* Size description struct for general caches. */
71struct cache_sizes { 71struct cache_sizes {
@@ -74,9 +74,9 @@ struct cache_sizes {
74 kmem_cache_t *cs_dmacachep; 74 kmem_cache_t *cs_dmacachep;
75}; 75};
76extern struct cache_sizes malloc_sizes[]; 76extern struct cache_sizes malloc_sizes[];
77extern void *__kmalloc(size_t, unsigned int __nocast); 77extern void *__kmalloc(size_t, gfp_t);
78 78
79static inline void *kmalloc(size_t size, unsigned int __nocast flags) 79static inline void *kmalloc(size_t size, gfp_t flags)
80{ 80{
81 if (__builtin_constant_p(size)) { 81 if (__builtin_constant_p(size)) {
82 int i = 0; 82 int i = 0;
@@ -99,7 +99,7 @@ found:
99 return __kmalloc(size, flags); 99 return __kmalloc(size, flags);
100} 100}
101 101
102extern void *kzalloc(size_t, unsigned int __nocast); 102extern void *kzalloc(size_t, gfp_t);
103 103
104/** 104/**
105 * kcalloc - allocate memory for an array. The memory is set to zero. 105 * kcalloc - allocate memory for an array. The memory is set to zero.
@@ -107,7 +107,7 @@ extern void *kzalloc(size_t, unsigned int __nocast);
107 * @size: element size. 107 * @size: element size.
108 * @flags: the type of memory to allocate. 108 * @flags: the type of memory to allocate.
109 */ 109 */
110static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast flags) 110static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
111{ 111{
112 if (n != 0 && size > INT_MAX / n) 112 if (n != 0 && size > INT_MAX / n)
113 return NULL; 113 return NULL;
@@ -118,15 +118,14 @@ extern void kfree(const void *);
118extern unsigned int ksize(const void *); 118extern unsigned int ksize(const void *);
119 119
120#ifdef CONFIG_NUMA 120#ifdef CONFIG_NUMA
121extern void *kmem_cache_alloc_node(kmem_cache_t *, 121extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node);
122 unsigned int __nocast flags, int node); 122extern void *kmalloc_node(size_t size, gfp_t flags, int node);
123extern void *kmalloc_node(size_t size, unsigned int __nocast flags, int node);
124#else 123#else
125static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) 124static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node)
126{ 125{
127 return kmem_cache_alloc(cachep, flags); 126 return kmem_cache_alloc(cachep, flags);
128} 127}
129static inline void *kmalloc_node(size_t size, unsigned int __nocast flags, int node) 128static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
130{ 129{
131 return kmalloc(size, flags); 130 return kmalloc(size, flags);
132} 131}
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index b63ce7014093..fa1ff3b165fe 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -2,11 +2,10 @@
2#define __LINUX_SMPLOCK_H 2#define __LINUX_SMPLOCK_H
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5#ifdef CONFIG_LOCK_KERNEL
5#include <linux/sched.h> 6#include <linux/sched.h>
6#include <linux/spinlock.h> 7#include <linux/spinlock.h>
7 8
8#ifdef CONFIG_LOCK_KERNEL
9
10#define kernel_locked() (current->lock_depth >= 0) 9#define kernel_locked() (current->lock_depth >= 0)
11 10
12extern int __lockfunc __reacquire_kernel_lock(void); 11extern int __lockfunc __reacquire_kernel_lock(void);
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index cdc99a27840d..0e9682c9def5 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -171,23 +171,42 @@ extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock);
171#define write_lock_irq(lock) _write_lock_irq(lock) 171#define write_lock_irq(lock) _write_lock_irq(lock)
172#define write_lock_bh(lock) _write_lock_bh(lock) 172#define write_lock_bh(lock) _write_lock_bh(lock)
173 173
174#define spin_unlock(lock) _spin_unlock(lock) 174/*
175#define write_unlock(lock) _write_unlock(lock) 175 * We inline the unlock functions in the nondebug case:
176#define read_unlock(lock) _read_unlock(lock) 176 */
177#if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP)
178# define spin_unlock(lock) _spin_unlock(lock)
179# define read_unlock(lock) _read_unlock(lock)
180# define write_unlock(lock) _write_unlock(lock)
181#else
182# define spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock)
183# define read_unlock(lock) __raw_read_unlock(&(lock)->raw_lock)
184# define write_unlock(lock) __raw_write_unlock(&(lock)->raw_lock)
185#endif
186
187#if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP)
188# define spin_unlock_irq(lock) _spin_unlock_irq(lock)
189# define read_unlock_irq(lock) _read_unlock_irq(lock)
190# define write_unlock_irq(lock) _write_unlock_irq(lock)
191#else
192# define spin_unlock_irq(lock) \
193 do { __raw_spin_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0)
194# define read_unlock_irq(lock) \
195 do { __raw_read_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0)
196# define write_unlock_irq(lock) \
197 do { __raw_write_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0)
198#endif
177 199
178#define spin_unlock_irqrestore(lock, flags) \ 200#define spin_unlock_irqrestore(lock, flags) \
179 _spin_unlock_irqrestore(lock, flags) 201 _spin_unlock_irqrestore(lock, flags)
180#define spin_unlock_irq(lock) _spin_unlock_irq(lock)
181#define spin_unlock_bh(lock) _spin_unlock_bh(lock) 202#define spin_unlock_bh(lock) _spin_unlock_bh(lock)
182 203
183#define read_unlock_irqrestore(lock, flags) \ 204#define read_unlock_irqrestore(lock, flags) \
184 _read_unlock_irqrestore(lock, flags) 205 _read_unlock_irqrestore(lock, flags)
185#define read_unlock_irq(lock) _read_unlock_irq(lock)
186#define read_unlock_bh(lock) _read_unlock_bh(lock) 206#define read_unlock_bh(lock) _read_unlock_bh(lock)
187 207
188#define write_unlock_irqrestore(lock, flags) \ 208#define write_unlock_irqrestore(lock, flags) \
189 _write_unlock_irqrestore(lock, flags) 209 _write_unlock_irqrestore(lock, flags)
190#define write_unlock_irq(lock) _write_unlock_irq(lock)
191#define write_unlock_bh(lock) _write_unlock_bh(lock) 210#define write_unlock_bh(lock) _write_unlock_bh(lock)
192 211
193#define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock)) 212#define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock))
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index e89b77b6505a..13a37f137ea2 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -21,8 +21,6 @@
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */ 22 */
23 23
24#include <linux/version.h>
25
26/*****************************************************************************/ 24/*****************************************************************************/
27#ifndef _STALLION_H 25#ifndef _STALLION_H
28#define _STALLION_H 26#define _STALLION_H
diff --git a/include/linux/string.h b/include/linux/string.h
index dab2652acbd8..369be3264a55 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -88,7 +88,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t);
88extern void * memchr(const void *,int,__kernel_size_t); 88extern void * memchr(const void *,int,__kernel_size_t);
89#endif 89#endif
90 90
91extern char *kstrdup(const char *s, unsigned int __nocast gfp); 91extern char *kstrdup(const char *s, gfp_t gfp);
92 92
93#ifdef __cplusplus 93#ifdef __cplusplus
94} 94}
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 04ebc24db348..b68c11a2d6dd 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -66,7 +66,12 @@ struct rpc_cred_cache {
66 66
67struct rpc_auth { 67struct rpc_auth {
68 unsigned int au_cslack; /* call cred size estimate */ 68 unsigned int au_cslack; /* call cred size estimate */
69 unsigned int au_rslack; /* reply verf size guess */ 69 /* guess at number of u32's auth adds before
70 * reply data; normally the verifier size: */
71 unsigned int au_rslack;
72 /* for gss, used to calculate au_rslack: */
73 unsigned int au_verfsize;
74
70 unsigned int au_flags; /* various flags */ 75 unsigned int au_flags; /* various flags */
71 struct rpc_authops * au_ops; /* operations */ 76 struct rpc_authops * au_ops; /* operations */
72 rpc_authflavor_t au_flavor; /* pseudoflavor (note may 77 rpc_authflavor_t au_flavor; /* pseudoflavor (note may
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index eadb31e3c198..1a42d902bc11 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -32,6 +32,7 @@
32#define RPCDBG_AUTH 0x0010 32#define RPCDBG_AUTH 0x0010
33#define RPCDBG_PMAP 0x0020 33#define RPCDBG_PMAP 0x0020
34#define RPCDBG_SCHED 0x0040 34#define RPCDBG_SCHED 0x0040
35#define RPCDBG_TRANS 0x0080
35#define RPCDBG_SVCSOCK 0x0100 36#define RPCDBG_SVCSOCK 0x0100
36#define RPCDBG_SVCDSP 0x0200 37#define RPCDBG_SVCDSP 0x0200
37#define RPCDBG_MISC 0x0400 38#define RPCDBG_MISC 0x0400
@@ -94,6 +95,8 @@ enum {
94 CTL_NLMDEBUG, 95 CTL_NLMDEBUG,
95 CTL_SLOTTABLE_UDP, 96 CTL_SLOTTABLE_UDP,
96 CTL_SLOTTABLE_TCP, 97 CTL_SLOTTABLE_TCP,
98 CTL_MIN_RESVPORT,
99 CTL_MAX_RESVPORT,
97}; 100};
98 101
99#endif /* _LINUX_SUNRPC_DEBUG_H_ */ 102#endif /* _LINUX_SUNRPC_DEBUG_H_ */
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 689262f63059..9b8bcf125c18 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -40,14 +40,21 @@ int gss_import_sec_context(
40 struct gss_ctx **ctx_id); 40 struct gss_ctx **ctx_id);
41u32 gss_get_mic( 41u32 gss_get_mic(
42 struct gss_ctx *ctx_id, 42 struct gss_ctx *ctx_id,
43 u32 qop,
44 struct xdr_buf *message, 43 struct xdr_buf *message,
45 struct xdr_netobj *mic_token); 44 struct xdr_netobj *mic_token);
46u32 gss_verify_mic( 45u32 gss_verify_mic(
47 struct gss_ctx *ctx_id, 46 struct gss_ctx *ctx_id,
48 struct xdr_buf *message, 47 struct xdr_buf *message,
49 struct xdr_netobj *mic_token, 48 struct xdr_netobj *mic_token);
50 u32 *qstate); 49u32 gss_wrap(
50 struct gss_ctx *ctx_id,
51 int offset,
52 struct xdr_buf *outbuf,
53 struct page **inpages);
54u32 gss_unwrap(
55 struct gss_ctx *ctx_id,
56 int offset,
57 struct xdr_buf *inbuf);
51u32 gss_delete_sec_context( 58u32 gss_delete_sec_context(
52 struct gss_ctx **ctx_id); 59 struct gss_ctx **ctx_id);
53 60
@@ -56,7 +63,6 @@ char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service);
56 63
57struct pf_desc { 64struct pf_desc {
58 u32 pseudoflavor; 65 u32 pseudoflavor;
59 u32 qop;
60 u32 service; 66 u32 service;
61 char *name; 67 char *name;
62 char *auth_domain_name; 68 char *auth_domain_name;
@@ -85,14 +91,21 @@ struct gss_api_ops {
85 struct gss_ctx *ctx_id); 91 struct gss_ctx *ctx_id);
86 u32 (*gss_get_mic)( 92 u32 (*gss_get_mic)(
87 struct gss_ctx *ctx_id, 93 struct gss_ctx *ctx_id,
88 u32 qop,
89 struct xdr_buf *message, 94 struct xdr_buf *message,
90 struct xdr_netobj *mic_token); 95 struct xdr_netobj *mic_token);
91 u32 (*gss_verify_mic)( 96 u32 (*gss_verify_mic)(
92 struct gss_ctx *ctx_id, 97 struct gss_ctx *ctx_id,
93 struct xdr_buf *message, 98 struct xdr_buf *message,
94 struct xdr_netobj *mic_token, 99 struct xdr_netobj *mic_token);
95 u32 *qstate); 100 u32 (*gss_wrap)(
101 struct gss_ctx *ctx_id,
102 int offset,
103 struct xdr_buf *outbuf,
104 struct page **inpages);
105 u32 (*gss_unwrap)(
106 struct gss_ctx *ctx_id,
107 int offset,
108 struct xdr_buf *buf);
96 void (*gss_delete_sec_context)( 109 void (*gss_delete_sec_context)(
97 void *internal_ctx_id); 110 void *internal_ctx_id);
98}; 111};
diff --git a/include/linux/sunrpc/gss_err.h b/include/linux/sunrpc/gss_err.h
index 92608a2e574c..a6807867bd21 100644
--- a/include/linux/sunrpc/gss_err.h
+++ b/include/linux/sunrpc/gss_err.h
@@ -66,16 +66,6 @@ typedef unsigned int OM_uint32;
66 66
67 67
68/* 68/*
69 * Define the default Quality of Protection for per-message services. Note
70 * that an implementation that offers multiple levels of QOP may either reserve
71 * a value (for example zero, as assumed here) to mean "default protection", or
72 * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
73 * QOP value. However a value of 0 should always be interpreted by a GSSAPI
74 * implementation as a request for the default protection level.
75 */
76#define GSS_C_QOP_DEFAULT 0
77
78/*
79 * Expiration time of 2^32-1 seconds means infinite lifetime for a 69 * Expiration time of 2^32-1 seconds means infinite lifetime for a
80 * credential or security context 70 * credential or security context
81 */ 71 */
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
index ffe31d2eb9ec..2c3601d31045 100644
--- a/include/linux/sunrpc/gss_krb5.h
+++ b/include/linux/sunrpc/gss_krb5.h
@@ -116,18 +116,22 @@ enum seal_alg {
116 116
117s32 117s32
118make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, 118make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
119 struct xdr_netobj *cksum); 119 int body_offset, struct xdr_netobj *cksum);
120
121u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *,
122 struct xdr_netobj *);
123
124u32 gss_verify_mic_kerberos(struct gss_ctx *, struct xdr_buf *,
125 struct xdr_netobj *);
120 126
121u32 127u32
122krb5_make_token(struct krb5_ctx *context_handle, int qop_req, 128gss_wrap_kerberos(struct gss_ctx *ctx_id, int offset,
123 struct xdr_buf *input_message_buffer, 129 struct xdr_buf *outbuf, struct page **pages);
124 struct xdr_netobj *output_message_buffer, int toktype);
125 130
126u32 131u32
127krb5_read_token(struct krb5_ctx *context_handle, 132gss_unwrap_kerberos(struct gss_ctx *ctx_id, int offset,
128 struct xdr_netobj *input_token_buffer, 133 struct xdr_buf *buf);
129 struct xdr_buf *message_buffer, 134
130 int *qop_state, int toktype);
131 135
132u32 136u32
133krb5_encrypt(struct crypto_tfm * key, 137krb5_encrypt(struct crypto_tfm * key,
@@ -137,6 +141,13 @@ u32
137krb5_decrypt(struct crypto_tfm * key, 141krb5_decrypt(struct crypto_tfm * key,
138 void *iv, void *in, void *out, int length); 142 void *iv, void *in, void *out, int length);
139 143
144int
145gss_encrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *outbuf, int offset,
146 struct page **pages);
147
148int
149gss_decrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *inbuf, int offset);
150
140s32 151s32
141krb5_make_seq_num(struct crypto_tfm * key, 152krb5_make_seq_num(struct crypto_tfm * key,
142 int direction, 153 int direction,
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h
index b5c9968c3c17..0beb2cf00a84 100644
--- a/include/linux/sunrpc/gss_spkm3.h
+++ b/include/linux/sunrpc/gss_spkm3.h
@@ -41,9 +41,9 @@ struct spkm3_ctx {
41#define SPKM_WRAP_TOK 5 41#define SPKM_WRAP_TOK 5
42#define SPKM_DEL_TOK 6 42#define SPKM_DEL_TOK 6
43 43
44u32 spkm3_make_token(struct spkm3_ctx *ctx, int qop_req, struct xdr_buf * text, struct xdr_netobj * token, int toktype); 44u32 spkm3_make_token(struct spkm3_ctx *ctx, struct xdr_buf * text, struct xdr_netobj * token, int toktype);
45 45
46u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int *qop_state, int toktype); 46u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int toktype);
47 47
48#define CKSUMTYPE_RSA_MD5 0x0007 48#define CKSUMTYPE_RSA_MD5 0x0007
49 49
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h
index 15f115332389..f43f237360ae 100644
--- a/include/linux/sunrpc/msg_prot.h
+++ b/include/linux/sunrpc/msg_prot.h
@@ -76,5 +76,30 @@ enum rpc_auth_stat {
76 76
77#define RPC_MAXNETNAMELEN 256 77#define RPC_MAXNETNAMELEN 256
78 78
79/*
80 * From RFC 1831:
81 *
82 * "A record is composed of one or more record fragments. A record
83 * fragment is a four-byte header followed by 0 to (2**31) - 1 bytes of
84 * fragment data. The bytes encode an unsigned binary number; as with
85 * XDR integers, the byte order is from highest to lowest. The number
86 * encodes two values -- a boolean which indicates whether the fragment
87 * is the last fragment of the record (bit value 1 implies the fragment
88 * is the last fragment) and a 31-bit unsigned binary value which is the
89 * length in bytes of the fragment's data. The boolean value is the
90 * highest-order bit of the header; the length is the 31 low-order bits.
91 * (Note that this record specification is NOT in XDR standard form!)"
92 *
93 * The Linux RPC client always sends its requests in a single record
94 * fragment, limiting the maximum payload size for stream transports to
95 * 2GB.
96 */
97
98typedef u32 rpc_fraghdr;
99
100#define RPC_LAST_STREAM_FRAGMENT (1U << 31)
101#define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT)
102#define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1)
103
79#endif /* __KERNEL__ */ 104#endif /* __KERNEL__ */
80#endif /* _LINUX_SUNRPC_MSGPROT_H_ */ 105#endif /* _LINUX_SUNRPC_MSGPROT_H_ */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 5af8800e0ce3..e4086ec8b952 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -171,7 +171,8 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p)
171{ 171{
172 char *cp = (char *)p; 172 char *cp = (char *)p;
173 struct kvec *vec = &rqstp->rq_arg.head[0]; 173 struct kvec *vec = &rqstp->rq_arg.head[0];
174 return cp - (char*)vec->iov_base <= vec->iov_len; 174 return cp >= (char*)vec->iov_base
175 && cp <= (char*)vec->iov_base + vec->iov_len;
175} 176}
176 177
177static inline int 178static inline int
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 23448d0fb5bc..5da968729cf8 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -161,14 +161,10 @@ typedef struct {
161 161
162typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); 162typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len);
163 163
164extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *);
164extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, 165extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int,
165 skb_reader_t *, skb_read_actor_t); 166 skb_reader_t *, skb_read_actor_t);
166 167
167struct socket;
168struct sockaddr;
169extern int xdr_sendpages(struct socket *, struct sockaddr *, int,
170 struct xdr_buf *, unsigned int, int);
171
172extern int xdr_encode_word(struct xdr_buf *, int, u32); 168extern int xdr_encode_word(struct xdr_buf *, int, u32);
173extern int xdr_decode_word(struct xdr_buf *, int, u32 *); 169extern int xdr_decode_word(struct xdr_buf *, int, u32 *);
174 170
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index e618c1649814..3b8b6e823c70 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/include/linux/sunrpc/clnt_xprt.h 2 * linux/include/linux/sunrpc/xprt.h
3 * 3 *
4 * Declarations for the RPC transport interface. 4 * Declarations for the RPC transport interface.
5 * 5 *
@@ -15,20 +15,6 @@
15#include <linux/sunrpc/sched.h> 15#include <linux/sunrpc/sched.h>
16#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
17 17
18/*
19 * The transport code maintains an estimate on the maximum number of out-
20 * standing RPC requests, using a smoothed version of the congestion
21 * avoidance implemented in 44BSD. This is basically the Van Jacobson
22 * congestion algorithm: If a retransmit occurs, the congestion window is
23 * halved; otherwise, it is incremented by 1/cwnd when
24 *
25 * - a reply is received and
26 * - a full number of requests are outstanding and
27 * - the congestion window hasn't been updated recently.
28 *
29 * Upper procedures may check whether a request would block waiting for
30 * a free RPC slot by using the RPC_CONGESTED() macro.
31 */
32extern unsigned int xprt_udp_slot_table_entries; 18extern unsigned int xprt_udp_slot_table_entries;
33extern unsigned int xprt_tcp_slot_table_entries; 19extern unsigned int xprt_tcp_slot_table_entries;
34 20
@@ -36,34 +22,23 @@ extern unsigned int xprt_tcp_slot_table_entries;
36#define RPC_DEF_SLOT_TABLE (16U) 22#define RPC_DEF_SLOT_TABLE (16U)
37#define RPC_MAX_SLOT_TABLE (128U) 23#define RPC_MAX_SLOT_TABLE (128U)
38 24
39#define RPC_CWNDSHIFT (8U)
40#define RPC_CWNDSCALE (1U << RPC_CWNDSHIFT)
41#define RPC_INITCWND RPC_CWNDSCALE
42#define RPC_MAXCWND(xprt) ((xprt)->max_reqs << RPC_CWNDSHIFT)
43#define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd)
44
45/* Default timeout values */
46#define RPC_MAX_UDP_TIMEOUT (60*HZ)
47#define RPC_MAX_TCP_TIMEOUT (600*HZ)
48
49/* 25/*
50 * Wait duration for an RPC TCP connection to be established. Solaris 26 * RPC call and reply header size as number of 32bit words (verifier
51 * NFS over TCP uses 60 seconds, for example, which is in line with how 27 * size computed separately)
52 * long a server takes to reboot.
53 */ 28 */
54#define RPC_CONNECT_TIMEOUT (60*HZ) 29#define RPC_CALLHDRSIZE 6
30#define RPC_REPHDRSIZE 4
55 31
56/* 32/*
57 * Delay an arbitrary number of seconds before attempting to reconnect 33 * Parameters for choosing a free port
58 * after an error.
59 */ 34 */
60#define RPC_REESTABLISH_TIMEOUT (15*HZ) 35extern unsigned int xprt_min_resvport;
36extern unsigned int xprt_max_resvport;
61 37
62/* RPC call and reply header size as number of 32bit words (verifier 38#define RPC_MIN_RESVPORT (1U)
63 * size computed separately) 39#define RPC_MAX_RESVPORT (65535U)
64 */ 40#define RPC_DEF_MIN_RESVPORT (650U)
65#define RPC_CALLHDRSIZE 6 41#define RPC_DEF_MAX_RESVPORT (1023U)
66#define RPC_REPHDRSIZE 4
67 42
68/* 43/*
69 * This describes a timeout strategy 44 * This describes a timeout strategy
@@ -76,6 +51,9 @@ struct rpc_timeout {
76 unsigned char to_exponential; 51 unsigned char to_exponential;
77}; 52};
78 53
54struct rpc_task;
55struct rpc_xprt;
56
79/* 57/*
80 * This describes a complete RPC request 58 * This describes a complete RPC request
81 */ 59 */
@@ -95,7 +73,10 @@ struct rpc_rqst {
95 int rq_cong; /* has incremented xprt->cong */ 73 int rq_cong; /* has incremented xprt->cong */
96 int rq_received; /* receive completed */ 74 int rq_received; /* receive completed */
97 u32 rq_seqno; /* gss seq no. used on req. */ 75 u32 rq_seqno; /* gss seq no. used on req. */
98 76 int rq_enc_pages_num;
77 struct page **rq_enc_pages; /* scratch pages for use by
78 gss privacy code */
79 void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */
99 struct list_head rq_list; 80 struct list_head rq_list;
100 81
101 struct xdr_buf rq_private_buf; /* The receive buffer 82 struct xdr_buf rq_private_buf; /* The receive buffer
@@ -121,12 +102,21 @@ struct rpc_rqst {
121#define rq_svec rq_snd_buf.head 102#define rq_svec rq_snd_buf.head
122#define rq_slen rq_snd_buf.len 103#define rq_slen rq_snd_buf.len
123 104
124#define XPRT_LAST_FRAG (1 << 0) 105struct rpc_xprt_ops {
125#define XPRT_COPY_RECM (1 << 1) 106 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
126#define XPRT_COPY_XID (1 << 2) 107 int (*reserve_xprt)(struct rpc_task *task);
127#define XPRT_COPY_DATA (1 << 3) 108 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
109 void (*connect)(struct rpc_task *task);
110 int (*send_request)(struct rpc_task *task);
111 void (*set_retrans_timeout)(struct rpc_task *task);
112 void (*timer)(struct rpc_task *task);
113 void (*release_request)(struct rpc_task *task);
114 void (*close)(struct rpc_xprt *xprt);
115 void (*destroy)(struct rpc_xprt *xprt);
116};
128 117
129struct rpc_xprt { 118struct rpc_xprt {
119 struct rpc_xprt_ops * ops; /* transport methods */
130 struct socket * sock; /* BSD socket layer */ 120 struct socket * sock; /* BSD socket layer */
131 struct sock * inet; /* INET layer */ 121 struct sock * inet; /* INET layer */
132 122
@@ -137,11 +127,13 @@ struct rpc_xprt {
137 unsigned long cong; /* current congestion */ 127 unsigned long cong; /* current congestion */
138 unsigned long cwnd; /* congestion window */ 128 unsigned long cwnd; /* congestion window */
139 129
140 unsigned int rcvsize, /* socket receive buffer size */ 130 size_t rcvsize, /* transport rcv buffer size */
141 sndsize; /* socket send buffer size */ 131 sndsize; /* transport send buffer size */
142 132
143 size_t max_payload; /* largest RPC payload size, 133 size_t max_payload; /* largest RPC payload size,
144 in bytes */ 134 in bytes */
135 unsigned int tsh_size; /* size of transport specific
136 header */
145 137
146 struct rpc_wait_queue sending; /* requests waiting to send */ 138 struct rpc_wait_queue sending; /* requests waiting to send */
147 struct rpc_wait_queue resend; /* requests waiting to resend */ 139 struct rpc_wait_queue resend; /* requests waiting to resend */
@@ -150,11 +142,9 @@ struct rpc_xprt {
150 struct list_head free; /* free slots */ 142 struct list_head free; /* free slots */
151 struct rpc_rqst * slot; /* slot table storage */ 143 struct rpc_rqst * slot; /* slot table storage */
152 unsigned int max_reqs; /* total slots */ 144 unsigned int max_reqs; /* total slots */
153 unsigned long sockstate; /* Socket state */ 145 unsigned long state; /* transport state */
154 unsigned char shutdown : 1, /* being shut down */ 146 unsigned char shutdown : 1, /* being shut down */
155 nocong : 1, /* no congestion control */ 147 resvport : 1; /* use a reserved port */
156 resvport : 1, /* use a reserved port */
157 stream : 1; /* TCP */
158 148
159 /* 149 /*
160 * XID 150 * XID
@@ -171,22 +161,27 @@ struct rpc_xprt {
171 unsigned long tcp_copied, /* copied to request */ 161 unsigned long tcp_copied, /* copied to request */
172 tcp_flags; 162 tcp_flags;
173 /* 163 /*
174 * Connection of sockets 164 * Connection of transports
175 */ 165 */
176 struct work_struct sock_connect; 166 unsigned long connect_timeout,
167 bind_timeout,
168 reestablish_timeout;
169 struct work_struct connect_worker;
177 unsigned short port; 170 unsigned short port;
171
178 /* 172 /*
179 * Disconnection of idle sockets 173 * Disconnection of idle transports
180 */ 174 */
181 struct work_struct task_cleanup; 175 struct work_struct task_cleanup;
182 struct timer_list timer; 176 struct timer_list timer;
183 unsigned long last_used; 177 unsigned long last_used,
178 idle_timeout;
184 179
185 /* 180 /*
186 * Send stuff 181 * Send stuff
187 */ 182 */
188 spinlock_t sock_lock; /* lock socket info */ 183 spinlock_t transport_lock; /* lock transport info */
189 spinlock_t xprt_lock; /* lock xprt info */ 184 spinlock_t reserve_lock; /* lock slot table */
190 struct rpc_task * snd_task; /* Task blocked in send */ 185 struct rpc_task * snd_task; /* Task blocked in send */
191 186
192 struct list_head recv; 187 struct list_head recv;
@@ -195,37 +190,111 @@ struct rpc_xprt {
195 void (*old_data_ready)(struct sock *, int); 190 void (*old_data_ready)(struct sock *, int);
196 void (*old_state_change)(struct sock *); 191 void (*old_state_change)(struct sock *);
197 void (*old_write_space)(struct sock *); 192 void (*old_write_space)(struct sock *);
198
199 wait_queue_head_t cong_wait;
200}; 193};
201 194
195#define XPRT_LAST_FRAG (1 << 0)
196#define XPRT_COPY_RECM (1 << 1)
197#define XPRT_COPY_XID (1 << 2)
198#define XPRT_COPY_DATA (1 << 3)
199
202#ifdef __KERNEL__ 200#ifdef __KERNEL__
203 201
204struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, 202/*
205 struct rpc_timeout *toparms); 203 * Transport operations used by ULPs
206int xprt_destroy(struct rpc_xprt *); 204 */
207void xprt_set_timeout(struct rpc_timeout *, unsigned int, 205struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, struct rpc_timeout *to);
208 unsigned long); 206void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long incr);
209 207
210void xprt_reserve(struct rpc_task *); 208/*
211int xprt_prepare_transmit(struct rpc_task *); 209 * Generic internal transport functions
212void xprt_transmit(struct rpc_task *); 210 */
213void xprt_receive(struct rpc_task *); 211void xprt_connect(struct rpc_task *task);
212void xprt_reserve(struct rpc_task *task);
213int xprt_reserve_xprt(struct rpc_task *task);
214int xprt_reserve_xprt_cong(struct rpc_task *task);
215int xprt_prepare_transmit(struct rpc_task *task);
216void xprt_transmit(struct rpc_task *task);
217void xprt_abort_transmit(struct rpc_task *task);
214int xprt_adjust_timeout(struct rpc_rqst *req); 218int xprt_adjust_timeout(struct rpc_rqst *req);
215void xprt_release(struct rpc_task *); 219void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
216void xprt_connect(struct rpc_task *); 220void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
217void xprt_sock_setbufsize(struct rpc_xprt *); 221void xprt_release(struct rpc_task *task);
218 222int xprt_destroy(struct rpc_xprt *xprt);
219#define XPRT_LOCKED 0 223
220#define XPRT_CONNECT 1 224static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p)
221#define XPRT_CONNECTING 2 225{
222 226 return p + xprt->tsh_size;
223#define xprt_connected(xp) (test_bit(XPRT_CONNECT, &(xp)->sockstate)) 227}
224#define xprt_set_connected(xp) (set_bit(XPRT_CONNECT, &(xp)->sockstate)) 228
225#define xprt_test_and_set_connected(xp) (test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate)) 229/*
226#define xprt_test_and_clear_connected(xp) \ 230 * Transport switch helper functions
227 (test_and_clear_bit(XPRT_CONNECT, &(xp)->sockstate)) 231 */
228#define xprt_clear_connected(xp) (clear_bit(XPRT_CONNECT, &(xp)->sockstate)) 232void xprt_set_retrans_timeout_def(struct rpc_task *task);
233void xprt_set_retrans_timeout_rtt(struct rpc_task *task);
234void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status);
235void xprt_wait_for_buffer_space(struct rpc_task *task);
236void xprt_write_space(struct rpc_xprt *xprt);
237void xprt_update_rtt(struct rpc_task *task);
238void xprt_adjust_cwnd(struct rpc_task *task, int result);
239struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid);
240void xprt_complete_rqst(struct rpc_task *task, int copied);
241void xprt_release_rqst_cong(struct rpc_task *task);
242void xprt_disconnect(struct rpc_xprt *xprt);
243
244/*
245 * Socket transport setup operations
246 */
247int xs_setup_udp(struct rpc_xprt *xprt, struct rpc_timeout *to);
248int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to);
249
250/*
251 * Reserved bit positions in xprt->state
252 */
253#define XPRT_LOCKED (0)
254#define XPRT_CONNECTED (1)
255#define XPRT_CONNECTING (2)
256
257static inline void xprt_set_connected(struct rpc_xprt *xprt)
258{
259 set_bit(XPRT_CONNECTED, &xprt->state);
260}
261
262static inline void xprt_clear_connected(struct rpc_xprt *xprt)
263{
264 clear_bit(XPRT_CONNECTED, &xprt->state);
265}
266
267static inline int xprt_connected(struct rpc_xprt *xprt)
268{
269 return test_bit(XPRT_CONNECTED, &xprt->state);
270}
271
272static inline int xprt_test_and_set_connected(struct rpc_xprt *xprt)
273{
274 return test_and_set_bit(XPRT_CONNECTED, &xprt->state);
275}
276
277static inline int xprt_test_and_clear_connected(struct rpc_xprt *xprt)
278{
279 return test_and_clear_bit(XPRT_CONNECTED, &xprt->state);
280}
281
282static inline void xprt_clear_connecting(struct rpc_xprt *xprt)
283{
284 smp_mb__before_clear_bit();
285 clear_bit(XPRT_CONNECTING, &xprt->state);
286 smp_mb__after_clear_bit();
287}
288
289static inline int xprt_connecting(struct rpc_xprt *xprt)
290{
291 return test_bit(XPRT_CONNECTING, &xprt->state);
292}
293
294static inline int xprt_test_and_set_connecting(struct rpc_xprt *xprt)
295{
296 return test_and_set_bit(XPRT_CONNECTING, &xprt->state);
297}
229 298
230#endif /* __KERNEL__*/ 299#endif /* __KERNEL__*/
231 300
diff --git a/include/linux/superhyway.h b/include/linux/superhyway.h
index c906c5a0aaef..17ea468fa362 100644
--- a/include/linux/superhyway.h
+++ b/include/linux/superhyway.h
@@ -19,7 +19,7 @@
19 */ 19 */
20#define SUPERHYWAY_DEVICE_ID_SH5_DMAC 0x0183 20#define SUPERHYWAY_DEVICE_ID_SH5_DMAC 0x0183
21 21
22struct vcr_info { 22struct superhyway_vcr_info {
23 u8 perr_flags; /* P-port Error flags */ 23 u8 perr_flags; /* P-port Error flags */
24 u8 merr_flags; /* Module Error flags */ 24 u8 merr_flags; /* Module Error flags */
25 u16 mod_vers; /* Module Version */ 25 u16 mod_vers; /* Module Version */
@@ -28,6 +28,17 @@ struct vcr_info {
28 u8 top_mb; /* Top Memory block */ 28 u8 top_mb; /* Top Memory block */
29}; 29};
30 30
31struct superhyway_ops {
32 int (*read_vcr)(unsigned long base, struct superhyway_vcr_info *vcr);
33 int (*write_vcr)(unsigned long base, struct superhyway_vcr_info vcr);
34};
35
36struct superhyway_bus {
37 struct superhyway_ops *ops;
38};
39
40extern struct superhyway_bus superhyway_channels[];
41
31struct superhyway_device_id { 42struct superhyway_device_id {
32 unsigned int id; 43 unsigned int id;
33 unsigned long driver_data; 44 unsigned long driver_data;
@@ -55,9 +66,11 @@ struct superhyway_device {
55 66
56 struct superhyway_device_id id; 67 struct superhyway_device_id id;
57 struct superhyway_driver *drv; 68 struct superhyway_driver *drv;
69 struct superhyway_bus *bus;
58 70
59 struct resource resource; 71 int num_resources;
60 struct vcr_info vcr; 72 struct resource *resource;
73 struct superhyway_vcr_info vcr;
61}; 74};
62 75
63#define to_superhyway_device(d) container_of((d), struct superhyway_device, dev) 76#define to_superhyway_device(d) container_of((d), struct superhyway_device, dev)
@@ -65,12 +78,27 @@ struct superhyway_device {
65#define superhyway_get_drvdata(d) dev_get_drvdata(&(d)->dev) 78#define superhyway_get_drvdata(d) dev_get_drvdata(&(d)->dev)
66#define superhyway_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) 79#define superhyway_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p))
67 80
68extern int superhyway_scan_bus(void); 81static inline int
82superhyway_read_vcr(struct superhyway_device *dev, unsigned long base,
83 struct superhyway_vcr_info *vcr)
84{
85 return dev->bus->ops->read_vcr(base, vcr);
86}
87
88static inline int
89superhyway_write_vcr(struct superhyway_device *dev, unsigned long base,
90 struct superhyway_vcr_info vcr)
91{
92 return dev->bus->ops->write_vcr(base, vcr);
93}
94
95extern int superhyway_scan_bus(struct superhyway_bus *);
69 96
70/* drivers/sh/superhyway/superhyway.c */ 97/* drivers/sh/superhyway/superhyway.c */
71int superhyway_register_driver(struct superhyway_driver *); 98int superhyway_register_driver(struct superhyway_driver *);
72void superhyway_unregister_driver(struct superhyway_driver *); 99void superhyway_unregister_driver(struct superhyway_driver *);
73int superhyway_add_device(unsigned int, unsigned long, unsigned long long); 100int superhyway_add_device(unsigned long base, struct superhyway_device *, struct superhyway_bus *);
101int superhyway_add_devices(struct superhyway_bus *bus, struct superhyway_device **devices, int nr_devices);
74 102
75/* drivers/sh/superhyway/superhyway-sysfs.c */ 103/* drivers/sh/superhyway/superhyway-sysfs.c */
76extern struct device_attribute superhyway_dev_attrs[]; 104extern struct device_attribute superhyway_dev_attrs[];
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index f2e96fdfaae0..a61c04f804b2 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -71,5 +71,12 @@ void restore_processor_state(void);
71struct saved_context; 71struct saved_context;
72void __save_processor_state(struct saved_context *ctxt); 72void __save_processor_state(struct saved_context *ctxt);
73void __restore_processor_state(struct saved_context *ctxt); 73void __restore_processor_state(struct saved_context *ctxt);
74unsigned long get_safe_page(gfp_t gfp_mask);
75
76/*
77 * XXX: We try to keep some more pages free so that I/O operations succeed
78 * without paging. Might this be more?
79 */
80#define PAGES_FOR_IO 512
74 81
75#endif /* _LINUX_SWSUSP_H */ 82#endif /* _LINUX_SWSUSP_H */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 3c9ff0048153..508668f840b6 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -147,7 +147,7 @@ struct swap_list_t {
147#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) 147#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
148 148
149/* linux/mm/oom_kill.c */ 149/* linux/mm/oom_kill.c */
150extern void out_of_memory(unsigned int __nocast gfp_mask, int order); 150extern void out_of_memory(gfp_t gfp_mask, int order);
151 151
152/* linux/mm/memory.c */ 152/* linux/mm/memory.c */
153extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); 153extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
@@ -171,8 +171,8 @@ extern int rotate_reclaimable_page(struct page *page);
171extern void swap_setup(void); 171extern void swap_setup(void);
172 172
173/* linux/mm/vmscan.c */ 173/* linux/mm/vmscan.c */
174extern int try_to_free_pages(struct zone **, unsigned int); 174extern int try_to_free_pages(struct zone **, gfp_t);
175extern int zone_reclaim(struct zone *, unsigned int, unsigned int); 175extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
176extern int shrink_all_memory(int); 176extern int shrink_all_memory(int);
177extern int vm_swappiness; 177extern int vm_swappiness;
178 178
@@ -239,6 +239,11 @@ static inline void put_swap_token(struct mm_struct *mm)
239 __put_swap_token(mm); 239 __put_swap_token(mm);
240} 240}
241 241
242static inline void disable_swap_token(void)
243{
244 put_swap_token(swap_token_mm);
245}
246
242#else /* CONFIG_SWAP */ 247#else /* CONFIG_SWAP */
243 248
244#define total_swap_pages 0 249#define total_swap_pages 0
@@ -283,6 +288,7 @@ static inline swp_entry_t get_swap_page(void)
283#define put_swap_token(x) do { } while(0) 288#define put_swap_token(x) do { } while(0)
284#define grab_swap_token() do { } while(0) 289#define grab_swap_token() do { } while(0)
285#define has_swap_token(x) 0 290#define has_swap_token(x) 0
291#define disable_swap_token() do { } while(0)
286 292
287#endif /* CONFIG_SWAP */ 293#endif /* CONFIG_SWAP */
288#endif /* __KERNEL__*/ 294#endif /* __KERNEL__*/
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index a6f03e473737..c7007b1db91d 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -491,6 +491,7 @@ asmlinkage long sys_nfsservctl(int cmd,
491asmlinkage long sys_syslog(int type, char __user *buf, int len); 491asmlinkage long sys_syslog(int type, char __user *buf, int len);
492asmlinkage long sys_uselib(const char __user *library); 492asmlinkage long sys_uselib(const char __user *library);
493asmlinkage long sys_ni_syscall(void); 493asmlinkage long sys_ni_syscall(void);
494asmlinkage long sys_ptrace(long request, long pid, long addr, long data);
494 495
495asmlinkage long sys_add_key(const char __user *_type, 496asmlinkage long sys_add_key(const char __user *_type,
496 const char __user *_description, 497 const char __user *_description,
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 3a29a9f9b451..6bc03c911a83 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -20,10 +20,10 @@
20 20
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/list.h>
24#include <linux/compiler.h> 23#include <linux/compiler.h>
25 24
26struct file; 25struct file;
26struct completion;
27 27
28#define CTL_MAXNAME 10 /* how many path components do we allow in a 28#define CTL_MAXNAME 10 /* how many path components do we allow in a
29 call to sysctl? In other words, what is 29 call to sysctl? In other words, what is
@@ -202,7 +202,9 @@ enum
202 NET_TR=14, 202 NET_TR=14,
203 NET_DECNET=15, 203 NET_DECNET=15,
204 NET_ECONET=16, 204 NET_ECONET=16,
205 NET_SCTP=17, 205 NET_SCTP=17,
206 NET_LLC=18,
207 NET_NETFILTER=19,
206}; 208};
207 209
208/* /proc/sys/kernel/random */ 210/* /proc/sys/kernel/random */
@@ -268,6 +270,42 @@ enum
268 NET_UNIX_MAX_DGRAM_QLEN=3, 270 NET_UNIX_MAX_DGRAM_QLEN=3,
269}; 271};
270 272
273/* /proc/sys/net/netfilter */
274enum
275{
276 NET_NF_CONNTRACK_MAX=1,
277 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
278 NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
279 NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
280 NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
281 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
282 NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
283 NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
284 NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
285 NET_NF_CONNTRACK_UDP_TIMEOUT=10,
286 NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
287 NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
288 NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
289 NET_NF_CONNTRACK_BUCKETS=14,
290 NET_NF_CONNTRACK_LOG_INVALID=15,
291 NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
292 NET_NF_CONNTRACK_TCP_LOOSE=17,
293 NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
294 NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
295 NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
296 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
297 NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
298 NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
299 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
300 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
301 NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
302 NET_NF_CONNTRACK_COUNT=27,
303 NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
304 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
305 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
306 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
307};
308
271/* /proc/sys/net/ipv4 */ 309/* /proc/sys/net/ipv4 */
272enum 310enum
273{ 311{
@@ -351,6 +389,7 @@ enum
351 NET_TCP_BIC_BETA=108, 389 NET_TCP_BIC_BETA=108,
352 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, 390 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
353 NET_TCP_CONG_CONTROL=110, 391 NET_TCP_CONG_CONTROL=110,
392 NET_TCP_ABC=111,
354}; 393};
355 394
356enum { 395enum {
@@ -522,6 +561,29 @@ enum {
522 NET_IPX_FORWARDING=2 561 NET_IPX_FORWARDING=2
523}; 562};
524 563
564/* /proc/sys/net/llc */
565enum {
566 NET_LLC2=1,
567 NET_LLC_STATION=2,
568};
569
570/* /proc/sys/net/llc/llc2 */
571enum {
572 NET_LLC2_TIMEOUT=1,
573};
574
575/* /proc/sys/net/llc/station */
576enum {
577 NET_LLC_STATION_ACK_TIMEOUT=1,
578};
579
580/* /proc/sys/net/llc/llc2/timeout */
581enum {
582 NET_LLC2_ACK_TIMEOUT=1,
583 NET_LLC2_P_TIMEOUT=2,
584 NET_LLC2_REJ_TIMEOUT=3,
585 NET_LLC2_BUSY_TIMEOUT=4,
586};
525 587
526/* /proc/sys/net/appletalk */ 588/* /proc/sys/net/appletalk */
527enum { 589enum {
@@ -652,6 +714,7 @@ enum {
652 NET_SCTP_PRSCTP_ENABLE = 14, 714 NET_SCTP_PRSCTP_ENABLE = 14,
653 NET_SCTP_SNDBUF_POLICY = 15, 715 NET_SCTP_SNDBUF_POLICY = 15,
654 NET_SCTP_SACK_TIMEOUT = 16, 716 NET_SCTP_SACK_TIMEOUT = 16,
717 NET_SCTP_RCVBUF_POLICY = 17,
655}; 718};
656 719
657/* /proc/sys/net/bridge */ 720/* /proc/sys/net/bridge */
@@ -795,6 +858,7 @@ enum
795}; 858};
796 859
797#ifdef __KERNEL__ 860#ifdef __KERNEL__
861#include <linux/list.h>
798 862
799extern void sysctl_init(void); 863extern void sysctl_init(void);
800 864
@@ -901,6 +965,8 @@ struct ctl_table_header
901{ 965{
902 ctl_table *ctl_table; 966 ctl_table *ctl_table;
903 struct list_head ctl_entry; 967 struct list_head ctl_entry;
968 int used;
969 struct completion *unregistering;
904}; 970};
905 971
906struct ctl_table_header * register_sysctl_table(ctl_table * table, 972struct ctl_table_header * register_sysctl_table(ctl_table * table,
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index 081b1ee8516e..e21937cf91d0 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -71,7 +71,7 @@ enum
71 TCF_META_ID_SK_SNDBUF, 71 TCF_META_ID_SK_SNDBUF,
72 TCF_META_ID_SK_ALLOCS, 72 TCF_META_ID_SK_ALLOCS,
73 TCF_META_ID_SK_ROUTE_CAPS, 73 TCF_META_ID_SK_ROUTE_CAPS,
74 TCF_META_ID_SK_HASHENT, 74 TCF_META_ID_SK_HASH,
75 TCF_META_ID_SK_LINGERTIME, 75 TCF_META_ID_SK_LINGERTIME,
76 TCF_META_ID_SK_ACK_BACKLOG, 76 TCF_META_ID_SK_ACK_BACKLOG,
77 TCF_META_ID_SK_MAX_ACK_BACKLOG, 77 TCF_META_ID_SK_MAX_ACK_BACKLOG,
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index ac4ca44c75ca..0e1da6602e05 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -307,6 +307,21 @@ struct tcp_sock {
307 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 307 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
308 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ 308 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
309 309
310 struct tcp_sack_block recv_sack_cache[4];
311
312 /* from STCP, retrans queue hinting */
313 struct sk_buff* lost_skb_hint;
314
315 struct sk_buff *scoreboard_skb_hint;
316 struct sk_buff *retransmit_skb_hint;
317 struct sk_buff *forward_skb_hint;
318 struct sk_buff *fastpath_skb_hint;
319
320 int fastpath_cnt_hint;
321 int lost_cnt_hint;
322 int retransmit_cnt_hint;
323 int forward_cnt_hint;
324
310 __u16 advmss; /* Advertised MSS */ 325 __u16 advmss; /* Advertised MSS */
311 __u16 prior_ssthresh; /* ssthresh saved at recovery start */ 326 __u16 prior_ssthresh; /* ssthresh saved at recovery start */
312 __u32 lost_out; /* Lost packets */ 327 __u32 lost_out; /* Lost packets */
@@ -326,6 +341,7 @@ struct tcp_sock {
326 __u32 snd_up; /* Urgent pointer */ 341 __u32 snd_up; /* Urgent pointer */
327 342
328 __u32 total_retrans; /* Total retransmits for entire connection */ 343 __u32 total_retrans; /* Total retransmits for entire connection */
344 __u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */
329 345
330 unsigned int keepalive_time; /* time before keep alive takes place */ 346 unsigned int keepalive_time; /* time before keep alive takes place */
331 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 347 unsigned int keepalive_intvl; /* time interval between keep alive probes */
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index 941f45ac117a..7dac8f04d28e 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -8,6 +8,7 @@
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/err.h> 10#include <linux/err.h>
11#include <linux/slab.h>
11 12
12struct ts_config; 13struct ts_config;
13 14
@@ -40,7 +41,7 @@ struct ts_state
40struct ts_ops 41struct ts_ops
41{ 42{
42 const char *name; 43 const char *name;
43 struct ts_config * (*init)(const void *, unsigned int, int); 44 struct ts_config * (*init)(const void *, unsigned int, gfp_t);
44 unsigned int (*find)(struct ts_config *, 45 unsigned int (*find)(struct ts_config *,
45 struct ts_state *); 46 struct ts_state *);
46 void (*destroy)(struct ts_config *); 47 void (*destroy)(struct ts_config *);
@@ -148,7 +149,7 @@ static inline unsigned int textsearch_get_pattern_len(struct ts_config *conf)
148extern int textsearch_register(struct ts_ops *); 149extern int textsearch_register(struct ts_ops *);
149extern int textsearch_unregister(struct ts_ops *); 150extern int textsearch_unregister(struct ts_ops *);
150extern struct ts_config *textsearch_prepare(const char *, const void *, 151extern struct ts_config *textsearch_prepare(const char *, const void *,
151 unsigned int, int, int); 152 unsigned int, gfp_t, int);
152extern void textsearch_destroy(struct ts_config *conf); 153extern void textsearch_destroy(struct ts_config *conf);
153extern unsigned int textsearch_find_continuous(struct ts_config *, 154extern unsigned int textsearch_find_continuous(struct ts_config *,
154 struct ts_state *, 155 struct ts_state *,
@@ -158,7 +159,8 @@ extern unsigned int textsearch_find_continuous(struct ts_config *,
158#define TS_PRIV_ALIGNTO 8 159#define TS_PRIV_ALIGNTO 8
159#define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1)) 160#define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1))
160 161
161static inline struct ts_config *alloc_ts_config(size_t payload, int gfp_mask) 162static inline struct ts_config *alloc_ts_config(size_t payload,
163 gfp_t gfp_mask)
162{ 164{
163 struct ts_config *conf; 165 struct ts_config *conf;
164 166
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index d252f45a0f9b..1c4eb41dbd89 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -27,31 +27,6 @@ extern long do_no_restart_syscall(struct restart_block *parm);
27 * - pass TIF_xxxx constants to these functions 27 * - pass TIF_xxxx constants to these functions
28 */ 28 */
29 29
30static inline void set_thread_flag(int flag)
31{
32 set_bit(flag,&current_thread_info()->flags);
33}
34
35static inline void clear_thread_flag(int flag)
36{
37 clear_bit(flag,&current_thread_info()->flags);
38}
39
40static inline int test_and_set_thread_flag(int flag)
41{
42 return test_and_set_bit(flag,&current_thread_info()->flags);
43}
44
45static inline int test_and_clear_thread_flag(int flag)
46{
47 return test_and_clear_bit(flag,&current_thread_info()->flags);
48}
49
50static inline int test_thread_flag(int flag)
51{
52 return test_bit(flag,&current_thread_info()->flags);
53}
54
55static inline void set_ti_thread_flag(struct thread_info *ti, int flag) 30static inline void set_ti_thread_flag(struct thread_info *ti, int flag)
56{ 31{
57 set_bit(flag,&ti->flags); 32 set_bit(flag,&ti->flags);
@@ -77,15 +52,19 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
77 return test_bit(flag,&ti->flags); 52 return test_bit(flag,&ti->flags);
78} 53}
79 54
80static inline void set_need_resched(void) 55#define set_thread_flag(flag) \
81{ 56 set_ti_thread_flag(current_thread_info(), flag)
82 set_thread_flag(TIF_NEED_RESCHED); 57#define clear_thread_flag(flag) \
83} 58 clear_ti_thread_flag(current_thread_info(), flag)
84 59#define test_and_set_thread_flag(flag) \
85static inline void clear_need_resched(void) 60 test_and_set_ti_thread_flag(current_thread_info(), flag)
86{ 61#define test_and_clear_thread_flag(flag) \
87 clear_thread_flag(TIF_NEED_RESCHED); 62 test_and_clear_ti_thread_flag(current_thread_info(), flag)
88} 63#define test_thread_flag(flag) \
64 test_ti_thread_flag(current_thread_info(), flag)
65
66#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED)
67#define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED)
89 68
90#endif 69#endif
91 70
diff --git a/include/linux/time.h b/include/linux/time.h
index 8e83f4e778bb..bfbe92d0767c 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -101,7 +101,7 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
101static inline void 101static inline void
102set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) 102set_normalized_timespec (struct timespec *ts, time_t sec, long nsec)
103{ 103{
104 while (nsec > NSEC_PER_SEC) { 104 while (nsec >= NSEC_PER_SEC) {
105 nsec -= NSEC_PER_SEC; 105 nsec -= NSEC_PER_SEC;
106 ++sec; 106 ++sec;
107 } 107 }
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 3340f3bd135d..72f3a7781106 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -12,16 +12,12 @@ struct timer_list {
12 struct list_head entry; 12 struct list_head entry;
13 unsigned long expires; 13 unsigned long expires;
14 14
15 unsigned long magic;
16
17 void (*function)(unsigned long); 15 void (*function)(unsigned long);
18 unsigned long data; 16 unsigned long data;
19 17
20 struct timer_base_s *base; 18 struct timer_base_s *base;
21}; 19};
22 20
23#define TIMER_MAGIC 0x4b87ad6e
24
25extern struct timer_base_s __init_timer_base; 21extern struct timer_base_s __init_timer_base;
26 22
27#define TIMER_INITIALIZER(_function, _expires, _data) { \ 23#define TIMER_INITIALIZER(_function, _expires, _data) { \
@@ -29,7 +25,6 @@ extern struct timer_base_s __init_timer_base;
29 .expires = (_expires), \ 25 .expires = (_expires), \
30 .data = (_data), \ 26 .data = (_data), \
31 .base = &__init_timer_base, \ 27 .base = &__init_timer_base, \
32 .magic = TIMER_MAGIC, \
33 } 28 }
34 29
35#define DEFINE_TIMER(_name, _function, _expires, _data) \ 30#define DEFINE_TIMER(_name, _function, _expires, _data) \
@@ -38,6 +33,15 @@ extern struct timer_base_s __init_timer_base;
38 33
39void fastcall init_timer(struct timer_list * timer); 34void fastcall init_timer(struct timer_list * timer);
40 35
36static inline void setup_timer(struct timer_list * timer,
37 void (*function)(unsigned long),
38 unsigned long data)
39{
40 timer->function = function;
41 timer->data = data;
42 init_timer(timer);
43}
44
41/*** 45/***
42 * timer_pending - is a timer pending? 46 * timer_pending - is a timer pending?
43 * @timer: the timer in question 47 * @timer: the timer in question
@@ -74,8 +78,9 @@ extern unsigned long next_timer_interrupt(void);
74 * Timers with an ->expired field in the past will be executed in the next 78 * Timers with an ->expired field in the past will be executed in the next
75 * timer tick. 79 * timer tick.
76 */ 80 */
77static inline void add_timer(struct timer_list * timer) 81static inline void add_timer(struct timer_list *timer)
78{ 82{
83 BUG_ON(timer_pending(timer));
79 __mod_timer(timer, timer->expires); 84 __mod_timer(timer, timer->expires);
80} 85}
81 86
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 7e050a2cc35b..04a4a8cb4ed3 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -282,6 +282,13 @@ static inline int ntp_synced(void)
282 return !(time_status & STA_UNSYNC); 282 return !(time_status & STA_UNSYNC);
283} 283}
284 284
285/* Required to safely shift negative values */
286#define shift_right(x, s) ({ \
287 __typeof__(x) __x = (x); \
288 __typeof__(s) __s = (s); \
289 __x < 0 ? -(-__x >> __s) : __x >> __s; \
290})
291
285 292
286#ifdef CONFIG_TIME_INTERPOLATION 293#ifdef CONFIG_TIME_INTERPOLATION
287 294
diff --git a/include/linux/types.h b/include/linux/types.h
index 2b678c22ca4a..21b9ce803644 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -151,7 +151,12 @@ typedef unsigned long sector_t;
151 */ 151 */
152 152
153#ifdef __CHECKER__ 153#ifdef __CHECKER__
154#define __bitwise __attribute__((bitwise)) 154#define __bitwise__ __attribute__((bitwise))
155#else
156#define __bitwise__
157#endif
158#ifdef __CHECK_ENDIAN__
159#define __bitwise __bitwise__
155#else 160#else
156#define __bitwise 161#define __bitwise
157#endif 162#endif
@@ -165,6 +170,10 @@ typedef __u64 __bitwise __le64;
165typedef __u64 __bitwise __be64; 170typedef __u64 __bitwise __be64;
166#endif 171#endif
167 172
173#ifdef __KERNEL__
174typedef unsigned __bitwise__ gfp_t;
175#endif
176
168struct ustat { 177struct ustat {
169 __kernel_daddr_t f_tfree; 178 __kernel_daddr_t f_tfree;
170 __kernel_ino_t f_tinode; 179 __kernel_ino_t f_tinode;
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 84876077027f..0ff7ca68e5c5 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -34,8 +34,7 @@
34#define UINPUT_BUFFER_SIZE 16 34#define UINPUT_BUFFER_SIZE 16
35#define UINPUT_NUM_REQUESTS 16 35#define UINPUT_NUM_REQUESTS 16
36 36
37/* state flags => bit index for {set|clear|test}_bit ops */ 37enum uinput_state { UIST_NEW_DEVICE, UIST_SETUP_COMPLETE, UIST_CREATED };
38#define UIST_CREATED 0
39 38
40struct uinput_request { 39struct uinput_request {
41 int id; 40 int id;
@@ -52,11 +51,12 @@ struct uinput_request {
52 51
53struct uinput_device { 52struct uinput_device {
54 struct input_dev *dev; 53 struct input_dev *dev;
55 unsigned long state; 54 struct semaphore sem;
55 enum uinput_state state;
56 wait_queue_head_t waitq; 56 wait_queue_head_t waitq;
57 unsigned char ready, 57 unsigned char ready;
58 head, 58 unsigned char head;
59 tail; 59 unsigned char tail;
60 struct input_event buff[UINPUT_BUFFER_SIZE]; 60 struct input_event buff[UINPUT_BUFFER_SIZE];
61 61
62 struct uinput_request *requests[UINPUT_NUM_REQUESTS]; 62 struct uinput_request *requests[UINPUT_NUM_REQUESTS];
@@ -91,6 +91,7 @@ struct uinput_ff_erase {
91#define UI_SET_SNDBIT _IOW(UINPUT_IOCTL_BASE, 106, int) 91#define UI_SET_SNDBIT _IOW(UINPUT_IOCTL_BASE, 106, int)
92#define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int) 92#define UI_SET_FFBIT _IOW(UINPUT_IOCTL_BASE, 107, int)
93#define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*) 93#define UI_SET_PHYS _IOW(UINPUT_IOCTL_BASE, 108, char*)
94#define UI_SET_SWBIT _IOW(UINPUT_IOCTL_BASE, 109, int)
94 95
95#define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload) 96#define UI_BEGIN_FF_UPLOAD _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload)
96#define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload) 97#define UI_END_FF_UPLOAD _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload)
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 4dbe580f9335..d81b050e5955 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -47,6 +47,7 @@ struct usb_driver;
47 * @urb_list: urbs queued to this endpoint; maintained by usbcore 47 * @urb_list: urbs queued to this endpoint; maintained by usbcore
48 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) 48 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
49 * with one or more transfer descriptors (TDs) per urb 49 * with one or more transfer descriptors (TDs) per urb
50 * @kobj: kobject for sysfs info
50 * @extra: descriptors following this endpoint in the configuration 51 * @extra: descriptors following this endpoint in the configuration
51 * @extralen: how many bytes of "extra" are valid 52 * @extralen: how many bytes of "extra" are valid
52 * 53 *
@@ -57,6 +58,7 @@ struct usb_host_endpoint {
57 struct usb_endpoint_descriptor desc; 58 struct usb_endpoint_descriptor desc;
58 struct list_head urb_list; 59 struct list_head urb_list;
59 void *hcpriv; 60 void *hcpriv;
61 struct kobject *kobj; /* For sysfs info */
60 62
61 unsigned char *extra; /* Extra descriptors */ 63 unsigned char *extra; /* Extra descriptors */
62 int extralen; 64 int extralen;
@@ -136,7 +138,8 @@ struct usb_interface {
136 * active alternate setting */ 138 * active alternate setting */
137 unsigned num_altsetting; /* number of alternate settings */ 139 unsigned num_altsetting; /* number of alternate settings */
138 140
139 int minor; /* minor number this interface is bound to */ 141 int minor; /* minor number this interface is
142 * bound to */
140 enum usb_interface_condition condition; /* state of binding */ 143 enum usb_interface_condition condition; /* state of binding */
141 struct device dev; /* interface specific device info */ 144 struct device dev; /* interface specific device info */
142 struct class_device *class_dev; 145 struct class_device *class_dev;
@@ -229,7 +232,7 @@ struct usb_interface_cache {
229struct usb_host_config { 232struct usb_host_config {
230 struct usb_config_descriptor desc; 233 struct usb_config_descriptor desc;
231 234
232 char *string; 235 char *string; /* iConfiguration string, if present */
233 /* the interfaces associated with this configuration, 236 /* the interfaces associated with this configuration,
234 * stored in no particular order */ 237 * stored in no particular order */
235 struct usb_interface *interface[USB_MAXINTERFACES]; 238 struct usb_interface *interface[USB_MAXINTERFACES];
@@ -248,7 +251,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
248 __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\ 251 __usb_get_extra_descriptor((ifpoint)->extra,(ifpoint)->extralen,\
249 type,(void**)ptr) 252 type,(void**)ptr)
250 253
251/* -------------------------------------------------------------------------- */ 254/* ----------------------------------------------------------------------- */
252 255
253struct usb_operations; 256struct usb_operations;
254 257
@@ -268,7 +271,8 @@ struct usb_bus {
268 unsigned is_b_host:1; /* true during some HNP roleswitches */ 271 unsigned is_b_host:1; /* true during some HNP roleswitches */
269 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ 272 unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
270 273
271 int devnum_next; /* Next open device number in round-robin allocation */ 274 int devnum_next; /* Next open device number in
275 * round-robin allocation */
272 276
273 struct usb_devmap devmap; /* device address allocation map */ 277 struct usb_devmap devmap; /* device address allocation map */
274 struct usb_operations *op; /* Operations (specific to the HC) */ 278 struct usb_operations *op; /* Operations (specific to the HC) */
@@ -289,15 +293,16 @@ struct usb_bus {
289 struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ 293 struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */
290 294
291 struct class_device *class_dev; /* class device for this bus */ 295 struct class_device *class_dev; /* class device for this bus */
292 struct kref kref; /* handles reference counting this bus */ 296 struct kref kref; /* reference counting for this bus */
293 void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ 297 void (*release)(struct usb_bus *bus);
298
294#if defined(CONFIG_USB_MON) 299#if defined(CONFIG_USB_MON)
295 struct mon_bus *mon_bus; /* non-null when associated */ 300 struct mon_bus *mon_bus; /* non-null when associated */
296 int monitored; /* non-zero when monitored */ 301 int monitored; /* non-zero when monitored */
297#endif 302#endif
298}; 303};
299 304
300/* -------------------------------------------------------------------------- */ 305/* ----------------------------------------------------------------------- */
301 306
302/* This is arbitrary. 307/* This is arbitrary.
303 * From USB 2.0 spec Table 11-13, offset 7, a hub can 308 * From USB 2.0 spec Table 11-13, offset 7, a hub can
@@ -326,7 +331,8 @@ struct usb_device {
326 331
327 struct semaphore serialize; 332 struct semaphore serialize;
328 333
329 unsigned int toggle[2]; /* one bit for each endpoint ([0] = IN, [1] = OUT) */ 334 unsigned int toggle[2]; /* one bit for each endpoint
335 * ([0] = IN, [1] = OUT) */
330 336
331 struct usb_device *parent; /* our hub, unless we're the root */ 337 struct usb_device *parent; /* our hub, unless we're the root */
332 struct usb_bus *bus; /* Bus we're part of */ 338 struct usb_bus *bus; /* Bus we're part of */
@@ -343,12 +349,14 @@ struct usb_device {
343 349
344 char **rawdescriptors; /* Raw descriptors for each config */ 350 char **rawdescriptors; /* Raw descriptors for each config */
345 351
346 int have_langid; /* whether string_langid is valid yet */ 352 int have_langid; /* whether string_langid is valid */
347 int string_langid; /* language ID for strings */ 353 int string_langid; /* language ID for strings */
348 354
349 char *product; 355 /* static strings from the device */
350 char *manufacturer; 356 char *product; /* iProduct string, if present */
351 char *serial; /* static strings from the device */ 357 char *manufacturer; /* iManufacturer string, if present */
358 char *serial; /* iSerialNumber string, if present */
359
352 struct list_head filelist; 360 struct list_head filelist;
353 struct class_device *class_dev; 361 struct class_device *class_dev;
354 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 362 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
@@ -440,22 +448,31 @@ extern struct usb_host_interface *usb_altnum_to_altsetting(
440 * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are 448 * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are
441 * high speed, and a different one if they are full or low speed. 449 * high speed, and a different one if they are full or low speed.
442 */ 450 */
443static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size) 451static inline int usb_make_path (struct usb_device *dev, char *buf,
452 size_t size)
444{ 453{
445 int actual; 454 int actual;
446 actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name, dev->devpath); 455 actual = snprintf (buf, size, "usb-%s-%s", dev->bus->bus_name,
456 dev->devpath);
447 return (actual >= (int)size) ? -1 : actual; 457 return (actual >= (int)size) ? -1 : actual;
448} 458}
449 459
450/*-------------------------------------------------------------------------*/ 460/*-------------------------------------------------------------------------*/
451 461
452#define USB_DEVICE_ID_MATCH_DEVICE (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) 462#define USB_DEVICE_ID_MATCH_DEVICE \
453#define USB_DEVICE_ID_MATCH_DEV_RANGE (USB_DEVICE_ID_MATCH_DEV_LO | USB_DEVICE_ID_MATCH_DEV_HI) 463 (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT)
454#define USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION (USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_RANGE) 464#define USB_DEVICE_ID_MATCH_DEV_RANGE \
465 (USB_DEVICE_ID_MATCH_DEV_LO | USB_DEVICE_ID_MATCH_DEV_HI)
466#define USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
467 (USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_RANGE)
455#define USB_DEVICE_ID_MATCH_DEV_INFO \ 468#define USB_DEVICE_ID_MATCH_DEV_INFO \
456 (USB_DEVICE_ID_MATCH_DEV_CLASS | USB_DEVICE_ID_MATCH_DEV_SUBCLASS | USB_DEVICE_ID_MATCH_DEV_PROTOCOL) 469 (USB_DEVICE_ID_MATCH_DEV_CLASS | \
470 USB_DEVICE_ID_MATCH_DEV_SUBCLASS | \
471 USB_DEVICE_ID_MATCH_DEV_PROTOCOL)
457#define USB_DEVICE_ID_MATCH_INT_INFO \ 472#define USB_DEVICE_ID_MATCH_INT_INFO \
458 (USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS | USB_DEVICE_ID_MATCH_INT_PROTOCOL) 473 (USB_DEVICE_ID_MATCH_INT_CLASS | \
474 USB_DEVICE_ID_MATCH_INT_SUBCLASS | \
475 USB_DEVICE_ID_MATCH_INT_PROTOCOL)
459 476
460/** 477/**
461 * USB_DEVICE - macro used to describe a specific usb device 478 * USB_DEVICE - macro used to describe a specific usb device
@@ -466,9 +483,11 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
466 * specific device. 483 * specific device.
467 */ 484 */
468#define USB_DEVICE(vend,prod) \ 485#define USB_DEVICE(vend,prod) \
469 .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), .idProduct = (prod) 486 .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = (vend), \
487 .idProduct = (prod)
470/** 488/**
471 * USB_DEVICE_VER - macro used to describe a specific usb device with a version range 489 * USB_DEVICE_VER - macro used to describe a specific usb device with a
490 * version range
472 * @vend: the 16 bit USB Vendor ID 491 * @vend: the 16 bit USB Vendor ID
473 * @prod: the 16 bit USB Product ID 492 * @prod: the 16 bit USB Product ID
474 * @lo: the bcdDevice_lo value 493 * @lo: the bcdDevice_lo value
@@ -478,7 +497,9 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
478 * specific device, with a version range. 497 * specific device, with a version range.
479 */ 498 */
480#define USB_DEVICE_VER(vend,prod,lo,hi) \ 499#define USB_DEVICE_VER(vend,prod,lo,hi) \
481 .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, .idVendor = (vend), .idProduct = (prod), .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) 500 .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, \
501 .idVendor = (vend), .idProduct = (prod), \
502 .bcdDevice_lo = (lo), .bcdDevice_hi = (hi)
482 503
483/** 504/**
484 * USB_DEVICE_INFO - macro used to describe a class of usb devices 505 * USB_DEVICE_INFO - macro used to describe a class of usb devices
@@ -490,7 +511,8 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
490 * specific class of devices. 511 * specific class of devices.
491 */ 512 */
492#define USB_DEVICE_INFO(cl,sc,pr) \ 513#define USB_DEVICE_INFO(cl,sc,pr) \
493 .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), .bDeviceSubClass = (sc), .bDeviceProtocol = (pr) 514 .match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, .bDeviceClass = (cl), \
515 .bDeviceSubClass = (sc), .bDeviceProtocol = (pr)
494 516
495/** 517/**
496 * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces 518 * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces
@@ -502,9 +524,10 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
502 * specific class of interfaces. 524 * specific class of interfaces.
503 */ 525 */
504#define USB_INTERFACE_INFO(cl,sc,pr) \ 526#define USB_INTERFACE_INFO(cl,sc,pr) \
505 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) 527 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \
528 .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
506 529
507/* -------------------------------------------------------------------------- */ 530/* ----------------------------------------------------------------------- */
508 531
509/** 532/**
510 * struct usb_driver - identifies USB driver to usbcore 533 * struct usb_driver - identifies USB driver to usbcore
@@ -557,7 +580,8 @@ struct usb_driver {
557 580
558 void (*disconnect) (struct usb_interface *intf); 581 void (*disconnect) (struct usb_interface *intf);
559 582
560 int (*ioctl) (struct usb_interface *intf, unsigned int code, void *buf); 583 int (*ioctl) (struct usb_interface *intf, unsigned int code,
584 void *buf);
561 585
562 int (*suspend) (struct usb_interface *intf, pm_message_t message); 586 int (*suspend) (struct usb_interface *intf, pm_message_t message);
563 int (*resume) (struct usb_interface *intf); 587 int (*resume) (struct usb_interface *intf);
@@ -572,10 +596,8 @@ extern struct bus_type usb_bus_type;
572 596
573/** 597/**
574 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number 598 * struct usb_class_driver - identifies a USB driver that wants to use the USB major number
575 * @name: devfs name for this driver. Will also be used by the driver 599 * @name: the usb class device name for this driver. Will show up in sysfs.
576 * class code to create a usb class device.
577 * @fops: pointer to the struct file_operations of this driver. 600 * @fops: pointer to the struct file_operations of this driver.
578 * @mode: the mode for the devfs file to be created for this driver.
579 * @minor_base: the start of the minor range for this driver. 601 * @minor_base: the start of the minor range for this driver.
580 * 602 *
581 * This structure is used for the usb_register_dev() and 603 * This structure is used for the usb_register_dev() and
@@ -585,8 +607,7 @@ extern struct bus_type usb_bus_type;
585struct usb_class_driver { 607struct usb_class_driver {
586 char *name; 608 char *name;
587 struct file_operations *fops; 609 struct file_operations *fops;
588 mode_t mode; 610 int minor_base;
589 int minor_base;
590}; 611};
591 612
592/* 613/*
@@ -603,7 +624,7 @@ extern void usb_deregister_dev(struct usb_interface *intf,
603 624
604extern int usb_disabled(void); 625extern int usb_disabled(void);
605 626
606/* -------------------------------------------------------------------------- */ 627/* ----------------------------------------------------------------------- */
607 628
608/* 629/*
609 * URB support, for asynchronous request completions 630 * URB support, for asynchronous request completions
@@ -613,12 +634,14 @@ extern int usb_disabled(void);
613 * urb->transfer_flags: 634 * urb->transfer_flags:
614 */ 635 */
615#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ 636#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */
616#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */ 637#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame
638 * ignored */
617#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ 639#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
618#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */ 640#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */
619#define URB_NO_FSBR 0x0020 /* UHCI-specific */ 641#define URB_NO_FSBR 0x0020 /* UHCI-specific */
620#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */ 642#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
621#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt needed */ 643#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt
644 * needed */
622 645
623struct usb_iso_packet_descriptor { 646struct usb_iso_packet_descriptor {
624 unsigned int offset; 647 unsigned int offset;
@@ -797,7 +820,7 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
797 */ 820 */
798struct urb 821struct urb
799{ 822{
800 /* private, usb core and host controller only fields in the urb */ 823 /* private: usb core and host controller only fields in the urb */
801 struct kref kref; /* reference count of the URB */ 824 struct kref kref; /* reference count of the URB */
802 spinlock_t lock; /* lock for the URB */ 825 spinlock_t lock; /* lock for the URB */
803 void *hcpriv; /* private data for host controller */ 826 void *hcpriv; /* private data for host controller */
@@ -805,8 +828,9 @@ struct urb
805 atomic_t use_count; /* concurrent submissions counter */ 828 atomic_t use_count; /* concurrent submissions counter */
806 u8 reject; /* submissions will fail */ 829 u8 reject; /* submissions will fail */
807 830
808 /* public, documented fields in the urb that can be used by drivers */ 831 /* public: documented fields in the urb that can be used by drivers */
809 struct list_head urb_list; /* list head for use by the urb owner */ 832 struct list_head urb_list; /* list head for use by the urb's
833 * current owner */
810 struct usb_device *dev; /* (in) pointer to associated device */ 834 struct usb_device *dev; /* (in) pointer to associated device */
811 unsigned int pipe; /* (in) pipe information */ 835 unsigned int pipe; /* (in) pipe information */
812 int status; /* (return) non-ISO status */ 836 int status; /* (return) non-ISO status */
@@ -819,14 +843,16 @@ struct urb
819 dma_addr_t setup_dma; /* (in) dma addr for setup_packet */ 843 dma_addr_t setup_dma; /* (in) dma addr for setup_packet */
820 int start_frame; /* (modify) start frame (ISO) */ 844 int start_frame; /* (modify) start frame (ISO) */
821 int number_of_packets; /* (in) number of ISO packets */ 845 int number_of_packets; /* (in) number of ISO packets */
822 int interval; /* (modify) transfer interval (INT/ISO) */ 846 int interval; /* (modify) transfer interval
847 * (INT/ISO) */
823 int error_count; /* (return) number of ISO errors */ 848 int error_count; /* (return) number of ISO errors */
824 void *context; /* (in) context for completion */ 849 void *context; /* (in) context for completion */
825 usb_complete_t complete; /* (in) completion routine */ 850 usb_complete_t complete; /* (in) completion routine */
826 struct usb_iso_packet_descriptor iso_frame_desc[0]; /* (in) ISO ONLY */ 851 struct usb_iso_packet_descriptor iso_frame_desc[0];
852 /* (in) ISO ONLY */
827}; 853};
828 854
829/* -------------------------------------------------------------------------- */ 855/* ----------------------------------------------------------------------- */
830 856
831/** 857/**
832 * usb_fill_control_urb - initializes a control urb 858 * usb_fill_control_urb - initializes a control urb
@@ -933,17 +959,17 @@ static inline void usb_fill_int_urb (struct urb *urb,
933} 959}
934 960
935extern void usb_init_urb(struct urb *urb); 961extern void usb_init_urb(struct urb *urb);
936extern struct urb *usb_alloc_urb(int iso_packets, unsigned mem_flags); 962extern struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags);
937extern void usb_free_urb(struct urb *urb); 963extern void usb_free_urb(struct urb *urb);
938#define usb_put_urb usb_free_urb 964#define usb_put_urb usb_free_urb
939extern struct urb *usb_get_urb(struct urb *urb); 965extern struct urb *usb_get_urb(struct urb *urb);
940extern int usb_submit_urb(struct urb *urb, unsigned mem_flags); 966extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags);
941extern int usb_unlink_urb(struct urb *urb); 967extern int usb_unlink_urb(struct urb *urb);
942extern void usb_kill_urb(struct urb *urb); 968extern void usb_kill_urb(struct urb *urb);
943 969
944#define HAVE_USB_BUFFERS 970#define HAVE_USB_BUFFERS
945void *usb_buffer_alloc (struct usb_device *dev, size_t size, 971void *usb_buffer_alloc (struct usb_device *dev, size_t size,
946 unsigned mem_flags, dma_addr_t *dma); 972 gfp_t mem_flags, dma_addr_t *dma);
947void usb_buffer_free (struct usb_device *dev, size_t size, 973void usb_buffer_free (struct usb_device *dev, size_t size,
948 void *addr, dma_addr_t dma); 974 void *addr, dma_addr_t dma);
949 975
@@ -974,11 +1000,6 @@ extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
974 void *data, int len, int *actual_length, 1000 void *data, int len, int *actual_length,
975 int timeout); 1001 int timeout);
976 1002
977/* selective suspend/resume */
978extern int usb_suspend_device(struct usb_device *dev, pm_message_t message);
979extern int usb_resume_device(struct usb_device *dev);
980
981
982/* wrappers around usb_control_msg() for the most common standard requests */ 1003/* wrappers around usb_control_msg() for the most common standard requests */
983extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype, 1004extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
984 unsigned char descindex, void *buf, int size); 1005 unsigned char descindex, void *buf, int size);
@@ -1025,7 +1046,7 @@ struct usb_sg_request {
1025 size_t bytes; 1046 size_t bytes;
1026 1047
1027 /* 1048 /*
1028 * members below are private to usbcore, 1049 * members below are private: to usbcore,
1029 * and are not provided for driver access! 1050 * and are not provided for driver access!
1030 */ 1051 */
1031 spinlock_t lock; 1052 spinlock_t lock;
@@ -1050,13 +1071,13 @@ int usb_sg_init (
1050 struct scatterlist *sg, 1071 struct scatterlist *sg,
1051 int nents, 1072 int nents,
1052 size_t length, 1073 size_t length,
1053 unsigned mem_flags 1074 gfp_t mem_flags
1054); 1075);
1055void usb_sg_cancel (struct usb_sg_request *io); 1076void usb_sg_cancel (struct usb_sg_request *io);
1056void usb_sg_wait (struct usb_sg_request *io); 1077void usb_sg_wait (struct usb_sg_request *io);
1057 1078
1058 1079
1059/* -------------------------------------------------------------------------- */ 1080/* ----------------------------------------------------------------------- */
1060 1081
1061/* 1082/*
1062 * For various legacy reasons, Linux has a small cookie that's paired with 1083 * For various legacy reasons, Linux has a small cookie that's paired with
@@ -1097,23 +1118,34 @@ void usb_sg_wait (struct usb_sg_request *io);
1097/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ 1118/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */
1098#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) 1119#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)
1099#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) 1120#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
1100#define usb_settoggle(dev, ep, out, bit) ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | ((bit) << (ep))) 1121#define usb_settoggle(dev, ep, out, bit) \
1122 ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \
1123 ((bit) << (ep)))
1101 1124
1102 1125
1103static inline unsigned int __create_pipe(struct usb_device *dev, unsigned int endpoint) 1126static inline unsigned int __create_pipe(struct usb_device *dev,
1127 unsigned int endpoint)
1104{ 1128{
1105 return (dev->devnum << 8) | (endpoint << 15); 1129 return (dev->devnum << 8) | (endpoint << 15);
1106} 1130}
1107 1131
1108/* Create various pipes... */ 1132/* Create various pipes... */
1109#define usb_sndctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint)) 1133#define usb_sndctrlpipe(dev,endpoint) \
1110#define usb_rcvctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1134 ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint))
1111#define usb_sndisocpipe(dev,endpoint) ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint)) 1135#define usb_rcvctrlpipe(dev,endpoint) \
1112#define usb_rcvisocpipe(dev,endpoint) ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1136 ((PIPE_CONTROL << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
1113#define usb_sndbulkpipe(dev,endpoint) ((PIPE_BULK << 30) | __create_pipe(dev,endpoint)) 1137#define usb_sndisocpipe(dev,endpoint) \
1114#define usb_rcvbulkpipe(dev,endpoint) ((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1138 ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint))
1115#define usb_sndintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint)) 1139#define usb_rcvisocpipe(dev,endpoint) \
1116#define usb_rcvintpipe(dev,endpoint) ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN) 1140 ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
1141#define usb_sndbulkpipe(dev,endpoint) \
1142 ((PIPE_BULK << 30) | __create_pipe(dev,endpoint))
1143#define usb_rcvbulkpipe(dev,endpoint) \
1144 ((PIPE_BULK << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
1145#define usb_sndintpipe(dev,endpoint) \
1146 ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint))
1147#define usb_rcvintpipe(dev,endpoint) \
1148 ((PIPE_INTERRUPT << 30) | __create_pipe(dev,endpoint) | USB_DIR_IN)
1117 1149
1118/*-------------------------------------------------------------------------*/ 1150/*-------------------------------------------------------------------------*/
1119 1151
@@ -1137,17 +1169,29 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
1137 return le16_to_cpu(ep->desc.wMaxPacketSize); 1169 return le16_to_cpu(ep->desc.wMaxPacketSize);
1138} 1170}
1139 1171
1140/* -------------------------------------------------------------------------- */ 1172/* ----------------------------------------------------------------------- */
1173
1174/* Events from the usb core */
1175#define USB_DEVICE_ADD 0x0001
1176#define USB_DEVICE_REMOVE 0x0002
1177#define USB_BUS_ADD 0x0003
1178#define USB_BUS_REMOVE 0x0004
1179extern void usb_register_notify(struct notifier_block *nb);
1180extern void usb_unregister_notify(struct notifier_block *nb);
1141 1181
1142#ifdef DEBUG 1182#ifdef DEBUG
1143#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg) 1183#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \
1184 __FILE__ , ## arg)
1144#else 1185#else
1145#define dbg(format, arg...) do {} while (0) 1186#define dbg(format, arg...) do {} while (0)
1146#endif 1187#endif
1147 1188
1148#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , __FILE__ , ## arg) 1189#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
1149#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , __FILE__ , ## arg) 1190 __FILE__ , ## arg)
1150#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , __FILE__ , ## arg) 1191#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , \
1192 __FILE__ , ## arg)
1193#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , \
1194 __FILE__ , ## arg)
1151 1195
1152 1196
1153#endif /* __KERNEL__ */ 1197#endif /* __KERNEL__ */
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index 71e608607324..ff81117eb733 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -107,18 +107,18 @@ struct usb_ep_ops {
107 int (*disable) (struct usb_ep *ep); 107 int (*disable) (struct usb_ep *ep);
108 108
109 struct usb_request *(*alloc_request) (struct usb_ep *ep, 109 struct usb_request *(*alloc_request) (struct usb_ep *ep,
110 unsigned gfp_flags); 110 gfp_t gfp_flags);
111 void (*free_request) (struct usb_ep *ep, struct usb_request *req); 111 void (*free_request) (struct usb_ep *ep, struct usb_request *req);
112 112
113 void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, 113 void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes,
114 dma_addr_t *dma, unsigned gfp_flags); 114 dma_addr_t *dma, gfp_t gfp_flags);
115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, 115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma,
116 unsigned bytes); 116 unsigned bytes);
117 // NOTE: on 2.6, drivers may also use dma_map() and 117 // NOTE: on 2.6, drivers may also use dma_map() and
118 // dma_sync_single_*() to directly manage dma overhead. 118 // dma_sync_single_*() to directly manage dma overhead.
119 119
120 int (*queue) (struct usb_ep *ep, struct usb_request *req, 120 int (*queue) (struct usb_ep *ep, struct usb_request *req,
121 unsigned gfp_flags); 121 gfp_t gfp_flags);
122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req); 122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req);
123 123
124 int (*set_halt) (struct usb_ep *ep, int value); 124 int (*set_halt) (struct usb_ep *ep, int value);
@@ -214,7 +214,7 @@ usb_ep_disable (struct usb_ep *ep)
214 * Returns the request, or null if one could not be allocated. 214 * Returns the request, or null if one could not be allocated.
215 */ 215 */
216static inline struct usb_request * 216static inline struct usb_request *
217usb_ep_alloc_request (struct usb_ep *ep, unsigned gfp_flags) 217usb_ep_alloc_request (struct usb_ep *ep, gfp_t gfp_flags)
218{ 218{
219 return ep->ops->alloc_request (ep, gfp_flags); 219 return ep->ops->alloc_request (ep, gfp_flags);
220} 220}
@@ -254,7 +254,7 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req)
254 */ 254 */
255static inline void * 255static inline void *
256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, 256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma,
257 unsigned gfp_flags) 257 gfp_t gfp_flags)
258{ 258{
259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); 259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags);
260} 260}
@@ -330,7 +330,7 @@ usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len)
330 * reported when the usb peripheral is disconnected. 330 * reported when the usb peripheral is disconnected.
331 */ 331 */
332static inline int 332static inline int
333usb_ep_queue (struct usb_ep *ep, struct usb_request *req, unsigned gfp_flags) 333usb_ep_queue (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags)
334{ 334{
335 return ep->ops->queue (ep, req, gfp_flags); 335 return ep->ops->queue (ep, req, gfp_flags);
336} 336}
diff --git a/include/linux/usb_otg.h b/include/linux/usb_otg.h
index c6683146e9b0..f827f6e203c2 100644
--- a/include/linux/usb_otg.h
+++ b/include/linux/usb_otg.h
@@ -63,6 +63,10 @@ struct otg_transceiver {
63 int (*set_power)(struct otg_transceiver *otg, 63 int (*set_power)(struct otg_transceiver *otg,
64 unsigned mA); 64 unsigned mA);
65 65
66 /* for non-OTG B devices: set transceiver into suspend mode */
67 int (*set_suspend)(struct otg_transceiver *otg,
68 int suspend);
69
66 /* for B devices only: start session with A-Host */ 70 /* for B devices only: start session with A-Host */
67 int (*start_srp)(struct otg_transceiver *otg); 71 int (*start_srp)(struct otg_transceiver *otg);
68 72
@@ -108,6 +112,15 @@ otg_set_power(struct otg_transceiver *otg, unsigned mA)
108} 112}
109 113
110static inline int 114static inline int
115otg_set_suspend(struct otg_transceiver *otg, int suspend)
116{
117 if (otg->set_suspend != NULL)
118 return otg->set_suspend(otg, suspend);
119 else
120 return 0;
121}
122
123static inline int
111otg_start_srp(struct otg_transceiver *otg) 124otg_start_srp(struct otg_transceiver *otg)
112{ 125{
113 return otg->start_srp(otg); 126 return otg->start_srp(otg);
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 9facf733800c..8859f0b41543 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -140,6 +140,12 @@ struct usbdevfs_urb32 {
140 compat_caddr_t usercontext; /* unused */ 140 compat_caddr_t usercontext; /* unused */
141 struct usbdevfs_iso_packet_desc iso_frame_desc[0]; 141 struct usbdevfs_iso_packet_desc iso_frame_desc[0];
142}; 142};
143
144struct usbdevfs_ioctl32 {
145 s32 ifno;
146 s32 ioctl_code;
147 compat_caddr_t data;
148};
143#endif 149#endif
144 150
145#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer) 151#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
@@ -160,6 +166,7 @@ struct usbdevfs_urb32 {
160#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) 166#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
161#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo) 167#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
162#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl) 168#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
169#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
163#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo) 170#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
164#define USBDEVFS_RESET _IO('U', 20) 171#define USBDEVFS_RESET _IO('U', 20)
165#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int) 172#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 1cc8c31b7988..91140091ced2 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -1,57 +1,16 @@
1#ifndef __LINUX_VIDEODEV_H 1#ifndef __LINUX_VIDEODEV_H
2#define __LINUX_VIDEODEV_H 2#define __LINUX_VIDEODEV_H
3 3
4#include <linux/compiler.h>
5#include <linux/types.h> 4#include <linux/types.h>
6 5
7#define HAVE_V4L2 1 6#define HAVE_V4L1 1
7
8#include <linux/videodev2.h> 8#include <linux/videodev2.h>
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11 11
12#include <linux/poll.h>
13#include <linux/mm.h> 12#include <linux/mm.h>
14#include <linux/device.h>
15
16struct video_device
17{
18 /* device info */
19 struct device *dev;
20 char name[32];
21 int type; /* v4l1 */
22 int type2; /* v4l2 */
23 int hardware;
24 int minor;
25
26 /* device ops + callbacks */
27 struct file_operations *fops;
28 void (*release)(struct video_device *vfd);
29
30
31 /* obsolete -- fops->owner is used instead */
32 struct module *owner;
33 /* dev->driver_data will be used instead some day.
34 * Use the video_{get|set}_drvdata() helper functions,
35 * so the switch over will be transparent for you.
36 * Or use {pci|usb}_{get|set}_drvdata() directly. */
37 void *priv;
38
39 /* for videodev.c intenal usage -- please don't touch */
40 int users; /* video_exclusive_{open|close} ... */
41 struct semaphore lock; /* ... helper function uses these */
42 char devfs_name[64]; /* devfs */
43 struct class_device class_dev; /* sysfs */
44};
45
46#define VIDEO_MAJOR 81
47
48#define VFL_TYPE_GRABBER 0
49#define VFL_TYPE_VBI 1
50#define VFL_TYPE_RADIO 2
51#define VFL_TYPE_VTX 3
52 13
53extern int video_register_device(struct video_device *, int type, int nr);
54extern void video_unregister_device(struct video_device *);
55extern struct video_device* video_devdata(struct file*); 14extern struct video_device* video_devdata(struct file*);
56 15
57#define to_video_device(cd) container_of(cd, struct video_device, class_dev) 16#define to_video_device(cd) container_of(cd, struct video_device, class_dev)
@@ -68,11 +27,7 @@ video_device_remove_file(struct video_device *vfd,
68 class_device_remove_file(&vfd->class_dev, attr); 27 class_device_remove_file(&vfd->class_dev, attr);
69} 28}
70 29
71/* helper functions to alloc / release struct video_device, the 30#if OBSOLETE_OWNER /* to be removed in 2.6.15 */
72 later can be used for video_device->release() */
73struct video_device *video_device_alloc(void);
74void video_device_release(struct video_device *vfd);
75
76/* helper functions to access driver private data. */ 31/* helper functions to access driver private data. */
77static inline void *video_get_drvdata(struct video_device *dev) 32static inline void *video_get_drvdata(struct video_device *dev)
78{ 33{
@@ -83,30 +38,12 @@ static inline void video_set_drvdata(struct video_device *dev, void *data)
83{ 38{
84 dev->priv = data; 39 dev->priv = data;
85} 40}
41#endif
86 42
87extern int video_exclusive_open(struct inode *inode, struct file *file); 43extern int video_exclusive_open(struct inode *inode, struct file *file);
88extern int video_exclusive_release(struct inode *inode, struct file *file); 44extern int video_exclusive_release(struct inode *inode, struct file *file);
89extern int video_usercopy(struct inode *inode, struct file *file,
90 unsigned int cmd, unsigned long arg,
91 int (*func)(struct inode *inode, struct file *file,
92 unsigned int cmd, void *arg));
93#endif /* __KERNEL__ */ 45#endif /* __KERNEL__ */
94 46
95#define VID_TYPE_CAPTURE 1 /* Can capture */
96#define VID_TYPE_TUNER 2 /* Can tune */
97#define VID_TYPE_TELETEXT 4 /* Does teletext */
98#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
99#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
100#define VID_TYPE_CLIPPING 32 /* Can clip */
101#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
102#define VID_TYPE_SCALES 128 /* Scalable */
103#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
104#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
105#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
106#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
107#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
108#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
109
110struct video_capability 47struct video_capability
111{ 48{
112 char name[32]; 49 char name[32];
@@ -202,9 +139,9 @@ struct video_audio
202#define VIDEO_SOUND_STEREO 2 139#define VIDEO_SOUND_STEREO 2
203#define VIDEO_SOUND_LANG1 4 140#define VIDEO_SOUND_LANG1 4
204#define VIDEO_SOUND_LANG2 8 141#define VIDEO_SOUND_LANG2 8
205 __u16 mode; 142 __u16 mode;
206 __u16 balance; /* Stereo balance */ 143 __u16 balance; /* Stereo balance */
207 __u16 step; /* Step actual volume uses */ 144 __u16 step; /* Step actual volume uses */
208}; 145};
209 146
210struct video_clip 147struct video_clip
@@ -260,9 +197,6 @@ struct video_key
260 __u32 flags; 197 __u32 flags;
261}; 198};
262 199
263
264#define VIDEO_MAX_FRAME 32
265
266struct video_mbuf 200struct video_mbuf
267{ 201{
268 int size; /* Total memory to map */ 202 int size; /* Total memory to map */
@@ -270,10 +204,8 @@ struct video_mbuf
270 int offsets[VIDEO_MAX_FRAME]; 204 int offsets[VIDEO_MAX_FRAME];
271}; 205};
272 206
273
274#define VIDEO_NO_UNIT (-1) 207#define VIDEO_NO_UNIT (-1)
275 208
276
277struct video_unit 209struct video_unit
278{ 210{
279 int video; /* Video minor */ 211 int video; /* Video minor */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 89a055761bed..1cded681eb6d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -15,16 +15,99 @@
15 */ 15 */
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17#include <linux/time.h> /* need struct timeval */ 17#include <linux/time.h> /* need struct timeval */
18#include <linux/poll.h>
19#include <linux/device.h>
18#endif 20#endif
19#include <linux/compiler.h> /* need __user */ 21#include <linux/compiler.h> /* need __user */
20 22
23
24#define OBSOLETE_OWNER 1 /* It will be removed for 2.6.15 */
25#define HAVE_V4L2 1
26
27/*
28 * Common stuff for both V4L1 and V4L2
29 * Moved from videodev.h
30 */
31
32#define VIDEO_MAX_FRAME 32
33
34#define VID_TYPE_CAPTURE 1 /* Can capture */
35#define VID_TYPE_TUNER 2 /* Can tune */
36#define VID_TYPE_TELETEXT 4 /* Does teletext */
37#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
38#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
39#define VID_TYPE_CLIPPING 32 /* Can clip */
40#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
41#define VID_TYPE_SCALES 128 /* Scalable */
42#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
43#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
44#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
45#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
46#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
47#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
48
49#ifdef __KERNEL__
50
51#define VFL_TYPE_GRABBER 0
52#define VFL_TYPE_VBI 1
53#define VFL_TYPE_RADIO 2
54#define VFL_TYPE_VTX 3
55
56struct video_device
57{
58 /* device info */
59 struct device *dev;
60 char name[32];
61 int type; /* v4l1 */
62 int type2; /* v4l2 */
63 int hardware;
64 int minor;
65
66 /* device ops + callbacks */
67 struct file_operations *fops;
68 void (*release)(struct video_device *vfd);
69
70
71#if OBSOLETE_OWNER /* to be removed in 2.6.15 */
72 /* obsolete -- fops->owner is used instead */
73 struct module *owner;
74 /* dev->driver_data will be used instead some day.
75 * Use the video_{get|set}_drvdata() helper functions,
76 * so the switch over will be transparent for you.
77 * Or use {pci|usb}_{get|set}_drvdata() directly. */
78 void *priv;
79#endif
80
81 /* for videodev.c intenal usage -- please don't touch */
82 int users; /* video_exclusive_{open|close} ... */
83 struct semaphore lock; /* ... helper function uses these */
84 char devfs_name[64]; /* devfs */
85 struct class_device class_dev; /* sysfs */
86};
87
88#define VIDEO_MAJOR 81
89
90extern int video_register_device(struct video_device *, int type, int nr);
91extern void video_unregister_device(struct video_device *);
92extern int video_usercopy(struct inode *inode, struct file *file,
93 unsigned int cmd, unsigned long arg,
94 int (*func)(struct inode *inode, struct file *file,
95 unsigned int cmd, void *arg));
96
97/* helper functions to alloc / release struct video_device, the
98 later can be used for video_device->release() */
99struct video_device *video_device_alloc(void);
100void video_device_release(struct video_device *vfd);
101
102#endif
103
21/* 104/*
22 * M I S C E L L A N E O U S 105 * M I S C E L L A N E O U S
23 */ 106 */
24 107
25/* Four-character-code (FOURCC) */ 108/* Four-character-code (FOURCC) */
26#define v4l2_fourcc(a,b,c,d)\ 109#define v4l2_fourcc(a,b,c,d)\
27 (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) 110 (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
28 111
29/* 112/*
30 * E N U M S 113 * E N U M S
@@ -154,20 +237,20 @@ struct v4l2_capability
154}; 237};
155 238
156/* Values for 'capabilities' field */ 239/* Values for 'capabilities' field */
157#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ 240#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
158#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ 241#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
159#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ 242#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
160#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ 243#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
161#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ 244#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
162#if 1 245#if 1
163#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ 246#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
164#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ 247#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
165#endif 248#endif
166#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ 249#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
167 250
168#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ 251#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
169#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ 252#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
170#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ 253#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
171 254
172#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ 255#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
173#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ 256#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
@@ -179,13 +262,13 @@ struct v4l2_capability
179 262
180struct v4l2_pix_format 263struct v4l2_pix_format
181{ 264{
182 __u32 width; 265 __u32 width;
183 __u32 height; 266 __u32 height;
184 __u32 pixelformat; 267 __u32 pixelformat;
185 enum v4l2_field field; 268 enum v4l2_field field;
186 __u32 bytesperline; /* for padding, zero if unused */ 269 __u32 bytesperline; /* for padding, zero if unused */
187 __u32 sizeimage; 270 __u32 sizeimage;
188 enum v4l2_colorspace colorspace; 271 enum v4l2_colorspace colorspace;
189 __u32 priv; /* private data, depends on pixelformat */ 272 __u32 priv; /* private data, depends on pixelformat */
190}; 273};
191 274
@@ -238,12 +321,12 @@ struct v4l2_pix_format
238 */ 321 */
239struct v4l2_fmtdesc 322struct v4l2_fmtdesc
240{ 323{
241 __u32 index; /* Format number */ 324 __u32 index; /* Format number */
242 enum v4l2_buf_type type; /* buffer type */ 325 enum v4l2_buf_type type; /* buffer type */
243 __u32 flags; 326 __u32 flags;
244 __u8 description[32]; /* Description string */ 327 __u8 description[32]; /* Description string */
245 __u32 pixelformat; /* Format fourcc */ 328 __u32 pixelformat; /* Format fourcc */
246 __u32 reserved[4]; 329 __u32 reserved[4];
247}; 330};
248 331
249#define V4L2_FMT_FLAG_COMPRESSED 0x0001 332#define V4L2_FMT_FLAG_COMPRESSED 0x0001
@@ -393,7 +476,7 @@ struct v4l2_jpegcompression
393#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ 476#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
394#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */ 477#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
395#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will 478#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
396 * allways use APP0 */ 479 * allways use APP0 */
397}; 480};
398 481
399 482
@@ -402,10 +485,10 @@ struct v4l2_jpegcompression
402 */ 485 */
403struct v4l2_requestbuffers 486struct v4l2_requestbuffers
404{ 487{
405 __u32 count; 488 __u32 count;
406 enum v4l2_buf_type type; 489 enum v4l2_buf_type type;
407 enum v4l2_memory memory; 490 enum v4l2_memory memory;
408 __u32 reserved[2]; 491 __u32 reserved[2];
409}; 492};
410 493
411struct v4l2_buffer 494struct v4l2_buffer
@@ -511,9 +594,9 @@ struct v4l2_outputparm
511 594
512struct v4l2_cropcap { 595struct v4l2_cropcap {
513 enum v4l2_buf_type type; 596 enum v4l2_buf_type type;
514 struct v4l2_rect bounds; 597 struct v4l2_rect bounds;
515 struct v4l2_rect defrect; 598 struct v4l2_rect defrect;
516 struct v4l2_fract pixelaspect; 599 struct v4l2_fract pixelaspect;
517}; 600};
518 601
519struct v4l2_crop { 602struct v4l2_crop {
@@ -544,6 +627,7 @@ typedef __u64 v4l2_std_id;
544 627
545#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) 628#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
546#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) 629#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
630#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
547 631
548#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) 632#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
549#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) 633#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
@@ -552,6 +636,7 @@ typedef __u64 v4l2_std_id;
552#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000) 636#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
553#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000) 637#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
554#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000) 638#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
639#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
555 640
556/* ATSC/HDTV */ 641/* ATSC/HDTV */
557#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) 642#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
@@ -581,13 +666,14 @@ typedef __u64 v4l2_std_id;
581 666
582#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ 667#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
583 V4L2_STD_PAL_60 |\ 668 V4L2_STD_PAL_60 |\
584 V4L2_STD_NTSC) 669 V4L2_STD_NTSC |\
670 V4L2_STD_NTSC_443)
585#define V4L2_STD_625_50 (V4L2_STD_PAL |\ 671#define V4L2_STD_625_50 (V4L2_STD_PAL |\
586 V4L2_STD_PAL_N |\ 672 V4L2_STD_PAL_N |\
587 V4L2_STD_PAL_Nc |\ 673 V4L2_STD_PAL_Nc |\
588 V4L2_STD_SECAM) 674 V4L2_STD_SECAM)
589#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ 675#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
590 V4L2_STD_ATSC_16_VSB) 676 V4L2_STD_ATSC_16_VSB)
591 677
592#define V4L2_STD_UNKNOWN 0 678#define V4L2_STD_UNKNOWN 0
593#define V4L2_STD_ALL (V4L2_STD_525_60 |\ 679#define V4L2_STD_ALL (V4L2_STD_525_60 |\
@@ -595,7 +681,7 @@ typedef __u64 v4l2_std_id;
595 681
596struct v4l2_standard 682struct v4l2_standard
597{ 683{
598 __u32 index; 684 __u32 index;
599 v4l2_std_id id; 685 v4l2_std_id id;
600 __u8 name[24]; 686 __u8 name[24];
601 struct v4l2_fract frameperiod; /* Frames, not fields */ 687 struct v4l2_fract frameperiod; /* Frames, not fields */
@@ -610,9 +696,9 @@ struct v4l2_standard
610struct v4l2_input 696struct v4l2_input
611{ 697{
612 __u32 index; /* Which input */ 698 __u32 index; /* Which input */
613 __u8 name[32]; /* Label */ 699 __u8 name[32]; /* Label */
614 __u32 type; /* Type of input */ 700 __u32 type; /* Type of input */
615 __u32 audioset; /* Associated audios (bitfield) */ 701 __u32 audioset; /* Associated audios (bitfield) */
616 __u32 tuner; /* Associated tuner */ 702 __u32 tuner; /* Associated tuner */
617 v4l2_std_id std; 703 v4l2_std_id std;
618 __u32 status; 704 __u32 status;
@@ -647,9 +733,9 @@ struct v4l2_input
647struct v4l2_output 733struct v4l2_output
648{ 734{
649 __u32 index; /* Which output */ 735 __u32 index; /* Which output */
650 __u8 name[32]; /* Label */ 736 __u8 name[32]; /* Label */
651 __u32 type; /* Type of output */ 737 __u32 type; /* Type of output */
652 __u32 audioset; /* Associated audios (bitfield) */ 738 __u32 audioset; /* Associated audios (bitfield) */
653 __u32 modulator; /* Associated modulator */ 739 __u32 modulator; /* Associated modulator */
654 v4l2_std_id std; 740 v4l2_std_id std;
655 __u32 reserved[4]; 741 __u32 reserved[4];
@@ -671,12 +757,12 @@ struct v4l2_control
671/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 757/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
672struct v4l2_queryctrl 758struct v4l2_queryctrl
673{ 759{
674 __u32 id; 760 __u32 id;
675 enum v4l2_ctrl_type type; 761 enum v4l2_ctrl_type type;
676 __u8 name[32]; /* Whatever */ 762 __u8 name[32]; /* Whatever */
677 __s32 minimum; /* Note signedness */ 763 __s32 minimum; /* Note signedness */
678 __s32 maximum; 764 __s32 maximum;
679 __s32 step; 765 __s32 step;
680 __s32 default_value; 766 __s32 default_value;
681 __u32 flags; 767 __u32 flags;
682 __u32 reserved[2]; 768 __u32 reserved[2];
@@ -779,10 +865,10 @@ struct v4l2_modulator
779 865
780struct v4l2_frequency 866struct v4l2_frequency
781{ 867{
782 __u32 tuner; 868 __u32 tuner;
783 enum v4l2_tuner_type type; 869 enum v4l2_tuner_type type;
784 __u32 frequency; 870 __u32 frequency;
785 __u32 reserved[8]; 871 __u32 reserved[8];
786}; 872};
787 873
788/* 874/*
@@ -802,6 +888,7 @@ struct v4l2_audio
802 888
803/* Flags for the 'mode' field */ 889/* Flags for the 'mode' field */
804#define V4L2_AUDMODE_AVL 0x00001 890#define V4L2_AUDMODE_AVL 0x00001
891#define V4L2_AUDMODE_32BITS 0x00002
805 892
806struct v4l2_audioout 893struct v4l2_audioout
807{ 894{
@@ -846,14 +933,14 @@ struct v4l2_vbi_format
846 933
847struct v4l2_sliced_vbi_format 934struct v4l2_sliced_vbi_format
848{ 935{
849 __u16 service_set; 936 __u16 service_set;
850 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field 937 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
851 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field 938 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
852 (equals frame lines 313-336 for 625 line video 939 (equals frame lines 313-336 for 625 line video
853 standards, 263-286 for 525 line standards) */ 940 standards, 263-286 for 525 line standards) */
854 __u16 service_lines[2][24]; 941 __u16 service_lines[2][24];
855 __u32 io_size; 942 __u32 io_size;
856 __u32 reserved[2]; /* must be zero */ 943 __u32 reserved[2]; /* must be zero */
857}; 944};
858 945
859#define V4L2_SLICED_TELETEXT_B (0x0001) 946#define V4L2_SLICED_TELETEXT_B (0x0001)
@@ -866,22 +953,22 @@ struct v4l2_sliced_vbi_format
866 953
867struct v4l2_sliced_vbi_cap 954struct v4l2_sliced_vbi_cap
868{ 955{
869 __u16 service_set; 956 __u16 service_set;
870 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field 957 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
871 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field 958 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
872 (equals frame lines 313-336 for 625 line video 959 (equals frame lines 313-336 for 625 line video
873 standards, 263-286 for 525 line standards) */ 960 standards, 263-286 for 525 line standards) */
874 __u16 service_lines[2][24]; 961 __u16 service_lines[2][24];
875 __u32 reserved[4]; /* must be 0 */ 962 __u32 reserved[4]; /* must be 0 */
876}; 963};
877 964
878struct v4l2_sliced_vbi_data 965struct v4l2_sliced_vbi_data
879{ 966{
880 __u32 id; 967 __u32 id;
881 __u32 field; /* 0: first field, 1: second field */ 968 __u32 field; /* 0: first field, 1: second field */
882 __u32 line; /* 1-23 */ 969 __u32 line; /* 1-23 */
883 __u32 reserved; /* must be 0 */ 970 __u32 reserved; /* must be 0 */
884 __u8 data[48]; 971 __u8 data[48];
885}; 972};
886#endif 973#endif
887 974
@@ -896,9 +983,9 @@ struct v4l2_format
896 enum v4l2_buf_type type; 983 enum v4l2_buf_type type;
897 union 984 union
898 { 985 {
899 struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE 986 struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
900 struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY 987 struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
901 struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE 988 struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
902#if 1 989#if 1
903 struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE 990 struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
904#endif 991#endif
@@ -981,6 +1068,7 @@ struct v4l2_streamparm
981#if 1 1068#if 1
982#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) 1069#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap)
983#endif 1070#endif
1071#define VIDIOC_LOG_STATUS _IO ('V', 70)
984 1072
985/* for compatibility, will go away some day */ 1073/* for compatibility, will go away some day */
986#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) 1074#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index b244f69ef682..1d5577b2b752 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -32,10 +32,14 @@ struct vm_struct {
32 * Highlevel APIs for driver use 32 * Highlevel APIs for driver use
33 */ 33 */
34extern void *vmalloc(unsigned long size); 34extern void *vmalloc(unsigned long size);
35extern void *vmalloc_node(unsigned long size, int node);
35extern void *vmalloc_exec(unsigned long size); 36extern void *vmalloc_exec(unsigned long size);
36extern void *vmalloc_32(unsigned long size); 37extern void *vmalloc_32(unsigned long size);
37extern void *__vmalloc(unsigned long size, unsigned int __nocast gfp_mask, pgprot_t prot); 38extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
38extern void *__vmalloc_area(struct vm_struct *area, unsigned int __nocast gfp_mask, pgprot_t prot); 39extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask,
40 pgprot_t prot);
41extern void *__vmalloc_node(unsigned long size, gfp_t gfp_mask,
42 pgprot_t prot, int node);
39extern void vfree(void *addr); 43extern void vfree(void *addr);
40 44
41extern void *vmap(struct page **pages, unsigned int count, 45extern void *vmap(struct page **pages, unsigned int count,
@@ -48,6 +52,8 @@ extern void vunmap(void *addr);
48extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); 52extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
49extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 53extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
50 unsigned long start, unsigned long end); 54 unsigned long start, unsigned long end);
55extern struct vm_struct *get_vm_area_node(unsigned long size,
56 unsigned long flags, int node);
51extern struct vm_struct *remove_vm_area(void *addr); 57extern struct vm_struct *remove_vm_area(void *addr);
52extern struct vm_struct *__remove_vm_area(void *addr); 58extern struct vm_struct *__remove_vm_area(void *addr);
53extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 59extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
diff --git a/include/linux/wait.h b/include/linux/wait.h
index d38c9fecdc36..d28518236b62 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -54,6 +54,7 @@ struct __wait_queue_head {
54}; 54};
55typedef struct __wait_queue_head wait_queue_head_t; 55typedef struct __wait_queue_head wait_queue_head_t;
56 56
57struct task_struct;
57 58
58/* 59/*
59 * Macros for declaration and initialisaton of the datatypes 60 * Macros for declaration and initialisaton of the datatypes
diff --git a/include/linux/wanpipe.h b/include/linux/wanpipe.h
index 167d956c492b..dae9860091dd 100644
--- a/include/linux/wanpipe.h
+++ b/include/linux/wanpipe.h
@@ -265,15 +265,6 @@ typedef struct {
265#include <linux/tty_driver.h> 265#include <linux/tty_driver.h>
266#include <linux/tty_flip.h> 266#include <linux/tty_flip.h>
267 267
268
269#define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0)
270#define is_alpha(ch) ((((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'z')||\
271 ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'Z'))?1:0)
272#define is_hex_digit(ch) ((((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')||\
273 ((ch)>=(unsigned)'a'&&(ch)<=(unsigned)'f')||\
274 ((ch)>=(unsigned)'A'&&(ch)<=(unsigned)'F'))?1:0)
275
276
277/****** Data Structures *****************************************************/ 268/****** Data Structures *****************************************************/
278 269
279/* Adapter Data Space. 270/* Adapter Data Space.
diff --git a/include/linux/x1205.h b/include/linux/x1205.h
new file mode 100644
index 000000000000..64fd3af894a5
--- /dev/null
+++ b/include/linux/x1205.h
@@ -0,0 +1,31 @@
1/*
2 * x1205.h - defines for drivers/i2c/chips/x1205.c
3 * Copyright 2004 Karen Spearel
4 * Copyright 2005 Alessandro Zummo
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
12#ifndef __LINUX_X1205_H__
13#define __LINUX_X1205_H__
14
15/* commands */
16
17#define X1205_CMD_GETDATETIME 0
18#define X1205_CMD_SETTIME 1
19#define X1205_CMD_SETDATETIME 2
20#define X1205_CMD_GETALARM 3
21#define X1205_CMD_SETALARM 4
22#define X1205_CMD_GETDTRIM 5
23#define X1205_CMD_SETDTRIM 6
24#define X1205_CMD_GETATRIM 7
25#define X1205_CMD_SETATRIM 8
26
27extern int x1205_do_command(unsigned int cmd, void *arg);
28extern int x1205_direct_attach(int adapter_id,
29 struct i2c_client_address_data *address_data);
30
31#endif /* __LINUX_X1205_H__ */
diff --git a/include/linux/zutil.h b/include/linux/zutil.h
index fdfd5ed41ec4..ee0c59cf2136 100644
--- a/include/linux/zutil.h
+++ b/include/linux/zutil.h
@@ -15,7 +15,6 @@
15 15
16#include <linux/zlib.h> 16#include <linux/zlib.h>
17#include <linux/string.h> 17#include <linux/string.h>
18#include <linux/errno.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
20 19
21typedef unsigned char uch; 20typedef unsigned char uch;