aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-01-17 18:34:51 -0500
committerDavid Woodhouse <dwmw2@infradead.org>2007-01-17 18:34:51 -0500
commit9cdf083f981b8d37b3212400a359368661385099 (patch)
treeaa15a6a08ad87e650dea40fb59b3180bef0d345b /include/linux
parente499e01d234a31d59679b7b1e1cf628d917ba49a (diff)
parenta8b3485287731978899ced11f24628c927890e78 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild13
-rw-r--r--include/linux/acct.h1
-rw-r--r--include/linux/acpi.h1
-rw-r--r--include/linux/aio.h5
-rw-r--r--include/linux/ata.h14
-rw-r--r--include/linux/atmarp.h2
-rw-r--r--include/linux/atmbr2684.h4
-rw-r--r--include/linux/atmmpc.h16
-rw-r--r--include/linux/audit.h6
-rw-r--r--include/linux/backlight.h2
-rw-r--r--include/linux/bio.h1
-rw-r--r--include/linux/bitrev.h15
-rw-r--r--include/linux/blkdev.h24
-rw-r--r--include/linux/blktrace_api.h12
-rw-r--r--include/linux/bootmem.h3
-rw-r--r--include/linux/bottom_half.h10
-rw-r--r--include/linux/bug.h47
-rw-r--r--include/linux/carta_random32.h29
-rw-r--r--include/linux/cciss_ioctl.h2
-rw-r--r--include/linux/cdev.h4
-rw-r--r--include/linux/clocksource.h2
-rw-r--r--include/linux/coda_linux.h2
-rw-r--r--include/linux/compiler.h2
-rw-r--r--include/linux/configfs.h25
-rw-r--r--include/linux/connector.h2
-rw-r--r--include/linux/cpu.h39
-rw-r--r--include/linux/cpufreq.h3
-rw-r--r--include/linux/cpuset.h24
-rw-r--r--include/linux/crc32.h4
-rw-r--r--include/linux/crypto.h22
-rw-r--r--include/linux/dccp.h49
-rw-r--r--include/linux/debug_locks.h2
-rw-r--r--include/linux/delayacct.h2
-rw-r--r--include/linux/device-mapper.h7
-rw-r--r--include/linux/device.h59
-rw-r--r--include/linux/divert.h132
-rw-r--r--include/linux/dm-ioctl.h9
-rw-r--r--include/linux/efi.h3
-rw-r--r--include/linux/elevator.h7
-rw-r--r--include/linux/elf.h11
-rw-r--r--include/linux/ext3_jbd.h76
-rw-r--r--include/linux/ext4_jbd2.h76
-rw-r--r--include/linux/fault-inject.h84
-rw-r--r--include/linux/fb.h16
-rw-r--r--include/linux/fib_rules.h3
-rw-r--r--include/linux/file.h24
-rw-r--r--include/linux/freezer.h90
-rw-r--r--include/linux/fs.h88
-rw-r--r--include/linux/fs_stack.h31
-rw-r--r--include/linux/fs_struct.h2
-rw-r--r--include/linux/fsl_devices.h1
-rw-r--r--include/linux/fsnotify.h2
-rw-r--r--include/linux/ftape-header-segment.h122
-rw-r--r--include/linux/ftape-vendors.h137
-rw-r--r--include/linux/ftape.h201
-rw-r--r--include/linux/fuse.h24
-rw-r--r--include/linux/futex.h2
-rw-r--r--include/linux/gameport.h2
-rw-r--r--include/linux/generic_serial.h2
-rw-r--r--include/linux/genetlink.h6
-rw-r--r--include/linux/genhd.h4
-rw-r--r--include/linux/gfp.h3
-rw-r--r--include/linux/gfs2_ondisk.h138
-rw-r--r--include/linux/hid-debug.h757
-rw-r--r--include/linux/hid.h528
-rw-r--r--include/linux/highmem.h17
-rw-r--r--include/linux/hugetlb.h1
-rw-r--r--include/linux/i2c-algo-bit.h5
-rw-r--r--include/linux/i2c-algo-ite.h72
-rw-r--r--include/linux/i2c-algo-pca.h1
-rw-r--r--include/linux/i2c-algo-pcf.h3
-rw-r--r--include/linux/i2c-algo-sgi.h1
-rw-r--r--include/linux/i2c-id.h20
-rw-r--r--include/linux/i2c-pnx.h43
-rw-r--r--include/linux/i2c-pxa.h31
-rw-r--r--include/linux/i2c.h75
-rw-r--r--include/linux/i2o.h22
-rw-r--r--include/linux/icmp.h2
-rw-r--r--include/linux/icmpv6.h12
-rw-r--r--include/linux/ide.h3
-rw-r--r--include/linux/if_addr.h6
-rw-r--r--include/linux/if_fddi.h2
-rw-r--r--include/linux/if_link.h6
-rw-r--r--include/linux/if_packet.h6
-rw-r--r--include/linux/if_tunnel.h8
-rw-r--r--include/linux/igmp.h3
-rw-r--r--include/linux/in.h1
-rw-r--r--include/linux/in6.h4
-rw-r--r--include/linux/inet.h4
-rw-r--r--include/linux/inetdevice.h14
-rw-r--r--include/linux/init.h1
-rw-r--r--include/linux/init_task.h19
-rw-r--r--include/linux/input.h33
-rw-r--r--include/linux/interrupt.h10
-rw-r--r--include/linux/ioport.h4
-rw-r--r--include/linux/ip.h2
-rw-r--r--include/linux/ip6_tunnel.h2
-rw-r--r--include/linux/ipmi.h45
-rw-r--r--include/linux/ipmi_msgdefs.h13
-rw-r--r--include/linux/ipmi_smi.h8
-rw-r--r--include/linux/ipv6.h2
-rw-r--r--include/linux/isdn.h8
-rw-r--r--include/linux/istallion.h36
-rw-r--r--include/linux/ixjuser.h2
-rw-r--r--include/linux/jbd.h3
-rw-r--r--include/linux/jbd2.h3
-rw-r--r--include/linux/jiffies.h2
-rw-r--r--include/linux/kbd_kern.h2
-rw-r--r--include/linux/kernel.h18
-rw-r--r--include/linux/kernelcapi.h2
-rw-r--r--include/linux/kexec.h8
-rw-r--r--include/linux/kobject.h13
-rw-r--r--include/linux/kprobes.h2
-rw-r--r--include/linux/ktime.h4
-rw-r--r--include/linux/kvm.h239
-rw-r--r--include/linux/libata.h59
-rw-r--r--include/linux/lockd/bind.h2
-rw-r--r--include/linux/lockd/lockd.h6
-rw-r--r--include/linux/lockd/sm_inter.h2
-rw-r--r--include/linux/lockd/xdr.h8
-rw-r--r--include/linux/lockdep.h27
-rw-r--r--include/linux/log2.h157
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/miscdevice.h5
-rw-r--r--include/linux/mm.h84
-rw-r--r--include/linux/mmc/card.h13
-rw-r--r--include/linux/mmc/host.h10
-rw-r--r--include/linux/mmc/protocol.h74
-rw-r--r--include/linux/mmzone.h95
-rw-r--r--include/linux/mnt_namespace.h42
-rw-r--r--include/linux/module.h21
-rw-r--r--include/linux/moduleparam.h3
-rw-r--r--include/linux/mount.h5
-rw-r--r--include/linux/mqueue.h2
-rw-r--r--include/linux/msg.h6
-rw-r--r--include/linux/mutex.h4
-rw-r--r--include/linux/mv643xx.h4
-rw-r--r--include/linux/n_r3964.h2
-rw-r--r--include/linux/namei.h5
-rw-r--r--include/linux/namespace.h42
-rw-r--r--include/linux/nbd.h1
-rw-r--r--include/linux/ncp_fs_sb.h8
-rw-r--r--include/linux/ncp_mount.h2
-rw-r--r--include/linux/net.h4
-rw-r--r--include/linux/netdevice.h25
-rw-r--r--include/linux/netfilter.h44
-rw-r--r--include/linux/netfilter/Kbuild2
-rw-r--r--include/linux/netfilter/nf_conntrack_amanda.h10
-rw-r--r--include/linux/netfilter/nf_conntrack_ftp.h20
-rw-r--r--include/linux/netfilter/nf_conntrack_h323.h92
-rw-r--r--include/linux/netfilter/nf_conntrack_h323_asn1.h (renamed from include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h)10
-rw-r--r--include/linux/netfilter/nf_conntrack_h323_types.h (renamed from include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h)12
-rw-r--r--include/linux/netfilter/nf_conntrack_irc.h15
-rw-r--r--include/linux/netfilter/nf_conntrack_pptp.h322
-rw-r--r--include/linux/netfilter/nf_conntrack_proto_gre.h112
-rw-r--r--include/linux/netfilter/nf_conntrack_sctp.h2
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h41
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h2
-rw-r--r--include/linux/netfilter/nf_conntrack_tftp.h20
-rw-r--r--include/linux/netfilter/nfnetlink.h2
-rw-r--r--include/linux/netfilter/nfnetlink_log.h12
-rw-r--r--include/linux/netfilter/nfnetlink_queue.h19
-rw-r--r--include/linux/netfilter/xt_NFLOG.h18
-rw-r--r--include/linux/netfilter/xt_conntrack.h4
-rw-r--r--include/linux/netfilter/xt_hashlimit.h40
-rw-r--r--include/linux/netfilter/xt_policy.h2
-rw-r--r--include/linux/netfilter_arp/arp_tables.h1
-rw-r--r--include/linux/netfilter_bridge.h3
-rw-r--r--include/linux/netfilter_bridge/ebt_802_3.h10
-rw-r--r--include/linux/netfilter_bridge/ebt_among.h2
-rw-r--r--include/linux/netfilter_bridge/ebt_arp.h14
-rw-r--r--include/linux/netfilter_bridge/ebt_ip.h8
-rw-r--r--include/linux/netfilter_bridge/ebt_nat.h1
-rw-r--r--include/linux/netfilter_bridge/ebt_vlan.h2
-rw-r--r--include/linux/netfilter_bridge/ebtables.h25
-rw-r--r--include/linux/netfilter_ipv4.h4
-rw-r--r--include/linux/netfilter_ipv4/Kbuild2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h3
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_ftp.h40
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_h323.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h4
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_sip.h34
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_tftp.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_LOG.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_hashlimit.h42
-rw-r--r--include/linux/netfilter_ipv6.h4
-rw-r--r--include/linux/netfilter_ipv6/ip6t_LOG.h2
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/netpoll.h15
-rw-r--r--include/linux/nfs_fs.h39
-rw-r--r--include/linux/nfs_fs_sb.h2
-rw-r--r--include/linux/nfs_page.h7
-rw-r--r--include/linux/nfs_xdr.h2
-rw-r--r--include/linux/nfsd/nfsd.h4
-rw-r--r--include/linux/nfsd/state.h1
-rw-r--r--include/linux/nfsd/xdr4.h40
-rw-r--r--include/linux/nmi.h5
-rw-r--r--include/linux/nsproxy.h6
-rw-r--r--include/linux/page-flags.h8
-rw-r--r--include/linux/pata_platform.h13
-rw-r--r--include/linux/pci.h32
-rw-r--r--include/linux/pci_ids.h33
-rw-r--r--include/linux/pci_regs.h25
-rw-r--r--include/linux/pfkeyv2.h5
-rw-r--r--include/linux/phy.h30
-rw-r--r--include/linux/pid.h5
-rw-r--r--include/linux/pid_namespace.h45
-rw-r--r--include/linux/pipe_fs_i.h5
-rw-r--r--include/linux/pktcdvd.h25
-rw-r--r--include/linux/platform_device.h8
-rw-r--r--include/linux/poll.h3
-rw-r--r--include/linux/profile.h25
-rw-r--r--include/linux/pspace.h23
-rw-r--r--include/linux/quotaops.h3
-rw-r--r--include/linux/radix-tree.h102
-rw-r--r--include/linux/raid/raid5.h5
-rw-r--r--include/linux/random.h20
-rw-r--r--include/linux/reciprocal_div.h32
-rw-r--r--include/linux/reiserfs_fs.h46
-rw-r--r--include/linux/reiserfs_fs_sb.h5
-rw-r--r--include/linux/relay.h4
-rw-r--r--include/linux/rmap.h6
-rw-r--r--include/linux/rtc.h1
-rw-r--r--include/linux/rtmutex.h2
-rw-r--r--include/linux/rtnetlink.h7
-rw-r--r--include/linux/rwsem-spinlock.h3
-rw-r--r--include/linux/sched.h142
-rw-r--r--include/linux/screen_info.h3
-rw-r--r--include/linux/sctp.h80
-rw-r--r--include/linux/security.h56
-rw-r--r--include/linux/seq_file.h4
-rw-r--r--include/linux/seqlock.h7
-rw-r--r--include/linux/serial_8250.h1
-rw-r--r--include/linux/serial_core.h10
-rw-r--r--include/linux/serio.h12
-rw-r--r--include/linux/signal.h2
-rw-r--r--include/linux/skbuff.h56
-rw-r--r--include/linux/slab.h338
-rw-r--r--include/linux/slab_def.h100
-rw-r--r--include/linux/smb_fs_sb.h2
-rw-r--r--include/linux/smp.h7
-rw-r--r--include/linux/socket.h3
-rw-r--r--include/linux/sockios.h4
-rw-r--r--include/linux/spi/spi.h2
-rw-r--r--include/linux/spinlock.h1
-rw-r--r--include/linux/stallion.h52
-rw-r--r--include/linux/start_kernel.h12
-rw-r--r--include/linux/sunrpc/auth_gss.h2
-rw-r--r--include/linux/sunrpc/clnt.h1
-rw-r--r--include/linux/sunrpc/debug.h6
-rw-r--r--include/linux/sunrpc/gss_krb5.h6
-rw-r--r--include/linux/sunrpc/gss_spkm3.h34
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
-rw-r--r--include/linux/sunrpc/sched.h15
-rw-r--r--include/linux/sunrpc/xdr.h25
-rw-r--r--include/linux/sunrpc/xprt.h37
-rw-r--r--include/linux/suspend.h9
-rw-r--r--include/linux/swap.h6
-rw-r--r--include/linux/sysctl.h19
-rw-r--r--include/linux/sysfs.h8
-rw-r--r--include/linux/sysrq.h22
-rw-r--r--include/linux/task_io_accounting.h37
-rw-r--r--include/linux/task_io_accounting_ops.h47
-rw-r--r--include/linux/taskstats.h28
-rw-r--r--include/linux/taskstats_kern.h43
-rw-r--r--include/linux/tcp.h190
-rw-r--r--include/linux/textsearch.h4
-rw-r--r--include/linux/tfrc.h28
-rw-r--r--include/linux/timer.h6
-rw-r--r--include/linux/tipc_config.h32
-rw-r--r--include/linux/topology.h5
-rw-r--r--include/linux/tty.h27
-rw-r--r--include/linux/tty_driver.h12
-rw-r--r--include/linux/tty_ldisc.h4
-rw-r--r--include/linux/types.h18
-rw-r--r--include/linux/uaccess.h49
-rw-r--r--include/linux/udp.h14
-rw-r--r--include/linux/unwind.h63
-rw-r--r--include/linux/usb.h183
-rw-r--r--include/linux/usb/serial.h2
-rw-r--r--include/linux/videodev2.h1
-rw-r--r--include/linux/vmstat.h11
-rw-r--r--include/linux/wireless.h2
-rw-r--r--include/linux/workqueue.h166
-rw-r--r--include/linux/xfrm.h8
-rw-r--r--include/linux/zftape.h87
286 files changed, 5706 insertions, 2697 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index a1155a2beb32..862e483cce8a 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -60,10 +60,7 @@ header-y += fadvise.h
60header-y += fd.h 60header-y += fd.h
61header-y += fdreg.h 61header-y += fdreg.h
62header-y += fib_rules.h 62header-y += fib_rules.h
63header-y += ftape-header-segment.h
64header-y += ftape-vendors.h
65header-y += fuse.h 63header-y += fuse.h
66header-y += futex.h
67header-y += genetlink.h 64header-y += genetlink.h
68header-y += gen_stats.h 65header-y += gen_stats.h
69header-y += gigaset_dev.h 66header-y += gigaset_dev.h
@@ -122,7 +119,6 @@ header-y += nfs4_mount.h
122header-y += nfs_mount.h 119header-y += nfs_mount.h
123header-y += oom.h 120header-y += oom.h
124header-y += param.h 121header-y += param.h
125header-y += pci_ids.h
126header-y += pci_regs.h 122header-y += pci_regs.h
127header-y += personality.h 123header-y += personality.h
128header-y += pfkeyv2.h 124header-y += pfkeyv2.h
@@ -141,7 +137,6 @@ header-y += radeonfb.h
141header-y += raw.h 137header-y += raw.h
142header-y += resource.h 138header-y += resource.h
143header-y += rose.h 139header-y += rose.h
144header-y += sctp.h
145header-y += smbno.h 140header-y += smbno.h
146header-y += snmp.h 141header-y += snmp.h
147header-y += sockios.h 142header-y += sockios.h
@@ -165,7 +160,6 @@ header-y += vt.h
165header-y += wireless.h 160header-y += wireless.h
166header-y += xattr.h 161header-y += xattr.h
167header-y += x25.h 162header-y += x25.h
168header-y += zorro_ids.h
169 163
170unifdef-y += acct.h 164unifdef-y += acct.h
171unifdef-y += adb.h 165unifdef-y += adb.h
@@ -193,7 +187,6 @@ unifdef-y += cuda.h
193unifdef-y += cyclades.h 187unifdef-y += cyclades.h
194unifdef-y += dccp.h 188unifdef-y += dccp.h
195unifdef-y += dirent.h 189unifdef-y += dirent.h
196unifdef-y += divert.h
197unifdef-y += dlm.h 190unifdef-y += dlm.h
198unifdef-y += elfcore.h 191unifdef-y += elfcore.h
199unifdef-y += errno.h 192unifdef-y += errno.h
@@ -206,8 +199,8 @@ unifdef-y += fb.h
206unifdef-y += fcntl.h 199unifdef-y += fcntl.h
207unifdef-y += filter.h 200unifdef-y += filter.h
208unifdef-y += flat.h 201unifdef-y += flat.h
202unifdef-y += futex.h
209unifdef-y += fs.h 203unifdef-y += fs.h
210unifdef-y += ftape.h
211unifdef-y += gameport.h 204unifdef-y += gameport.h
212unifdef-y += generic_serial.h 205unifdef-y += generic_serial.h
213unifdef-y += genhd.h 206unifdef-y += genhd.h
@@ -225,6 +218,7 @@ unifdef-y += if_bridge.h
225unifdef-y += if_ec.h 218unifdef-y += if_ec.h
226unifdef-y += if_eql.h 219unifdef-y += if_eql.h
227unifdef-y += if_ether.h 220unifdef-y += if_ether.h
221unifdef-y += if_fddi.h
228unifdef-y += if_frad.h 222unifdef-y += if_frad.h
229unifdef-y += if_ltalk.h 223unifdef-y += if_ltalk.h
230unifdef-y += if_pppox.h 224unifdef-y += if_pppox.h
@@ -286,6 +280,7 @@ unifdef-y += nvram.h
286unifdef-y += parport.h 280unifdef-y += parport.h
287unifdef-y += patchkey.h 281unifdef-y += patchkey.h
288unifdef-y += pci.h 282unifdef-y += pci.h
283unifdef-y += personality.h
289unifdef-y += pktcdvd.h 284unifdef-y += pktcdvd.h
290unifdef-y += pmu.h 285unifdef-y += pmu.h
291unifdef-y += poll.h 286unifdef-y += poll.h
@@ -341,7 +336,7 @@ unifdef-y += videodev.h
341unifdef-y += wait.h 336unifdef-y += wait.h
342unifdef-y += wanrouter.h 337unifdef-y += wanrouter.h
343unifdef-y += watchdog.h 338unifdef-y += watchdog.h
339unifdef-y += wireless.h
344unifdef-y += xfrm.h 340unifdef-y += xfrm.h
345unifdef-y += zftape.h
346 341
347objhdr-y += version.h 342objhdr-y += version.h
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 0496d1f09952..302eb727ecb8 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -119,6 +119,7 @@ struct acct_v3
119#ifdef CONFIG_BSD_PROCESS_ACCT 119#ifdef CONFIG_BSD_PROCESS_ACCT
120struct vfsmount; 120struct vfsmount;
121struct super_block; 121struct super_block;
122struct pacct_struct;
122extern void acct_auto_close_mnt(struct vfsmount *m); 123extern void acct_auto_close_mnt(struct vfsmount *m);
123extern void acct_auto_close(struct super_block *sb); 124extern void acct_auto_close(struct super_block *sb);
124extern void acct_init_pacct(struct pacct_struct *pacct); 125extern void acct_init_pacct(struct pacct_struct *pacct);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 2b0c955590fe..91f1f2363870 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -47,6 +47,7 @@ enum acpi_irq_model_id {
47 ACPI_IRQ_MODEL_PIC = 0, 47 ACPI_IRQ_MODEL_PIC = 0,
48 ACPI_IRQ_MODEL_IOAPIC, 48 ACPI_IRQ_MODEL_IOAPIC,
49 ACPI_IRQ_MODEL_IOSAPIC, 49 ACPI_IRQ_MODEL_IOSAPIC,
50 ACPI_IRQ_MODEL_PLATFORM,
50 ACPI_IRQ_MODEL_COUNT 51 ACPI_IRQ_MODEL_COUNT
51}; 52};
52 53
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 0d71c0041f13..a30ef13c9e62 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -105,13 +105,13 @@ struct kiocb {
105 wait_queue_t ki_wait; 105 wait_queue_t ki_wait;
106 loff_t ki_pos; 106 loff_t ki_pos;
107 107
108 atomic_t ki_bio_count; /* num bio used for this iocb */
108 void *private; 109 void *private;
109 /* State that we remember to be able to restart/retry */ 110 /* State that we remember to be able to restart/retry */
110 unsigned short ki_opcode; 111 unsigned short ki_opcode;
111 size_t ki_nbytes; /* copy of iocb->aio_nbytes */ 112 size_t ki_nbytes; /* copy of iocb->aio_nbytes */
112 char __user *ki_buf; /* remaining iocb->aio_buf */ 113 char __user *ki_buf; /* remaining iocb->aio_buf */
113 size_t ki_left; /* remaining bytes */ 114 size_t ki_left; /* remaining bytes */
114 long ki_retried; /* just for testing */
115 struct iovec ki_inline_vec; /* inline vector */ 115 struct iovec ki_inline_vec; /* inline vector */
116 struct iovec *ki_iovec; 116 struct iovec *ki_iovec;
117 unsigned long ki_nr_segs; 117 unsigned long ki_nr_segs;
@@ -194,7 +194,7 @@ struct kioctx {
194 194
195 struct aio_ring_info ring_info; 195 struct aio_ring_info ring_info;
196 196
197 struct work_struct wq; 197 struct delayed_work wq;
198}; 198};
199 199
200/* prototypes */ 200/* prototypes */
@@ -238,7 +238,6 @@ do { \
238} while (0) 238} while (0)
239 239
240#define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait) 240#define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait)
241#define is_retried_kiocb(iocb) ((iocb)->ki_retried > 1)
242 241
243#include <linux/aio_abi.h> 242#include <linux/aio_abi.h>
244 243
diff --git a/include/linux/ata.h b/include/linux/ata.h
index d89441907024..1df941648a57 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -200,8 +200,9 @@ enum {
200 ATA_CBL_NONE = 0, 200 ATA_CBL_NONE = 0,
201 ATA_CBL_PATA40 = 1, 201 ATA_CBL_PATA40 = 1,
202 ATA_CBL_PATA80 = 2, 202 ATA_CBL_PATA80 = 2,
203 ATA_CBL_PATA_UNK = 3, 203 ATA_CBL_PATA40_SHORT = 3, /* 40 wire cable to high UDMA spec */
204 ATA_CBL_SATA = 4, 204 ATA_CBL_PATA_UNK = 4,
205 ATA_CBL_SATA = 5,
205 206
206 /* SATA Status and Control Registers */ 207 /* SATA Status and Control Registers */
207 SCR_STATUS = 0, 208 SCR_STATUS = 0,
@@ -342,6 +343,15 @@ static inline int ata_id_is_cfa(const u16 *id)
342 return 0; 343 return 0;
343} 344}
344 345
346static inline int ata_drive_40wire(const u16 *dev_id)
347{
348 if (ata_id_major_version(dev_id) >= 5 && ata_id_is_sata(dev_id))
349 return 0; /* SATA */
350 if (dev_id[93] & 0x4000)
351 return 0; /* 80 wire */
352 return 1;
353}
354
345static inline int atapi_cdb_len(const u16 *dev_id) 355static inline int atapi_cdb_len(const u16 *dev_id)
346{ 356{
347 u16 tmp = dev_id[0] & 0x3; 357 u16 tmp = dev_id[0] & 0x3;
diff --git a/include/linux/atmarp.h b/include/linux/atmarp.h
index 24f82338f59a..ee108f9e9cb7 100644
--- a/include/linux/atmarp.h
+++ b/include/linux/atmarp.h
@@ -37,7 +37,7 @@ enum atmarp_ctrl_type {
37struct atmarp_ctrl { 37struct atmarp_ctrl {
38 enum atmarp_ctrl_type type; /* message type */ 38 enum atmarp_ctrl_type type; /* message type */
39 int itf_num;/* interface number (if present) */ 39 int itf_num;/* interface number (if present) */
40 uint32_t ip; /* IP address (act_need only) */ 40 __be32 ip; /* IP address (act_need only) */
41}; 41};
42 42
43#endif 43#endif
diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h
index 7981b733f1ef..969fb6c9e1cc 100644
--- a/include/linux/atmbr2684.h
+++ b/include/linux/atmbr2684.h
@@ -86,8 +86,8 @@ struct atm_backend_br2684 {
86 * efficient per-if in/out filters, this support will be removed 86 * efficient per-if in/out filters, this support will be removed
87 */ 87 */
88struct br2684_filter { 88struct br2684_filter {
89 __u32 prefix; /* network byte order */ 89 __be32 prefix; /* network byte order */
90 __u32 netmask; /* 0 = disable filter */ 90 __be32 netmask; /* 0 = disable filter */
91}; 91};
92 92
93struct br2684_filter_set { 93struct br2684_filter_set {
diff --git a/include/linux/atmmpc.h b/include/linux/atmmpc.h
index 5fbfa68136d3..ea1650425a12 100644
--- a/include/linux/atmmpc.h
+++ b/include/linux/atmmpc.h
@@ -13,7 +13,7 @@
13 13
14struct atmmpc_ioc { 14struct atmmpc_ioc {
15 int dev_num; 15 int dev_num;
16 uint32_t ipaddr; /* the IP address of the shortcut */ 16 __be32 ipaddr; /* the IP address of the shortcut */
17 int type; /* ingress or egress */ 17 int type; /* ingress or egress */
18}; 18};
19 19
@@ -21,8 +21,8 @@ typedef struct in_ctrl_info {
21 uint8_t Last_NHRP_CIE_code; 21 uint8_t Last_NHRP_CIE_code;
22 uint8_t Last_Q2931_cause_value; 22 uint8_t Last_Q2931_cause_value;
23 uint8_t eg_MPC_ATM_addr[ATM_ESA_LEN]; 23 uint8_t eg_MPC_ATM_addr[ATM_ESA_LEN];
24 uint32_t tag; 24 __be32 tag;
25 uint32_t in_dst_ip; /* IP address this ingress MPC sends packets to */ 25 __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */
26 uint16_t holding_time; 26 uint16_t holding_time;
27 uint32_t request_id; 27 uint32_t request_id;
28} in_ctrl_info; 28} in_ctrl_info;
@@ -30,10 +30,10 @@ typedef struct in_ctrl_info {
30typedef struct eg_ctrl_info { 30typedef struct eg_ctrl_info {
31 uint8_t DLL_header[256]; 31 uint8_t DLL_header[256];
32 uint8_t DH_length; 32 uint8_t DH_length;
33 uint32_t cache_id; 33 __be32 cache_id;
34 uint32_t tag; 34 __be32 tag;
35 uint32_t mps_ip; 35 __be32 mps_ip;
36 uint32_t eg_dst_ip; /* IP address to which ingress MPC sends packets */ 36 __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */
37 uint8_t in_MPC_data_ATM_addr[ATM_ESA_LEN]; 37 uint8_t in_MPC_data_ATM_addr[ATM_ESA_LEN];
38 uint16_t holding_time; 38 uint16_t holding_time;
39} eg_ctrl_info; 39} eg_ctrl_info;
@@ -49,7 +49,7 @@ struct mpc_parameters {
49 49
50struct k_message { 50struct k_message {
51 uint16_t type; 51 uint16_t type;
52 uint32_t ip_mask; 52 __be32 ip_mask;
53 uint8_t MPS_ctrl[ATM_ESA_LEN]; 53 uint8_t MPS_ctrl[ATM_ESA_LEN];
54 union { 54 union {
55 in_ctrl_info in_info; 55 in_ctrl_info in_info;
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b2ca666d9997..0e07db6cc0d0 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -101,6 +101,10 @@
101#define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */ 101#define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */
102#define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */ 102#define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */
103#define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */ 103#define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */
104#define AUDIT_MAC_IPSEC_ADDSA 1411 /* Add a XFRM state */
105#define AUDIT_MAC_IPSEC_DELSA 1412 /* Delete a XFRM state */
106#define AUDIT_MAC_IPSEC_ADDSPD 1413 /* Add a XFRM policy */
107#define AUDIT_MAC_IPSEC_DELSPD 1414 /* Delete a XFRM policy */
104 108
105#define AUDIT_FIRST_KERN_ANOM_MSG 1700 109#define AUDIT_FIRST_KERN_ANOM_MSG 1700
106#define AUDIT_LAST_KERN_ANOM_MSG 1799 110#define AUDIT_LAST_KERN_ANOM_MSG 1799
@@ -377,6 +381,7 @@ extern void auditsc_get_stamp(struct audit_context *ctx,
377 struct timespec *t, unsigned int *serial); 381 struct timespec *t, unsigned int *serial);
378extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); 382extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
379extern uid_t audit_get_loginuid(struct audit_context *ctx); 383extern uid_t audit_get_loginuid(struct audit_context *ctx);
384extern void audit_log_task_context(struct audit_buffer *ab);
380extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp); 385extern int __audit_ipc_obj(struct kern_ipc_perm *ipcp);
381extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); 386extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode);
382extern int audit_bprm(struct linux_binprm *bprm); 387extern int audit_bprm(struct linux_binprm *bprm);
@@ -449,6 +454,7 @@ extern int audit_n_rules;
449#define audit_inode_update(i) do { ; } while (0) 454#define audit_inode_update(i) do { ; } while (0)
450#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) 455#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
451#define audit_get_loginuid(c) ({ -1; }) 456#define audit_get_loginuid(c) ({ -1; })
457#define audit_log_task_context(b) do { ; } while (0)
452#define audit_ipc_obj(i) ({ 0; }) 458#define audit_ipc_obj(i) ({ 0; })
453#define audit_ipc_set_perm(q,u,g,m) ({ 0; }) 459#define audit_ipc_set_perm(q,u,g,m) ({ 0; })
454#define audit_bprm(p) ({ 0; }) 460#define audit_bprm(p) ({ 0; })
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 75e91f5b6a04..a5cf1beacb44 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -54,7 +54,7 @@ struct backlight_device {
54}; 54};
55 55
56extern struct backlight_device *backlight_device_register(const char *name, 56extern struct backlight_device *backlight_device_register(const char *name,
57 void *devdata, struct backlight_properties *bp); 57 struct device *dev,void *devdata,struct backlight_properties *bp);
58extern void backlight_device_unregister(struct backlight_device *bd); 58extern void backlight_device_unregister(struct backlight_device *bd);
59 59
60#define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev) 60#define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 092dbd0e7658..08daf3272c02 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -309,6 +309,7 @@ extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
309 gfp_t); 309 gfp_t);
310extern void bio_set_pages_dirty(struct bio *bio); 310extern void bio_set_pages_dirty(struct bio *bio);
311extern void bio_check_pages_dirty(struct bio *bio); 311extern void bio_check_pages_dirty(struct bio *bio);
312extern void bio_release_pages(struct bio *bio);
312extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); 313extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
313extern int bio_uncopy_user(struct bio *); 314extern int bio_uncopy_user(struct bio *);
314void zero_fill_bio(struct bio *bio); 315void zero_fill_bio(struct bio *bio);
diff --git a/include/linux/bitrev.h b/include/linux/bitrev.h
new file mode 100644
index 000000000000..05e540d6963a
--- /dev/null
+++ b/include/linux/bitrev.h
@@ -0,0 +1,15 @@
1#ifndef _LINUX_BITREV_H
2#define _LINUX_BITREV_H
3
4#include <linux/types.h>
5
6extern u8 const byte_rev_table[256];
7
8static inline u8 bitrev8(u8 byte)
9{
10 return byte_rev_table[byte];
11}
12
13extern u32 bitrev32(u32 in);
14
15#endif /* _LINUX_BITREV_H */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 7bfcde2d5578..36a6eacefe20 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -331,10 +331,6 @@ struct request_pm_state
331 331
332#include <linux/elevator.h> 332#include <linux/elevator.h>
333 333
334typedef int (merge_request_fn) (request_queue_t *, struct request *,
335 struct bio *);
336typedef int (merge_requests_fn) (request_queue_t *, struct request *,
337 struct request *);
338typedef void (request_fn_proc) (request_queue_t *q); 334typedef void (request_fn_proc) (request_queue_t *q);
339typedef int (make_request_fn) (request_queue_t *q, struct bio *bio); 335typedef int (make_request_fn) (request_queue_t *q, struct bio *bio);
340typedef int (prep_rq_fn) (request_queue_t *, struct request *); 336typedef int (prep_rq_fn) (request_queue_t *, struct request *);
@@ -342,7 +338,6 @@ typedef void (unplug_fn) (request_queue_t *);
342 338
343struct bio_vec; 339struct bio_vec;
344typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); 340typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *);
345typedef void (activity_fn) (void *data, int rw);
346typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); 341typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *);
347typedef void (prepare_flush_fn) (request_queue_t *, struct request *); 342typedef void (prepare_flush_fn) (request_queue_t *, struct request *);
348typedef void (softirq_done_fn)(struct request *); 343typedef void (softirq_done_fn)(struct request *);
@@ -377,14 +372,10 @@ struct request_queue
377 struct request_list rq; 372 struct request_list rq;
378 373
379 request_fn_proc *request_fn; 374 request_fn_proc *request_fn;
380 merge_request_fn *back_merge_fn;
381 merge_request_fn *front_merge_fn;
382 merge_requests_fn *merge_requests_fn;
383 make_request_fn *make_request_fn; 375 make_request_fn *make_request_fn;
384 prep_rq_fn *prep_rq_fn; 376 prep_rq_fn *prep_rq_fn;
385 unplug_fn *unplug_fn; 377 unplug_fn *unplug_fn;
386 merge_bvec_fn *merge_bvec_fn; 378 merge_bvec_fn *merge_bvec_fn;
387 activity_fn *activity_fn;
388 issue_flush_fn *issue_flush_fn; 379 issue_flush_fn *issue_flush_fn;
389 prepare_flush_fn *prepare_flush_fn; 380 prepare_flush_fn *prepare_flush_fn;
390 softirq_done_fn *softirq_done_fn; 381 softirq_done_fn *softirq_done_fn;
@@ -411,8 +402,6 @@ struct request_queue
411 */ 402 */
412 void *queuedata; 403 void *queuedata;
413 404
414 void *activity_data;
415
416 /* 405 /*
417 * queue needs bounce pages for pages above this limit 406 * queue needs bounce pages for pages above this limit
418 */ 407 */
@@ -653,6 +642,11 @@ extern int sg_scsi_ioctl(struct file *, struct request_queue *,
653 struct gendisk *, struct scsi_ioctl_command __user *); 642 struct gendisk *, struct scsi_ioctl_command __user *);
654 643
655/* 644/*
645 * Temporary export, until SCSI gets fixed up.
646 */
647extern int ll_back_merge_fn(request_queue_t *, struct request *, struct bio *);
648
649/*
656 * A queue has just exitted congestion. Note this in the global counter of 650 * A queue has just exitted congestion. Note this in the global counter of
657 * congested queues, and wake up anyone who was waiting for requests to be 651 * congested queues, and wake up anyone who was waiting for requests to be
658 * put back. 652 * put back.
@@ -677,11 +671,11 @@ extern void blk_sync_queue(struct request_queue *q);
677extern void __blk_stop_queue(request_queue_t *q); 671extern void __blk_stop_queue(request_queue_t *q);
678extern void blk_run_queue(request_queue_t *); 672extern void blk_run_queue(request_queue_t *);
679extern void blk_start_queueing(request_queue_t *); 673extern void blk_start_queueing(request_queue_t *);
680extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); 674extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long);
681extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); 675extern int blk_rq_unmap_user(struct bio *);
682extern int blk_rq_unmap_user(struct bio *, unsigned int);
683extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); 676extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t);
684extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); 677extern int blk_rq_map_user_iov(request_queue_t *, struct request *,
678 struct sg_iovec *, int, unsigned int);
685extern int blk_execute_rq(request_queue_t *, struct gendisk *, 679extern int blk_execute_rq(request_queue_t *, struct gendisk *,
686 struct request *, int); 680 struct request *, int);
687extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, 681extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *,
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index b99a714fcac6..3680ff9a30ed 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -50,6 +50,15 @@ enum blktrace_act {
50}; 50};
51 51
52/* 52/*
53 * Notify events.
54 */
55enum blktrace_notify {
56 __BLK_TN_PROCESS = 0, /* establish pid/name mapping */
57 __BLK_TN_TIMESTAMP, /* include system clock */
58};
59
60
61/*
53 * Trace actions in full. Additionally, read or write is masked 62 * Trace actions in full. Additionally, read or write is masked
54 */ 63 */
55#define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE)) 64#define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE))
@@ -68,6 +77,9 @@ enum blktrace_act {
68#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) 77#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE)
69#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) 78#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
70 79
80#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
81#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
82
71#define BLK_IO_TRACE_MAGIC 0x65617400 83#define BLK_IO_TRACE_MAGIC 0x65617400
72#define BLK_IO_TRACE_VERSION 0x07 84#define BLK_IO_TRACE_VERSION 0x07
73 85
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 31e9abb6d977..2275f2748708 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -119,8 +119,7 @@ extern void *alloc_large_system_hash(const char *tablename,
119 unsigned int *_hash_mask, 119 unsigned int *_hash_mask,
120 unsigned long limit); 120 unsigned long limit);
121 121
122#define HASH_HIGHMEM 0x00000001 /* Consider highmem? */ 122#define HASH_EARLY 0x00000001 /* Allocating during early boot? */
123#define HASH_EARLY 0x00000002 /* Allocating during early boot? */
124 123
125/* Only NUMA needs hash distribution. 124/* Only NUMA needs hash distribution.
126 * IA64 is known to have sufficient vmalloc space. 125 * IA64 is known to have sufficient vmalloc space.
diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h
new file mode 100644
index 000000000000..777dbf695d44
--- /dev/null
+++ b/include/linux/bottom_half.h
@@ -0,0 +1,10 @@
1#ifndef _LINUX_BH_H
2#define _LINUX_BH_H
3
4extern void local_bh_disable(void);
5extern void __local_bh_enable(void);
6extern void _local_bh_enable(void);
7extern void local_bh_enable(void);
8extern void local_bh_enable_ip(unsigned long ip);
9
10#endif /* _LINUX_BH_H */
diff --git a/include/linux/bug.h b/include/linux/bug.h
new file mode 100644
index 000000000000..42aa0a54b6f4
--- /dev/null
+++ b/include/linux/bug.h
@@ -0,0 +1,47 @@
1#ifndef _LINUX_BUG_H
2#define _LINUX_BUG_H
3
4#include <linux/module.h>
5#include <asm/bug.h>
6
7enum bug_trap_type {
8 BUG_TRAP_TYPE_NONE = 0,
9 BUG_TRAP_TYPE_WARN = 1,
10 BUG_TRAP_TYPE_BUG = 2,
11};
12
13#ifdef CONFIG_GENERIC_BUG
14#include <asm-generic/bug.h>
15
16static inline int is_warning_bug(const struct bug_entry *bug)
17{
18 return bug->flags & BUGFLAG_WARNING;
19}
20
21const struct bug_entry *find_bug(unsigned long bugaddr);
22
23enum bug_trap_type report_bug(unsigned long bug_addr);
24
25int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
26 struct module *);
27void module_bug_cleanup(struct module *);
28
29/* These are defined by the architecture */
30int is_valid_bugaddr(unsigned long addr);
31
32#else /* !CONFIG_GENERIC_BUG */
33
34static inline enum bug_trap_type report_bug(unsigned long bug_addr)
35{
36 return BUG_TRAP_TYPE_BUG;
37}
38static inline int module_bug_finalize(const Elf_Ehdr *hdr,
39 const Elf_Shdr *sechdrs,
40 struct module *mod)
41{
42 return 0;
43}
44static inline void module_bug_cleanup(struct module *mod) {}
45
46#endif /* CONFIG_GENERIC_BUG */
47#endif /* _LINUX_BUG_H */
diff --git a/include/linux/carta_random32.h b/include/linux/carta_random32.h
deleted file mode 100644
index f6f3bd9f20b5..000000000000
--- a/include/linux/carta_random32.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * Fast, simple, yet decent quality random number generator based on
3 * a paper by David G. Carta ("Two Fast Implementations of the
4 * `Minimal Standard' Random Number Generator," Communications of the
5 * ACM, January, 1990).
6 *
7 * Copyright (c) 2002-2006 Hewlett-Packard Development Company, L.P.
8 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 * 02111-1307 USA
23 */
24#ifndef _LINUX_CARTA_RANDOM32_H_
25#define _LINUX_CARTA_RANDOM32_H_
26
27u64 carta_random32(u64 seed);
28
29#endif /* _LINUX_CARTA_RANDOM32_H_ */
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index 6e27f42e3a57..cb57c30081a8 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -80,7 +80,7 @@ typedef __u32 DriverVer_type;
80#define HWORD __u16 80#define HWORD __u16
81#define DWORD __u32 81#define DWORD __u32
82 82
83#define CISS_MAX_LUN 16 83#define CISS_MAX_LUN 1024
84 84
85#define LEVEL2LUN 1 // index into Target(x) structure, due to byte swapping 85#define LEVEL2LUN 1 // index into Target(x) structure, due to byte swapping
86#define LEVEL3LUN 0 86#define LEVEL3LUN 0
diff --git a/include/linux/cdev.h b/include/linux/cdev.h
index ee5f53f2ca15..f309b00e986e 100644
--- a/include/linux/cdev.h
+++ b/include/linux/cdev.h
@@ -2,6 +2,10 @@
2#define _LINUX_CDEV_H 2#define _LINUX_CDEV_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5#include <linux/kobject.h>
6#include <linux/kdev_t.h>
7#include <linux/list.h>
8
5struct cdev { 9struct cdev {
6 struct kobject kobj; 10 struct kobject kobj;
7 struct module *owner; 11 struct module *owner;
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index d852024ed095..1622d23a8dc3 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -159,7 +159,7 @@ static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles)
159 * Unless you're the timekeeping code, you should not be using this! 159 * Unless you're the timekeeping code, you should not be using this!
160 */ 160 */
161static inline void clocksource_calculate_interval(struct clocksource *c, 161static inline void clocksource_calculate_interval(struct clocksource *c,
162 unsigned long length_nsec) 162 unsigned long length_nsec)
163{ 163{
164 u64 tmp; 164 u64 tmp;
165 165
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h
index be512cc98791..4c2632a8d31b 100644
--- a/include/linux/coda_linux.h
+++ b/include/linux/coda_linux.h
@@ -64,7 +64,7 @@ void coda_sysctl_clean(void);
64 64
65#define CODA_ALLOC(ptr, cast, size) do { \ 65#define CODA_ALLOC(ptr, cast, size) do { \
66 if (size < PAGE_SIZE) \ 66 if (size < PAGE_SIZE) \
67 ptr = (cast)kmalloc((unsigned long) size, GFP_KERNEL); \ 67 ptr = kmalloc((unsigned long) size, GFP_KERNEL); \
68 else \ 68 else \
69 ptr = (cast)vmalloc((unsigned long) size); \ 69 ptr = (cast)vmalloc((unsigned long) size); \
70 if (!ptr) \ 70 if (!ptr) \
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 538423d4a865..aca66984aafd 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -40,7 +40,7 @@ extern void __chk_io_ptr(void __iomem *);
40#error no compiler-gcc.h file for this gcc version 40#error no compiler-gcc.h file for this gcc version
41#elif __GNUC__ == 4 41#elif __GNUC__ == 4
42# include <linux/compiler-gcc4.h> 42# include <linux/compiler-gcc4.h>
43#elif __GNUC__ == 3 43#elif __GNUC__ == 3 && __GNUC_MINOR__ >= 2
44# include <linux/compiler-gcc3.h> 44# include <linux/compiler-gcc3.h>
45#else 45#else
46# error Sorry, your compiler is too old/not recognized. 46# error Sorry, your compiler is too old/not recognized.
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index a7f015027535..fef6f3d0a4a7 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -160,31 +160,6 @@ struct configfs_group_operations {
160 void (*drop_item)(struct config_group *group, struct config_item *item); 160 void (*drop_item)(struct config_group *group, struct config_item *item);
161}; 161};
162 162
163
164
165/**
166 * Use these macros to make defining attributes easier. See include/linux/device.h
167 * for examples..
168 */
169
170#if 0
171#define __ATTR(_name,_mode,_show,_store) { \
172 .attr = {.ca_name = __stringify(_name), .ca_mode = _mode, .ca_owner = THIS_MODULE }, \
173 .show = _show, \
174 .store = _store, \
175}
176
177#define __ATTR_RO(_name) { \
178 .attr = { .ca_name = __stringify(_name), .ca_mode = 0444, .ca_owner = THIS_MODULE }, \
179 .show = _name##_show, \
180}
181
182#define __ATTR_NULL { .attr = { .name = NULL } }
183
184#define attr_name(_attr) (_attr).attr.name
185#endif
186
187
188struct configfs_subsystem { 163struct configfs_subsystem {
189 struct config_group su_group; 164 struct config_group su_group;
190 struct semaphore su_sem; 165 struct semaphore su_sem;
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 4c02119c6ab9..10eb56b2940a 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -170,7 +170,7 @@ void cn_queue_free_dev(struct cn_queue_dev *dev);
170 170
171int cn_cb_equal(struct cb_id *, struct cb_id *); 171int cn_cb_equal(struct cb_id *, struct cb_id *);
172 172
173void cn_queue_wrapper(void *data); 173void cn_queue_wrapper(struct work_struct *work);
174 174
175extern int cn_already_initialized; 175extern int cn_already_initialized;
176 176
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 3fef7d67aedc..bfb520212d71 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -24,15 +24,24 @@
24#include <linux/compiler.h> 24#include <linux/compiler.h>
25#include <linux/cpumask.h> 25#include <linux/cpumask.h>
26#include <asm/semaphore.h> 26#include <asm/semaphore.h>
27#include <linux/mutex.h>
27 28
28struct cpu { 29struct cpu {
29 int node_id; /* The node which contains the CPU */ 30 int node_id; /* The node which contains the CPU */
30 int no_control; /* Should the sysfs control file be created? */ 31 int hotpluggable; /* creates sysfs control file if hotpluggable */
31 struct sys_device sysdev; 32 struct sys_device sysdev;
32}; 33};
33 34
34extern int register_cpu(struct cpu *cpu, int num); 35extern int register_cpu(struct cpu *cpu, int num);
35extern struct sys_device *get_cpu_sysdev(unsigned cpu); 36extern struct sys_device *get_cpu_sysdev(unsigned cpu);
37
38extern int cpu_add_sysdev_attr(struct sysdev_attribute *attr);
39extern void cpu_remove_sysdev_attr(struct sysdev_attribute *attr);
40
41extern int cpu_add_sysdev_attr_group(struct attribute_group *attrs);
42extern void cpu_remove_sysdev_attr_group(struct attribute_group *attrs);
43
44
36#ifdef CONFIG_HOTPLUG_CPU 45#ifdef CONFIG_HOTPLUG_CPU
37extern void unregister_cpu(struct cpu *cpu); 46extern void unregister_cpu(struct cpu *cpu);
38#endif 47#endif
@@ -66,6 +75,17 @@ extern struct sysdev_class cpu_sysdev_class;
66 75
67#ifdef CONFIG_HOTPLUG_CPU 76#ifdef CONFIG_HOTPLUG_CPU
68/* Stop CPUs going up and down. */ 77/* Stop CPUs going up and down. */
78
79static inline void cpuhotplug_mutex_lock(struct mutex *cpu_hp_mutex)
80{
81 mutex_lock(cpu_hp_mutex);
82}
83
84static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
85{
86 mutex_unlock(cpu_hp_mutex);
87}
88
69extern void lock_cpu_hotplug(void); 89extern void lock_cpu_hotplug(void);
70extern void unlock_cpu_hotplug(void); 90extern void unlock_cpu_hotplug(void);
71#define hotcpu_notifier(fn, pri) { \ 91#define hotcpu_notifier(fn, pri) { \
@@ -77,17 +97,24 @@ extern void unlock_cpu_hotplug(void);
77#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) 97#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb)
78int cpu_down(unsigned int cpu); 98int cpu_down(unsigned int cpu);
79#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) 99#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
80#else 100
101#else /* CONFIG_HOTPLUG_CPU */
102
103static inline void cpuhotplug_mutex_lock(struct mutex *cpu_hp_mutex)
104{ }
105static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
106{ }
107
81#define lock_cpu_hotplug() do { } while (0) 108#define lock_cpu_hotplug() do { } while (0)
82#define unlock_cpu_hotplug() do { } while (0) 109#define unlock_cpu_hotplug() do { } while (0)
83#define lock_cpu_hotplug_interruptible() 0 110#define lock_cpu_hotplug_interruptible() 0
84#define hotcpu_notifier(fn, pri) do { } while (0) 111#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
85#define register_hotcpu_notifier(nb) do { } while (0) 112#define register_hotcpu_notifier(nb) do { (void)(nb); } while (0)
86#define unregister_hotcpu_notifier(nb) do { } while (0) 113#define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0)
87 114
88/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */ 115/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
89static inline int cpu_is_offline(int cpu) { return 0; } 116static inline int cpu_is_offline(int cpu) { return 0; }
90#endif 117#endif /* CONFIG_HOTPLUG_CPU */
91 118
92#ifdef CONFIG_SUSPEND_SMP 119#ifdef CONFIG_SUSPEND_SMP
93extern int disable_nonboot_cpus(void); 120extern int disable_nonboot_cpus(void);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 4ea39fee99c7..7f008f6bfdc3 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -172,6 +172,8 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
172 unsigned int relation); 172 unsigned int relation);
173 173
174 174
175extern int cpufreq_driver_getavg(struct cpufreq_policy *policy);
176
175int cpufreq_register_governor(struct cpufreq_governor *governor); 177int cpufreq_register_governor(struct cpufreq_governor *governor);
176void cpufreq_unregister_governor(struct cpufreq_governor *governor); 178void cpufreq_unregister_governor(struct cpufreq_governor *governor);
177 179
@@ -204,6 +206,7 @@ struct cpufreq_driver {
204 unsigned int (*get) (unsigned int cpu); 206 unsigned int (*get) (unsigned int cpu);
205 207
206 /* optional */ 208 /* optional */
209 unsigned int (*getavg) (unsigned int cpu);
207 int (*exit) (struct cpufreq_policy *policy); 210 int (*exit) (struct cpufreq_policy *policy);
208 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); 211 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg);
209 int (*resume) (struct cpufreq_policy *policy); 212 int (*resume) (struct cpufreq_policy *policy);
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 4d8adf663681..fd404416f31c 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -23,16 +23,26 @@ extern void cpuset_fork(struct task_struct *p);
23extern void cpuset_exit(struct task_struct *p); 23extern void cpuset_exit(struct task_struct *p);
24extern cpumask_t cpuset_cpus_allowed(struct task_struct *p); 24extern cpumask_t cpuset_cpus_allowed(struct task_struct *p);
25extern nodemask_t cpuset_mems_allowed(struct task_struct *p); 25extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
26#define cpuset_current_mems_allowed (current->mems_allowed)
26void cpuset_init_current_mems_allowed(void); 27void cpuset_init_current_mems_allowed(void);
27void cpuset_update_task_memory_state(void); 28void cpuset_update_task_memory_state(void);
28#define cpuset_nodes_subset_current_mems_allowed(nodes) \ 29#define cpuset_nodes_subset_current_mems_allowed(nodes) \
29 nodes_subset((nodes), current->mems_allowed) 30 nodes_subset((nodes), current->mems_allowed)
30int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); 31int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl);
31 32
32extern int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask); 33extern int __cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask);
33static int inline cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) 34extern int __cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask);
35
36static int inline cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask)
37{
38 return number_of_cpusets <= 1 ||
39 __cpuset_zone_allowed_softwall(z, gfp_mask);
40}
41
42static int inline cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask)
34{ 43{
35 return number_of_cpusets <= 1 || __cpuset_zone_allowed(z, gfp_mask); 44 return number_of_cpusets <= 1 ||
45 __cpuset_zone_allowed_hardwall(z, gfp_mask);
36} 46}
37 47
38extern int cpuset_excl_nodes_overlap(const struct task_struct *p); 48extern int cpuset_excl_nodes_overlap(const struct task_struct *p);
@@ -83,6 +93,7 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
83 return node_possible_map; 93 return node_possible_map;
84} 94}
85 95
96#define cpuset_current_mems_allowed (node_online_map)
86static inline void cpuset_init_current_mems_allowed(void) {} 97static inline void cpuset_init_current_mems_allowed(void) {}
87static inline void cpuset_update_task_memory_state(void) {} 98static inline void cpuset_update_task_memory_state(void) {}
88#define cpuset_nodes_subset_current_mems_allowed(nodes) (1) 99#define cpuset_nodes_subset_current_mems_allowed(nodes) (1)
@@ -92,7 +103,12 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl)
92 return 1; 103 return 1;
93} 104}
94 105
95static inline int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) 106static inline int cpuset_zone_allowed_softwall(struct zone *z, gfp_t gfp_mask)
107{
108 return 1;
109}
110
111static inline int cpuset_zone_allowed_hardwall(struct zone *z, gfp_t gfp_mask)
96{ 112{
97 return 1; 113 return 1;
98} 114}
diff --git a/include/linux/crc32.h b/include/linux/crc32.h
index 56c0645789a9..e20dd1f9b40a 100644
--- a/include/linux/crc32.h
+++ b/include/linux/crc32.h
@@ -6,10 +6,10 @@
6#define _LINUX_CRC32_H 6#define _LINUX_CRC32_H
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/bitrev.h>
9 10
10extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); 11extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len);
11extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); 12extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len);
12extern u32 bitreverse(u32 in);
13 13
14#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length) 14#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length)
15 15
@@ -21,7 +21,7 @@ extern u32 bitreverse(u32 in);
21 * is in bit nr 0], thus it must be reversed before use. Except for 21 * is in bit nr 0], thus it must be reversed before use. Except for
22 * nics that bit swap the result internally... 22 * nics that bit swap the result internally...
23 */ 23 */
24#define ether_crc(length, data) bitreverse(crc32_le(~0, data, length)) 24#define ether_crc(length, data) bitrev32(crc32_le(~0, data, length))
25#define ether_crc_le(length, data) crc32_le(~0, data, length) 25#define ether_crc_le(length, data) crc32_le(~0, data, length)
26 26
27#endif /* _LINUX_CRC32_H */ 27#endif /* _LINUX_CRC32_H */
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 6485e9716b36..4aa9046601da 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -241,12 +241,8 @@ int crypto_unregister_alg(struct crypto_alg *alg);
241 * Algorithm query interface. 241 * Algorithm query interface.
242 */ 242 */
243#ifdef CONFIG_CRYPTO 243#ifdef CONFIG_CRYPTO
244int crypto_alg_available(const char *name, u32 flags)
245 __deprecated_for_modules;
246int crypto_has_alg(const char *name, u32 type, u32 mask); 244int crypto_has_alg(const char *name, u32 type, u32 mask);
247#else 245#else
248static int crypto_alg_available(const char *name, u32 flags)
249 __deprecated_for_modules;
250static inline int crypto_alg_available(const char *name, u32 flags) 246static inline int crypto_alg_available(const char *name, u32 flags)
251{ 247{
252 return 0; 248 return 0;
@@ -707,16 +703,6 @@ static inline void crypto_cipher_decrypt_one(struct crypto_cipher *tfm,
707 dst, src); 703 dst, src);
708} 704}
709 705
710void crypto_digest_init(struct crypto_tfm *tfm) __deprecated_for_modules;
711void crypto_digest_update(struct crypto_tfm *tfm,
712 struct scatterlist *sg, unsigned int nsg)
713 __deprecated_for_modules;
714void crypto_digest_final(struct crypto_tfm *tfm, u8 *out)
715 __deprecated_for_modules;
716void crypto_digest_digest(struct crypto_tfm *tfm,
717 struct scatterlist *sg, unsigned int nsg, u8 *out)
718 __deprecated_for_modules;
719
720static inline struct crypto_hash *__crypto_hash_cast(struct crypto_tfm *tfm) 706static inline struct crypto_hash *__crypto_hash_cast(struct crypto_tfm *tfm)
721{ 707{
722 return (struct crypto_hash *)tfm; 708 return (struct crypto_hash *)tfm;
@@ -729,14 +715,6 @@ static inline struct crypto_hash *crypto_hash_cast(struct crypto_tfm *tfm)
729 return __crypto_hash_cast(tfm); 715 return __crypto_hash_cast(tfm);
730} 716}
731 717
732static int crypto_digest_setkey(struct crypto_tfm *tfm, const u8 *key,
733 unsigned int keylen) __deprecated;
734static inline int crypto_digest_setkey(struct crypto_tfm *tfm,
735 const u8 *key, unsigned int keylen)
736{
737 return tfm->crt_hash.setkey(crypto_hash_cast(tfm), key, keylen);
738}
739
740static inline struct crypto_hash *crypto_alloc_hash(const char *alg_name, 718static inline struct crypto_hash *crypto_alloc_hash(const char *alg_name,
741 u32 type, u32 mask) 719 u32 type, u32 mask)
742{ 720{
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 53553c99cad6..1cb054bd93f2 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -30,7 +30,7 @@ struct dccp_hdr {
30#else 30#else
31#error "Adjust your <asm/byteorder.h> defines" 31#error "Adjust your <asm/byteorder.h> defines"
32#endif 32#endif
33 __u16 dccph_checksum; 33 __sum16 dccph_checksum;
34#if defined(__LITTLE_ENDIAN_BITFIELD) 34#if defined(__LITTLE_ENDIAN_BITFIELD)
35 __u8 dccph_x:1, 35 __u8 dccph_x:1,
36 dccph_type:4, 36 dccph_type:4,
@@ -175,14 +175,18 @@ enum {
175 DCCPC_CCID3 = 3, 175 DCCPC_CCID3 = 3,
176}; 176};
177 177
178/* DCCP features */ 178/* DCCP features (RFC 4340 section 6.4) */
179enum { 179enum {
180 DCCPF_RESERVED = 0, 180 DCCPF_RESERVED = 0,
181 DCCPF_CCID = 1, 181 DCCPF_CCID = 1,
182 DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */
182 DCCPF_SEQUENCE_WINDOW = 3, 183 DCCPF_SEQUENCE_WINDOW = 3,
184 DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */
183 DCCPF_ACK_RATIO = 5, 185 DCCPF_ACK_RATIO = 5,
184 DCCPF_SEND_ACK_VECTOR = 6, 186 DCCPF_SEND_ACK_VECTOR = 6,
185 DCCPF_SEND_NDP_COUNT = 7, 187 DCCPF_SEND_NDP_COUNT = 7,
188 DCCPF_MIN_CSUM_COVER = 8,
189 DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */
186 /* 10-127 reserved */ 190 /* 10-127 reserved */
187 DCCPF_MIN_CCID_SPECIFIC = 128, 191 DCCPF_MIN_CCID_SPECIFIC = 128,
188 DCCPF_MAX_CCID_SPECIFIC = 255, 192 DCCPF_MAX_CCID_SPECIFIC = 255,
@@ -196,13 +200,16 @@ struct dccp_so_feat {
196}; 200};
197 201
198/* DCCP socket options */ 202/* DCCP socket options */
199#define DCCP_SOCKOPT_PACKET_SIZE 1 203#define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */
200#define DCCP_SOCKOPT_SERVICE 2 204#define DCCP_SOCKOPT_SERVICE 2
201#define DCCP_SOCKOPT_CHANGE_L 3 205#define DCCP_SOCKOPT_CHANGE_L 3
202#define DCCP_SOCKOPT_CHANGE_R 4 206#define DCCP_SOCKOPT_CHANGE_R 4
207#define DCCP_SOCKOPT_SEND_CSCOV 10
208#define DCCP_SOCKOPT_RECV_CSCOV 11
203#define DCCP_SOCKOPT_CCID_RX_INFO 128 209#define DCCP_SOCKOPT_CCID_RX_INFO 128
204#define DCCP_SOCKOPT_CCID_TX_INFO 192 210#define DCCP_SOCKOPT_CCID_TX_INFO 192
205 211
212/* maximum number of services provided on the same listening port */
206#define DCCP_SERVICE_LIST_MAX_LEN 32 213#define DCCP_SERVICE_LIST_MAX_LEN 32
207 214
208#ifdef __KERNEL__ 215#ifdef __KERNEL__
@@ -256,6 +263,13 @@ static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb)
256 return (struct dccp_hdr *)skb->h.raw; 263 return (struct dccp_hdr *)skb->h.raw;
257} 264}
258 265
266static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen)
267{
268 skb->h.raw = skb_push(skb, headlen);
269 memset(skb->h.raw, 0, headlen);
270 return dccp_hdr(skb);
271}
272
259static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) 273static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb)
260{ 274{
261 return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); 275 return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr));
@@ -342,6 +356,9 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
342 * @dccpms_ccid - Congestion Control Id (CCID) (section 10) 356 * @dccpms_ccid - Congestion Control Id (CCID) (section 10)
343 * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5) 357 * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5)
344 * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2) 358 * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2)
359 * @dccpms_ack_ratio - Ack Ratio Feature (section 11.3)
360 * @dccpms_pending - List of features being negotiated
361 * @dccpms_conf -
345 */ 362 */
346struct dccp_minisock { 363struct dccp_minisock {
347 __u64 dccpms_sequence_window; 364 __u64 dccpms_sequence_window;
@@ -410,7 +427,7 @@ struct dccp_service_list {
410}; 427};
411 428
412#define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) 429#define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1)
413#define DCCP_SERVICE_CODE_IS_ABSENT 0 430#define DCCP_SERVICE_CODE_IS_ABSENT 0
414 431
415static inline int dccp_list_has_service(const struct dccp_service_list *sl, 432static inline int dccp_list_has_service(const struct dccp_service_list *sl,
416 const __be32 service) 433 const __be32 service)
@@ -419,7 +436,7 @@ static inline int dccp_list_has_service(const struct dccp_service_list *sl,
419 u32 i = sl->dccpsl_nr; 436 u32 i = sl->dccpsl_nr;
420 while (i--) 437 while (i--)
421 if (sl->dccpsl_list[i] == service) 438 if (sl->dccpsl_list[i] == service)
422 return 1; 439 return 1;
423 } 440 }
424 return 0; 441 return 0;
425} 442}
@@ -439,12 +456,25 @@ struct dccp_ackvec;
439 * @dccps_gss - greatest sequence number sent 456 * @dccps_gss - greatest sequence number sent
440 * @dccps_gsr - greatest valid sequence number received 457 * @dccps_gsr - greatest valid sequence number received
441 * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss 458 * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss
459 * @dccps_service - first (passive sock) or unique (active sock) service code
460 * @dccps_service_list - second .. last service code on passive socket
442 * @dccps_timestamp_time - time of latest TIMESTAMP option 461 * @dccps_timestamp_time - time of latest TIMESTAMP option
443 * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option 462 * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option
444 * @dccps_packet_size - Set thru setsockopt 463 * @dccps_l_ack_ratio -
445 * @dccps_role - Role of this sock, one of %dccp_role 464 * @dccps_r_ack_ratio -
465 * @dccps_pcslen - sender partial checksum coverage (via sockopt)
466 * @dccps_pcrlen - receiver partial checksum coverage (via sockopt)
446 * @dccps_ndp_count - number of Non Data Packets since last data packet 467 * @dccps_ndp_count - number of Non Data Packets since last data packet
468 * @dccps_mss_cache -
469 * @dccps_minisock -
447 * @dccps_hc_rx_ackvec - rx half connection ack vector 470 * @dccps_hc_rx_ackvec - rx half connection ack vector
471 * @dccps_hc_rx_ccid -
472 * @dccps_hc_tx_ccid -
473 * @dccps_options_received -
474 * @dccps_epoch -
475 * @dccps_role - Role of this sock, one of %dccp_role
476 * @dccps_hc_rx_insert_options -
477 * @dccps_hc_tx_insert_options -
448 * @dccps_xmit_timer - timer for when CCID is not ready to send 478 * @dccps_xmit_timer - timer for when CCID is not ready to send
449 */ 479 */
450struct dccp_sock { 480struct dccp_sock {
@@ -464,9 +494,10 @@ struct dccp_sock {
464 struct dccp_service_list *dccps_service_list; 494 struct dccp_service_list *dccps_service_list;
465 struct timeval dccps_timestamp_time; 495 struct timeval dccps_timestamp_time;
466 __u32 dccps_timestamp_echo; 496 __u32 dccps_timestamp_echo;
467 __u32 dccps_packet_size;
468 __u16 dccps_l_ack_ratio; 497 __u16 dccps_l_ack_ratio;
469 __u16 dccps_r_ack_ratio; 498 __u16 dccps_r_ack_ratio;
499 __u16 dccps_pcslen;
500 __u16 dccps_pcrlen;
470 unsigned long dccps_ndp_count; 501 unsigned long dccps_ndp_count;
471 __u32 dccps_mss_cache; 502 __u32 dccps_mss_cache;
472 struct dccp_minisock dccps_minisock; 503 struct dccp_minisock dccps_minisock;
@@ -480,7 +511,7 @@ struct dccp_sock {
480 __u8 dccps_hc_tx_insert_options:1; 511 __u8 dccps_hc_tx_insert_options:1;
481 struct timer_list dccps_xmit_timer; 512 struct timer_list dccps_xmit_timer;
482}; 513};
483 514
484static inline struct dccp_sock *dccp_sk(const struct sock *sk) 515static inline struct dccp_sock *dccp_sk(const struct sock *sk)
485{ 516{
486 return (struct dccp_sock *)sk; 517 return (struct dccp_sock *)sk;
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index 952bee79a8f3..1678a5de7013 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -24,7 +24,7 @@ extern int debug_locks_off(void);
24 int __ret = 0; \ 24 int __ret = 0; \
25 \ 25 \
26 if (unlikely(c)) { \ 26 if (unlikely(c)) { \
27 if (debug_locks_off()) \ 27 if (debug_locks_off() && !debug_locks_silent) \
28 WARN_ON(1); \ 28 WARN_ON(1); \
29 __ret = 1; \ 29 __ret = 1; \
30 } \ 30 } \
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h
index 561e2a77805c..55d1ca5e60f5 100644
--- a/include/linux/delayacct.h
+++ b/include/linux/delayacct.h
@@ -30,7 +30,7 @@
30#ifdef CONFIG_TASK_DELAY_ACCT 30#ifdef CONFIG_TASK_DELAY_ACCT
31 31
32extern int delayacct_on; /* Delay accounting turned on/off */ 32extern int delayacct_on; /* Delay accounting turned on/off */
33extern kmem_cache_t *delayacct_cache; 33extern struct kmem_cache *delayacct_cache;
34extern void delayacct_init(void); 34extern void delayacct_init(void);
35extern void __delayacct_tsk_init(struct task_struct *); 35extern void __delayacct_tsk_init(struct task_struct *);
36extern void __delayacct_tsk_exit(struct task_struct *); 36extern void __delayacct_tsk_exit(struct task_struct *);
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 03ef41c1eaac..499f5373e213 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -39,7 +39,8 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti);
39 * The map function must return: 39 * The map function must return:
40 * < 0: error 40 * < 0: error
41 * = 0: The target will handle the io by resubmitting it later 41 * = 0: The target will handle the io by resubmitting it later
42 * > 0: simple remap complete 42 * = 1: simple remap complete
43 * = 2: The target wants to push back the io
43 */ 44 */
44typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, 45typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
45 union map_info *map_context); 46 union map_info *map_context);
@@ -50,6 +51,7 @@ typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio,
50 * 0 : ended successfully 51 * 0 : ended successfully
51 * 1 : for some reason the io has still not completed (eg, 52 * 1 : for some reason the io has still not completed (eg,
52 * multipath target might want to requeue a failed io). 53 * multipath target might want to requeue a failed io).
54 * 2 : The target wants to push back the io
53 */ 55 */
54typedef int (*dm_endio_fn) (struct dm_target *ti, 56typedef int (*dm_endio_fn) (struct dm_target *ti,
55 struct bio *bio, int error, 57 struct bio *bio, int error,
@@ -173,7 +175,7 @@ void *dm_get_mdptr(struct mapped_device *md);
173/* 175/*
174 * A device can still be used while suspended, but I/O is deferred. 176 * A device can still be used while suspended, but I/O is deferred.
175 */ 177 */
176int dm_suspend(struct mapped_device *md, int with_lockfs); 178int dm_suspend(struct mapped_device *md, unsigned suspend_flags);
177int dm_resume(struct mapped_device *md); 179int dm_resume(struct mapped_device *md);
178 180
179/* 181/*
@@ -188,6 +190,7 @@ int dm_wait_event(struct mapped_device *md, int event_nr);
188const char *dm_device_name(struct mapped_device *md); 190const char *dm_device_name(struct mapped_device *md);
189struct gendisk *dm_disk(struct mapped_device *md); 191struct gendisk *dm_disk(struct mapped_device *md);
190int dm_suspended(struct mapped_device *md); 192int dm_suspended(struct mapped_device *md);
193int dm_noflush_suspending(struct dm_target *ti);
191 194
192/* 195/*
193 * Geometry functions. 196 * Geometry functions.
diff --git a/include/linux/device.h b/include/linux/device.h
index 9d4f6a963936..f44247fe8135 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -21,6 +21,7 @@
21#include <linux/pm.h> 21#include <linux/pm.h>
22#include <asm/semaphore.h> 22#include <asm/semaphore.h>
23#include <asm/atomic.h> 23#include <asm/atomic.h>
24#include <asm/device.h>
24 25
25#define DEVICE_NAME_SIZE 50 26#define DEVICE_NAME_SIZE 50
26#define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */ 27#define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */
@@ -42,6 +43,8 @@ struct bus_type {
42 struct klist klist_devices; 43 struct klist klist_devices;
43 struct klist klist_drivers; 44 struct klist klist_drivers;
44 45
46 struct blocking_notifier_head bus_notifier;
47
45 struct bus_attribute * bus_attrs; 48 struct bus_attribute * bus_attrs;
46 struct device_attribute * dev_attrs; 49 struct device_attribute * dev_attrs;
47 struct driver_attribute * drv_attrs; 50 struct driver_attribute * drv_attrs;
@@ -75,6 +78,29 @@ int __must_check bus_for_each_drv(struct bus_type *bus,
75 struct device_driver *start, void *data, 78 struct device_driver *start, void *data,
76 int (*fn)(struct device_driver *, void *)); 79 int (*fn)(struct device_driver *, void *));
77 80
81/*
82 * Bus notifiers: Get notified of addition/removal of devices
83 * and binding/unbinding of drivers to devices.
84 * In the long run, it should be a replacement for the platform
85 * notify hooks.
86 */
87struct notifier_block;
88
89extern int bus_register_notifier(struct bus_type *bus,
90 struct notifier_block *nb);
91extern int bus_unregister_notifier(struct bus_type *bus,
92 struct notifier_block *nb);
93
94/* All 4 notifers below get called with the target struct device *
95 * as an argument. Note that those functions are likely to be called
96 * with the device semaphore held in the core, so be careful.
97 */
98#define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */
99#define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */
100#define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */
101#define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be
102 unbound */
103
78/* driverfs interface for exporting bus attributes */ 104/* driverfs interface for exporting bus attributes */
79 105
80struct bus_attribute { 106struct bus_attribute {
@@ -343,10 +369,11 @@ struct device {
343 void *driver_data; /* data private to the driver */ 369 void *driver_data; /* data private to the driver */
344 void *platform_data; /* Platform specific data, device 370 void *platform_data; /* Platform specific data, device
345 core doesn't touch it */ 371 core doesn't touch it */
346 void *firmware_data; /* Firmware specific data (e.g. ACPI,
347 BIOS data),reserved for device core*/
348 struct dev_pm_info power; 372 struct dev_pm_info power;
349 373
374#ifdef CONFIG_NUMA
375 int numa_node; /* NUMA node this device is close to */
376#endif
350 u64 *dma_mask; /* dma mask (if dma'able device) */ 377 u64 *dma_mask; /* dma mask (if dma'able device) */
351 u64 coherent_dma_mask;/* Like dma_mask, but for 378 u64 coherent_dma_mask;/* Like dma_mask, but for
352 alloc_coherent mappings as 379 alloc_coherent mappings as
@@ -358,6 +385,8 @@ struct device {
358 385
359 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 386 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
360 override */ 387 override */
388 /* arch specific additions */
389 struct dev_archdata archdata;
361 390
362 /* class_device migration path */ 391 /* class_device migration path */
363 struct list_head node; 392 struct list_head node;
@@ -368,6 +397,25 @@ struct device {
368 void (*release)(struct device * dev); 397 void (*release)(struct device * dev);
369}; 398};
370 399
400#ifdef CONFIG_NUMA
401static inline int dev_to_node(struct device *dev)
402{
403 return dev->numa_node;
404}
405static inline void set_dev_node(struct device *dev, int node)
406{
407 dev->numa_node = node;
408}
409#else
410static inline int dev_to_node(struct device *dev)
411{
412 return -1;
413}
414static inline void set_dev_node(struct device *dev, int node)
415{
416}
417#endif
418
371static inline void * 419static inline void *
372dev_get_drvdata (struct device *dev) 420dev_get_drvdata (struct device *dev)
373{ 421{
@@ -385,6 +433,8 @@ static inline int device_is_registered(struct device *dev)
385 return dev->is_registered; 433 return dev->is_registered;
386} 434}
387 435
436void driver_init(void);
437
388/* 438/*
389 * High level routines for use by the bus drivers 439 * High level routines for use by the bus drivers
390 */ 440 */
@@ -395,7 +445,10 @@ extern int __must_check device_add(struct device * dev);
395extern void device_del(struct device * dev); 445extern void device_del(struct device * dev);
396extern int device_for_each_child(struct device *, void *, 446extern int device_for_each_child(struct device *, void *,
397 int (*fn)(struct device *, void *)); 447 int (*fn)(struct device *, void *));
448extern struct device *device_find_child(struct device *, void *data,
449 int (*match)(struct device *, void *));
398extern int device_rename(struct device *dev, char *new_name); 450extern int device_rename(struct device *dev, char *new_name);
451extern int device_move(struct device *dev, struct device *new_parent);
399 452
400/* 453/*
401 * Manual binding of a device to driver. See drivers/base/bus.c 454 * Manual binding of a device to driver. See drivers/base/bus.c
@@ -415,8 +468,6 @@ extern struct device *device_create(struct class *cls, struct device *parent,
415 __attribute__((format(printf,4,5))); 468 __attribute__((format(printf,4,5)));
416extern void device_destroy(struct class *cls, dev_t devt); 469extern void device_destroy(struct class *cls, dev_t devt);
417 470
418extern int virtual_device_parent(struct device *dev);
419
420/* 471/*
421 * Platform "fixup" functions - allow the platform to have their say 472 * Platform "fixup" functions - allow the platform to have their say
422 * about devices and actions that the general device layer doesn't 473 * about devices and actions that the general device layer doesn't
diff --git a/include/linux/divert.h b/include/linux/divert.h
deleted file mode 100644
index 8fb4e9de6843..000000000000
--- a/include/linux/divert.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * Frame Diversion, Benoit Locher <Benoit.Locher@skf.com>
3 *
4 * Changes:
5 * 06/09/2000 BL: initial version
6 *
7 */
8
9#ifndef _LINUX_DIVERT_H
10#define _LINUX_DIVERT_H
11
12#include <asm/types.h>
13
14#define MAX_DIVERT_PORTS 8 /* Max number of ports to divert (tcp, udp) */
15
16/* Divertable protocols */
17#define DIVERT_PROTO_NONE 0x0000
18#define DIVERT_PROTO_IP 0x0001
19#define DIVERT_PROTO_ICMP 0x0002
20#define DIVERT_PROTO_TCP 0x0004
21#define DIVERT_PROTO_UDP 0x0008
22
23/*
24 * This is an Ethernet Frame Diverter option block
25 */
26struct divert_blk
27{
28 int divert; /* are we active */
29 unsigned int protos; /* protocols */
30 __u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */
31 __u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */
32 __u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */
33 __u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */
34};
35
36/*
37 * Diversion control block, for configuration with the userspace tool
38 * divert
39 */
40
41typedef union _divert_cf_arg
42{
43 __s16 int16;
44 __u16 uint16;
45 __s32 int32;
46 __u32 uint32;
47 __s64 int64;
48 __u64 uint64;
49 void __user *ptr;
50} divert_cf_arg;
51
52
53struct divert_cf
54{
55 int cmd; /* Command */
56 divert_cf_arg arg1,
57 arg2,
58 arg3;
59 int dev_index; /* device index (eth0=0, etc...) */
60};
61
62
63/* Diversion commands */
64#define DIVCMD_DIVERT 1 /* ENABLE/DISABLE diversion */
65#define DIVCMD_IP 2 /* ENABLE/DISABLE whold IP diversion */
66#define DIVCMD_TCP 3 /* ENABLE/DISABLE whold TCP diversion */
67#define DIVCMD_TCPDST 4 /* ADD/REMOVE TCP DST port for diversion */
68#define DIVCMD_TCPSRC 5 /* ADD/REMOVE TCP SRC port for diversion */
69#define DIVCMD_UDP 6 /* ENABLE/DISABLE whole UDP diversion */
70#define DIVCMD_UDPDST 7 /* ADD/REMOVE UDP DST port for diversion */
71#define DIVCMD_UDPSRC 8 /* ADD/REMOVE UDP SRC port for diversion */
72#define DIVCMD_ICMP 9 /* ENABLE/DISABLE whole ICMP diversion */
73#define DIVCMD_GETSTATUS 10 /* GET the status of the diverter */
74#define DIVCMD_RESET 11 /* Reset the diverter on the specified dev */
75#define DIVCMD_GETVERSION 12 /* Retrieve the diverter code version (char[32]) */
76
77/* General syntax of the commands:
78 *
79 * DIVCMD_xxxxxx(arg1, arg2, arg3, dev_index)
80 *
81 * SIOCSIFDIVERT:
82 * DIVCMD_DIVERT(DIVARG1_ENABLE|DIVARG1_DISABLE, , ,ifindex)
83 * DIVCMD_IP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex)
84 * DIVCMD_TCP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex)
85 * DIVCMD_TCPDST(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex)
86 * DIVCMD_TCPSRC(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex)
87 * DIVCMD_UDP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex)
88 * DIVCMD_UDPDST(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex)
89 * DIVCMD_UDPSRC(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex)
90 * DIVCMD_ICMP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex)
91 * DIVCMD_RESET(, , , ifindex)
92 *
93 * SIOGIFDIVERT:
94 * DIVCMD_GETSTATUS(divert_blk, , , ifindex)
95 * DIVCMD_GETVERSION(string[3])
96 */
97
98
99/* Possible values for arg1 */
100#define DIVARG1_ENABLE 0 /* ENABLE something */
101#define DIVARG1_DISABLE 1 /* DISABLE something */
102#define DIVARG1_ADD 2 /* ADD something */
103#define DIVARG1_REMOVE 3 /* REMOVE something */
104
105
106#ifdef __KERNEL__
107
108/* diverter functions */
109#include <linux/skbuff.h>
110
111#ifdef CONFIG_NET_DIVERT
112#include <linux/netdevice.h>
113
114int alloc_divert_blk(struct net_device *);
115void free_divert_blk(struct net_device *);
116int divert_ioctl(unsigned int cmd, struct divert_cf __user *arg);
117void divert_frame(struct sk_buff *skb);
118static inline void handle_diverter(struct sk_buff *skb)
119{
120 /* if diversion is supported on device, then divert */
121 if (skb->dev->divert && skb->dev->divert->divert)
122 divert_frame(skb);
123}
124
125#else
126# define alloc_divert_blk(dev) (0)
127# define free_divert_blk(dev) do {} while (0)
128# define divert_ioctl(cmd, arg) (-ENOPKG)
129# define handle_diverter(skb) do {} while (0)
130#endif
131#endif
132#endif /* _LINUX_DIVERT_H */
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 8853fc4d1c5e..b93486107821 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -285,9 +285,9 @@ typedef char ioctl_struct[308];
285#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 285#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
286 286
287#define DM_VERSION_MAJOR 4 287#define DM_VERSION_MAJOR 4
288#define DM_VERSION_MINOR 10 288#define DM_VERSION_MINOR 11
289#define DM_VERSION_PATCHLEVEL 0 289#define DM_VERSION_PATCHLEVEL 0
290#define DM_VERSION_EXTRA "-ioctl (2006-09-14)" 290#define DM_VERSION_EXTRA "-ioctl (2006-10-12)"
291 291
292/* Status bits */ 292/* Status bits */
293#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 293#define DM_READONLY_FLAG (1 << 0) /* In/Out */
@@ -323,4 +323,9 @@ typedef char ioctl_struct[308];
323 */ 323 */
324#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */ 324#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */
325 325
326/*
327 * Set this to suspend without flushing queued ios.
328 */
329#define DM_NOFLUSH_FLAG (1 << 11) /* In */
330
326#endif /* _LINUX_DM_IOCTL_H */ 331#endif /* _LINUX_DM_IOCTL_H */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 66d621dbcb6c..df1c91855f0e 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -300,8 +300,9 @@ extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size,
300extern int __init efi_uart_console_only (void); 300extern int __init efi_uart_console_only (void);
301extern void efi_initialize_iomem_resources(struct resource *code_resource, 301extern void efi_initialize_iomem_resources(struct resource *code_resource,
302 struct resource *data_resource); 302 struct resource *data_resource);
303extern unsigned long __init efi_get_time(void); 303extern unsigned long efi_get_time(void);
304extern int __init efi_set_rtc_mmss(unsigned long nowtime); 304extern int __init efi_set_rtc_mmss(unsigned long nowtime);
305extern int is_available_memory(efi_memory_desc_t * md);
305extern struct efi_memory_map memmap; 306extern struct efi_memory_map memmap;
306 307
307/** 308/**
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 2fa9f1144228..e88fcbc77f8f 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -12,6 +12,8 @@ typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struc
12 12
13typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); 13typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int);
14 14
15typedef int (elevator_allow_merge_fn) (request_queue_t *, struct request *, struct bio *);
16
15typedef int (elevator_dispatch_fn) (request_queue_t *, int); 17typedef int (elevator_dispatch_fn) (request_queue_t *, int);
16 18
17typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); 19typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
@@ -21,11 +23,11 @@ typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
21typedef int (elevator_may_queue_fn) (request_queue_t *, int); 23typedef int (elevator_may_queue_fn) (request_queue_t *, int);
22 24
23typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); 25typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t);
24typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); 26typedef void (elevator_put_req_fn) (struct request *);
25typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); 27typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
26typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 28typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
27 29
28typedef void *(elevator_init_fn) (request_queue_t *, elevator_t *); 30typedef void *(elevator_init_fn) (request_queue_t *);
29typedef void (elevator_exit_fn) (elevator_t *); 31typedef void (elevator_exit_fn) (elevator_t *);
30 32
31struct elevator_ops 33struct elevator_ops
@@ -33,6 +35,7 @@ struct elevator_ops
33 elevator_merge_fn *elevator_merge_fn; 35 elevator_merge_fn *elevator_merge_fn;
34 elevator_merged_fn *elevator_merged_fn; 36 elevator_merged_fn *elevator_merged_fn;
35 elevator_merge_req_fn *elevator_merge_req_fn; 37 elevator_merge_req_fn *elevator_merge_req_fn;
38 elevator_allow_merge_fn *elevator_allow_merge_fn;
36 39
37 elevator_dispatch_fn *elevator_dispatch_fn; 40 elevator_dispatch_fn *elevator_dispatch_fn;
38 elevator_add_req_fn *elevator_add_req_fn; 41 elevator_add_req_fn *elevator_add_req_fn;
diff --git a/include/linux/elf.h b/include/linux/elf.h
index b70d1d2c8d28..60713e6ea297 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -6,6 +6,8 @@
6#include <linux/elf-em.h> 6#include <linux/elf-em.h>
7#include <asm/elf.h> 7#include <asm/elf.h>
8 8
9struct file;
10
9#ifndef elf_read_implies_exec 11#ifndef elf_read_implies_exec
10 /* Executables for which elf_read_implies_exec() returns TRUE will 12 /* Executables for which elf_read_implies_exec() returns TRUE will
11 have the READ_IMPLIES_EXEC personality flag set automatically. 13 have the READ_IMPLIES_EXEC personality flag set automatically.
@@ -358,6 +360,7 @@ extern Elf32_Dyn _DYNAMIC [];
358#define elfhdr elf32_hdr 360#define elfhdr elf32_hdr
359#define elf_phdr elf32_phdr 361#define elf_phdr elf32_phdr
360#define elf_note elf32_note 362#define elf_note elf32_note
363#define elf_addr_t Elf32_Off
361 364
362#else 365#else
363 366
@@ -365,8 +368,16 @@ extern Elf64_Dyn _DYNAMIC [];
365#define elfhdr elf64_hdr 368#define elfhdr elf64_hdr
366#define elf_phdr elf64_phdr 369#define elf_phdr elf64_phdr
367#define elf_note elf64_note 370#define elf_note elf64_note
371#define elf_addr_t Elf64_Off
368 372
369#endif 373#endif
370 374
375#ifndef ARCH_HAVE_EXTRA_ELF_NOTES
376static inline int arch_notes_size(void) { return 0; }
377static inline void arch_write_notes(struct file *file) { }
378
379#define ELF_CORE_EXTRA_NOTES_SIZE arch_notes_size()
380#define ELF_CORE_WRITE_EXTRA_NOTES arch_write_notes(file)
381#endif /* ARCH_HAVE_EXTRA_ELF_NOTES */
371 382
372#endif /* _LINUX_ELF_H */ 383#endif /* _LINUX_ELF_H */
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h
index ce0e6109aff0..8c43b13a02fe 100644
--- a/include/linux/ext3_jbd.h
+++ b/include/linux/ext3_jbd.h
@@ -109,74 +109,32 @@ int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode);
109 * been done yet. 109 * been done yet.
110 */ 110 */
111 111
112void ext3_journal_abort_handle(const char *caller, const char *err_fn, 112static inline void ext3_journal_release_buffer(handle_t *handle,
113 struct buffer_head *bh, handle_t *handle, int err); 113 struct buffer_head *bh)
114
115static inline int
116__ext3_journal_get_undo_access(const char *where, handle_t *handle,
117 struct buffer_head *bh)
118{ 114{
119 int err = journal_get_undo_access(handle, bh); 115 journal_release_buffer(handle, bh);
120 if (err)
121 ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
122 return err;
123} 116}
124 117
125static inline int 118void ext3_journal_abort_handle(const char *caller, const char *err_fn,
126__ext3_journal_get_write_access(const char *where, handle_t *handle, 119 struct buffer_head *bh, handle_t *handle, int err);
127 struct buffer_head *bh)
128{
129 int err = journal_get_write_access(handle, bh);
130 if (err)
131 ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
132 return err;
133}
134 120
135static inline void 121int __ext3_journal_get_undo_access(const char *where, handle_t *handle,
136ext3_journal_release_buffer(handle_t *handle, struct buffer_head *bh) 122 struct buffer_head *bh);
137{
138 journal_release_buffer(handle, bh);
139}
140 123
141static inline int 124int __ext3_journal_get_write_access(const char *where, handle_t *handle,
142__ext3_journal_forget(const char *where, handle_t *handle, struct buffer_head *bh) 125 struct buffer_head *bh);
143{
144 int err = journal_forget(handle, bh);
145 if (err)
146 ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
147 return err;
148}
149 126
150static inline int 127int __ext3_journal_forget(const char *where, handle_t *handle,
151__ext3_journal_revoke(const char *where, handle_t *handle, 128 struct buffer_head *bh);
152 unsigned long blocknr, struct buffer_head *bh)
153{
154 int err = journal_revoke(handle, blocknr, bh);
155 if (err)
156 ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
157 return err;
158}
159 129
160static inline int 130int __ext3_journal_revoke(const char *where, handle_t *handle,
161__ext3_journal_get_create_access(const char *where, 131 unsigned long blocknr, struct buffer_head *bh);
162 handle_t *handle, struct buffer_head *bh)
163{
164 int err = journal_get_create_access(handle, bh);
165 if (err)
166 ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
167 return err;
168}
169 132
170static inline int 133int __ext3_journal_get_create_access(const char *where,
171__ext3_journal_dirty_metadata(const char *where, 134 handle_t *handle, struct buffer_head *bh);
172 handle_t *handle, struct buffer_head *bh)
173{
174 int err = journal_dirty_metadata(handle, bh);
175 if (err)
176 ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
177 return err;
178}
179 135
136int __ext3_journal_dirty_metadata(const char *where,
137 handle_t *handle, struct buffer_head *bh);
180 138
181#define ext3_journal_get_undo_access(handle, bh) \ 139#define ext3_journal_get_undo_access(handle, bh) \
182 __ext3_journal_get_undo_access(__FUNCTION__, (handle), (bh)) 140 __ext3_journal_get_undo_access(__FUNCTION__, (handle), (bh))
diff --git a/include/linux/ext4_jbd2.h b/include/linux/ext4_jbd2.h
index 72dd631912e4..d716e6392cf6 100644
--- a/include/linux/ext4_jbd2.h
+++ b/include/linux/ext4_jbd2.h
@@ -114,74 +114,32 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode);
114 * been done yet. 114 * been done yet.
115 */ 115 */
116 116
117void ext4_journal_abort_handle(const char *caller, const char *err_fn, 117static inline void ext4_journal_release_buffer(handle_t *handle,
118 struct buffer_head *bh, handle_t *handle, int err); 118 struct buffer_head *bh)
119
120static inline int
121__ext4_journal_get_undo_access(const char *where, handle_t *handle,
122 struct buffer_head *bh)
123{ 119{
124 int err = jbd2_journal_get_undo_access(handle, bh); 120 jbd2_journal_release_buffer(handle, bh);
125 if (err)
126 ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
127 return err;
128} 121}
129 122
130static inline int 123void ext4_journal_abort_handle(const char *caller, const char *err_fn,
131__ext4_journal_get_write_access(const char *where, handle_t *handle, 124 struct buffer_head *bh, handle_t *handle, int err);
132 struct buffer_head *bh)
133{
134 int err = jbd2_journal_get_write_access(handle, bh);
135 if (err)
136 ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
137 return err;
138}
139 125
140static inline void 126int __ext4_journal_get_undo_access(const char *where, handle_t *handle,
141ext4_journal_release_buffer(handle_t *handle, struct buffer_head *bh) 127 struct buffer_head *bh);
142{
143 jbd2_journal_release_buffer(handle, bh);
144}
145 128
146static inline int 129int __ext4_journal_get_write_access(const char *where, handle_t *handle,
147__ext4_journal_forget(const char *where, handle_t *handle, struct buffer_head *bh) 130 struct buffer_head *bh);
148{
149 int err = jbd2_journal_forget(handle, bh);
150 if (err)
151 ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
152 return err;
153}
154 131
155static inline int 132int __ext4_journal_forget(const char *where, handle_t *handle,
156__ext4_journal_revoke(const char *where, handle_t *handle, 133 struct buffer_head *bh);
157 ext4_fsblk_t blocknr, struct buffer_head *bh)
158{
159 int err = jbd2_journal_revoke(handle, blocknr, bh);
160 if (err)
161 ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
162 return err;
163}
164 134
165static inline int 135int __ext4_journal_revoke(const char *where, handle_t *handle,
166__ext4_journal_get_create_access(const char *where, 136 ext4_fsblk_t blocknr, struct buffer_head *bh);
167 handle_t *handle, struct buffer_head *bh)
168{
169 int err = jbd2_journal_get_create_access(handle, bh);
170 if (err)
171 ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
172 return err;
173}
174 137
175static inline int 138int __ext4_journal_get_create_access(const char *where,
176__ext4_journal_dirty_metadata(const char *where, 139 handle_t *handle, struct buffer_head *bh);
177 handle_t *handle, struct buffer_head *bh)
178{
179 int err = jbd2_journal_dirty_metadata(handle, bh);
180 if (err)
181 ext4_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
182 return err;
183}
184 140
141int __ext4_journal_dirty_metadata(const char *where,
142 handle_t *handle, struct buffer_head *bh);
185 143
186#define ext4_journal_get_undo_access(handle, bh) \ 144#define ext4_journal_get_undo_access(handle, bh) \
187 __ext4_journal_get_undo_access(__FUNCTION__, (handle), (bh)) 145 __ext4_journal_get_undo_access(__FUNCTION__, (handle), (bh))
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
new file mode 100644
index 000000000000..32368c4f0326
--- /dev/null
+++ b/include/linux/fault-inject.h
@@ -0,0 +1,84 @@
1#ifndef _LINUX_FAULT_INJECT_H
2#define _LINUX_FAULT_INJECT_H
3
4#ifdef CONFIG_FAULT_INJECTION
5
6#include <linux/types.h>
7#include <linux/debugfs.h>
8#include <asm/atomic.h>
9
10/*
11 * For explanation of the elements of this struct, see
12 * Documentation/fault-injection/fault-injection.txt
13 */
14struct fault_attr {
15 unsigned long probability;
16 unsigned long interval;
17 atomic_t times;
18 atomic_t space;
19 unsigned long verbose;
20 u32 task_filter;
21 unsigned long stacktrace_depth;
22 unsigned long require_start;
23 unsigned long require_end;
24 unsigned long reject_start;
25 unsigned long reject_end;
26
27 unsigned long count;
28
29#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
30
31 struct {
32 struct dentry *dir;
33
34 struct dentry *probability_file;
35 struct dentry *interval_file;
36 struct dentry *times_file;
37 struct dentry *space_file;
38 struct dentry *verbose_file;
39 struct dentry *task_filter_file;
40 struct dentry *stacktrace_depth_file;
41 struct dentry *require_start_file;
42 struct dentry *require_end_file;
43 struct dentry *reject_start_file;
44 struct dentry *reject_end_file;
45 } dentries;
46
47#endif
48};
49
50#define FAULT_ATTR_INITIALIZER { \
51 .interval = 1, \
52 .times = ATOMIC_INIT(1), \
53 .require_end = ULONG_MAX, \
54 .stacktrace_depth = 32, \
55 .verbose = 2, \
56 }
57
58#define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
59int setup_fault_attr(struct fault_attr *attr, char *str);
60void should_fail_srandom(unsigned long entropy);
61bool should_fail(struct fault_attr *attr, ssize_t size);
62
63#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
64
65int init_fault_attr_dentries(struct fault_attr *attr, const char *name);
66void cleanup_fault_attr_dentries(struct fault_attr *attr);
67
68#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */
69
70static inline int init_fault_attr_dentries(struct fault_attr *attr,
71 const char *name)
72{
73 return -ENODEV;
74}
75
76static inline void cleanup_fault_attr_dentries(struct fault_attr *attr)
77{
78}
79
80#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */
81
82#endif /* CONFIG_FAULT_INJECTION */
83
84#endif /* _LINUX_FAULT_INJECT_H */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 3e69241e6a81..64177ec9a019 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -774,8 +774,8 @@ struct fb_info {
774#endif 774#endif
775 775
776 struct fb_ops *fbops; 776 struct fb_ops *fbops;
777 struct device *device; 777 struct device *device; /* This is the parent */
778 struct class_device *class_device; /* sysfs per device attrs */ 778 struct device *dev; /* This is this fb device */
779 int class_flag; /* private sysfs flags */ 779 int class_flag; /* private sysfs flags */
780#ifdef CONFIG_FB_TILEBLITTING 780#ifdef CONFIG_FB_TILEBLITTING
781 struct fb_tile_ops *tileops; /* Tile Blitting */ 781 struct fb_tile_ops *tileops; /* Tile Blitting */
@@ -910,8 +910,8 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
910/* drivers/video/fbsysfs.c */ 910/* drivers/video/fbsysfs.c */
911extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); 911extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
912extern void framebuffer_release(struct fb_info *info); 912extern void framebuffer_release(struct fb_info *info);
913extern int fb_init_class_device(struct fb_info *fb_info); 913extern int fb_init_device(struct fb_info *fb_info);
914extern void fb_cleanup_class_device(struct fb_info *head); 914extern void fb_cleanup_device(struct fb_info *head);
915extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); 915extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max);
916 916
917/* drivers/video/fbmon.c */ 917/* drivers/video/fbmon.c */
@@ -929,8 +929,6 @@ extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max)
929#define FB_MODE_IS_FIRST 16 929#define FB_MODE_IS_FIRST 16
930#define FB_MODE_IS_FROM_VAR 32 930#define FB_MODE_IS_FROM_VAR 32
931 931
932extern int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
933 const struct fb_info *fb_info);
934extern int fbmon_dpms(const struct fb_info *fb_info); 932extern int fbmon_dpms(const struct fb_info *fb_info);
935extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, 933extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var,
936 struct fb_info *info); 934 struct fb_info *info);
@@ -970,11 +968,11 @@ extern struct fb_videomode *fb_find_best_display(struct fb_monspecs *specs,
970/* drivers/video/fbcmap.c */ 968/* drivers/video/fbcmap.c */
971extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); 969extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
972extern void fb_dealloc_cmap(struct fb_cmap *cmap); 970extern void fb_dealloc_cmap(struct fb_cmap *cmap);
973extern int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to); 971extern int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to);
974extern int fb_cmap_to_user(struct fb_cmap *from, struct fb_cmap_user *to); 972extern int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to);
975extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info); 973extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info);
976extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info); 974extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info);
977extern struct fb_cmap *fb_default_cmap(int len); 975extern const struct fb_cmap *fb_default_cmap(int len);
978extern void fb_invert_cmaps(void); 976extern void fb_invert_cmaps(void);
979 977
980struct fb_videomode { 978struct fb_videomode {
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
index 4418c8d9d479..8270aac2aa5d 100644
--- a/include/linux/fib_rules.h
+++ b/include/linux/fib_rules.h
@@ -6,6 +6,7 @@
6 6
7/* rule is permanent, and cannot be deleted */ 7/* rule is permanent, and cannot be deleted */
8#define FIB_RULE_PERMANENT 1 8#define FIB_RULE_PERMANENT 1
9#define FIB_RULE_INVERT 2
9 10
10struct fib_rule_hdr 11struct fib_rule_hdr
11{ 12{
@@ -34,7 +35,7 @@ enum
34 FRA_UNUSED3, 35 FRA_UNUSED3,
35 FRA_UNUSED4, 36 FRA_UNUSED4,
36 FRA_UNUSED5, 37 FRA_UNUSED5,
37 FRA_FWMARK, /* netfilter mark */ 38 FRA_FWMARK, /* mark */
38 FRA_FLOW, /* flow/class id */ 39 FRA_FLOW, /* flow/class id */
39 FRA_UNUSED6, 40 FRA_UNUSED6,
40 FRA_UNUSED7, 41 FRA_UNUSED7,
diff --git a/include/linux/file.h b/include/linux/file.h
index 74183e6f7f45..a59001e9ea58 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -26,19 +26,12 @@ struct embedded_fd_set {
26 unsigned long fds_bits[1]; 26 unsigned long fds_bits[1];
27}; 27};
28 28
29/*
30 * More than this number of fds: we use a separately allocated fd_set
31 */
32#define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set))
33
34struct fdtable { 29struct fdtable {
35 unsigned int max_fds; 30 unsigned int max_fds;
36 int max_fdset;
37 struct file ** fd; /* current fd array */ 31 struct file ** fd; /* current fd array */
38 fd_set *close_on_exec; 32 fd_set *close_on_exec;
39 fd_set *open_fds; 33 fd_set *open_fds;
40 struct rcu_head rcu; 34 struct rcu_head rcu;
41 struct files_struct *free_files;
42 struct fdtable *next; 35 struct fdtable *next;
43}; 36};
44 37
@@ -64,6 +57,8 @@ struct files_struct {
64 57
65#define files_fdtable(files) (rcu_dereference((files)->fdt)) 58#define files_fdtable(files) (rcu_dereference((files)->fdt))
66 59
60extern struct kmem_cache *filp_cachep;
61
67extern void FASTCALL(__fput(struct file *)); 62extern void FASTCALL(__fput(struct file *));
68extern void FASTCALL(fput(struct file *)); 63extern void FASTCALL(fput(struct file *));
69 64
@@ -81,16 +76,15 @@ extern int get_unused_fd(void);
81extern void FASTCALL(put_unused_fd(unsigned int fd)); 76extern void FASTCALL(put_unused_fd(unsigned int fd));
82struct kmem_cache; 77struct kmem_cache;
83 78
84extern struct file ** alloc_fd_array(int);
85extern void free_fd_array(struct file **, int);
86
87extern fd_set *alloc_fdset(int);
88extern void free_fdset(fd_set *, int);
89
90extern int expand_files(struct files_struct *, int nr); 79extern int expand_files(struct files_struct *, int nr);
91extern void free_fdtable(struct fdtable *fdt); 80extern void free_fdtable_rcu(struct rcu_head *rcu);
92extern void __init files_defer_init(void); 81extern void __init files_defer_init(void);
93 82
83static inline void free_fdtable(struct fdtable *fdt)
84{
85 call_rcu(&fdt->rcu, free_fdtable_rcu);
86}
87
94static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 88static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd)
95{ 89{
96 struct file * file = NULL; 90 struct file * file = NULL;
@@ -114,4 +108,6 @@ struct files_struct *get_files_struct(struct task_struct *);
114void FASTCALL(put_files_struct(struct files_struct *fs)); 108void FASTCALL(put_files_struct(struct files_struct *fs));
115void reset_files_struct(struct task_struct *, struct files_struct *); 109void reset_files_struct(struct task_struct *, struct files_struct *);
116 110
111extern struct kmem_cache *files_cachep;
112
117#endif /* __LINUX_FILE_H */ 113#endif /* __LINUX_FILE_H */
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
new file mode 100644
index 000000000000..5e75e26d4787
--- /dev/null
+++ b/include/linux/freezer.h
@@ -0,0 +1,90 @@
1/* Freezer declarations */
2
3#include <linux/sched.h>
4
5#ifdef CONFIG_PM
6/*
7 * Check if a process has been frozen
8 */
9static inline int frozen(struct task_struct *p)
10{
11 return p->flags & PF_FROZEN;
12}
13
14/*
15 * Check if there is a request to freeze a process
16 */
17static inline int freezing(struct task_struct *p)
18{
19 return test_tsk_thread_flag(p, TIF_FREEZE);
20}
21
22/*
23 * Request that a process be frozen
24 */
25static inline void freeze(struct task_struct *p)
26{
27 set_tsk_thread_flag(p, TIF_FREEZE);
28}
29
30/*
31 * Sometimes we may need to cancel the previous 'freeze' request
32 */
33static inline void do_not_freeze(struct task_struct *p)
34{
35 clear_tsk_thread_flag(p, TIF_FREEZE);
36}
37
38/*
39 * Wake up a frozen process
40 */
41static inline int thaw_process(struct task_struct *p)
42{
43 if (frozen(p)) {
44 p->flags &= ~PF_FROZEN;
45 wake_up_process(p);
46 return 1;
47 }
48 return 0;
49}
50
51/*
52 * freezing is complete, mark process as frozen
53 */
54static inline void frozen_process(struct task_struct *p)
55{
56 p->flags |= PF_FROZEN;
57 wmb();
58 clear_tsk_thread_flag(p, TIF_FREEZE);
59}
60
61extern void refrigerator(void);
62extern int freeze_processes(void);
63extern void thaw_processes(void);
64
65static inline int try_to_freeze(void)
66{
67 if (freezing(current)) {
68 refrigerator();
69 return 1;
70 } else
71 return 0;
72}
73
74extern void thaw_some_processes(int all);
75
76#else
77static inline int frozen(struct task_struct *p) { return 0; }
78static inline int freezing(struct task_struct *p) { return 0; }
79static inline void freeze(struct task_struct *p) { BUG(); }
80static inline int thaw_process(struct task_struct *p) { return 1; }
81static inline void frozen_process(struct task_struct *p) { BUG(); }
82
83static inline void refrigerator(void) {}
84static inline int freeze_processes(void) { BUG(); return 0; }
85static inline void thaw_processes(void) {}
86
87static inline int try_to_freeze(void) { return 0; }
88
89
90#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2fe6e3f900ba..1410e5330c8d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -120,6 +120,7 @@ extern int dir_notify_enable;
120#define MS_PRIVATE (1<<18) /* change to private */ 120#define MS_PRIVATE (1<<18) /* change to private */
121#define MS_SLAVE (1<<19) /* change to slave */ 121#define MS_SLAVE (1<<19) /* change to slave */
122#define MS_SHARED (1<<20) /* change to shared */ 122#define MS_SHARED (1<<20) /* change to shared */
123#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
123#define MS_ACTIVE (1<<30) 124#define MS_ACTIVE (1<<30)
124#define MS_NOUSER (1<<31) 125#define MS_NOUSER (1<<31)
125 126
@@ -269,6 +270,7 @@ extern int dir_notify_enable;
269#include <linux/types.h> 270#include <linux/types.h>
270#include <linux/kdev_t.h> 271#include <linux/kdev_t.h>
271#include <linux/dcache.h> 272#include <linux/dcache.h>
273#include <linux/namei.h>
272#include <linux/stat.h> 274#include <linux/stat.h>
273#include <linux/cache.h> 275#include <linux/cache.h>
274#include <linux/kobject.h> 276#include <linux/kobject.h>
@@ -276,7 +278,7 @@ extern int dir_notify_enable;
276#include <linux/radix-tree.h> 278#include <linux/radix-tree.h>
277#include <linux/prio_tree.h> 279#include <linux/prio_tree.h>
278#include <linux/init.h> 280#include <linux/init.h>
279#include <linux/sched.h> 281#include <linux/pid.h>
280#include <linux/mutex.h> 282#include <linux/mutex.h>
281 283
282#include <asm/atomic.h> 284#include <asm/atomic.h>
@@ -424,6 +426,7 @@ struct address_space_operations {
424 /* migrate the contents of a page to the specified target */ 426 /* migrate the contents of a page to the specified target */
425 int (*migratepage) (struct address_space *, 427 int (*migratepage) (struct address_space *,
426 struct page *, struct page *); 428 struct page *, struct page *);
429 int (*launder_page) (struct page *);
427}; 430};
428 431
429struct backing_dev_info; 432struct backing_dev_info;
@@ -456,7 +459,7 @@ struct block_device {
456 struct inode * bd_inode; /* will die */ 459 struct inode * bd_inode; /* will die */
457 int bd_openers; 460 int bd_openers;
458 struct mutex bd_mutex; /* open/close mutex */ 461 struct mutex bd_mutex; /* open/close mutex */
459 struct mutex bd_mount_mutex; /* mount mutex */ 462 struct semaphore bd_mount_sem;
460 struct list_head bd_inodes; 463 struct list_head bd_inodes;
461 void * bd_holder; 464 void * bd_holder;
462 int bd_holders; 465 int bd_holders;
@@ -482,21 +485,6 @@ struct block_device {
482}; 485};
483 486
484/* 487/*
485 * bdev->bd_mutex nesting subclasses for the lock validator:
486 *
487 * 0: normal
488 * 1: 'whole'
489 * 2: 'partition'
490 */
491enum bdev_bd_mutex_lock_class
492{
493 BD_MUTEX_NORMAL,
494 BD_MUTEX_WHOLE,
495 BD_MUTEX_PARTITION
496};
497
498
499/*
500 * Radix-tree tags, for tagging dirty and writeback pages within the pagecache 488 * Radix-tree tags, for tagging dirty and writeback pages within the pagecache
501 * radix trees 489 * radix trees
502 */ 490 */
@@ -543,19 +531,22 @@ struct inode {
543 struct list_head i_dentry; 531 struct list_head i_dentry;
544 unsigned long i_ino; 532 unsigned long i_ino;
545 atomic_t i_count; 533 atomic_t i_count;
546 umode_t i_mode;
547 unsigned int i_nlink; 534 unsigned int i_nlink;
548 uid_t i_uid; 535 uid_t i_uid;
549 gid_t i_gid; 536 gid_t i_gid;
550 dev_t i_rdev; 537 dev_t i_rdev;
538 unsigned long i_version;
551 loff_t i_size; 539 loff_t i_size;
540#ifdef __NEED_I_SIZE_ORDERED
541 seqcount_t i_size_seqcount;
542#endif
552 struct timespec i_atime; 543 struct timespec i_atime;
553 struct timespec i_mtime; 544 struct timespec i_mtime;
554 struct timespec i_ctime; 545 struct timespec i_ctime;
555 unsigned int i_blkbits; 546 unsigned int i_blkbits;
556 unsigned long i_version;
557 blkcnt_t i_blocks; 547 blkcnt_t i_blocks;
558 unsigned short i_bytes; 548 unsigned short i_bytes;
549 umode_t i_mode;
559 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 550 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
560 struct mutex i_mutex; 551 struct mutex i_mutex;
561 struct rw_semaphore i_alloc_sem; 552 struct rw_semaphore i_alloc_sem;
@@ -598,9 +589,6 @@ struct inode {
598 void *i_security; 589 void *i_security;
599#endif 590#endif
600 void *i_private; /* fs or device private pointer */ 591 void *i_private; /* fs or device private pointer */
601#ifdef __NEED_I_SIZE_ORDERED
602 seqcount_t i_size_seqcount;
603#endif
604}; 592};
605 593
606/* 594/*
@@ -636,7 +624,7 @@ extern void inode_double_unlock(struct inode *inode1, struct inode *inode2);
636 * cmpxchg8b without the need of the lock prefix). For SMP compiles 624 * cmpxchg8b without the need of the lock prefix). For SMP compiles
637 * and 64bit archs it makes no difference if preempt is enabled or not. 625 * and 64bit archs it makes no difference if preempt is enabled or not.
638 */ 626 */
639static inline loff_t i_size_read(struct inode *inode) 627static inline loff_t i_size_read(const struct inode *inode)
640{ 628{
641#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 629#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
642 loff_t i_size; 630 loff_t i_size;
@@ -679,12 +667,12 @@ static inline void i_size_write(struct inode *inode, loff_t i_size)
679#endif 667#endif
680} 668}
681 669
682static inline unsigned iminor(struct inode *inode) 670static inline unsigned iminor(const struct inode *inode)
683{ 671{
684 return MINOR(inode->i_rdev); 672 return MINOR(inode->i_rdev);
685} 673}
686 674
687static inline unsigned imajor(struct inode *inode) 675static inline unsigned imajor(const struct inode *inode)
688{ 676{
689 return MAJOR(inode->i_rdev); 677 return MAJOR(inode->i_rdev);
690} 678}
@@ -726,8 +714,9 @@ struct file {
726 struct list_head fu_list; 714 struct list_head fu_list;
727 struct rcu_head fu_rcuhead; 715 struct rcu_head fu_rcuhead;
728 } f_u; 716 } f_u;
729 struct dentry *f_dentry; 717 struct path f_path;
730 struct vfsmount *f_vfsmnt; 718#define f_dentry f_path.dentry
719#define f_vfsmnt f_path.mnt
731 const struct file_operations *f_op; 720 const struct file_operations *f_op;
732 atomic_t f_count; 721 atomic_t f_count;
733 unsigned int f_flags; 722 unsigned int f_flags;
@@ -977,36 +966,13 @@ enum {
977#define vfs_check_frozen(sb, level) \ 966#define vfs_check_frozen(sb, level) \
978 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) 967 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level)))
979 968
980static inline void get_fs_excl(void) 969#define get_fs_excl() atomic_inc(&current->fs_excl)
981{ 970#define put_fs_excl() atomic_dec(&current->fs_excl)
982 atomic_inc(&current->fs_excl); 971#define has_fs_excl() atomic_read(&current->fs_excl)
983}
984
985static inline void put_fs_excl(void)
986{
987 atomic_dec(&current->fs_excl);
988}
989
990static inline int has_fs_excl(void)
991{
992 return atomic_read(&current->fs_excl);
993}
994 972
995 973/* not quite ready to be deprecated, but... */
996/* 974extern void lock_super(struct super_block *);
997 * Superblock locking. 975extern void unlock_super(struct super_block *);
998 */
999static inline void lock_super(struct super_block * sb)
1000{
1001 get_fs_excl();
1002 mutex_lock(&sb->s_lock);
1003}
1004
1005static inline void unlock_super(struct super_block * sb)
1006{
1007 put_fs_excl();
1008 mutex_unlock(&sb->s_lock);
1009}
1010 976
1011/* 977/*
1012 * VFS helper functions.. 978 * VFS helper functions..
@@ -1262,7 +1228,7 @@ extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
1262static inline void file_accessed(struct file *file) 1228static inline void file_accessed(struct file *file)
1263{ 1229{
1264 if (!(file->f_flags & O_NOATIME)) 1230 if (!(file->f_flags & O_NOATIME))
1265 touch_atime(file->f_vfsmnt, file->f_dentry); 1231 touch_atime(file->f_path.mnt, file->f_path.dentry);
1266} 1232}
1267 1233
1268int sync_inode(struct inode *inode, struct writeback_control *wbc); 1234int sync_inode(struct inode *inode, struct writeback_control *wbc);
@@ -1504,7 +1470,9 @@ extern char * getname(const char __user *);
1504extern void __init vfs_caches_init_early(void); 1470extern void __init vfs_caches_init_early(void);
1505extern void __init vfs_caches_init(unsigned long); 1471extern void __init vfs_caches_init(unsigned long);
1506 1472
1507#define __getname() kmem_cache_alloc(names_cachep, SLAB_KERNEL) 1473extern struct kmem_cache *names_cachep;
1474
1475#define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL)
1508#define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) 1476#define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
1509#ifndef CONFIG_AUDITSYSCALL 1477#ifndef CONFIG_AUDITSYSCALL
1510#define putname(name) __putname(name) 1478#define putname(name) __putname(name)
@@ -1520,7 +1488,6 @@ extern void bd_set_size(struct block_device *, loff_t size);
1520extern void bd_forget(struct inode *inode); 1488extern void bd_forget(struct inode *inode);
1521extern void bdput(struct block_device *); 1489extern void bdput(struct block_device *);
1522extern struct block_device *open_by_devnum(dev_t, unsigned); 1490extern struct block_device *open_by_devnum(dev_t, unsigned);
1523extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
1524extern const struct address_space_operations def_blk_aops; 1491extern const struct address_space_operations def_blk_aops;
1525#else 1492#else
1526static inline void bd_forget(struct inode *inode) {} 1493static inline void bd_forget(struct inode *inode) {}
@@ -1538,7 +1505,6 @@ extern int blkdev_driver_ioctl(struct inode *inode, struct file *file,
1538extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); 1505extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long);
1539extern int blkdev_get(struct block_device *, mode_t, unsigned); 1506extern int blkdev_get(struct block_device *, mode_t, unsigned);
1540extern int blkdev_put(struct block_device *); 1507extern int blkdev_put(struct block_device *);
1541extern int blkdev_put_partition(struct block_device *);
1542extern int bd_claim(struct block_device *, void *); 1508extern int bd_claim(struct block_device *, void *);
1543extern void bd_release(struct block_device *); 1509extern void bd_release(struct block_device *);
1544#ifdef CONFIG_SYSFS 1510#ifdef CONFIG_SYSFS
@@ -1653,7 +1619,7 @@ static inline void put_write_access(struct inode * inode)
1653static inline void allow_write_access(struct file *file) 1619static inline void allow_write_access(struct file *file)
1654{ 1620{
1655 if (file) 1621 if (file)
1656 atomic_inc(&file->f_dentry->d_inode->i_writecount); 1622 atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
1657} 1623}
1658extern int do_pipe(int *); 1624extern int do_pipe(int *);
1659extern struct file *create_read_pipe(struct file *f); 1625extern struct file *create_read_pipe(struct file *f);
diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h
new file mode 100644
index 000000000000..bb516ceeefc9
--- /dev/null
+++ b/include/linux/fs_stack.h
@@ -0,0 +1,31 @@
1#ifndef _LINUX_FS_STACK_H
2#define _LINUX_FS_STACK_H
3
4/* This file defines generic functions used primarily by stackable
5 * filesystems; none of these functions require i_mutex to be held.
6 */
7
8#include <linux/fs.h>
9
10/* externs for fs/stack.c */
11extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
12 int (*get_nlinks)(struct inode *));
13
14extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src);
15
16/* inlines */
17static inline void fsstack_copy_attr_atime(struct inode *dest,
18 const struct inode *src)
19{
20 dest->i_atime = src->i_atime;
21}
22
23static inline void fsstack_copy_attr_times(struct inode *dest,
24 const struct inode *src)
25{
26 dest->i_atime = src->i_atime;
27 dest->i_mtime = src->i_mtime;
28 dest->i_ctime = src->i_ctime;
29}
30
31#endif /* _LINUX_FS_STACK_H */
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index c623d12a486e..11a36ceddf73 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -18,6 +18,8 @@ struct fs_struct {
18 .umask = 0022, \ 18 .umask = 0022, \
19} 19}
20 20
21extern struct kmem_cache *fs_cachep;
22
21extern void exit_fs(struct task_struct *); 23extern void exit_fs(struct task_struct *);
22extern void set_fs_altroot(void); 24extern void set_fs_altroot(void);
23extern void set_fs_root(struct fs_struct *, struct vfsmount *, struct dentry *); 25extern void set_fs_root(struct fs_struct *, struct vfsmount *, struct dentry *);
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 3da29e2d524a..abb64c437f6f 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -19,6 +19,7 @@
19#define _FSL_DEVICE_H_ 19#define _FSL_DEVICE_H_
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/phy.h>
22 23
23/* 24/*
24 * Some conventions on how we handle peripherals on Freescale chips 25 * Some conventions on how we handle peripherals on Freescale chips
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index d4f219ffaa5d..dfc4e4f68da4 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -164,7 +164,7 @@ static inline void fsnotify_open(struct dentry *dentry)
164 */ 164 */
165static inline void fsnotify_close(struct file *file) 165static inline void fsnotify_close(struct file *file)
166{ 166{
167 struct dentry *dentry = file->f_dentry; 167 struct dentry *dentry = file->f_path.dentry;
168 struct inode *inode = dentry->d_inode; 168 struct inode *inode = dentry->d_inode;
169 const char *name = dentry->d_name.name; 169 const char *name = dentry->d_name.name;
170 mode_t mode = file->f_mode; 170 mode_t mode = file->f_mode;
diff --git a/include/linux/ftape-header-segment.h b/include/linux/ftape-header-segment.h
deleted file mode 100644
index 4732218f0708..000000000000
--- a/include/linux/ftape-header-segment.h
+++ /dev/null
@@ -1,122 +0,0 @@
1#ifndef _FTAPE_HEADER_SEGMENT_H
2#define _FTAPE_HEADER_SEGMENT_H
3
4/*
5 * Copyright (C) 1996-1997 Claus-Justus Heine.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 *
22 * $Source: /homes/cvs/ftape-stacked/include/linux/ftape-header-segment.h,v $
23 * $Revision: 1.2 $
24 * $Date: 1997/10/05 19:19:28 $
25 *
26 * This file defines some offsets into the header segment of a
27 * floppy tape cartridge. For use with the QIC-40/80/3010/3020
28 * floppy-tape driver "ftape" for Linux.
29 */
30
31#define FT_SIGNATURE 0 /* must be 0xaa55aa55 */
32#define FT_FMT_CODE 4
33#define FT_REV_LEVEL 5 /* only for QIC-80 since. Rev. L (== 0x0c) */
34#define FT_HSEG_1 6 /* first header segment, except for format code 6 */
35#define FT_HSEG_2 8 /* second header segment, except for format code 6 */
36#define FT_FRST_SEG 10 /* first data segment, except for format code 6 */
37#define FT_LAST_SEG 12 /* last data segment, except for format code 6 */
38#define FT_FMT_DATE 14 /* date and time of most recent format, see below */
39#define FT_WR_DATE 18 /* date and time of most recent write or format */
40#define FT_SPT 24 /* segments per track */
41#define FT_TPC 26 /* tracks per cartridge */
42#define FT_FHM 27 /* floppy drive head (maximum of it) */
43#define FT_FTM 28 /* floppy track max. */
44#define FT_FSM 29 /* floppy sector max. (128) */
45#define FT_LABEL 30 /* floppy tape label */
46#define FT_LABEL_DATE 74 /* date and time the tape label was written */
47#define FT_LABEL_SZ (FT_LABEL_DATE - FT_LABEL)
48#define FT_CMAP_START 78 /* starting segment of compression map */
49#define FT_FMT_ERROR 128 /* must be set to 0xff if remainder gets lost during
50 * tape format
51 */
52#define FT_SEG_CNT 130 /* number of seg. written, formatted or verified
53 * through lifetime of tape (why not read?)
54 */
55#define FT_INIT_DATE 138 /* date and time of initial tape format */
56#define FT_FMT_CNT 142 /* number of times tape has been formatted */
57#define FT_FSL_CNT 144 /* number of segments in failed sector log */
58#define FT_MK_CODE 146 /* id string of tape manufacturer */
59#define FT_LOT_CODE 190 /* tape manufacturer lot code */
60#define FT_6_HSEG_1 234 /* first header segment for format code 6 */
61#define FT_6_HSEG_2 238 /* second header segment for format code 6 */
62#define FT_6_FRST_SEG 242 /* first data segment for format code 6 */
63#define FT_6_LAST_SEG 246 /* last data segment for format code 6 */
64
65#define FT_FSL 256
66#define FT_HEADER_END 256 /* space beyond this point:
67 * format codes 2, 3 and 5:
68 * - failed sector log until byte 2047
69 * - bad sector map in the reamining part of segment
70 * format codes 4 and 6:
71 * - bad sector map starts hear
72 */
73
74
75/* value to be stored at the FT_SIGNATURE offset
76 */
77#define FT_HSEG_MAGIC 0xaa55aa55
78#define FT_D2G_MAGIC 0x82288228 /* Ditto 2GB */
79
80/* data and time encoding: */
81#define FT_YEAR_SHIFT 25
82#define FT_YEAR_MASK 0xfe000000
83#define FT_YEAR_0 1970
84#define FT_YEAR_MAX 127
85#define FT_YEAR(year) ((((year)-FT_YEAR_0)<<FT_YEAR_SHIFT)&FT_YEAR_MASK)
86
87#define FT_TIME_SHIFT 0
88#define FT_TIME_MASK 0x01FFFFFF
89#define FT_TIME_MAX 0x01ea6dff /* last second of a year */
90#define FT_TIME(mo,d,h,m,s) \
91 ((((s)+60*((m)+60*((h)+24*((d)+31*(mo))))) & FT_TIME_MASK))
92
93#define FT_TIME_STAMP(y,mo,d,h,m,s) (FT_YEAR(y) | FT_TIME(mo,d,h,m,s))
94
95/* values for the format code field */
96typedef enum {
97 fmt_normal = 2, /* QIC-80 post Rev. B 205Ft or 307Ft tape */
98 fmt_1100ft = 3, /* QIC-80 post Rev. B 1100Ft tape */
99 fmt_var = 4, /* QIC-80 post Rev. B variabel length format */
100 fmt_425ft = 5, /* QIC-80 post Rev. B 425Ft tape */
101 fmt_big = 6 /* QIC-3010/3020 variable length tape with more
102 * than 2^16 segments per tape
103 */
104} ft_format_type;
105
106/* definitions for the failed sector log */
107#define FT_FSL_SIZE (2 * FT_SECTOR_SIZE - FT_HEADER_END)
108#define FT_FSL_MAX_ENTRIES (FT_FSL_SIZE/sizeof(__u32))
109
110typedef struct ft_fsl_entry {
111 __u16 segment;
112 __u16 date;
113} __attribute__ ((packed)) ft_fsl_entry;
114
115
116/* date encoding for the failed sector log
117 * month: 1..12, day: 1..31, year: 1970..2097
118 */
119#define FT_FSL_TIME_STAMP(y,m,d) \
120 (((((y) - FT_YEAR_0)<<9)&0xfe00) | (((m)<<5)&0x01e0) | ((d)&0x001f))
121
122#endif /* _FTAPE_HEADER_SEGMENT_H */
diff --git a/include/linux/ftape-vendors.h b/include/linux/ftape-vendors.h
deleted file mode 100644
index ec1a81f059e5..000000000000
--- a/include/linux/ftape-vendors.h
+++ /dev/null
@@ -1,137 +0,0 @@
1#ifndef _FTAPE_VENDORS_H
2#define _FTAPE_VENDORS_H
3
4/*
5 * Copyright (C) 1993-1996 Bas Laarhoven,
6 * (C) 1996-1997 Claus-Justus Heine.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; see the file COPYING. If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 *
23 * $Source: /homes/cvs/ftape-stacked/include/linux/ftape-vendors.h,v $
24 * $Revision: 1.6 $
25 * $Date: 1997/10/09 15:38:11 $
26 *
27 * This file contains the supported drive types with their
28 * QIC-117 spec. vendor code and drive dependent configuration
29 * information.
30 */
31
32typedef enum {
33 unknown_wake_up = 0,
34 no_wake_up,
35 wake_up_colorado,
36 wake_up_mountain,
37 wake_up_insight,
38} wake_up_types;
39
40typedef struct {
41 wake_up_types wake_up; /* see wake_up_types */
42 char *name; /* Text describing the drive */
43} wakeup_method;
44
45/* Note: order of entries in WAKEUP_METHODS must be so that a variable
46 * of type wake_up_types can be used as an index in the array.
47 */
48#define WAKEUP_METHODS { \
49 { unknown_wake_up, "Unknown" }, \
50 { no_wake_up, "None" }, \
51 { wake_up_colorado, "Colorado" }, \
52 { wake_up_mountain, "Mountain" }, \
53 { wake_up_insight, "Motor-on" }, \
54}
55
56typedef struct {
57 unsigned int vendor_id; /* vendor id from drive */
58 int speed; /* maximum tape transport speed (ips) */
59 wake_up_types wake_up; /* see wake_up_types */
60 char *name; /* Text describing the drive */
61} vendor_struct;
62
63#define UNKNOWN_VENDOR (-1)
64
65#define QIC117_VENDORS { \
66/* see _vendor_struct */ \
67 { 0x00000, 82, wake_up_colorado, "Colorado DJ-10 (old)" }, \
68 { 0x00047, 90, wake_up_colorado, "Colorado DJ-10/DJ-20" }, \
69 { 0x011c2, 84, wake_up_colorado, "Colorado 700" }, \
70 { 0x011c3, 90, wake_up_colorado, "Colorado 1400" }, \
71 { 0x011c4, 84, wake_up_colorado, "Colorado DJ-10/DJ-20 (new)" }, \
72 { 0x011c5, 84, wake_up_colorado, "HP Colorado T1000" }, \
73 { 0x011c6, 90, wake_up_colorado, "HP Colorado T3000" }, \
74 { 0x00005, 45, wake_up_mountain, "Archive 5580i" }, \
75 { 0x10005, 50, wake_up_insight, "Insight 80Mb, Irwin 80SX" }, \
76 { 0x00140, 74, wake_up_mountain, "Archive S.Hornet [Identity/Escom]" }, \
77 { 0x00146, 72, wake_up_mountain, "Archive 31250Q [Escom]" }, \
78 { 0x0014a, 100, wake_up_mountain, "Archive XL9250i [Conner/Escom]" }, \
79 { 0x0014c, 98, wake_up_mountain, "Conner C250MQT" }, \
80 { 0x0014e, 80, wake_up_mountain, "Conner C250MQ" }, \
81 { 0x00150, 80, wake_up_mountain, "Conner TSM420R/TST800R" }, \
82 { 0x00152, 80, wake_up_mountain, "Conner TSM850R" }, \
83 { 0x00156, 80, wake_up_mountain, "Conner TSM850R/1700R/TST3200R" }, \
84 { 0x00180, 0, wake_up_mountain, "Summit SE 150" }, \
85 { 0x00181, 85, wake_up_mountain, "Summit SE 250, Mountain FS8000" }, \
86 { 0x001c1, 82, no_wake_up, "Wangtek 3040F" }, \
87 { 0x001c8, 64, no_wake_up, "Wangtek 3080F" }, \
88 { 0x001c8, 64, wake_up_colorado, "Wangtek 3080F" }, \
89 { 0x001ca, 67, no_wake_up, "Wangtek 3080F (new)" }, \
90 { 0x001cc, 77, wake_up_colorado, "Wangtek 3200 / Teac 700" }, \
91 { 0x001cd, 75, wake_up_colorado, "Reveal TB1400" }, \
92 { 0x00380, 85, wake_up_colorado, "Exabyte Eagle-96" }, \
93 { 0x00381, 85, wake_up_colorado, "Exabyte Eagle TR-3" }, \
94 { 0x00382, 85, wake_up_colorado, "Exabyte Eagle TR-3" }, \
95 { 0x003ce, 77, wake_up_colorado, "Teac 800" }, \
96 { 0x003cf, 0, wake_up_colorado, "Teac FT3010TR" }, \
97 { 0x08880, 64, no_wake_up, "Iomega 250, Ditto 800" }, \
98 { 0x08880, 64, wake_up_colorado, "Iomega 250, Ditto 800" }, \
99 { 0x08880, 64, wake_up_insight, "Iomega 250, Ditto 800" }, \
100 { 0x08881, 80, wake_up_colorado, "Iomega 700" }, \
101 { 0x08882, 80, wake_up_colorado, "Iomega 3200" }, \
102 { 0x08883, 80, wake_up_colorado, "Iomega DITTO 2GB" }, \
103 { 0x00021, 70, no_wake_up, "AIWA CT-803" }, \
104 { 0x004c0, 80, no_wake_up, "AIWA TD-S1600" }, \
105 { 0x00021, 0, wake_up_mountain, "COREtape QIC80" }, \
106 { 0x00441, 0, wake_up_mountain, "ComByte DoublePlay" }, \
107 { 0x00481, 127, wake_up_mountain, "PERTEC MyTape 800" }, \
108 { 0x00483, 130, wake_up_mountain, "PERTEC MyTape 3200" }, \
109 { UNKNOWN_VENDOR, 0, no_wake_up, "unknown" } \
110}
111
112#define QIC117_MAKE_CODES { \
113 { 0, "Unassigned" }, \
114 { 1, "Alloy Computer Products" }, \
115 { 2, "3M" }, \
116 { 3, "Tandberg Data" }, \
117 { 4, "Colorado" }, \
118 { 5, "Archive/Conner" }, \
119 { 6, "Mountain/Summit Memory Systems" }, \
120 { 7, "Wangtek/Rexon/Tecmar" }, \
121 { 8, "Sony" }, \
122 { 9, "Cipher Data Products" }, \
123 { 10, "Irwin Magnetic Systems" }, \
124 { 11, "Braemar" }, \
125 { 12, "Verbatim" }, \
126 { 13, "Core International" }, \
127 { 14, "Exabyte" }, \
128 { 15, "Teac" }, \
129 { 16, "Gigatek" }, \
130 { 17, "ComByte" }, \
131 { 18, "PERTEC Memories" }, \
132 { 19, "Aiwa" }, \
133 { 71, "Colorado" }, \
134 { 546, "Iomega Inc" }, \
135}
136
137#endif /* _FTAPE_VENDORS_H */
diff --git a/include/linux/ftape.h b/include/linux/ftape.h
deleted file mode 100644
index 7e7038cba86a..000000000000
--- a/include/linux/ftape.h
+++ /dev/null
@@ -1,201 +0,0 @@
1#ifndef _FTAPE_H
2#define _FTAPE_H
3
4/*
5 * Copyright (C) 1994-1996 Bas Laarhoven,
6 * (C) 1996-1997 Claus-Justus Heine.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; see the file COPYING. If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21
22 *
23 * $Source: /homes/cvs/ftape-stacked/include/linux/ftape.h,v $
24 * $Revision: 1.17.6.4 $
25 * $Date: 1997/11/25 01:52:54 $
26 *
27 * This file contains global definitions, typedefs and macro's
28 * for the QIC-40/80/3010/3020 floppy-tape driver for Linux.
29 */
30
31#define FTAPE_VERSION "ftape v3.04d 25/11/97"
32
33#ifdef __KERNEL__
34#include <linux/interrupt.h>
35#include <linux/mm.h>
36#endif
37#include <linux/types.h>
38#include <linux/mtio.h>
39
40#define FT_SECTOR(x) (x+1) /* sector offset into real sector */
41#define FT_SECTOR_SIZE 1024
42#define FT_SECTORS_PER_SEGMENT 32
43#define FT_ECC_SECTORS 3
44#define FT_SEGMENT_SIZE ((FT_SECTORS_PER_SEGMENT - FT_ECC_SECTORS) * FT_SECTOR_SIZE)
45#define FT_BUFF_SIZE (FT_SECTORS_PER_SEGMENT * FT_SECTOR_SIZE)
46
47/*
48 * bits of the minor device number that define drive selection
49 * methods. Could be used one day to access multiple tape
50 * drives on the same controller.
51 */
52#define FTAPE_SEL_A 0
53#define FTAPE_SEL_B 1
54#define FTAPE_SEL_C 2
55#define FTAPE_SEL_D 3
56#define FTAPE_SEL_MASK 3
57#define FTAPE_SEL(unit) ((unit) & FTAPE_SEL_MASK)
58#define FTAPE_NO_REWIND 4 /* mask for minor nr */
59
60/* the following two may be reported when MTIOCGET is requested ... */
61typedef union {
62 struct {
63 __u8 error;
64 __u8 command;
65 } error;
66 long space;
67} ft_drive_error;
68typedef union {
69 struct {
70 __u8 drive_status;
71 __u8 drive_config;
72 __u8 tape_status;
73 } status;
74 long space;
75} ft_drive_status;
76
77#ifdef __KERNEL__
78
79#define FT_RQM_DELAY 12
80#define FT_MILLISECOND 1
81#define FT_SECOND 1000
82#define FT_FOREVER -1
83#ifndef HZ
84#error "HZ undefined."
85#endif
86#define FT_USPT (1000000/HZ) /* microseconds per tick */
87
88/* This defines the number of retries that the driver will allow
89 * before giving up (and letting a higher level handle the error).
90 */
91#ifdef TESTING
92#define FT_SOFT_RETRIES 1 /* number of low level retries */
93#define FT_RETRIES_ON_ECC_ERROR 3 /* ecc error when correcting segment */
94#else
95#define FT_SOFT_RETRIES 6 /* number of low level retries (triple) */
96#define FT_RETRIES_ON_ECC_ERROR 3 /* ecc error when correcting segment */
97#endif
98
99#ifndef THE_FTAPE_MAINTAINER
100#define THE_FTAPE_MAINTAINER "the ftape maintainer"
101#endif
102
103/* Initialize missing configuration parameters.
104 */
105#ifndef CONFIG_FT_NR_BUFFERS
106# define CONFIG_FT_NR_BUFFERS 3
107#endif
108#ifndef CONFIG_FT_FDC_THR
109# define CONFIG_FT_FDC_THR 8
110#endif
111#ifndef CONFIG_FT_FDC_MAX_RATE
112# define CONFIG_FT_FDC_MAX_RATE 2000
113#endif
114#ifndef CONFIG_FT_FDC_BASE
115# define CONFIG_FT_FDC_BASE 0
116#endif
117#ifndef CONFIG_FT_FDC_IRQ
118# define CONFIG_FT_FDC_IRQ 0
119#endif
120#ifndef CONFIG_FT_FDC_DMA
121# define CONFIG_FT_FDC_DMA 0
122#endif
123
124/* Turn some booleans into numbers.
125 */
126#ifdef CONFIG_FT_PROBE_FC10
127# undef CONFIG_FT_PROBE_FC10
128# define CONFIG_FT_PROBE_FC10 1
129#else
130# define CONFIG_FT_PROBE_FC10 0
131#endif
132#ifdef CONFIG_FT_MACH2
133# undef CONFIG_FT_MACH2
134# define CONFIG_FT_MACH2 1
135#else
136# define CONFIG_FT_MACH2 0
137#endif
138
139/* Insert default settings
140 */
141#if CONFIG_FT_PROBE_FC10 == 1
142# if CONFIG_FT_FDC_BASE == 0
143# undef CONFIG_FT_FDC_BASE
144# define CONFIG_FT_FDC_BASE 0x180
145# endif
146# if CONFIG_FT_FDC_IRQ == 0
147# undef CONFIG_FT_FDC_IRQ
148# define CONFIG_FT_FDC_IRQ 9
149# endif
150# if CONFIG_FT_FDC_DMA == 0
151# undef CONFIG_FT_FDC_DMA
152# define CONFIG_FT_FDC_DMA 3
153# endif
154#elif CONFIG_FT_MACH2 == 1 /* CONFIG_FT_PROBE_FC10 == 1 */
155# if CONFIG_FT_FDC_BASE == 0
156# undef CONFIG_FT_FDC_BASE
157# define CONFIG_FT_FDC_BASE 0x1E0
158# endif
159# if CONFIG_FT_FDC_IRQ == 0
160# undef CONFIG_FT_FDC_IRQ
161# define CONFIG_FT_FDC_IRQ 6
162# endif
163# if CONFIG_FT_FDC_DMA == 0
164# undef CONFIG_FT_FDC_DMA
165# define CONFIG_FT_FDC_DMA 2
166# endif
167#elif defined(CONFIG_FT_ALT_FDC) /* CONFIG_FT_MACH2 */
168# if CONFIG_FT_FDC_BASE == 0
169# undef CONFIG_FT_FDC_BASE
170# define CONFIG_FT_FDC_BASE 0x370
171# endif
172# if CONFIG_FT_FDC_IRQ == 0
173# undef CONFIG_FT_FDC_IRQ
174# define CONFIG_FT_FDC_IRQ 6
175# endif
176# if CONFIG_FT_FDC_DMA == 0
177# undef CONFIG_FT_FDC_DMA
178# define CONFIG_FT_FDC_DMA 2
179# endif
180#else /* CONFIG_FT_ALT_FDC */
181# if CONFIG_FT_FDC_BASE == 0
182# undef CONFIG_FT_FDC_BASE
183# define CONFIG_FT_FDC_BASE 0x3f0
184# endif
185# if CONFIG_FT_FDC_IRQ == 0
186# undef CONFIG_FT_FDC_IRQ
187# define CONFIG_FT_FDC_IRQ 6
188# endif
189# if CONFIG_FT_FDC_DMA == 0
190# undef CONFIG_FT_FDC_DMA
191# define CONFIG_FT_FDC_DMA 2
192# endif
193#endif /* standard FDC */
194
195/* some useful macro's
196 */
197#define NR_ITEMS(x) (int)(sizeof(x)/ sizeof(*x))
198
199#endif /* __KERNEL__ */
200
201#endif
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 9fc48a674b82..534744efe30d 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -15,7 +15,7 @@
15#define FUSE_KERNEL_VERSION 7 15#define FUSE_KERNEL_VERSION 7
16 16
17/** Minor version number of this interface */ 17/** Minor version number of this interface */
18#define FUSE_KERNEL_MINOR_VERSION 7 18#define FUSE_KERNEL_MINOR_VERSION 8
19 19
20/** The node ID of the root inode */ 20/** The node ID of the root inode */
21#define FUSE_ROOT_ID 1 21#define FUSE_ROOT_ID 1
@@ -92,6 +92,11 @@ struct fuse_file_lock {
92#define FUSE_ASYNC_READ (1 << 0) 92#define FUSE_ASYNC_READ (1 << 0)
93#define FUSE_POSIX_LOCKS (1 << 1) 93#define FUSE_POSIX_LOCKS (1 << 1)
94 94
95/**
96 * Release flags
97 */
98#define FUSE_RELEASE_FLUSH (1 << 0)
99
95enum fuse_opcode { 100enum fuse_opcode {
96 FUSE_LOOKUP = 1, 101 FUSE_LOOKUP = 1,
97 FUSE_FORGET = 2, /* no reply */ 102 FUSE_FORGET = 2, /* no reply */
@@ -127,6 +132,8 @@ enum fuse_opcode {
127 FUSE_ACCESS = 34, 132 FUSE_ACCESS = 34,
128 FUSE_CREATE = 35, 133 FUSE_CREATE = 35,
129 FUSE_INTERRUPT = 36, 134 FUSE_INTERRUPT = 36,
135 FUSE_BMAP = 37,
136 FUSE_DESTROY = 38,
130}; 137};
131 138
132/* The read buffer is required to be at least 8k, but may be much larger */ 139/* The read buffer is required to be at least 8k, but may be much larger */
@@ -205,12 +212,13 @@ struct fuse_open_out {
205struct fuse_release_in { 212struct fuse_release_in {
206 __u64 fh; 213 __u64 fh;
207 __u32 flags; 214 __u32 flags;
208 __u32 padding; 215 __u32 release_flags;
216 __u64 lock_owner;
209}; 217};
210 218
211struct fuse_flush_in { 219struct fuse_flush_in {
212 __u64 fh; 220 __u64 fh;
213 __u32 flush_flags; 221 __u32 unused;
214 __u32 padding; 222 __u32 padding;
215 __u64 lock_owner; 223 __u64 lock_owner;
216}; 224};
@@ -296,6 +304,16 @@ struct fuse_interrupt_in {
296 __u64 unique; 304 __u64 unique;
297}; 305};
298 306
307struct fuse_bmap_in {
308 __u64 block;
309 __u32 blocksize;
310 __u32 padding;
311};
312
313struct fuse_bmap_out {
314 __u64 block;
315};
316
299struct fuse_in_header { 317struct fuse_in_header {
300 __u32 len; 318 __u32 len;
301 __u32 opcode; 319 __u32 opcode;
diff --git a/include/linux/futex.h b/include/linux/futex.h
index d097b5b72bc6..3f153b4e156c 100644
--- a/include/linux/futex.h
+++ b/include/linux/futex.h
@@ -93,6 +93,7 @@ struct robust_list_head {
93 */ 93 */
94#define ROBUST_LIST_LIMIT 2048 94#define ROBUST_LIST_LIMIT 2048
95 95
96#ifdef __KERNEL__
96long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout, 97long do_futex(u32 __user *uaddr, int op, u32 val, unsigned long timeout,
97 u32 __user *uaddr2, u32 val2, u32 val3); 98 u32 __user *uaddr2, u32 val2, u32 val3);
98 99
@@ -110,6 +111,7 @@ static inline void exit_pi_state_list(struct task_struct *curr)
110{ 111{
111} 112}
112#endif 113#endif
114#endif /* __KERNEL__ */
113 115
114#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ 116#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */
115#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ 117#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 2cdba0c23957..afad95272841 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -105,7 +105,7 @@ static inline void gameport_set_phys(struct gameport *gameport,
105 105
106static inline struct gameport *gameport_allocate_port(void) 106static inline struct gameport *gameport_allocate_port(void)
107{ 107{
108 struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL); 108 struct gameport *gameport = kzalloc(sizeof(struct gameport), GFP_KERNEL);
109 109
110 return gameport; 110 return gameport;
111} 111}
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h
index e25384561955..5412da28fa47 100644
--- a/include/linux/generic_serial.h
+++ b/include/linux/generic_serial.h
@@ -91,7 +91,7 @@ void gs_hangup(struct tty_struct *tty);
91int gs_block_til_ready(void *port, struct file *filp); 91int gs_block_til_ready(void *port, struct file *filp);
92void gs_close(struct tty_struct *tty, struct file *filp); 92void gs_close(struct tty_struct *tty, struct file *filp);
93void gs_set_termios (struct tty_struct * tty, 93void gs_set_termios (struct tty_struct * tty,
94 struct termios * old_termios); 94 struct ktermios * old_termios);
95int gs_init_port(struct gs_port *port); 95int gs_init_port(struct gs_port *port);
96int gs_setserial(struct gs_port *port, struct serial_struct __user *sp); 96int gs_setserial(struct gs_port *port, struct serial_struct __user *sp);
97int gs_getserial(struct gs_port *port, struct serial_struct __user *sp); 97int gs_getserial(struct gs_port *port, struct serial_struct __user *sp);
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index 9049dc65ae51..f7a93770e1be 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -17,6 +17,9 @@ struct genlmsghdr {
17#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr)) 17#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
18 18
19#define GENL_ADMIN_PERM 0x01 19#define GENL_ADMIN_PERM 0x01
20#define GENL_CMD_CAP_DO 0x02
21#define GENL_CMD_CAP_DUMP 0x04
22#define GENL_CMD_CAP_HASPOL 0x08
20 23
21/* 24/*
22 * List of reserved static generic netlink identifiers: 25 * List of reserved static generic netlink identifiers:
@@ -58,9 +61,6 @@ enum {
58 CTRL_ATTR_OP_UNSPEC, 61 CTRL_ATTR_OP_UNSPEC,
59 CTRL_ATTR_OP_ID, 62 CTRL_ATTR_OP_ID,
60 CTRL_ATTR_OP_FLAGS, 63 CTRL_ATTR_OP_FLAGS,
61 CTRL_ATTR_OP_POLICY,
62 CTRL_ATTR_OP_DOIT,
63 CTRL_ATTR_OP_DUMPIT,
64 __CTRL_ATTR_OP_MAX, 64 __CTRL_ATTR_OP_MAX,
65}; 65};
66 66
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 41f276fdd185..0a022b2f63fc 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -83,6 +83,9 @@ struct hd_struct {
83 struct kobject *holder_dir; 83 struct kobject *holder_dir;
84 unsigned ios[2], sectors[2]; /* READs and WRITEs */ 84 unsigned ios[2], sectors[2]; /* READs and WRITEs */
85 int policy, partno; 85 int policy, partno;
86#ifdef CONFIG_FAIL_MAKE_REQUEST
87 int make_it_fail;
88#endif
86}; 89};
87 90
88#define GENHD_FL_REMOVABLE 1 91#define GENHD_FL_REMOVABLE 1
@@ -90,6 +93,7 @@ struct hd_struct {
90#define GENHD_FL_CD 8 93#define GENHD_FL_CD 8
91#define GENHD_FL_UP 16 94#define GENHD_FL_UP 16
92#define GENHD_FL_SUPPRESS_PARTITION_INFO 32 95#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
96#define GENHD_FL_FAIL 64
93 97
94struct disk_stats { 98struct disk_stats {
95 unsigned long sectors[2]; /* READs and WRITEs */ 99 unsigned long sectors[2]; /* READs and WRITEs */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index bf2b6bc3f6fd..00c314aedab7 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -116,6 +116,9 @@ static inline enum zone_type gfp_zone(gfp_t flags)
116#ifndef HAVE_ARCH_FREE_PAGE 116#ifndef HAVE_ARCH_FREE_PAGE
117static inline void arch_free_page(struct page *page, int order) { } 117static inline void arch_free_page(struct page *page, int order) { }
118#endif 118#endif
119#ifndef HAVE_ARCH_ALLOC_PAGE
120static inline void arch_alloc_page(struct page *page, int order) { }
121#endif
119 122
120extern struct page * 123extern struct page *
121FASTCALL(__alloc_pages(gfp_t, unsigned int, struct zonelist *)); 124FASTCALL(__alloc_pages(gfp_t, unsigned int, struct zonelist *));
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index a7ae7c177cac..8b7e4c1e32ae 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -54,8 +54,13 @@ struct gfs2_inum {
54 __be64 no_addr; 54 __be64 no_addr;
55}; 55};
56 56
57static inline int gfs2_inum_equal(const struct gfs2_inum *ino1, 57struct gfs2_inum_host {
58 const struct gfs2_inum *ino2) 58 __u64 no_formal_ino;
59 __u64 no_addr;
60};
61
62static inline int gfs2_inum_equal(const struct gfs2_inum_host *ino1,
63 const struct gfs2_inum_host *ino2)
59{ 64{
60 return ino1->no_formal_ino == ino2->no_formal_ino && 65 return ino1->no_formal_ino == ino2->no_formal_ino &&
61 ino1->no_addr == ino2->no_addr; 66 ino1->no_addr == ino2->no_addr;
@@ -89,6 +94,12 @@ struct gfs2_meta_header {
89 __be32 __pad1; /* Was incarnation number in gfs1 */ 94 __be32 __pad1; /* Was incarnation number in gfs1 */
90}; 95};
91 96
97struct gfs2_meta_header_host {
98 __u32 mh_magic;
99 __u32 mh_type;
100 __u32 mh_format;
101};
102
92/* 103/*
93 * super-block structure 104 * super-block structure
94 * 105 *
@@ -128,6 +139,23 @@ struct gfs2_sb {
128 /* In gfs1, quota and license dinodes followed */ 139 /* In gfs1, quota and license dinodes followed */
129}; 140};
130 141
142struct gfs2_sb_host {
143 struct gfs2_meta_header_host sb_header;
144
145 __u32 sb_fs_format;
146 __u32 sb_multihost_format;
147
148 __u32 sb_bsize;
149 __u32 sb_bsize_shift;
150
151 struct gfs2_inum_host sb_master_dir; /* Was jindex dinode in gfs1 */
152 struct gfs2_inum_host sb_root_dir;
153
154 char sb_lockproto[GFS2_LOCKNAME_LEN];
155 char sb_locktable[GFS2_LOCKNAME_LEN];
156 /* In gfs1, quota and license dinodes followed */
157};
158
131/* 159/*
132 * resource index structure 160 * resource index structure
133 */ 161 */
@@ -145,6 +173,14 @@ struct gfs2_rindex {
145 __u8 ri_reserved[64]; 173 __u8 ri_reserved[64];
146}; 174};
147 175
176struct gfs2_rindex_host {
177 __u64 ri_addr; /* grp block disk address */
178 __u64 ri_data0; /* first data location */
179 __u32 ri_length; /* length of rgrp header in fs blocks */
180 __u32 ri_data; /* num of data blocks in rgrp */
181 __u32 ri_bitbytes; /* number of bytes in data bitmaps */
182};
183
148/* 184/*
149 * resource group header structure 185 * resource group header structure
150 */ 186 */
@@ -176,6 +212,13 @@ struct gfs2_rgrp {
176 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ 212 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */
177}; 213};
178 214
215struct gfs2_rgrp_host {
216 __u32 rg_flags;
217 __u32 rg_free;
218 __u32 rg_dinodes;
219 __u64 rg_igeneration;
220};
221
179/* 222/*
180 * quota structure 223 * quota structure
181 */ 224 */
@@ -187,6 +230,12 @@ struct gfs2_quota {
187 __u8 qu_reserved[64]; 230 __u8 qu_reserved[64];
188}; 231};
189 232
233struct gfs2_quota_host {
234 __u64 qu_limit;
235 __u64 qu_warn;
236 __u64 qu_value;
237};
238
190/* 239/*
191 * dinode structure 240 * dinode structure
192 */ 241 */
@@ -270,6 +319,27 @@ struct gfs2_dinode {
270 __u8 di_reserved[56]; 319 __u8 di_reserved[56];
271}; 320};
272 321
322struct gfs2_dinode_host {
323 __u64 di_size; /* number of bytes in file */
324 __u64 di_blocks; /* number of blocks in file */
325
326 /* This section varies from gfs1. Padding added to align with
327 * remainder of dinode
328 */
329 __u64 di_goal_meta; /* rgrp to alloc from next */
330 __u64 di_goal_data; /* data block goal */
331 __u64 di_generation; /* generation number for NFS */
332
333 __u32 di_flags; /* GFS2_DIF_... */
334 __u16 di_height; /* height of metadata */
335
336 /* These only apply to directories */
337 __u16 di_depth; /* Number of bits in the table */
338 __u32 di_entries; /* The number of entries in the directory */
339
340 __u64 di_eattr; /* extended attribute block number */
341};
342
273/* 343/*
274 * directory structure - many of these per directory file 344 * directory structure - many of these per directory file
275 */ 345 */
@@ -344,6 +414,16 @@ struct gfs2_log_header {
344 __be32 lh_hash; 414 __be32 lh_hash;
345}; 415};
346 416
417struct gfs2_log_header_host {
418 struct gfs2_meta_header_host lh_header;
419
420 __u64 lh_sequence; /* Sequence number of this transaction */
421 __u32 lh_flags; /* GFS2_LOG_HEAD_... */
422 __u32 lh_tail; /* Block number of log tail */
423 __u32 lh_blkno;
424 __u32 lh_hash;
425};
426
347/* 427/*
348 * Log type descriptor 428 * Log type descriptor
349 */ 429 */
@@ -384,6 +464,11 @@ struct gfs2_inum_range {
384 __be64 ir_length; 464 __be64 ir_length;
385}; 465};
386 466
467struct gfs2_inum_range_host {
468 __u64 ir_start;
469 __u64 ir_length;
470};
471
387/* 472/*
388 * Statfs change 473 * Statfs change
389 * Describes an change to the pool of free and allocated 474 * Describes an change to the pool of free and allocated
@@ -396,6 +481,12 @@ struct gfs2_statfs_change {
396 __be64 sc_dinodes; 481 __be64 sc_dinodes;
397}; 482};
398 483
484struct gfs2_statfs_change_host {
485 __u64 sc_total;
486 __u64 sc_free;
487 __u64 sc_dinodes;
488};
489
399/* 490/*
400 * Quota change 491 * Quota change
401 * Describes an allocation change for a particular 492 * Describes an allocation change for a particular
@@ -410,33 +501,38 @@ struct gfs2_quota_change {
410 __be32 qc_id; 501 __be32 qc_id;
411}; 502};
412 503
504struct gfs2_quota_change_host {
505 __u64 qc_change;
506 __u32 qc_flags; /* GFS2_QCF_... */
507 __u32 qc_id;
508};
509
413#ifdef __KERNEL__ 510#ifdef __KERNEL__
414/* Translation functions */ 511/* Translation functions */
415 512
416extern void gfs2_inum_in(struct gfs2_inum *no, const void *buf); 513extern void gfs2_inum_in(struct gfs2_inum_host *no, const void *buf);
417extern void gfs2_inum_out(const struct gfs2_inum *no, void *buf); 514extern void gfs2_inum_out(const struct gfs2_inum_host *no, void *buf);
418extern void gfs2_sb_in(struct gfs2_sb *sb, const void *buf); 515extern void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf);
419extern void gfs2_rindex_in(struct gfs2_rindex *ri, const void *buf); 516extern void gfs2_rindex_in(struct gfs2_rindex_host *ri, const void *buf);
420extern void gfs2_rindex_out(const struct gfs2_rindex *ri, void *buf); 517extern void gfs2_rindex_out(const struct gfs2_rindex_host *ri, void *buf);
421extern void gfs2_rgrp_in(struct gfs2_rgrp *rg, const void *buf); 518extern void gfs2_rgrp_in(struct gfs2_rgrp_host *rg, const void *buf);
422extern void gfs2_rgrp_out(const struct gfs2_rgrp *rg, void *buf); 519extern void gfs2_rgrp_out(const struct gfs2_rgrp_host *rg, void *buf);
423extern void gfs2_quota_in(struct gfs2_quota *qu, const void *buf); 520extern void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf);
424extern void gfs2_quota_out(const struct gfs2_quota *qu, void *buf); 521struct gfs2_inode;
425extern void gfs2_dinode_in(struct gfs2_dinode *di, const void *buf); 522extern void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf);
426extern void gfs2_dinode_out(const struct gfs2_dinode *di, void *buf);
427extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf); 523extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf);
428extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf); 524extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf);
429extern void gfs2_log_header_in(struct gfs2_log_header *lh, const void *buf); 525extern void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf);
430extern void gfs2_inum_range_in(struct gfs2_inum_range *ir, const void *buf); 526extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf);
431extern void gfs2_inum_range_out(const struct gfs2_inum_range *ir, void *buf); 527extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf);
432extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, const void *buf); 528extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf);
433extern void gfs2_statfs_change_out(const struct gfs2_statfs_change *sc, void *buf); 529extern void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf);
434extern void gfs2_quota_change_in(struct gfs2_quota_change *qc, const void *buf); 530extern void gfs2_quota_change_in(struct gfs2_quota_change_host *qc, const void *buf);
435 531
436/* Printing functions */ 532/* Printing functions */
437 533
438extern void gfs2_rindex_print(const struct gfs2_rindex *ri); 534extern void gfs2_rindex_print(const struct gfs2_rindex_host *ri);
439extern void gfs2_dinode_print(const struct gfs2_dinode *di); 535extern void gfs2_dinode_print(const struct gfs2_inode *ip);
440 536
441#endif /* __KERNEL__ */ 537#endif /* __KERNEL__ */
442 538
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h
new file mode 100644
index 000000000000..f04d6d75c098
--- /dev/null
+++ b/include/linux/hid-debug.h
@@ -0,0 +1,757 @@
1/*
2 * $Id: hid-debug.h,v 1.8 2001/09/25 09:37:57 vojtech Exp $
3 *
4 * (c) 1999 Andreas Gal <gal@cs.uni-magdeburg.de>
5 * (c) 2000-2001 Vojtech Pavlik <vojtech@ucw.cz>
6 *
7 * Some debug stuff for the HID parser.
8 */
9
10/*
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 * Should you need to contact me, the author, you can do so either by
26 * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
27 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
28 */
29
30#include <linux/input.h>
31
32struct hid_usage_entry {
33 unsigned page;
34 unsigned usage;
35 char *description;
36};
37
38static const struct hid_usage_entry hid_usage_table[] = {
39 { 0, 0, "Undefined" },
40 { 1, 0, "GenericDesktop" },
41 {0, 0x01, "Pointer"},
42 {0, 0x02, "Mouse"},
43 {0, 0x04, "Joystick"},
44 {0, 0x05, "GamePad"},
45 {0, 0x06, "Keyboard"},
46 {0, 0x07, "Keypad"},
47 {0, 0x08, "MultiAxis"},
48 {0, 0x30, "X"},
49 {0, 0x31, "Y"},
50 {0, 0x32, "Z"},
51 {0, 0x33, "Rx"},
52 {0, 0x34, "Ry"},
53 {0, 0x35, "Rz"},
54 {0, 0x36, "Slider"},
55 {0, 0x37, "Dial"},
56 {0, 0x38, "Wheel"},
57 {0, 0x39, "HatSwitch"},
58 {0, 0x3a, "CountedBuffer"},
59 {0, 0x3b, "ByteCount"},
60 {0, 0x3c, "MotionWakeup"},
61 {0, 0x3d, "Start"},
62 {0, 0x3e, "Select"},
63 {0, 0x40, "Vx"},
64 {0, 0x41, "Vy"},
65 {0, 0x42, "Vz"},
66 {0, 0x43, "Vbrx"},
67 {0, 0x44, "Vbry"},
68 {0, 0x45, "Vbrz"},
69 {0, 0x46, "Vno"},
70 {0, 0x80, "SystemControl"},
71 {0, 0x81, "SystemPowerDown"},
72 {0, 0x82, "SystemSleep"},
73 {0, 0x83, "SystemWakeUp"},
74 {0, 0x84, "SystemContextMenu"},
75 {0, 0x85, "SystemMainMenu"},
76 {0, 0x86, "SystemAppMenu"},
77 {0, 0x87, "SystemMenuHelp"},
78 {0, 0x88, "SystemMenuExit"},
79 {0, 0x89, "SystemMenuSelect"},
80 {0, 0x8a, "SystemMenuRight"},
81 {0, 0x8b, "SystemMenuLeft"},
82 {0, 0x8c, "SystemMenuUp"},
83 {0, 0x8d, "SystemMenuDown"},
84 {0, 0x90, "D-PadUp"},
85 {0, 0x91, "D-PadDown"},
86 {0, 0x92, "D-PadRight"},
87 {0, 0x93, "D-PadLeft"},
88 { 2, 0, "Simulation" },
89 {0, 0xb0, "Aileron"},
90 {0, 0xb1, "AileronTrim"},
91 {0, 0xb2, "Anti-Torque"},
92 {0, 0xb3, "Autopilot"},
93 {0, 0xb4, "Chaff"},
94 {0, 0xb5, "Collective"},
95 {0, 0xb6, "DiveBrake"},
96 {0, 0xb7, "ElectronicCountermeasures"},
97 {0, 0xb8, "Elevator"},
98 {0, 0xb9, "ElevatorTrim"},
99 {0, 0xba, "Rudder"},
100 {0, 0xbb, "Throttle"},
101 {0, 0xbc, "FlightCommunications"},
102 {0, 0xbd, "FlareRelease"},
103 {0, 0xbe, "LandingGear"},
104 {0, 0xbf, "ToeBrake"},
105 { 7, 0, "Keyboard" },
106 { 8, 0, "LED" },
107 {0, 0x01, "NumLock"},
108 {0, 0x02, "CapsLock"},
109 {0, 0x03, "ScrollLock"},
110 {0, 0x04, "Compose"},
111 {0, 0x05, "Kana"},
112 {0, 0x4b, "GenericIndicator"},
113 { 9, 0, "Button" },
114 { 10, 0, "Ordinal" },
115 { 12, 0, "Consumer" },
116 {0, 0x238, "HorizontalWheel"},
117 { 13, 0, "Digitizers" },
118 {0, 0x01, "Digitizer"},
119 {0, 0x02, "Pen"},
120 {0, 0x03, "LightPen"},
121 {0, 0x04, "TouchScreen"},
122 {0, 0x05, "TouchPad"},
123 {0, 0x20, "Stylus"},
124 {0, 0x21, "Puck"},
125 {0, 0x22, "Finger"},
126 {0, 0x30, "TipPressure"},
127 {0, 0x31, "BarrelPressure"},
128 {0, 0x32, "InRange"},
129 {0, 0x33, "Touch"},
130 {0, 0x34, "UnTouch"},
131 {0, 0x35, "Tap"},
132 {0, 0x39, "TabletFunctionKey"},
133 {0, 0x3a, "ProgramChangeKey"},
134 {0, 0x3c, "Invert"},
135 {0, 0x42, "TipSwitch"},
136 {0, 0x43, "SecondaryTipSwitch"},
137 {0, 0x44, "BarrelSwitch"},
138 {0, 0x45, "Eraser"},
139 {0, 0x46, "TabletPick"},
140 { 15, 0, "PhysicalInterfaceDevice" },
141 {0, 0x00, "Undefined"},
142 {0, 0x01, "Physical_Interface_Device"},
143 {0, 0x20, "Normal"},
144 {0, 0x21, "Set_Effect_Report"},
145 {0, 0x22, "Effect_Block_Index"},
146 {0, 0x23, "Parameter_Block_Offset"},
147 {0, 0x24, "ROM_Flag"},
148 {0, 0x25, "Effect_Type"},
149 {0, 0x26, "ET_Constant_Force"},
150 {0, 0x27, "ET_Ramp"},
151 {0, 0x28, "ET_Custom_Force_Data"},
152 {0, 0x30, "ET_Square"},
153 {0, 0x31, "ET_Sine"},
154 {0, 0x32, "ET_Triangle"},
155 {0, 0x33, "ET_Sawtooth_Up"},
156 {0, 0x34, "ET_Sawtooth_Down"},
157 {0, 0x40, "ET_Spring"},
158 {0, 0x41, "ET_Damper"},
159 {0, 0x42, "ET_Inertia"},
160 {0, 0x43, "ET_Friction"},
161 {0, 0x50, "Duration"},
162 {0, 0x51, "Sample_Period"},
163 {0, 0x52, "Gain"},
164 {0, 0x53, "Trigger_Button"},
165 {0, 0x54, "Trigger_Repeat_Interval"},
166 {0, 0x55, "Axes_Enable"},
167 {0, 0x56, "Direction_Enable"},
168 {0, 0x57, "Direction"},
169 {0, 0x58, "Type_Specific_Block_Offset"},
170 {0, 0x59, "Block_Type"},
171 {0, 0x5A, "Set_Envelope_Report"},
172 {0, 0x5B, "Attack_Level"},
173 {0, 0x5C, "Attack_Time"},
174 {0, 0x5D, "Fade_Level"},
175 {0, 0x5E, "Fade_Time"},
176 {0, 0x5F, "Set_Condition_Report"},
177 {0, 0x60, "CP_Offset"},
178 {0, 0x61, "Positive_Coefficient"},
179 {0, 0x62, "Negative_Coefficient"},
180 {0, 0x63, "Positive_Saturation"},
181 {0, 0x64, "Negative_Saturation"},
182 {0, 0x65, "Dead_Band"},
183 {0, 0x66, "Download_Force_Sample"},
184 {0, 0x67, "Isoch_Custom_Force_Enable"},
185 {0, 0x68, "Custom_Force_Data_Report"},
186 {0, 0x69, "Custom_Force_Data"},
187 {0, 0x6A, "Custom_Force_Vendor_Defined_Data"},
188 {0, 0x6B, "Set_Custom_Force_Report"},
189 {0, 0x6C, "Custom_Force_Data_Offset"},
190 {0, 0x6D, "Sample_Count"},
191 {0, 0x6E, "Set_Periodic_Report"},
192 {0, 0x6F, "Offset"},
193 {0, 0x70, "Magnitude"},
194 {0, 0x71, "Phase"},
195 {0, 0x72, "Period"},
196 {0, 0x73, "Set_Constant_Force_Report"},
197 {0, 0x74, "Set_Ramp_Force_Report"},
198 {0, 0x75, "Ramp_Start"},
199 {0, 0x76, "Ramp_End"},
200 {0, 0x77, "Effect_Operation_Report"},
201 {0, 0x78, "Effect_Operation"},
202 {0, 0x79, "Op_Effect_Start"},
203 {0, 0x7A, "Op_Effect_Start_Solo"},
204 {0, 0x7B, "Op_Effect_Stop"},
205 {0, 0x7C, "Loop_Count"},
206 {0, 0x7D, "Device_Gain_Report"},
207 {0, 0x7E, "Device_Gain"},
208 {0, 0x7F, "PID_Pool_Report"},
209 {0, 0x80, "RAM_Pool_Size"},
210 {0, 0x81, "ROM_Pool_Size"},
211 {0, 0x82, "ROM_Effect_Block_Count"},
212 {0, 0x83, "Simultaneous_Effects_Max"},
213 {0, 0x84, "Pool_Alignment"},
214 {0, 0x85, "PID_Pool_Move_Report"},
215 {0, 0x86, "Move_Source"},
216 {0, 0x87, "Move_Destination"},
217 {0, 0x88, "Move_Length"},
218 {0, 0x89, "PID_Block_Load_Report"},
219 {0, 0x8B, "Block_Load_Status"},
220 {0, 0x8C, "Block_Load_Success"},
221 {0, 0x8D, "Block_Load_Full"},
222 {0, 0x8E, "Block_Load_Error"},
223 {0, 0x8F, "Block_Handle"},
224 {0, 0x90, "PID_Block_Free_Report"},
225 {0, 0x91, "Type_Specific_Block_Handle"},
226 {0, 0x92, "PID_State_Report"},
227 {0, 0x94, "Effect_Playing"},
228 {0, 0x95, "PID_Device_Control_Report"},
229 {0, 0x96, "PID_Device_Control"},
230 {0, 0x97, "DC_Enable_Actuators"},
231 {0, 0x98, "DC_Disable_Actuators"},
232 {0, 0x99, "DC_Stop_All_Effects"},
233 {0, 0x9A, "DC_Device_Reset"},
234 {0, 0x9B, "DC_Device_Pause"},
235 {0, 0x9C, "DC_Device_Continue"},
236 {0, 0x9F, "Device_Paused"},
237 {0, 0xA0, "Actuators_Enabled"},
238 {0, 0xA4, "Safety_Switch"},
239 {0, 0xA5, "Actuator_Override_Switch"},
240 {0, 0xA6, "Actuator_Power"},
241 {0, 0xA7, "Start_Delay"},
242 {0, 0xA8, "Parameter_Block_Size"},
243 {0, 0xA9, "Device_Managed_Pool"},
244 {0, 0xAA, "Shared_Parameter_Blocks"},
245 {0, 0xAB, "Create_New_Effect_Report"},
246 {0, 0xAC, "RAM_Pool_Available"},
247 { 0x84, 0, "Power Device" },
248 { 0x84, 0x02, "PresentStatus" },
249 { 0x84, 0x03, "ChangeStatus" },
250 { 0x84, 0x04, "UPS" },
251 { 0x84, 0x05, "PowerSupply" },
252 { 0x84, 0x10, "BatterySystem" },
253 { 0x84, 0x11, "BatterySystemID" },
254 { 0x84, 0x12, "Battery" },
255 { 0x84, 0x13, "BatteryID" },
256 { 0x84, 0x14, "Charger" },
257 { 0x84, 0x15, "ChargerID" },
258 { 0x84, 0x16, "PowerConverter" },
259 { 0x84, 0x17, "PowerConverterID" },
260 { 0x84, 0x18, "OutletSystem" },
261 { 0x84, 0x19, "OutletSystemID" },
262 { 0x84, 0x1a, "Input" },
263 { 0x84, 0x1b, "InputID" },
264 { 0x84, 0x1c, "Output" },
265 { 0x84, 0x1d, "OutputID" },
266 { 0x84, 0x1e, "Flow" },
267 { 0x84, 0x1f, "FlowID" },
268 { 0x84, 0x20, "Outlet" },
269 { 0x84, 0x21, "OutletID" },
270 { 0x84, 0x22, "Gang" },
271 { 0x84, 0x24, "PowerSummary" },
272 { 0x84, 0x25, "PowerSummaryID" },
273 { 0x84, 0x30, "Voltage" },
274 { 0x84, 0x31, "Current" },
275 { 0x84, 0x32, "Frequency" },
276 { 0x84, 0x33, "ApparentPower" },
277 { 0x84, 0x35, "PercentLoad" },
278 { 0x84, 0x40, "ConfigVoltage" },
279 { 0x84, 0x41, "ConfigCurrent" },
280 { 0x84, 0x43, "ConfigApparentPower" },
281 { 0x84, 0x53, "LowVoltageTransfer" },
282 { 0x84, 0x54, "HighVoltageTransfer" },
283 { 0x84, 0x56, "DelayBeforeStartup" },
284 { 0x84, 0x57, "DelayBeforeShutdown" },
285 { 0x84, 0x58, "Test" },
286 { 0x84, 0x5a, "AudibleAlarmControl" },
287 { 0x84, 0x60, "Present" },
288 { 0x84, 0x61, "Good" },
289 { 0x84, 0x62, "InternalFailure" },
290 { 0x84, 0x65, "Overload" },
291 { 0x84, 0x66, "OverCharged" },
292 { 0x84, 0x67, "OverTemperature" },
293 { 0x84, 0x68, "ShutdownRequested" },
294 { 0x84, 0x69, "ShutdownImminent" },
295 { 0x84, 0x6b, "SwitchOn/Off" },
296 { 0x84, 0x6c, "Switchable" },
297 { 0x84, 0x6d, "Used" },
298 { 0x84, 0x6e, "Boost" },
299 { 0x84, 0x73, "CommunicationLost" },
300 { 0x84, 0xfd, "iManufacturer" },
301 { 0x84, 0xfe, "iProduct" },
302 { 0x84, 0xff, "iSerialNumber" },
303 { 0x85, 0, "Battery System" },
304 { 0x85, 0x01, "SMBBatteryMode" },
305 { 0x85, 0x02, "SMBBatteryStatus" },
306 { 0x85, 0x03, "SMBAlarmWarning" },
307 { 0x85, 0x04, "SMBChargerMode" },
308 { 0x85, 0x05, "SMBChargerStatus" },
309 { 0x85, 0x06, "SMBChargerSpecInfo" },
310 { 0x85, 0x07, "SMBSelectorState" },
311 { 0x85, 0x08, "SMBSelectorPresets" },
312 { 0x85, 0x09, "SMBSelectorInfo" },
313 { 0x85, 0x29, "RemainingCapacityLimit" },
314 { 0x85, 0x2c, "CapacityMode" },
315 { 0x85, 0x42, "BelowRemainingCapacityLimit" },
316 { 0x85, 0x44, "Charging" },
317 { 0x85, 0x45, "Discharging" },
318 { 0x85, 0x4b, "NeedReplacement" },
319 { 0x85, 0x66, "RemainingCapacity" },
320 { 0x85, 0x68, "RunTimeToEmpty" },
321 { 0x85, 0x6a, "AverageTimeToFull" },
322 { 0x85, 0x83, "DesignCapacity" },
323 { 0x85, 0x85, "ManufacturerDate" },
324 { 0x85, 0x89, "iDeviceChemistry" },
325 { 0x85, 0x8b, "Rechargable" },
326 { 0x85, 0x8f, "iOEMInformation" },
327 { 0x85, 0x8d, "CapacityGranularity1" },
328 { 0x85, 0xd0, "ACPresent" },
329 /* pages 0xff00 to 0xffff are vendor-specific */
330 { 0xffff, 0, "Vendor-specific-FF" },
331 { 0, 0, NULL }
332};
333
334static void resolv_usage_page(unsigned page) {
335 const struct hid_usage_entry *p;
336
337 for (p = hid_usage_table; p->description; p++)
338 if (p->page == page) {
339 printk("%s", p->description);
340 return;
341 }
342 printk("%04x", page);
343}
344
345static void resolv_usage(unsigned usage) {
346 const struct hid_usage_entry *p;
347
348 resolv_usage_page(usage >> 16);
349 printk(".");
350 for (p = hid_usage_table; p->description; p++)
351 if (p->page == (usage >> 16)) {
352 for(++p; p->description && p->usage != 0; p++)
353 if (p->usage == (usage & 0xffff)) {
354 printk("%s", p->description);
355 return;
356 }
357 break;
358 }
359 printk("%04x", usage & 0xffff);
360}
361
362__inline__ static void tab(int n) {
363 while (n--) printk(" ");
364}
365
366static void hid_dump_field(struct hid_field *field, int n) {
367 int j;
368
369 if (field->physical) {
370 tab(n);
371 printk("Physical(");
372 resolv_usage(field->physical); printk(")\n");
373 }
374 if (field->logical) {
375 tab(n);
376 printk("Logical(");
377 resolv_usage(field->logical); printk(")\n");
378 }
379 tab(n); printk("Usage(%d)\n", field->maxusage);
380 for (j = 0; j < field->maxusage; j++) {
381 tab(n+2);resolv_usage(field->usage[j].hid); printk("\n");
382 }
383 if (field->logical_minimum != field->logical_maximum) {
384 tab(n); printk("Logical Minimum(%d)\n", field->logical_minimum);
385 tab(n); printk("Logical Maximum(%d)\n", field->logical_maximum);
386 }
387 if (field->physical_minimum != field->physical_maximum) {
388 tab(n); printk("Physical Minimum(%d)\n", field->physical_minimum);
389 tab(n); printk("Physical Maximum(%d)\n", field->physical_maximum);
390 }
391 if (field->unit_exponent) {
392 tab(n); printk("Unit Exponent(%d)\n", field->unit_exponent);
393 }
394 if (field->unit) {
395 char *systems[5] = { "None", "SI Linear", "SI Rotation", "English Linear", "English Rotation" };
396 char *units[5][8] = {
397 { "None", "None", "None", "None", "None", "None", "None", "None" },
398 { "None", "Centimeter", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" },
399 { "None", "Radians", "Gram", "Seconds", "Kelvin", "Ampere", "Candela", "None" },
400 { "None", "Inch", "Slug", "Seconds", "Fahrenheit", "Ampere", "Candela", "None" },
401 { "None", "Degrees", "Slug", "Seconds", "Fahrenheit", "Ampere", "Candela", "None" }
402 };
403
404 int i;
405 int sys;
406 __u32 data = field->unit;
407
408 /* First nibble tells us which system we're in. */
409 sys = data & 0xf;
410 data >>= 4;
411
412 if(sys > 4) {
413 tab(n); printk("Unit(Invalid)\n");
414 }
415 else {
416 int earlier_unit = 0;
417
418 tab(n); printk("Unit(%s : ", systems[sys]);
419
420 for (i=1 ; i<sizeof(__u32)*2 ; i++) {
421 char nibble = data & 0xf;
422 data >>= 4;
423 if (nibble != 0) {
424 if(earlier_unit++ > 0)
425 printk("*");
426 printk("%s", units[sys][i]);
427 if(nibble != 1) {
428 /* This is a _signed_ nibble(!) */
429
430 int val = nibble & 0x7;
431 if(nibble & 0x08)
432 val = -((0x7 & ~val) +1);
433 printk("^%d", val);
434 }
435 }
436 }
437 printk(")\n");
438 }
439 }
440 tab(n); printk("Report Size(%u)\n", field->report_size);
441 tab(n); printk("Report Count(%u)\n", field->report_count);
442 tab(n); printk("Report Offset(%u)\n", field->report_offset);
443
444 tab(n); printk("Flags( ");
445 j = field->flags;
446 printk("%s", HID_MAIN_ITEM_CONSTANT & j ? "Constant " : "");
447 printk("%s", HID_MAIN_ITEM_VARIABLE & j ? "Variable " : "Array ");
448 printk("%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute ");
449 printk("%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : "");
450 printk("%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : "");
451 printk("%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPrefferedState " : "");
452 printk("%s", HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : "");
453 printk("%s", HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : "");
454 printk("%s", HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : "");
455 printk(")\n");
456}
457
458static void __attribute__((unused)) hid_dump_device(struct hid_device *device) {
459 struct hid_report_enum *report_enum;
460 struct hid_report *report;
461 struct list_head *list;
462 unsigned i,k;
463 static char *table[] = {"INPUT", "OUTPUT", "FEATURE"};
464
465 for (i = 0; i < HID_REPORT_TYPES; i++) {
466 report_enum = device->report_enum + i;
467 list = report_enum->report_list.next;
468 while (list != &report_enum->report_list) {
469 report = (struct hid_report *) list;
470 tab(2);
471 printk("%s", table[i]);
472 if (report->id)
473 printk("(%d)", report->id);
474 printk("[%s]", table[report->type]);
475 printk("\n");
476 for (k = 0; k < report->maxfield; k++) {
477 tab(4);
478 printk("Field(%d)\n", k);
479 hid_dump_field(report->field[k], 6);
480 }
481 list = list->next;
482 }
483 }
484}
485
486static void __attribute__((unused)) hid_dump_input(struct hid_usage *usage, __s32 value) {
487 printk("hid-debug: input ");
488 resolv_usage(usage->hid);
489 printk(" = %d\n", value);
490}
491
492
493static char *events[EV_MAX + 1] = {
494 [EV_SYN] = "Sync", [EV_KEY] = "Key",
495 [EV_REL] = "Relative", [EV_ABS] = "Absolute",
496 [EV_MSC] = "Misc", [EV_LED] = "LED",
497 [EV_SND] = "Sound", [EV_REP] = "Repeat",
498 [EV_FF] = "ForceFeedback", [EV_PWR] = "Power",
499 [EV_FF_STATUS] = "ForceFeedbackStatus",
500};
501
502static char *syncs[2] = {
503 [SYN_REPORT] = "Report", [SYN_CONFIG] = "Config",
504};
505static char *keys[KEY_MAX + 1] = {
506 [KEY_RESERVED] = "Reserved", [KEY_ESC] = "Esc",
507 [KEY_1] = "1", [KEY_2] = "2",
508 [KEY_3] = "3", [KEY_4] = "4",
509 [KEY_5] = "5", [KEY_6] = "6",
510 [KEY_7] = "7", [KEY_8] = "8",
511 [KEY_9] = "9", [KEY_0] = "0",
512 [KEY_MINUS] = "Minus", [KEY_EQUAL] = "Equal",
513 [KEY_BACKSPACE] = "Backspace", [KEY_TAB] = "Tab",
514 [KEY_Q] = "Q", [KEY_W] = "W",
515 [KEY_E] = "E", [KEY_R] = "R",
516 [KEY_T] = "T", [KEY_Y] = "Y",
517 [KEY_U] = "U", [KEY_I] = "I",
518 [KEY_O] = "O", [KEY_P] = "P",
519 [KEY_LEFTBRACE] = "LeftBrace", [KEY_RIGHTBRACE] = "RightBrace",
520 [KEY_ENTER] = "Enter", [KEY_LEFTCTRL] = "LeftControl",
521 [KEY_A] = "A", [KEY_S] = "S",
522 [KEY_D] = "D", [KEY_F] = "F",
523 [KEY_G] = "G", [KEY_H] = "H",
524 [KEY_J] = "J", [KEY_K] = "K",
525 [KEY_L] = "L", [KEY_SEMICOLON] = "Semicolon",
526 [KEY_APOSTROPHE] = "Apostrophe", [KEY_GRAVE] = "Grave",
527 [KEY_LEFTSHIFT] = "LeftShift", [KEY_BACKSLASH] = "BackSlash",
528 [KEY_Z] = "Z", [KEY_X] = "X",
529 [KEY_C] = "C", [KEY_V] = "V",
530 [KEY_B] = "B", [KEY_N] = "N",
531 [KEY_M] = "M", [KEY_COMMA] = "Comma",
532 [KEY_DOT] = "Dot", [KEY_SLASH] = "Slash",
533 [KEY_RIGHTSHIFT] = "RightShift", [KEY_KPASTERISK] = "KPAsterisk",
534 [KEY_LEFTALT] = "LeftAlt", [KEY_SPACE] = "Space",
535 [KEY_CAPSLOCK] = "CapsLock", [KEY_F1] = "F1",
536 [KEY_F2] = "F2", [KEY_F3] = "F3",
537 [KEY_F4] = "F4", [KEY_F5] = "F5",
538 [KEY_F6] = "F6", [KEY_F7] = "F7",
539 [KEY_F8] = "F8", [KEY_F9] = "F9",
540 [KEY_F10] = "F10", [KEY_NUMLOCK] = "NumLock",
541 [KEY_SCROLLLOCK] = "ScrollLock", [KEY_KP7] = "KP7",
542 [KEY_KP8] = "KP8", [KEY_KP9] = "KP9",
543 [KEY_KPMINUS] = "KPMinus", [KEY_KP4] = "KP4",
544 [KEY_KP5] = "KP5", [KEY_KP6] = "KP6",
545 [KEY_KPPLUS] = "KPPlus", [KEY_KP1] = "KP1",
546 [KEY_KP2] = "KP2", [KEY_KP3] = "KP3",
547 [KEY_KP0] = "KP0", [KEY_KPDOT] = "KPDot",
548 [KEY_ZENKAKUHANKAKU] = "Zenkaku/Hankaku", [KEY_102ND] = "102nd",
549 [KEY_F11] = "F11", [KEY_F12] = "F12",
550 [KEY_RO] = "RO", [KEY_KATAKANA] = "Katakana",
551 [KEY_HIRAGANA] = "HIRAGANA", [KEY_HENKAN] = "Henkan",
552 [KEY_KATAKANAHIRAGANA] = "Katakana/Hiragana", [KEY_MUHENKAN] = "Muhenkan",
553 [KEY_KPJPCOMMA] = "KPJpComma", [KEY_KPENTER] = "KPEnter",
554 [KEY_RIGHTCTRL] = "RightCtrl", [KEY_KPSLASH] = "KPSlash",
555 [KEY_SYSRQ] = "SysRq", [KEY_RIGHTALT] = "RightAlt",
556 [KEY_LINEFEED] = "LineFeed", [KEY_HOME] = "Home",
557 [KEY_UP] = "Up", [KEY_PAGEUP] = "PageUp",
558 [KEY_LEFT] = "Left", [KEY_RIGHT] = "Right",
559 [KEY_END] = "End", [KEY_DOWN] = "Down",
560 [KEY_PAGEDOWN] = "PageDown", [KEY_INSERT] = "Insert",
561 [KEY_DELETE] = "Delete", [KEY_MACRO] = "Macro",
562 [KEY_MUTE] = "Mute", [KEY_VOLUMEDOWN] = "VolumeDown",
563 [KEY_VOLUMEUP] = "VolumeUp", [KEY_POWER] = "Power",
564 [KEY_KPEQUAL] = "KPEqual", [KEY_KPPLUSMINUS] = "KPPlusMinus",
565 [KEY_PAUSE] = "Pause", [KEY_KPCOMMA] = "KPComma",
566 [KEY_HANGUEL] = "Hangeul", [KEY_HANJA] = "Hanja",
567 [KEY_YEN] = "Yen", [KEY_LEFTMETA] = "LeftMeta",
568 [KEY_RIGHTMETA] = "RightMeta", [KEY_COMPOSE] = "Compose",
569 [KEY_STOP] = "Stop", [KEY_AGAIN] = "Again",
570 [KEY_PROPS] = "Props", [KEY_UNDO] = "Undo",
571 [KEY_FRONT] = "Front", [KEY_COPY] = "Copy",
572 [KEY_OPEN] = "Open", [KEY_PASTE] = "Paste",
573 [KEY_FIND] = "Find", [KEY_CUT] = "Cut",
574 [KEY_HELP] = "Help", [KEY_MENU] = "Menu",
575 [KEY_CALC] = "Calc", [KEY_SETUP] = "Setup",
576 [KEY_SLEEP] = "Sleep", [KEY_WAKEUP] = "WakeUp",
577 [KEY_FILE] = "File", [KEY_SENDFILE] = "SendFile",
578 [KEY_DELETEFILE] = "DeleteFile", [KEY_XFER] = "X-fer",
579 [KEY_PROG1] = "Prog1", [KEY_PROG2] = "Prog2",
580 [KEY_WWW] = "WWW", [KEY_MSDOS] = "MSDOS",
581 [KEY_COFFEE] = "Coffee", [KEY_DIRECTION] = "Direction",
582 [KEY_CYCLEWINDOWS] = "CycleWindows", [KEY_MAIL] = "Mail",
583 [KEY_BOOKMARKS] = "Bookmarks", [KEY_COMPUTER] = "Computer",
584 [KEY_BACK] = "Back", [KEY_FORWARD] = "Forward",
585 [KEY_CLOSECD] = "CloseCD", [KEY_EJECTCD] = "EjectCD",
586 [KEY_EJECTCLOSECD] = "EjectCloseCD", [KEY_NEXTSONG] = "NextSong",
587 [KEY_PLAYPAUSE] = "PlayPause", [KEY_PREVIOUSSONG] = "PreviousSong",
588 [KEY_STOPCD] = "StopCD", [KEY_RECORD] = "Record",
589 [KEY_REWIND] = "Rewind", [KEY_PHONE] = "Phone",
590 [KEY_ISO] = "ISOKey", [KEY_CONFIG] = "Config",
591 [KEY_HOMEPAGE] = "HomePage", [KEY_REFRESH] = "Refresh",
592 [KEY_EXIT] = "Exit", [KEY_MOVE] = "Move",
593 [KEY_EDIT] = "Edit", [KEY_SCROLLUP] = "ScrollUp",
594 [KEY_SCROLLDOWN] = "ScrollDown", [KEY_KPLEFTPAREN] = "KPLeftParenthesis",
595 [KEY_KPRIGHTPAREN] = "KPRightParenthesis", [KEY_NEW] = "New",
596 [KEY_REDO] = "Redo", [KEY_F13] = "F13",
597 [KEY_F14] = "F14", [KEY_F15] = "F15",
598 [KEY_F16] = "F16", [KEY_F17] = "F17",
599 [KEY_F18] = "F18", [KEY_F19] = "F19",
600 [KEY_F20] = "F20", [KEY_F21] = "F21",
601 [KEY_F22] = "F22", [KEY_F23] = "F23",
602 [KEY_F24] = "F24", [KEY_PLAYCD] = "PlayCD",
603 [KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3",
604 [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend",
605 [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play",
606 [KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost",
607 [KEY_PRINT] = "Print", [KEY_HP] = "HP",
608 [KEY_CAMERA] = "Camera", [KEY_SOUND] = "Sound",
609 [KEY_QUESTION] = "Question", [KEY_EMAIL] = "Email",
610 [KEY_CHAT] = "Chat", [KEY_SEARCH] = "Search",
611 [KEY_CONNECT] = "Connect", [KEY_FINANCE] = "Finance",
612 [KEY_SPORT] = "Sport", [KEY_SHOP] = "Shop",
613 [KEY_ALTERASE] = "AlternateErase", [KEY_CANCEL] = "Cancel",
614 [KEY_BRIGHTNESSDOWN] = "BrightnessDown", [KEY_BRIGHTNESSUP] = "BrightnessUp",
615 [KEY_MEDIA] = "Media", [KEY_UNKNOWN] = "Unknown",
616 [BTN_0] = "Btn0", [BTN_1] = "Btn1",
617 [BTN_2] = "Btn2", [BTN_3] = "Btn3",
618 [BTN_4] = "Btn4", [BTN_5] = "Btn5",
619 [BTN_6] = "Btn6", [BTN_7] = "Btn7",
620 [BTN_8] = "Btn8", [BTN_9] = "Btn9",
621 [BTN_LEFT] = "LeftBtn", [BTN_RIGHT] = "RightBtn",
622 [BTN_MIDDLE] = "MiddleBtn", [BTN_SIDE] = "SideBtn",
623 [BTN_EXTRA] = "ExtraBtn", [BTN_FORWARD] = "ForwardBtn",
624 [BTN_BACK] = "BackBtn", [BTN_TASK] = "TaskBtn",
625 [BTN_TRIGGER] = "Trigger", [BTN_THUMB] = "ThumbBtn",
626 [BTN_THUMB2] = "ThumbBtn2", [BTN_TOP] = "TopBtn",
627 [BTN_TOP2] = "TopBtn2", [BTN_PINKIE] = "PinkieBtn",
628 [BTN_BASE] = "BaseBtn", [BTN_BASE2] = "BaseBtn2",
629 [BTN_BASE3] = "BaseBtn3", [BTN_BASE4] = "BaseBtn4",
630 [BTN_BASE5] = "BaseBtn5", [BTN_BASE6] = "BaseBtn6",
631 [BTN_DEAD] = "BtnDead", [BTN_A] = "BtnA",
632 [BTN_B] = "BtnB", [BTN_C] = "BtnC",
633 [BTN_X] = "BtnX", [BTN_Y] = "BtnY",
634 [BTN_Z] = "BtnZ", [BTN_TL] = "BtnTL",
635 [BTN_TR] = "BtnTR", [BTN_TL2] = "BtnTL2",
636 [BTN_TR2] = "BtnTR2", [BTN_SELECT] = "BtnSelect",
637 [BTN_START] = "BtnStart", [BTN_MODE] = "BtnMode",
638 [BTN_THUMBL] = "BtnThumbL", [BTN_THUMBR] = "BtnThumbR",
639 [BTN_TOOL_PEN] = "ToolPen", [BTN_TOOL_RUBBER] = "ToolRubber",
640 [BTN_TOOL_BRUSH] = "ToolBrush", [BTN_TOOL_PENCIL] = "ToolPencil",
641 [BTN_TOOL_AIRBRUSH] = "ToolAirbrush", [BTN_TOOL_FINGER] = "ToolFinger",
642 [BTN_TOOL_MOUSE] = "ToolMouse", [BTN_TOOL_LENS] = "ToolLens",
643 [BTN_TOUCH] = "Touch", [BTN_STYLUS] = "Stylus",
644 [BTN_STYLUS2] = "Stylus2", [BTN_TOOL_DOUBLETAP] = "ToolDoubleTap",
645 [BTN_TOOL_TRIPLETAP] = "ToolTripleTap", [BTN_GEAR_DOWN] = "WheelBtn",
646 [BTN_GEAR_UP] = "Gear up", [KEY_OK] = "Ok",
647 [KEY_SELECT] = "Select", [KEY_GOTO] = "Goto",
648 [KEY_CLEAR] = "Clear", [KEY_POWER2] = "Power2",
649 [KEY_OPTION] = "Option", [KEY_INFO] = "Info",
650 [KEY_TIME] = "Time", [KEY_VENDOR] = "Vendor",
651 [KEY_ARCHIVE] = "Archive", [KEY_PROGRAM] = "Program",
652 [KEY_CHANNEL] = "Channel", [KEY_FAVORITES] = "Favorites",
653 [KEY_EPG] = "EPG", [KEY_PVR] = "PVR",
654 [KEY_MHP] = "MHP", [KEY_LANGUAGE] = "Language",
655 [KEY_TITLE] = "Title", [KEY_SUBTITLE] = "Subtitle",
656 [KEY_ANGLE] = "Angle", [KEY_ZOOM] = "Zoom",
657 [KEY_MODE] = "Mode", [KEY_KEYBOARD] = "Keyboard",
658 [KEY_SCREEN] = "Screen", [KEY_PC] = "PC",
659 [KEY_TV] = "TV", [KEY_TV2] = "TV2",
660 [KEY_VCR] = "VCR", [KEY_VCR2] = "VCR2",
661 [KEY_SAT] = "Sat", [KEY_SAT2] = "Sat2",
662 [KEY_CD] = "CD", [KEY_TAPE] = "Tape",
663 [KEY_RADIO] = "Radio", [KEY_TUNER] = "Tuner",
664 [KEY_PLAYER] = "Player", [KEY_TEXT] = "Text",
665 [KEY_DVD] = "DVD", [KEY_AUX] = "Aux",
666 [KEY_MP3] = "MP3", [KEY_AUDIO] = "Audio",
667 [KEY_VIDEO] = "Video", [KEY_DIRECTORY] = "Directory",
668 [KEY_LIST] = "List", [KEY_MEMO] = "Memo",
669 [KEY_CALENDAR] = "Calendar", [KEY_RED] = "Red",
670 [KEY_GREEN] = "Green", [KEY_YELLOW] = "Yellow",
671 [KEY_BLUE] = "Blue", [KEY_CHANNELUP] = "ChannelUp",
672 [KEY_CHANNELDOWN] = "ChannelDown", [KEY_FIRST] = "First",
673 [KEY_LAST] = "Last", [KEY_AB] = "AB",
674 [KEY_NEXT] = "Next", [KEY_RESTART] = "Restart",
675 [KEY_SLOW] = "Slow", [KEY_SHUFFLE] = "Shuffle",
676 [KEY_BREAK] = "Break", [KEY_PREVIOUS] = "Previous",
677 [KEY_DIGITS] = "Digits", [KEY_TEEN] = "TEEN",
678 [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL",
679 [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine",
680 [KEY_DEL_LINE] = "DeleteLine",
681 [KEY_SEND] = "Send", [KEY_REPLY] = "Reply",
682 [KEY_FORWARDMAIL] = "ForwardMail", [KEY_SAVE] = "Save",
683 [KEY_DOCUMENTS] = "Documents",
684 [KEY_FN] = "Fn", [KEY_FN_ESC] = "Fn+ESC",
685 [KEY_FN_1] = "Fn+1", [KEY_FN_2] = "Fn+2",
686 [KEY_FN_B] = "Fn+B", [KEY_FN_D] = "Fn+D",
687 [KEY_FN_E] = "Fn+E", [KEY_FN_F] = "Fn+F",
688 [KEY_FN_S] = "Fn+S",
689 [KEY_FN_F1] = "Fn+F1", [KEY_FN_F2] = "Fn+F2",
690 [KEY_FN_F3] = "Fn+F3", [KEY_FN_F4] = "Fn+F4",
691 [KEY_FN_F5] = "Fn+F5", [KEY_FN_F6] = "Fn+F6",
692 [KEY_FN_F7] = "Fn+F7", [KEY_FN_F8] = "Fn+F8",
693 [KEY_FN_F9] = "Fn+F9", [KEY_FN_F10] = "Fn+F10",
694 [KEY_FN_F11] = "Fn+F11", [KEY_FN_F12] = "Fn+F12",
695 [KEY_KBDILLUMTOGGLE] = "KbdIlluminationToggle",
696 [KEY_KBDILLUMDOWN] = "KbdIlluminationDown",
697 [KEY_KBDILLUMUP] = "KbdIlluminationUp",
698 [KEY_SWITCHVIDEOMODE] = "SwitchVideoMode",
699};
700
701static char *relatives[REL_MAX + 1] = {
702 [REL_X] = "X", [REL_Y] = "Y",
703 [REL_Z] = "Z", [REL_HWHEEL] = "HWheel",
704 [REL_DIAL] = "Dial", [REL_WHEEL] = "Wheel",
705 [REL_MISC] = "Misc",
706};
707
708static char *absolutes[ABS_MAX + 1] = {
709 [ABS_X] = "X", [ABS_Y] = "Y",
710 [ABS_Z] = "Z", [ABS_RX] = "Rx",
711 [ABS_RY] = "Ry", [ABS_RZ] = "Rz",
712 [ABS_THROTTLE] = "Throttle", [ABS_RUDDER] = "Rudder",
713 [ABS_WHEEL] = "Wheel", [ABS_GAS] = "Gas",
714 [ABS_BRAKE] = "Brake", [ABS_HAT0X] = "Hat0X",
715 [ABS_HAT0Y] = "Hat0Y", [ABS_HAT1X] = "Hat1X",
716 [ABS_HAT1Y] = "Hat1Y", [ABS_HAT2X] = "Hat2X",
717 [ABS_HAT2Y] = "Hat2Y", [ABS_HAT3X] = "Hat3X",
718 [ABS_HAT3Y] = "Hat 3Y", [ABS_PRESSURE] = "Pressure",
719 [ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt",
720 [ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "Tool Width",
721 [ABS_VOLUME] = "Volume", [ABS_MISC] = "Misc",
722};
723
724static char *misc[MSC_MAX + 1] = {
725 [MSC_SERIAL] = "Serial", [MSC_PULSELED] = "Pulseled",
726 [MSC_GESTURE] = "Gesture", [MSC_RAW] = "RawData"
727};
728
729static char *leds[LED_MAX + 1] = {
730 [LED_NUML] = "NumLock", [LED_CAPSL] = "CapsLock",
731 [LED_SCROLLL] = "ScrollLock", [LED_COMPOSE] = "Compose",
732 [LED_KANA] = "Kana", [LED_SLEEP] = "Sleep",
733 [LED_SUSPEND] = "Suspend", [LED_MUTE] = "Mute",
734 [LED_MISC] = "Misc",
735};
736
737static char *repeats[REP_MAX + 1] = {
738 [REP_DELAY] = "Delay", [REP_PERIOD] = "Period"
739};
740
741static char *sounds[SND_MAX + 1] = {
742 [SND_CLICK] = "Click", [SND_BELL] = "Bell",
743 [SND_TONE] = "Tone"
744};
745
746static char **names[EV_MAX + 1] = {
747 [EV_SYN] = syncs, [EV_KEY] = keys,
748 [EV_REL] = relatives, [EV_ABS] = absolutes,
749 [EV_MSC] = misc, [EV_LED] = leds,
750 [EV_SND] = sounds, [EV_REP] = repeats,
751};
752
753static void __attribute__((unused)) resolv_event(__u8 type, __u16 code) {
754
755 printk("%s.%s", events[type] ? events[type] : "?",
756 names[type] ? (names[type][code] ? names[type][code] : "?") : "?");
757}
diff --git a/include/linux/hid.h b/include/linux/hid.h
new file mode 100644
index 000000000000..770120add15a
--- /dev/null
+++ b/include/linux/hid.h
@@ -0,0 +1,528 @@
1#ifndef __HID_H
2#define __HID_H
3
4/*
5 * $Id: hid.h,v 1.24 2001/12/27 10:37:41 vojtech Exp $
6 *
7 * Copyright (c) 1999 Andreas Gal
8 * Copyright (c) 2000-2001 Vojtech Pavlik
9 * Copyright (c) 2006 Jiri Kosina
10 */
11
12/*
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 *
27 * Should you need to contact me, the author, you can do so either by
28 * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
29 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
30 */
31
32#include <linux/types.h>
33#include <linux/slab.h>
34#include <linux/list.h>
35#include <linux/timer.h>
36#include <linux/workqueue.h>
37#include <linux/input.h>
38
39/*
40 * USB HID (Human Interface Device) interface class code
41 */
42
43#define USB_INTERFACE_CLASS_HID 3
44
45/*
46 * USB HID interface subclass and protocol codes
47 */
48
49#define USB_INTERFACE_SUBCLASS_BOOT 1
50#define USB_INTERFACE_PROTOCOL_KEYBOARD 1
51#define USB_INTERFACE_PROTOCOL_MOUSE 2
52
53/*
54 * HID class requests
55 */
56
57#define HID_REQ_GET_REPORT 0x01
58#define HID_REQ_GET_IDLE 0x02
59#define HID_REQ_GET_PROTOCOL 0x03
60#define HID_REQ_SET_REPORT 0x09
61#define HID_REQ_SET_IDLE 0x0A
62#define HID_REQ_SET_PROTOCOL 0x0B
63
64/*
65 * HID class descriptor types
66 */
67
68#define HID_DT_HID (USB_TYPE_CLASS | 0x01)
69#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
70#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
71
72/*
73 * We parse each description item into this structure. Short items data
74 * values are expanded to 32-bit signed int, long items contain a pointer
75 * into the data area.
76 */
77
78struct hid_item {
79 unsigned format;
80 __u8 size;
81 __u8 type;
82 __u8 tag;
83 union {
84 __u8 u8;
85 __s8 s8;
86 __u16 u16;
87 __s16 s16;
88 __u32 u32;
89 __s32 s32;
90 __u8 *longdata;
91 } data;
92};
93
94/*
95 * HID report item format
96 */
97
98#define HID_ITEM_FORMAT_SHORT 0
99#define HID_ITEM_FORMAT_LONG 1
100
101/*
102 * Special tag indicating long items
103 */
104
105#define HID_ITEM_TAG_LONG 15
106
107/*
108 * HID report descriptor item type (prefix bit 2,3)
109 */
110
111#define HID_ITEM_TYPE_MAIN 0
112#define HID_ITEM_TYPE_GLOBAL 1
113#define HID_ITEM_TYPE_LOCAL 2
114#define HID_ITEM_TYPE_RESERVED 3
115
116/*
117 * HID report descriptor main item tags
118 */
119
120#define HID_MAIN_ITEM_TAG_INPUT 8
121#define HID_MAIN_ITEM_TAG_OUTPUT 9
122#define HID_MAIN_ITEM_TAG_FEATURE 11
123#define HID_MAIN_ITEM_TAG_BEGIN_COLLECTION 10
124#define HID_MAIN_ITEM_TAG_END_COLLECTION 12
125
126/*
127 * HID report descriptor main item contents
128 */
129
130#define HID_MAIN_ITEM_CONSTANT 0x001
131#define HID_MAIN_ITEM_VARIABLE 0x002
132#define HID_MAIN_ITEM_RELATIVE 0x004
133#define HID_MAIN_ITEM_WRAP 0x008
134#define HID_MAIN_ITEM_NONLINEAR 0x010
135#define HID_MAIN_ITEM_NO_PREFERRED 0x020
136#define HID_MAIN_ITEM_NULL_STATE 0x040
137#define HID_MAIN_ITEM_VOLATILE 0x080
138#define HID_MAIN_ITEM_BUFFERED_BYTE 0x100
139
140/*
141 * HID report descriptor collection item types
142 */
143
144#define HID_COLLECTION_PHYSICAL 0
145#define HID_COLLECTION_APPLICATION 1
146#define HID_COLLECTION_LOGICAL 2
147
148/*
149 * HID report descriptor global item tags
150 */
151
152#define HID_GLOBAL_ITEM_TAG_USAGE_PAGE 0
153#define HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM 1
154#define HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM 2
155#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM 3
156#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM 4
157#define HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT 5
158#define HID_GLOBAL_ITEM_TAG_UNIT 6
159#define HID_GLOBAL_ITEM_TAG_REPORT_SIZE 7
160#define HID_GLOBAL_ITEM_TAG_REPORT_ID 8
161#define HID_GLOBAL_ITEM_TAG_REPORT_COUNT 9
162#define HID_GLOBAL_ITEM_TAG_PUSH 10
163#define HID_GLOBAL_ITEM_TAG_POP 11
164
165/*
166 * HID report descriptor local item tags
167 */
168
169#define HID_LOCAL_ITEM_TAG_USAGE 0
170#define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM 1
171#define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM 2
172#define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX 3
173#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM 4
174#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM 5
175#define HID_LOCAL_ITEM_TAG_STRING_INDEX 7
176#define HID_LOCAL_ITEM_TAG_STRING_MINIMUM 8
177#define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM 9
178#define HID_LOCAL_ITEM_TAG_DELIMITER 10
179
180/*
181 * HID usage tables
182 */
183
184#define HID_USAGE_PAGE 0xffff0000
185
186#define HID_UP_UNDEFINED 0x00000000
187#define HID_UP_GENDESK 0x00010000
188#define HID_UP_SIMULATION 0x00020000
189#define HID_UP_KEYBOARD 0x00070000
190#define HID_UP_LED 0x00080000
191#define HID_UP_BUTTON 0x00090000
192#define HID_UP_ORDINAL 0x000a0000
193#define HID_UP_CONSUMER 0x000c0000
194#define HID_UP_DIGITIZER 0x000d0000
195#define HID_UP_PID 0x000f0000
196#define HID_UP_HPVENDOR 0xff7f0000
197#define HID_UP_MSVENDOR 0xff000000
198#define HID_UP_CUSTOM 0x00ff0000
199#define HID_UP_LOGIVENDOR 0xffbc0000
200
201#define HID_USAGE 0x0000ffff
202
203#define HID_GD_POINTER 0x00010001
204#define HID_GD_MOUSE 0x00010002
205#define HID_GD_JOYSTICK 0x00010004
206#define HID_GD_GAMEPAD 0x00010005
207#define HID_GD_KEYBOARD 0x00010006
208#define HID_GD_KEYPAD 0x00010007
209#define HID_GD_MULTIAXIS 0x00010008
210#define HID_GD_X 0x00010030
211#define HID_GD_Y 0x00010031
212#define HID_GD_Z 0x00010032
213#define HID_GD_RX 0x00010033
214#define HID_GD_RY 0x00010034
215#define HID_GD_RZ 0x00010035
216#define HID_GD_SLIDER 0x00010036
217#define HID_GD_DIAL 0x00010037
218#define HID_GD_WHEEL 0x00010038
219#define HID_GD_HATSWITCH 0x00010039
220#define HID_GD_BUFFER 0x0001003a
221#define HID_GD_BYTECOUNT 0x0001003b
222#define HID_GD_MOTION 0x0001003c
223#define HID_GD_START 0x0001003d
224#define HID_GD_SELECT 0x0001003e
225#define HID_GD_VX 0x00010040
226#define HID_GD_VY 0x00010041
227#define HID_GD_VZ 0x00010042
228#define HID_GD_VBRX 0x00010043
229#define HID_GD_VBRY 0x00010044
230#define HID_GD_VBRZ 0x00010045
231#define HID_GD_VNO 0x00010046
232#define HID_GD_FEATURE 0x00010047
233#define HID_GD_UP 0x00010090
234#define HID_GD_DOWN 0x00010091
235#define HID_GD_RIGHT 0x00010092
236#define HID_GD_LEFT 0x00010093
237
238/*
239 * HID report types --- Ouch! HID spec says 1 2 3!
240 */
241
242#define HID_INPUT_REPORT 0
243#define HID_OUTPUT_REPORT 1
244#define HID_FEATURE_REPORT 2
245
246/*
247 * HID device quirks.
248 */
249
250#define HID_QUIRK_INVERT 0x00000001
251#define HID_QUIRK_NOTOUCH 0x00000002
252#define HID_QUIRK_IGNORE 0x00000004
253#define HID_QUIRK_NOGET 0x00000008
254#define HID_QUIRK_HIDDEV 0x00000010
255#define HID_QUIRK_BADPAD 0x00000020
256#define HID_QUIRK_MULTI_INPUT 0x00000040
257#define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x00000080
258#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100
259#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200
260#define HID_QUIRK_MIGHTYMOUSE 0x00000400
261#define HID_QUIRK_CYMOTION 0x00000800
262#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000
263#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000
264#define HID_QUIRK_INVERT_HWHEEL 0x00004000
265#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000
266#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000
267
268/*
269 * This is the global environment of the parser. This information is
270 * persistent for main-items. The global environment can be saved and
271 * restored with PUSH/POP statements.
272 */
273
274struct hid_global {
275 unsigned usage_page;
276 __s32 logical_minimum;
277 __s32 logical_maximum;
278 __s32 physical_minimum;
279 __s32 physical_maximum;
280 __s32 unit_exponent;
281 unsigned unit;
282 unsigned report_id;
283 unsigned report_size;
284 unsigned report_count;
285};
286
287/*
288 * This is the local environment. It is persistent up the next main-item.
289 */
290
291#define HID_MAX_DESCRIPTOR_SIZE 4096
292#define HID_MAX_USAGES 1024
293#define HID_DEFAULT_NUM_COLLECTIONS 16
294
295struct hid_local {
296 unsigned usage[HID_MAX_USAGES]; /* usage array */
297 unsigned collection_index[HID_MAX_USAGES]; /* collection index array */
298 unsigned usage_index;
299 unsigned usage_minimum;
300 unsigned delimiter_depth;
301 unsigned delimiter_branch;
302};
303
304/*
305 * This is the collection stack. We climb up the stack to determine
306 * application and function of each field.
307 */
308
309struct hid_collection {
310 unsigned type;
311 unsigned usage;
312 unsigned level;
313};
314
315struct hid_usage {
316 unsigned hid; /* hid usage code */
317 unsigned collection_index; /* index into collection array */
318 /* hidinput data */
319 __u16 code; /* input driver code */
320 __u8 type; /* input driver type */
321 __s8 hat_min; /* hat switch fun */
322 __s8 hat_max; /* ditto */
323 __s8 hat_dir; /* ditto */
324};
325
326struct hid_input;
327
328struct hid_field {
329 unsigned physical; /* physical usage for this field */
330 unsigned logical; /* logical usage for this field */
331 unsigned application; /* application usage for this field */
332 struct hid_usage *usage; /* usage table for this function */
333 unsigned maxusage; /* maximum usage index */
334 unsigned flags; /* main-item flags (i.e. volatile,array,constant) */
335 unsigned report_offset; /* bit offset in the report */
336 unsigned report_size; /* size of this field in the report */
337 unsigned report_count; /* number of this field in the report */
338 unsigned report_type; /* (input,output,feature) */
339 __s32 *value; /* last known value(s) */
340 __s32 logical_minimum;
341 __s32 logical_maximum;
342 __s32 physical_minimum;
343 __s32 physical_maximum;
344 __s32 unit_exponent;
345 unsigned unit;
346 struct hid_report *report; /* associated report */
347 unsigned index; /* index into report->field[] */
348 /* hidinput data */
349 struct hid_input *hidinput; /* associated input structure */
350 __u16 dpad; /* dpad input code */
351};
352
353#define HID_MAX_FIELDS 64
354
355struct hid_report {
356 struct list_head list;
357 unsigned id; /* id of this report */
358 unsigned type; /* report type */
359 struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */
360 unsigned maxfield; /* maximum valid field index */
361 unsigned size; /* size of the report (bits) */
362 struct hid_device *device; /* associated device */
363};
364
365struct hid_report_enum {
366 unsigned numbered;
367 struct list_head report_list;
368 struct hid_report *report_id_hash[256];
369};
370
371#define HID_REPORT_TYPES 3
372
373#define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */
374#define HID_MAX_BUFFER_SIZE 4096 /* 4kb */
375#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */
376#define HID_OUTPUT_FIFO_SIZE 64
377
378struct hid_control_fifo {
379 unsigned char dir;
380 struct hid_report *report;
381};
382
383#define HID_CLAIMED_INPUT 1
384#define HID_CLAIMED_HIDDEV 2
385
386#define HID_CTRL_RUNNING 1
387#define HID_OUT_RUNNING 2
388#define HID_IN_RUNNING 3
389#define HID_RESET_PENDING 4
390#define HID_SUSPENDED 5
391#define HID_CLEAR_HALT 6
392
393struct hid_input {
394 struct list_head list;
395 struct hid_report *report;
396 struct input_dev *input;
397};
398
399struct hid_device { /* device report descriptor */
400 __u8 *rdesc;
401 unsigned rsize;
402 struct hid_collection *collection; /* List of HID collections */
403 unsigned collection_size; /* Number of allocated hid_collections */
404 unsigned maxcollection; /* Number of parsed collections */
405 unsigned maxapplication; /* Number of applications */
406 unsigned short bus; /* BUS ID */
407 unsigned short vendor; /* Vendor ID */
408 unsigned short product; /* Product ID */
409 unsigned version; /* HID version */
410 unsigned country; /* HID country */
411 struct hid_report_enum report_enum[HID_REPORT_TYPES];
412
413 struct device *dev; /* device */
414
415 unsigned claimed; /* Claimed by hidinput, hiddev? */
416 unsigned quirks; /* Various quirks the device can pull on us */
417
418 struct list_head inputs; /* The list of inputs */
419 void *hiddev; /* The hiddev structure */
420 int minor; /* Hiddev minor number */
421
422 wait_queue_head_t wait; /* For sleeping */
423
424 int open; /* is the device open by anyone? */
425 char name[128]; /* Device name */
426 char phys[64]; /* Device physical location */
427 char uniq[64]; /* Device unique identifier (serial #) */
428
429 void *driver_data;
430
431 /* device-specific function pointers */
432 int (*hidinput_input_event) (struct input_dev *, unsigned int, unsigned int, int);
433 int (*hidinput_open) (struct input_dev *);
434 void (*hidinput_close) (struct input_dev *);
435
436 /* hiddev event handler */
437 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
438 struct hid_usage *, __s32);
439 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
440#ifdef CONFIG_USB_HIDINPUT_POWERBOOK
441 unsigned int pb_fnmode;
442 unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
443 unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
444#endif
445};
446
447#define HID_GLOBAL_STACK_SIZE 4
448#define HID_COLLECTION_STACK_SIZE 4
449
450struct hid_parser {
451 struct hid_global global;
452 struct hid_global global_stack[HID_GLOBAL_STACK_SIZE];
453 unsigned global_stack_ptr;
454 struct hid_local local;
455 unsigned collection_stack[HID_COLLECTION_STACK_SIZE];
456 unsigned collection_stack_ptr;
457 struct hid_device *device;
458};
459
460struct hid_class_descriptor {
461 __u8 bDescriptorType;
462 __u16 wDescriptorLength;
463} __attribute__ ((packed));
464
465struct hid_descriptor {
466 __u8 bLength;
467 __u8 bDescriptorType;
468 __u16 bcdHID;
469 __u8 bCountryCode;
470 __u8 bNumDescriptors;
471
472 struct hid_class_descriptor desc[1];
473} __attribute__ ((packed));
474
475#ifdef DEBUG
476#include "hid-debug.h"
477#else
478#define hid_dump_input(a,b) do { } while (0)
479#define hid_dump_device(c) do { } while (0)
480#define hid_dump_field(a,b) do { } while (0)
481#define resolv_usage(a) do { } while (0)
482#define resolv_event(a,b) do { } while (0)
483#endif
484
485/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
486/* We ignore a few input applications that are not widely used */
487#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
488
489/* HID core API */
490extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
491extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
492extern int hidinput_connect(struct hid_device *);
493extern void hidinput_disconnect(struct hid_device *);
494
495int hid_set_field(struct hid_field *, unsigned, __s32);
496int hid_input_report(struct hid_device *, int type, u8 *, int, int);
497int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
498void hid_input_field(struct hid_device *hid, struct hid_field *field, __u8 *data, int interrupt);
499void hid_output_report(struct hid_report *report, __u8 *data);
500void hid_free_device(struct hid_device *device);
501struct hid_device *hid_parse_report(__u8 *start, unsigned size);
502
503#ifdef CONFIG_HID_FF
504int hid_ff_init(struct hid_device *hid);
505
506int hid_lgff_init(struct hid_device *hid);
507int hid_tmff_init(struct hid_device *hid);
508int hid_zpff_init(struct hid_device *hid);
509#ifdef CONFIG_HID_PID
510int hid_pidff_init(struct hid_device *hid);
511#else
512static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }
513#endif
514
515#else
516static inline int hid_ff_init(struct hid_device *hid) { return -1; }
517#endif
518#ifdef DEBUG
519#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \
520 __FILE__ , ## arg)
521#else
522#define dbg(format, arg...) do {} while (0)
523#endif
524
525#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
526 __FILE__ , ## arg)
527#endif
528
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index fd7d12daa94f..645d440807c2 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -3,11 +3,12 @@
3 3
4#include <linux/fs.h> 4#include <linux/fs.h>
5#include <linux/mm.h> 5#include <linux/mm.h>
6#include <linux/uaccess.h>
6 7
7#include <asm/cacheflush.h> 8#include <asm/cacheflush.h>
8 9
9#ifndef ARCH_HAS_FLUSH_ANON_PAGE 10#ifndef ARCH_HAS_FLUSH_ANON_PAGE
10static inline void flush_anon_page(struct page *page, unsigned long vmaddr) 11static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr)
11{ 12{
12} 13}
13#endif 14#endif
@@ -41,9 +42,10 @@ static inline void *kmap(struct page *page)
41 42
42#define kunmap(page) do { (void) (page); } while (0) 43#define kunmap(page) do { (void) (page); } while (0)
43 44
44#define kmap_atomic(page, idx) page_address(page) 45#define kmap_atomic(page, idx) \
45#define kunmap_atomic(addr, idx) do { } while (0) 46 ({ pagefault_disable(); page_address(page); })
46#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn)) 47#define kunmap_atomic(addr, idx) do { pagefault_enable(); } while (0)
48#define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx))
47#define kmap_atomic_to_page(ptr) virt_to_page(ptr) 49#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
48#endif 50#endif
49 51
@@ -94,7 +96,10 @@ static inline void memclear_highpage_flush(struct page *page, unsigned int offse
94 kunmap_atomic(kaddr, KM_USER0); 96 kunmap_atomic(kaddr, KM_USER0);
95} 97}
96 98
97static inline void copy_user_highpage(struct page *to, struct page *from, unsigned long vaddr) 99#ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE
100
101static inline void copy_user_highpage(struct page *to, struct page *from,
102 unsigned long vaddr, struct vm_area_struct *vma)
98{ 103{
99 char *vfrom, *vto; 104 char *vfrom, *vto;
100 105
@@ -107,6 +112,8 @@ static inline void copy_user_highpage(struct page *to, struct page *from, unsign
107 smp_wmb(); 112 smp_wmb();
108} 113}
109 114
115#endif
116
110static inline void copy_highpage(struct page *to, struct page *from) 117static inline void copy_highpage(struct page *to, struct page *from)
111{ 118{
112 char *vfrom, *vto; 119 char *vfrom, *vto;
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index ace64e57e17f..a60995afe334 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -35,6 +35,7 @@ extern int sysctl_hugetlb_shm_group;
35 35
36pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr); 36pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr);
37pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr); 37pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr);
38int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep);
38struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, 39struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
39 int write); 40 int write);
40struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, 41struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h
index c8f8df25c7e0..937da70cb4c4 100644
--- a/include/linux/i2c-algo-bit.h
+++ b/include/linux/i2c-algo-bit.h
@@ -26,9 +26,9 @@
26 26
27/* --- Defines for bit-adapters --------------------------------------- */ 27/* --- Defines for bit-adapters --------------------------------------- */
28/* 28/*
29 * This struct contains the hw-dependent functions of bit-style adapters to 29 * This struct contains the hw-dependent functions of bit-style adapters to
30 * manipulate the line states, and to init any hw-specific features. This is 30 * manipulate the line states, and to init any hw-specific features. This is
31 * only used if you have more than one hw-type of adapter running. 31 * only used if you have more than one hw-type of adapter running.
32 */ 32 */
33struct i2c_algo_bit_data { 33struct i2c_algo_bit_data {
34 void *data; /* private data for lowlevel routines */ 34 void *data; /* private data for lowlevel routines */
@@ -44,6 +44,5 @@ struct i2c_algo_bit_data {
44}; 44};
45 45
46int i2c_bit_add_bus(struct i2c_adapter *); 46int i2c_bit_add_bus(struct i2c_adapter *);
47int i2c_bit_del_bus(struct i2c_adapter *);
48 47
49#endif /* _LINUX_I2C_ALGO_BIT_H */ 48#endif /* _LINUX_I2C_ALGO_BIT_H */
diff --git a/include/linux/i2c-algo-ite.h b/include/linux/i2c-algo-ite.h
deleted file mode 100644
index 0073fe96c76e..000000000000
--- a/include/linux/i2c-algo-ite.h
+++ /dev/null
@@ -1,72 +0,0 @@
1/* ------------------------------------------------------------------------- */
2/* i2c-algo-ite.h i2c driver algorithms for ITE IIC adapters */
3/* ------------------------------------------------------------------------- */
4/* Copyright (C) 1995-97 Simon G. Vogl
5 1998-99 Hans Berglund
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20/* ------------------------------------------------------------------------- */
21
22/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
23 Frodo Looijaard <frodol@dds.nl> */
24
25/* Modifications by MontaVista Software, 2001
26 Changes made to support the ITE IIC peripheral */
27
28
29#ifndef I2C_ALGO_ITE_H
30#define I2C_ALGO_ITE_H 1
31
32#include <linux/types.h>
33
34/* Example of a sequential read request:
35 struct i2c_iic_msg s_msg;
36
37 s_msg.addr=device_address;
38 s_msg.len=length;
39 s_msg.buf=buffer;
40 s_msg.waddr=word_address;
41 ioctl(file,I2C_SREAD, &s_msg);
42 */
43#define I2C_SREAD 0x780 /* SREAD ioctl command */
44
45struct i2c_iic_msg {
46 __u16 addr; /* device address */
47 __u16 waddr; /* word address */
48 short len; /* msg length */
49 char *buf; /* pointer to msg data */
50};
51
52#ifdef __KERNEL__
53struct i2c_adapter;
54
55struct i2c_algo_iic_data {
56 void *data; /* private data for lolevel routines */
57 void (*setiic) (void *data, int ctl, int val);
58 int (*getiic) (void *data, int ctl);
59 int (*getown) (void *data);
60 int (*getclock) (void *data);
61 void (*waitforpin) (void);
62
63 /* local settings */
64 int udelay;
65 int mdelay;
66 int timeout;
67};
68
69int i2c_iic_add_bus(struct i2c_adapter *);
70int i2c_iic_del_bus(struct i2c_adapter *);
71#endif /* __KERNEL__ */
72#endif /* I2C_ALGO_ITE_H */
diff --git a/include/linux/i2c-algo-pca.h b/include/linux/i2c-algo-pca.h
index 226693e0d88b..fce47c051bb1 100644
--- a/include/linux/i2c-algo-pca.h
+++ b/include/linux/i2c-algo-pca.h
@@ -10,6 +10,5 @@ struct i2c_algo_pca_data {
10}; 10};
11 11
12int i2c_pca_add_bus(struct i2c_adapter *); 12int i2c_pca_add_bus(struct i2c_adapter *);
13int i2c_pca_del_bus(struct i2c_adapter *);
14 13
15#endif /* _LINUX_I2C_ALGO_PCA_H */ 14#endif /* _LINUX_I2C_ALGO_PCA_H */
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h
index 9908f3fc4839..994eb86f882c 100644
--- a/include/linux/i2c-algo-pcf.h
+++ b/include/linux/i2c-algo-pcf.h
@@ -31,7 +31,7 @@ struct i2c_algo_pcf_data {
31 int (*getpcf) (void *data, int ctl); 31 int (*getpcf) (void *data, int ctl);
32 int (*getown) (void *data); 32 int (*getown) (void *data);
33 int (*getclock) (void *data); 33 int (*getclock) (void *data);
34 void (*waitforpin) (void); 34 void (*waitforpin) (void);
35 35
36 /* local settings */ 36 /* local settings */
37 int udelay; 37 int udelay;
@@ -39,6 +39,5 @@ struct i2c_algo_pcf_data {
39}; 39};
40 40
41int i2c_pcf_add_bus(struct i2c_adapter *); 41int i2c_pcf_add_bus(struct i2c_adapter *);
42int i2c_pcf_del_bus(struct i2c_adapter *);
43 42
44#endif /* _LINUX_I2C_ALGO_PCF_H */ 43#endif /* _LINUX_I2C_ALGO_PCF_H */
diff --git a/include/linux/i2c-algo-sgi.h b/include/linux/i2c-algo-sgi.h
index 4a0113d64064..3b7715024e69 100644
--- a/include/linux/i2c-algo-sgi.h
+++ b/include/linux/i2c-algo-sgi.h
@@ -22,6 +22,5 @@ struct i2c_algo_sgi_data {
22}; 22};
23 23
24int i2c_sgi_add_bus(struct i2c_adapter *); 24int i2c_sgi_add_bus(struct i2c_adapter *);
25int i2c_sgi_del_bus(struct i2c_adapter *);
26 25
27#endif /* I2C_ALGO_SGI_H */ 26#endif /* I2C_ALGO_SGI_H */
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 0a8f750cbede..d38778f2fbec 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -1,7 +1,7 @@
1/* ------------------------------------------------------------------------- */ 1/* ------------------------------------------------------------------------- */
2/* */ 2/* */
3/* i2c-id.h - identifier values for i2c drivers and adapters */ 3/* i2c-id.h - identifier values for i2c drivers and adapters */
4/* */ 4/* */
5/* ------------------------------------------------------------------------- */ 5/* ------------------------------------------------------------------------- */
6/* Copyright (C) 1995-1999 Simon G. Vogl 6/* Copyright (C) 1995-1999 Simon G. Vogl
7 7
@@ -40,10 +40,10 @@
40#define I2C_DRIVERID_SAA7120 11 /* video encoder */ 40#define I2C_DRIVERID_SAA7120 11 /* video encoder */
41#define I2C_DRIVERID_SAA7121 12 /* video encoder */ 41#define I2C_DRIVERID_SAA7121 12 /* video encoder */
42#define I2C_DRIVERID_SAA7185B 13 /* video encoder */ 42#define I2C_DRIVERID_SAA7185B 13 /* video encoder */
43#define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */ 43#define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */
44#define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */ 44#define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */
45#define I2C_DRIVERID_PCF8582C 16 /* eeprom */ 45#define I2C_DRIVERID_PCF8582C 16 /* eeprom */
46#define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */ 46#define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */
47#define I2C_DRIVERID_TEA6300 18 /* audio mixer */ 47#define I2C_DRIVERID_TEA6300 18 /* audio mixer */
48#define I2C_DRIVERID_BT829 19 /* pc to tv encoder */ 48#define I2C_DRIVERID_BT829 19 /* pc to tv encoder */
49#define I2C_DRIVERID_TDA9850 20 /* audio mixer */ 49#define I2C_DRIVERID_TDA9850 20 /* audio mixer */
@@ -82,9 +82,8 @@
82#define I2C_DRIVERID_STM41T00 52 /* real time clock */ 82#define I2C_DRIVERID_STM41T00 52 /* real time clock */
83#define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */ 83#define I2C_DRIVERID_UDA1342 53 /* UDA1342 audio codec */
84#define I2C_DRIVERID_ADV7170 54 /* video encoder */ 84#define I2C_DRIVERID_ADV7170 54 /* video encoder */
85#define I2C_DRIVERID_RADEON 55 /* I2C bus on Radeon boards */
86#define I2C_DRIVERID_MAX1617 56 /* temp sensor */ 85#define I2C_DRIVERID_MAX1617 56 /* temp sensor */
87#define I2C_DRIVERID_SAA7191 57 /* video encoder */ 86#define I2C_DRIVERID_SAA7191 57 /* video decoder */
88#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ 87#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */
89#define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */ 88#define I2C_DRIVERID_BT832 59 /* CMOS camera video processor */
90#define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */ 89#define I2C_DRIVERID_TDA9887 60 /* TDA988x IF-PLL demodulator */
@@ -132,7 +131,6 @@
132#define I2C_DRIVERID_ADM1021 1008 131#define I2C_DRIVERID_ADM1021 1008
133#define I2C_DRIVERID_ADM9240 1009 132#define I2C_DRIVERID_ADM9240 1009
134#define I2C_DRIVERID_LTC1710 1010 133#define I2C_DRIVERID_LTC1710 1010
135#define I2C_DRIVERID_ICSPLL 1012
136#define I2C_DRIVERID_BT869 1013 134#define I2C_DRIVERID_BT869 1013
137#define I2C_DRIVERID_MAXILIFE 1014 135#define I2C_DRIVERID_MAXILIFE 1014
138#define I2C_DRIVERID_MATORB 1015 136#define I2C_DRIVERID_MATORB 1015
@@ -144,7 +142,6 @@
144#define I2C_DRIVERID_MTP008 1023 142#define I2C_DRIVERID_MTP008 1023
145#define I2C_DRIVERID_DS1621 1024 143#define I2C_DRIVERID_DS1621 1024
146#define I2C_DRIVERID_ADM1024 1025 144#define I2C_DRIVERID_ADM1024 1025
147#define I2C_DRIVERID_IT87 1026
148#define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */ 145#define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */
149#define I2C_DRIVERID_FSCPOS 1028 146#define I2C_DRIVERID_FSCPOS 1028
150#define I2C_DRIVERID_FSCSCY 1029 147#define I2C_DRIVERID_FSCSCY 1029
@@ -159,12 +156,13 @@
159#define I2C_DRIVERID_ASB100 1043 156#define I2C_DRIVERID_ASB100 1043
160#define I2C_DRIVERID_FSCHER 1046 157#define I2C_DRIVERID_FSCHER 1046
161#define I2C_DRIVERID_W83L785TS 1047 158#define I2C_DRIVERID_W83L785TS 1047
159#define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */
162 160
163/* 161/*
164 * ---- Adapter types ---------------------------------------------------- 162 * ---- Adapter types ----------------------------------------------------
165 */ 163 */
166 164
167/* --- Bit algorithm adapters */ 165/* --- Bit algorithm adapters */
168#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ 166#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */
169#define I2C_HW_B_SER 0x010002 /* Serial line interface */ 167#define I2C_HW_B_SER 0x010002 /* Serial line interface */
170#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ 168#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */
@@ -212,9 +210,6 @@
212/* --- MPC8xx PowerPC adapters */ 210/* --- MPC8xx PowerPC adapters */
213#define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */ 211#define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */
214 212
215/* --- ITE based algorithms */
216#define I2C_HW_I_IIC 0x080000 /* controller on the ITE */
217
218/* --- PowerPC on-chip adapters */ 213/* --- PowerPC on-chip adapters */
219#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */ 214#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */
220 215
@@ -250,6 +245,7 @@
250#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ 245#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */
251#define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */ 246#define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */
252#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ 247#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */
248#define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */
253 249
254/* --- ISA pseudo-adapter */ 250/* --- ISA pseudo-adapter */
255#define I2C_HW_ISA 0x050000 251#define I2C_HW_ISA 0x050000
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
new file mode 100644
index 000000000000..e6e9c814da61
--- /dev/null
+++ b/include/linux/i2c-pnx.h
@@ -0,0 +1,43 @@
1/*
2 * Header file for I2C support on PNX010x/4008.
3 *
4 * Author: Dennis Kovalev <dkovalev@ru.mvista.com>
5 *
6 * 2004-2006 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#ifndef __I2C_PNX_H__
13#define __I2C_PNX_H__
14
15#include <asm/arch/i2c.h>
16
17struct i2c_pnx_mif {
18 int ret; /* Return value */
19 int mode; /* Interface mode */
20 struct completion complete; /* I/O completion */
21 struct timer_list timer; /* Timeout */
22 char * buf; /* Data buffer */
23 int len; /* Length of data buffer */
24};
25
26struct i2c_pnx_algo_data {
27 u32 base;
28 u32 ioaddr;
29 int irq;
30 struct i2c_pnx_mif mif;
31 int last;
32};
33
34struct i2c_pnx_data {
35 int (*suspend) (struct platform_device *pdev, pm_message_t state);
36 int (*resume) (struct platform_device *pdev);
37 u32 (*calculate_input_freq) (struct platform_device *pdev);
38 int (*set_clock_run) (struct platform_device *pdev);
39 int (*set_clock_stop) (struct platform_device *pdev);
40 struct i2c_adapter *adapter;
41};
42
43#endif /* __I2C_PNX_H__ */
diff --git a/include/linux/i2c-pxa.h b/include/linux/i2c-pxa.h
index 5f3eaf802223..41dcdfe7f625 100644
--- a/include/linux/i2c-pxa.h
+++ b/include/linux/i2c-pxa.h
@@ -1,29 +1,6 @@
1#ifndef _LINUX_I2C_ALGO_PXA_H 1#ifndef _LINUX_I2C_ALGO_PXA_H
2#define _LINUX_I2C_ALGO_PXA_H 2#define _LINUX_I2C_ALGO_PXA_H
3 3
4struct i2c_eeprom_emu_watcher {
5 void (*write)(void *, unsigned int addr, unsigned char newval);
6};
7
8struct i2c_eeprom_emu_watch {
9 struct list_head node;
10 unsigned int start;
11 unsigned int end;
12 struct i2c_eeprom_emu_watcher *ops;
13 void *data;
14};
15
16#define I2C_EEPROM_EMU_SIZE (256)
17
18struct i2c_eeprom_emu {
19 unsigned int size;
20 unsigned int ptr;
21 unsigned int seen_start;
22 struct list_head watch;
23
24 unsigned char bytes[I2C_EEPROM_EMU_SIZE];
25};
26
27typedef enum i2c_slave_event_e { 4typedef enum i2c_slave_event_e {
28 I2C_SLAVE_EVENT_START_READ, 5 I2C_SLAVE_EVENT_START_READ,
29 I2C_SLAVE_EVENT_START_WRITE, 6 I2C_SLAVE_EVENT_START_WRITE,
@@ -37,12 +14,4 @@ struct i2c_slave_client {
37 void (*write)(void *ptr, unsigned int val); 14 void (*write)(void *ptr, unsigned int val);
38}; 15};
39 16
40extern int i2c_eeprom_emu_addwatcher(struct i2c_eeprom_emu *, void *data,
41 unsigned int addr, unsigned int size,
42 struct i2c_eeprom_emu_watcher *);
43
44extern void i2c_eeprom_emu_delwatcher(struct i2c_eeprom_emu *, void *data, struct i2c_eeprom_emu_watcher *watcher);
45
46extern struct i2c_eeprom_emu *i2c_pxa_get_eeprom(void);
47
48#endif /* _LINUX_I2C_ALGO_PXA_H */ 17#endif /* _LINUX_I2C_ALGO_PXA_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 9b5d04768c2c..71e50d3e492f 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -1,7 +1,7 @@
1/* ------------------------------------------------------------------------- */ 1/* ------------------------------------------------------------------------- */
2/* */ 2/* */
3/* i2c.h - definitions for the i2c-bus interface */ 3/* i2c.h - definitions for the i2c-bus interface */
4/* */ 4/* */
5/* ------------------------------------------------------------------------- */ 5/* ------------------------------------------------------------------------- */
6/* Copyright (C) 1995-2000 Simon G. Vogl 6/* Copyright (C) 1995-2000 Simon G. Vogl
7 7
@@ -27,7 +27,7 @@
27#define _LINUX_I2C_H 27#define _LINUX_I2C_H
28 28
29#include <linux/types.h> 29#include <linux/types.h>
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/i2c-id.h> 32#include <linux/i2c-id.h>
33#include <linux/mod_devicetable.h> 33#include <linux/mod_devicetable.h>
@@ -53,8 +53,8 @@ union i2c_smbus_data;
53 53
54/* 54/*
55 * The master routines are the ones normally used to transmit data to devices 55 * The master routines are the ones normally used to transmit data to devices
56 * on a bus (or read from them). Apart from two basic transfer functions to 56 * on a bus (or read from them). Apart from two basic transfer functions to
57 * transmit one message at a time, a more complex version can be used to 57 * transmit one message at a time, a more complex version can be used to
58 * transmit an arbitrary number of messages without interruption. 58 * transmit an arbitrary number of messages without interruption.
59 */ 59 */
60extern int i2c_master_send(struct i2c_client *,const char* ,int); 60extern int i2c_master_send(struct i2c_client *,const char* ,int);
@@ -67,10 +67,10 @@ extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
67 67
68/* This is the very generalized SMBus access routine. You probably do not 68/* This is the very generalized SMBus access routine. You probably do not
69 want to use this, though; one of the functions below may be much easier, 69 want to use this, though; one of the functions below may be much easier,
70 and probably just as fast. 70 and probably just as fast.
71 Note that we use i2c_adapter here, because you do not need a specific 71 Note that we use i2c_adapter here, because you do not need a specific
72 smbus adapter to call this function. */ 72 smbus adapter to call this function. */
73extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr, 73extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr,
74 unsigned short flags, 74 unsigned short flags,
75 char read_write, u8 command, int size, 75 char read_write, u8 command, int size,
76 union i2c_smbus_data * data); 76 union i2c_smbus_data * data);
@@ -112,14 +112,14 @@ struct i2c_driver {
112 112
113 /* Notifies the driver that a new bus has appeared. This routine 113 /* Notifies the driver that a new bus has appeared. This routine
114 * can be used by the driver to test if the bus meets its conditions 114 * can be used by the driver to test if the bus meets its conditions
115 * & seek for the presence of the chip(s) it supports. If found, it 115 * & seek for the presence of the chip(s) it supports. If found, it
116 * registers the client(s) that are on the bus to the i2c admin. via 116 * registers the client(s) that are on the bus to the i2c admin. via
117 * i2c_attach_client. 117 * i2c_attach_client.
118 */ 118 */
119 int (*attach_adapter)(struct i2c_adapter *); 119 int (*attach_adapter)(struct i2c_adapter *);
120 int (*detach_adapter)(struct i2c_adapter *); 120 int (*detach_adapter)(struct i2c_adapter *);
121 121
122 /* tells the driver that a client is about to be deleted & gives it 122 /* tells the driver that a client is about to be deleted & gives it
123 * the chance to remove its private data. Also, if the client struct 123 * the chance to remove its private data. Also, if the client struct
124 * has been dynamically allocated by the driver in the function above, 124 * has been dynamically allocated by the driver in the function above,
125 * it must be freed here. 125 * it must be freed here.
@@ -139,13 +139,13 @@ struct i2c_driver {
139#define I2C_NAME_SIZE 50 139#define I2C_NAME_SIZE 50
140 140
141/* 141/*
142 * i2c_client identifies a single device (i.e. chip) that is connected to an 142 * i2c_client identifies a single device (i.e. chip) that is connected to an
143 * i2c bus. The behaviour is defined by the routines of the driver. This 143 * i2c bus. The behaviour is defined by the routines of the driver. This
144 * function is mainly used for lookup & other admin. functions. 144 * function is mainly used for lookup & other admin. functions.
145 */ 145 */
146struct i2c_client { 146struct i2c_client {
147 unsigned int flags; /* div., see below */ 147 unsigned int flags; /* div., see below */
148 unsigned short addr; /* chip address - NOTE: 7bit */ 148 unsigned short addr; /* chip address - NOTE: 7bit */
149 /* addresses are stored in the */ 149 /* addresses are stored in the */
150 /* _LOWER_ 7 bits */ 150 /* _LOWER_ 7 bits */
151 struct i2c_adapter *adapter; /* the adapter we sit on */ 151 struct i2c_adapter *adapter; /* the adapter we sit on */
@@ -182,14 +182,14 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
182 */ 182 */
183struct i2c_algorithm { 183struct i2c_algorithm {
184 /* If an adapter algorithm can't do I2C-level access, set master_xfer 184 /* If an adapter algorithm can't do I2C-level access, set master_xfer
185 to NULL. If an adapter algorithm can do SMBus access, set 185 to NULL. If an adapter algorithm can do SMBus access, set
186 smbus_xfer. If set to NULL, the SMBus protocol is simulated 186 smbus_xfer. If set to NULL, the SMBus protocol is simulated
187 using common I2C messages */ 187 using common I2C messages */
188 /* master_xfer should return the number of messages successfully 188 /* master_xfer should return the number of messages successfully
189 processed, or a negative value on error */ 189 processed, or a negative value on error */
190 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, 190 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
191 int num); 191 int num);
192 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, 192 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
193 unsigned short flags, char read_write, 193 unsigned short flags, char read_write,
194 u8 command, int size, union i2c_smbus_data * data); 194 u8 command, int size, union i2c_smbus_data * data);
195 195
@@ -216,6 +216,7 @@ struct i2c_adapter {
216 int (*client_unregister)(struct i2c_client *); 216 int (*client_unregister)(struct i2c_client *);
217 217
218 /* data fields that are valid for all devices */ 218 /* data fields that are valid for all devices */
219 u8 level; /* nesting level for lockdep */
219 struct mutex bus_lock; 220 struct mutex bus_lock;
220 struct mutex clist_lock; 221 struct mutex clist_lock;
221 222
@@ -316,7 +317,7 @@ extern int i2c_check_addr (struct i2c_adapter *adapter, int addr);
316 * It will only call found_proc if some client is connected at the 317 * It will only call found_proc if some client is connected at the
317 * specific address (unless a 'force' matched); 318 * specific address (unless a 'force' matched);
318 */ 319 */
319extern int i2c_probe(struct i2c_adapter *adapter, 320extern int i2c_probe(struct i2c_adapter *adapter,
320 struct i2c_client_address_data *address_data, 321 struct i2c_client_address_data *address_data,
321 int (*found_proc) (struct i2c_adapter *, int, int)); 322 int (*found_proc) (struct i2c_adapter *, int, int));
322 323
@@ -352,15 +353,15 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
352 */ 353 */
353struct i2c_msg { 354struct i2c_msg {
354 __u16 addr; /* slave address */ 355 __u16 addr; /* slave address */
355 __u16 flags; 356 __u16 flags;
356#define I2C_M_TEN 0x10 /* we have a ten bit chip address */ 357#define I2C_M_TEN 0x10 /* we have a ten bit chip address */
357#define I2C_M_RD 0x01 358#define I2C_M_RD 0x01
358#define I2C_M_NOSTART 0x4000 359#define I2C_M_NOSTART 0x4000
359#define I2C_M_REV_DIR_ADDR 0x2000 360#define I2C_M_REV_DIR_ADDR 0x2000
360#define I2C_M_IGNORE_NAK 0x1000 361#define I2C_M_IGNORE_NAK 0x1000
361#define I2C_M_NO_RD_ACK 0x0800 362#define I2C_M_NO_RD_ACK 0x0800
362 __u16 len; /* msg length */ 363 __u16 len; /* msg length */
363 __u8 *buf; /* pointer to msg data */ 364 __u8 *buf; /* pointer to msg data */
364}; 365};
365 366
366/* To determine what functionality is present */ 367/* To determine what functionality is present */
@@ -370,16 +371,16 @@ struct i2c_msg {
370#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */ 371#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART,..} */
371#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */ 372#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 /* SMBus 2.0 */
372#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */ 373#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 /* SMBus 2.0 */
373#define I2C_FUNC_SMBUS_QUICK 0x00010000 374#define I2C_FUNC_SMBUS_QUICK 0x00010000
374#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 375#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
375#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 376#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
376#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 377#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
377#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 378#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
378#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 379#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
379#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 380#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
380#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 381#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
381#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 382#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
382#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 383#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
383#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */ 384#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* I2C-like block xfer */
384#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */ 385#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* w/ 1-byte reg. addr. */
385#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */ 386#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 /* I2C-like block xfer */
@@ -406,10 +407,10 @@ struct i2c_msg {
406 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \ 407 I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | \
407 I2C_FUNC_SMBUS_I2C_BLOCK) 408 I2C_FUNC_SMBUS_I2C_BLOCK)
408 409
409/* 410/*
410 * Data for SMBus Messages 411 * Data for SMBus Messages
411 */ 412 */
412#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ 413#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
413union i2c_smbus_data { 414union i2c_smbus_data {
414 __u8 byte; 415 __u8 byte;
415 __u16 word; 416 __u16 word;
@@ -421,11 +422,11 @@ union i2c_smbus_data {
421#define I2C_SMBUS_READ 1 422#define I2C_SMBUS_READ 1
422#define I2C_SMBUS_WRITE 0 423#define I2C_SMBUS_WRITE 0
423 424
424/* SMBus transaction types (size parameter in the above functions) 425/* SMBus transaction types (size parameter in the above functions)
425 Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */ 426 Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */
426#define I2C_SMBUS_QUICK 0 427#define I2C_SMBUS_QUICK 0
427#define I2C_SMBUS_BYTE 1 428#define I2C_SMBUS_BYTE 1
428#define I2C_SMBUS_BYTE_DATA 2 429#define I2C_SMBUS_BYTE_DATA 2
429#define I2C_SMBUS_WORD_DATA 3 430#define I2C_SMBUS_WORD_DATA 3
430#define I2C_SMBUS_PROC_CALL 4 431#define I2C_SMBUS_PROC_CALL 4
431#define I2C_SMBUS_BLOCK_DATA 5 432#define I2C_SMBUS_BLOCK_DATA 5
@@ -434,15 +435,15 @@ union i2c_smbus_data {
434 435
435 436
436/* ----- commands for the ioctl like i2c_command call: 437/* ----- commands for the ioctl like i2c_command call:
437 * note that additional calls are defined in the algorithm and hw 438 * note that additional calls are defined in the algorithm and hw
438 * dependent layers - these can be listed here, or see the 439 * dependent layers - these can be listed here, or see the
439 * corresponding header files. 440 * corresponding header files.
440 */ 441 */
441 /* -> bit-adapter specific ioctls */ 442 /* -> bit-adapter specific ioctls */
442#define I2C_RETRIES 0x0701 /* number of times a device address */ 443#define I2C_RETRIES 0x0701 /* number of times a device address */
443 /* should be polled when not */ 444 /* should be polled when not */
444 /* acknowledging */ 445 /* acknowledging */
445#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */ 446#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */
446 447
447 448
448/* this is for i2c-dev.c */ 449/* this is for i2c-dev.c */
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index c115e9e840b4..52f53e2e70c3 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -461,7 +461,7 @@ struct i2o_driver {
461 int (*reply) (struct i2o_controller *, u32, struct i2o_message *); 461 int (*reply) (struct i2o_controller *, u32, struct i2o_message *);
462 462
463 /* Event handler */ 463 /* Event handler */
464 void (*event) (struct i2o_event *); 464 work_func_t event;
465 465
466 struct workqueue_struct *event_queue; /* Event queue */ 466 struct workqueue_struct *event_queue; /* Event queue */
467 467
@@ -490,7 +490,7 @@ struct i2o_dma {
490 */ 490 */
491struct i2o_pool { 491struct i2o_pool {
492 char *name; 492 char *name;
493 kmem_cache_t *slab; 493 struct kmem_cache *slab;
494 mempool_t *mempool; 494 mempool_t *mempool;
495}; 495};
496 496
@@ -986,7 +986,8 @@ extern void i2o_driver_unregister(struct i2o_driver *);
986 986
987/** 987/**
988 * i2o_driver_notify_controller_add - Send notification of added controller 988 * i2o_driver_notify_controller_add - Send notification of added controller
989 * to a single I2O driver 989 * @drv: I2O driver
990 * @c: I2O controller
990 * 991 *
991 * Send notification of added controller to a single registered driver. 992 * Send notification of added controller to a single registered driver.
992 */ 993 */
@@ -998,8 +999,9 @@ static inline void i2o_driver_notify_controller_add(struct i2o_driver *drv,
998}; 999};
999 1000
1000/** 1001/**
1001 * i2o_driver_notify_controller_remove - Send notification of removed 1002 * i2o_driver_notify_controller_remove - Send notification of removed controller
1002 * controller to a single I2O driver 1003 * @drv: I2O driver
1004 * @c: I2O controller
1003 * 1005 *
1004 * Send notification of removed controller to a single registered driver. 1006 * Send notification of removed controller to a single registered driver.
1005 */ 1007 */
@@ -1011,8 +1013,9 @@ static inline void i2o_driver_notify_controller_remove(struct i2o_driver *drv,
1011}; 1013};
1012 1014
1013/** 1015/**
1014 * i2o_driver_notify_device_add - Send notification of added device to a 1016 * i2o_driver_notify_device_add - Send notification of added device
1015 * single I2O driver 1017 * @drv: I2O driver
1018 * @i2o_dev: the added i2o_device
1016 * 1019 *
1017 * Send notification of added device to a single registered driver. 1020 * Send notification of added device to a single registered driver.
1018 */ 1021 */
@@ -1025,7 +1028,8 @@ static inline void i2o_driver_notify_device_add(struct i2o_driver *drv,
1025 1028
1026/** 1029/**
1027 * i2o_driver_notify_device_remove - Send notification of removed device 1030 * i2o_driver_notify_device_remove - Send notification of removed device
1028 * to a single I2O driver 1031 * @drv: I2O driver
1032 * @i2o_dev: the added i2o_device
1029 * 1033 *
1030 * Send notification of removed device to a single registered driver. 1034 * Send notification of removed device to a single registered driver.
1031 */ 1035 */
@@ -1148,7 +1152,7 @@ static inline void i2o_msg_post(struct i2o_controller *c,
1148/** 1152/**
1149 * i2o_msg_post_wait - Post and wait a message and wait until return 1153 * i2o_msg_post_wait - Post and wait a message and wait until return
1150 * @c: controller 1154 * @c: controller
1151 * @m: message to post 1155 * @msg: message to post
1152 * @timeout: time in seconds to wait 1156 * @timeout: time in seconds to wait
1153 * 1157 *
1154 * This API allows an OSM to post a message and then be told whether or 1158 * This API allows an OSM to post a message and then be told whether or
diff --git a/include/linux/icmp.h b/include/linux/icmp.h
index 878cfe4e587f..24da4fbc1a2f 100644
--- a/include/linux/icmp.h
+++ b/include/linux/icmp.h
@@ -68,7 +68,7 @@
68struct icmphdr { 68struct icmphdr {
69 __u8 type; 69 __u8 type;
70 __u8 code; 70 __u8 code;
71 __be16 checksum; 71 __sum16 checksum;
72 union { 72 union {
73 struct { 73 struct {
74 __be16 id; 74 __be16 id;
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index c771a7db9871..68d3526c3a05 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -7,17 +7,17 @@ struct icmp6hdr {
7 7
8 __u8 icmp6_type; 8 __u8 icmp6_type;
9 __u8 icmp6_code; 9 __u8 icmp6_code;
10 __u16 icmp6_cksum; 10 __sum16 icmp6_cksum;
11 11
12 12
13 union { 13 union {
14 __u32 un_data32[1]; 14 __be32 un_data32[1];
15 __u16 un_data16[2]; 15 __be16 un_data16[2];
16 __u8 un_data8[4]; 16 __u8 un_data8[4];
17 17
18 struct icmpv6_echo { 18 struct icmpv6_echo {
19 __u16 identifier; 19 __be16 identifier;
20 __u16 sequence; 20 __be16 sequence;
21 } u_echo; 21 } u_echo;
22 22
23 struct icmpv6_nd_advt { 23 struct icmpv6_nd_advt {
@@ -53,7 +53,7 @@ struct icmp6hdr {
53#else 53#else
54#error "Please fix <asm/byteorder.h>" 54#error "Please fix <asm/byteorder.h>"
55#endif 55#endif
56 __u16 rt_lifetime; 56 __be16 rt_lifetime;
57 } u_nd_ra; 57 } u_nd_ra;
58 58
59 } icmp6_dataun; 59 } icmp6_dataun;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 9c2050293f17..e26a03981a94 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -796,6 +796,7 @@ typedef struct hwif_s {
796 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ 796 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
797 unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ 797 unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */
798 unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ 798 unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */
799 unsigned atapi_irq_bogon : 1; /* Generates spurious DMA interrupts in PIO mode */
799 800
800 struct device gendev; 801 struct device gendev;
801 struct completion gendev_rel_comp; /* To deal with device release() */ 802 struct completion gendev_rel_comp; /* To deal with device release() */
@@ -803,8 +804,6 @@ typedef struct hwif_s {
803 void *hwif_data; /* extra hwif data */ 804 void *hwif_data; /* extra hwif data */
804 805
805 unsigned dma; 806 unsigned dma;
806
807 void (*led_act)(void *data, int rw);
808} ____cacheline_internodealigned_in_smp ide_hwif_t; 807} ____cacheline_internodealigned_in_smp ide_hwif_t;
809 808
810/* 809/*
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h
index dbe8f6120a40..d557e4ce9b6b 100644
--- a/include/linux/if_addr.h
+++ b/include/linux/if_addr.h
@@ -52,4 +52,10 @@ struct ifa_cacheinfo
52 __u32 tstamp; /* updated timestamp, hundredths of seconds */ 52 __u32 tstamp; /* updated timestamp, hundredths of seconds */
53}; 53};
54 54
55/* backwards compatibility for userspace */
56#ifndef __KERNEL__
57#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
58#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
59#endif
60
55#endif 61#endif
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h
index e0a150046208..4aba6b0ad41c 100644
--- a/include/linux/if_fddi.h
+++ b/include/linux/if_fddi.h
@@ -103,6 +103,8 @@ struct fddihdr
103 } __attribute__ ((packed)); 103 } __attribute__ ((packed));
104 104
105#ifdef __KERNEL__ 105#ifdef __KERNEL__
106#include <linux/netdevice.h>
107
106/* Define FDDI statistics structure */ 108/* Define FDDI statistics structure */
107struct fddi_statistics { 109struct fddi_statistics {
108 110
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index e963a077e6f5..35ed3b5467f3 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -82,6 +82,12 @@ enum
82 82
83#define IFLA_MAX (__IFLA_MAX - 1) 83#define IFLA_MAX (__IFLA_MAX - 1)
84 84
85/* backwards compatibility for userspace */
86#ifndef __KERNEL__
87#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
88#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
89#endif
90
85/* ifi_flags. 91/* ifi_flags.
86 92
87 IFF_* flags. 93 IFF_* flags.
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index b92558549d27..99393ef3af39 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -1,17 +1,19 @@
1#ifndef __LINUX_IF_PACKET_H 1#ifndef __LINUX_IF_PACKET_H
2#define __LINUX_IF_PACKET_H 2#define __LINUX_IF_PACKET_H
3 3
4#include <linux/types.h>
5
4struct sockaddr_pkt 6struct sockaddr_pkt
5{ 7{
6 unsigned short spkt_family; 8 unsigned short spkt_family;
7 unsigned char spkt_device[14]; 9 unsigned char spkt_device[14];
8 unsigned short spkt_protocol; 10 __be16 spkt_protocol;
9}; 11};
10 12
11struct sockaddr_ll 13struct sockaddr_ll
12{ 14{
13 unsigned short sll_family; 15 unsigned short sll_family;
14 unsigned short sll_protocol; 16 __be16 sll_protocol;
15 int sll_ifindex; 17 int sll_ifindex;
16 unsigned short sll_hatype; 18 unsigned short sll_hatype;
17 unsigned char sll_pkttype; 19 unsigned char sll_pkttype;
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index bef9f8fd93b3..8de079ba1107 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -19,10 +19,10 @@ struct ip_tunnel_parm
19{ 19{
20 char name[IFNAMSIZ]; 20 char name[IFNAMSIZ];
21 int link; 21 int link;
22 __u16 i_flags; 22 __be16 i_flags;
23 __u16 o_flags; 23 __be16 o_flags;
24 __u32 i_key; 24 __be32 i_key;
25 __u32 o_key; 25 __be32 o_key;
26 struct iphdr iph; 26 struct iphdr iph;
27}; 27};
28 28
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 21dd56905271..9dbb525c5178 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -30,7 +30,7 @@ struct igmphdr
30{ 30{
31 __u8 type; 31 __u8 type;
32 __u8 code; /* For newer IGMP */ 32 __u8 code; /* For newer IGMP */
33 __be16 csum; 33 __sum16 csum;
34 __be32 group; 34 __be32 group;
35}; 35};
36 36
@@ -127,6 +127,7 @@ struct igmpv3_query {
127 127
128#ifdef __KERNEL__ 128#ifdef __KERNEL__
129#include <linux/skbuff.h> 129#include <linux/skbuff.h>
130#include <linux/timer.h>
130#include <linux/in.h> 131#include <linux/in.h>
131 132
132extern int sysctl_igmp_max_memberships; 133extern int sysctl_igmp_max_memberships;
diff --git a/include/linux/in.h b/include/linux/in.h
index 2619859f6e1b..1912e7c0bc26 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -45,6 +45,7 @@ enum {
45 45
46 IPPROTO_COMP = 108, /* Compression Header protocol */ 46 IPPROTO_COMP = 108, /* Compression Header protocol */
47 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */ 47 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
48 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
48 49
49 IPPROTO_RAW = 255, /* Raw IP packets */ 50 IPPROTO_RAW = 255, /* Raw IP packets */
50 IPPROTO_MAX 51 IPPROTO_MAX
diff --git a/include/linux/in6.h b/include/linux/in6.h
index f28621f638e0..4e8350ae8869 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -54,7 +54,7 @@ extern const struct in6_addr in6addr_loopback;
54struct sockaddr_in6 { 54struct sockaddr_in6 {
55 unsigned short int sin6_family; /* AF_INET6 */ 55 unsigned short int sin6_family; /* AF_INET6 */
56 __be16 sin6_port; /* Transport layer port # */ 56 __be16 sin6_port; /* Transport layer port # */
57 __u32 sin6_flowinfo; /* IPv6 flow information */ 57 __be32 sin6_flowinfo; /* IPv6 flow information */
58 struct in6_addr sin6_addr; /* IPv6 address */ 58 struct in6_addr sin6_addr; /* IPv6 address */
59 __u32 sin6_scope_id; /* scope id (new in RFC2553) */ 59 __u32 sin6_scope_id; /* scope id (new in RFC2553) */
60}; 60};
@@ -72,7 +72,7 @@ struct ipv6_mreq {
72struct in6_flowlabel_req 72struct in6_flowlabel_req
73{ 73{
74 struct in6_addr flr_dst; 74 struct in6_addr flr_dst;
75 __u32 flr_label; 75 __be32 flr_label;
76 __u8 flr_action; 76 __u8 flr_action;
77 __u8 flr_share; 77 __u8 flr_share;
78 __u16 flr_flags; 78 __u16 flr_flags;
diff --git a/include/linux/inet.h b/include/linux/inet.h
index b7c6da7d6d32..675a7dbe86f8 100644
--- a/include/linux/inet.h
+++ b/include/linux/inet.h
@@ -46,7 +46,7 @@
46#include <linux/types.h> 46#include <linux/types.h>
47 47
48extern __be32 in_aton(const char *str); 48extern __be32 in_aton(const char *str);
49extern int in4_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); 49extern int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end);
50extern int in6_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); 50extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char **end);
51#endif 51#endif
52#endif /* _LINUX_INET_H */ 52#endif /* _LINUX_INET_H */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 5a0ab04627bc..c0f7aec331c2 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -124,12 +124,13 @@ static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
124 * Check if a mask is acceptable. 124 * Check if a mask is acceptable.
125 */ 125 */
126 126
127static __inline__ int bad_mask(u32 mask, u32 addr) 127static __inline__ int bad_mask(__be32 mask, __be32 addr)
128{ 128{
129 __u32 hmask;
129 if (addr & (mask = ~mask)) 130 if (addr & (mask = ~mask))
130 return 1; 131 return 1;
131 mask = ntohl(mask); 132 hmask = ntohl(mask);
132 if (mask & (mask+1)) 133 if (hmask & (hmask+1))
133 return 1; 134 return 1;
134 return 0; 135 return 0;
135} 136}
@@ -190,11 +191,12 @@ static __inline__ __be32 inet_make_mask(int logmask)
190 return 0; 191 return 0;
191} 192}
192 193
193static __inline__ int inet_mask_len(__u32 mask) 194static __inline__ int inet_mask_len(__be32 mask)
194{ 195{
195 if (!(mask = ntohl(mask))) 196 __u32 hmask = ntohl(mask);
197 if (!hmask)
196 return 0; 198 return 0;
197 return 32 - ffz(~mask); 199 return 32 - ffz(~hmask);
198} 200}
199 201
200 202
diff --git a/include/linux/init.h b/include/linux/init.h
index 5eb5d24b7680..5a593a1dec1e 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -111,6 +111,7 @@ extern void setup_arch(char **);
111#define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) 111#define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s)
112#define fs_initcall(fn) __define_initcall("5",fn,5) 112#define fs_initcall(fn) __define_initcall("5",fn,5)
113#define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) 113#define fs_initcall_sync(fn) __define_initcall("5s",fn,5s)
114#define rootfs_initcall(fn) __define_initcall("rootfs",fn,rootfs)
114#define device_initcall(fn) __define_initcall("6",fn,6) 115#define device_initcall(fn) __define_initcall("6",fn,6)
115#define device_initcall_sync(fn) __define_initcall("6s",fn,6s) 116#define device_initcall_sync(fn) __define_initcall("6s",fn,6s)
116#define late_initcall(fn) __define_initcall("7",fn,7) 117#define late_initcall(fn) __define_initcall("7",fn,7)
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 33c5daacc743..6383d2d83bb0 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -7,16 +7,15 @@
7#include <linux/utsname.h> 7#include <linux/utsname.h>
8#include <linux/lockdep.h> 8#include <linux/lockdep.h>
9#include <linux/ipc.h> 9#include <linux/ipc.h>
10#include <linux/pid_namespace.h>
10 11
11#define INIT_FDTABLE \ 12#define INIT_FDTABLE \
12{ \ 13{ \
13 .max_fds = NR_OPEN_DEFAULT, \ 14 .max_fds = NR_OPEN_DEFAULT, \
14 .max_fdset = EMBEDDED_FD_SET_SIZE, \
15 .fd = &init_files.fd_array[0], \ 15 .fd = &init_files.fd_array[0], \
16 .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \ 16 .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \
17 .open_fds = (fd_set *)&init_files.open_fds_init, \ 17 .open_fds = (fd_set *)&init_files.open_fds_init, \
18 .rcu = RCU_HEAD_INIT, \ 18 .rcu = RCU_HEAD_INIT, \
19 .free_files = NULL, \
20 .next = NULL, \ 19 .next = NULL, \
21} 20}
22 21
@@ -57,25 +56,27 @@
57 .cpu_vm_mask = CPU_MASK_ALL, \ 56 .cpu_vm_mask = CPU_MASK_ALL, \
58} 57}
59 58
60#define INIT_SIGNALS(sig) { \ 59#define INIT_SIGNALS(sig) { \
61 .count = ATOMIC_INIT(1), \ 60 .count = ATOMIC_INIT(1), \
62 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ 61 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
63 .shared_pending = { \ 62 .shared_pending = { \
64 .list = LIST_HEAD_INIT(sig.shared_pending.list), \ 63 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
65 .signal = {{0}}}, \ 64 .signal = {{0}}}, \
66 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ 65 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
67 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ 66 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
68 .rlim = INIT_RLIMITS, \ 67 .rlim = INIT_RLIMITS, \
69 .pgrp = 1, \ 68 .pgrp = 1, \
70 .session = 1, \ 69 .tty_old_pgrp = 0, \
70 { .__session = 1}, \
71} 71}
72 72
73extern struct nsproxy init_nsproxy; 73extern struct nsproxy init_nsproxy;
74#define INIT_NSPROXY(nsproxy) { \ 74#define INIT_NSPROXY(nsproxy) { \
75 .pid_ns = &init_pid_ns, \
75 .count = ATOMIC_INIT(1), \ 76 .count = ATOMIC_INIT(1), \
76 .nslock = SPIN_LOCK_UNLOCKED, \ 77 .nslock = __SPIN_LOCK_UNLOCKED(nsproxy.nslock), \
77 .uts_ns = &init_uts_ns, \ 78 .uts_ns = &init_uts_ns, \
78 .namespace = NULL, \ 79 .mnt_ns = NULL, \
79 INIT_IPC_NS(ipc_ns) \ 80 INIT_IPC_NS(ipc_ns) \
80} 81}
81 82
diff --git a/include/linux/input.h b/include/linux/input.h
index c38507ba38b5..bde65c8a3519 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -491,6 +491,21 @@ struct input_absinfo {
491#define KEY_DIGITS 0x19d 491#define KEY_DIGITS 0x19d
492#define KEY_TEEN 0x19e 492#define KEY_TEEN 0x19e
493#define KEY_TWEN 0x19f 493#define KEY_TWEN 0x19f
494#define KEY_VIDEOPHONE 0x1a0
495#define KEY_GAMES 0x1a1
496#define KEY_ZOOMIN 0x1a2
497#define KEY_ZOOMOUT 0x1a3
498#define KEY_ZOOMRESET 0x1a4
499#define KEY_WORDPROCESSOR 0x1a5
500#define KEY_EDITOR 0x1a6
501#define KEY_SPREADSHEET 0x1a7
502#define KEY_GRAPHICSEDITOR 0x1a8
503#define KEY_PRESENTATION 0x1a9
504#define KEY_DATABASE 0x1aa
505#define KEY_NEWS 0x1ab
506#define KEY_VOICEMAIL 0x1ac
507#define KEY_ADDRESSBOOK 0x1ad
508#define KEY_MESSENGER 0x1ae
494 509
495#define KEY_DEL_EOL 0x1c0 510#define KEY_DEL_EOL 0x1c0
496#define KEY_DEL_EOS 0x1c1 511#define KEY_DEL_EOS 0x1c1
@@ -663,7 +678,7 @@ struct input_absinfo {
663#define BUS_GSC 0x1A 678#define BUS_GSC 0x1A
664 679
665/* 680/*
666 * Values describing the status of an effect 681 * Values describing the status of a force-feedback effect
667 */ 682 */
668#define FF_STATUS_STOPPED 0x00 683#define FF_STATUS_STOPPED 0x00
669#define FF_STATUS_PLAYING 0x01 684#define FF_STATUS_PLAYING 0x01
@@ -680,7 +695,7 @@ struct input_absinfo {
680 */ 695 */
681 696
682/** 697/**
683 * struct ff_replay - defines scheduling of the effect 698 * struct ff_replay - defines scheduling of the force-feedback effect
684 * @length: duration of the effect 699 * @length: duration of the effect
685 * @delay: delay before effect should start playing 700 * @delay: delay before effect should start playing
686 */ 701 */
@@ -690,7 +705,7 @@ struct ff_replay {
690}; 705};
691 706
692/** 707/**
693 * struct ff_trigger - defines what triggers the effect 708 * struct ff_trigger - defines what triggers the force-feedback effect
694 * @button: number of the button triggering the effect 709 * @button: number of the button triggering the effect
695 * @interval: controls how soon the effect can be re-triggered 710 * @interval: controls how soon the effect can be re-triggered
696 */ 711 */
@@ -700,7 +715,7 @@ struct ff_trigger {
700}; 715};
701 716
702/** 717/**
703 * struct ff_envelope - generic effect envelope 718 * struct ff_envelope - generic force-feedback effect envelope
704 * @attack_length: duration of the attack (ms) 719 * @attack_length: duration of the attack (ms)
705 * @attack_level: level at the beginning of the attack 720 * @attack_level: level at the beginning of the attack
706 * @fade_length: duration of fade (ms) 721 * @fade_length: duration of fade (ms)
@@ -719,7 +734,7 @@ struct ff_envelope {
719}; 734};
720 735
721/** 736/**
722 * struct ff_constant_effect - defines parameters of a constant effect 737 * struct ff_constant_effect - defines parameters of a constant force-feedback effect
723 * @level: strength of the effect; may be negative 738 * @level: strength of the effect; may be negative
724 * @envelope: envelope data 739 * @envelope: envelope data
725 */ 740 */
@@ -729,7 +744,7 @@ struct ff_constant_effect {
729}; 744};
730 745
731/** 746/**
732 * struct ff_ramp_effect - defines parameters of a ramp effect 747 * struct ff_ramp_effect - defines parameters of a ramp force-feedback effect
733 * @start_level: beginning strength of the effect; may be negative 748 * @start_level: beginning strength of the effect; may be negative
734 * @end_level: final strength of the effect; may be negative 749 * @end_level: final strength of the effect; may be negative
735 * @envelope: envelope data 750 * @envelope: envelope data
@@ -741,7 +756,7 @@ struct ff_ramp_effect {
741}; 756};
742 757
743/** 758/**
744 * struct ff_condition_effect - defines a spring or friction effect 759 * struct ff_condition_effect - defines a spring or friction force-feedback effect
745 * @right_saturation: maximum level when joystick moved all way to the right 760 * @right_saturation: maximum level when joystick moved all way to the right
746 * @left_saturation: same for the left side 761 * @left_saturation: same for the left side
747 * @right_coeff: controls how fast the force grows when the joystick moves 762 * @right_coeff: controls how fast the force grows when the joystick moves
@@ -762,7 +777,7 @@ struct ff_condition_effect {
762}; 777};
763 778
764/** 779/**
765 * struct ff_periodic_effect - defines parameters of a periodic effect 780 * struct ff_periodic_effect - defines parameters of a periodic force-feedback effect
766 * @waveform: kind of the effect (wave) 781 * @waveform: kind of the effect (wave)
767 * @period: period of the wave (ms) 782 * @period: period of the wave (ms)
768 * @magnitude: peak value 783 * @magnitude: peak value
@@ -793,7 +808,7 @@ struct ff_periodic_effect {
793}; 808};
794 809
795/** 810/**
796 * struct ff_rumble_effect - defines parameters of a periodic effect 811 * struct ff_rumble_effect - defines parameters of a periodic force-feedback effect
797 * @strong_magnitude: magnitude of the heavy motor 812 * @strong_magnitude: magnitude of the heavy motor
798 * @weak_magnitude: magnitude of the light one 813 * @weak_magnitude: magnitude of the light one
799 * 814 *
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 5b83e7b59621..e36e86c869fb 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -11,6 +11,7 @@
11#include <linux/hardirq.h> 11#include <linux/hardirq.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/irqflags.h> 13#include <linux/irqflags.h>
14#include <linux/bottom_half.h>
14#include <asm/atomic.h> 15#include <asm/atomic.h>
15#include <asm/ptrace.h> 16#include <asm/ptrace.h>
16#include <asm/system.h> 17#include <asm/system.h>
@@ -217,12 +218,6 @@ static inline void __deprecated save_and_cli(unsigned long *x)
217#define save_and_cli(x) save_and_cli(&x) 218#define save_and_cli(x) save_and_cli(&x)
218#endif /* CONFIG_SMP */ 219#endif /* CONFIG_SMP */
219 220
220extern void local_bh_disable(void);
221extern void __local_bh_enable(void);
222extern void _local_bh_enable(void);
223extern void local_bh_enable(void);
224extern void local_bh_enable_ip(unsigned long ip);
225
226/* PLEASE, avoid to allocate new softirqs, if you need not _really_ high 221/* PLEASE, avoid to allocate new softirqs, if you need not _really_ high
227 frequency threaded job scheduling. For almost all the purposes 222 frequency threaded job scheduling. For almost all the purposes
228 tasklets are more than enough. F.e. all serial device BHs et 223 tasklets are more than enough. F.e. all serial device BHs et
@@ -236,7 +231,8 @@ enum
236 NET_TX_SOFTIRQ, 231 NET_TX_SOFTIRQ,
237 NET_RX_SOFTIRQ, 232 NET_RX_SOFTIRQ,
238 BLOCK_SOFTIRQ, 233 BLOCK_SOFTIRQ,
239 TASKLET_SOFTIRQ 234 TASKLET_SOFTIRQ,
235 SCHED_SOFTIRQ,
240}; 236};
241 237
242/* softirq mask and active fields moved to irq_cpustat_t in 238/* softirq mask and active fields moved to irq_cpustat_t in
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index d42c83399071..15228d79c5bc 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -89,6 +89,10 @@ struct resource_list {
89#define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */ 89#define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */
90#define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */ 90#define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */
91#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */ 91#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */
92#define IORESOURCE_ROM_BIOS_COPY (1<<3) /* ROM is BIOS copy, resource field overlaid */
93
94/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */
95#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */
92 96
93/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ 97/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
94extern struct resource ioport_resource; 98extern struct resource ioport_resource;
diff --git a/include/linux/ip.h b/include/linux/ip.h
index ecee9bb27d0e..1d36b971a8b5 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -98,7 +98,7 @@ struct iphdr {
98 __be16 frag_off; 98 __be16 frag_off;
99 __u8 ttl; 99 __u8 ttl;
100 __u8 protocol; 100 __u8 protocol;
101 __be16 check; 101 __sum16 check;
102 __be32 saddr; 102 __be32 saddr;
103 __be32 daddr; 103 __be32 daddr;
104 /*The options start here. */ 104 /*The options start here. */
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h
index 5c23aeb104ca..af3f4a70f3df 100644
--- a/include/linux/ip6_tunnel.h
+++ b/include/linux/ip6_tunnel.h
@@ -25,7 +25,7 @@ struct ip6_tnl_parm {
25 __u8 proto; /* tunnel protocol */ 25 __u8 proto; /* tunnel protocol */
26 __u8 encap_limit; /* encapsulation limit for tunnel */ 26 __u8 encap_limit; /* encapsulation limit for tunnel */
27 __u8 hop_limit; /* hop limit for tunnel */ 27 __u8 hop_limit; /* hop limit for tunnel */
28 __u32 flowinfo; /* traffic class and flowlabel for tunnel */ 28 __be32 flowinfo; /* traffic class and flowlabel for tunnel */
29 __u32 flags; /* tunnel flags */ 29 __u32 flags; /* tunnel flags */
30 struct in6_addr laddr; /* local tunnel end-point address */ 30 struct in6_addr laddr; /* local tunnel end-point address */
31 struct in6_addr raddr; /* remote tunnel end-point address */ 31 struct in6_addr raddr; /* remote tunnel end-point address */
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 796ca009fd46..7a9db390c56a 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -208,6 +208,15 @@ struct kernel_ipmi_msg
208 code as the first byte of the incoming data, unlike a response. */ 208 code as the first byte of the incoming data, unlike a response. */
209 209
210 210
211/*
212 * Modes for ipmi_set_maint_mode() and the userland IOCTL. The AUTO
213 * setting is the default and means it will be set on certain
214 * commands. Hard setting it on and off will override automatic
215 * operation.
216 */
217#define IPMI_MAINTENANCE_MODE_AUTO 0
218#define IPMI_MAINTENANCE_MODE_OFF 1
219#define IPMI_MAINTENANCE_MODE_ON 2
211 220
212#ifdef __KERNEL__ 221#ifdef __KERNEL__
213 222
@@ -374,6 +383,35 @@ int ipmi_unregister_for_cmd(ipmi_user_t user,
374 unsigned int chans); 383 unsigned int chans);
375 384
376/* 385/*
386 * Go into a mode where the driver will not autonomously attempt to do
387 * things with the interface. It will still respond to attentions and
388 * interrupts, and it will expect that commands will complete. It
389 * will not automatcially check for flags, events, or things of that
390 * nature.
391 *
392 * This is primarily used for firmware upgrades. The idea is that
393 * when you go into firmware upgrade mode, you do this operation
394 * and the driver will not attempt to do anything but what you tell
395 * it or what the BMC asks for.
396 *
397 * Note that if you send a command that resets the BMC, the driver
398 * will still expect a response from that command. So the BMC should
399 * reset itself *after* the response is sent. Resetting before the
400 * response is just silly.
401 *
402 * If in auto maintenance mode, the driver will automatically go into
403 * maintenance mode for 30 seconds if it sees a cold reset, a warm
404 * reset, or a firmware NetFN. This means that code that uses only
405 * firmware NetFN commands to do upgrades will work automatically
406 * without change, assuming it sends a message every 30 seconds or
407 * less.
408 *
409 * See the IPMI_MAINTENANCE_MODE_xxx defines for what the mode means.
410 */
411int ipmi_get_maintenance_mode(ipmi_user_t user);
412int ipmi_set_maintenance_mode(ipmi_user_t user, int mode);
413
414/*
377 * Allow run-to-completion mode to be set for the interface of 415 * Allow run-to-completion mode to be set for the interface of
378 * a specific user. 416 * a specific user.
379 */ 417 */
@@ -656,4 +694,11 @@ struct ipmi_timing_parms
656#define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, \ 694#define IPMICTL_GET_TIMING_PARMS_CMD _IOR(IPMI_IOC_MAGIC, 23, \
657 struct ipmi_timing_parms) 695 struct ipmi_timing_parms)
658 696
697/*
698 * Set the maintenance mode. See ipmi_set_maintenance_mode() above
699 * for a description of what this does.
700 */
701#define IPMICTL_GET_MAINTENANCE_MODE_CMD _IOR(IPMI_IOC_MAGIC, 30, int)
702#define IPMICTL_SET_MAINTENANCE_MODE_CMD _IOW(IPMI_IOC_MAGIC, 31, int)
703
659#endif /* __LINUX_IPMI_H */ 704#endif /* __LINUX_IPMI_H */
diff --git a/include/linux/ipmi_msgdefs.h b/include/linux/ipmi_msgdefs.h
index 4d04d8b58a0a..b56a158d587a 100644
--- a/include/linux/ipmi_msgdefs.h
+++ b/include/linux/ipmi_msgdefs.h
@@ -46,6 +46,8 @@
46#define IPMI_NETFN_APP_REQUEST 0x06 46#define IPMI_NETFN_APP_REQUEST 0x06
47#define IPMI_NETFN_APP_RESPONSE 0x07 47#define IPMI_NETFN_APP_RESPONSE 0x07
48#define IPMI_GET_DEVICE_ID_CMD 0x01 48#define IPMI_GET_DEVICE_ID_CMD 0x01
49#define IPMI_COLD_RESET_CMD 0x02
50#define IPMI_WARM_RESET_CMD 0x03
49#define IPMI_CLEAR_MSG_FLAGS_CMD 0x30 51#define IPMI_CLEAR_MSG_FLAGS_CMD 0x30
50#define IPMI_GET_DEVICE_GUID_CMD 0x08 52#define IPMI_GET_DEVICE_GUID_CMD 0x08
51#define IPMI_GET_MSG_FLAGS_CMD 0x31 53#define IPMI_GET_MSG_FLAGS_CMD 0x31
@@ -60,20 +62,27 @@
60#define IPMI_NETFN_STORAGE_RESPONSE 0x0b 62#define IPMI_NETFN_STORAGE_RESPONSE 0x0b
61#define IPMI_ADD_SEL_ENTRY_CMD 0x44 63#define IPMI_ADD_SEL_ENTRY_CMD 0x44
62 64
65#define IPMI_NETFN_FIRMWARE_REQUEST 0x08
66#define IPMI_NETFN_FIRMWARE_RESPONSE 0x09
67
63/* The default slave address */ 68/* The default slave address */
64#define IPMI_BMC_SLAVE_ADDR 0x20 69#define IPMI_BMC_SLAVE_ADDR 0x20
65 70
66/* The BT interface on high-end HP systems supports up to 255 bytes in 71/* The BT interface on high-end HP systems supports up to 255 bytes in
67 * one transfer. Its "virtual" BMC supports some commands that are longer 72 * one transfer. Its "virtual" BMC supports some commands that are longer
68 * than 128 bytes. Use the full 256, plus NetFn/LUN, Cmd, cCode, plus 73 * than 128 bytes. Use the full 256, plus NetFn/LUN, Cmd, cCode, plus
69 * some overhead. It would be nice to base this on the "BT Capabilities" 74 * some overhead; it's not worth the effort to dynamically size this based
70 * but that's too hard to propagate to the rest of the driver. */ 75 * on the results of the "Get BT Capabilities" command. */
71#define IPMI_MAX_MSG_LENGTH 272 /* multiple of 16 */ 76#define IPMI_MAX_MSG_LENGTH 272 /* multiple of 16 */
72 77
73#define IPMI_CC_NO_ERROR 0x00 78#define IPMI_CC_NO_ERROR 0x00
74#define IPMI_NODE_BUSY_ERR 0xc0 79#define IPMI_NODE_BUSY_ERR 0xc0
75#define IPMI_INVALID_COMMAND_ERR 0xc1 80#define IPMI_INVALID_COMMAND_ERR 0xc1
81#define IPMI_TIMEOUT_ERR 0xc3
76#define IPMI_ERR_MSG_TRUNCATED 0xc6 82#define IPMI_ERR_MSG_TRUNCATED 0xc6
83#define IPMI_REQ_LEN_INVALID_ERR 0xc7
84#define IPMI_REQ_LEN_EXCEEDED_ERR 0xc8
85#define IPMI_NOT_IN_MY_STATE_ERR 0xd5 /* IPMI 2.0 */
77#define IPMI_LOST_ARBITRATION_ERR 0x81 86#define IPMI_LOST_ARBITRATION_ERR 0x81
78#define IPMI_BUS_ERR 0x82 87#define IPMI_BUS_ERR 0x82
79#define IPMI_NAK_ON_WRITE_ERR 0x83 88#define IPMI_NAK_ON_WRITE_ERR 0x83
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 6d9c7e4da472..c0633108d05d 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -115,6 +115,13 @@ struct ipmi_smi_handlers
115 poll for operations during things like crash dumps. */ 115 poll for operations during things like crash dumps. */
116 void (*poll)(void *send_info); 116 void (*poll)(void *send_info);
117 117
118 /* Enable/disable firmware maintenance mode. Note that this
119 is *not* the modes defined, this is simply an on/off
120 setting. The message handler does the mode handling. Note
121 that this is called from interupt context, so it cannot
122 block. */
123 void (*set_maintenance_mode)(void *send_info, int enable);
124
118 /* Tell the handler that we are using it/not using it. The 125 /* Tell the handler that we are using it/not using it. The
119 message handler get the modules that this handler belongs 126 message handler get the modules that this handler belongs
120 to; this function lets the SMI claim any modules that it 127 to; this function lets the SMI claim any modules that it
@@ -173,6 +180,7 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
173 void *send_info, 180 void *send_info,
174 struct ipmi_device_id *device_id, 181 struct ipmi_device_id *device_id,
175 struct device *dev, 182 struct device *dev,
183 const char *sysfs_name,
176 unsigned char slave_addr); 184 unsigned char slave_addr);
177 185
178/* 186/*
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 4f435c59de06..f8241130f5ea 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -274,7 +274,7 @@ struct ipv6_pinfo {
274 struct in6_addr *saddr_cache; 274 struct in6_addr *saddr_cache;
275#endif 275#endif
276 276
277 __u32 flow_label; 277 __be32 flow_label;
278 __u32 frag_size; 278 __u32 frag_size;
279 __s16 hop_limit; 279 __s16 hop_limit;
280 __s16 mcast_hops; 280 __s16 mcast_hops;
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 62991148d5a5..3c7875b7ab5b 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -511,8 +511,8 @@ typedef struct modem_info {
511#endif 511#endif
512 struct tty_struct *tty; /* Pointer to corresponding tty */ 512 struct tty_struct *tty; /* Pointer to corresponding tty */
513 atemu emu; /* AT-emulator data */ 513 atemu emu; /* AT-emulator data */
514 struct termios normal_termios; /* For saving termios structs */ 514 struct ktermios normal_termios; /* For saving termios structs */
515 struct termios callout_termios; 515 struct ktermios callout_termios;
516 wait_queue_head_t open_wait, close_wait; 516 wait_queue_head_t open_wait, close_wait;
517 struct semaphore write_sem; 517 struct semaphore write_sem;
518 spinlock_t readlock; 518 spinlock_t readlock;
@@ -525,8 +525,8 @@ typedef struct _isdn_modem {
525 int refcount; /* Number of opens */ 525 int refcount; /* Number of opens */
526 struct tty_driver *tty_modem; /* tty-device */ 526 struct tty_driver *tty_modem; /* tty-device */
527 struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */ 527 struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
528 struct termios *modem_termios[ISDN_MAX_CHANNELS]; 528 struct ktermios *modem_termios[ISDN_MAX_CHANNELS];
529 struct termios *modem_termios_locked[ISDN_MAX_CHANNELS]; 529 struct ktermios *modem_termios_locked[ISDN_MAX_CHANNELS];
530 modem_info info[ISDN_MAX_CHANNELS]; /* Private data */ 530 modem_info info[ISDN_MAX_CHANNELS]; /* Private data */
531} isdn_modem_t; 531} isdn_modem_t;
532 532
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index b55e2a035605..106a5e85e5c4 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -49,13 +49,13 @@
49 * communication with the slave board will always be on a per port 49 * communication with the slave board will always be on a per port
50 * basis. 50 * basis.
51 */ 51 */
52typedef struct { 52struct stliport {
53 unsigned long magic; 53 unsigned long magic;
54 int portnr; 54 unsigned int portnr;
55 int panelnr; 55 unsigned int panelnr;
56 int brdnr; 56 unsigned int brdnr;
57 unsigned long state; 57 unsigned long state;
58 int devnr; 58 unsigned int devnr;
59 int flags; 59 int flags;
60 int baud_base; 60 int baud_base;
61 int custom_divisor; 61 int custom_divisor;
@@ -72,7 +72,7 @@ typedef struct {
72 wait_queue_head_t close_wait; 72 wait_queue_head_t close_wait;
73 wait_queue_head_t raw_wait; 73 wait_queue_head_t raw_wait;
74 struct work_struct tqhangup; 74 struct work_struct tqhangup;
75 asysigs_t asig; 75 struct asysigs asig;
76 unsigned long addr; 76 unsigned long addr;
77 unsigned long rxoffset; 77 unsigned long rxoffset;
78 unsigned long txoffset; 78 unsigned long txoffset;
@@ -83,31 +83,31 @@ typedef struct {
83 unsigned char reqbit; 83 unsigned char reqbit;
84 unsigned char portidx; 84 unsigned char portidx;
85 unsigned char portbit; 85 unsigned char portbit;
86} stliport_t; 86};
87 87
88/* 88/*
89 * Use a structure of function pointers to do board level operations. 89 * Use a structure of function pointers to do board level operations.
90 * These include, enable/disable, paging shared memory, interrupting, etc. 90 * These include, enable/disable, paging shared memory, interrupting, etc.
91 */ 91 */
92typedef struct stlibrd { 92struct stlibrd {
93 unsigned long magic; 93 unsigned long magic;
94 int brdnr; 94 unsigned int brdnr;
95 int brdtype; 95 unsigned int brdtype;
96 int state; 96 unsigned int state;
97 int nrpanels; 97 unsigned int nrpanels;
98 int nrports; 98 unsigned int nrports;
99 int nrdevs; 99 unsigned int nrdevs;
100 unsigned int iobase; 100 unsigned int iobase;
101 int iosize; 101 int iosize;
102 unsigned long memaddr; 102 unsigned long memaddr;
103 void __iomem *membase; 103 void __iomem *membase;
104 int memsize; 104 unsigned long memsize;
105 int pagesize; 105 int pagesize;
106 int hostoffset; 106 int hostoffset;
107 int slaveoffset; 107 int slaveoffset;
108 int bitsize; 108 int bitsize;
109 int enabval; 109 int enabval;
110 int panels[STL_MAXPANELS]; 110 unsigned int panels[STL_MAXPANELS];
111 int panelids[STL_MAXPANELS]; 111 int panelids[STL_MAXPANELS];
112 void (*init)(struct stlibrd *brdp); 112 void (*init)(struct stlibrd *brdp);
113 void (*enable)(struct stlibrd *brdp); 113 void (*enable)(struct stlibrd *brdp);
@@ -116,8 +116,8 @@ typedef struct stlibrd {
116 void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line); 116 void __iomem *(*getmemptr)(struct stlibrd *brdp, unsigned long offset, int line);
117 void (*intr)(struct stlibrd *brdp); 117 void (*intr)(struct stlibrd *brdp);
118 void (*reset)(struct stlibrd *brdp); 118 void (*reset)(struct stlibrd *brdp);
119 stliport_t *ports[STL_MAXPORTS]; 119 struct stliport *ports[STL_MAXPORTS];
120} stlibrd_t; 120};
121 121
122 122
123/* 123/*
diff --git a/include/linux/ixjuser.h b/include/linux/ixjuser.h
index fd1756d3a47e..88b45895746d 100644
--- a/include/linux/ixjuser.h
+++ b/include/linux/ixjuser.h
@@ -315,7 +315,7 @@ typedef struct {
315* structures. If the freq0 variable is non-zero, the tone table contents 315* structures. If the freq0 variable is non-zero, the tone table contents
316* for the tone_index are updated to the frequencies and gains defined. It 316* for the tone_index are updated to the frequencies and gains defined. It
317* should be noted that DTMF tones cannot be reassigned, so if DTMF tone 317* should be noted that DTMF tones cannot be reassigned, so if DTMF tone
318* table indexs are used in a cadence the frequency and gain variables will 318* table indexes are used in a cadence the frequency and gain variables will
319* be ignored. 319* be ignored.
320* 320*
321* If the array elements contain frequency parameters the driver will 321* If the array elements contain frequency parameters the driver will
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index fe89444b1c6f..452737551260 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -839,7 +839,6 @@ struct journal_s
839 */ 839 */
840 840
841/* Filing buffers */ 841/* Filing buffers */
842extern void __journal_temp_unlink_buffer(struct journal_head *jh);
843extern void journal_unfile_buffer(journal_t *, struct journal_head *); 842extern void journal_unfile_buffer(journal_t *, struct journal_head *);
844extern void __journal_unfile_buffer(struct journal_head *); 843extern void __journal_unfile_buffer(struct journal_head *);
845extern void __journal_refile_buffer(struct journal_head *); 844extern void __journal_refile_buffer(struct journal_head *);
@@ -949,7 +948,7 @@ void journal_put_journal_head(struct journal_head *jh);
949/* 948/*
950 * handle management 949 * handle management
951 */ 950 */
952extern kmem_cache_t *jbd_handle_cache; 951extern struct kmem_cache *jbd_handle_cache;
953 952
954static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) 953static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags)
955{ 954{
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index ddb128795781..0e0fedd2039a 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -848,7 +848,6 @@ struct journal_s
848 */ 848 */
849 849
850/* Filing buffers */ 850/* Filing buffers */
851extern void __jbd2_journal_temp_unlink_buffer(struct journal_head *jh);
852extern void jbd2_journal_unfile_buffer(journal_t *, struct journal_head *); 851extern void jbd2_journal_unfile_buffer(journal_t *, struct journal_head *);
853extern void __jbd2_journal_unfile_buffer(struct journal_head *); 852extern void __jbd2_journal_unfile_buffer(struct journal_head *);
854extern void __jbd2_journal_refile_buffer(struct journal_head *); 853extern void __jbd2_journal_refile_buffer(struct journal_head *);
@@ -958,7 +957,7 @@ void jbd2_journal_put_journal_head(struct journal_head *jh);
958/* 957/*
959 * handle management 958 * handle management
960 */ 959 */
961extern kmem_cache_t *jbd2_handle_cache; 960extern struct kmem_cache *jbd2_handle_cache;
962 961
963static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) 962static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags)
964{ 963{
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index c8d5f207c3d4..0ec6e28bccd2 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -74,7 +74,7 @@
74#define __jiffy_data __attribute__((section(".data"))) 74#define __jiffy_data __attribute__((section(".data")))
75 75
76/* 76/*
77 * The 64-bit value is not volatile - you MUST NOT read it 77 * The 64-bit value is not atomic - you MUST NOT read it
78 * without sampling the sequence number in xtime_lock. 78 * without sampling the sequence number in xtime_lock.
79 * get_jiffies_64() will do this for you as appropriate. 79 * get_jiffies_64() will do this for you as appropriate.
80 */ 80 */
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index efe0ee4cc80b..06c58c423fe1 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -158,7 +158,7 @@ static inline void con_schedule_flip(struct tty_struct *t)
158 if (t->buf.tail != NULL) 158 if (t->buf.tail != NULL)
159 t->buf.tail->commit = t->buf.tail->used; 159 t->buf.tail->commit = t->buf.tail->used;
160 spin_unlock_irqrestore(&t->buf.lock, flags); 160 spin_unlock_irqrestore(&t->buf.lock, flags);
161 schedule_work(&t->buf.work); 161 schedule_delayed_work(&t->buf.work, 0);
162} 162}
163 163
164#endif 164#endif
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index b9b5e4ba166a..63fb18dcac30 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -13,10 +13,12 @@
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <linux/bitops.h> 15#include <linux/bitops.h>
16#include <linux/log2.h>
16#include <asm/byteorder.h> 17#include <asm/byteorder.h>
17#include <asm/bug.h> 18#include <asm/bug.h>
18 19
19extern const char linux_banner[]; 20extern const char linux_banner[];
21extern const char linux_proc_banner[];
20 22
21#define INT_MAX ((int)(~0U>>1)) 23#define INT_MAX ((int)(~0U>>1))
22#define INT_MIN (-INT_MAX - 1) 24#define INT_MIN (-INT_MAX - 1)
@@ -65,7 +67,7 @@ struct user;
65 * context (spinlock, irq-handler, ...). 67 * context (spinlock, irq-handler, ...).
66 * 68 *
67 * This is a useful debugging help to be able to catch problems early and not 69 * This is a useful debugging help to be able to catch problems early and not
68 * be biten later when the calling function happens to sleep when it is not 70 * be bitten later when the calling function happens to sleep when it is not
69 * supposed to. 71 * supposed to.
70 */ 72 */
71#ifdef CONFIG_PREEMPT_VOLUNTARY 73#ifdef CONFIG_PREEMPT_VOLUNTARY
@@ -157,20 +159,6 @@ static inline int printk(const char *s, ...) { return 0; }
157 159
158unsigned long int_sqrt(unsigned long); 160unsigned long int_sqrt(unsigned long);
159 161
160static inline int __attribute_pure__ long_log2(unsigned long x)
161{
162 int r = 0;
163 for (x >>= 1; x > 0; x >>= 1)
164 r++;
165 return r;
166}
167
168static inline unsigned long
169__attribute_const__ roundup_pow_of_two(unsigned long x)
170{
171 return 1UL << fls_long(x - 1);
172}
173
174extern int printk_ratelimit(void); 162extern int printk_ratelimit(void);
175extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); 163extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
176extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, 164extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index 891bb2cf0aa8..aea34e74c496 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -47,6 +47,8 @@ typedef struct kcapi_carddef {
47 47
48#include <linux/list.h> 48#include <linux/list.h>
49#include <linux/skbuff.h> 49#include <linux/skbuff.h>
50#include <linux/workqueue.h>
51#include <asm/semaphore.h>
50 52
51#define KCI_CONTRUP 0 /* arg: struct capi_profile */ 53#define KCI_CONTRUP 0 /* arg: struct capi_profile */
52#define KCI_CONTRDOWN 1 /* arg: NULL */ 54#define KCI_CONTRDOWN 1 /* arg: NULL */
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 6427949ddf99..d02425cdd801 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -105,9 +105,14 @@ extern struct page *kimage_alloc_control_pages(struct kimage *image,
105 unsigned int order); 105 unsigned int order);
106extern void crash_kexec(struct pt_regs *); 106extern void crash_kexec(struct pt_regs *);
107int kexec_should_crash(struct task_struct *); 107int kexec_should_crash(struct task_struct *);
108void crash_save_cpu(struct pt_regs *regs, int cpu);
108extern struct kimage *kexec_image; 109extern struct kimage *kexec_image;
109extern struct kimage *kexec_crash_image; 110extern struct kimage *kexec_crash_image;
110 111
112#ifndef kexec_flush_icache_page
113#define kexec_flush_icache_page(page)
114#endif
115
111#define KEXEC_ON_CRASH 0x00000001 116#define KEXEC_ON_CRASH 0x00000001
112#define KEXEC_ARCH_MASK 0xffff0000 117#define KEXEC_ARCH_MASK 0xffff0000
113 118
@@ -122,6 +127,8 @@ extern struct kimage *kexec_crash_image;
122#define KEXEC_ARCH_IA_64 (50 << 16) 127#define KEXEC_ARCH_IA_64 (50 << 16)
123#define KEXEC_ARCH_S390 (22 << 16) 128#define KEXEC_ARCH_S390 (22 << 16)
124#define KEXEC_ARCH_SH (42 << 16) 129#define KEXEC_ARCH_SH (42 << 16)
130#define KEXEC_ARCH_MIPS_LE (10 << 16)
131#define KEXEC_ARCH_MIPS ( 8 << 16)
125 132
126#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */ 133#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */
127 134
@@ -131,6 +138,7 @@ extern struct resource crashk_res;
131typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; 138typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
132extern note_buf_t *crash_notes; 139extern note_buf_t *crash_notes;
133 140
141
134#else /* !CONFIG_KEXEC */ 142#else /* !CONFIG_KEXEC */
135struct pt_regs; 143struct pt_regs;
136struct task_struct; 144struct task_struct;
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index bcd9cd173c2c..76538fcf2c4e 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -47,6 +47,7 @@ enum kobject_action {
47 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ 47 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */
48 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ 48 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */
49 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ 49 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */
50 KOBJ_MOVE = (__force kobject_action_t) 0x08, /* device move */
50}; 51};
51 52
52struct kobject { 53struct kobject {
@@ -76,6 +77,7 @@ extern int __must_check kobject_add(struct kobject *);
76extern void kobject_del(struct kobject *); 77extern void kobject_del(struct kobject *);
77 78
78extern int __must_check kobject_rename(struct kobject *, const char *new_name); 79extern int __must_check kobject_rename(struct kobject *, const char *new_name);
80extern int __must_check kobject_move(struct kobject *, struct kobject *);
79 81
80extern int __must_check kobject_register(struct kobject *); 82extern int __must_check kobject_register(struct kobject *);
81extern void kobject_unregister(struct kobject *); 83extern void kobject_unregister(struct kobject *);
@@ -263,14 +265,21 @@ extern int __must_check subsys_create_file(struct subsystem * ,
263 struct subsys_attribute *); 265 struct subsys_attribute *);
264 266
265#if defined(CONFIG_HOTPLUG) 267#if defined(CONFIG_HOTPLUG)
266void kobject_uevent(struct kobject *kobj, enum kobject_action action); 268int kobject_uevent(struct kobject *kobj, enum kobject_action action);
269int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
270 char *envp[]);
267 271
268int add_uevent_var(char **envp, int num_envp, int *cur_index, 272int add_uevent_var(char **envp, int num_envp, int *cur_index,
269 char *buffer, int buffer_size, int *cur_len, 273 char *buffer, int buffer_size, int *cur_len,
270 const char *format, ...) 274 const char *format, ...)
271 __attribute__((format (printf, 7, 8))); 275 __attribute__((format (printf, 7, 8)));
272#else 276#else
273static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { } 277static inline int kobject_uevent(struct kobject *kobj, enum kobject_action action)
278{ return 0; }
279static inline int kobject_uevent_env(struct kobject *kobj,
280 enum kobject_action action,
281 char *envp[])
282{ return 0; }
274 283
275static inline int add_uevent_var(char **envp, int num_envp, int *cur_index, 284static inline int add_uevent_var(char **envp, int num_envp, int *cur_index,
276 char *buffer, int buffer_size, int *cur_len, 285 char *buffer, int buffer_size, int *cur_len,
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index ac4c0559f751..769be39b9681 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -165,7 +165,7 @@ extern void arch_disarm_kprobe(struct kprobe *p);
165extern int arch_init_kprobes(void); 165extern int arch_init_kprobes(void);
166extern void show_registers(struct pt_regs *regs); 166extern void show_registers(struct pt_regs *regs);
167extern kprobe_opcode_t *get_insn_slot(void); 167extern kprobe_opcode_t *get_insn_slot(void);
168extern void free_insn_slot(kprobe_opcode_t *slot); 168extern void free_insn_slot(kprobe_opcode_t *slot, int dirty);
169extern void kprobes_inc_nmissed_count(struct kprobe *p); 169extern void kprobes_inc_nmissed_count(struct kprobe *p);
170 170
171/* Get the kprobe at this addr (if any) - called with preemption disabled */ 171/* Get the kprobe at this addr (if any) - called with preemption disabled */
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 84eeecd60a02..611f17f79eef 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -248,9 +248,9 @@ static inline struct timeval ktime_to_timeval(const ktime_t kt)
248 * 248 *
249 * Returns the scalar nanoseconds representation of kt 249 * Returns the scalar nanoseconds representation of kt
250 */ 250 */
251static inline u64 ktime_to_ns(const ktime_t kt) 251static inline s64 ktime_to_ns(const ktime_t kt)
252{ 252{
253 return (u64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; 253 return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec;
254} 254}
255 255
256#endif 256#endif
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
new file mode 100644
index 000000000000..bc8b4616bad7
--- /dev/null
+++ b/include/linux/kvm.h
@@ -0,0 +1,239 @@
1#ifndef __LINUX_KVM_H
2#define __LINUX_KVM_H
3
4/*
5 * Userspace interface for /dev/kvm - kernel based virtual machine
6 *
7 * Note: this interface is considered experimental and may change without
8 * notice.
9 */
10
11#include <asm/types.h>
12#include <linux/ioctl.h>
13
14#define KVM_API_VERSION 2
15
16/*
17 * Architectural interrupt line count, and the size of the bitmap needed
18 * to hold them.
19 */
20#define KVM_NR_INTERRUPTS 256
21#define KVM_IRQ_BITMAP_SIZE_BYTES ((KVM_NR_INTERRUPTS + 7) / 8)
22#define KVM_IRQ_BITMAP_SIZE(type) (KVM_IRQ_BITMAP_SIZE_BYTES / sizeof(type))
23
24
25/* for KVM_CREATE_MEMORY_REGION */
26struct kvm_memory_region {
27 __u32 slot;
28 __u32 flags;
29 __u64 guest_phys_addr;
30 __u64 memory_size; /* bytes */
31};
32
33/* for kvm_memory_region::flags */
34#define KVM_MEM_LOG_DIRTY_PAGES 1UL
35
36
37#define KVM_EXIT_TYPE_FAIL_ENTRY 1
38#define KVM_EXIT_TYPE_VM_EXIT 2
39
40enum kvm_exit_reason {
41 KVM_EXIT_UNKNOWN = 0,
42 KVM_EXIT_EXCEPTION = 1,
43 KVM_EXIT_IO = 2,
44 KVM_EXIT_CPUID = 3,
45 KVM_EXIT_DEBUG = 4,
46 KVM_EXIT_HLT = 5,
47 KVM_EXIT_MMIO = 6,
48 KVM_EXIT_IRQ_WINDOW_OPEN = 7,
49};
50
51/* for KVM_RUN */
52struct kvm_run {
53 /* in */
54 __u32 vcpu;
55 __u32 emulated; /* skip current instruction */
56 __u32 mmio_completed; /* mmio request completed */
57 __u8 request_interrupt_window;
58 __u8 padding1[3];
59
60 /* out */
61 __u32 exit_type;
62 __u32 exit_reason;
63 __u32 instruction_length;
64 __u8 ready_for_interrupt_injection;
65 __u8 if_flag;
66 __u16 padding2;
67 __u64 cr8;
68 __u64 apic_base;
69
70 union {
71 /* KVM_EXIT_UNKNOWN */
72 struct {
73 __u32 hardware_exit_reason;
74 } hw;
75 /* KVM_EXIT_EXCEPTION */
76 struct {
77 __u32 exception;
78 __u32 error_code;
79 } ex;
80 /* KVM_EXIT_IO */
81 struct {
82#define KVM_EXIT_IO_IN 0
83#define KVM_EXIT_IO_OUT 1
84 __u8 direction;
85 __u8 size; /* bytes */
86 __u8 string;
87 __u8 string_down;
88 __u8 rep;
89 __u8 pad;
90 __u16 port;
91 __u64 count;
92 union {
93 __u64 address;
94 __u32 value;
95 };
96 } io;
97 struct {
98 } debug;
99 /* KVM_EXIT_MMIO */
100 struct {
101 __u64 phys_addr;
102 __u8 data[8];
103 __u32 len;
104 __u8 is_write;
105 } mmio;
106 };
107};
108
109/* for KVM_GET_REGS and KVM_SET_REGS */
110struct kvm_regs {
111 /* in */
112 __u32 vcpu;
113 __u32 padding;
114
115 /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
116 __u64 rax, rbx, rcx, rdx;
117 __u64 rsi, rdi, rsp, rbp;
118 __u64 r8, r9, r10, r11;
119 __u64 r12, r13, r14, r15;
120 __u64 rip, rflags;
121};
122
123struct kvm_segment {
124 __u64 base;
125 __u32 limit;
126 __u16 selector;
127 __u8 type;
128 __u8 present, dpl, db, s, l, g, avl;
129 __u8 unusable;
130 __u8 padding;
131};
132
133struct kvm_dtable {
134 __u64 base;
135 __u16 limit;
136 __u16 padding[3];
137};
138
139/* for KVM_GET_SREGS and KVM_SET_SREGS */
140struct kvm_sregs {
141 /* in */
142 __u32 vcpu;
143 __u32 padding;
144
145 /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */
146 struct kvm_segment cs, ds, es, fs, gs, ss;
147 struct kvm_segment tr, ldt;
148 struct kvm_dtable gdt, idt;
149 __u64 cr0, cr2, cr3, cr4, cr8;
150 __u64 efer;
151 __u64 apic_base;
152 __u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)];
153};
154
155struct kvm_msr_entry {
156 __u32 index;
157 __u32 reserved;
158 __u64 data;
159};
160
161/* for KVM_GET_MSRS and KVM_SET_MSRS */
162struct kvm_msrs {
163 __u32 vcpu;
164 __u32 nmsrs; /* number of msrs in entries */
165
166 struct kvm_msr_entry entries[0];
167};
168
169/* for KVM_GET_MSR_INDEX_LIST */
170struct kvm_msr_list {
171 __u32 nmsrs; /* number of msrs in entries */
172 __u32 indices[0];
173};
174
175/* for KVM_TRANSLATE */
176struct kvm_translation {
177 /* in */
178 __u64 linear_address;
179 __u32 vcpu;
180 __u32 padding;
181
182 /* out */
183 __u64 physical_address;
184 __u8 valid;
185 __u8 writeable;
186 __u8 usermode;
187};
188
189/* for KVM_INTERRUPT */
190struct kvm_interrupt {
191 /* in */
192 __u32 vcpu;
193 __u32 irq;
194};
195
196struct kvm_breakpoint {
197 __u32 enabled;
198 __u32 padding;
199 __u64 address;
200};
201
202/* for KVM_DEBUG_GUEST */
203struct kvm_debug_guest {
204 /* int */
205 __u32 vcpu;
206 __u32 enabled;
207 struct kvm_breakpoint breakpoints[4];
208 __u32 singlestep;
209};
210
211/* for KVM_GET_DIRTY_LOG */
212struct kvm_dirty_log {
213 __u32 slot;
214 __u32 padding;
215 union {
216 void __user *dirty_bitmap; /* one bit per page */
217 __u64 padding;
218 };
219};
220
221#define KVMIO 0xAE
222
223#define KVM_GET_API_VERSION _IO(KVMIO, 1)
224#define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run)
225#define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs)
226#define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs)
227#define KVM_GET_SREGS _IOWR(KVMIO, 5, struct kvm_sregs)
228#define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs)
229#define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation)
230#define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt)
231#define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest)
232#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region)
233#define KVM_CREATE_VCPU _IOW(KVMIO, 11, int /* vcpu_slot */)
234#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log)
235#define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs)
236#define KVM_SET_MSRS _IOWR(KVMIO, 14, struct kvm_msrs)
237#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 15, struct kvm_msr_list)
238
239#endif
diff --git a/include/linux/libata.h b/include/linux/libata.h
index abd2debebca2..ab2754830322 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -140,6 +140,7 @@ enum {
140 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */ 140 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */
141 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ 141 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */
142 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ 142 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */
143 ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */
143 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 144 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
144 145
145 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ 146 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */
@@ -175,6 +176,7 @@ enum {
175 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H 176 ATA_FLAG_SKIP_D2H_BSY = (1 << 12), /* can't wait for the first D2H
176 * Register FIS clearing BSY */ 177 * Register FIS clearing BSY */
177 ATA_FLAG_DEBUGMSG = (1 << 13), 178 ATA_FLAG_DEBUGMSG = (1 << 13),
179 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */
178 180
179 /* The following flag belongs to ap->pflags but is kept in 181 /* The following flag belongs to ap->pflags but is kept in
180 * ap->flags because it's referenced in many LLDs and will be 182 * ap->flags because it's referenced in many LLDs and will be
@@ -283,6 +285,9 @@ enum {
283 ATA_EHI_QUIET = (1 << 3), /* be quiet */ 285 ATA_EHI_QUIET = (1 << 3), /* be quiet */
284 286
285 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ 287 ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */
288 ATA_EHI_PRINTINFO = (1 << 17), /* print configuration info */
289 ATA_EHI_SETMODE = (1 << 18), /* configure transfer mode */
290 ATA_EHI_POST_SETMODE = (1 << 19), /* revaildating after setmode */
286 291
287 ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK, 292 ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK,
288 293
@@ -307,10 +312,11 @@ enum {
307 (some horkage may be drive/controller pair dependant */ 312 (some horkage may be drive/controller pair dependant */
308 313
309 ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */ 314 ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */
315 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */
316 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */
310}; 317};
311 318
312enum hsm_task_states { 319enum hsm_task_states {
313 HSM_ST_UNKNOWN, /* state unknown */
314 HSM_ST_IDLE, /* no command on going */ 320 HSM_ST_IDLE, /* no command on going */
315 HSM_ST, /* (waiting the device to) transfer data */ 321 HSM_ST, /* (waiting the device to) transfer data */
316 HSM_ST_LAST, /* (waiting the device to) complete command */ 322 HSM_ST_LAST, /* (waiting the device to) complete command */
@@ -329,6 +335,7 @@ enum ata_completion_errors {
329 AC_ERR_SYSTEM = (1 << 6), /* system error */ 335 AC_ERR_SYSTEM = (1 << 6), /* system error */
330 AC_ERR_INVALID = (1 << 7), /* invalid argument */ 336 AC_ERR_INVALID = (1 << 7), /* invalid argument */
331 AC_ERR_OTHER = (1 << 8), /* unknown */ 337 AC_ERR_OTHER = (1 << 8), /* unknown */
338 AC_ERR_NODEV_HINT = (1 << 9), /* polling device detection hint */
332}; 339};
333 340
334/* forward declarations */ 341/* forward declarations */
@@ -568,8 +575,9 @@ struct ata_port {
568 struct ata_host *host; 575 struct ata_host *host;
569 struct device *dev; 576 struct device *dev;
570 577
571 struct work_struct port_task; 578 void *port_task_data;
572 struct work_struct hotplug_task; 579 struct delayed_work port_task;
580 struct delayed_work hotplug_task;
573 struct work_struct scsi_rescan_task; 581 struct work_struct scsi_rescan_task;
574 582
575 unsigned int hsm_task_state; 583 unsigned int hsm_task_state;
@@ -700,6 +708,8 @@ extern int sata_phy_debounce(struct ata_port *ap, const unsigned long *param);
700extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param); 708extern int sata_phy_resume(struct ata_port *ap, const unsigned long *param);
701extern int ata_std_prereset(struct ata_port *ap); 709extern int ata_std_prereset(struct ata_port *ap);
702extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); 710extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
711extern int sata_port_hardreset(struct ata_port *ap,
712 const unsigned long *timing);
703extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); 713extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
704extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 714extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
705extern void ata_port_disable(struct ata_port *); 715extern void ata_port_disable(struct ata_port *);
@@ -744,10 +754,9 @@ extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg);
744extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); 754extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
745extern void ata_host_resume(struct ata_host *host); 755extern void ata_host_resume(struct ata_host *host);
746extern int ata_ratelimit(void); 756extern int ata_ratelimit(void);
747extern unsigned int ata_busy_sleep(struct ata_port *ap, 757extern int ata_busy_sleep(struct ata_port *ap,
748 unsigned long timeout_pat, 758 unsigned long timeout_pat, unsigned long timeout);
749 unsigned long timeout); 759extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn,
750extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *),
751 void *data, unsigned long delay); 760 void *data, unsigned long delay);
752extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, 761extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
753 unsigned long interval_msec, 762 unsigned long interval_msec,
@@ -787,6 +796,7 @@ extern void ata_id_string(const u16 *id, unsigned char *s,
787 unsigned int ofs, unsigned int len); 796 unsigned int ofs, unsigned int len);
788extern void ata_id_c_string(const u16 *id, unsigned char *s, 797extern void ata_id_c_string(const u16 *id, unsigned char *s,
789 unsigned int ofs, unsigned int len); 798 unsigned int ofs, unsigned int len);
799extern unsigned long ata_device_blacklisted(const struct ata_device *dev);
790extern void ata_bmdma_setup (struct ata_queued_cmd *qc); 800extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
791extern void ata_bmdma_start (struct ata_queued_cmd *qc); 801extern void ata_bmdma_start (struct ata_queued_cmd *qc);
792extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 802extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
@@ -1061,7 +1071,7 @@ static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits,
1061 udelay(10); 1071 udelay(10);
1062 status = ata_chk_status(ap); 1072 status = ata_chk_status(ap);
1063 max--; 1073 max--;
1064 } while ((status & bits) && (max > 0)); 1074 } while (status != 0xff && (status & bits) && (max > 0));
1065 1075
1066 return status; 1076 return status;
1067} 1077}
@@ -1082,7 +1092,7 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
1082{ 1092{
1083 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 1093 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
1084 1094
1085 if (status & (ATA_BUSY | ATA_DRQ)) { 1095 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) {
1086 unsigned long l = ap->ioaddr.status_addr; 1096 unsigned long l = ap->ioaddr.status_addr;
1087 if (ata_msg_warn(ap)) 1097 if (ata_msg_warn(ap))
1088 printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n", 1098 printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n",
@@ -1148,37 +1158,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1148} 1158}
1149 1159
1150/** 1160/**
1151 * ata_irq_on - Enable interrupts on a port.
1152 * @ap: Port on which interrupts are enabled.
1153 *
1154 * Enable interrupts on a legacy IDE device using MMIO or PIO,
1155 * wait for idle, clear any pending interrupts.
1156 *
1157 * LOCKING:
1158 * Inherited from caller.
1159 */
1160
1161static inline u8 ata_irq_on(struct ata_port *ap)
1162{
1163 struct ata_ioports *ioaddr = &ap->ioaddr;
1164 u8 tmp;
1165
1166 ap->ctl &= ~ATA_NIEN;
1167 ap->last_ctl = ap->ctl;
1168
1169 if (ap->flags & ATA_FLAG_MMIO)
1170 writeb(ap->ctl, (void __iomem *) ioaddr->ctl_addr);
1171 else
1172 outb(ap->ctl, ioaddr->ctl_addr);
1173 tmp = ata_wait_idle(ap);
1174
1175 ap->ops->irq_clear(ap);
1176
1177 return tmp;
1178}
1179
1180
1181/**
1182 * ata_irq_ack - Acknowledge a device interrupt. 1161 * ata_irq_ack - Acknowledge a device interrupt.
1183 * @ap: Port on which interrupts are enabled. 1162 * @ap: Port on which interrupts are enabled.
1184 * 1163 *
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index aa50d89eacd7..246de1d84a26 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -23,7 +23,7 @@ struct svc_rqst;
23 * This is the set of functions for lockd->nfsd communication 23 * This is the set of functions for lockd->nfsd communication
24 */ 24 */
25struct nlmsvc_binding { 25struct nlmsvc_binding {
26 u32 (*fopen)(struct svc_rqst *, 26 __be32 (*fopen)(struct svc_rqst *,
27 struct nfs_fh *, 27 struct nfs_fh *,
28 struct file **); 28 struct file **);
29 void (*fclose)(struct file *); 29 void (*fclose)(struct file *);
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 862d9730a60d..ac25b5649c59 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -164,14 +164,12 @@ void nlmclnt_next_cookie(struct nlm_cookie *);
164 */ 164 */
165struct nlm_host * nlmclnt_lookup_host(const struct sockaddr_in *, int, int, const char *, int); 165struct nlm_host * nlmclnt_lookup_host(const struct sockaddr_in *, int, int, const char *, int);
166struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *, const char *, int); 166struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *, const char *, int);
167struct nlm_host * nlm_lookup_host(int server, const struct sockaddr_in *, int, int, const char *, int);
168struct rpc_clnt * nlm_bind_host(struct nlm_host *); 167struct rpc_clnt * nlm_bind_host(struct nlm_host *);
169void nlm_rebind_host(struct nlm_host *); 168void nlm_rebind_host(struct nlm_host *);
170struct nlm_host * nlm_get_host(struct nlm_host *); 169struct nlm_host * nlm_get_host(struct nlm_host *);
171void nlm_release_host(struct nlm_host *); 170void nlm_release_host(struct nlm_host *);
172void nlm_shutdown_hosts(void); 171void nlm_shutdown_hosts(void);
173extern void nlm_host_rebooted(const struct sockaddr_in *, const char *, int, u32); 172extern void nlm_host_rebooted(const struct sockaddr_in *, const char *, int, u32);
174struct nsm_handle *nsm_find(const struct sockaddr_in *, const char *, int);
175void nsm_release(struct nsm_handle *); 173void nsm_release(struct nsm_handle *);
176 174
177 175
@@ -193,7 +191,7 @@ __be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
193unsigned long nlmsvc_retry_blocked(void); 191unsigned long nlmsvc_retry_blocked(void);
194void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, 192void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
195 nlm_host_match_fn_t match); 193 nlm_host_match_fn_t match);
196void nlmsvc_grant_reply(struct nlm_cookie *, u32); 194void nlmsvc_grant_reply(struct nlm_cookie *, __be32);
197 195
198/* 196/*
199 * File handling for the server personality 197 * File handling for the server personality
@@ -208,7 +206,7 @@ void nlmsvc_invalidate_all(void);
208static __inline__ struct inode * 206static __inline__ struct inode *
209nlmsvc_file_inode(struct nlm_file *file) 207nlmsvc_file_inode(struct nlm_file *file)
210{ 208{
211 return file->f_file->f_dentry->d_inode; 209 return file->f_file->f_path.dentry->d_inode;
212} 210}
213 211
214/* 212/*
diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h
index fc61d40964da..22a645828f26 100644
--- a/include/linux/lockd/sm_inter.h
+++ b/include/linux/lockd/sm_inter.h
@@ -24,7 +24,7 @@
24 * Arguments for all calls to statd 24 * Arguments for all calls to statd
25 */ 25 */
26struct nsm_args { 26struct nsm_args {
27 u32 addr; /* remote address */ 27 __be32 addr; /* remote address */
28 u32 prog; /* RPC callback info */ 28 u32 prog; /* RPC callback info */
29 u32 vers; 29 u32 vers;
30 u32 proc; 30 u32 proc;
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h
index 29e7d9fc9dad..83a1f9f6237b 100644
--- a/include/linux/lockd/xdr.h
+++ b/include/linux/lockd/xdr.h
@@ -69,7 +69,7 @@ typedef struct nlm_args nlm_args;
69 */ 69 */
70struct nlm_res { 70struct nlm_res {
71 struct nlm_cookie cookie; 71 struct nlm_cookie cookie;
72 u32 status; 72 __be32 status;
73 struct nlm_lock lock; 73 struct nlm_lock lock;
74}; 74};
75 75
@@ -80,9 +80,9 @@ struct nlm_reboot {
80 char * mon; 80 char * mon;
81 int len; 81 int len;
82 u32 state; 82 u32 state;
83 u32 addr; 83 __be32 addr;
84 u32 vers; 84 __be32 vers;
85 u32 proto; 85 __be32 proto;
86}; 86};
87 87
88/* 88/*
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 819f08f1310d..ea097dddc44f 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -193,7 +193,6 @@ extern void lockdep_free_key_range(void *start, unsigned long size);
193 193
194extern void lockdep_off(void); 194extern void lockdep_off(void);
195extern void lockdep_on(void); 195extern void lockdep_on(void);
196extern int lockdep_internal(void);
197 196
198/* 197/*
199 * These methods are used by specific locking variants (spinlocks, 198 * These methods are used by specific locking variants (spinlocks,
@@ -243,6 +242,8 @@ extern void lock_release(struct lockdep_map *lock, int nested,
243 242
244# define INIT_LOCKDEP .lockdep_recursion = 0, 243# define INIT_LOCKDEP .lockdep_recursion = 0,
245 244
245#define lockdep_depth(tsk) ((tsk)->lockdep_depth)
246
246#else /* !LOCKDEP */ 247#else /* !LOCKDEP */
247 248
248static inline void lockdep_off(void) 249static inline void lockdep_off(void)
@@ -253,11 +254,6 @@ static inline void lockdep_on(void)
253{ 254{
254} 255}
255 256
256static inline int lockdep_internal(void)
257{
258 return 0;
259}
260
261# define lock_acquire(l, s, t, r, c, i) do { } while (0) 257# define lock_acquire(l, s, t, r, c, i) do { } while (0)
262# define lock_release(l, n, i) do { } while (0) 258# define lock_release(l, n, i) do { } while (0)
263# define lockdep_init() do { } while (0) 259# define lockdep_init() do { } while (0)
@@ -277,20 +273,33 @@ static inline int lockdep_internal(void)
277 * The class key takes no space if lockdep is disabled: 273 * The class key takes no space if lockdep is disabled:
278 */ 274 */
279struct lock_class_key { }; 275struct lock_class_key { };
276
277#define lockdep_depth(tsk) (0)
278
280#endif /* !LOCKDEP */ 279#endif /* !LOCKDEP */
281 280
282#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS) 281#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
283extern void early_init_irq_lock_class(void); 282extern void early_init_irq_lock_class(void);
284#else 283#else
285# define early_init_irq_lock_class() do { } while (0) 284static inline void early_init_irq_lock_class(void)
285{
286}
286#endif 287#endif
287 288
288#ifdef CONFIG_TRACE_IRQFLAGS 289#ifdef CONFIG_TRACE_IRQFLAGS
289extern void early_boot_irqs_off(void); 290extern void early_boot_irqs_off(void);
290extern void early_boot_irqs_on(void); 291extern void early_boot_irqs_on(void);
292extern void print_irqtrace_events(struct task_struct *curr);
291#else 293#else
292# define early_boot_irqs_off() do { } while (0) 294static inline void early_boot_irqs_off(void)
293# define early_boot_irqs_on() do { } while (0) 295{
296}
297static inline void early_boot_irqs_on(void)
298{
299}
300static inline void print_irqtrace_events(struct task_struct *curr)
301{
302}
294#endif 303#endif
295 304
296/* 305/*
diff --git a/include/linux/log2.h b/include/linux/log2.h
new file mode 100644
index 000000000000..d02e1a547a7e
--- /dev/null
+++ b/include/linux/log2.h
@@ -0,0 +1,157 @@
1/* Integer base 2 logarithm calculation
2 *
3 * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef _LINUX_LOG2_H
13#define _LINUX_LOG2_H
14
15#include <linux/types.h>
16#include <linux/bitops.h>
17
18/*
19 * deal with unrepresentable constant logarithms
20 */
21extern __attribute__((const, noreturn))
22int ____ilog2_NaN(void);
23
24/*
25 * non-constant log of base 2 calculators
26 * - the arch may override these in asm/bitops.h if they can be implemented
27 * more efficiently than using fls() and fls64()
28 * - the arch is not required to handle n==0 if implementing the fallback
29 */
30#ifndef CONFIG_ARCH_HAS_ILOG2_U32
31static inline __attribute__((const))
32int __ilog2_u32(u32 n)
33{
34 return fls(n) - 1;
35}
36#endif
37
38#ifndef CONFIG_ARCH_HAS_ILOG2_U64
39static inline __attribute__((const))
40int __ilog2_u64(u64 n)
41{
42 return fls64(n) - 1;
43}
44#endif
45
46/*
47 * round up to nearest power of two
48 */
49static inline __attribute__((const))
50unsigned long __roundup_pow_of_two(unsigned long n)
51{
52 return 1UL << fls_long(n - 1);
53}
54
55/**
56 * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value
57 * @n - parameter
58 *
59 * constant-capable log of base 2 calculation
60 * - this can be used to initialise global variables from constant data, hence
61 * the massive ternary operator construction
62 *
63 * selects the appropriately-sized optimised version depending on sizeof(n)
64 */
65#define ilog2(n) \
66( \
67 __builtin_constant_p(n) ? ( \
68 (n) < 1 ? ____ilog2_NaN() : \
69 (n) & (1ULL << 63) ? 63 : \
70 (n) & (1ULL << 62) ? 62 : \
71 (n) & (1ULL << 61) ? 61 : \
72 (n) & (1ULL << 60) ? 60 : \
73 (n) & (1ULL << 59) ? 59 : \
74 (n) & (1ULL << 58) ? 58 : \
75 (n) & (1ULL << 57) ? 57 : \
76 (n) & (1ULL << 56) ? 56 : \
77 (n) & (1ULL << 55) ? 55 : \
78 (n) & (1ULL << 54) ? 54 : \
79 (n) & (1ULL << 53) ? 53 : \
80 (n) & (1ULL << 52) ? 52 : \
81 (n) & (1ULL << 51) ? 51 : \
82 (n) & (1ULL << 50) ? 50 : \
83 (n) & (1ULL << 49) ? 49 : \
84 (n) & (1ULL << 48) ? 48 : \
85 (n) & (1ULL << 47) ? 47 : \
86 (n) & (1ULL << 46) ? 46 : \
87 (n) & (1ULL << 45) ? 45 : \
88 (n) & (1ULL << 44) ? 44 : \
89 (n) & (1ULL << 43) ? 43 : \
90 (n) & (1ULL << 42) ? 42 : \
91 (n) & (1ULL << 41) ? 41 : \
92 (n) & (1ULL << 40) ? 40 : \
93 (n) & (1ULL << 39) ? 39 : \
94 (n) & (1ULL << 38) ? 38 : \
95 (n) & (1ULL << 37) ? 37 : \
96 (n) & (1ULL << 36) ? 36 : \
97 (n) & (1ULL << 35) ? 35 : \
98 (n) & (1ULL << 34) ? 34 : \
99 (n) & (1ULL << 33) ? 33 : \
100 (n) & (1ULL << 32) ? 32 : \
101 (n) & (1ULL << 31) ? 31 : \
102 (n) & (1ULL << 30) ? 30 : \
103 (n) & (1ULL << 29) ? 29 : \
104 (n) & (1ULL << 28) ? 28 : \
105 (n) & (1ULL << 27) ? 27 : \
106 (n) & (1ULL << 26) ? 26 : \
107 (n) & (1ULL << 25) ? 25 : \
108 (n) & (1ULL << 24) ? 24 : \
109 (n) & (1ULL << 23) ? 23 : \
110 (n) & (1ULL << 22) ? 22 : \
111 (n) & (1ULL << 21) ? 21 : \
112 (n) & (1ULL << 20) ? 20 : \
113 (n) & (1ULL << 19) ? 19 : \
114 (n) & (1ULL << 18) ? 18 : \
115 (n) & (1ULL << 17) ? 17 : \
116 (n) & (1ULL << 16) ? 16 : \
117 (n) & (1ULL << 15) ? 15 : \
118 (n) & (1ULL << 14) ? 14 : \
119 (n) & (1ULL << 13) ? 13 : \
120 (n) & (1ULL << 12) ? 12 : \
121 (n) & (1ULL << 11) ? 11 : \
122 (n) & (1ULL << 10) ? 10 : \
123 (n) & (1ULL << 9) ? 9 : \
124 (n) & (1ULL << 8) ? 8 : \
125 (n) & (1ULL << 7) ? 7 : \
126 (n) & (1ULL << 6) ? 6 : \
127 (n) & (1ULL << 5) ? 5 : \
128 (n) & (1ULL << 4) ? 4 : \
129 (n) & (1ULL << 3) ? 3 : \
130 (n) & (1ULL << 2) ? 2 : \
131 (n) & (1ULL << 1) ? 1 : \
132 (n) & (1ULL << 0) ? 0 : \
133 ____ilog2_NaN() \
134 ) : \
135 (sizeof(n) <= 4) ? \
136 __ilog2_u32(n) : \
137 __ilog2_u64(n) \
138 )
139
140/**
141 * roundup_pow_of_two - round the given value up to nearest power of two
142 * @n - parameter
143 *
144 * round the given balue up to the nearest power of two
145 * - the result is undefined when n == 0
146 * - this can be used to initialise global variables from constant data
147 */
148#define roundup_pow_of_two(n) \
149( \
150 __builtin_constant_p(n) ? ( \
151 (n == 1) ? 0 : \
152 (1UL << (ilog2((n) - 1) + 1)) \
153 ) : \
154 __roundup_pow_of_two(n) \
155 )
156
157#endif /* _LINUX_LOG2_H */
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 156c40fc664e..b78bbf42135a 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -3,6 +3,7 @@
3 3
4#define ADFS_SUPER_MAGIC 0xadf5 4#define ADFS_SUPER_MAGIC 0xadf5
5#define AFFS_SUPER_MAGIC 0xadff 5#define AFFS_SUPER_MAGIC 0xadff
6#define AFS_SUPER_MAGIC 0x5346414F
6#define AUTOFS_SUPER_MAGIC 0x0187 7#define AUTOFS_SUPER_MAGIC 0x0187
7#define CODA_SUPER_MAGIC 0x73757245 8#define CODA_SUPER_MAGIC 0x73757245
8#define EFS_SUPER_MAGIC 0x414A53 9#define EFS_SUPER_MAGIC 0x414A53
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index b03cfb91e228..326da7d500c7 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -31,15 +31,14 @@
31#define HPET_MINOR 228 31#define HPET_MINOR 228
32 32
33struct device; 33struct device;
34struct class_device;
35 34
36struct miscdevice { 35struct miscdevice {
37 int minor; 36 int minor;
38 const char *name; 37 const char *name;
39 const struct file_operations *fops; 38 const struct file_operations *fops;
40 struct list_head list; 39 struct list_head list;
41 struct device *dev; 40 struct device *parent;
42 struct class_device *class; 41 struct device *this_device;
43}; 42};
44 43
45extern int misc_register(struct miscdevice * misc); 44extern int misc_register(struct miscdevice * misc);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d538de901965..76912231af41 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -114,6 +114,8 @@ struct vm_area_struct {
114#endif 114#endif
115}; 115};
116 116
117extern struct kmem_cache *vm_area_cachep;
118
117/* 119/*
118 * This struct defines the per-mm list of VMAs for uClinux. If CONFIG_MMU is 120 * This struct defines the per-mm list of VMAs for uClinux. If CONFIG_MMU is
119 * disabled, then there's a single shared list of VMAs maintained by the 121 * disabled, then there's a single shared list of VMAs maintained by the
@@ -294,6 +296,24 @@ void put_pages_list(struct list_head *pages);
294void split_page(struct page *page, unsigned int order); 296void split_page(struct page *page, unsigned int order);
295 297
296/* 298/*
299 * Compound pages have a destructor function. Provide a
300 * prototype for that function and accessor functions.
301 * These are _only_ valid on the head of a PG_compound page.
302 */
303typedef void compound_page_dtor(struct page *);
304
305static inline void set_compound_page_dtor(struct page *page,
306 compound_page_dtor *dtor)
307{
308 page[1].lru.next = (void *)dtor;
309}
310
311static inline compound_page_dtor *get_compound_page_dtor(struct page *page)
312{
313 return (compound_page_dtor *)page[1].lru.next;
314}
315
316/*
297 * Multiple processes may "see" the same page. E.g. for untouched 317 * Multiple processes may "see" the same page. E.g. for untouched
298 * mappings of /dev/null, all processes see the same page full of 318 * mappings of /dev/null, all processes see the same page full of
299 * zeroes, and text pages of executables and shared libraries have 319 * zeroes, and text pages of executables and shared libraries have
@@ -396,7 +416,9 @@ void split_page(struct page *page, unsigned int order);
396 * We are going to use the flags for the page to node mapping if its in 416 * We are going to use the flags for the page to node mapping if its in
397 * there. This includes the case where there is no node, so it is implicit. 417 * there. This includes the case where there is no node, so it is implicit.
398 */ 418 */
399#define FLAGS_HAS_NODE (NODES_WIDTH > 0 || NODES_SHIFT == 0) 419#if !(NODES_WIDTH > 0 || NODES_SHIFT == 0)
420#define NODE_NOT_IN_PAGE_FLAGS
421#endif
400 422
401#ifndef PFN_SECTION_SHIFT 423#ifndef PFN_SECTION_SHIFT
402#define PFN_SECTION_SHIFT 0 424#define PFN_SECTION_SHIFT 0
@@ -411,13 +433,18 @@ void split_page(struct page *page, unsigned int order);
411#define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) 433#define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0))
412#define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) 434#define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0))
413 435
414/* NODE:ZONE or SECTION:ZONE is used to lookup the zone from a page. */ 436/* NODE:ZONE or SECTION:ZONE is used to ID a zone for the buddy allcator */
415#if FLAGS_HAS_NODE 437#ifdef NODE_NOT_IN_PAGEFLAGS
416#define ZONETABLE_SHIFT (NODES_SHIFT + ZONES_SHIFT) 438#define ZONEID_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT)
439#else
440#define ZONEID_SHIFT (NODES_SHIFT + ZONES_SHIFT)
441#endif
442
443#if ZONES_WIDTH > 0
444#define ZONEID_PGSHIFT ZONES_PGSHIFT
417#else 445#else
418#define ZONETABLE_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) 446#define ZONEID_PGSHIFT NODES_PGOFF
419#endif 447#endif
420#define ZONETABLE_PGSHIFT ZONES_PGSHIFT
421 448
422#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED 449#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED
423#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED 450#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED
@@ -426,26 +453,28 @@ void split_page(struct page *page, unsigned int order);
426#define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) 453#define ZONES_MASK ((1UL << ZONES_WIDTH) - 1)
427#define NODES_MASK ((1UL << NODES_WIDTH) - 1) 454#define NODES_MASK ((1UL << NODES_WIDTH) - 1)
428#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) 455#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
429#define ZONETABLE_MASK ((1UL << ZONETABLE_SHIFT) - 1) 456#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1)
430 457
431static inline enum zone_type page_zonenum(struct page *page) 458static inline enum zone_type page_zonenum(struct page *page)
432{ 459{
433 return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; 460 return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
434} 461}
435 462
436struct zone; 463/*
437extern struct zone *zone_table[]; 464 * The identification function is only used by the buddy allocator for
438 465 * determining if two pages could be buddies. We are not really
466 * identifying a zone since we could be using a the section number
467 * id if we have not node id available in page flags.
468 * We guarantee only that it will return the same value for two
469 * combinable pages in a zone.
470 */
439static inline int page_zone_id(struct page *page) 471static inline int page_zone_id(struct page *page)
440{ 472{
441 return (page->flags >> ZONETABLE_PGSHIFT) & ZONETABLE_MASK; 473 BUILD_BUG_ON(ZONEID_PGSHIFT == 0 && ZONEID_MASK);
442} 474 return (page->flags >> ZONEID_PGSHIFT) & ZONEID_MASK;
443static inline struct zone *page_zone(struct page *page)
444{
445 return zone_table[page_zone_id(page)];
446} 475}
447 476
448static inline unsigned long zone_to_nid(struct zone *zone) 477static inline int zone_to_nid(struct zone *zone)
449{ 478{
450#ifdef CONFIG_NUMA 479#ifdef CONFIG_NUMA
451 return zone->node; 480 return zone->node;
@@ -454,13 +483,20 @@ static inline unsigned long zone_to_nid(struct zone *zone)
454#endif 483#endif
455} 484}
456 485
457static inline unsigned long page_to_nid(struct page *page) 486#ifdef NODE_NOT_IN_PAGE_FLAGS
487extern int page_to_nid(struct page *page);
488#else
489static inline int page_to_nid(struct page *page)
490{
491 return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
492}
493#endif
494
495static inline struct zone *page_zone(struct page *page)
458{ 496{
459 if (FLAGS_HAS_NODE) 497 return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)];
460 return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
461 else
462 return zone_to_nid(page_zone(page));
463} 498}
499
464static inline unsigned long page_to_section(struct page *page) 500static inline unsigned long page_to_section(struct page *page)
465{ 501{
466 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; 502 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
@@ -477,6 +513,7 @@ static inline void set_page_node(struct page *page, unsigned long node)
477 page->flags &= ~(NODES_MASK << NODES_PGSHIFT); 513 page->flags &= ~(NODES_MASK << NODES_PGSHIFT);
478 page->flags |= (node & NODES_MASK) << NODES_PGSHIFT; 514 page->flags |= (node & NODES_MASK) << NODES_PGSHIFT;
479} 515}
516
480static inline void set_page_section(struct page *page, unsigned long section) 517static inline void set_page_section(struct page *page, unsigned long section)
481{ 518{
482 page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT); 519 page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT);
@@ -941,14 +978,13 @@ extern int early_pfn_to_nid(unsigned long pfn);
941#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ 978#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
942#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ 979#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
943extern void set_dma_reserve(unsigned long new_dma_reserve); 980extern void set_dma_reserve(unsigned long new_dma_reserve);
944extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); 981extern void memmap_init_zone(unsigned long, int, unsigned long,
982 unsigned long, enum memmap_context);
945extern void setup_per_zone_pages_min(void); 983extern void setup_per_zone_pages_min(void);
946extern void mem_init(void); 984extern void mem_init(void);
947extern void show_mem(void); 985extern void show_mem(void);
948extern void si_meminfo(struct sysinfo * val); 986extern void si_meminfo(struct sysinfo * val);
949extern void si_meminfo_node(struct sysinfo *val, int nid); 987extern void si_meminfo_node(struct sysinfo *val, int nid);
950extern void zonetable_add(struct zone *zone, int nid, enum zone_type zid,
951 unsigned long pfn, unsigned long size);
952 988
953#ifdef CONFIG_NUMA 989#ifdef CONFIG_NUMA
954extern void setup_per_cpu_pageset(void); 990extern void setup_per_cpu_pageset(void);
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 991a37382a22..d0e6a5497614 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -39,6 +39,10 @@ struct mmc_csd {
39 write_misalign:1; 39 write_misalign:1;
40}; 40};
41 41
42struct mmc_ext_csd {
43 unsigned int hs_max_dtr;
44};
45
42struct sd_scr { 46struct sd_scr {
43 unsigned char sda_vsn; 47 unsigned char sda_vsn;
44 unsigned char bus_widths; 48 unsigned char bus_widths;
@@ -46,6 +50,10 @@ struct sd_scr {
46#define SD_SCR_BUS_WIDTH_4 (1<<2) 50#define SD_SCR_BUS_WIDTH_4 (1<<2)
47}; 51};
48 52
53struct sd_switch_caps {
54 unsigned int hs_max_dtr;
55};
56
49struct mmc_host; 57struct mmc_host;
50 58
51/* 59/*
@@ -62,12 +70,15 @@ struct mmc_card {
62#define MMC_STATE_BAD (1<<2) /* unrecognised device */ 70#define MMC_STATE_BAD (1<<2) /* unrecognised device */
63#define MMC_STATE_SDCARD (1<<3) /* is an SD card */ 71#define MMC_STATE_SDCARD (1<<3) /* is an SD card */
64#define MMC_STATE_READONLY (1<<4) /* card is read-only */ 72#define MMC_STATE_READONLY (1<<4) /* card is read-only */
73#define MMC_STATE_HIGHSPEED (1<<5) /* card is in high speed mode */
65 u32 raw_cid[4]; /* raw card CID */ 74 u32 raw_cid[4]; /* raw card CID */
66 u32 raw_csd[4]; /* raw card CSD */ 75 u32 raw_csd[4]; /* raw card CSD */
67 u32 raw_scr[2]; /* raw card SCR */ 76 u32 raw_scr[2]; /* raw card SCR */
68 struct mmc_cid cid; /* card identification */ 77 struct mmc_cid cid; /* card identification */
69 struct mmc_csd csd; /* card specific */ 78 struct mmc_csd csd; /* card specific */
79 struct mmc_ext_csd ext_csd; /* mmc v4 extended card specific */
70 struct sd_scr scr; /* extra SD information */ 80 struct sd_scr scr; /* extra SD information */
81 struct sd_switch_caps sw_caps; /* switch (CMD6) caps */
71}; 82};
72 83
73#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) 84#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
@@ -75,12 +86,14 @@ struct mmc_card {
75#define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) 86#define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD)
76#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD) 87#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD)
77#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) 88#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
89#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED)
78 90
79#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) 91#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
80#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) 92#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD)
81#define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) 93#define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD)
82#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD) 94#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD)
83#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) 95#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
96#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
84 97
85#define mmc_card_name(c) ((c)->cid.prod_name) 98#define mmc_card_name(c) ((c)->cid.prod_name)
86#define mmc_card_id(c) ((c)->dev.bus_id) 99#define mmc_card_id(c) ((c)->dev.bus_id)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 587264a58d56..c15ae1986b98 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -74,8 +74,8 @@ struct mmc_card;
74struct device; 74struct device;
75 75
76struct mmc_host { 76struct mmc_host {
77 struct device *dev; 77 struct device *parent;
78 struct class_device class_dev; 78 struct device class_dev;
79 int index; 79 int index;
80 const struct mmc_host_ops *ops; 80 const struct mmc_host_ops *ops;
81 unsigned int f_min; 81 unsigned int f_min;
@@ -110,7 +110,7 @@ struct mmc_host {
110 struct mmc_card *card_busy; /* the MMC card claiming host */ 110 struct mmc_card *card_busy; /* the MMC card claiming host */
111 struct mmc_card *card_selected; /* the selected MMC card */ 111 struct mmc_card *card_selected; /* the selected MMC card */
112 112
113 struct work_struct detect; 113 struct delayed_work detect;
114 114
115 unsigned long private[0] ____cacheline_aligned; 115 unsigned long private[0] ____cacheline_aligned;
116}; 116};
@@ -125,8 +125,8 @@ static inline void *mmc_priv(struct mmc_host *host)
125 return (void *)host->private; 125 return (void *)host->private;
126} 126}
127 127
128#define mmc_dev(x) ((x)->dev) 128#define mmc_dev(x) ((x)->parent)
129#define mmc_hostname(x) ((x)->class_dev.class_id) 129#define mmc_hostname(x) ((x)->class_dev.bus_id)
130 130
131extern int mmc_suspend_host(struct mmc_host *, pm_message_t); 131extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
132extern int mmc_resume_host(struct mmc_host *); 132extern int mmc_resume_host(struct mmc_host *);
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h
index 08dec8d9e703..2dce60c43f4b 100644
--- a/include/linux/mmc/protocol.h
+++ b/include/linux/mmc/protocol.h
@@ -25,14 +25,16 @@
25#ifndef MMC_MMC_PROTOCOL_H 25#ifndef MMC_MMC_PROTOCOL_H
26#define MMC_MMC_PROTOCOL_H 26#define MMC_MMC_PROTOCOL_H
27 27
28/* Standard MMC commands (3.1) type argument response */ 28/* Standard MMC commands (4.1) type argument response */
29 /* class 1 */ 29 /* class 1 */
30#define MMC_GO_IDLE_STATE 0 /* bc */ 30#define MMC_GO_IDLE_STATE 0 /* bc */
31#define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ 31#define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */
32#define MMC_ALL_SEND_CID 2 /* bcr R2 */ 32#define MMC_ALL_SEND_CID 2 /* bcr R2 */
33#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ 33#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */
34#define MMC_SET_DSR 4 /* bc [31:16] RCA */ 34#define MMC_SET_DSR 4 /* bc [31:16] RCA */
35#define MMC_SWITCH 6 /* ac [31:0] See below R1b */
35#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ 36#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */
37#define MMC_SEND_EXT_CSD 8 /* adtc R1 */
36#define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ 38#define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */
37#define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ 39#define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */
38#define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ 40#define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */
@@ -80,6 +82,7 @@
80 /* class 8 */ 82 /* class 8 */
81/* This is basically the same command as for MMC with some quirks. */ 83/* This is basically the same command as for MMC with some quirks. */
82#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ 84#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
85#define SD_SWITCH 6 /* adtc [31:0] See below R1 */
83 86
84 /* Application commands */ 87 /* Application commands */
85#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ 88#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */
@@ -88,6 +91,30 @@
88#define SD_APP_SEND_SCR 51 /* adtc R1 */ 91#define SD_APP_SEND_SCR 51 /* adtc R1 */
89 92
90/* 93/*
94 * MMC_SWITCH argument format:
95 *
96 * [31:26] Always 0
97 * [25:24] Access Mode
98 * [23:16] Location of target Byte in EXT_CSD
99 * [15:08] Value Byte
100 * [07:03] Always 0
101 * [02:00] Command Set
102 */
103
104/*
105 * SD_SWITCH argument format:
106 *
107 * [31] Check (0) or switch (1)
108 * [30:24] Reserved (0)
109 * [23:20] Function group 6
110 * [19:16] Function group 5
111 * [15:12] Function group 4
112 * [11:8] Function group 3
113 * [7:4] Function group 2
114 * [3:0] Function group 1
115 */
116
117/*
91 MMC status in R1 118 MMC status in R1
92 Type 119 Type
93 e : error bit 120 e : error bit
@@ -230,13 +257,54 @@ struct _mmc_csd {
230 257
231#define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */ 258#define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */
232#define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */ 259#define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */
233#define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 */ 260#define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 - 3.2 - 3.31 - 4.0 - 4.1 */
261#define CSD_STRUCT_EXT_CSD 3 /* Version is coded in CSD_STRUCTURE in EXT_CSD */
234 262
235#define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */ 263#define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */
236#define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */ 264#define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */
237#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ 265#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */
238#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */ 266#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 - 3.2 - 3.31 */
267#define CSD_SPEC_VER_4 4 /* Implements system specification 4.0 - 4.1 */
268
269/*
270 * EXT_CSD fields
271 */
272
273#define EXT_CSD_BUS_WIDTH 183 /* R/W */
274#define EXT_CSD_HS_TIMING 185 /* R/W */
275#define EXT_CSD_CARD_TYPE 196 /* RO */
276
277/*
278 * EXT_CSD field definitions
279 */
280
281#define EXT_CSD_CMD_SET_NORMAL (1<<0)
282#define EXT_CSD_CMD_SET_SECURE (1<<1)
283#define EXT_CSD_CMD_SET_CPSECURE (1<<2)
284
285#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */
286#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */
287
288#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */
289#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
290#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */
291
292/*
293 * MMC_SWITCH access modes
294 */
295
296#define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */
297#define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits which are 1 in value */
298#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */
299#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */
300
301/*
302 * SCR field definitions
303 */
239 304
305#define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */
306#define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */
307#define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */
240 308
241/* 309/*
242 * SD bus widths 310 * SD bus widths
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index e06683e2bea3..b262f47961fb 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -278,7 +278,7 @@ struct zone {
278 /* 278 /*
279 * rarely used fields: 279 * rarely used fields:
280 */ 280 */
281 char *name; 281 const char *name;
282} ____cacheline_internodealigned_in_smp; 282} ____cacheline_internodealigned_in_smp;
283 283
284/* 284/*
@@ -288,19 +288,94 @@ struct zone {
288 */ 288 */
289#define DEF_PRIORITY 12 289#define DEF_PRIORITY 12
290 290
291/* Maximum number of zones on a zonelist */
292#define MAX_ZONES_PER_ZONELIST (MAX_NUMNODES * MAX_NR_ZONES)
293
294#ifdef CONFIG_NUMA
295/*
296 * We cache key information from each zonelist for smaller cache
297 * footprint when scanning for free pages in get_page_from_freelist().
298 *
299 * 1) The BITMAP fullzones tracks which zones in a zonelist have come
300 * up short of free memory since the last time (last_fullzone_zap)
301 * we zero'd fullzones.
302 * 2) The array z_to_n[] maps each zone in the zonelist to its node
303 * id, so that we can efficiently evaluate whether that node is
304 * set in the current tasks mems_allowed.
305 *
306 * Both fullzones and z_to_n[] are one-to-one with the zonelist,
307 * indexed by a zones offset in the zonelist zones[] array.
308 *
309 * The get_page_from_freelist() routine does two scans. During the
310 * first scan, we skip zones whose corresponding bit in 'fullzones'
311 * is set or whose corresponding node in current->mems_allowed (which
312 * comes from cpusets) is not set. During the second scan, we bypass
313 * this zonelist_cache, to ensure we look methodically at each zone.
314 *
315 * Once per second, we zero out (zap) fullzones, forcing us to
316 * reconsider nodes that might have regained more free memory.
317 * The field last_full_zap is the time we last zapped fullzones.
318 *
319 * This mechanism reduces the amount of time we waste repeatedly
320 * reexaming zones for free memory when they just came up low on
321 * memory momentarilly ago.
322 *
323 * The zonelist_cache struct members logically belong in struct
324 * zonelist. However, the mempolicy zonelists constructed for
325 * MPOL_BIND are intentionally variable length (and usually much
326 * shorter). A general purpose mechanism for handling structs with
327 * multiple variable length members is more mechanism than we want
328 * here. We resort to some special case hackery instead.
329 *
330 * The MPOL_BIND zonelists don't need this zonelist_cache (in good
331 * part because they are shorter), so we put the fixed length stuff
332 * at the front of the zonelist struct, ending in a variable length
333 * zones[], as is needed by MPOL_BIND.
334 *
335 * Then we put the optional zonelist cache on the end of the zonelist
336 * struct. This optional stuff is found by a 'zlcache_ptr' pointer in
337 * the fixed length portion at the front of the struct. This pointer
338 * both enables us to find the zonelist cache, and in the case of
339 * MPOL_BIND zonelists, (which will just set the zlcache_ptr to NULL)
340 * to know that the zonelist cache is not there.
341 *
342 * The end result is that struct zonelists come in two flavors:
343 * 1) The full, fixed length version, shown below, and
344 * 2) The custom zonelists for MPOL_BIND.
345 * The custom MPOL_BIND zonelists have a NULL zlcache_ptr and no zlcache.
346 *
347 * Even though there may be multiple CPU cores on a node modifying
348 * fullzones or last_full_zap in the same zonelist_cache at the same
349 * time, we don't lock it. This is just hint data - if it is wrong now
350 * and then, the allocator will still function, perhaps a bit slower.
351 */
352
353
354struct zonelist_cache {
355 unsigned short z_to_n[MAX_ZONES_PER_ZONELIST]; /* zone->nid */
356 DECLARE_BITMAP(fullzones, MAX_ZONES_PER_ZONELIST); /* zone full? */
357 unsigned long last_full_zap; /* when last zap'd (jiffies) */
358};
359#else
360struct zonelist_cache;
361#endif
362
291/* 363/*
292 * One allocation request operates on a zonelist. A zonelist 364 * One allocation request operates on a zonelist. A zonelist
293 * is a list of zones, the first one is the 'goal' of the 365 * is a list of zones, the first one is the 'goal' of the
294 * allocation, the other zones are fallback zones, in decreasing 366 * allocation, the other zones are fallback zones, in decreasing
295 * priority. 367 * priority.
296 * 368 *
297 * Right now a zonelist takes up less than a cacheline. We never 369 * If zlcache_ptr is not NULL, then it is just the address of zlcache,
298 * modify it apart from boot-up, and only a few indices are used, 370 * as explained above. If zlcache_ptr is NULL, there is no zlcache.
299 * so despite the zonelist table being relatively big, the cache
300 * footprint of this construct is very small.
301 */ 371 */
372
302struct zonelist { 373struct zonelist {
303 struct zone *zones[MAX_NUMNODES * MAX_NR_ZONES + 1]; // NULL delimited 374 struct zonelist_cache *zlcache_ptr; // NULL or &zlcache
375 struct zone *zones[MAX_ZONES_PER_ZONELIST + 1]; // NULL delimited
376#ifdef CONFIG_NUMA
377 struct zonelist_cache zlcache; // optional ...
378#endif
304}; 379};
305 380
306#ifdef CONFIG_ARCH_POPULATES_NODE_MAP 381#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
@@ -375,9 +450,13 @@ void build_all_zonelists(void);
375void wakeup_kswapd(struct zone *zone, int order); 450void wakeup_kswapd(struct zone *zone, int order);
376int zone_watermark_ok(struct zone *z, int order, unsigned long mark, 451int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
377 int classzone_idx, int alloc_flags); 452 int classzone_idx, int alloc_flags);
378 453enum memmap_context {
454 MEMMAP_EARLY,
455 MEMMAP_HOTPLUG,
456};
379extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, 457extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn,
380 unsigned long size); 458 unsigned long size,
459 enum memmap_context context);
381 460
382#ifdef CONFIG_HAVE_MEMORY_PRESENT 461#ifdef CONFIG_HAVE_MEMORY_PRESENT
383void memory_present(int nid, unsigned long start, unsigned long end); 462void memory_present(int nid, unsigned long start, unsigned long end);
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
new file mode 100644
index 000000000000..4af0b1fc282a
--- /dev/null
+++ b/include/linux/mnt_namespace.h
@@ -0,0 +1,42 @@
1#ifndef _NAMESPACE_H_
2#define _NAMESPACE_H_
3#ifdef __KERNEL__
4
5#include <linux/mount.h>
6#include <linux/sched.h>
7#include <linux/nsproxy.h>
8
9struct mnt_namespace {
10 atomic_t count;
11 struct vfsmount * root;
12 struct list_head list;
13 wait_queue_head_t poll;
14 int event;
15};
16
17extern int copy_mnt_ns(int, struct task_struct *);
18extern void __put_mnt_ns(struct mnt_namespace *ns);
19extern struct mnt_namespace *dup_mnt_ns(struct task_struct *,
20 struct fs_struct *);
21
22static inline void put_mnt_ns(struct mnt_namespace *ns)
23{
24 if (atomic_dec_and_lock(&ns->count, &vfsmount_lock))
25 /* releases vfsmount_lock */
26 __put_mnt_ns(ns);
27}
28
29static inline void exit_mnt_ns(struct task_struct *p)
30{
31 struct mnt_namespace *ns = p->nsproxy->mnt_ns;
32 if (ns)
33 put_mnt_ns(ns);
34}
35
36static inline void get_mnt_ns(struct mnt_namespace *ns)
37{
38 atomic_inc(&ns->count);
39}
40
41#endif
42#endif
diff --git a/include/linux/module.h b/include/linux/module.h
index d1d00ce8f4ed..10f771a49997 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -6,7 +6,6 @@
6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
7 * Rewritten again by Rusty Russell, 2002 7 * Rewritten again by Rusty Russell, 2002
8 */ 8 */
9#include <linux/sched.h>
10#include <linux/spinlock.h> 9#include <linux/spinlock.h>
11#include <linux/list.h> 10#include <linux/list.h>
12#include <linux/stat.h> 11#include <linux/stat.h>
@@ -264,6 +263,7 @@ struct module
264 struct module_attribute *modinfo_attrs; 263 struct module_attribute *modinfo_attrs;
265 const char *version; 264 const char *version;
266 const char *srcversion; 265 const char *srcversion;
266 struct kobject *drivers_dir;
267 267
268 /* Exported symbols */ 268 /* Exported symbols */
269 const struct kernel_symbol *syms; 269 const struct kernel_symbol *syms;
@@ -319,6 +319,13 @@ struct module
319 319
320 unsigned int taints; /* same bits as kernel:tainted */ 320 unsigned int taints; /* same bits as kernel:tainted */
321 321
322#ifdef CONFIG_GENERIC_BUG
323 /* Support for BUG */
324 struct list_head bug_list;
325 struct bug_entry *bug_table;
326 unsigned num_bugs;
327#endif
328
322#ifdef CONFIG_MODULE_UNLOAD 329#ifdef CONFIG_MODULE_UNLOAD
323 /* Reference counts */ 330 /* Reference counts */
324 struct module_ref ref[NR_CPUS]; 331 struct module_ref ref[NR_CPUS];
@@ -410,17 +417,7 @@ static inline int try_module_get(struct module *module)
410 return ret; 417 return ret;
411} 418}
412 419
413static inline void module_put(struct module *module) 420extern void module_put(struct module *module);
414{
415 if (module) {
416 unsigned int cpu = get_cpu();
417 local_dec(&module->ref[cpu].count);
418 /* Maybe they're waiting for us to drop reference? */
419 if (unlikely(!module_is_live(module)))
420 wake_up_process(module->waiter);
421 put_cpu();
422 }
423}
424 421
425#else /*!CONFIG_MODULE_UNLOAD*/ 422#else /*!CONFIG_MODULE_UNLOAD*/
426static inline int try_module_get(struct module *module) 423static inline int try_module_get(struct module *module)
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 7c0c2c198f1f..4a189dadb160 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -63,6 +63,9 @@ struct kparam_array
63 not there, read bits mean it's readable, write bits mean it's 63 not there, read bits mean it's readable, write bits mean it's
64 writable. */ 64 writable. */
65#define __module_param_call(prefix, name, set, get, arg, perm) \ 65#define __module_param_call(prefix, name, set, get, arg, perm) \
66 /* Default value instead of permissions? */ \
67 static int __param_perm_check_##name __attribute__((unused)) = \
68 BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \
66 static char __param_str_##name[] = prefix #name; \ 69 static char __param_str_##name[] = prefix #name; \
67 static struct kernel_param const __param_##name \ 70 static struct kernel_param const __param_##name \
68 __attribute_used__ \ 71 __attribute_used__ \
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 403d1a97c512..1b7e178b0d84 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -20,13 +20,14 @@
20struct super_block; 20struct super_block;
21struct vfsmount; 21struct vfsmount;
22struct dentry; 22struct dentry;
23struct namespace; 23struct mnt_namespace;
24 24
25#define MNT_NOSUID 0x01 25#define MNT_NOSUID 0x01
26#define MNT_NODEV 0x02 26#define MNT_NODEV 0x02
27#define MNT_NOEXEC 0x04 27#define MNT_NOEXEC 0x04
28#define MNT_NOATIME 0x08 28#define MNT_NOATIME 0x08
29#define MNT_NODIRATIME 0x10 29#define MNT_NODIRATIME 0x10
30#define MNT_RELATIME 0x20
30 31
31#define MNT_SHRINKABLE 0x100 32#define MNT_SHRINKABLE 0x100
32 33
@@ -52,7 +53,7 @@ struct vfsmount {
52 struct list_head mnt_slave_list;/* list of slave mounts */ 53 struct list_head mnt_slave_list;/* list of slave mounts */
53 struct list_head mnt_slave; /* slave list entry */ 54 struct list_head mnt_slave; /* slave list entry */
54 struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ 55 struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */
55 struct namespace *mnt_namespace; /* containing namespace */ 56 struct mnt_namespace *mnt_ns; /* containing namespace */
56 int mnt_pinned; 57 int mnt_pinned;
57}; 58};
58 59
diff --git a/include/linux/mqueue.h b/include/linux/mqueue.h
index 8db9d75541a6..8b5a79615fbf 100644
--- a/include/linux/mqueue.h
+++ b/include/linux/mqueue.h
@@ -18,8 +18,6 @@
18#ifndef _LINUX_MQUEUE_H 18#ifndef _LINUX_MQUEUE_H
19#define _LINUX_MQUEUE_H 19#define _LINUX_MQUEUE_H
20 20
21#include <linux/types.h>
22
23#define MQ_PRIO_MAX 32768 21#define MQ_PRIO_MAX 32768
24/* per-uid limit of kernel memory used by mqueue, in bytes */ 22/* per-uid limit of kernel memory used by mqueue, in bytes */
25#define MQ_BYTES_MAX 819200 23#define MQ_BYTES_MAX 819200
diff --git a/include/linux/msg.h b/include/linux/msg.h
index acc7c174ff00..f1b60740d641 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -92,6 +92,12 @@ struct msg_queue {
92 struct list_head q_senders; 92 struct list_head q_senders;
93}; 93};
94 94
95/* Helper routines for sys_msgsnd and sys_msgrcv */
96extern long do_msgsnd(int msqid, long mtype, void __user *mtext,
97 size_t msgsz, int msgflg);
98extern long do_msgrcv(int msqid, long *pmtype, void __user *mtext,
99 size_t msgsz, long msgtyp, int msgflg);
100
95#endif /* __KERNEL__ */ 101#endif /* __KERNEL__ */
96 102
97#endif /* _LINUX_MSG_H */ 103#endif /* _LINUX_MSG_H */
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 27c48daa3183..a7544afd7582 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -94,7 +94,7 @@ do { \
94 94
95#define __MUTEX_INITIALIZER(lockname) \ 95#define __MUTEX_INITIALIZER(lockname) \
96 { .count = ATOMIC_INIT(1) \ 96 { .count = ATOMIC_INIT(1) \
97 , .wait_lock = SPIN_LOCK_UNLOCKED \ 97 , .wait_lock = __SPIN_LOCK_UNLOCKED(lockname.wait_lock) \
98 , .wait_list = LIST_HEAD_INIT(lockname.wait_list) \ 98 , .wait_list = LIST_HEAD_INIT(lockname.wait_list) \
99 __DEBUG_MUTEX_INITIALIZER(lockname) \ 99 __DEBUG_MUTEX_INITIALIZER(lockname) \
100 __DEP_MAP_MUTEX_INITIALIZER(lockname) } 100 __DEP_MAP_MUTEX_INITIALIZER(lockname) }
@@ -125,8 +125,10 @@ extern int fastcall mutex_lock_interruptible(struct mutex *lock);
125 125
126#ifdef CONFIG_DEBUG_LOCK_ALLOC 126#ifdef CONFIG_DEBUG_LOCK_ALLOC
127extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); 127extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
128extern int mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass);
128#else 129#else
129# define mutex_lock_nested(lock, subclass) mutex_lock(lock) 130# define mutex_lock_nested(lock, subclass) mutex_lock(lock)
131# define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
130#endif 132#endif
131 133
132/* 134/*
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index edfa012fad3a..aff25c000abf 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -724,7 +724,7 @@
724#define MV643XX_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port) (0x2470 + (port<<10)) 724#define MV643XX_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port) (0x2470 + (port<<10))
725#define MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port) (0x2474 + (port<<10)) 725#define MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port) (0x2474 + (port<<10))
726#define MV643XX_ETH_RX_MINIMAL_FRAME_SIZE_REG(port) (0x247c + (port<<10)) 726#define MV643XX_ETH_RX_MINIMAL_FRAME_SIZE_REG(port) (0x247c + (port<<10))
727#define MV643XX_ETH_RX_DISCARDED_FRAMES_COUNTER(port) (0x2484 + (port<<10) 727#define MV643XX_ETH_RX_DISCARDED_FRAMES_COUNTER(port) (0x2484 + (port<<10))
728#define MV643XX_ETH_PORT_DEBUG_0_REG(port) (0x248c + (port<<10)) 728#define MV643XX_ETH_PORT_DEBUG_0_REG(port) (0x248c + (port<<10))
729#define MV643XX_ETH_PORT_DEBUG_1_REG(port) (0x2490 + (port<<10)) 729#define MV643XX_ETH_PORT_DEBUG_1_REG(port) (0x2490 + (port<<10))
730#define MV643XX_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port) (0x2494 + (port<<10)) 730#define MV643XX_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port) (0x2494 + (port<<10))
@@ -1135,7 +1135,7 @@ struct mv64xxx_i2c_pdata {
1135#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_1 (1<<19) 1135#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_1 (1<<19)
1136#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_2 (1<<20) 1136#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_2 (1<<20)
1137#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_3 ((1<<20) | (1<<19)) 1137#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_3 ((1<<20) | (1<<19))
1138#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_4 ((1<<21) 1138#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_4 (1<<21)
1139#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_5 ((1<<21) | (1<<19)) 1139#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_5 ((1<<21) | (1<<19))
1140#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_6 ((1<<21) | (1<<20)) 1140#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_6 ((1<<21) | (1<<20))
1141#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_7 ((1<<21) | (1<<20) | (1<<19)) 1141#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_7 ((1<<21) | (1<<20) | (1<<19))
diff --git a/include/linux/n_r3964.h b/include/linux/n_r3964.h
index db4f3776978a..de24af79ebd3 100644
--- a/include/linux/n_r3964.h
+++ b/include/linux/n_r3964.h
@@ -116,7 +116,7 @@ struct r3964_message;
116 116
117struct r3964_client_info { 117struct r3964_client_info {
118 spinlock_t lock; 118 spinlock_t lock;
119 pid_t pid; 119 struct pid *pid;
120 unsigned int sig_flags; 120 unsigned int sig_flags;
121 121
122 struct r3964_client_info *next; 122 struct r3964_client_info *next;
diff --git a/include/linux/namei.h b/include/linux/namei.h
index f5f19606effb..d39a5a67e979 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -29,6 +29,11 @@ struct nameidata {
29 } intent; 29 } intent;
30}; 30};
31 31
32struct path {
33 struct vfsmount *mnt;
34 struct dentry *dentry;
35};
36
32/* 37/*
33 * Type of the last component on LOOKUP_PARENT 38 * Type of the last component on LOOKUP_PARENT
34 */ 39 */
diff --git a/include/linux/namespace.h b/include/linux/namespace.h
deleted file mode 100644
index d137009f0b2b..000000000000
--- a/include/linux/namespace.h
+++ /dev/null
@@ -1,42 +0,0 @@
1#ifndef _NAMESPACE_H_
2#define _NAMESPACE_H_
3#ifdef __KERNEL__
4
5#include <linux/mount.h>
6#include <linux/sched.h>
7#include <linux/nsproxy.h>
8
9struct namespace {
10 atomic_t count;
11 struct vfsmount * root;
12 struct list_head list;
13 wait_queue_head_t poll;
14 int event;
15};
16
17extern int copy_namespace(int, struct task_struct *);
18extern void __put_namespace(struct namespace *namespace);
19extern struct namespace *dup_namespace(struct task_struct *, struct fs_struct *);
20
21static inline void put_namespace(struct namespace *namespace)
22{
23 if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock))
24 /* releases vfsmount_lock */
25 __put_namespace(namespace);
26}
27
28static inline void exit_namespace(struct task_struct *p)
29{
30 struct namespace *namespace = p->nsproxy->namespace;
31 if (namespace) {
32 put_namespace(namespace);
33 }
34}
35
36static inline void get_namespace(struct namespace *namespace)
37{
38 atomic_inc(&namespace->count);
39}
40
41#endif
42#endif
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index d6b6dc09ad97..0f3e69302540 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -64,6 +64,7 @@ struct nbd_device {
64 struct gendisk *disk; 64 struct gendisk *disk;
65 int blksize; 65 int blksize;
66 u64 bytesize; 66 u64 bytesize;
67 pid_t pid; /* pid of nbd-client, if attached */
67}; 68};
68 69
69#endif 70#endif
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
index b089d9506283..a503052138bd 100644
--- a/include/linux/ncp_fs_sb.h
+++ b/include/linux/ncp_fs_sb.h
@@ -127,10 +127,10 @@ struct ncp_server {
127 } unexpected_packet; 127 } unexpected_packet;
128}; 128};
129 129
130extern void ncp_tcp_rcv_proc(void *server); 130extern void ncp_tcp_rcv_proc(struct work_struct *work);
131extern void ncp_tcp_tx_proc(void *server); 131extern void ncp_tcp_tx_proc(struct work_struct *work);
132extern void ncpdgram_rcv_proc(void *server); 132extern void ncpdgram_rcv_proc(struct work_struct *work);
133extern void ncpdgram_timeout_proc(void *server); 133extern void ncpdgram_timeout_proc(struct work_struct *work);
134extern void ncpdgram_timeout_call(unsigned long server); 134extern void ncpdgram_timeout_call(unsigned long server);
135extern void ncp_tcp_data_ready(struct sock* sk, int len); 135extern void ncp_tcp_data_ready(struct sock* sk, int len);
136extern void ncp_tcp_write_space(struct sock* sk); 136extern void ncp_tcp_write_space(struct sock* sk);
diff --git a/include/linux/ncp_mount.h b/include/linux/ncp_mount.h
index f46bddcdbd3b..a2b549eb1eca 100644
--- a/include/linux/ncp_mount.h
+++ b/include/linux/ncp_mount.h
@@ -75,7 +75,7 @@ struct ncp_mount_data_kernel {
75 unsigned int int_flags; /* internal flags */ 75 unsigned int int_flags; /* internal flags */
76#define NCP_IMOUNT_LOGGEDIN_POSSIBLE 0x0001 76#define NCP_IMOUNT_LOGGEDIN_POSSIBLE 0x0001
77 __kernel_uid32_t mounted_uid; /* Who may umount() this filesystem? */ 77 __kernel_uid32_t mounted_uid; /* Who may umount() this filesystem? */
78 __kernel_pid_t wdog_pid; /* Who cares for our watchdog packets? */ 78 struct pid *wdog_pid; /* Who cares for our watchdog packets? */
79 unsigned int ncp_fd; /* The socket to the ncp port */ 79 unsigned int ncp_fd; /* The socket to the ncp port */
80 unsigned int time_out; /* How long should I wait after 80 unsigned int time_out; /* How long should I wait after
81 sending a NCP request? */ 81 sending a NCP request? */
diff --git a/include/linux/net.h b/include/linux/net.h
index 15c733b816f0..f28d8a2e2c91 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -19,7 +19,6 @@
19#define _LINUX_NET_H 19#define _LINUX_NET_H
20 20
21#include <linux/wait.h> 21#include <linux/wait.h>
22#include <linux/random.h>
23#include <asm/socket.h> 22#include <asm/socket.h>
24 23
25struct poll_table_struct; 24struct poll_table_struct;
@@ -57,6 +56,7 @@ typedef enum {
57 56
58#ifdef __KERNEL__ 57#ifdef __KERNEL__
59#include <linux/stringify.h> 58#include <linux/stringify.h>
59#include <linux/random.h>
60 60
61#define SOCK_ASYNC_NOSPACE 0 61#define SOCK_ASYNC_NOSPACE 0
62#define SOCK_ASYNC_WAITDATA 1 62#define SOCK_ASYNC_WAITDATA 1
@@ -196,7 +196,7 @@ extern struct socket *sockfd_lookup(int fd, int *err);
196extern int net_ratelimit(void); 196extern int net_ratelimit(void);
197 197
198#define net_random() random32() 198#define net_random() random32()
199#define net_srandom(seed) srandom32(seed) 199#define net_srandom(seed) srandom32((__force u32)seed)
200 200
201extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg, 201extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg,
202 struct kvec *vec, size_t num, size_t len); 202 struct kvec *vec, size_t num, size_t len);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 83b8c4f1d69d..fea0d9db6846 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -30,6 +30,7 @@
30#include <linux/if_packet.h> 30#include <linux/if_packet.h>
31 31
32#ifdef __KERNEL__ 32#ifdef __KERNEL__
33#include <linux/timer.h>
33#include <asm/atomic.h> 34#include <asm/atomic.h>
34#include <asm/cache.h> 35#include <asm/cache.h>
35#include <asm/byteorder.h> 36#include <asm/byteorder.h>
@@ -38,7 +39,6 @@
38#include <linux/percpu.h> 39#include <linux/percpu.h>
39#include <linux/dmaengine.h> 40#include <linux/dmaengine.h>
40 41
41struct divert_blk;
42struct vlan_group; 42struct vlan_group;
43struct ethtool_ops; 43struct ethtool_ops;
44struct netpoll_info; 44struct netpoll_info;
@@ -67,6 +67,10 @@ struct netpoll_info;
67#define NET_RX_CN_HIGH 4 /* The storm is here */ 67#define NET_RX_CN_HIGH 4 /* The storm is here */
68#define NET_RX_BAD 5 /* packet dropped due to kernel error */ 68#define NET_RX_BAD 5 /* packet dropped due to kernel error */
69 69
70/* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It
71 * indicates that the device will soon be dropping packets, or already drops
72 * some packets of the same priority; prompting us to send less aggressively. */
73#define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e))
70#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) 74#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
71 75
72#endif 76#endif
@@ -189,13 +193,20 @@ struct hh_cache
189{ 193{
190 struct hh_cache *hh_next; /* Next entry */ 194 struct hh_cache *hh_next; /* Next entry */
191 atomic_t hh_refcnt; /* number of users */ 195 atomic_t hh_refcnt; /* number of users */
192 __be16 hh_type; /* protocol identifier, f.e ETH_P_IP 196/*
197 * We want hh_output, hh_len, hh_lock and hh_data be a in a separate
198 * cache line on SMP.
199 * They are mostly read, but hh_refcnt may be changed quite frequently,
200 * incurring cache line ping pongs.
201 */
202 __be16 hh_type ____cacheline_aligned_in_smp;
203 /* protocol identifier, f.e ETH_P_IP
193 * NOTE: For VLANs, this will be the 204 * NOTE: For VLANs, this will be the
194 * encapuslated type. --BLG 205 * encapuslated type. --BLG
195 */ 206 */
196 int hh_len; /* length of header */ 207 u16 hh_len; /* length of header */
197 int (*hh_output)(struct sk_buff *skb); 208 int (*hh_output)(struct sk_buff *skb);
198 rwlock_t hh_lock; 209 seqlock_t hh_lock;
199 210
200 /* cached hardware header; allow for machine alignment needs. */ 211 /* cached hardware header; allow for machine alignment needs. */
201#define HH_DATA_MOD 16 212#define HH_DATA_MOD 16
@@ -517,11 +528,6 @@ struct net_device
517 /* bridge stuff */ 528 /* bridge stuff */
518 struct net_bridge_port *br_port; 529 struct net_bridge_port *br_port;
519 530
520#ifdef CONFIG_NET_DIVERT
521 /* this will get initialized at each interface type init routine */
522 struct divert_blk *divert;
523#endif /* CONFIG_NET_DIVERT */
524
525 /* class/net/name entry */ 531 /* class/net/name entry */
526 struct class_device class_dev; 532 struct class_device class_dev;
527 /* space for optional statistics and wireless sysfs groups */ 533 /* space for optional statistics and wireless sysfs groups */
@@ -900,6 +906,7 @@ static inline void netif_poll_disable(struct net_device *dev)
900 906
901static inline void netif_poll_enable(struct net_device *dev) 907static inline void netif_poll_enable(struct net_device *dev)
902{ 908{
909 smp_mb__before_clear_bit();
903 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 910 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
904} 911}
905 912
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index b7e67d1d4382..d4c4c5120bc0 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -117,6 +117,16 @@ void nf_unregister_hooks(struct nf_hook_ops *reg, unsigned int n);
117int nf_register_sockopt(struct nf_sockopt_ops *reg); 117int nf_register_sockopt(struct nf_sockopt_ops *reg);
118void nf_unregister_sockopt(struct nf_sockopt_ops *reg); 118void nf_unregister_sockopt(struct nf_sockopt_ops *reg);
119 119
120#ifdef CONFIG_SYSCTL
121/* Sysctl registration */
122struct ctl_table_header *nf_register_sysctl_table(struct ctl_table *path,
123 struct ctl_table *table);
124void nf_unregister_sysctl_table(struct ctl_table_header *header,
125 struct ctl_table *table);
126extern struct ctl_table nf_net_netfilter_sysctl_path[];
127extern struct ctl_table nf_net_ipv4_netfilter_sysctl_path[];
128#endif /* CONFIG_SYSCTL */
129
120extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; 130extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS];
121 131
122/* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will 132/* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will
@@ -282,15 +292,31 @@ extern void nf_invalidate_cache(int pf);
282 Returns true or false. */ 292 Returns true or false. */
283extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); 293extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len);
284 294
285extern u_int16_t nf_csum_update(u_int32_t oldval, u_int32_t newval, 295static inline void nf_csum_replace4(__sum16 *sum, __be32 from, __be32 to)
286 u_int32_t csum); 296{
287extern u_int16_t nf_proto_csum_update(struct sk_buff *skb, 297 __be32 diff[] = { ~from, to };
288 u_int32_t oldval, u_int32_t newval, 298
289 u_int16_t csum, int pseudohdr); 299 *sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum)));
300}
301
302static inline void nf_csum_replace2(__sum16 *sum, __be16 from, __be16 to)
303{
304 nf_csum_replace4(sum, (__force __be32)from, (__force __be32)to);
305}
306
307extern void nf_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
308 __be32 from, __be32 to, int pseudohdr);
309
310static inline void nf_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb,
311 __be16 from, __be16 to, int pseudohdr)
312{
313 nf_proto_csum_replace4(sum, skb, (__force __be32)from,
314 (__force __be32)to, pseudohdr);
315}
290 316
291struct nf_afinfo { 317struct nf_afinfo {
292 unsigned short family; 318 unsigned short family;
293 unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook, 319 __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook,
294 unsigned int dataoff, u_int8_t protocol); 320 unsigned int dataoff, u_int8_t protocol);
295 void (*saveroute)(const struct sk_buff *skb, 321 void (*saveroute)(const struct sk_buff *skb,
296 struct nf_info *info); 322 struct nf_info *info);
@@ -305,12 +331,12 @@ static inline struct nf_afinfo *nf_get_afinfo(unsigned short family)
305 return rcu_dereference(nf_afinfo[family]); 331 return rcu_dereference(nf_afinfo[family]);
306} 332}
307 333
308static inline unsigned int 334static inline __sum16
309nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, 335nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff,
310 u_int8_t protocol, unsigned short family) 336 u_int8_t protocol, unsigned short family)
311{ 337{
312 struct nf_afinfo *afinfo; 338 struct nf_afinfo *afinfo;
313 unsigned int csum = 0; 339 __sum16 csum = 0;
314 340
315 rcu_read_lock(); 341 rcu_read_lock();
316 afinfo = nf_get_afinfo(family); 342 afinfo = nf_get_afinfo(family);
@@ -331,7 +357,7 @@ extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *);
331static inline void 357static inline void
332nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) 358nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family)
333{ 359{
334#ifdef CONFIG_IP_NF_NAT_NEEDED 360#if defined(CONFIG_IP_NF_NAT_NEEDED) || defined(CONFIG_NF_NAT_NEEDED)
335 void (*decodefn)(struct sk_buff *, struct flowi *); 361 void (*decodefn)(struct sk_buff *, struct flowi *);
336 362
337 if (family == AF_INET && (decodefn = ip_nat_decode_session) != NULL) 363 if (family == AF_INET && (decodefn = ip_nat_decode_session) != NULL)
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 312bd2ffee33..6328175a1c3a 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -14,6 +14,7 @@ header-y += xt_dscp.h
14header-y += xt_DSCP.h 14header-y += xt_DSCP.h
15header-y += xt_esp.h 15header-y += xt_esp.h
16header-y += xt_helper.h 16header-y += xt_helper.h
17header-y += xt_hashlimit.h
17header-y += xt_length.h 18header-y += xt_length.h
18header-y += xt_limit.h 19header-y += xt_limit.h
19header-y += xt_mac.h 20header-y += xt_mac.h
@@ -21,6 +22,7 @@ header-y += xt_mark.h
21header-y += xt_MARK.h 22header-y += xt_MARK.h
22header-y += xt_multiport.h 23header-y += xt_multiport.h
23header-y += xt_NFQUEUE.h 24header-y += xt_NFQUEUE.h
25header-y += xt_NFLOG.h
24header-y += xt_pkttype.h 26header-y += xt_pkttype.h
25header-y += xt_policy.h 27header-y += xt_policy.h
26header-y += xt_realm.h 28header-y += xt_realm.h
diff --git a/include/linux/netfilter/nf_conntrack_amanda.h b/include/linux/netfilter/nf_conntrack_amanda.h
new file mode 100644
index 000000000000..26c223544ae8
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_amanda.h
@@ -0,0 +1,10 @@
1#ifndef _NF_CONNTRACK_AMANDA_H
2#define _NF_CONNTRACK_AMANDA_H
3/* AMANDA tracking. */
4
5extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff **pskb,
6 enum ip_conntrack_info ctinfo,
7 unsigned int matchoff,
8 unsigned int matchlen,
9 struct nf_conntrack_expect *exp);
10#endif /* _NF_CONNTRACK_AMANDA_H */
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
index ad4a41c9ce93..81453ea7e4c2 100644
--- a/include/linux/netfilter/nf_conntrack_ftp.h
+++ b/include/linux/netfilter/nf_conntrack_ftp.h
@@ -3,16 +3,16 @@
3/* FTP tracking. */ 3/* FTP tracking. */
4 4
5/* This enum is exposed to userspace */ 5/* This enum is exposed to userspace */
6enum ip_ct_ftp_type 6enum nf_ct_ftp_type
7{ 7{
8 /* PORT command from client */ 8 /* PORT command from client */
9 IP_CT_FTP_PORT, 9 NF_CT_FTP_PORT,
10 /* PASV response from server */ 10 /* PASV response from server */
11 IP_CT_FTP_PASV, 11 NF_CT_FTP_PASV,
12 /* EPRT command from client */ 12 /* EPRT command from client */
13 IP_CT_FTP_EPRT, 13 NF_CT_FTP_EPRT,
14 /* EPSV response from server */ 14 /* EPSV response from server */
15 IP_CT_FTP_EPSV, 15 NF_CT_FTP_EPSV,
16}; 16};
17 17
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
@@ -21,23 +21,23 @@ enum ip_ct_ftp_type
21 21
22#define NUM_SEQ_TO_REMEMBER 2 22#define NUM_SEQ_TO_REMEMBER 2
23/* This structure exists only once per master */ 23/* This structure exists only once per master */
24struct ip_ct_ftp_master { 24struct nf_ct_ftp_master {
25 /* Valid seq positions for cmd matching after newline */ 25 /* Valid seq positions for cmd matching after newline */
26 u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; 26 u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
27 /* 0 means seq_match_aft_nl not set */ 27 /* 0 means seq_match_aft_nl not set */
28 int seq_aft_nl_num[IP_CT_DIR_MAX]; 28 int seq_aft_nl_num[IP_CT_DIR_MAX];
29}; 29};
30 30
31struct ip_conntrack_expect; 31struct nf_conntrack_expect;
32 32
33/* For NAT to hook in when we find a packet which describes what other 33/* For NAT to hook in when we find a packet which describes what other
34 * connection we should expect. */ 34 * connection we should expect. */
35extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb, 35extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff **pskb,
36 enum ip_conntrack_info ctinfo, 36 enum ip_conntrack_info ctinfo,
37 enum ip_ct_ftp_type type, 37 enum nf_ct_ftp_type type,
38 unsigned int matchoff, 38 unsigned int matchoff,
39 unsigned int matchlen, 39 unsigned int matchlen,
40 struct ip_conntrack_expect *exp, 40 struct nf_conntrack_expect *exp,
41 u32 *seq); 41 u32 *seq);
42#endif /* __KERNEL__ */ 42#endif /* __KERNEL__ */
43 43
diff --git a/include/linux/netfilter/nf_conntrack_h323.h b/include/linux/netfilter/nf_conntrack_h323.h
new file mode 100644
index 000000000000..08e2f4977c2e
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_h323.h
@@ -0,0 +1,92 @@
1#ifndef _NF_CONNTRACK_H323_H
2#define _NF_CONNTRACK_H323_H
3
4#ifdef __KERNEL__
5
6#include <linux/netfilter/nf_conntrack_h323_asn1.h>
7
8#define RAS_PORT 1719
9#define Q931_PORT 1720
10#define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */
11
12/* This structure exists only once per master */
13struct nf_ct_h323_master {
14
15 /* Original and NATed Q.931 or H.245 signal ports */
16 __be16 sig_port[IP_CT_DIR_MAX];
17
18 /* Original and NATed RTP ports */
19 __be16 rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX];
20
21 union {
22 /* RAS connection timeout */
23 u_int32_t timeout;
24
25 /* Next TPKT length (for separate TPKT header and data) */
26 u_int16_t tpkt_len[IP_CT_DIR_MAX];
27 };
28};
29
30struct nf_conn;
31
32extern int get_h225_addr(struct nf_conn *ct, unsigned char *data,
33 TransportAddress *taddr,
34 union nf_conntrack_address *addr, __be16 *port);
35extern void nf_conntrack_h245_expect(struct nf_conn *new,
36 struct nf_conntrack_expect *this);
37extern void nf_conntrack_q931_expect(struct nf_conn *new,
38 struct nf_conntrack_expect *this);
39extern int (*set_h245_addr_hook) (struct sk_buff **pskb,
40 unsigned char **data, int dataoff,
41 H245_TransportAddress *taddr,
42 union nf_conntrack_address *addr,
43 __be16 port);
44extern int (*set_h225_addr_hook) (struct sk_buff **pskb,
45 unsigned char **data, int dataoff,
46 TransportAddress *taddr,
47 union nf_conntrack_address *addr,
48 __be16 port);
49extern int (*set_sig_addr_hook) (struct sk_buff **pskb,
50 struct nf_conn *ct,
51 enum ip_conntrack_info ctinfo,
52 unsigned char **data,
53 TransportAddress *taddr, int count);
54extern int (*set_ras_addr_hook) (struct sk_buff **pskb,
55 struct nf_conn *ct,
56 enum ip_conntrack_info ctinfo,
57 unsigned char **data,
58 TransportAddress *taddr, int count);
59extern int (*nat_rtp_rtcp_hook) (struct sk_buff **pskb,
60 struct nf_conn *ct,
61 enum ip_conntrack_info ctinfo,
62 unsigned char **data, int dataoff,
63 H245_TransportAddress *taddr,
64 __be16 port, __be16 rtp_port,
65 struct nf_conntrack_expect *rtp_exp,
66 struct nf_conntrack_expect *rtcp_exp);
67extern int (*nat_t120_hook) (struct sk_buff **pskb, struct nf_conn *ct,
68 enum ip_conntrack_info ctinfo,
69 unsigned char **data, int dataoff,
70 H245_TransportAddress *taddr, __be16 port,
71 struct nf_conntrack_expect *exp);
72extern int (*nat_h245_hook) (struct sk_buff **pskb, struct nf_conn *ct,
73 enum ip_conntrack_info ctinfo,
74 unsigned char **data, int dataoff,
75 TransportAddress *taddr, __be16 port,
76 struct nf_conntrack_expect *exp);
77extern int (*nat_callforwarding_hook) (struct sk_buff **pskb,
78 struct nf_conn *ct,
79 enum ip_conntrack_info ctinfo,
80 unsigned char **data, int dataoff,
81 TransportAddress *taddr,
82 __be16 port,
83 struct nf_conntrack_expect *exp);
84extern int (*nat_q931_hook) (struct sk_buff **pskb, struct nf_conn *ct,
85 enum ip_conntrack_info ctinfo,
86 unsigned char **data, TransportAddress *taddr,
87 int idx, __be16 port,
88 struct nf_conntrack_expect *exp);
89
90#endif
91
92#endif
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h b/include/linux/netfilter/nf_conntrack_h323_asn1.h
index c6e9a0b6d30b..8dab5968fc7e 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
+++ b/include/linux/netfilter/nf_conntrack_h323_asn1.h
@@ -1,6 +1,6 @@
1/**************************************************************************** 1/****************************************************************************
2 * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 2 * ip_conntrack_h323_asn1.h - BER and PER decoding library for H.323
3 * conntrack/NAT module. 3 * conntrack/NAT module.
4 * 4 *
5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net> 5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
6 * 6 *
@@ -34,13 +34,13 @@
34 * 34 *
35 ****************************************************************************/ 35 ****************************************************************************/
36 36
37#ifndef _IP_CONNTRACK_HELPER_H323_ASN1_H_ 37#ifndef _NF_CONNTRACK_HELPER_H323_ASN1_H_
38#define _IP_CONNTRACK_HELPER_H323_ASN1_H_ 38#define _NF_CONNTRACK_HELPER_H323_ASN1_H_
39 39
40/***************************************************************************** 40/*****************************************************************************
41 * H.323 Types 41 * H.323 Types
42 ****************************************************************************/ 42 ****************************************************************************/
43#include "ip_conntrack_helper_h323_types.h" 43#include "nf_conntrack_h323_types.h"
44 44
45typedef struct { 45typedef struct {
46 enum { 46 enum {
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h b/include/linux/netfilter/nf_conntrack_h323_types.h
index 3d4a773799fc..38d74d5c9700 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
+++ b/include/linux/netfilter/nf_conntrack_h323_types.h
@@ -10,6 +10,11 @@ typedef struct TransportAddress_ipAddress { /* SEQUENCE */
10 unsigned ip; 10 unsigned ip;
11} TransportAddress_ipAddress; 11} TransportAddress_ipAddress;
12 12
13typedef struct TransportAddress_ip6Address { /* SEQUENCE */
14 int options; /* No use */
15 unsigned ip6;
16} TransportAddress_ip6Address;
17
13typedef struct TransportAddress { /* CHOICE */ 18typedef struct TransportAddress { /* CHOICE */
14 enum { 19 enum {
15 eTransportAddress_ipAddress, 20 eTransportAddress_ipAddress,
@@ -22,6 +27,7 @@ typedef struct TransportAddress { /* CHOICE */
22 } choice; 27 } choice;
23 union { 28 union {
24 TransportAddress_ipAddress ipAddress; 29 TransportAddress_ipAddress ipAddress;
30 TransportAddress_ip6Address ip6Address;
25 }; 31 };
26} TransportAddress; 32} TransportAddress;
27 33
@@ -93,6 +99,11 @@ typedef struct UnicastAddress_iPAddress { /* SEQUENCE */
93 unsigned network; 99 unsigned network;
94} UnicastAddress_iPAddress; 100} UnicastAddress_iPAddress;
95 101
102typedef struct UnicastAddress_iP6Address { /* SEQUENCE */
103 int options; /* No use */
104 unsigned network;
105} UnicastAddress_iP6Address;
106
96typedef struct UnicastAddress { /* CHOICE */ 107typedef struct UnicastAddress { /* CHOICE */
97 enum { 108 enum {
98 eUnicastAddress_iPAddress, 109 eUnicastAddress_iPAddress,
@@ -105,6 +116,7 @@ typedef struct UnicastAddress { /* CHOICE */
105 } choice; 116 } choice;
106 union { 117 union {
107 UnicastAddress_iPAddress iPAddress; 118 UnicastAddress_iPAddress iPAddress;
119 UnicastAddress_iP6Address iP6Address;
108 }; 120 };
109} UnicastAddress; 121} UnicastAddress;
110 122
diff --git a/include/linux/netfilter/nf_conntrack_irc.h b/include/linux/netfilter/nf_conntrack_irc.h
new file mode 100644
index 000000000000..2ab6b8255911
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_irc.h
@@ -0,0 +1,15 @@
1#ifndef _NF_CONNTRACK_IRC_H
2#define _NF_CONNTRACK_IRC_H
3
4#ifdef __KERNEL__
5
6#define IRC_PORT 6667
7
8extern unsigned int (*nf_nat_irc_hook)(struct sk_buff **pskb,
9 enum ip_conntrack_info ctinfo,
10 unsigned int matchoff,
11 unsigned int matchlen,
12 struct nf_conntrack_expect *exp);
13
14#endif /* __KERNEL__ */
15#endif /* _NF_CONNTRACK_IRC_H */
diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h
new file mode 100644
index 000000000000..9d8144a488cd
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_pptp.h
@@ -0,0 +1,322 @@
1/* PPTP constants and structs */
2#ifndef _NF_CONNTRACK_PPTP_H
3#define _NF_CONNTRACK_PPTP_H
4
5#include <linux/netfilter/nf_conntrack_common.h>
6
7/* state of the control session */
8enum pptp_ctrlsess_state {
9 PPTP_SESSION_NONE, /* no session present */
10 PPTP_SESSION_ERROR, /* some session error */
11 PPTP_SESSION_STOPREQ, /* stop_sess request seen */
12 PPTP_SESSION_REQUESTED, /* start_sess request seen */
13 PPTP_SESSION_CONFIRMED, /* session established */
14};
15
16/* state of the call inside the control session */
17enum pptp_ctrlcall_state {
18 PPTP_CALL_NONE,
19 PPTP_CALL_ERROR,
20 PPTP_CALL_OUT_REQ,
21 PPTP_CALL_OUT_CONF,
22 PPTP_CALL_IN_REQ,
23 PPTP_CALL_IN_REP,
24 PPTP_CALL_IN_CONF,
25 PPTP_CALL_CLEAR_REQ,
26};
27
28/* conntrack private data */
29struct nf_ct_pptp_master {
30 enum pptp_ctrlsess_state sstate; /* session state */
31 enum pptp_ctrlcall_state cstate; /* call state */
32 __be16 pac_call_id; /* call id of PAC */
33 __be16 pns_call_id; /* call id of PNS */
34
35 /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack
36 * and therefore imposes a fixed limit on the number of maps */
37 struct nf_ct_gre_keymap *keymap[IP_CT_DIR_MAX];
38};
39
40struct nf_nat_pptp {
41 __be16 pns_call_id; /* NAT'ed PNS call id */
42 __be16 pac_call_id; /* NAT'ed PAC call id */
43};
44
45#ifdef __KERNEL__
46
47#define PPTP_CONTROL_PORT 1723
48
49#define PPTP_PACKET_CONTROL 1
50#define PPTP_PACKET_MGMT 2
51
52#define PPTP_MAGIC_COOKIE 0x1a2b3c4d
53
54struct pptp_pkt_hdr {
55 __u16 packetLength;
56 __be16 packetType;
57 __be32 magicCookie;
58};
59
60/* PptpControlMessageType values */
61#define PPTP_START_SESSION_REQUEST 1
62#define PPTP_START_SESSION_REPLY 2
63#define PPTP_STOP_SESSION_REQUEST 3
64#define PPTP_STOP_SESSION_REPLY 4
65#define PPTP_ECHO_REQUEST 5
66#define PPTP_ECHO_REPLY 6
67#define PPTP_OUT_CALL_REQUEST 7
68#define PPTP_OUT_CALL_REPLY 8
69#define PPTP_IN_CALL_REQUEST 9
70#define PPTP_IN_CALL_REPLY 10
71#define PPTP_IN_CALL_CONNECT 11
72#define PPTP_CALL_CLEAR_REQUEST 12
73#define PPTP_CALL_DISCONNECT_NOTIFY 13
74#define PPTP_WAN_ERROR_NOTIFY 14
75#define PPTP_SET_LINK_INFO 15
76
77#define PPTP_MSG_MAX 15
78
79/* PptpGeneralError values */
80#define PPTP_ERROR_CODE_NONE 0
81#define PPTP_NOT_CONNECTED 1
82#define PPTP_BAD_FORMAT 2
83#define PPTP_BAD_VALUE 3
84#define PPTP_NO_RESOURCE 4
85#define PPTP_BAD_CALLID 5
86#define PPTP_REMOVE_DEVICE_ERROR 6
87
88struct PptpControlHeader {
89 __be16 messageType;
90 __u16 reserved;
91};
92
93/* FramingCapability Bitmap Values */
94#define PPTP_FRAME_CAP_ASYNC 0x1
95#define PPTP_FRAME_CAP_SYNC 0x2
96
97/* BearerCapability Bitmap Values */
98#define PPTP_BEARER_CAP_ANALOG 0x1
99#define PPTP_BEARER_CAP_DIGITAL 0x2
100
101struct PptpStartSessionRequest {
102 __be16 protocolVersion;
103 __u16 reserved1;
104 __be32 framingCapability;
105 __be32 bearerCapability;
106 __be16 maxChannels;
107 __be16 firmwareRevision;
108 __u8 hostName[64];
109 __u8 vendorString[64];
110};
111
112/* PptpStartSessionResultCode Values */
113#define PPTP_START_OK 1
114#define PPTP_START_GENERAL_ERROR 2
115#define PPTP_START_ALREADY_CONNECTED 3
116#define PPTP_START_NOT_AUTHORIZED 4
117#define PPTP_START_UNKNOWN_PROTOCOL 5
118
119struct PptpStartSessionReply {
120 __be16 protocolVersion;
121 __u8 resultCode;
122 __u8 generalErrorCode;
123 __be32 framingCapability;
124 __be32 bearerCapability;
125 __be16 maxChannels;
126 __be16 firmwareRevision;
127 __u8 hostName[64];
128 __u8 vendorString[64];
129};
130
131/* PptpStopReasons */
132#define PPTP_STOP_NONE 1
133#define PPTP_STOP_PROTOCOL 2
134#define PPTP_STOP_LOCAL_SHUTDOWN 3
135
136struct PptpStopSessionRequest {
137 __u8 reason;
138 __u8 reserved1;
139 __u16 reserved2;
140};
141
142/* PptpStopSessionResultCode */
143#define PPTP_STOP_OK 1
144#define PPTP_STOP_GENERAL_ERROR 2
145
146struct PptpStopSessionReply {
147 __u8 resultCode;
148 __u8 generalErrorCode;
149 __u16 reserved1;
150};
151
152struct PptpEchoRequest {
153 __be32 identNumber;
154};
155
156/* PptpEchoReplyResultCode */
157#define PPTP_ECHO_OK 1
158#define PPTP_ECHO_GENERAL_ERROR 2
159
160struct PptpEchoReply {
161 __be32 identNumber;
162 __u8 resultCode;
163 __u8 generalErrorCode;
164 __u16 reserved;
165};
166
167/* PptpFramingType */
168#define PPTP_ASYNC_FRAMING 1
169#define PPTP_SYNC_FRAMING 2
170#define PPTP_DONT_CARE_FRAMING 3
171
172/* PptpCallBearerType */
173#define PPTP_ANALOG_TYPE 1
174#define PPTP_DIGITAL_TYPE 2
175#define PPTP_DONT_CARE_BEARER_TYPE 3
176
177struct PptpOutCallRequest {
178 __be16 callID;
179 __be16 callSerialNumber;
180 __be32 minBPS;
181 __be32 maxBPS;
182 __be32 bearerType;
183 __be32 framingType;
184 __be16 packetWindow;
185 __be16 packetProcDelay;
186 __be16 phoneNumberLength;
187 __u16 reserved1;
188 __u8 phoneNumber[64];
189 __u8 subAddress[64];
190};
191
192/* PptpCallResultCode */
193#define PPTP_OUTCALL_CONNECT 1
194#define PPTP_OUTCALL_GENERAL_ERROR 2
195#define PPTP_OUTCALL_NO_CARRIER 3
196#define PPTP_OUTCALL_BUSY 4
197#define PPTP_OUTCALL_NO_DIAL_TONE 5
198#define PPTP_OUTCALL_TIMEOUT 6
199#define PPTP_OUTCALL_DONT_ACCEPT 7
200
201struct PptpOutCallReply {
202 __be16 callID;
203 __be16 peersCallID;
204 __u8 resultCode;
205 __u8 generalErrorCode;
206 __be16 causeCode;
207 __be32 connectSpeed;
208 __be16 packetWindow;
209 __be16 packetProcDelay;
210 __be32 physChannelID;
211};
212
213struct PptpInCallRequest {
214 __be16 callID;
215 __be16 callSerialNumber;
216 __be32 callBearerType;
217 __be32 physChannelID;
218 __be16 dialedNumberLength;
219 __be16 dialingNumberLength;
220 __u8 dialedNumber[64];
221 __u8 dialingNumber[64];
222 __u8 subAddress[64];
223};
224
225/* PptpInCallResultCode */
226#define PPTP_INCALL_ACCEPT 1
227#define PPTP_INCALL_GENERAL_ERROR 2
228#define PPTP_INCALL_DONT_ACCEPT 3
229
230struct PptpInCallReply {
231 __be16 callID;
232 __be16 peersCallID;
233 __u8 resultCode;
234 __u8 generalErrorCode;
235 __be16 packetWindow;
236 __be16 packetProcDelay;
237 __u16 reserved;
238};
239
240struct PptpInCallConnected {
241 __be16 peersCallID;
242 __u16 reserved;
243 __be32 connectSpeed;
244 __be16 packetWindow;
245 __be16 packetProcDelay;
246 __be32 callFramingType;
247};
248
249struct PptpClearCallRequest {
250 __be16 callID;
251 __u16 reserved;
252};
253
254struct PptpCallDisconnectNotify {
255 __be16 callID;
256 __u8 resultCode;
257 __u8 generalErrorCode;
258 __be16 causeCode;
259 __u16 reserved;
260 __u8 callStatistics[128];
261};
262
263struct PptpWanErrorNotify {
264 __be16 peersCallID;
265 __u16 reserved;
266 __be32 crcErrors;
267 __be32 framingErrors;
268 __be32 hardwareOverRuns;
269 __be32 bufferOverRuns;
270 __be32 timeoutErrors;
271 __be32 alignmentErrors;
272};
273
274struct PptpSetLinkInfo {
275 __be16 peersCallID;
276 __u16 reserved;
277 __be32 sendAccm;
278 __be32 recvAccm;
279};
280
281union pptp_ctrl_union {
282 struct PptpStartSessionRequest sreq;
283 struct PptpStartSessionReply srep;
284 struct PptpStopSessionRequest streq;
285 struct PptpStopSessionReply strep;
286 struct PptpOutCallRequest ocreq;
287 struct PptpOutCallReply ocack;
288 struct PptpInCallRequest icreq;
289 struct PptpInCallReply icack;
290 struct PptpInCallConnected iccon;
291 struct PptpClearCallRequest clrreq;
292 struct PptpCallDisconnectNotify disc;
293 struct PptpWanErrorNotify wanerr;
294 struct PptpSetLinkInfo setlink;
295};
296
297/* crap needed for nf_conntrack_compat.h */
298struct nf_conn;
299struct nf_conntrack_expect;
300
301extern int
302(*nf_nat_pptp_hook_outbound)(struct sk_buff **pskb,
303 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
304 struct PptpControlHeader *ctlh,
305 union pptp_ctrl_union *pptpReq);
306
307extern int
308(*nf_nat_pptp_hook_inbound)(struct sk_buff **pskb,
309 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
310 struct PptpControlHeader *ctlh,
311 union pptp_ctrl_union *pptpReq);
312
313extern void
314(*nf_nat_pptp_hook_exp_gre)(struct nf_conntrack_expect *exp_orig,
315 struct nf_conntrack_expect *exp_reply);
316
317extern void
318(*nf_nat_pptp_hook_expectfn)(struct nf_conn *ct,
319 struct nf_conntrack_expect *exp);
320
321#endif /* __KERNEL__ */
322#endif /* _NF_CONNTRACK_PPTP_H */
diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h
new file mode 100644
index 000000000000..4e6bbce04ff8
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_proto_gre.h
@@ -0,0 +1,112 @@
1#ifndef _CONNTRACK_PROTO_GRE_H
2#define _CONNTRACK_PROTO_GRE_H
3#include <asm/byteorder.h>
4
5/* GRE PROTOCOL HEADER */
6
7/* GRE Version field */
8#define GRE_VERSION_1701 0x0
9#define GRE_VERSION_PPTP 0x1
10
11/* GRE Protocol field */
12#define GRE_PROTOCOL_PPTP 0x880B
13
14/* GRE Flags */
15#define GRE_FLAG_C 0x80
16#define GRE_FLAG_R 0x40
17#define GRE_FLAG_K 0x20
18#define GRE_FLAG_S 0x10
19#define GRE_FLAG_A 0x80
20
21#define GRE_IS_C(f) ((f)&GRE_FLAG_C)
22#define GRE_IS_R(f) ((f)&GRE_FLAG_R)
23#define GRE_IS_K(f) ((f)&GRE_FLAG_K)
24#define GRE_IS_S(f) ((f)&GRE_FLAG_S)
25#define GRE_IS_A(f) ((f)&GRE_FLAG_A)
26
27/* GRE is a mess: Four different standards */
28struct gre_hdr {
29#if defined(__LITTLE_ENDIAN_BITFIELD)
30 __u16 rec:3,
31 srr:1,
32 seq:1,
33 key:1,
34 routing:1,
35 csum:1,
36 version:3,
37 reserved:4,
38 ack:1;
39#elif defined(__BIG_ENDIAN_BITFIELD)
40 __u16 csum:1,
41 routing:1,
42 key:1,
43 seq:1,
44 srr:1,
45 rec:3,
46 ack:1,
47 reserved:4,
48 version:3;
49#else
50#error "Adjust your <asm/byteorder.h> defines"
51#endif
52 __be16 protocol;
53};
54
55/* modified GRE header for PPTP */
56struct gre_hdr_pptp {
57 __u8 flags; /* bitfield */
58 __u8 version; /* should be GRE_VERSION_PPTP */
59 __be16 protocol; /* should be GRE_PROTOCOL_PPTP */
60 __be16 payload_len; /* size of ppp payload, not inc. gre header */
61 __be16 call_id; /* peer's call_id for this session */
62 __be32 seq; /* sequence number. Present if S==1 */
63 __be32 ack; /* seq number of highest packet recieved by */
64 /* sender in this session */
65};
66
67struct nf_ct_gre {
68 unsigned int stream_timeout;
69 unsigned int timeout;
70};
71
72#ifdef __KERNEL__
73#include <net/netfilter/nf_conntrack_tuple.h>
74
75struct nf_conn;
76
77/* structure for original <-> reply keymap */
78struct nf_ct_gre_keymap {
79 struct list_head list;
80 struct nf_conntrack_tuple tuple;
81};
82
83/* add new tuple->key_reply pair to keymap */
84int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir,
85 struct nf_conntrack_tuple *t);
86
87/* delete keymap entries */
88void nf_ct_gre_keymap_destroy(struct nf_conn *ct);
89
90/* get pointer to gre key, if present */
91static inline __be32 *gre_key(struct gre_hdr *greh)
92{
93 if (!greh->key)
94 return NULL;
95 if (greh->csum || greh->routing)
96 return (__be32 *)(greh+sizeof(*greh)+4);
97 return (__be32 *)(greh+sizeof(*greh));
98}
99
100/* get pointer ot gre csum, if present */
101static inline __sum16 *gre_csum(struct gre_hdr *greh)
102{
103 if (!greh->csum)
104 return NULL;
105 return (__sum16 *)(greh+sizeof(*greh));
106}
107
108extern void nf_ct_gre_keymap_flush(void);
109extern void nf_nat_need_gre(void);
110
111#endif /* __KERNEL__ */
112#endif /* _CONNTRACK_PROTO_GRE_H */
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h
index b8994d9fd1a9..5cf2c115cce4 100644
--- a/include/linux/netfilter/nf_conntrack_sctp.h
+++ b/include/linux/netfilter/nf_conntrack_sctp.h
@@ -20,7 +20,7 @@ struct ip_ct_sctp
20{ 20{
21 enum sctp_conntrack state; 21 enum sctp_conntrack state;
22 22
23 u_int32_t vtag[IP_CT_DIR_MAX]; 23 __be32 vtag[IP_CT_DIR_MAX];
24 u_int32_t ttag[IP_CT_DIR_MAX]; 24 u_int32_t ttag[IP_CT_DIR_MAX];
25}; 25};
26 26
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
new file mode 100644
index 000000000000..bb7f2041db74
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -0,0 +1,41 @@
1#ifndef __NF_CONNTRACK_SIP_H__
2#define __NF_CONNTRACK_SIP_H__
3#ifdef __KERNEL__
4
5#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600
7
8enum sip_header_pos {
9 POS_REG_REQ_URI,
10 POS_REQ_URI,
11 POS_FROM,
12 POS_TO,
13 POS_VIA,
14 POS_CONTACT,
15 POS_CONTENT,
16 POS_MEDIA,
17 POS_OWNER_IP4,
18 POS_CONNECTION_IP4,
19 POS_OWNER_IP6,
20 POS_CONNECTION_IP6,
21 POS_SDP_HEADER,
22};
23
24extern unsigned int (*nf_nat_sip_hook)(struct sk_buff **pskb,
25 enum ip_conntrack_info ctinfo,
26 struct nf_conn *ct,
27 const char **dptr);
28extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff **pskb,
29 enum ip_conntrack_info ctinfo,
30 struct nf_conntrack_expect *exp,
31 const char *dptr);
32
33extern int ct_sip_get_info(struct nf_conn *ct, const char *dptr, size_t dlen,
34 unsigned int *matchoff, unsigned int *matchlen,
35 enum sip_header_pos pos);
36extern int ct_sip_lnlen(const char *line, const char *limit);
37extern const char *ct_sip_search(const char *needle, const char *haystack,
38 size_t needle_len, size_t haystack_len,
39 int case_sensitive);
40#endif /* __KERNEL__ */
41#endif /* __NF_CONNTRACK_SIP_H__ */
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index 6b01ba297727..2f4e98b90cc0 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -25,7 +25,7 @@ enum tcp_conntrack {
25#define IP_CT_TCP_FLAG_SACK_PERM 0x02 25#define IP_CT_TCP_FLAG_SACK_PERM 0x02
26 26
27/* This sender sent FIN first */ 27/* This sender sent FIN first */
28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x03 28#define IP_CT_TCP_FLAG_CLOSE_INIT 0x04
29 29
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31 31
diff --git a/include/linux/netfilter/nf_conntrack_tftp.h b/include/linux/netfilter/nf_conntrack_tftp.h
new file mode 100644
index 000000000000..0d79b7ae051f
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_tftp.h
@@ -0,0 +1,20 @@
1#ifndef _NF_CONNTRACK_TFTP_H
2#define _NF_CONNTRACK_TFTP_H
3
4#define TFTP_PORT 69
5
6struct tftphdr {
7 __be16 opcode;
8};
9
10#define TFTP_OPCODE_READ 1
11#define TFTP_OPCODE_WRITE 2
12#define TFTP_OPCODE_DATA 3
13#define TFTP_OPCODE_ACK 4
14#define TFTP_OPCODE_ERROR 5
15
16extern unsigned int (*nf_nat_tftp_hook)(struct sk_buff **pskb,
17 enum ip_conntrack_info ctinfo,
18 struct nf_conntrack_expect *exp);
19
20#endif /* _NF_CONNTRACK_TFTP_H */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 6d8e3e5a80e9..1e9c821f152d 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -78,7 +78,7 @@ struct nfattr
78struct nfgenmsg { 78struct nfgenmsg {
79 u_int8_t nfgen_family; /* AF_xxx */ 79 u_int8_t nfgen_family; /* AF_xxx */
80 u_int8_t version; /* nfnetlink version */ 80 u_int8_t version; /* nfnetlink version */
81 u_int16_t res_id; /* resource id */ 81 __be16 res_id; /* resource id */
82}; 82};
83 83
84#define NFNETLINK_V0 0 84#define NFNETLINK_V0 0
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h
index 87b92f8b988f..5966afa026e9 100644
--- a/include/linux/netfilter/nfnetlink_log.h
+++ b/include/linux/netfilter/nfnetlink_log.h
@@ -16,24 +16,22 @@ enum nfulnl_msg_types {
16}; 16};
17 17
18struct nfulnl_msg_packet_hdr { 18struct nfulnl_msg_packet_hdr {
19 u_int16_t hw_protocol; /* hw protocol (network order) */ 19 __be16 hw_protocol; /* hw protocol (network order) */
20 u_int8_t hook; /* netfilter hook */ 20 u_int8_t hook; /* netfilter hook */
21 u_int8_t _pad; 21 u_int8_t _pad;
22}; 22};
23 23
24struct nfulnl_msg_packet_hw { 24struct nfulnl_msg_packet_hw {
25 u_int16_t hw_addrlen; 25 __be16 hw_addrlen;
26 u_int16_t _pad; 26 u_int16_t _pad;
27 u_int8_t hw_addr[8]; 27 u_int8_t hw_addr[8];
28}; 28};
29 29
30struct nfulnl_msg_packet_timestamp { 30struct nfulnl_msg_packet_timestamp {
31 aligned_u64 sec; 31 aligned_be64 sec;
32 aligned_u64 usec; 32 aligned_be64 usec;
33}; 33};
34 34
35#define NFULNL_PREFIXLEN 30 /* just like old log target */
36
37enum nfulnl_attr_type { 35enum nfulnl_attr_type {
38 NFULA_UNSPEC, 36 NFULA_UNSPEC,
39 NFULA_PACKET_HDR, 37 NFULA_PACKET_HDR,
@@ -67,7 +65,7 @@ struct nfulnl_msg_config_cmd {
67} __attribute__ ((packed)); 65} __attribute__ ((packed));
68 66
69struct nfulnl_msg_config_mode { 67struct nfulnl_msg_config_mode {
70 u_int32_t copy_range; 68 __be32 copy_range;
71 u_int8_t copy_mode; 69 u_int8_t copy_mode;
72 u_int8_t _pad; 70 u_int8_t _pad;
73} __attribute__ ((packed)); 71} __attribute__ ((packed));
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index 36af0360b56d..83e789633e35 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -13,20 +13,20 @@ enum nfqnl_msg_types {
13}; 13};
14 14
15struct nfqnl_msg_packet_hdr { 15struct nfqnl_msg_packet_hdr {
16 u_int32_t packet_id; /* unique ID of packet in queue */ 16 __be32 packet_id; /* unique ID of packet in queue */
17 u_int16_t hw_protocol; /* hw protocol (network order) */ 17 __be16 hw_protocol; /* hw protocol (network order) */
18 u_int8_t hook; /* netfilter hook */ 18 u_int8_t hook; /* netfilter hook */
19} __attribute__ ((packed)); 19} __attribute__ ((packed));
20 20
21struct nfqnl_msg_packet_hw { 21struct nfqnl_msg_packet_hw {
22 u_int16_t hw_addrlen; 22 __be16 hw_addrlen;
23 u_int16_t _pad; 23 u_int16_t _pad;
24 u_int8_t hw_addr[8]; 24 u_int8_t hw_addr[8];
25}; 25};
26 26
27struct nfqnl_msg_packet_timestamp { 27struct nfqnl_msg_packet_timestamp {
28 aligned_u64 sec; 28 aligned_be64 sec;
29 aligned_u64 usec; 29 aligned_be64 usec;
30}; 30};
31 31
32enum nfqnl_attr_type { 32enum nfqnl_attr_type {
@@ -47,8 +47,8 @@ enum nfqnl_attr_type {
47#define NFQA_MAX (__NFQA_MAX - 1) 47#define NFQA_MAX (__NFQA_MAX - 1)
48 48
49struct nfqnl_msg_verdict_hdr { 49struct nfqnl_msg_verdict_hdr {
50 u_int32_t verdict; 50 __be32 verdict;
51 u_int32_t id; 51 __be32 id;
52}; 52};
53 53
54 54
@@ -63,7 +63,7 @@ enum nfqnl_msg_config_cmds {
63struct nfqnl_msg_config_cmd { 63struct nfqnl_msg_config_cmd {
64 u_int8_t command; /* nfqnl_msg_config_cmds */ 64 u_int8_t command; /* nfqnl_msg_config_cmds */
65 u_int8_t _pad; 65 u_int8_t _pad;
66 u_int16_t pf; /* AF_xxx for PF_[UN]BIND */ 66 __be16 pf; /* AF_xxx for PF_[UN]BIND */
67}; 67};
68 68
69enum nfqnl_config_mode { 69enum nfqnl_config_mode {
@@ -73,7 +73,7 @@ enum nfqnl_config_mode {
73}; 73};
74 74
75struct nfqnl_msg_config_params { 75struct nfqnl_msg_config_params {
76 u_int32_t copy_range; 76 __be32 copy_range;
77 u_int8_t copy_mode; /* enum nfqnl_config_mode */ 77 u_int8_t copy_mode; /* enum nfqnl_config_mode */
78} __attribute__ ((packed)); 78} __attribute__ ((packed));
79 79
@@ -82,6 +82,7 @@ enum nfqnl_attr_config {
82 NFQA_CFG_UNSPEC, 82 NFQA_CFG_UNSPEC,
83 NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ 83 NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */
84 NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ 84 NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */
85 NFQA_CFG_QUEUE_MAXLEN, /* u_int32_t */
85 __NFQA_CFG_MAX 86 __NFQA_CFG_MAX
86}; 87};
87#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) 88#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
diff --git a/include/linux/netfilter/xt_NFLOG.h b/include/linux/netfilter/xt_NFLOG.h
new file mode 100644
index 000000000000..cdcd0ed58f7a
--- /dev/null
+++ b/include/linux/netfilter/xt_NFLOG.h
@@ -0,0 +1,18 @@
1#ifndef _XT_NFLOG_TARGET
2#define _XT_NFLOG_TARGET
3
4#define XT_NFLOG_DEFAULT_GROUP 0x1
5#define XT_NFLOG_DEFAULT_THRESHOLD 1
6
7#define XT_NFLOG_MASK 0x0
8
9struct xt_nflog_info {
10 u_int32_t len;
11 u_int16_t group;
12 u_int16_t threshold;
13 u_int16_t flags;
14 u_int16_t pad;
15 char prefix[64];
16};
17
18#endif /* _XT_NFLOG_TARGET */
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h
index 4c2d9945ca54..70b6f718cf4c 100644
--- a/include/linux/netfilter/xt_conntrack.h
+++ b/include/linux/netfilter/xt_conntrack.h
@@ -29,14 +29,14 @@
29struct ip_conntrack_old_tuple 29struct ip_conntrack_old_tuple
30{ 30{
31 struct { 31 struct {
32 __u32 ip; 32 __be32 ip;
33 union { 33 union {
34 __u16 all; 34 __u16 all;
35 } u; 35 } u;
36 } src; 36 } src;
37 37
38 struct { 38 struct {
39 __u32 ip; 39 __be32 ip;
40 union { 40 union {
41 __u16 all; 41 __u16 all;
42 } u; 42 } u;
diff --git a/include/linux/netfilter/xt_hashlimit.h b/include/linux/netfilter/xt_hashlimit.h
new file mode 100644
index 000000000000..b4556b8edbfd
--- /dev/null
+++ b/include/linux/netfilter/xt_hashlimit.h
@@ -0,0 +1,40 @@
1#ifndef _XT_HASHLIMIT_H
2#define _XT_HASHLIMIT_H
3
4/* timings are in milliseconds. */
5#define XT_HASHLIMIT_SCALE 10000
6/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
7 seconds, or one every 59 hours. */
8
9/* details of this structure hidden by the implementation */
10struct xt_hashlimit_htable;
11
12#define XT_HASHLIMIT_HASH_DIP 0x0001
13#define XT_HASHLIMIT_HASH_DPT 0x0002
14#define XT_HASHLIMIT_HASH_SIP 0x0004
15#define XT_HASHLIMIT_HASH_SPT 0x0008
16
17struct hashlimit_cfg {
18 u_int32_t mode; /* bitmask of IPT_HASHLIMIT_HASH_* */
19 u_int32_t avg; /* Average secs between packets * scale */
20 u_int32_t burst; /* Period multiplier for upper limit. */
21
22 /* user specified */
23 u_int32_t size; /* how many buckets */
24 u_int32_t max; /* max number of entries */
25 u_int32_t gc_interval; /* gc interval */
26 u_int32_t expire; /* when do entries expire? */
27};
28
29struct xt_hashlimit_info {
30 char name [IFNAMSIZ]; /* name */
31 struct hashlimit_cfg cfg;
32 struct xt_hashlimit_htable *hinfo;
33
34 /* Used internally by the kernel */
35 union {
36 void *ptr;
37 struct xt_hashlimit_info *master;
38 } u;
39};
40#endif /*_XT_HASHLIMIT_H*/
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h
index a8132ec076fb..45654d359a68 100644
--- a/include/linux/netfilter/xt_policy.h
+++ b/include/linux/netfilter/xt_policy.h
@@ -39,7 +39,7 @@ struct xt_policy_elem
39 union xt_policy_addr smask; 39 union xt_policy_addr smask;
40 union xt_policy_addr daddr; 40 union xt_policy_addr daddr;
41 union xt_policy_addr dmask; 41 union xt_policy_addr dmask;
42 u_int32_t spi; 42 __be32 spi;
43 u_int32_t reqid; 43 u_int32_t reqid;
44 u_int8_t proto; 44 u_int8_t proto;
45 u_int8_t mode; 45 u_int8_t mode;
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 0be235418a2f..24c8786d12e9 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -190,6 +190,7 @@ struct arpt_replace
190 190
191/* The argument to ARPT_SO_ADD_COUNTERS. */ 191/* The argument to ARPT_SO_ADD_COUNTERS. */
192#define arpt_counters_info xt_counters_info 192#define arpt_counters_info xt_counters_info
193#define arpt_counters xt_counters
193 194
194/* The argument to ARPT_SO_GET_ENTRIES. */ 195/* The argument to ARPT_SO_GET_ENTRIES. */
195struct arpt_get_entries 196struct arpt_get_entries
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 9a4dd11af86e..55689f39f77a 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -64,11 +64,10 @@ static inline int nf_bridge_pad(const struct sk_buff *skb)
64 64
65struct bridge_skb_cb { 65struct bridge_skb_cb {
66 union { 66 union {
67 __u32 ipv4; 67 __be32 ipv4;
68 } daddr; 68 } daddr;
69}; 69};
70 70
71extern int brnf_deferred_hooks;
72#else 71#else
73#define nf_bridge_maybe_copy_header(skb) (0) 72#define nf_bridge_maybe_copy_header(skb) (0)
74#define nf_bridge_pad(skb) (0) 73#define nf_bridge_pad(skb) (0)
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h
index b9f712c14a0a..07f044ff1a6b 100644
--- a/include/linux/netfilter_bridge/ebt_802_3.h
+++ b/include/linux/netfilter_bridge/ebt_802_3.h
@@ -28,21 +28,21 @@ struct hdr_ui {
28 uint8_t ssap; 28 uint8_t ssap;
29 uint8_t ctrl; 29 uint8_t ctrl;
30 uint8_t orig[3]; 30 uint8_t orig[3];
31 uint16_t type; 31 __be16 type;
32}; 32};
33 33
34struct hdr_ni { 34struct hdr_ni {
35 uint8_t dsap; 35 uint8_t dsap;
36 uint8_t ssap; 36 uint8_t ssap;
37 uint16_t ctrl; 37 __be16 ctrl;
38 uint8_t orig[3]; 38 uint8_t orig[3];
39 uint16_t type; 39 __be16 type;
40}; 40};
41 41
42struct ebt_802_3_hdr { 42struct ebt_802_3_hdr {
43 uint8_t daddr[6]; 43 uint8_t daddr[6];
44 uint8_t saddr[6]; 44 uint8_t saddr[6];
45 uint16_t len; 45 __be16 len;
46 union { 46 union {
47 struct hdr_ui ui; 47 struct hdr_ui ui;
48 struct hdr_ni ni; 48 struct hdr_ni ni;
@@ -61,7 +61,7 @@ static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
61struct ebt_802_3_info 61struct ebt_802_3_info
62{ 62{
63 uint8_t sap; 63 uint8_t sap;
64 uint16_t type; 64 __be16 type;
65 uint8_t bitmask; 65 uint8_t bitmask;
66 uint8_t invflags; 66 uint8_t invflags;
67}; 67};
diff --git a/include/linux/netfilter_bridge/ebt_among.h b/include/linux/netfilter_bridge/ebt_among.h
index 307c1fed8511..7654069233ca 100644
--- a/include/linux/netfilter_bridge/ebt_among.h
+++ b/include/linux/netfilter_bridge/ebt_among.h
@@ -32,7 +32,7 @@
32struct ebt_mac_wormhash_tuple 32struct ebt_mac_wormhash_tuple
33{ 33{
34 uint32_t cmp[2]; 34 uint32_t cmp[2];
35 uint32_t ip; 35 __be32 ip;
36}; 36};
37 37
38struct ebt_mac_wormhash 38struct ebt_mac_wormhash
diff --git a/include/linux/netfilter_bridge/ebt_arp.h b/include/linux/netfilter_bridge/ebt_arp.h
index 537ec6b487a2..97e4dbde1f89 100644
--- a/include/linux/netfilter_bridge/ebt_arp.h
+++ b/include/linux/netfilter_bridge/ebt_arp.h
@@ -14,13 +14,13 @@
14 14
15struct ebt_arp_info 15struct ebt_arp_info
16{ 16{
17 uint16_t htype; 17 __be16 htype;
18 uint16_t ptype; 18 __be16 ptype;
19 uint16_t opcode; 19 __be16 opcode;
20 uint32_t saddr; 20 __be32 saddr;
21 uint32_t smsk; 21 __be32 smsk;
22 uint32_t daddr; 22 __be32 daddr;
23 uint32_t dmsk; 23 __be32 dmsk;
24 unsigned char smaddr[ETH_ALEN]; 24 unsigned char smaddr[ETH_ALEN];
25 unsigned char smmsk[ETH_ALEN]; 25 unsigned char smmsk[ETH_ALEN];
26 unsigned char dmaddr[ETH_ALEN]; 26 unsigned char dmaddr[ETH_ALEN];
diff --git a/include/linux/netfilter_bridge/ebt_ip.h b/include/linux/netfilter_bridge/ebt_ip.h
index 7247385cdcb1..d6847475bf2e 100644
--- a/include/linux/netfilter_bridge/ebt_ip.h
+++ b/include/linux/netfilter_bridge/ebt_ip.h
@@ -28,10 +28,10 @@
28/* the same values are used for the invflags */ 28/* the same values are used for the invflags */
29struct ebt_ip_info 29struct ebt_ip_info
30{ 30{
31 uint32_t saddr; 31 __be32 saddr;
32 uint32_t daddr; 32 __be32 daddr;
33 uint32_t smsk; 33 __be32 smsk;
34 uint32_t dmsk; 34 __be32 dmsk;
35 uint8_t tos; 35 uint8_t tos;
36 uint8_t protocol; 36 uint8_t protocol;
37 uint8_t bitmask; 37 uint8_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_nat.h b/include/linux/netfilter_bridge/ebt_nat.h
index 26fd90da4cd6..435b886a51aa 100644
--- a/include/linux/netfilter_bridge/ebt_nat.h
+++ b/include/linux/netfilter_bridge/ebt_nat.h
@@ -1,6 +1,7 @@
1#ifndef __LINUX_BRIDGE_EBT_NAT_H 1#ifndef __LINUX_BRIDGE_EBT_NAT_H
2#define __LINUX_BRIDGE_EBT_NAT_H 2#define __LINUX_BRIDGE_EBT_NAT_H
3 3
4#define NAT_ARP_BIT (0x00000010)
4struct ebt_nat_info 5struct ebt_nat_info
5{ 6{
6 unsigned char mac[ETH_ALEN]; 7 unsigned char mac[ETH_ALEN];
diff --git a/include/linux/netfilter_bridge/ebt_vlan.h b/include/linux/netfilter_bridge/ebt_vlan.h
index cb1fcc41565f..1d98be4031e7 100644
--- a/include/linux/netfilter_bridge/ebt_vlan.h
+++ b/include/linux/netfilter_bridge/ebt_vlan.h
@@ -10,7 +10,7 @@
10struct ebt_vlan_info { 10struct ebt_vlan_info {
11 uint16_t id; /* VLAN ID {1-4095} */ 11 uint16_t id; /* VLAN ID {1-4095} */
12 uint8_t prio; /* VLAN User Priority {0-7} */ 12 uint8_t prio; /* VLAN User Priority {0-7} */
13 uint16_t encap; /* VLAN Encapsulated frame code {0-65535} */ 13 __be16 encap; /* VLAN Encapsulated frame code {0-65535} */
14 uint8_t bitmask; /* Args bitmask bit 1=1 - ID arg, 14 uint8_t bitmask; /* Args bitmask bit 1=1 - ID arg,
15 bit 2=1 User-Priority arg, bit 3=1 encap*/ 15 bit 2=1 User-Priority arg, bit 3=1 encap*/
16 uint8_t invflags; /* Inverse bitmask bit 1=1 - inversed ID arg, 16 uint8_t invflags; /* Inverse bitmask bit 1=1 - inversed ID arg,
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index b1a7cc90877b..94e0a7dc0cb2 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -26,6 +26,10 @@
26#define EBT_CONTINUE -3 26#define EBT_CONTINUE -3
27#define EBT_RETURN -4 27#define EBT_RETURN -4
28#define NUM_STANDARD_TARGETS 4 28#define NUM_STANDARD_TARGETS 4
29/* ebtables target modules store the verdict inside an int. We can
30 * reclaim a part of this int for backwards compatible extensions.
31 * The 4 lsb are more than enough to store the verdict. */
32#define EBT_VERDICT_BITS 0x0000000F
29 33
30struct ebt_counter 34struct ebt_counter
31{ 35{
@@ -42,6 +46,23 @@ struct ebt_replace
42 /* total size of the entries */ 46 /* total size of the entries */
43 unsigned int entries_size; 47 unsigned int entries_size;
44 /* start of the chains */ 48 /* start of the chains */
49 struct ebt_entries __user *hook_entry[NF_BR_NUMHOOKS];
50 /* nr of counters userspace expects back */
51 unsigned int num_counters;
52 /* where the kernel will put the old counters */
53 struct ebt_counter __user *counters;
54 char __user *entries;
55};
56
57struct ebt_replace_kernel
58{
59 char name[EBT_TABLE_MAXNAMELEN];
60 unsigned int valid_hooks;
61 /* nr of rules in the table */
62 unsigned int nentries;
63 /* total size of the entries */
64 unsigned int entries_size;
65 /* start of the chains */
45 struct ebt_entries *hook_entry[NF_BR_NUMHOOKS]; 66 struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
46 /* nr of counters userspace expects back */ 67 /* nr of counters userspace expects back */
47 unsigned int num_counters; 68 unsigned int num_counters;
@@ -141,7 +162,7 @@ struct ebt_entry {
141 /* this needs to be the first field */ 162 /* this needs to be the first field */
142 unsigned int bitmask; 163 unsigned int bitmask;
143 unsigned int invflags; 164 unsigned int invflags;
144 uint16_t ethproto; 165 __be16 ethproto;
145 /* the physical in-dev */ 166 /* the physical in-dev */
146 char in[IFNAMSIZ]; 167 char in[IFNAMSIZ];
147 /* the logical in-dev */ 168 /* the logical in-dev */
@@ -251,7 +272,7 @@ struct ebt_table
251{ 272{
252 struct list_head list; 273 struct list_head list;
253 char name[EBT_TABLE_MAXNAMELEN]; 274 char name[EBT_TABLE_MAXNAMELEN];
254 struct ebt_replace *table; 275 struct ebt_replace_kernel *table;
255 unsigned int valid_hooks; 276 unsigned int valid_hooks;
256 rwlock_t lock; 277 rwlock_t lock;
257 /* e.g. could be the table explicitly only allows certain 278 /* e.g. could be the table explicitly only allows certain
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 5b63a231a76b..ceae87a4c891 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -57,10 +57,8 @@ enum nf_ip_hook_priorities {
57 NF_IP_PRI_RAW = -300, 57 NF_IP_PRI_RAW = -300,
58 NF_IP_PRI_SELINUX_FIRST = -225, 58 NF_IP_PRI_SELINUX_FIRST = -225,
59 NF_IP_PRI_CONNTRACK = -200, 59 NF_IP_PRI_CONNTRACK = -200,
60 NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
61 NF_IP_PRI_MANGLE = -150, 60 NF_IP_PRI_MANGLE = -150,
62 NF_IP_PRI_NAT_DST = -100, 61 NF_IP_PRI_NAT_DST = -100,
63 NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
64 NF_IP_PRI_FILTER = 0, 62 NF_IP_PRI_FILTER = 0,
65 NF_IP_PRI_NAT_SRC = 100, 63 NF_IP_PRI_NAT_SRC = 100,
66 NF_IP_PRI_SELINUX_LAST = 225, 64 NF_IP_PRI_SELINUX_LAST = 225,
@@ -79,7 +77,7 @@ enum nf_ip_hook_priorities {
79#ifdef __KERNEL__ 77#ifdef __KERNEL__
80extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type); 78extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type);
81extern int ip_xfrm_me_harder(struct sk_buff **pskb); 79extern int ip_xfrm_me_harder(struct sk_buff **pskb);
82extern unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 80extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
83 unsigned int dataoff, u_int8_t protocol); 81 unsigned int dataoff, u_int8_t protocol);
84#endif /*__KERNEL__*/ 82#endif /*__KERNEL__*/
85 83
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index 591c1a809c00..180337801a86 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -1,6 +1,4 @@
1header-y += ip_conntrack_helper.h 1header-y += ip_conntrack_helper.h
2header-y += ip_conntrack_helper_h323_asn1.h
3header-y += ip_conntrack_helper_h323_types.h
4header-y += ip_conntrack_protocol.h 2header-y += ip_conntrack_protocol.h
5header-y += ip_conntrack_sctp.h 3header-y += ip_conntrack_sctp.h
6header-y += ip_conntrack_tcp.h 4header-y += ip_conntrack_tcp.h
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 64e868034c4a..33581c13d947 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -9,6 +9,7 @@
9#include <linux/compiler.h> 9#include <linux/compiler.h>
10#include <asm/atomic.h> 10#include <asm/atomic.h>
11 11
12#include <linux/timer.h>
12#include <linux/netfilter_ipv4/ip_conntrack_tcp.h> 13#include <linux/netfilter_ipv4/ip_conntrack_tcp.h>
13#include <linux/netfilter_ipv4/ip_conntrack_icmp.h> 14#include <linux/netfilter_ipv4/ip_conntrack_icmp.h>
14#include <linux/netfilter_ipv4/ip_conntrack_proto_gre.h> 15#include <linux/netfilter_ipv4/ip_conntrack_proto_gre.h>
@@ -277,7 +278,7 @@ extern struct ip_conntrack_expect *
277__ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); 278__ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple);
278 279
279extern struct ip_conntrack_expect * 280extern struct ip_conntrack_expect *
280ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); 281ip_conntrack_expect_find_get(const struct ip_conntrack_tuple *tuple);
281 282
282extern struct ip_conntrack_tuple_hash * 283extern struct ip_conntrack_tuple_hash *
283__ip_conntrack_find(const struct ip_conntrack_tuple *tuple, 284__ip_conntrack_find(const struct ip_conntrack_tuple *tuple,
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h
index 63811934de4d..2129fc3972ac 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h
@@ -1,6 +1,44 @@
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. */
3 4
4#include <linux/netfilter/nf_conntrack_ftp.h> 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__ */
5 43
6#endif /* _IP_CONNTRACK_FTP_H */ 44#endif /* _IP_CONNTRACK_FTP_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
index 943cc6a4871d..18f769818f4e 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
@@ -3,7 +3,7 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h> 6#include <linux/netfilter/nf_conntrack_h323_asn1.h>
7 7
8#define RAS_PORT 1719 8#define RAS_PORT 1719
9#define Q931_PORT 1720 9#define Q931_PORT 1720
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
index 1d853aa873eb..e371e0fc1672 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
@@ -102,11 +102,11 @@ static inline __be32 *gre_key(struct gre_hdr *greh)
102} 102}
103 103
104/* get pointer ot gre csum, if present */ 104/* get pointer ot gre csum, if present */
105static inline u_int16_t *gre_csum(struct gre_hdr *greh) 105static inline __sum16 *gre_csum(struct gre_hdr *greh)
106{ 106{
107 if (!greh->csum) 107 if (!greh->csum)
108 return NULL; 108 return NULL;
109 return (u_int16_t *) (greh+sizeof(*greh)); 109 return (__sum16 *) (greh+sizeof(*greh));
110} 110}
111 111
112#endif /* __KERNEL__ */ 112#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sip.h b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
index 913dad66c0fb..bef6c646defa 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_sip.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
@@ -5,23 +5,18 @@
5#define SIP_PORT 5060 5#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600 6#define SIP_TIMEOUT 3600
7 7
8#define POS_VIA 0 8enum sip_header_pos {
9#define POS_CONTACT 1 9 POS_REG_REQ_URI,
10#define POS_CONTENT 2 10 POS_REQ_URI,
11#define POS_MEDIA 3 11 POS_FROM,
12#define POS_OWNER 4 12 POS_TO,
13#define POS_CONNECTION 5 13 POS_VIA,
14#define POS_REQ_HEADER 6 14 POS_CONTACT,
15#define POS_SDP_HEADER 7 15 POS_CONTENT,
16 16 POS_MEDIA,
17struct sip_header_nfo { 17 POS_OWNER,
18 const char *lname; 18 POS_CONNECTION,
19 const char *sname; 19 POS_SDP_HEADER,
20 const char *ln_str;
21 size_t lnlen;
22 size_t snlen;
23 size_t ln_strlen;
24 int (*match_len)(const char *, const char *, int *);
25}; 20};
26 21
27extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb, 22extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb,
@@ -36,9 +31,10 @@ extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb,
36extern int ct_sip_get_info(const char *dptr, size_t dlen, 31extern int ct_sip_get_info(const char *dptr, size_t dlen,
37 unsigned int *matchoff, 32 unsigned int *matchoff,
38 unsigned int *matchlen, 33 unsigned int *matchlen,
39 struct sip_header_nfo *hnfo); 34 enum sip_header_pos pos);
40extern int ct_sip_lnlen(const char *line, const char *limit); 35extern int ct_sip_lnlen(const char *line, const char *limit);
41extern const char *ct_sip_search(const char *needle, const char *haystack, 36extern const char *ct_sip_search(const char *needle, const char *haystack,
42 size_t needle_len, size_t haystack_len); 37 size_t needle_len, size_t haystack_len,
38 int case_sensitive);
43#endif /* __KERNEL__ */ 39#endif /* __KERNEL__ */
44#endif /* __IP_CONNTRACK_SIP_H__ */ 40#endif /* __IP_CONNTRACK_SIP_H__ */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
index cde9729aa173..a404fc0abf0e 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
@@ -4,7 +4,7 @@
4#define TFTP_PORT 69 4#define TFTP_PORT 69
5 5
6struct tftphdr { 6struct tftphdr {
7 u_int16_t opcode; 7 __be16 opcode;
8}; 8};
9 9
10#define TFTP_OPCODE_READ 1 10#define TFTP_OPCODE_READ 1
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h
index 892f9a33fea8..90fa6525ef9c 100644
--- a/include/linux/netfilter_ipv4/ipt_LOG.h
+++ b/include/linux/netfilter_ipv4/ipt_LOG.h
@@ -6,7 +6,7 @@
6#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ 6#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */
7#define IPT_LOG_IPOPT 0x04 /* Log IP options */ 7#define IPT_LOG_IPOPT 0x04 /* Log IP options */
8#define IPT_LOG_UID 0x08 /* Log UID owning local socket */ 8#define IPT_LOG_UID 0x08 /* Log UID owning local socket */
9#define IPT_LOG_NFLOG 0x10 /* Log using nf_log backend */ 9#define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */
10#define IPT_LOG_MASK 0x1f 10#define IPT_LOG_MASK 0x1f
11 11
12struct ipt_log_info { 12struct ipt_log_info {
diff --git a/include/linux/netfilter_ipv4/ipt_hashlimit.h b/include/linux/netfilter_ipv4/ipt_hashlimit.h
index ac2cb64ecd76..5662120a3d7b 100644
--- a/include/linux/netfilter_ipv4/ipt_hashlimit.h
+++ b/include/linux/netfilter_ipv4/ipt_hashlimit.h
@@ -1,40 +1,14 @@
1#ifndef _IPT_HASHLIMIT_H 1#ifndef _IPT_HASHLIMIT_H
2#define _IPT_HASHLIMIT_H 2#define _IPT_HASHLIMIT_H
3 3
4/* timings are in milliseconds. */ 4#include <linux/netfilter/xt_hashlimit.h>
5#define IPT_HASHLIMIT_SCALE 10000
6/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
7 seconds, or one every 59 hours. */
8 5
9/* details of this structure hidden by the implementation */ 6#define IPT_HASHLIMIT_SCALE XT_HASHLIMIT_SCALE
10struct ipt_hashlimit_htable; 7#define IPT_HASHLIMIT_HASH_DIP XT_HASHLIMIT_HASH_DIP
8#define IPT_HASHLIMIT_HASH_DPT XT_HASHLIMIT_HASH_DPT
9#define IPT_HASHLIMIT_HASH_SIP XT_HASHLIMIT_HASH_SIP
10#define IPT_HASHLIMIT_HASH_SPT XT_HASHLIMIT_HASH_SPT
11 11
12#define IPT_HASHLIMIT_HASH_DIP 0x0001 12#define ipt_hashlimit_info xt_hashlimit_info
13#define IPT_HASHLIMIT_HASH_DPT 0x0002
14#define IPT_HASHLIMIT_HASH_SIP 0x0004
15#define IPT_HASHLIMIT_HASH_SPT 0x0008
16 13
17struct hashlimit_cfg { 14#endif /* _IPT_HASHLIMIT_H */
18 u_int32_t mode; /* bitmask of IPT_HASHLIMIT_HASH_* */
19 u_int32_t avg; /* Average secs between packets * scale */
20 u_int32_t burst; /* Period multiplier for upper limit. */
21
22 /* user specified */
23 u_int32_t size; /* how many buckets */
24 u_int32_t max; /* max number of entries */
25 u_int32_t gc_interval; /* gc interval */
26 u_int32_t expire; /* when do entries expire? */
27};
28
29struct ipt_hashlimit_info {
30 char name [IFNAMSIZ]; /* name */
31 struct hashlimit_cfg cfg;
32 struct ipt_hashlimit_htable *hinfo;
33
34 /* Used internally by the kernel */
35 union {
36 void *ptr;
37 struct ipt_hashlimit_info *master;
38 } u;
39};
40#endif /*_IPT_HASHLIMIT_H*/
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index d97e268cdfe5..66ca8e3100dc 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -62,10 +62,8 @@ enum nf_ip6_hook_priorities {
62 NF_IP6_PRI_CONNTRACK_DEFRAG = -400, 62 NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
63 NF_IP6_PRI_SELINUX_FIRST = -225, 63 NF_IP6_PRI_SELINUX_FIRST = -225,
64 NF_IP6_PRI_CONNTRACK = -200, 64 NF_IP6_PRI_CONNTRACK = -200,
65 NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
66 NF_IP6_PRI_MANGLE = -150, 65 NF_IP6_PRI_MANGLE = -150,
67 NF_IP6_PRI_NAT_DST = -100, 66 NF_IP6_PRI_NAT_DST = -100,
68 NF_IP6_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
69 NF_IP6_PRI_FILTER = 0, 67 NF_IP6_PRI_FILTER = 0,
70 NF_IP6_PRI_NAT_SRC = 100, 68 NF_IP6_PRI_NAT_SRC = 100,
71 NF_IP6_PRI_SELINUX_LAST = 225, 69 NF_IP6_PRI_SELINUX_LAST = 225,
@@ -74,7 +72,7 @@ enum nf_ip6_hook_priorities {
74 72
75#ifdef CONFIG_NETFILTER 73#ifdef CONFIG_NETFILTER
76extern int ip6_route_me_harder(struct sk_buff *skb); 74extern int ip6_route_me_harder(struct sk_buff *skb);
77extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, 75extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
78 unsigned int dataoff, u_int8_t protocol); 76 unsigned int dataoff, u_int8_t protocol);
79 77
80extern int ipv6_netfilter_init(void); 78extern int ipv6_netfilter_init(void);
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h
index 060c1a1c6c60..0d0119b0458c 100644
--- a/include/linux/netfilter_ipv6/ip6t_LOG.h
+++ b/include/linux/netfilter_ipv6/ip6t_LOG.h
@@ -6,7 +6,7 @@
6#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ 6#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */
7#define IP6T_LOG_IPOPT 0x04 /* Log IP options */ 7#define IP6T_LOG_IPOPT 0x04 /* Log IP options */
8#define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ 8#define IP6T_LOG_UID 0x08 /* Log UID owning local socket */
9#define IP6T_LOG_NFLOG 0x10 /* Log using nf_log backend */ 9#define IP6T_LOG_NFLOG 0x10 /* Unsupported, don't use */
10#define IP6T_LOG_MASK 0x1f 10#define IP6T_LOG_MASK 0x1f
11 11
12struct ip6t_log_info { 12struct ip6t_log_info {
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 66411622e06e..b3b9b609ee89 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -141,7 +141,6 @@ struct netlink_skb_parms
141{ 141{
142 struct ucred creds; /* Skb credentials */ 142 struct ucred creds; /* Skb credentials */
143 __u32 pid; 143 __u32 pid;
144 __u32 dst_pid;
145 __u32 dst_group; 144 __u32 dst_group;
146 kernel_cap_t eff_cap; 145 kernel_cap_t eff_cap;
147 __u32 loginuid; /* Login (audit) uid */ 146 __u32 loginuid; /* Login (audit) uid */
@@ -174,6 +173,7 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol);
174 */ 173 */
175#define NLMSG_GOODORDER 0 174#define NLMSG_GOODORDER 0
176#define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER)) 175#define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER))
176#define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN)
177 177
178 178
179struct netlink_callback 179struct netlink_callback
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 1efe60c5c00c..29930b71a9aa 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -12,26 +12,27 @@
12#include <linux/rcupdate.h> 12#include <linux/rcupdate.h>
13#include <linux/list.h> 13#include <linux/list.h>
14 14
15struct netpoll;
16
17struct netpoll { 15struct netpoll {
18 struct net_device *dev; 16 struct net_device *dev;
19 char dev_name[16], *name; 17 char dev_name[IFNAMSIZ];
18 const char *name;
20 void (*rx_hook)(struct netpoll *, int, char *, int); 19 void (*rx_hook)(struct netpoll *, int, char *, int);
21 void (*drop)(struct sk_buff *skb); 20
22 u32 local_ip, remote_ip; 21 u32 local_ip, remote_ip;
23 u16 local_port, remote_port; 22 u16 local_port, remote_port;
24 unsigned char local_mac[6], remote_mac[6]; 23 u8 local_mac[ETH_ALEN], remote_mac[ETH_ALEN];
25}; 24};
26 25
27struct netpoll_info { 26struct netpoll_info {
27 atomic_t refcnt;
28 spinlock_t poll_lock; 28 spinlock_t poll_lock;
29 int poll_owner; 29 int poll_owner;
30 int tries;
31 int rx_flags; 30 int rx_flags;
32 spinlock_t rx_lock; 31 spinlock_t rx_lock;
33 struct netpoll *rx_np; /* netpoll that registered an rx_hook */ 32 struct netpoll *rx_np; /* netpoll that registered an rx_hook */
34 struct sk_buff_head arp_tx; /* list of arp requests to reply to */ 33 struct sk_buff_head arp_tx; /* list of arp requests to reply to */
34 struct sk_buff_head txq;
35 struct delayed_work tx_work;
35}; 36};
36 37
37void netpoll_poll(struct netpoll *np); 38void netpoll_poll(struct netpoll *np);
@@ -42,7 +43,7 @@ int netpoll_trap(void);
42void netpoll_set_trap(int trap); 43void netpoll_set_trap(int trap);
43void netpoll_cleanup(struct netpoll *np); 44void netpoll_cleanup(struct netpoll *np);
44int __netpoll_rx(struct sk_buff *skb); 45int __netpoll_rx(struct sk_buff *skb);
45void netpoll_queue(struct sk_buff *skb); 46
46 47
47#ifdef CONFIG_NETPOLL 48#ifdef CONFIG_NETPOLL
48static inline int netpoll_rx(struct sk_buff *skb) 49static inline int netpoll_rx(struct sk_buff *skb)
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 45228c1a1195..04963063e620 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -33,6 +33,7 @@
33#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ 33#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
34#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */ 34#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */
35#define FLUSH_INVALIDATE 64 /* Invalidate the page cache */ 35#define FLUSH_INVALIDATE 64 /* Invalidate the page cache */
36#define FLUSH_NOWRITEPAGE 128 /* Don't call writepage() */
36 37
37#ifdef __KERNEL__ 38#ifdef __KERNEL__
38 39
@@ -318,7 +319,7 @@ extern void put_nfs_open_context(struct nfs_open_context *ctx);
318extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); 319extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode);
319 320
320/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 321/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
321extern u32 root_nfs_parse_addr(char *name); /*__init*/ 322extern __be32 root_nfs_parse_addr(char *name); /*__init*/
322 323
323static inline void nfs_fattr_init(struct nfs_fattr *fattr) 324static inline void nfs_fattr_init(struct nfs_fattr *fattr)
324{ 325{
@@ -427,19 +428,21 @@ extern int nfs_flush_incompatible(struct file *file, struct page *page);
427extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); 428extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
428extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); 429extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
429extern void nfs_writedata_release(void *); 430extern void nfs_writedata_release(void *);
430 431extern int nfs_set_page_dirty(struct page *);
431#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
432struct nfs_write_data *nfs_commit_alloc(void);
433void nfs_commit_free(struct nfs_write_data *p);
434#endif
435 432
436/* 433/*
437 * Try to write back everything synchronously (but check the 434 * Try to write back everything synchronously (but check the
438 * return value!) 435 * return value!)
439 */ 436 */
440extern int nfs_sync_inode_wait(struct inode *, unsigned long, unsigned int, int); 437extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_control *, int);
438extern int nfs_sync_mapping_range(struct address_space *, loff_t, loff_t, int);
439extern int nfs_wb_all(struct inode *inode);
440extern int nfs_wb_page(struct inode *inode, struct page* page);
441extern int nfs_wb_page_priority(struct inode *inode, struct page* page, int how);
441#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 442#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
442extern int nfs_commit_inode(struct inode *, int); 443extern int nfs_commit_inode(struct inode *, int);
444extern struct nfs_write_data *nfs_commit_alloc(void);
445extern void nfs_commit_free(struct nfs_write_data *wdata);
443extern void nfs_commit_release(void *wdata); 446extern void nfs_commit_release(void *wdata);
444#else 447#else
445static inline int 448static inline int
@@ -455,28 +458,6 @@ nfs_have_writebacks(struct inode *inode)
455 return NFS_I(inode)->npages != 0; 458 return NFS_I(inode)->npages != 0;
456} 459}
457 460
458static inline int
459nfs_wb_all(struct inode *inode)
460{
461 int error = nfs_sync_inode_wait(inode, 0, 0, 0);
462 return (error < 0) ? error : 0;
463}
464
465/*
466 * Write back all requests on one page - we do this before reading it.
467 */
468static inline int nfs_wb_page_priority(struct inode *inode, struct page* page, int how)
469{
470 int error = nfs_sync_inode_wait(inode, page->index, 1,
471 how | FLUSH_STABLE);
472 return (error < 0) ? error : 0;
473}
474
475static inline int nfs_wb_page(struct inode *inode, struct page* page)
476{
477 return nfs_wb_page_priority(inode, page, 0);
478}
479
480/* 461/*
481 * Allocate nfs_write_data structures 462 * Allocate nfs_write_data structures
482 */ 463 */
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 7ccfc7ef0a83..95796e6924f1 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -51,7 +51,7 @@ struct nfs_client {
51 51
52 unsigned long cl_lease_time; 52 unsigned long cl_lease_time;
53 unsigned long cl_last_renewal; 53 unsigned long cl_last_renewal;
54 struct work_struct cl_renewd; 54 struct delayed_work cl_renewd;
55 55
56 struct rpc_wait_queue cl_rpcwaitq; 56 struct rpc_wait_queue cl_rpcwaitq;
57 57
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 1f7bd287c230..2e555d49c9b7 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -30,6 +30,8 @@
30#define PG_BUSY 0 30#define PG_BUSY 0
31#define PG_NEED_COMMIT 1 31#define PG_NEED_COMMIT 1
32#define PG_NEED_RESCHED 2 32#define PG_NEED_RESCHED 2
33#define PG_NEED_FLUSH 3
34#define PG_FLUSHING 4
33 35
34struct nfs_inode; 36struct nfs_inode;
35struct nfs_page { 37struct nfs_page {
@@ -60,8 +62,9 @@ extern void nfs_clear_request(struct nfs_page *req);
60extern void nfs_release_request(struct nfs_page *req); 62extern void nfs_release_request(struct nfs_page *req);
61 63
62 64
63extern int nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst, 65extern long nfs_scan_dirty(struct address_space *mapping,
64 unsigned long idx_start, unsigned int npages); 66 struct writeback_control *wbc,
67 struct list_head *dst);
65extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst, 68extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst,
66 unsigned long idx_start, unsigned int npages); 69 unsigned long idx_start, unsigned int npages);
67extern int nfs_coalesce_requests(struct list_head *, struct list_head *, 70extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 768c1ad5ff6f..9ee9da5e1cc9 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -785,8 +785,6 @@ struct nfs_rpc_ops {
785 int (*readlink)(struct inode *, struct page *, unsigned int, 785 int (*readlink)(struct inode *, struct page *, unsigned int,
786 unsigned int); 786 unsigned int);
787 int (*read) (struct nfs_read_data *); 787 int (*read) (struct nfs_read_data *);
788 int (*write) (struct nfs_write_data *);
789 int (*commit) (struct nfs_write_data *);
790 int (*create) (struct inode *, struct dentry *, 788 int (*create) (struct inode *, struct dentry *,
791 struct iattr *, int, struct nameidata *); 789 struct iattr *, int, struct nameidata *);
792 int (*remove) (struct inode *, struct qstr *); 790 int (*remove) (struct inode *, struct qstr *);
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index edb54c3171b3..0727774772ba 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -275,12 +275,12 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
275 * we might process an operation with side effects, and be unable to 275 * we might process an operation with side effects, and be unable to
276 * tell the client that the operation succeeded. 276 * tell the client that the operation succeeded.
277 * 277 *
278 * COMPOUND_SLACK_SPACE - this is the minimum amount of buffer space 278 * COMPOUND_SLACK_SPACE - this is the minimum bytes of buffer space
279 * needed to encode an "ordinary" _successful_ operation. (GETATTR, 279 * needed to encode an "ordinary" _successful_ operation. (GETATTR,
280 * READ, READDIR, and READLINK have their own buffer checks.) if we 280 * READ, READDIR, and READLINK have their own buffer checks.) if we
281 * fall below this level, we fail the next operation with NFS4ERR_RESOURCE. 281 * fall below this level, we fail the next operation with NFS4ERR_RESOURCE.
282 * 282 *
283 * COMPOUND_ERR_SLACK_SPACE - this is the minimum amount of buffer space 283 * COMPOUND_ERR_SLACK_SPACE - this is the minimum bytes of buffer space
284 * needed to encode an operation which has failed with NFS4ERR_RESOURCE. 284 * needed to encode an operation which has failed with NFS4ERR_RESOURCE.
285 * care is taken to ensure that we never fall below this level for any 285 * care is taken to ensure that we never fall below this level for any
286 * reason. 286 * reason.
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index c3673f487e84..ab5c236bd9a7 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -273,7 +273,6 @@ struct nfs4_stateid {
273 ((err) != nfserr_stale_stateid) && \ 273 ((err) != nfserr_stale_stateid) && \
274 ((err) != nfserr_bad_stateid)) 274 ((err) != nfserr_bad_stateid))
275 275
276extern __be32 nfsd4_renew(clientid_t *clid);
277extern __be32 nfs4_preprocess_stateid_op(struct svc_fh *current_fh, 276extern __be32 nfs4_preprocess_stateid_op(struct svc_fh *current_fh,
278 stateid_t *stateid, int flags, struct file **filp); 277 stateid_t *stateid, int flags, struct file **filp);
279extern void nfs4_lock_state(void); 278extern void nfs4_lock_state(void);
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 45ca01b5f844..09799bcee0ac 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -44,6 +44,12 @@
44#define NFSD4_MAX_TAGLEN 128 44#define NFSD4_MAX_TAGLEN 128
45#define XDR_LEN(n) (((n) + 3) & ~3) 45#define XDR_LEN(n) (((n) + 3) & ~3)
46 46
47struct nfsd4_compound_state {
48 struct svc_fh current_fh;
49 struct svc_fh save_fh;
50 struct nfs4_stateowner *replay_owner;
51};
52
47struct nfsd4_change_info { 53struct nfsd4_change_info {
48 u32 atomic; 54 u32 atomic;
49 u32 before_ctime_sec; 55 u32 before_ctime_sec;
@@ -430,35 +436,39 @@ __be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
430 struct dentry *dentry, __be32 *buffer, int *countp, 436 struct dentry *dentry, __be32 *buffer, int *countp,
431 u32 *bmval, struct svc_rqst *); 437 u32 *bmval, struct svc_rqst *);
432extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp, 438extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
439 struct nfsd4_compound_state *,
433 struct nfsd4_setclientid *setclid); 440 struct nfsd4_setclientid *setclid);
434extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, 441extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
442 struct nfsd4_compound_state *,
435 struct nfsd4_setclientid_confirm *setclientid_confirm); 443 struct nfsd4_setclientid_confirm *setclientid_confirm);
436extern __be32 nfsd4_process_open1(struct nfsd4_open *open); 444extern __be32 nfsd4_process_open1(struct nfsd4_open *open);
437extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, 445extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
438 struct svc_fh *current_fh, struct nfsd4_open *open); 446 struct svc_fh *current_fh, struct nfsd4_open *open);
439extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, 447extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
440 struct svc_fh *current_fh, struct nfsd4_open_confirm *oc, 448 struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc);
441 struct nfs4_stateowner **); 449extern __be32 nfsd4_close(struct svc_rqst *rqstp,
442extern __be32 nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, 450 struct nfsd4_compound_state *,
443 struct nfsd4_close *close, 451 struct nfsd4_close *close);
444 struct nfs4_stateowner **replay_owner);
445extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp, 452extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
446 struct svc_fh *current_fh, struct nfsd4_open_downgrade *od, 453 struct nfsd4_compound_state *,
447 struct nfs4_stateowner **replay_owner); 454 struct nfsd4_open_downgrade *od);
448extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, 455extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
449 struct nfsd4_lock *lock, 456 struct nfsd4_lock *lock);
450 struct nfs4_stateowner **replay_owner); 457extern __be32 nfsd4_lockt(struct svc_rqst *rqstp,
451extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh, 458 struct nfsd4_compound_state *,
452 struct nfsd4_lockt *lockt); 459 struct nfsd4_lockt *lockt);
453extern __be32 nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, 460extern __be32 nfsd4_locku(struct svc_rqst *rqstp,
454 struct nfsd4_locku *locku, 461 struct nfsd4_compound_state *,
455 struct nfs4_stateowner **replay_owner); 462 struct nfsd4_locku *locku);
456extern __be32 463extern __be32
457nfsd4_release_lockowner(struct svc_rqst *rqstp, 464nfsd4_release_lockowner(struct svc_rqst *rqstp,
465 struct nfsd4_compound_state *,
458 struct nfsd4_release_lockowner *rlockowner); 466 struct nfsd4_release_lockowner *rlockowner);
459extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); 467extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *);
460extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp, 468extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
461 struct svc_fh *current_fh, struct nfsd4_delegreturn *dr); 469 struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr);
470extern __be32 nfsd4_renew(struct svc_rqst *rqstp,
471 struct nfsd4_compound_state *, clientid_t *clid);
462#endif 472#endif
463 473
464/* 474/*
diff --git a/include/linux/nmi.h b/include/linux/nmi.h
index e16904e28c3a..acb4ed130247 100644
--- a/include/linux/nmi.h
+++ b/include/linux/nmi.h
@@ -15,9 +15,14 @@
15 * disables interrupts for a long time. This call is stateless. 15 * disables interrupts for a long time. This call is stateless.
16 */ 16 */
17#ifdef ARCH_HAS_NMI_WATCHDOG 17#ifdef ARCH_HAS_NMI_WATCHDOG
18#include <asm/nmi.h>
18extern void touch_nmi_watchdog(void); 19extern void touch_nmi_watchdog(void);
19#else 20#else
20# define touch_nmi_watchdog() touch_softlockup_watchdog() 21# define touch_nmi_watchdog() touch_softlockup_watchdog()
21#endif 22#endif
22 23
24#ifndef trigger_all_cpu_backtrace
25#define trigger_all_cpu_backtrace() do { } while (0)
26#endif
27
23#endif 28#endif
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 971d1c6dfc4b..0b9f0dc30d61 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -4,9 +4,10 @@
4#include <linux/spinlock.h> 4#include <linux/spinlock.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
6 6
7struct namespace; 7struct mnt_namespace;
8struct uts_namespace; 8struct uts_namespace;
9struct ipc_namespace; 9struct ipc_namespace;
10struct pid_namespace;
10 11
11/* 12/*
12 * A structure to contain pointers to all per-process 13 * A structure to contain pointers to all per-process
@@ -25,7 +26,8 @@ struct nsproxy {
25 spinlock_t nslock; 26 spinlock_t nslock;
26 struct uts_namespace *uts_ns; 27 struct uts_namespace *uts_ns;
27 struct ipc_namespace *ipc_ns; 28 struct ipc_namespace *ipc_ns;
28 struct namespace *namespace; 29 struct mnt_namespace *mnt_ns;
30 struct pid_namespace *pid_ns;
29}; 31};
30extern struct nsproxy init_nsproxy; 32extern struct nsproxy init_nsproxy;
31 33
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 4830a3bedfb2..350878a2d848 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -253,15 +253,11 @@ static inline void SetPageUptodate(struct page *page)
253 253
254struct page; /* forward declaration */ 254struct page; /* forward declaration */
255 255
256int test_clear_page_dirty(struct page *page); 256extern void cancel_dirty_page(struct page *page, unsigned int account_size);
257
257int test_clear_page_writeback(struct page *page); 258int test_clear_page_writeback(struct page *page);
258int test_set_page_writeback(struct page *page); 259int test_set_page_writeback(struct page *page);
259 260
260static inline void clear_page_dirty(struct page *page)
261{
262 test_clear_page_dirty(page);
263}
264
265static inline void set_page_writeback(struct page *page) 261static inline void set_page_writeback(struct page *page)
266{ 262{
267 test_set_page_writeback(page); 263 test_set_page_writeback(page);
diff --git a/include/linux/pata_platform.h b/include/linux/pata_platform.h
new file mode 100644
index 000000000000..2d5fd647e0e9
--- /dev/null
+++ b/include/linux/pata_platform.h
@@ -0,0 +1,13 @@
1#ifndef __LINUX_PATA_PLATFORM_H
2#define __LINUX_PATA_PLATFORM_H
3
4struct pata_platform_info {
5 /*
6 * I/O port shift, for platforms with ports that are
7 * constantly spaced and need larger than the 1-byte
8 * spacing used by ata_std_ports().
9 */
10 unsigned int ioport_shift;
11};
12
13#endif /* __LINUX_PATA_PLATFORM_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 09be0f81b27b..f3c617eabd8d 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -20,9 +20,6 @@
20/* Include the pci register defines */ 20/* Include the pci register defines */
21#include <linux/pci_regs.h> 21#include <linux/pci_regs.h>
22 22
23/* Include the ID list */
24#include <linux/pci_ids.h>
25
26/* 23/*
27 * The PCI interface treats multi-function devices as independent 24 * The PCI interface treats multi-function devices as independent
28 * devices. The slot/function address of each device is encoded 25 * devices. The slot/function address of each device is encoded
@@ -51,8 +48,12 @@
51#include <linux/list.h> 48#include <linux/list.h>
52#include <linux/compiler.h> 49#include <linux/compiler.h>
53#include <linux/errno.h> 50#include <linux/errno.h>
51#include <asm/atomic.h>
54#include <linux/device.h> 52#include <linux/device.h>
55 53
54/* Include the ID list */
55#include <linux/pci_ids.h>
56
56/* File state for mmap()s on /proc/bus/pci/X/Y */ 57/* File state for mmap()s on /proc/bus/pci/X/Y */
57enum pci_mmap_state { 58enum pci_mmap_state {
58 pci_mmap_io, 59 pci_mmap_io,
@@ -159,7 +160,6 @@ struct pci_dev {
159 unsigned int transparent:1; /* Transparent PCI bridge */ 160 unsigned int transparent:1; /* Transparent PCI bridge */
160 unsigned int multifunction:1;/* Part of multi-function device */ 161 unsigned int multifunction:1;/* Part of multi-function device */
161 /* keep track of device state */ 162 /* keep track of device state */
162 unsigned int is_enabled:1; /* pci_enable_device has been called */
163 unsigned int is_busmaster:1; /* device is busmaster */ 163 unsigned int is_busmaster:1; /* device is busmaster */
164 unsigned int no_msi:1; /* device may not use msi */ 164 unsigned int no_msi:1; /* device may not use msi */
165 unsigned int no_d1d2:1; /* only allow d0 or d3 */ 165 unsigned int no_d1d2:1; /* only allow d0 or d3 */
@@ -167,6 +167,7 @@ struct pci_dev {
167 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 167 unsigned int broken_parity_status:1; /* Device generates false positive parity */
168 unsigned int msi_enabled:1; 168 unsigned int msi_enabled:1;
169 unsigned int msix_enabled:1; 169 unsigned int msix_enabled:1;
170 atomic_t enable_cnt; /* pci_enable_device has been called */
170 171
171 u32 saved_config_space[16]; /* config space saved at suspend time */ 172 u32 saved_config_space[16]; /* config space saved at suspend time */
172 struct hlist_head saved_cap_space; 173 struct hlist_head saved_cap_space;
@@ -395,6 +396,21 @@ struct pci_driver {
395 */ 396 */
396#define pci_module_init pci_register_driver 397#define pci_module_init pci_register_driver
397 398
399/**
400 * PCI_VDEVICE - macro used to describe a specific pci device in short form
401 * @vend: the vendor name
402 * @dev: the 16 bit PCI Device ID
403 *
404 * This macro is used to create a struct pci_device_id that matches a
405 * specific PCI device. The subvendor, and subdevice fields will be set
406 * to PCI_ANY_ID. The macro allows the next field to follow as the device
407 * private data.
408 */
409
410#define PCI_VDEVICE(vendor, device) \
411 PCI_VENDOR_ID_##vendor, (device), \
412 PCI_ANY_ID, PCI_ANY_ID, 0, 0
413
398/* these external functions are only available when PCI support is enabled */ 414/* these external functions are only available when PCI support is enabled */
399#ifdef CONFIG_PCI 415#ifdef CONFIG_PCI
400 416
@@ -453,6 +469,8 @@ struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
453int pci_find_capability (struct pci_dev *dev, int cap); 469int pci_find_capability (struct pci_dev *dev, int cap);
454int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 470int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
455int pci_find_ext_capability (struct pci_dev *dev, int cap); 471int pci_find_ext_capability (struct pci_dev *dev, int cap);
472int pci_find_ht_capability (struct pci_dev *dev, int ht_cap);
473int pci_find_next_ht_capability (struct pci_dev *dev, int pos, int ht_cap);
456struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 474struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
457 475
458struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, 476struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
@@ -467,6 +485,7 @@ struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn);
467struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn); 485struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn);
468struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from); 486struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from);
469int pci_dev_present(const struct pci_device_id *ids); 487int pci_dev_present(const struct pci_device_id *ids);
488const struct pci_device_id *pci_find_present(const struct pci_device_id *ids);
470 489
471int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val); 490int pci_bus_read_config_byte (struct pci_bus *bus, unsigned int devfn, int where, u8 *val);
472int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val); 491int pci_bus_read_config_word (struct pci_bus *bus, unsigned int devfn, int where, u16 *val);
@@ -680,6 +699,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *
680{ return NULL; } 699{ return NULL; }
681 700
682#define pci_dev_present(ids) (0) 701#define pci_dev_present(ids) (0)
702#define pci_find_present(ids) (NULL)
683#define pci_dev_put(dev) do { } while (0) 703#define pci_dev_put(dev) do { } while (0)
684 704
685static inline void pci_set_master(struct pci_dev *dev) { } 705static inline void pci_set_master(struct pci_dev *dev) { }
@@ -782,6 +802,7 @@ enum pci_fixup_pass {
782 pci_fixup_header, /* After reading configuration header */ 802 pci_fixup_header, /* After reading configuration header */
783 pci_fixup_final, /* Final phase of device fixups */ 803 pci_fixup_final, /* Final phase of device fixups */
784 pci_fixup_enable, /* pci_enable_device() time */ 804 pci_fixup_enable, /* pci_enable_device() time */
805 pci_fixup_resume, /* pci_enable_device() time */
785}; 806};
786 807
787/* Anonymous variables would be nice... */ 808/* Anonymous variables would be nice... */
@@ -800,6 +821,9 @@ enum pci_fixup_pass {
800#define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ 821#define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \
801 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ 822 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \
802 vendor##device##hook, vendor, device, hook) 823 vendor##device##hook, vendor, device, hook)
824#define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \
825 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \
826 resume##vendor##device##hook, vendor, device, hook)
803 827
804 828
805void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 829void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index fa4e1d799782..f7a416c52edc 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -104,6 +104,10 @@
104#define PCI_CLASS_SERIAL_FIBER 0x0c04 104#define PCI_CLASS_SERIAL_FIBER 0x0c04
105#define PCI_CLASS_SERIAL_SMBUS 0x0c05 105#define PCI_CLASS_SERIAL_SMBUS 0x0c05
106 106
107#define PCI_BASE_CLASS_WIRELESS 0x0d
108#define PCI_CLASS_WIRELESS_RF_CONTROLLER 0x0d10
109#define PCI_CLASS_WIRELESS_WHCI 0x0d1010
110
107#define PCI_BASE_CLASS_INTELLIGENT 0x0e 111#define PCI_BASE_CLASS_INTELLIGENT 0x0e
108#define PCI_CLASS_INTELLIGENT_I2O 0x0e00 112#define PCI_CLASS_INTELLIGENT_I2O 0x0e00
109 113
@@ -390,7 +394,7 @@
390#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d 394#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
391#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e 395#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e
392#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f 396#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f
393#define PCI_DEVICE_ID_NS_CS5535_VIDEO 0x0030 397#define PCI_DEVICE_ID_NS_GX_VIDEO 0x0030
394#define PCI_DEVICE_ID_NS_SATURN 0x0035 398#define PCI_DEVICE_ID_NS_SATURN 0x0035
395#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 399#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500
396#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 400#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501
@@ -403,8 +407,7 @@
403#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515 407#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515
404#define PCI_DEVICE_ID_NS_87410 0xd001 408#define PCI_DEVICE_ID_NS_87410 0xd001
405 409
406#define PCI_DEVICE_ID_NS_CS5535_HOST_BRIDGE 0x0028 410#define PCI_DEVICE_ID_NS_GX_HOST_BRIDGE 0x0028
407#define PCI_DEVICE_ID_NS_CS5535_ISA_BRIDGE 0x002b
408 411
409#define PCI_VENDOR_ID_TSENG 0x100c 412#define PCI_VENDOR_ID_TSENG 0x100c
410#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202 413#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202
@@ -1213,6 +1216,10 @@
1213#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 1216#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
1214#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 1217#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
1215#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453 1218#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453
1219#define PCI_DEVICE_ID_NVIDIA_NVENET_24 0x054C
1220#define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D
1221#define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E
1222#define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F
1216#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 1223#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560
1217 1224
1218#define PCI_VENDOR_ID_IMS 0x10e0 1225#define PCI_VENDOR_ID_IMS 0x10e0
@@ -1270,6 +1277,7 @@
1270#define PCI_DEVICE_ID_VIA_3296_0 0x0296 1277#define PCI_DEVICE_ID_VIA_3296_0 0x0296
1271#define PCI_DEVICE_ID_VIA_8363_0 0x0305 1278#define PCI_DEVICE_ID_VIA_8363_0 0x0305
1272#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314 1279#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314
1280#define PCI_DEVICE_ID_VIA_K8M890CE 0x0336
1273#define PCI_DEVICE_ID_VIA_8371_0 0x0391 1281#define PCI_DEVICE_ID_VIA_8371_0 0x0391
1274#define PCI_DEVICE_ID_VIA_8501_0 0x0501 1282#define PCI_DEVICE_ID_VIA_8501_0 0x0501
1275#define PCI_DEVICE_ID_VIA_82C561 0x0561 1283#define PCI_DEVICE_ID_VIA_82C561 0x0561
@@ -1782,14 +1790,17 @@
1782#define PCI_DEVICE_ID_MOXA_C104 0x1040 1790#define PCI_DEVICE_ID_MOXA_C104 0x1040
1783#define PCI_DEVICE_ID_MOXA_CP104U 0x1041 1791#define PCI_DEVICE_ID_MOXA_CP104U 0x1041
1784#define PCI_DEVICE_ID_MOXA_CP104JU 0x1042 1792#define PCI_DEVICE_ID_MOXA_CP104JU 0x1042
1793#define PCI_DEVICE_ID_MOXA_CP104EL 0x1043
1785#define PCI_DEVICE_ID_MOXA_CT114 0x1140 1794#define PCI_DEVICE_ID_MOXA_CT114 0x1140
1786#define PCI_DEVICE_ID_MOXA_CP114 0x1141 1795#define PCI_DEVICE_ID_MOXA_CP114 0x1141
1787#define PCI_DEVICE_ID_MOXA_CP118U 0x1180 1796#define PCI_DEVICE_ID_MOXA_CP118U 0x1180
1797#define PCI_DEVICE_ID_MOXA_CP118EL 0x1181
1788#define PCI_DEVICE_ID_MOXA_CP132 0x1320 1798#define PCI_DEVICE_ID_MOXA_CP132 0x1320
1789#define PCI_DEVICE_ID_MOXA_CP132U 0x1321 1799#define PCI_DEVICE_ID_MOXA_CP132U 0x1321
1790#define PCI_DEVICE_ID_MOXA_CP134U 0x1340 1800#define PCI_DEVICE_ID_MOXA_CP134U 0x1340
1791#define PCI_DEVICE_ID_MOXA_C168 0x1680 1801#define PCI_DEVICE_ID_MOXA_C168 0x1680
1792#define PCI_DEVICE_ID_MOXA_CP168U 0x1681 1802#define PCI_DEVICE_ID_MOXA_CP168U 0x1681
1803#define PCI_DEVICE_ID_MOXA_CP168EL 0x1682
1793 1804
1794#define PCI_VENDOR_ID_CCD 0x1397 1805#define PCI_VENDOR_ID_CCD 0x1397
1795#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0 1806#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0
@@ -1860,6 +1871,7 @@
1860#define PCI_DEVICE_ID_OXSEMI_16PCI95N 0x9511 1871#define PCI_DEVICE_ID_OXSEMI_16PCI95N 0x9511
1861#define PCI_DEVICE_ID_OXSEMI_16PCI954PP 0x9513 1872#define PCI_DEVICE_ID_OXSEMI_16PCI954PP 0x9513
1862#define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521 1873#define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521
1874#define PCI_DEVICE_ID_OXSEMI_16PCI952PP 0x9523
1863 1875
1864#define PCI_VENDOR_ID_SAMSUNG 0x144d 1876#define PCI_VENDOR_ID_SAMSUNG 0x144d
1865 1877
@@ -1893,6 +1905,7 @@
1893#define PCI_VENDOR_ID_BROADCOM 0x14e4 1905#define PCI_VENDOR_ID_BROADCOM 0x14e4
1894#define PCI_DEVICE_ID_TIGON3_5752 0x1600 1906#define PCI_DEVICE_ID_TIGON3_5752 0x1600
1895#define PCI_DEVICE_ID_TIGON3_5752M 0x1601 1907#define PCI_DEVICE_ID_TIGON3_5752M 0x1601
1908#define PCI_DEVICE_ID_NX2_5709 0x1639
1896#define PCI_DEVICE_ID_TIGON3_5700 0x1644 1909#define PCI_DEVICE_ID_TIGON3_5700 0x1644
1897#define PCI_DEVICE_ID_TIGON3_5701 0x1645 1910#define PCI_DEVICE_ID_TIGON3_5701 0x1645
1898#define PCI_DEVICE_ID_TIGON3_5702 0x1646 1911#define PCI_DEVICE_ID_TIGON3_5702 0x1646
@@ -1926,6 +1939,7 @@
1926#define PCI_DEVICE_ID_TIGON3_5750M 0x167c 1939#define PCI_DEVICE_ID_TIGON3_5750M 0x167c
1927#define PCI_DEVICE_ID_TIGON3_5751M 0x167d 1940#define PCI_DEVICE_ID_TIGON3_5751M 0x167d
1928#define PCI_DEVICE_ID_TIGON3_5751F 0x167e 1941#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
1942#define PCI_DEVICE_ID_TIGON3_5787F 0x167f
1929#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 1943#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
1930#define PCI_DEVICE_ID_TIGON3_5782 0x1696 1944#define PCI_DEVICE_ID_TIGON3_5782 0x1696
1931#define PCI_DEVICE_ID_TIGON3_5786 0x169a 1945#define PCI_DEVICE_ID_TIGON3_5786 0x169a
@@ -1997,6 +2011,8 @@
1997#define PCI_DEVICE_ID_FARSITE_TE1 0x1610 2011#define PCI_DEVICE_ID_FARSITE_TE1 0x1610
1998#define PCI_DEVICE_ID_FARSITE_TE1C 0x1612 2012#define PCI_DEVICE_ID_FARSITE_TE1C 0x1612
1999 2013
2014#define PCI_VENDOR_ID_ARIMA 0x161f
2015
2000#define PCI_VENDOR_ID_SIBYTE 0x166d 2016#define PCI_VENDOR_ID_SIBYTE 0x166d
2001#define PCI_DEVICE_ID_BCM1250_PCI 0x0001 2017#define PCI_DEVICE_ID_BCM1250_PCI 0x0001
2002#define PCI_DEVICE_ID_BCM1250_HT 0x0002 2018#define PCI_DEVICE_ID_BCM1250_HT 0x0002
@@ -2056,6 +2072,10 @@
2056#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366 2072#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366
2057#define PCI_DEVICE_ID_JMICRON_JMB368 0x2368 2073#define PCI_DEVICE_ID_JMICRON_JMB368 0x2368
2058 2074
2075#define PCI_VENDOR_ID_KORENIX 0x1982
2076#define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600
2077#define PCI_DEVICE_ID_KORENIX_JETCARDF1 0x16ff
2078
2059#define PCI_VENDOR_ID_TEKRAM 0x1de1 2079#define PCI_VENDOR_ID_TEKRAM 0x1de1
2060#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 2080#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29
2061 2081
@@ -2211,6 +2231,13 @@
2211#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 2231#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815
2212#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e 2232#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
2213#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 2233#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
2234#define PCI_DEVICE_ID_INTEL_ICH9_0 0x2910
2235#define PCI_DEVICE_ID_INTEL_ICH9_1 0x2911
2236#define PCI_DEVICE_ID_INTEL_ICH9_2 0x2912
2237#define PCI_DEVICE_ID_INTEL_ICH9_3 0x2913
2238#define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914
2239#define PCI_DEVICE_ID_INTEL_ICH9_5 0x2915
2240#define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930
2214#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2241#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2215#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2242#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2216#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2243#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index c321316f1bc7..7a6d34ee5ab1 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -292,6 +292,12 @@
292#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 292#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
293#define PCI_MSI_MASK_BIT 16 /* Mask bits register */ 293#define PCI_MSI_MASK_BIT 16 /* Mask bits register */
294 294
295/* MSI-X registers (these are at offset PCI_MSI_FLAGS) */
296#define PCI_MSIX_FLAGS_QSIZE 0x7FF
297#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
298#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
299#define PCI_MSIX_FLAGS_BITMASK (1 << 0)
300
295/* CompactPCI Hotswap Register */ 301/* CompactPCI Hotswap Register */
296 302
297#define PCI_CHSWP_CSR 2 /* Control and Status Register */ 303#define PCI_CHSWP_CSR 2 /* Control and Status Register */
@@ -469,15 +475,32 @@
469#define PCI_PWR_CAP 12 /* Capability */ 475#define PCI_PWR_CAP 12 /* Capability */
470#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ 476#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
471 477
472/* Hypertransport sub capability types */ 478/*
479 * Hypertransport sub capability types
480 *
481 * Unfortunately there are both 3 bit and 5 bit capability types defined
482 * in the HT spec, catering for that is a little messy. You probably don't
483 * want to use these directly, just use pci_find_ht_capability() and it
484 * will do the right thing for you.
485 */
486#define HT_3BIT_CAP_MASK 0xE0
473#define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */ 487#define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */
474#define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */ 488#define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */
489
490#define HT_5BIT_CAP_MASK 0xF8
475#define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */ 491#define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */
476#define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */ 492#define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */
477#define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */ 493#define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */
478#define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */ 494#define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */
479#define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */ 495#define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */
480#define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */ 496#define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */
497#define HT_MSI_FLAGS 0x02 /* Offset to flags */
498#define HT_MSI_FLAGS_ENABLE 0x1 /* Mapping enable */
499#define HT_MSI_FLAGS_FIXED 0x2 /* Fixed mapping only */
500#define HT_MSI_FIXED_ADDR 0x00000000FEE00000ULL /* Fixed addr */
501#define HT_MSI_ADDR_LO 0x04 /* Offset to low addr bits */
502#define HT_MSI_ADDR_LO_MASK 0xFFF00000 /* Low address bit mask */
503#define HT_MSI_ADDR_HI 0x08 /* Offset to high addr bits */
481#define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */ 504#define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */
482#define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */ 505#define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */
483#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ 506#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index d5dd471da225..265bafab6494 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -32,7 +32,7 @@ struct sadb_ext {
32struct sadb_sa { 32struct sadb_sa {
33 uint16_t sadb_sa_len; 33 uint16_t sadb_sa_len;
34 uint16_t sadb_sa_exttype; 34 uint16_t sadb_sa_exttype;
35 uint32_t sadb_sa_spi; 35 __be32 sadb_sa_spi;
36 uint8_t sadb_sa_replay; 36 uint8_t sadb_sa_replay;
37 uint8_t sadb_sa_state; 37 uint8_t sadb_sa_state;
38 uint8_t sadb_sa_auth; 38 uint8_t sadb_sa_auth;
@@ -211,7 +211,7 @@ struct sadb_x_nat_t_type {
211struct sadb_x_nat_t_port { 211struct sadb_x_nat_t_port {
212 uint16_t sadb_x_nat_t_port_len; 212 uint16_t sadb_x_nat_t_port_len;
213 uint16_t sadb_x_nat_t_port_exttype; 213 uint16_t sadb_x_nat_t_port_exttype;
214 uint16_t sadb_x_nat_t_port_port; 214 __be16 sadb_x_nat_t_port_port;
215 uint16_t sadb_x_nat_t_port_reserved; 215 uint16_t sadb_x_nat_t_port_reserved;
216} __attribute__((packed)); 216} __attribute__((packed));
217/* sizeof(struct sadb_x_nat_t_port) == 8 */ 217/* sizeof(struct sadb_x_nat_t_port) == 8 */
@@ -285,6 +285,7 @@ struct sadb_x_sec_ctx {
285#define SADB_X_AALG_SHA2_384HMAC 6 285#define SADB_X_AALG_SHA2_384HMAC 6
286#define SADB_X_AALG_SHA2_512HMAC 7 286#define SADB_X_AALG_SHA2_512HMAC 7
287#define SADB_X_AALG_RIPEMD160HMAC 8 287#define SADB_X_AALG_RIPEMD160HMAC 8
288#define SADB_X_AALG_AES_XCBC_MAC 9
288#define SADB_X_AALG_NULL 251 /* kame */ 289#define SADB_X_AALG_NULL 251 /* kame */
289#define SADB_AALG_MAX 251 290#define SADB_AALG_MAX 251
290 291
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 9447a57ee8a9..edd4c88ca7d8 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -20,6 +20,10 @@
20 20
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/ethtool.h>
24#include <linux/mii.h>
25#include <linux/timer.h>
26#include <linux/workqueue.h>
23 27
24#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ 28#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
25 SUPPORTED_10baseT_Full | \ 29 SUPPORTED_10baseT_Full | \
@@ -43,15 +47,26 @@
43#define PHY_HAS_INTERRUPT 0x00000001 47#define PHY_HAS_INTERRUPT 0x00000001
44#define PHY_HAS_MAGICANEG 0x00000002 48#define PHY_HAS_MAGICANEG 0x00000002
45 49
50/* Interface Mode definitions */
51typedef enum {
52 PHY_INTERFACE_MODE_MII,
53 PHY_INTERFACE_MODE_GMII,
54 PHY_INTERFACE_MODE_SGMII,
55 PHY_INTERFACE_MODE_TBI,
56 PHY_INTERFACE_MODE_RMII,
57 PHY_INTERFACE_MODE_RGMII,
58 PHY_INTERFACE_MODE_RTBI
59} phy_interface_t;
60
46#define MII_BUS_MAX 4 61#define MII_BUS_MAX 4
47 62
48 63
49#define PHY_INIT_TIMEOUT 100000 64#define PHY_INIT_TIMEOUT 100000
50#define PHY_STATE_TIME 1 65#define PHY_STATE_TIME 1
51#define PHY_FORCE_TIMEOUT 10 66#define PHY_FORCE_TIMEOUT 10
52#define PHY_AN_TIMEOUT 10 67#define PHY_AN_TIMEOUT 10
53 68
54#define PHY_MAX_ADDR 32 69#define PHY_MAX_ADDR 32
55 70
56/* Used when trying to connect to a specific phy (mii bus id:phy device id) */ 71/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
57#define PHY_ID_FMT "%x:%02x" 72#define PHY_ID_FMT "%x:%02x"
@@ -83,8 +98,8 @@ struct mii_bus {
83 int *irq; 98 int *irq;
84}; 99};
85 100
86#define PHY_INTERRUPT_DISABLED 0x0 101#define PHY_INTERRUPT_DISABLED 0x0
87#define PHY_INTERRUPT_ENABLED 0x80000000 102#define PHY_INTERRUPT_ENABLED 0x80000000
88 103
89/* PHY state machine states: 104/* PHY state machine states:
90 * 105 *
@@ -226,6 +241,8 @@ struct phy_device {
226 241
227 u32 dev_flags; 242 u32 dev_flags;
228 243
244 phy_interface_t interface;
245
229 /* Bus address of the PHY (0-32) */ 246 /* Bus address of the PHY (0-32) */
230 int addr; 247 int addr;
231 248
@@ -341,9 +358,10 @@ struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
341int phy_clear_interrupt(struct phy_device *phydev); 358int phy_clear_interrupt(struct phy_device *phydev);
342int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); 359int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
343struct phy_device * phy_attach(struct net_device *dev, 360struct phy_device * phy_attach(struct net_device *dev,
344 const char *phy_id, u32 flags); 361 const char *phy_id, u32 flags, phy_interface_t interface);
345struct phy_device * phy_connect(struct net_device *dev, const char *phy_id, 362struct phy_device * phy_connect(struct net_device *dev, const char *phy_id,
346 void (*handler)(struct net_device *), u32 flags); 363 void (*handler)(struct net_device *), u32 flags,
364 phy_interface_t interface);
347void phy_disconnect(struct phy_device *phydev); 365void phy_disconnect(struct phy_device *phydev);
348void phy_detach(struct phy_device *phydev); 366void phy_detach(struct phy_device *phydev);
349void phy_start(struct phy_device *phydev); 367void phy_start(struct phy_device *phydev);
diff --git a/include/linux/pid.h b/include/linux/pid.h
index 2c0007d17218..4dec047b1837 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -35,8 +35,9 @@ enum pid_type
35 * 35 *
36 * Holding a reference to struct pid solves both of these problems. 36 * Holding a reference to struct pid solves both of these problems.
37 * It is small so holding a reference does not consume a lot of 37 * It is small so holding a reference does not consume a lot of
38 * resources, and since a new struct pid is allocated when the numeric 38 * resources, and since a new struct pid is allocated when the numeric pid
39 * pid value is reused we don't mistakenly refer to new processes. 39 * value is reused (when pids wrap around) we don't mistakenly refer to new
40 * processes.
40 */ 41 */
41 42
42struct pid 43struct pid
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
new file mode 100644
index 000000000000..d2a9d419f01f
--- /dev/null
+++ b/include/linux/pid_namespace.h
@@ -0,0 +1,45 @@
1#ifndef _LINUX_PID_NS_H
2#define _LINUX_PID_NS_H
3
4#include <linux/sched.h>
5#include <linux/mm.h>
6#include <linux/threads.h>
7#include <linux/pid.h>
8#include <linux/nsproxy.h>
9#include <linux/kref.h>
10
11struct pidmap {
12 atomic_t nr_free;
13 void *page;
14};
15
16#define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
17
18struct pid_namespace {
19 struct kref kref;
20 struct pidmap pidmap[PIDMAP_ENTRIES];
21 int last_pid;
22 struct task_struct *child_reaper;
23};
24
25extern struct pid_namespace init_pid_ns;
26
27static inline void get_pid_ns(struct pid_namespace *ns)
28{
29 kref_get(&ns->kref);
30}
31
32extern int copy_pid_ns(int flags, struct task_struct *tsk);
33extern void free_pid_ns(struct kref *kref);
34
35static inline void put_pid_ns(struct pid_namespace *ns)
36{
37 kref_put(&ns->kref, free_pid_ns);
38}
39
40static inline struct task_struct *child_reaper(struct task_struct *tsk)
41{
42 return tsk->nsproxy->pid_ns->child_reaper;
43}
44
45#endif /* _LINUX_PID_NS_H */
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index ea4f7cd7bfd8..2e19478e9e84 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -12,7 +12,7 @@
12struct pipe_buffer { 12struct pipe_buffer {
13 struct page *page; 13 struct page *page;
14 unsigned int offset, len; 14 unsigned int offset, len;
15 struct pipe_buf_operations *ops; 15 const struct pipe_buf_operations *ops;
16 unsigned int flags; 16 unsigned int flags;
17}; 17};
18 18
@@ -41,9 +41,7 @@ struct pipe_buf_operations {
41struct pipe_inode_info { 41struct pipe_inode_info {
42 wait_queue_head_t wait; 42 wait_queue_head_t wait;
43 unsigned int nrbufs, curbuf; 43 unsigned int nrbufs, curbuf;
44 struct pipe_buffer bufs[PIPE_BUFFERS];
45 struct page *tmp_page; 44 struct page *tmp_page;
46 unsigned int start;
47 unsigned int readers; 45 unsigned int readers;
48 unsigned int writers; 46 unsigned int writers;
49 unsigned int waiting_writers; 47 unsigned int waiting_writers;
@@ -52,6 +50,7 @@ struct pipe_inode_info {
52 struct fasync_struct *fasync_readers; 50 struct fasync_struct *fasync_readers;
53 struct fasync_struct *fasync_writers; 51 struct fasync_struct *fasync_writers;
54 struct inode *inode; 52 struct inode *inode;
53 struct pipe_buffer bufs[PIPE_BUFFERS];
55}; 54};
56 55
57/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual 56/* Differs from PIPE_BUF in that PIPE_SIZE is the length of the actual
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index 8a94c717c266..5ea4f05683f6 100644
--- a/include/linux/pktcdvd.h
+++ b/include/linux/pktcdvd.h
@@ -111,6 +111,13 @@ struct pkt_ctrl_command {
111#include <linux/blkdev.h> 111#include <linux/blkdev.h>
112#include <linux/completion.h> 112#include <linux/completion.h>
113#include <linux/cdrom.h> 113#include <linux/cdrom.h>
114#include <linux/kobject.h>
115#include <linux/sysfs.h>
116
117/* default bio write queue congestion marks */
118#define PKT_WRITE_CONGESTION_ON 10000
119#define PKT_WRITE_CONGESTION_OFF 9000
120
114 121
115struct packet_settings 122struct packet_settings
116{ 123{
@@ -241,6 +248,14 @@ struct packet_stacked_data
241}; 248};
242#define PSD_POOL_SIZE 64 249#define PSD_POOL_SIZE 64
243 250
251struct pktcdvd_kobj
252{
253 struct kobject kobj;
254 struct pktcdvd_device *pd;
255};
256#define to_pktcdvdkobj(_k) \
257 ((struct pktcdvd_kobj*)container_of(_k,struct pktcdvd_kobj,kobj))
258
244struct pktcdvd_device 259struct pktcdvd_device
245{ 260{
246 struct block_device *bdev; /* dev attached */ 261 struct block_device *bdev; /* dev attached */
@@ -271,6 +286,16 @@ struct pktcdvd_device
271 286
272 struct packet_iosched iosched; 287 struct packet_iosched iosched;
273 struct gendisk *disk; 288 struct gendisk *disk;
289
290 int write_congestion_off;
291 int write_congestion_on;
292
293 struct class_device *clsdev; /* sysfs pktcdvd[0-7] class dev */
294 struct pktcdvd_kobj *kobj_stat; /* sysfs pktcdvd[0-7]/stat/ */
295 struct pktcdvd_kobj *kobj_wqueue; /* sysfs pktcdvd[0-7]/write_queue/ */
296
297 struct dentry *dfs_d_root; /* debugfs: devname directory */
298 struct dentry *dfs_f_info; /* debugfs: info file */
274}; 299};
275 300
276#endif /* __KERNEL__ */ 301#endif /* __KERNEL__ */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 29cd6dee13db..8bbd459eafdc 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -39,7 +39,7 @@ extern struct platform_device *platform_device_register_simple(char *, unsigned
39 39
40extern struct platform_device *platform_device_alloc(const char *name, unsigned int id); 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); 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); 42extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size);
43extern int platform_device_add(struct platform_device *pdev); 43extern int platform_device_add(struct platform_device *pdev);
44extern void platform_device_del(struct platform_device *pdev); 44extern void platform_device_del(struct platform_device *pdev);
45extern void platform_device_put(struct platform_device *pdev); 45extern void platform_device_put(struct platform_device *pdev);
@@ -58,6 +58,12 @@ struct platform_driver {
58extern int platform_driver_register(struct platform_driver *); 58extern int platform_driver_register(struct platform_driver *);
59extern void platform_driver_unregister(struct platform_driver *); 59extern void platform_driver_unregister(struct platform_driver *);
60 60
61/* non-hotpluggable platform devices may use this so that probe() and
62 * its support may live in __init sections, conserving runtime memory.
63 */
64extern int platform_driver_probe(struct platform_driver *driver,
65 int (*probe)(struct platform_device *));
66
61#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) 67#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
62#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) 68#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
63 69
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 51e1b56741fb..27690798623f 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -8,7 +8,8 @@
8#include <linux/compiler.h> 8#include <linux/compiler.h>
9#include <linux/wait.h> 9#include <linux/wait.h>
10#include <linux/string.h> 10#include <linux/string.h>
11#include <linux/mm.h> 11#include <linux/fs.h>
12#include <linux/sched.h>
12#include <asm/uaccess.h> 13#include <asm/uaccess.h>
13 14
14/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating 15/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating
diff --git a/include/linux/profile.h b/include/linux/profile.h
index acce53fd38b6..eec48f5f9348 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -6,10 +6,16 @@
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/init.h> 7#include <linux/init.h>
8#include <linux/cpumask.h> 8#include <linux/cpumask.h>
9#include <linux/cache.h>
10
9#include <asm/errno.h> 11#include <asm/errno.h>
10 12
13extern int prof_on __read_mostly;
14
11#define CPU_PROFILING 1 15#define CPU_PROFILING 1
12#define SCHED_PROFILING 2 16#define SCHED_PROFILING 2
17#define SLEEP_PROFILING 3
18#define KVM_PROFILING 4
13 19
14struct proc_dir_entry; 20struct proc_dir_entry;
15struct pt_regs; 21struct pt_regs;
@@ -18,7 +24,24 @@ struct notifier_block;
18/* init basic kernel profiler */ 24/* init basic kernel profiler */
19void __init profile_init(void); 25void __init profile_init(void);
20void profile_tick(int); 26void profile_tick(int);
21void profile_hit(int, void *); 27
28/*
29 * Add multiple profiler hits to a given address:
30 */
31void profile_hits(int, void *ip, unsigned int nr_hits);
32
33/*
34 * Single profiler hit:
35 */
36static inline void profile_hit(int type, void *ip)
37{
38 /*
39 * Speedup for the common (no profiling enabled) case:
40 */
41 if (unlikely(prof_on == type))
42 profile_hits(type, ip, 1);
43}
44
22#ifdef CONFIG_PROC_FS 45#ifdef CONFIG_PROC_FS
23void create_prof_cpu_mask(struct proc_dir_entry *); 46void create_prof_cpu_mask(struct proc_dir_entry *);
24#else 47#else
diff --git a/include/linux/pspace.h b/include/linux/pspace.h
deleted file mode 100644
index 91d48b8b2d99..000000000000
--- a/include/linux/pspace.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef _LINUX_PSPACE_H
2#define _LINUX_PSPACE_H
3
4#include <linux/sched.h>
5#include <linux/mm.h>
6#include <linux/threads.h>
7#include <linux/pid.h>
8
9struct pidmap {
10 atomic_t nr_free;
11 void *page;
12};
13
14#define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
15
16struct pspace {
17 struct pidmap pidmap[PIDMAP_ENTRIES];
18 int last_pid;
19};
20
21extern struct pspace init_pspace;
22
23#endif /* _LINUX_PSPACE_H */
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 5110201a4159..90c23f690c0d 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -37,6 +37,9 @@ extern int dquot_release(struct dquot *dquot);
37extern int dquot_commit_info(struct super_block *sb, int type); 37extern int dquot_commit_info(struct super_block *sb, int type);
38extern int dquot_mark_dquot_dirty(struct dquot *dquot); 38extern int dquot_mark_dquot_dirty(struct dquot *dquot);
39 39
40int remove_inode_dquot_ref(struct inode *inode, int type,
41 struct list_head *tofree_head);
42
40extern int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path); 43extern int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path);
41extern int vfs_quota_on_mount(struct super_block *sb, char *qf_name, 44extern int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
42 int format_id, int type); 45 int format_id, int type);
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 9158a68140c9..0deb842541ac 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright (C) 2001 Momchil Velikov 2 * Copyright (C) 2001 Momchil Velikov
3 * Portions Copyright (C) 2001 Christoph Hellwig 3 * Portions Copyright (C) 2001 Christoph Hellwig
4 * Copyright (C) 2006 Nick Piggin
4 * 5 *
5 * This program is free software; you can redistribute it and/or 6 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as 7 * modify it under the terms of the GNU General Public License as
@@ -19,9 +20,37 @@
19#ifndef _LINUX_RADIX_TREE_H 20#ifndef _LINUX_RADIX_TREE_H
20#define _LINUX_RADIX_TREE_H 21#define _LINUX_RADIX_TREE_H
21 22
22#include <linux/sched.h>
23#include <linux/preempt.h> 23#include <linux/preempt.h>
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/kernel.h>
26#include <linux/rcupdate.h>
27
28/*
29 * A direct pointer (root->rnode pointing directly to a data item,
30 * rather than another radix_tree_node) is signalled by the low bit
31 * set in the root->rnode pointer.
32 *
33 * In this case root->height is also NULL, but the direct pointer tests are
34 * needed for RCU lookups when root->height is unreliable.
35 */
36#define RADIX_TREE_DIRECT_PTR 1
37
38static inline void *radix_tree_ptr_to_direct(void *ptr)
39{
40 return (void *)((unsigned long)ptr | RADIX_TREE_DIRECT_PTR);
41}
42
43static inline void *radix_tree_direct_to_ptr(void *ptr)
44{
45 return (void *)((unsigned long)ptr & ~RADIX_TREE_DIRECT_PTR);
46}
47
48static inline int radix_tree_is_direct_ptr(void *ptr)
49{
50 return (int)((unsigned long)ptr & RADIX_TREE_DIRECT_PTR);
51}
52
53/*** radix-tree API starts here ***/
25 54
26#define RADIX_TREE_MAX_TAGS 2 55#define RADIX_TREE_MAX_TAGS 2
27 56
@@ -48,6 +77,77 @@ do { \
48 (root)->rnode = NULL; \ 77 (root)->rnode = NULL; \
49} while (0) 78} while (0)
50 79
80/**
81 * Radix-tree synchronization
82 *
83 * The radix-tree API requires that users provide all synchronisation (with
84 * specific exceptions, noted below).
85 *
86 * Synchronization of access to the data items being stored in the tree, and
87 * management of their lifetimes must be completely managed by API users.
88 *
89 * For API usage, in general,
90 * - any function _modifying_ the the tree or tags (inserting or deleting
91 * items, setting or clearing tags must exclude other modifications, and
92 * exclude any functions reading the tree.
93 * - any function _reading_ the the tree or tags (looking up items or tags,
94 * gang lookups) must exclude modifications to the tree, but may occur
95 * concurrently with other readers.
96 *
97 * The notable exceptions to this rule are the following functions:
98 * radix_tree_lookup
99 * radix_tree_tag_get
100 * radix_tree_gang_lookup
101 * radix_tree_gang_lookup_tag
102 * radix_tree_tagged
103 *
104 * The first 4 functions are able to be called locklessly, using RCU. The
105 * caller must ensure calls to these functions are made within rcu_read_lock()
106 * regions. Other readers (lock-free or otherwise) and modifications may be
107 * running concurrently.
108 *
109 * It is still required that the caller manage the synchronization and lifetimes
110 * of the items. So if RCU lock-free lookups are used, typically this would mean
111 * that the items have their own locks, or are amenable to lock-free access; and
112 * that the items are freed by RCU (or only freed after having been deleted from
113 * the radix tree *and* a synchronize_rcu() grace period).
114 *
115 * (Note, rcu_assign_pointer and rcu_dereference are not needed to control
116 * access to data items when inserting into or looking up from the radix tree)
117 *
118 * radix_tree_tagged is able to be called without locking or RCU.
119 */
120
121/**
122 * radix_tree_deref_slot - dereference a slot
123 * @pslot: pointer to slot, returned by radix_tree_lookup_slot
124 * Returns: item that was stored in that slot with any direct pointer flag
125 * removed.
126 *
127 * For use with radix_tree_lookup_slot(). Caller must hold tree at least read
128 * locked across slot lookup and dereference. More likely, will be used with
129 * radix_tree_replace_slot(), as well, so caller will hold tree write locked.
130 */
131static inline void *radix_tree_deref_slot(void **pslot)
132{
133 return radix_tree_direct_to_ptr(*pslot);
134}
135/**
136 * radix_tree_replace_slot - replace item in a slot
137 * @pslot: pointer to slot, returned by radix_tree_lookup_slot
138 * @item: new item to store in the slot.
139 *
140 * For use with radix_tree_lookup_slot(). Caller must hold tree write locked
141 * across slot lookup and replacement.
142 */
143static inline void radix_tree_replace_slot(void **pslot, void *item)
144{
145 BUG_ON(radix_tree_is_direct_ptr(item));
146 rcu_assign_pointer(*pslot,
147 (void *)((unsigned long)item |
148 ((unsigned long)*pslot & RADIX_TREE_DIRECT_PTR)));
149}
150
51int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); 151int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
52void *radix_tree_lookup(struct radix_tree_root *, unsigned long); 152void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
53void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); 153void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index f13299a15591..d8286db60b96 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -227,7 +227,10 @@ struct raid5_private_data {
227 struct list_head handle_list; /* stripes needing handling */ 227 struct list_head handle_list; /* stripes needing handling */
228 struct list_head delayed_list; /* stripes that have plugged requests */ 228 struct list_head delayed_list; /* stripes that have plugged requests */
229 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ 229 struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */
230 struct bio *retry_read_aligned; /* currently retrying aligned bios */
231 struct bio *retry_read_aligned_list; /* aligned bios retry list */
230 atomic_t preread_active_stripes; /* stripes with scheduled io */ 232 atomic_t preread_active_stripes; /* stripes with scheduled io */
233 atomic_t active_aligned_reads;
231 234
232 atomic_t reshape_stripes; /* stripes with pending writes for reshape */ 235 atomic_t reshape_stripes; /* stripes with pending writes for reshape */
233 /* unfortunately we need two cache names as we temporarily have 236 /* unfortunately we need two cache names as we temporarily have
@@ -235,7 +238,7 @@ struct raid5_private_data {
235 */ 238 */
236 int active_name; 239 int active_name;
237 char cache_name[2][20]; 240 char cache_name[2][20];
238 kmem_cache_t *slab_cache; /* for allocating stripes */ 241 struct kmem_cache *slab_cache; /* for allocating stripes */
239 242
240 int seq_flush, seq_write; 243 int seq_flush, seq_write;
241 int quiesce; 244 int quiesce;
diff --git a/include/linux/random.h b/include/linux/random.h
index 0248b30e306d..01ad71033d65 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -51,16 +51,16 @@ extern void add_interrupt_randomness(int irq);
51extern void get_random_bytes(void *buf, int nbytes); 51extern void get_random_bytes(void *buf, int nbytes);
52void generate_random_uuid(unsigned char uuid_out[16]); 52void generate_random_uuid(unsigned char uuid_out[16]);
53 53
54extern __u32 secure_ip_id(__u32 daddr); 54extern __u32 secure_ip_id(__be32 daddr);
55extern u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport); 55extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
56extern u32 secure_ipv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, 56extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
57 __u16 dport); 57 __be16 dport);
58extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, 58extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
59 __u16 sport, __u16 dport); 59 __be16 sport, __be16 dport);
60extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, 60extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
61 __u16 sport, __u16 dport); 61 __be16 sport, __be16 dport);
62extern u64 secure_dccp_sequence_number(__u32 saddr, __u32 daddr, 62extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
63 __u16 sport, __u16 dport); 63 __be16 sport, __be16 dport);
64 64
65#ifndef MODULE 65#ifndef MODULE
66extern struct file_operations random_fops, urandom_fops; 66extern struct file_operations random_fops, urandom_fops;
diff --git a/include/linux/reciprocal_div.h b/include/linux/reciprocal_div.h
new file mode 100644
index 000000000000..f9c90b33285b
--- /dev/null
+++ b/include/linux/reciprocal_div.h
@@ -0,0 +1,32 @@
1#ifndef _LINUX_RECIPROCAL_DIV_H
2#define _LINUX_RECIPROCAL_DIV_H
3
4#include <linux/types.h>
5
6/*
7 * This file describes reciprocical division.
8 *
9 * This optimizes the (A/B) problem, when A and B are two u32
10 * and B is a known value (but not known at compile time)
11 *
12 * The math principle used is :
13 * Let RECIPROCAL_VALUE(B) be (((1LL << 32) + (B - 1))/ B)
14 * Then A / B = (u32)(((u64)(A) * (R)) >> 32)
15 *
16 * This replaces a divide by a multiply (and a shift), and
17 * is generally less expensive in CPU cycles.
18 */
19
20/*
21 * Computes the reciprocal value (R) for the value B of the divisor.
22 * Should not be called before each reciprocal_divide(),
23 * or else the performance is slower than a normal divide.
24 */
25extern u32 reciprocal_value(u32 B);
26
27
28static inline u32 reciprocal_divide(u32 A, u32 R)
29{
30 return (u32)(((u64)A * R) >> 32);
31}
32#endif
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 7bc6bfb86253..c3fc6caaad3f 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -739,7 +739,7 @@ struct block_head {
739#define PUT_B_FREE_SPACE(p_s_bh,val) do { set_blkh_free_space(B_BLK_HEAD(p_s_bh),val); } while (0) 739#define PUT_B_FREE_SPACE(p_s_bh,val) do { set_blkh_free_space(B_BLK_HEAD(p_s_bh),val); } while (0)
740 740
741/* Get right delimiting key. -- little endian */ 741/* Get right delimiting key. -- little endian */
742#define B_PRIGHT_DELIM_KEY(p_s_bh) (&(blk_right_delim_key(B_BLK_HEAD(p_s_bh)) 742#define B_PRIGHT_DELIM_KEY(p_s_bh) (&(blk_right_delim_key(B_BLK_HEAD(p_s_bh))))
743 743
744/* Does the buffer contain a disk leaf. */ 744/* Does the buffer contain a disk leaf. */
745#define B_IS_ITEMS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) == DISK_LEAF_NODE_LEVEL) 745#define B_IS_ITEMS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) == DISK_LEAF_NODE_LEVEL)
@@ -1159,7 +1159,7 @@ znodes are the way! */
1159#define PATH_READA 0x1 /* do read ahead */ 1159#define PATH_READA 0x1 /* do read ahead */
1160#define PATH_READA_BACK 0x2 /* read backwards */ 1160#define PATH_READA_BACK 0x2 /* read backwards */
1161 1161
1162struct path { 1162struct treepath {
1163 int path_length; /* Length of the array above. */ 1163 int path_length; /* Length of the array above. */
1164 int reada; 1164 int reada;
1165 struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */ 1165 struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */
@@ -1169,7 +1169,7 @@ struct path {
1169#define pos_in_item(path) ((path)->pos_in_item) 1169#define pos_in_item(path) ((path)->pos_in_item)
1170 1170
1171#define INITIALIZE_PATH(var) \ 1171#define INITIALIZE_PATH(var) \
1172struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,} 1172struct treepath var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
1173 1173
1174/* Get path element by path and path position. */ 1174/* Get path element by path and path position. */
1175#define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset)) 1175#define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset))
@@ -1327,7 +1327,7 @@ struct tree_balance {
1327 int need_balance_dirty; 1327 int need_balance_dirty;
1328 struct super_block *tb_sb; 1328 struct super_block *tb_sb;
1329 struct reiserfs_transaction_handle *transaction_handle; 1329 struct reiserfs_transaction_handle *transaction_handle;
1330 struct path *tb_path; 1330 struct treepath *tb_path;
1331 struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */ 1331 struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */
1332 struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */ 1332 struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */
1333 struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */ 1333 struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */
@@ -1793,41 +1793,41 @@ static inline void copy_key(struct reiserfs_key *to,
1793 memcpy(to, from, KEY_SIZE); 1793 memcpy(to, from, KEY_SIZE);
1794} 1794}
1795 1795
1796int comp_items(const struct item_head *stored_ih, const struct path *p_s_path); 1796int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path);
1797const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path, 1797const struct reiserfs_key *get_rkey(const struct treepath *p_s_chk_path,
1798 const struct super_block *p_s_sb); 1798 const struct super_block *p_s_sb);
1799int search_by_key(struct super_block *, const struct cpu_key *, 1799int search_by_key(struct super_block *, const struct cpu_key *,
1800 struct path *, int); 1800 struct treepath *, int);
1801#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) 1801#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL)
1802int search_for_position_by_key(struct super_block *p_s_sb, 1802int search_for_position_by_key(struct super_block *p_s_sb,
1803 const struct cpu_key *p_s_cpu_key, 1803 const struct cpu_key *p_s_cpu_key,
1804 struct path *p_s_search_path); 1804 struct treepath *p_s_search_path);
1805extern void decrement_bcount(struct buffer_head *p_s_bh); 1805extern void decrement_bcount(struct buffer_head *p_s_bh);
1806void decrement_counters_in_path(struct path *p_s_search_path); 1806void decrement_counters_in_path(struct treepath *p_s_search_path);
1807void pathrelse(struct path *p_s_search_path); 1807void pathrelse(struct treepath *p_s_search_path);
1808int reiserfs_check_path(struct path *p); 1808int reiserfs_check_path(struct treepath *p);
1809void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path); 1809void pathrelse_and_restore(struct super_block *s, struct treepath *p_s_search_path);
1810 1810
1811int reiserfs_insert_item(struct reiserfs_transaction_handle *th, 1811int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
1812 struct path *path, 1812 struct treepath *path,
1813 const struct cpu_key *key, 1813 const struct cpu_key *key,
1814 struct item_head *ih, 1814 struct item_head *ih,
1815 struct inode *inode, const char *body); 1815 struct inode *inode, const char *body);
1816 1816
1817int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, 1817int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th,
1818 struct path *path, 1818 struct treepath *path,
1819 const struct cpu_key *key, 1819 const struct cpu_key *key,
1820 struct inode *inode, 1820 struct inode *inode,
1821 const char *body, int paste_size); 1821 const char *body, int paste_size);
1822 1822
1823int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, 1823int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
1824 struct path *path, 1824 struct treepath *path,
1825 struct cpu_key *key, 1825 struct cpu_key *key,
1826 struct inode *inode, 1826 struct inode *inode,
1827 struct page *page, loff_t new_file_size); 1827 struct page *page, loff_t new_file_size);
1828 1828
1829int reiserfs_delete_item(struct reiserfs_transaction_handle *th, 1829int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
1830 struct path *path, 1830 struct treepath *path,
1831 const struct cpu_key *key, 1831 const struct cpu_key *key,
1832 struct inode *inode, struct buffer_head *p_s_un_bh); 1832 struct inode *inode, struct buffer_head *p_s_un_bh);
1833 1833
@@ -1858,7 +1858,7 @@ void padd_item(char *item, int total_length, int length);
1858#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ 1858#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */
1859 1859
1860int restart_transaction(struct reiserfs_transaction_handle *th, 1860int restart_transaction(struct reiserfs_transaction_handle *th,
1861 struct inode *inode, struct path *path); 1861 struct inode *inode, struct treepath *path);
1862void reiserfs_read_locked_inode(struct inode *inode, 1862void reiserfs_read_locked_inode(struct inode *inode,
1863 struct reiserfs_iget_args *args); 1863 struct reiserfs_iget_args *args);
1864int reiserfs_find_actor(struct inode *inode, void *p); 1864int reiserfs_find_actor(struct inode *inode, void *p);
@@ -1905,7 +1905,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
1905/* namei.c */ 1905/* namei.c */
1906void set_de_name_and_namelen(struct reiserfs_dir_entry *de); 1906void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
1907int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, 1907int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
1908 struct path *path, struct reiserfs_dir_entry *de); 1908 struct treepath *path, struct reiserfs_dir_entry *de);
1909struct dentry *reiserfs_get_parent(struct dentry *); 1909struct dentry *reiserfs_get_parent(struct dentry *);
1910/* procfs.c */ 1910/* procfs.c */
1911 1911
@@ -1956,9 +1956,9 @@ extern const struct file_operations reiserfs_dir_operations;
1956 1956
1957/* tail_conversion.c */ 1957/* tail_conversion.c */
1958int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, 1958int direct2indirect(struct reiserfs_transaction_handle *, struct inode *,
1959 struct path *, struct buffer_head *, loff_t); 1959 struct treepath *, struct buffer_head *, loff_t);
1960int indirect2direct(struct reiserfs_transaction_handle *, struct inode *, 1960int indirect2direct(struct reiserfs_transaction_handle *, struct inode *,
1961 struct page *, struct path *, const struct cpu_key *, 1961 struct page *, struct treepath *, const struct cpu_key *,
1962 loff_t, char *); 1962 loff_t, char *);
1963void reiserfs_unmap_buffer(struct buffer_head *); 1963void reiserfs_unmap_buffer(struct buffer_head *);
1964 1964
@@ -2045,7 +2045,7 @@ struct __reiserfs_blocknr_hint {
2045 struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */ 2045 struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */
2046 long block; /* file offset, in blocks */ 2046 long block; /* file offset, in blocks */
2047 struct in_core_key key; 2047 struct in_core_key key;
2048 struct path *path; /* search path, used by allocator to deternine search_start by 2048 struct treepath *path; /* search path, used by allocator to deternine search_start by
2049 * various ways */ 2049 * various ways */
2050 struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and 2050 struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and
2051 * bitmap blocks changes */ 2051 * bitmap blocks changes */
@@ -2101,7 +2101,7 @@ static inline int reiserfs_new_form_blocknrs(struct tree_balance *tb,
2101static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle 2101static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle
2102 *th, struct inode *inode, 2102 *th, struct inode *inode,
2103 b_blocknr_t * new_blocknrs, 2103 b_blocknr_t * new_blocknrs,
2104 struct path *path, long block) 2104 struct treepath *path, long block)
2105{ 2105{
2106 reiserfs_blocknr_hint_t hint = { 2106 reiserfs_blocknr_hint_t hint = {
2107 .th = th, 2107 .th = th,
@@ -2118,7 +2118,7 @@ static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle
2118static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle 2118static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle
2119 *th, struct inode *inode, 2119 *th, struct inode *inode,
2120 b_blocknr_t * new_blocknrs, 2120 b_blocknr_t * new_blocknrs,
2121 struct path *path, long block) 2121 struct treepath *path, long block)
2122{ 2122{
2123 reiserfs_blocknr_hint_t hint = { 2123 reiserfs_blocknr_hint_t hint = {
2124 .th = th, 2124 .th = th,
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 73e0becec086..3a28742d86f9 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -249,7 +249,8 @@ struct reiserfs_journal {
249 int j_errno; 249 int j_errno;
250 250
251 /* when flushing ordered buffers, throttle new ordered writers */ 251 /* when flushing ordered buffers, throttle new ordered writers */
252 struct work_struct j_work; 252 struct delayed_work j_work;
253 struct super_block *j_work_sb;
253 atomic_t j_async_throttle; 254 atomic_t j_async_throttle;
254}; 255};
255 256
@@ -429,7 +430,7 @@ enum reiserfs_mount_options {
429/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting 430/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting
430** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option 431** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option
431** is not required. If the normal autodection code can't determine which 432** is not required. If the normal autodection code can't determine which
432** hash to use (because both hases had the same value for a file) 433** hash to use (because both hashes had the same value for a file)
433** use this option to force a specific hash. It won't allow you to override 434** use this option to force a specific hash. It won't allow you to override
434** the existing hash on the FS, so if you have a tea hash disk, and mount 435** the existing hash on the FS, so if you have a tea hash disk, and mount
435** with -o hash=rupasov, the mount will fail. 436** with -o hash=rupasov, the mount will fail.
diff --git a/include/linux/relay.h b/include/linux/relay.h
index 24accb483849..c6a48bfc8b14 100644
--- a/include/linux/relay.h
+++ b/include/linux/relay.h
@@ -38,7 +38,7 @@ struct rchan_buf
38 size_t subbufs_consumed; /* count of sub-buffers consumed */ 38 size_t subbufs_consumed; /* count of sub-buffers consumed */
39 struct rchan *chan; /* associated channel */ 39 struct rchan *chan; /* associated channel */
40 wait_queue_head_t read_wait; /* reader wait queue */ 40 wait_queue_head_t read_wait; /* reader wait queue */
41 struct work_struct wake_readers; /* reader wake-up work struct */ 41 struct delayed_work wake_readers; /* reader wake-up work struct */
42 struct dentry *dentry; /* channel file dentry */ 42 struct dentry *dentry; /* channel file dentry */
43 struct kref kref; /* channel buffer refcount */ 43 struct kref kref; /* channel buffer refcount */
44 struct page **page_array; /* array of current buffer pages */ 44 struct page **page_array; /* array of current buffer pages */
@@ -274,7 +274,7 @@ static inline void subbuf_start_reserve(struct rchan_buf *buf,
274/* 274/*
275 * exported relay file operations, kernel/relay.c 275 * exported relay file operations, kernel/relay.c
276 */ 276 */
277extern struct file_operations relay_file_operations; 277extern const struct file_operations relay_file_operations;
278 278
279#endif /* _LINUX_RELAY_H */ 279#endif /* _LINUX_RELAY_H */
280 280
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index db2c1df4fef9..bdd277223af0 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -30,11 +30,11 @@ struct anon_vma {
30 30
31#ifdef CONFIG_MMU 31#ifdef CONFIG_MMU
32 32
33extern kmem_cache_t *anon_vma_cachep; 33extern struct kmem_cache *anon_vma_cachep;
34 34
35static inline struct anon_vma *anon_vma_alloc(void) 35static inline struct anon_vma *anon_vma_alloc(void)
36{ 36{
37 return kmem_cache_alloc(anon_vma_cachep, SLAB_KERNEL); 37 return kmem_cache_alloc(anon_vma_cachep, GFP_KERNEL);
38} 38}
39 39
40static inline void anon_vma_free(struct anon_vma *anon_vma) 40static inline void anon_vma_free(struct anon_vma *anon_vma)
@@ -72,7 +72,7 @@ void __anon_vma_link(struct vm_area_struct *);
72void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); 72void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
73void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); 73void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
74void page_add_file_rmap(struct page *); 74void page_add_file_rmap(struct page *);
75void page_remove_rmap(struct page *); 75void page_remove_rmap(struct page *, struct vm_area_struct *);
76 76
77/** 77/**
78 * page_dup_rmap - duplicate pte mapping to a page 78 * page_dup_rmap - duplicate pte mapping to a page
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 09ff4c3e2713..5e22d4510d11 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -106,6 +106,7 @@ extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year
106extern int rtc_valid_tm(struct rtc_time *tm); 106extern int rtc_valid_tm(struct rtc_time *tm);
107extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); 107extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time);
108extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); 108extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm);
109extern void rtc_merge_alarm(struct rtc_time *now, struct rtc_time *alarm);
109 110
110#include <linux/device.h> 111#include <linux/device.h>
111#include <linux/seq_file.h> 112#include <linux/seq_file.h>
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index 5d41dee82f80..b0090e9f7884 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -63,7 +63,7 @@ struct hrtimer_sleeper;
63#endif 63#endif
64 64
65#define __RT_MUTEX_INITIALIZER(mutexname) \ 65#define __RT_MUTEX_INITIALIZER(mutexname) \
66 { .wait_lock = SPIN_LOCK_UNLOCKED \ 66 { .wait_lock = __SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
67 , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, mutexname.wait_lock) \ 67 , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list, mutexname.wait_lock) \
68 , .owner = NULL \ 68 , .owner = NULL \
69 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} 69 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)}
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 3a18addaed4c..4a629ea70cc4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/netlink.h> 4#include <linux/netlink.h>
5#include <linux/if_link.h> 5#include <linux/if_link.h>
6#include <linux/if_addr.h>
7#include <linux/neighbour.h>
6 8
7/**** 9/****
8 * Routing/neighbour discovery messages. 10 * Routing/neighbour discovery messages.
@@ -81,8 +83,6 @@ enum {
81 83
82 RTM_NEWPREFIX = 52, 84 RTM_NEWPREFIX = 52,
83#define RTM_NEWPREFIX RTM_NEWPREFIX 85#define RTM_NEWPREFIX RTM_NEWPREFIX
84 RTM_GETPREFIX = 54,
85#define RTM_GETPREFIX RTM_GETPREFIX
86 86
87 RTM_GETMULTICAST = 58, 87 RTM_GETMULTICAST = 58,
88#define RTM_GETMULTICAST RTM_GETMULTICAST 88#define RTM_GETMULTICAST RTM_GETMULTICAST
@@ -587,6 +587,9 @@ extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group,
587 struct nlmsghdr *nlh, gfp_t flags); 587 struct nlmsghdr *nlh, gfp_t flags);
588extern void rtnl_set_sk_err(u32 group, int error); 588extern void rtnl_set_sk_err(u32 group, int error);
589extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); 589extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
590extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst,
591 u32 id, u32 ts, u32 tsage, long expires,
592 u32 error);
590 593
591extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); 594extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
592 595
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h
index ae1fcadd598e..813cee13da0d 100644
--- a/include/linux/rwsem-spinlock.h
+++ b/include/linux/rwsem-spinlock.h
@@ -44,7 +44,8 @@ struct rw_semaphore {
44#endif 44#endif
45 45
46#define __RWSEM_INITIALIZER(name) \ 46#define __RWSEM_INITIALIZER(name) \
47{ 0, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } 47{ 0, __SPIN_LOCK_UNLOCKED(name.wait_lock), LIST_HEAD_INIT((name).wait_list) \
48 __RWSEM_DEP_MAP_INIT(name) }
48 49
49#define DECLARE_RWSEM(name) \ 50#define DECLARE_RWSEM(name) \
50 struct rw_semaphore name = __RWSEM_INITIALIZER(name) 51 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index eafe4a7b8237..446373535190 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -82,6 +82,7 @@ struct sched_param {
82#include <linux/resource.h> 82#include <linux/resource.h>
83#include <linux/timer.h> 83#include <linux/timer.h>
84#include <linux/hrtimer.h> 84#include <linux/hrtimer.h>
85#include <linux/task_io_accounting.h>
85 86
86#include <asm/processor.h> 87#include <asm/processor.h>
87 88
@@ -194,7 +195,16 @@ extern void init_idle(struct task_struct *idle, int cpu);
194 195
195extern cpumask_t nohz_cpu_mask; 196extern cpumask_t nohz_cpu_mask;
196 197
197extern void show_state(void); 198/*
199 * Only dump TASK_* tasks. (-1 for all tasks)
200 */
201extern void show_state_filter(unsigned long state_filter);
202
203static inline void show_state(void)
204{
205 show_state_filter(-1);
206}
207
198extern void show_regs(struct pt_regs *); 208extern void show_regs(struct pt_regs *);
199 209
200/* 210/*
@@ -338,15 +348,23 @@ struct mm_struct {
338 348
339 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ 349 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
340 350
341 unsigned dumpable:2;
342 cpumask_t cpu_vm_mask; 351 cpumask_t cpu_vm_mask;
343 352
344 /* Architecture-specific MM context */ 353 /* Architecture-specific MM context */
345 mm_context_t context; 354 mm_context_t context;
346 355
347 /* Token based thrashing protection. */ 356 /* Swap token stuff */
348 unsigned long swap_token_time; 357 /*
349 char recent_pagein; 358 * Last value of global fault stamp as seen by this process.
359 * In other words, this value gives an indication of how long
360 * it has been since this task got the token.
361 * Look at mm/thrash.c
362 */
363 unsigned int faultstamp;
364 unsigned int token_priority;
365 unsigned int last_interval;
366
367 unsigned char dumpable:2;
350 368
351 /* coredumping support */ 369 /* coredumping support */
352 int core_waiters; 370 int core_waiters;
@@ -419,7 +437,12 @@ struct signal_struct {
419 /* job control IDs */ 437 /* job control IDs */
420 pid_t pgrp; 438 pid_t pgrp;
421 pid_t tty_old_pgrp; 439 pid_t tty_old_pgrp;
422 pid_t session; 440
441 union {
442 pid_t session __deprecated;
443 pid_t __session;
444 };
445
423 /* boolean value for session group leader */ 446 /* boolean value for session group leader */
424 int leader; 447 int leader;
425 448
@@ -556,7 +579,7 @@ struct sched_info {
556#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ 579#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
557 580
558#ifdef CONFIG_SCHEDSTATS 581#ifdef CONFIG_SCHEDSTATS
559extern struct file_operations proc_schedstat_operations; 582extern const struct file_operations proc_schedstat_operations;
560#endif /* CONFIG_SCHEDSTATS */ 583#endif /* CONFIG_SCHEDSTATS */
561 584
562#ifdef CONFIG_TASK_DELAY_ACCT 585#ifdef CONFIG_TASK_DELAY_ACCT
@@ -625,6 +648,7 @@ enum idle_type
625#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ 648#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */
626#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ 649#define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */
627#define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ 650#define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */
651#define SD_SERIALIZE 1024 /* Only a single load balancing instance */
628 652
629#define BALANCE_FOR_MC_POWER \ 653#define BALANCE_FOR_MC_POWER \
630 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) 654 (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0)
@@ -991,6 +1015,7 @@ struct task_struct {
991 wait_queue_t *io_wait; 1015 wait_queue_t *io_wait;
992/* i/o counters(bytes read/written, #syscalls */ 1016/* i/o counters(bytes read/written, #syscalls */
993 u64 rchar, wchar, syscr, syscw; 1017 u64 rchar, wchar, syscr, syscw;
1018 struct task_io_accounting ioac;
994#if defined(CONFIG_TASK_XACCT) 1019#if defined(CONFIG_TASK_XACCT)
995 u64 acct_rss_mem1; /* accumulated rss usage */ 1020 u64 acct_rss_mem1; /* accumulated rss usage */
996 u64 acct_vm_mem1; /* accumulated virtual memory usage */ 1021 u64 acct_vm_mem1; /* accumulated virtual memory usage */
@@ -1023,6 +1048,9 @@ struct task_struct {
1023#ifdef CONFIG_TASK_DELAY_ACCT 1048#ifdef CONFIG_TASK_DELAY_ACCT
1024 struct task_delay_info *delays; 1049 struct task_delay_info *delays;
1025#endif 1050#endif
1051#ifdef CONFIG_FAULT_INJECTION
1052 int make_it_fail;
1053#endif
1026}; 1054};
1027 1055
1028static inline pid_t process_group(struct task_struct *tsk) 1056static inline pid_t process_group(struct task_struct *tsk)
@@ -1030,6 +1058,21 @@ static inline pid_t process_group(struct task_struct *tsk)
1030 return tsk->signal->pgrp; 1058 return tsk->signal->pgrp;
1031} 1059}
1032 1060
1061static inline pid_t signal_session(struct signal_struct *sig)
1062{
1063 return sig->__session;
1064}
1065
1066static inline pid_t process_session(struct task_struct *tsk)
1067{
1068 return signal_session(tsk->signal);
1069}
1070
1071static inline void set_signal_session(struct signal_struct *sig, pid_t session)
1072{
1073 sig->__session = session;
1074}
1075
1033static inline struct pid *task_pid(struct task_struct *task) 1076static inline struct pid *task_pid(struct task_struct *task)
1034{ 1077{
1035 return task->pids[PIDTYPE_PID].pid; 1078 return task->pids[PIDTYPE_PID].pid;
@@ -1101,7 +1144,6 @@ static inline void put_task_struct(struct task_struct *t)
1101#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1144#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1102#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ 1145#define PF_FLUSHER 0x00001000 /* responsible for disk writeback */
1103#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1146#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1104#define PF_FREEZE 0x00004000 /* this task is being frozen for suspend now */
1105#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1147#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
1106#define PF_FROZEN 0x00010000 /* frozen for system suspend */ 1148#define PF_FROZEN 0x00010000 /* frozen for system suspend */
1107#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ 1149#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
@@ -1223,7 +1265,6 @@ extern struct mm_struct init_mm;
1223 1265
1224#define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr) 1266#define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr)
1225extern struct task_struct *find_task_by_pid_type(int type, int pid); 1267extern struct task_struct *find_task_by_pid_type(int type, int pid);
1226extern void set_special_pids(pid_t session, pid_t pgrp);
1227extern void __set_special_pids(pid_t session, pid_t pgrp); 1268extern void __set_special_pids(pid_t session, pid_t pgrp);
1228 1269
1229/* per-UID process charging. */ 1270/* per-UID process charging. */
@@ -1288,7 +1329,6 @@ extern int kill_pgrp(struct pid *pid, int sig, int priv);
1288extern int kill_pid(struct pid *pid, int sig, int priv); 1329extern int kill_pid(struct pid *pid, int sig, int priv);
1289extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); 1330extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp);
1290extern int kill_pg_info(int, struct siginfo *, pid_t); 1331extern int kill_pg_info(int, struct siginfo *, pid_t);
1291extern int kill_proc_info(int, struct siginfo *, pid_t);
1292extern void do_notify_parent(struct task_struct *, int); 1332extern void do_notify_parent(struct task_struct *, int);
1293extern void force_sig(int, struct task_struct *); 1333extern void force_sig(int, struct task_struct *);
1294extern void force_sig_specific(int, struct task_struct *); 1334extern void force_sig_specific(int, struct task_struct *);
@@ -1365,7 +1405,6 @@ extern NORET_TYPE void do_group_exit(int);
1365extern void daemonize(const char *, ...); 1405extern void daemonize(const char *, ...);
1366extern int allow_signal(int); 1406extern int allow_signal(int);
1367extern int disallow_signal(int); 1407extern int disallow_signal(int);
1368extern struct task_struct *child_reaper;
1369 1408
1370extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); 1409extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *);
1371extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); 1410extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
@@ -1610,87 +1649,6 @@ extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls);
1610 1649
1611extern void normalize_rt_tasks(void); 1650extern void normalize_rt_tasks(void);
1612 1651
1613#ifdef CONFIG_PM
1614/*
1615 * Check if a process has been frozen
1616 */
1617static inline int frozen(struct task_struct *p)
1618{
1619 return p->flags & PF_FROZEN;
1620}
1621
1622/*
1623 * Check if there is a request to freeze a process
1624 */
1625static inline int freezing(struct task_struct *p)
1626{
1627 return p->flags & PF_FREEZE;
1628}
1629
1630/*
1631 * Request that a process be frozen
1632 * FIXME: SMP problem. We may not modify other process' flags!
1633 */
1634static inline void freeze(struct task_struct *p)
1635{
1636 p->flags |= PF_FREEZE;
1637}
1638
1639/*
1640 * Sometimes we may need to cancel the previous 'freeze' request
1641 */
1642static inline void do_not_freeze(struct task_struct *p)
1643{
1644 p->flags &= ~PF_FREEZE;
1645}
1646
1647/*
1648 * Wake up a frozen process
1649 */
1650static inline int thaw_process(struct task_struct *p)
1651{
1652 if (frozen(p)) {
1653 p->flags &= ~PF_FROZEN;
1654 wake_up_process(p);
1655 return 1;
1656 }
1657 return 0;
1658}
1659
1660/*
1661 * freezing is complete, mark process as frozen
1662 */
1663static inline void frozen_process(struct task_struct *p)
1664{
1665 p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
1666}
1667
1668extern void refrigerator(void);
1669extern int freeze_processes(void);
1670extern void thaw_processes(void);
1671
1672static inline int try_to_freeze(void)
1673{
1674 if (freezing(current)) {
1675 refrigerator();
1676 return 1;
1677 } else
1678 return 0;
1679}
1680#else
1681static inline int frozen(struct task_struct *p) { return 0; }
1682static inline int freezing(struct task_struct *p) { return 0; }
1683static inline void freeze(struct task_struct *p) { BUG(); }
1684static inline int thaw_process(struct task_struct *p) { return 1; }
1685static inline void frozen_process(struct task_struct *p) { BUG(); }
1686
1687static inline void refrigerator(void) {}
1688static inline int freeze_processes(void) { BUG(); return 0; }
1689static inline void thaw_processes(void) {}
1690
1691static inline int try_to_freeze(void) { return 0; }
1692
1693#endif /* CONFIG_PM */
1694#endif /* __KERNEL__ */ 1652#endif /* __KERNEL__ */
1695 1653
1696#endif 1654#endif
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index 2925e66a6732..b02308ee7667 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -42,7 +42,8 @@ struct screen_info {
42 u16 pages; /* 0x32 */ 42 u16 pages; /* 0x32 */
43 u16 vesa_attributes; /* 0x34 */ 43 u16 vesa_attributes; /* 0x34 */
44 u32 capabilities; /* 0x36 */ 44 u32 capabilities; /* 0x36 */
45 /* 0x3a -- 0x3f reserved for future expansion */ 45 /* 0x3a -- 0x3b reserved for future expansion */
46 /* 0x3c -- 0x3f micro stack for relocatable kernels */
46}; 47};
47 48
48extern struct screen_info screen_info; 49extern struct screen_info screen_info;
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 6ec66dec29f7..d4f86560bfff 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -57,17 +57,17 @@
57 57
58/* Section 3.1. SCTP Common Header Format */ 58/* Section 3.1. SCTP Common Header Format */
59typedef struct sctphdr { 59typedef struct sctphdr {
60 __u16 source; 60 __be16 source;
61 __u16 dest; 61 __be16 dest;
62 __u32 vtag; 62 __be32 vtag;
63 __u32 checksum; 63 __be32 checksum;
64} __attribute__((packed)) sctp_sctphdr_t; 64} __attribute__((packed)) sctp_sctphdr_t;
65 65
66/* Section 3.2. Chunk Field Descriptions. */ 66/* Section 3.2. Chunk Field Descriptions. */
67typedef struct sctp_chunkhdr { 67typedef struct sctp_chunkhdr {
68 __u8 type; 68 __u8 type;
69 __u8 flags; 69 __u8 flags;
70 __u16 length; 70 __be16 length;
71} __attribute__((packed)) sctp_chunkhdr_t; 71} __attribute__((packed)) sctp_chunkhdr_t;
72 72
73 73
@@ -153,8 +153,8 @@ enum { SCTP_CHUNK_FLAG_T = 0x01 };
153 */ 153 */
154 154
155typedef struct sctp_paramhdr { 155typedef struct sctp_paramhdr {
156 __u16 type; 156 __be16 type;
157 __u16 length; 157 __be16 length;
158} __attribute__((packed)) sctp_paramhdr_t; 158} __attribute__((packed)) sctp_paramhdr_t;
159 159
160typedef enum { 160typedef enum {
@@ -180,7 +180,7 @@ typedef enum {
180 SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003), 180 SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003),
181 SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004), 181 SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004),
182 SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005), 182 SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005),
183 SCTP_PARAM_ADAPTION_LAYER_IND = __constant_htons(0xc006), 183 SCTP_PARAM_ADAPTATION_LAYER_IND = __constant_htons(0xc006),
184 184
185} sctp_param_t; /* enum */ 185} sctp_param_t; /* enum */
186 186
@@ -203,10 +203,10 @@ enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), };
203/* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */ 203/* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */
204 204
205typedef struct sctp_datahdr { 205typedef struct sctp_datahdr {
206 __u32 tsn; 206 __be32 tsn;
207 __u16 stream; 207 __be16 stream;
208 __u16 ssn; 208 __be16 ssn;
209 __u32 ppid; 209 __be32 ppid;
210 __u8 payload[0]; 210 __u8 payload[0];
211} __attribute__((packed)) sctp_datahdr_t; 211} __attribute__((packed)) sctp_datahdr_t;
212 212
@@ -232,11 +232,11 @@ enum { SCTP_DATA_FRAG_MASK = 0x03, };
232 * endpoints. 232 * endpoints.
233 */ 233 */
234typedef struct sctp_inithdr { 234typedef struct sctp_inithdr {
235 __u32 init_tag; 235 __be32 init_tag;
236 __u32 a_rwnd; 236 __be32 a_rwnd;
237 __u16 num_outbound_streams; 237 __be16 num_outbound_streams;
238 __u16 num_inbound_streams; 238 __be16 num_inbound_streams;
239 __u32 initial_tsn; 239 __be32 initial_tsn;
240 __u8 params[0]; 240 __u8 params[0];
241} __attribute__((packed)) sctp_inithdr_t; 241} __attribute__((packed)) sctp_inithdr_t;
242 242
@@ -261,7 +261,7 @@ typedef struct sctp_ipv6addr_param {
261/* Section 3.3.2.1 Cookie Preservative (9) */ 261/* Section 3.3.2.1 Cookie Preservative (9) */
262typedef struct sctp_cookie_preserve_param { 262typedef struct sctp_cookie_preserve_param {
263 sctp_paramhdr_t param_hdr; 263 sctp_paramhdr_t param_hdr;
264 uint32_t lifespan_increment; 264 __be32 lifespan_increment;
265} __attribute__((packed)) sctp_cookie_preserve_param_t; 265} __attribute__((packed)) sctp_cookie_preserve_param_t;
266 266
267/* Section 3.3.2.1 Host Name Address (11) */ 267/* Section 3.3.2.1 Host Name Address (11) */
@@ -273,7 +273,7 @@ typedef struct sctp_hostname_param {
273/* Section 3.3.2.1 Supported Address Types (12) */ 273/* Section 3.3.2.1 Supported Address Types (12) */
274typedef struct sctp_supported_addrs_param { 274typedef struct sctp_supported_addrs_param {
275 sctp_paramhdr_t param_hdr; 275 sctp_paramhdr_t param_hdr;
276 uint16_t types[0]; 276 __be16 types[0];
277} __attribute__((packed)) sctp_supported_addrs_param_t; 277} __attribute__((packed)) sctp_supported_addrs_param_t;
278 278
279/* Appendix A. ECN Capable (32768) */ 279/* Appendix A. ECN Capable (32768) */
@@ -281,11 +281,11 @@ typedef struct sctp_ecn_capable_param {
281 sctp_paramhdr_t param_hdr; 281 sctp_paramhdr_t param_hdr;
282} __attribute__((packed)) sctp_ecn_capable_param_t; 282} __attribute__((packed)) sctp_ecn_capable_param_t;
283 283
284/* ADDIP Section 3.2.6 Adaption Layer Indication */ 284/* ADDIP Section 3.2.6 Adaptation Layer Indication */
285typedef struct sctp_adaption_ind_param { 285typedef struct sctp_adaptation_ind_param {
286 struct sctp_paramhdr param_hdr; 286 struct sctp_paramhdr param_hdr;
287 __u32 adaption_ind; 287 __be32 adaptation_ind;
288} __attribute__((packed)) sctp_adaption_ind_param_t; 288} __attribute__((packed)) sctp_adaptation_ind_param_t;
289 289
290/* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): 290/* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2):
291 * The INIT ACK chunk is used to acknowledge the initiation of an SCTP 291 * The INIT ACK chunk is used to acknowledge the initiation of an SCTP
@@ -316,11 +316,11 @@ typedef struct sctp_unrecognized_param {
316 */ 316 */
317 317
318typedef struct sctp_gap_ack_block { 318typedef struct sctp_gap_ack_block {
319 __u16 start; 319 __be16 start;
320 __u16 end; 320 __be16 end;
321} __attribute__((packed)) sctp_gap_ack_block_t; 321} __attribute__((packed)) sctp_gap_ack_block_t;
322 322
323typedef uint32_t sctp_dup_tsn_t; 323typedef __be32 sctp_dup_tsn_t;
324 324
325typedef union { 325typedef union {
326 sctp_gap_ack_block_t gab; 326 sctp_gap_ack_block_t gab;
@@ -328,10 +328,10 @@ typedef union {
328} sctp_sack_variable_t; 328} sctp_sack_variable_t;
329 329
330typedef struct sctp_sackhdr { 330typedef struct sctp_sackhdr {
331 __u32 cum_tsn_ack; 331 __be32 cum_tsn_ack;
332 __u32 a_rwnd; 332 __be32 a_rwnd;
333 __u16 num_gap_ack_blocks; 333 __be16 num_gap_ack_blocks;
334 __u16 num_dup_tsns; 334 __be16 num_dup_tsns;
335 sctp_sack_variable_t variable[0]; 335 sctp_sack_variable_t variable[0];
336} __attribute__((packed)) sctp_sackhdr_t; 336} __attribute__((packed)) sctp_sackhdr_t;
337 337
@@ -371,7 +371,7 @@ typedef struct sctp_abort_chunk {
371 * and the highest consecutive acking value. 371 * and the highest consecutive acking value.
372 */ 372 */
373typedef struct sctp_shutdownhdr { 373typedef struct sctp_shutdownhdr {
374 __u32 cum_tsn_ack; 374 __be32 cum_tsn_ack;
375} __attribute__((packed)) sctp_shutdownhdr_t; 375} __attribute__((packed)) sctp_shutdownhdr_t;
376 376
377struct sctp_shutdown_chunk_t { 377struct sctp_shutdown_chunk_t {
@@ -382,8 +382,8 @@ struct sctp_shutdown_chunk_t {
382/* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ 382/* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */
383 383
384typedef struct sctp_errhdr { 384typedef struct sctp_errhdr {
385 __u16 cause; 385 __be16 cause;
386 __u16 length; 386 __be16 length;
387 __u8 variable[0]; 387 __u8 variable[0];
388} __attribute__((packed)) sctp_errhdr_t; 388} __attribute__((packed)) sctp_errhdr_t;
389 389
@@ -462,7 +462,7 @@ typedef enum {
462 * Explicit Congestion Notification Echo (ECNE) (12) 462 * Explicit Congestion Notification Echo (ECNE) (12)
463 */ 463 */
464typedef struct sctp_ecnehdr { 464typedef struct sctp_ecnehdr {
465 __u32 lowest_tsn; 465 __be32 lowest_tsn;
466} sctp_ecnehdr_t; 466} sctp_ecnehdr_t;
467 467
468typedef struct sctp_ecne_chunk { 468typedef struct sctp_ecne_chunk {
@@ -474,7 +474,7 @@ typedef struct sctp_ecne_chunk {
474 * Congestion Window Reduced (CWR) (13) 474 * Congestion Window Reduced (CWR) (13)
475 */ 475 */
476typedef struct sctp_cwrhdr { 476typedef struct sctp_cwrhdr {
477 __u32 lowest_tsn; 477 __be32 lowest_tsn;
478} sctp_cwrhdr_t; 478} sctp_cwrhdr_t;
479 479
480typedef struct sctp_cwr_chunk { 480typedef struct sctp_cwr_chunk {
@@ -529,12 +529,12 @@ typedef struct sctp_cwr_chunk {
529 * chunks this field MUST be filled in. 529 * chunks this field MUST be filled in.
530 */ 530 */
531struct sctp_fwdtsn_skip { 531struct sctp_fwdtsn_skip {
532 __u16 stream; 532 __be16 stream;
533 __u16 ssn; 533 __be16 ssn;
534} __attribute__((packed)); 534} __attribute__((packed));
535 535
536struct sctp_fwdtsn_hdr { 536struct sctp_fwdtsn_hdr {
537 __u32 new_cum_tsn; 537 __be32 new_cum_tsn;
538 struct sctp_fwdtsn_skip skip[0]; 538 struct sctp_fwdtsn_skip skip[0];
539} __attribute((packed)); 539} __attribute((packed));
540 540
@@ -578,11 +578,11 @@ struct sctp_fwdtsn_chunk {
578 */ 578 */
579typedef struct sctp_addip_param { 579typedef struct sctp_addip_param {
580 sctp_paramhdr_t param_hdr; 580 sctp_paramhdr_t param_hdr;
581 __u32 crr_id; 581 __be32 crr_id;
582} __attribute__((packed)) sctp_addip_param_t; 582} __attribute__((packed)) sctp_addip_param_t;
583 583
584typedef struct sctp_addiphdr { 584typedef struct sctp_addiphdr {
585 __u32 serial; 585 __be32 serial;
586 __u8 params[0]; 586 __u8 params[0];
587} __attribute__((packed)) sctp_addiphdr_t; 587} __attribute__((packed)) sctp_addiphdr_t;
588 588
diff --git a/include/linux/security.h b/include/linux/security.h
index b200b9856f32..83cdefae9931 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -826,6 +826,8 @@ struct request_sock;
826 * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid. 826 * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid.
827 * @inet_csk_clone: 827 * @inet_csk_clone:
828 * Sets the new child socket's sid to the openreq sid. 828 * Sets the new child socket's sid to the openreq sid.
829 * @inet_conn_established:
830 * Sets the connection's peersid to the secmark on skb.
829 * @req_classify_flow: 831 * @req_classify_flow:
830 * Sets the flow's sid to the openreq sid. 832 * Sets the flow's sid to the openreq sid.
831 * 833 *
@@ -836,10 +838,8 @@ struct request_sock;
836 * used by the XFRM system. 838 * used by the XFRM system.
837 * @sec_ctx contains the security context information being provided by 839 * @sec_ctx contains the security context information being provided by
838 * the user-level policy update program (e.g., setkey). 840 * the user-level policy update program (e.g., setkey).
839 * @sk refers to the sock from which to derive the security context.
840 * Allocate a security structure to the xp->security field; the security 841 * Allocate a security structure to the xp->security field; the security
841 * field is initialized to NULL when the xfrm_policy is allocated. Only 842 * field is initialized to NULL when the xfrm_policy is allocated.
842 * one of sec_ctx or sock can be specified.
843 * Return 0 if operation was successful (memory to allocate, legal context) 843 * Return 0 if operation was successful (memory to allocate, legal context)
844 * @xfrm_policy_clone_security: 844 * @xfrm_policy_clone_security:
845 * @old contains an existing xfrm_policy in the SPD. 845 * @old contains an existing xfrm_policy in the SPD.
@@ -858,9 +858,6 @@ struct request_sock;
858 * Database by the XFRM system. 858 * Database by the XFRM system.
859 * @sec_ctx contains the security context information being provided by 859 * @sec_ctx contains the security context information being provided by
860 * the user-level SA generation program (e.g., setkey or racoon). 860 * the user-level SA generation program (e.g., setkey or racoon).
861 * @polsec contains the security context information associated with a xfrm
862 * policy rule from which to take the base context. polsec must be NULL
863 * when sec_ctx is specified.
864 * @secid contains the secid from which to take the mls portion of the context. 861 * @secid contains the secid from which to take the mls portion of the context.
865 * Allocate a security structure to the x->security field; the security 862 * Allocate a security structure to the x->security field; the security
866 * field is initialized to NULL when the xfrm_state is allocated. Set the 863 * field is initialized to NULL when the xfrm_state is allocated. Set the
@@ -889,11 +886,6 @@ struct request_sock;
889 * @xp contains the policy to check for a match. 886 * @xp contains the policy to check for a match.
890 * @fl contains the flow to check for a match. 887 * @fl contains the flow to check for a match.
891 * Return 1 if there is a match. 888 * Return 1 if there is a match.
892 * @xfrm_flow_state_match:
893 * @fl contains the flow key to match.
894 * @xfrm points to the xfrm_state to match.
895 * @xp points to the xfrm_policy to match.
896 * Return 1 if there is a match.
897 * @xfrm_decode_session: 889 * @xfrm_decode_session:
898 * @skb points to skb to decode. 890 * @skb points to skb to decode.
899 * @secid points to the flow key secid to set. 891 * @secid points to the flow key secid to set.
@@ -1373,25 +1365,24 @@ struct security_operations {
1373 int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb, 1365 int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb,
1374 struct request_sock *req); 1366 struct request_sock *req);
1375 void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req); 1367 void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req);
1368 void (*inet_conn_established)(struct sock *sk, struct sk_buff *skb);
1376 void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl); 1369 void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl);
1377#endif /* CONFIG_SECURITY_NETWORK */ 1370#endif /* CONFIG_SECURITY_NETWORK */
1378 1371
1379#ifdef CONFIG_SECURITY_NETWORK_XFRM 1372#ifdef CONFIG_SECURITY_NETWORK_XFRM
1380 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, 1373 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp,
1381 struct xfrm_user_sec_ctx *sec_ctx, struct sock *sk); 1374 struct xfrm_user_sec_ctx *sec_ctx);
1382 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); 1375 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new);
1383 void (*xfrm_policy_free_security) (struct xfrm_policy *xp); 1376 void (*xfrm_policy_free_security) (struct xfrm_policy *xp);
1384 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp); 1377 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp);
1385 int (*xfrm_state_alloc_security) (struct xfrm_state *x, 1378 int (*xfrm_state_alloc_security) (struct xfrm_state *x,
1386 struct xfrm_user_sec_ctx *sec_ctx, struct xfrm_sec_ctx *polsec, 1379 struct xfrm_user_sec_ctx *sec_ctx,
1387 u32 secid); 1380 u32 secid);
1388 void (*xfrm_state_free_security) (struct xfrm_state *x); 1381 void (*xfrm_state_free_security) (struct xfrm_state *x);
1389 int (*xfrm_state_delete_security) (struct xfrm_state *x); 1382 int (*xfrm_state_delete_security) (struct xfrm_state *x);
1390 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir); 1383 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir);
1391 int (*xfrm_state_pol_flow_match)(struct xfrm_state *x, 1384 int (*xfrm_state_pol_flow_match)(struct xfrm_state *x,
1392 struct xfrm_policy *xp, struct flowi *fl); 1385 struct xfrm_policy *xp, struct flowi *fl);
1393 int (*xfrm_flow_state_match)(struct flowi *fl, struct xfrm_state *xfrm,
1394 struct xfrm_policy *xp);
1395 int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall); 1386 int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall);
1396#endif /* CONFIG_SECURITY_NETWORK_XFRM */ 1387#endif /* CONFIG_SECURITY_NETWORK_XFRM */
1397 1388
@@ -2966,9 +2957,15 @@ static inline void security_inet_csk_clone(struct sock *newsk,
2966{ 2957{
2967 security_ops->inet_csk_clone(newsk, req); 2958 security_ops->inet_csk_clone(newsk, req);
2968} 2959}
2960
2961static inline void security_inet_conn_established(struct sock *sk,
2962 struct sk_buff *skb)
2963{
2964 security_ops->inet_conn_established(sk, skb);
2965}
2969#else /* CONFIG_SECURITY_NETWORK */ 2966#else /* CONFIG_SECURITY_NETWORK */
2970static inline int security_unix_stream_connect(struct socket * sock, 2967static inline int security_unix_stream_connect(struct socket * sock,
2971 struct socket * other, 2968 struct socket * other,
2972 struct sock * newsk) 2969 struct sock * newsk)
2973{ 2970{
2974 return 0; 2971 return 0;
@@ -3115,12 +3112,17 @@ static inline void security_inet_csk_clone(struct sock *newsk,
3115 const struct request_sock *req) 3112 const struct request_sock *req)
3116{ 3113{
3117} 3114}
3115
3116static inline void security_inet_conn_established(struct sock *sk,
3117 struct sk_buff *skb)
3118{
3119}
3118#endif /* CONFIG_SECURITY_NETWORK */ 3120#endif /* CONFIG_SECURITY_NETWORK */
3119 3121
3120#ifdef CONFIG_SECURITY_NETWORK_XFRM 3122#ifdef CONFIG_SECURITY_NETWORK_XFRM
3121static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) 3123static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx)
3122{ 3124{
3123 return security_ops->xfrm_policy_alloc_security(xp, sec_ctx, NULL); 3125 return security_ops->xfrm_policy_alloc_security(xp, sec_ctx);
3124} 3126}
3125 3127
3126static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) 3128static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new)
@@ -3141,7 +3143,7 @@ static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
3141static inline int security_xfrm_state_alloc(struct xfrm_state *x, 3143static inline int security_xfrm_state_alloc(struct xfrm_state *x,
3142 struct xfrm_user_sec_ctx *sec_ctx) 3144 struct xfrm_user_sec_ctx *sec_ctx)
3143{ 3145{
3144 return security_ops->xfrm_state_alloc_security(x, sec_ctx, NULL, 0); 3146 return security_ops->xfrm_state_alloc_security(x, sec_ctx, 0);
3145} 3147}
3146 3148
3147static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x, 3149static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
@@ -3149,7 +3151,11 @@ static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
3149{ 3151{
3150 if (!polsec) 3152 if (!polsec)
3151 return 0; 3153 return 0;
3152 return security_ops->xfrm_state_alloc_security(x, NULL, polsec, secid); 3154 /*
3155 * We want the context to be taken from secid which is usually
3156 * from the sock.
3157 */
3158 return security_ops->xfrm_state_alloc_security(x, NULL, secid);
3153} 3159}
3154 3160
3155static inline int security_xfrm_state_delete(struct xfrm_state *x) 3161static inline int security_xfrm_state_delete(struct xfrm_state *x)
@@ -3173,12 +3179,6 @@ static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
3173 return security_ops->xfrm_state_pol_flow_match(x, xp, fl); 3179 return security_ops->xfrm_state_pol_flow_match(x, xp, fl);
3174} 3180}
3175 3181
3176static inline int security_xfrm_flow_state_match(struct flowi *fl,
3177 struct xfrm_state *xfrm, struct xfrm_policy *xp)
3178{
3179 return security_ops->xfrm_flow_state_match(fl, xfrm, xp);
3180}
3181
3182static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) 3182static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
3183{ 3183{
3184 return security_ops->xfrm_decode_session(skb, secid, 1); 3184 return security_ops->xfrm_decode_session(skb, secid, 1);
@@ -3242,12 +3242,6 @@ static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
3242 return 1; 3242 return 1;
3243} 3243}
3244 3244
3245static inline int security_xfrm_flow_state_match(struct flowi *fl,
3246 struct xfrm_state *xfrm, struct xfrm_policy *xp)
3247{
3248 return 1;
3249}
3250
3251static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) 3245static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
3252{ 3246{
3253 return 0; 3247 return 0;
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index b95f6eb7254c..3e3cccbb1cac 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -20,7 +20,7 @@ struct seq_file {
20 loff_t index; 20 loff_t index;
21 loff_t version; 21 loff_t version;
22 struct mutex lock; 22 struct mutex lock;
23 struct seq_operations *op; 23 const struct seq_operations *op;
24 void *private; 24 void *private;
25}; 25};
26 26
@@ -31,7 +31,7 @@ struct seq_operations {
31 int (*show) (struct seq_file *m, void *v); 31 int (*show) (struct seq_file *m, void *v);
32}; 32};
33 33
34int seq_open(struct file *, struct seq_operations *); 34int seq_open(struct file *, const struct seq_operations *);
35ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); 35ssize_t seq_read(struct file *, char __user *, size_t, loff_t *);
36loff_t seq_lseek(struct file *, loff_t, int); 36loff_t seq_lseek(struct file *, loff_t, int);
37int seq_release(struct inode *, struct file *); 37int seq_release(struct inode *, struct file *);
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 46000936f8f1..6b0648cfdffc 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -44,8 +44,11 @@ typedef struct {
44#define SEQLOCK_UNLOCKED \ 44#define SEQLOCK_UNLOCKED \
45 __SEQLOCK_UNLOCKED(old_style_seqlock_init) 45 __SEQLOCK_UNLOCKED(old_style_seqlock_init)
46 46
47#define seqlock_init(x) \ 47#define seqlock_init(x) \
48 do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); } while (0) 48 do { \
49 (x)->sequence = 0; \
50 spin_lock_init(&(x)->lock); \
51 } while (0)
49 52
50#define DEFINE_SEQLOCK(x) \ 53#define DEFINE_SEQLOCK(x) \
51 seqlock_t x = __SEQLOCK_UNLOCKED(x) 54 seqlock_t x = __SEQLOCK_UNLOCKED(x)
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 8e9681413726..71310d80c09a 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -41,6 +41,7 @@ enum {
41 PLAT8250_DEV_FOURPORT, 41 PLAT8250_DEV_FOURPORT,
42 PLAT8250_DEV_ACCENT, 42 PLAT8250_DEV_ACCENT,
43 PLAT8250_DEV_BOCA, 43 PLAT8250_DEV_BOCA,
44 PLAT8250_DEV_EXAR_ST16C554,
44 PLAT8250_DEV_HUB6, 45 PLAT8250_DEV_HUB6,
45 PLAT8250_DEV_MCA, 46 PLAT8250_DEV_MCA,
46 PLAT8250_DEV_AU1X00, 47 PLAT8250_DEV_AU1X00,
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 463ab953b092..cf23813cbec2 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -132,6 +132,8 @@
132 132
133#define PORT_S3C2412 73 133#define PORT_S3C2412 73
134 134
135/* Xilinx uartlite */
136#define PORT_UARTLITE 74
135 137
136#ifdef __KERNEL__ 138#ifdef __KERNEL__
137 139
@@ -164,8 +166,8 @@ struct uart_ops {
164 void (*break_ctl)(struct uart_port *, int ctl); 166 void (*break_ctl)(struct uart_port *, int ctl);
165 int (*startup)(struct uart_port *); 167 int (*startup)(struct uart_port *);
166 void (*shutdown)(struct uart_port *); 168 void (*shutdown)(struct uart_port *);
167 void (*set_termios)(struct uart_port *, struct termios *new, 169 void (*set_termios)(struct uart_port *, struct ktermios *new,
168 struct termios *old); 170 struct ktermios *old);
169 void (*pm)(struct uart_port *, unsigned int state, 171 void (*pm)(struct uart_port *, unsigned int state,
170 unsigned int oldstate); 172 unsigned int oldstate);
171 int (*set_wake)(struct uart_port *, unsigned int state); 173 int (*set_wake)(struct uart_port *, unsigned int state);
@@ -359,8 +361,8 @@ void uart_write_wakeup(struct uart_port *port);
359 */ 361 */
360void uart_update_timeout(struct uart_port *port, unsigned int cflag, 362void uart_update_timeout(struct uart_port *port, unsigned int cflag,
361 unsigned int baud); 363 unsigned int baud);
362unsigned int uart_get_baud_rate(struct uart_port *port, struct termios *termios, 364unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
363 struct termios *old, unsigned int min, 365 struct ktermios *old, unsigned int min,
364 unsigned int max); 366 unsigned int max);
365unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud); 367unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud);
366 368
diff --git a/include/linux/serio.h b/include/linux/serio.h
index b99c5ca9708d..0f478a8791a2 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -85,18 +85,8 @@ static inline void serio_register_port(struct serio *serio)
85 85
86void serio_unregister_port(struct serio *serio); 86void serio_unregister_port(struct serio *serio);
87void serio_unregister_child_port(struct serio *serio); 87void serio_unregister_child_port(struct serio *serio);
88void __serio_unregister_port_delayed(struct serio *serio, struct module *owner);
89static inline void serio_unregister_port_delayed(struct serio *serio)
90{
91 __serio_unregister_port_delayed(serio, THIS_MODULE);
92}
93
94void __serio_register_driver(struct serio_driver *drv, struct module *owner);
95static inline void serio_register_driver(struct serio_driver *drv)
96{
97 __serio_register_driver(drv, THIS_MODULE);
98}
99 88
89int serio_register_driver(struct serio_driver *drv);
100void serio_unregister_driver(struct serio_driver *drv); 90void serio_unregister_driver(struct serio_driver *drv);
101 91
102static inline int serio_write(struct serio *serio, unsigned char data) 92static inline int serio_write(struct serio *serio, unsigned char data)
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 117135e33d67..14749056dd63 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -241,6 +241,8 @@ extern int sigprocmask(int, sigset_t *, sigset_t *);
241struct pt_regs; 241struct pt_regs;
242extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); 242extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
243 243
244extern struct kmem_cache *sighand_cachep;
245
244#endif /* __KERNEL__ */ 246#endif /* __KERNEL__ */
245 247
246#endif /* _LINUX_SIGNAL_H */ 248#endif /* _LINUX_SIGNAL_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 85577a4ffa61..4ff3940210d8 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -22,12 +22,10 @@
22#include <asm/atomic.h> 22#include <asm/atomic.h>
23#include <asm/types.h> 23#include <asm/types.h>
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/mm.h>
26#include <linux/highmem.h>
27#include <linux/poll.h>
28#include <linux/net.h> 25#include <linux/net.h>
29#include <linux/textsearch.h> 26#include <linux/textsearch.h>
30#include <net/checksum.h> 27#include <net/checksum.h>
28#include <linux/rcupdate.h>
31#include <linux/dmaengine.h> 29#include <linux/dmaengine.h>
32 30
33#define HAVE_ALLOC_SKB /* For the drivers to know */ 31#define HAVE_ALLOC_SKB /* For the drivers to know */
@@ -139,7 +137,7 @@ struct skb_shared_info {
139 /* Warning: this field is not always filled in (UFO)! */ 137 /* Warning: this field is not always filled in (UFO)! */
140 unsigned short gso_segs; 138 unsigned short gso_segs;
141 unsigned short gso_type; 139 unsigned short gso_type;
142 unsigned int ip6_frag_id; 140 __be32 ip6_frag_id;
143 struct sk_buff *frag_list; 141 struct sk_buff *frag_list;
144 skb_frag_t frags[MAX_SKB_FRAGS]; 142 skb_frag_t frags[MAX_SKB_FRAGS];
145}; 143};
@@ -216,7 +214,7 @@ enum {
216 * @tail: Tail pointer 214 * @tail: Tail pointer
217 * @end: End pointer 215 * @end: End pointer
218 * @destructor: Destruct function 216 * @destructor: Destruct function
219 * @nfmark: Can be used for communication between hooks 217 * @mark: Generic packet mark
220 * @nfct: Associated connection, if any 218 * @nfct: Associated connection, if any
221 * @ipvs_property: skbuff is owned by ipvs 219 * @ipvs_property: skbuff is owned by ipvs
222 * @nfctinfo: Relationship of this skb to the connection 220 * @nfctinfo: Relationship of this skb to the connection
@@ -273,8 +271,11 @@ struct sk_buff {
273 271
274 unsigned int len, 272 unsigned int len,
275 data_len, 273 data_len,
276 mac_len, 274 mac_len;
277 csum; 275 union {
276 __wsum csum;
277 __u32 csum_offset;
278 };
278 __u32 priority; 279 __u32 priority;
279 __u8 local_df:1, 280 __u8 local_df:1,
280 cloned:1, 281 cloned:1,
@@ -295,7 +296,6 @@ struct sk_buff {
295#ifdef CONFIG_BRIDGE_NETFILTER 296#ifdef CONFIG_BRIDGE_NETFILTER
296 struct nf_bridge_info *nf_bridge; 297 struct nf_bridge_info *nf_bridge;
297#endif 298#endif
298 __u32 nfmark;
299#endif /* CONFIG_NETFILTER */ 299#endif /* CONFIG_NETFILTER */
300#ifdef CONFIG_NET_SCHED 300#ifdef CONFIG_NET_SCHED
301 __u16 tc_index; /* traffic control index */ 301 __u16 tc_index; /* traffic control index */
@@ -310,6 +310,7 @@ struct sk_buff {
310 __u32 secmark; 310 __u32 secmark;
311#endif 311#endif
312 312
313 __u32 mark;
313 314
314 /* These elements must be at the end, see alloc_skb() for details. */ 315 /* These elements must be at the end, see alloc_skb() for details. */
315 unsigned int truesize; 316 unsigned int truesize;
@@ -331,20 +332,20 @@ struct sk_buff {
331extern void kfree_skb(struct sk_buff *skb); 332extern void kfree_skb(struct sk_buff *skb);
332extern void __kfree_skb(struct sk_buff *skb); 333extern void __kfree_skb(struct sk_buff *skb);
333extern struct sk_buff *__alloc_skb(unsigned int size, 334extern struct sk_buff *__alloc_skb(unsigned int size,
334 gfp_t priority, int fclone); 335 gfp_t priority, int fclone, int node);
335static inline struct sk_buff *alloc_skb(unsigned int size, 336static inline struct sk_buff *alloc_skb(unsigned int size,
336 gfp_t priority) 337 gfp_t priority)
337{ 338{
338 return __alloc_skb(size, priority, 0); 339 return __alloc_skb(size, priority, 0, -1);
339} 340}
340 341
341static inline struct sk_buff *alloc_skb_fclone(unsigned int size, 342static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
342 gfp_t priority) 343 gfp_t priority)
343{ 344{
344 return __alloc_skb(size, priority, 1); 345 return __alloc_skb(size, priority, 1, -1);
345} 346}
346 347
347extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, 348extern struct sk_buff *alloc_skb_from_cache(struct kmem_cache *cp,
348 unsigned int size, 349 unsigned int size,
349 gfp_t priority); 350 gfp_t priority);
350extern void kfree_skbmem(struct sk_buff *skb); 351extern void kfree_skbmem(struct sk_buff *skb);
@@ -1199,8 +1200,7 @@ static inline int skb_add_data(struct sk_buff *skb,
1199 1200
1200 if (skb->ip_summed == CHECKSUM_NONE) { 1201 if (skb->ip_summed == CHECKSUM_NONE) {
1201 int err = 0; 1202 int err = 0;
1202 unsigned int csum = csum_and_copy_from_user(from, 1203 __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy),
1203 skb_put(skb, copy),
1204 copy, 0, &err); 1204 copy, 0, &err);
1205 if (!err) { 1205 if (!err) {
1206 skb->csum = csum_block_add(skb->csum, csum, off); 1206 skb->csum = csum_block_add(skb->csum, csum, off);
@@ -1293,24 +1293,6 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
1293 return __pskb_trim(skb, len); 1293 return __pskb_trim(skb, len);
1294} 1294}
1295 1295
1296static inline void *kmap_skb_frag(const skb_frag_t *frag)
1297{
1298#ifdef CONFIG_HIGHMEM
1299 BUG_ON(in_irq());
1300
1301 local_bh_disable();
1302#endif
1303 return kmap_atomic(frag->page, KM_SKB_DATA_SOFTIRQ);
1304}
1305
1306static inline void kunmap_skb_frag(void *vaddr)
1307{
1308 kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
1309#ifdef CONFIG_HIGHMEM
1310 local_bh_enable();
1311#endif
1312}
1313
1314#define skb_queue_walk(queue, skb) \ 1296#define skb_queue_walk(queue, skb) \
1315 for (skb = (queue)->next; \ 1297 for (skb = (queue)->next; \
1316 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ 1298 prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \
@@ -1335,15 +1317,15 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
1335extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); 1317extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
1336extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, 1318extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb,
1337 unsigned int flags); 1319 unsigned int flags);
1338extern unsigned int skb_checksum(const struct sk_buff *skb, int offset, 1320extern __wsum skb_checksum(const struct sk_buff *skb, int offset,
1339 int len, unsigned int csum); 1321 int len, __wsum csum);
1340extern int skb_copy_bits(const struct sk_buff *skb, int offset, 1322extern int skb_copy_bits(const struct sk_buff *skb, int offset,
1341 void *to, int len); 1323 void *to, int len);
1342extern int skb_store_bits(const struct sk_buff *skb, int offset, 1324extern int skb_store_bits(const struct sk_buff *skb, int offset,
1343 void *from, int len); 1325 void *from, int len);
1344extern unsigned int skb_copy_and_csum_bits(const struct sk_buff *skb, 1326extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb,
1345 int offset, u8 *to, int len, 1327 int offset, u8 *to, int len,
1346 unsigned int csum); 1328 __wsum csum);
1347extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); 1329extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
1348extern void skb_split(struct sk_buff *skb, 1330extern void skb_split(struct sk_buff *skb,
1349 struct sk_buff *skb1, const u32 len); 1331 struct sk_buff *skb1, const u32 len);
@@ -1399,7 +1381,7 @@ static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *
1399 1381
1400extern void __net_timestamp(struct sk_buff *skb); 1382extern void __net_timestamp(struct sk_buff *skb);
1401 1383
1402extern unsigned int __skb_checksum_complete(struct sk_buff *skb); 1384extern __sum16 __skb_checksum_complete(struct sk_buff *skb);
1403 1385
1404/** 1386/**
1405 * skb_checksum_complete - Calculate checksum of an entire packet 1387 * skb_checksum_complete - Calculate checksum of an entire packet
diff --git a/include/linux/slab.h b/include/linux/slab.h
index c4947b8a2c03..1ef822e31c77 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -1,82 +1,106 @@
1/* 1/*
2 * linux/include/linux/slab.h 2 * Written by Mark Hemment, 1996 (markhe@nextd.demon.co.uk).
3 * Written by Mark Hemment, 1996. 3 *
4 * (markhe@nextd.demon.co.uk) 4 * (C) SGI 2006, Christoph Lameter <clameter@sgi.com>
5 * Cleaned up and restructured to ease the addition of alternative
6 * implementations of SLAB allocators.
5 */ 7 */
6 8
7#ifndef _LINUX_SLAB_H 9#ifndef _LINUX_SLAB_H
8#define _LINUX_SLAB_H 10#define _LINUX_SLAB_H
9 11
10#if defined(__KERNEL__) 12#ifdef __KERNEL__
11
12typedef struct kmem_cache kmem_cache_t;
13 13
14#include <linux/gfp.h> 14#include <linux/gfp.h>
15#include <linux/init.h> 15#include <linux/types.h>
16#include <linux/types.h>
17#include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */
18#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */
19 16
20/* flags for kmem_cache_alloc() */ 17typedef struct kmem_cache kmem_cache_t __deprecated;
21#define SLAB_NOFS GFP_NOFS
22#define SLAB_NOIO GFP_NOIO
23#define SLAB_ATOMIC GFP_ATOMIC
24#define SLAB_USER GFP_USER
25#define SLAB_KERNEL GFP_KERNEL
26#define SLAB_DMA GFP_DMA
27 18
28#define SLAB_LEVEL_MASK GFP_LEVEL_MASK 19/*
20 * Flags to pass to kmem_cache_create().
21 * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set.
22 */
23#define SLAB_DEBUG_FREE 0x00000100UL /* DEBUG: Perform (expensive) checks on free */
24#define SLAB_DEBUG_INITIAL 0x00000200UL /* DEBUG: Call constructor (as verifier) */
25#define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */
26#define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */
27#define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */
28#define SLAB_CACHE_DMA 0x00004000UL /* Use GFP_DMA memory */
29#define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* Force alignment even if debuggin is active */
30#define SLAB_STORE_USER 0x00010000UL /* DEBUG: Store the last owner for bug hunting */
31#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
32#define SLAB_PANIC 0x00040000UL /* Panic if kmem_cache_create() fails */
33#define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */
34#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */
29 35
30#define SLAB_NO_GROW __GFP_NO_GROW /* don't grow a cache */ 36/* Flags passed to a constructor functions */
37#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* If not set, then deconstructor */
38#define SLAB_CTOR_ATOMIC 0x002UL /* Tell constructor it can't sleep */
39#define SLAB_CTOR_VERIFY 0x004UL /* Tell constructor it's a verify call */
31 40
32/* flags to pass to kmem_cache_create(). 41/*
33 * The first 3 are only valid when the allocator as been build 42 * struct kmem_cache related prototypes
34 * SLAB_DEBUG_SUPPORT.
35 */ 43 */
36#define SLAB_DEBUG_FREE 0x00000100UL /* Peform (expensive) checks on free */ 44void __init kmem_cache_init(void);
37#define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ 45extern int slab_is_available(void);
38#define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */
39#define SLAB_POISON 0x00000800UL /* Poison objects */
40#define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */
41#define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */
42#define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */
43#define SLAB_STORE_USER 0x00010000UL /* store the last owner for bug hunting */
44#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* track pages allocated to indicate
45 what is reclaimable later*/
46#define SLAB_PANIC 0x00040000UL /* panic if kmem_cache_create() fails */
47#define SLAB_DESTROY_BY_RCU 0x00080000UL /* defer freeing pages to RCU */
48#define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */
49 46
50/* flags passed to a constructor func */ 47struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
51#define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */ 48 unsigned long,
52#define SLAB_CTOR_ATOMIC 0x002UL /* tell constructor it can't sleep */ 49 void (*)(void *, struct kmem_cache *, unsigned long),
53#define SLAB_CTOR_VERIFY 0x004UL /* tell constructor it's a verify call */ 50 void (*)(void *, struct kmem_cache *, unsigned long));
51void kmem_cache_destroy(struct kmem_cache *);
52int kmem_cache_shrink(struct kmem_cache *);
53void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
54void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
55void kmem_cache_free(struct kmem_cache *, void *);
56unsigned int kmem_cache_size(struct kmem_cache *);
57const char *kmem_cache_name(struct kmem_cache *);
58int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
54 59
55#ifndef CONFIG_SLOB 60#ifdef CONFIG_NUMA
61extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
62#else
63static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
64 gfp_t flags, int node)
65{
66 return kmem_cache_alloc(cachep, flags);
67}
68#endif
56 69
57/* prototypes */ 70/*
58extern void __init kmem_cache_init(void); 71 * Common kmalloc functions provided by all allocators
72 */
73void *__kmalloc(size_t, gfp_t);
74void *__kzalloc(size_t, gfp_t);
75void kfree(const void *);
76unsigned int ksize(const void *);
59 77
60extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, 78/**
61 void (*)(void *, kmem_cache_t *, unsigned long), 79 * kcalloc - allocate memory for an array. The memory is set to zero.
62 void (*)(void *, kmem_cache_t *, unsigned long)); 80 * @n: number of elements.
63extern void kmem_cache_destroy(kmem_cache_t *); 81 * @size: element size.
64extern int kmem_cache_shrink(kmem_cache_t *); 82 * @flags: the type of memory to allocate.
65extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); 83 */
66extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); 84static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
67extern void kmem_cache_free(kmem_cache_t *, void *); 85{
68extern unsigned int kmem_cache_size(kmem_cache_t *); 86 if (n != 0 && size > ULONG_MAX / n)
69extern const char *kmem_cache_name(kmem_cache_t *); 87 return NULL;
88 return __kzalloc(n * size, flags);
89}
70 90
71/* Size description struct for general caches. */ 91/*
72struct cache_sizes { 92 * Allocator specific definitions. These are mainly used to establish optimized
73 size_t cs_size; 93 * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by selecting
74 kmem_cache_t *cs_cachep; 94 * the appropriate general cache at compile time.
75 kmem_cache_t *cs_dmacachep; 95 */
76};
77extern struct cache_sizes malloc_sizes[];
78 96
79extern void *__kmalloc(size_t, gfp_t); 97#ifdef CONFIG_SLAB
98#include <linux/slab_def.h>
99#else
100/*
101 * Fallback definitions for an allocator not wanting to provide
102 * its own optimized kmalloc definitions (like SLOB).
103 */
80 104
81/** 105/**
82 * kmalloc - allocate memory 106 * kmalloc - allocate memory
@@ -125,46 +149,9 @@ extern void *__kmalloc(size_t, gfp_t);
125 */ 149 */
126static inline void *kmalloc(size_t size, gfp_t flags) 150static inline void *kmalloc(size_t size, gfp_t flags)
127{ 151{
128 if (__builtin_constant_p(size)) {
129 int i = 0;
130#define CACHE(x) \
131 if (size <= x) \
132 goto found; \
133 else \
134 i++;
135#include "kmalloc_sizes.h"
136#undef CACHE
137 {
138 extern void __you_cannot_kmalloc_that_much(void);
139 __you_cannot_kmalloc_that_much();
140 }
141found:
142 return kmem_cache_alloc((flags & GFP_DMA) ?
143 malloc_sizes[i].cs_dmacachep :
144 malloc_sizes[i].cs_cachep, flags);
145 }
146 return __kmalloc(size, flags); 152 return __kmalloc(size, flags);
147} 153}
148 154
149/*
150 * kmalloc_track_caller is a special version of kmalloc that records the
151 * calling function of the routine calling it for slab leak tracking instead
152 * of just the calling function (confusing, eh?).
153 * It's useful when the call to kmalloc comes from a widely-used standard
154 * allocator where we care about the real place the memory allocation
155 * request comes from.
156 */
157#ifndef CONFIG_DEBUG_SLAB
158#define kmalloc_track_caller(size, flags) \
159 __kmalloc(size, flags)
160#else
161extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
162#define kmalloc_track_caller(size, flags) \
163 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
164#endif
165
166extern void *__kzalloc(size_t, gfp_t);
167
168/** 155/**
169 * kzalloc - allocate memory. The memory is set to zero. 156 * kzalloc - allocate memory. The memory is set to zero.
170 * @size: how many bytes of memory are required. 157 * @size: how many bytes of memory are required.
@@ -172,128 +159,65 @@ extern void *__kzalloc(size_t, gfp_t);
172 */ 159 */
173static inline void *kzalloc(size_t size, gfp_t flags) 160static inline void *kzalloc(size_t size, gfp_t flags)
174{ 161{
175 if (__builtin_constant_p(size)) {
176 int i = 0;
177#define CACHE(x) \
178 if (size <= x) \
179 goto found; \
180 else \
181 i++;
182#include "kmalloc_sizes.h"
183#undef CACHE
184 {
185 extern void __you_cannot_kzalloc_that_much(void);
186 __you_cannot_kzalloc_that_much();
187 }
188found:
189 return kmem_cache_zalloc((flags & GFP_DMA) ?
190 malloc_sizes[i].cs_dmacachep :
191 malloc_sizes[i].cs_cachep, flags);
192 }
193 return __kzalloc(size, flags); 162 return __kzalloc(size, flags);
194} 163}
164#endif
195 165
196/** 166#ifndef CONFIG_NUMA
197 * kcalloc - allocate memory for an array. The memory is set to zero.
198 * @n: number of elements.
199 * @size: element size.
200 * @flags: the type of memory to allocate.
201 */
202static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
203{
204 if (n != 0 && size > ULONG_MAX / n)
205 return NULL;
206 return kzalloc(n * size, flags);
207}
208
209extern void kfree(const void *);
210extern unsigned int ksize(const void *);
211extern int slab_is_available(void);
212
213#ifdef CONFIG_NUMA
214extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node);
215extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
216
217static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
218{
219 if (__builtin_constant_p(size)) {
220 int i = 0;
221#define CACHE(x) \
222 if (size <= x) \
223 goto found; \
224 else \
225 i++;
226#include "kmalloc_sizes.h"
227#undef CACHE
228 {
229 extern void __you_cannot_kmalloc_that_much(void);
230 __you_cannot_kmalloc_that_much();
231 }
232found:
233 return kmem_cache_alloc_node((flags & GFP_DMA) ?
234 malloc_sizes[i].cs_dmacachep :
235 malloc_sizes[i].cs_cachep, flags, node);
236 }
237 return __kmalloc_node(size, flags, node);
238}
239#else
240static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node)
241{
242 return kmem_cache_alloc(cachep, flags);
243}
244static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 167static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
245{ 168{
246 return kmalloc(size, flags); 169 return kmalloc(size, flags);
247} 170}
248#endif
249
250extern int FASTCALL(kmem_cache_reap(int));
251extern int FASTCALL(kmem_ptr_validate(kmem_cache_t *cachep, void *ptr));
252
253#else /* CONFIG_SLOB */
254
255/* SLOB allocator routines */
256
257void kmem_cache_init(void);
258struct kmem_cache *kmem_cache_create(const char *c, size_t, size_t,
259 unsigned long,
260 void (*)(void *, struct kmem_cache *, unsigned long),
261 void (*)(void *, struct kmem_cache *, unsigned long));
262void kmem_cache_destroy(struct kmem_cache *c);
263void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags);
264void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
265void kmem_cache_free(struct kmem_cache *c, void *b);
266const char *kmem_cache_name(struct kmem_cache *);
267void *kmalloc(size_t size, gfp_t flags);
268void *__kzalloc(size_t size, gfp_t flags);
269void kfree(const void *m);
270unsigned int ksize(const void *m);
271unsigned int kmem_cache_size(struct kmem_cache *c);
272 171
273static inline void *kcalloc(size_t n, size_t size, gfp_t flags) 172static inline void *__kmalloc_node(size_t size, gfp_t flags, int node)
274{ 173{
275 return __kzalloc(n * size, flags); 174 return __kmalloc(size, flags);
276} 175}
176#endif /* !CONFIG_NUMA */
277 177
278#define kmem_cache_shrink(d) (0) 178/*
279#define kmem_cache_reap(a) 179 * kmalloc_track_caller is a special version of kmalloc that records the
280#define kmem_ptr_validate(a, b) (0) 180 * calling function of the routine calling it for slab leak tracking instead
281#define kmem_cache_alloc_node(c, f, n) kmem_cache_alloc(c, f) 181 * of just the calling function (confusing, eh?).
282#define kmalloc_node(s, f, n) kmalloc(s, f) 182 * It's useful when the call to kmalloc comes from a widely-used standard
283#define kzalloc(s, f) __kzalloc(s, f) 183 * allocator where we care about the real place the memory allocation
284#define kmalloc_track_caller kmalloc 184 * request comes from.
185 */
186#ifdef CONFIG_DEBUG_SLAB
187extern void *__kmalloc_track_caller(size_t, gfp_t, void*);
188#define kmalloc_track_caller(size, flags) \
189 __kmalloc_track_caller(size, flags, __builtin_return_address(0))
190#else
191#define kmalloc_track_caller(size, flags) \
192 __kmalloc(size, flags)
193#endif /* DEBUG_SLAB */
285 194
286#endif /* CONFIG_SLOB */ 195#ifdef CONFIG_NUMA
196/*
197 * kmalloc_node_track_caller is a special version of kmalloc_node that
198 * records the calling function of the routine calling it for slab leak
199 * tracking instead of just the calling function (confusing, eh?).
200 * It's useful when the call to kmalloc_node comes from a widely-used
201 * standard allocator where we care about the real place the memory
202 * allocation request comes from.
203 */
204#ifdef CONFIG_DEBUG_SLAB
205extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *);
206#define kmalloc_node_track_caller(size, flags, node) \
207 __kmalloc_node_track_caller(size, flags, node, \
208 __builtin_return_address(0))
209#else
210#define kmalloc_node_track_caller(size, flags, node) \
211 __kmalloc_node(size, flags, node)
212#endif
287 213
288/* System wide caches */ 214#else /* CONFIG_NUMA */
289extern kmem_cache_t *vm_area_cachep;
290extern kmem_cache_t *names_cachep;
291extern kmem_cache_t *files_cachep;
292extern kmem_cache_t *filp_cachep;
293extern kmem_cache_t *fs_cachep;
294extern kmem_cache_t *sighand_cachep;
295extern kmem_cache_t *bio_cachep;
296 215
297#endif /* __KERNEL__ */ 216#define kmalloc_node_track_caller(size, flags, node) \
217 kmalloc_track_caller(size, flags)
298 218
219#endif /* DEBUG_SLAB */
220
221#endif /* __KERNEL__ */
299#endif /* _LINUX_SLAB_H */ 222#endif /* _LINUX_SLAB_H */
223
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
new file mode 100644
index 000000000000..4b463e66ddea
--- /dev/null
+++ b/include/linux/slab_def.h
@@ -0,0 +1,100 @@
1#ifndef _LINUX_SLAB_DEF_H
2#define _LINUX_SLAB_DEF_H
3
4/*
5 * Definitions unique to the original Linux SLAB allocator.
6 *
7 * What we provide here is a way to optimize the frequent kmalloc
8 * calls in the kernel by selecting the appropriate general cache
9 * if kmalloc was called with a size that can be established at
10 * compile time.
11 */
12
13#include <linux/init.h>
14#include <asm/page.h> /* kmalloc_sizes.h needs PAGE_SIZE */
15#include <asm/cache.h> /* kmalloc_sizes.h needs L1_CACHE_BYTES */
16#include <linux/compiler.h>
17
18/* Size description struct for general caches. */
19struct cache_sizes {
20 size_t cs_size;
21 struct kmem_cache *cs_cachep;
22 struct kmem_cache *cs_dmacachep;
23};
24extern struct cache_sizes malloc_sizes[];
25
26static inline void *kmalloc(size_t size, gfp_t flags)
27{
28 if (__builtin_constant_p(size)) {
29 int i = 0;
30#define CACHE(x) \
31 if (size <= x) \
32 goto found; \
33 else \
34 i++;
35#include "kmalloc_sizes.h"
36#undef CACHE
37 {
38 extern void __you_cannot_kmalloc_that_much(void);
39 __you_cannot_kmalloc_that_much();
40 }
41found:
42 return kmem_cache_alloc((flags & GFP_DMA) ?
43 malloc_sizes[i].cs_dmacachep :
44 malloc_sizes[i].cs_cachep, flags);
45 }
46 return __kmalloc(size, flags);
47}
48
49static inline void *kzalloc(size_t size, gfp_t flags)
50{
51 if (__builtin_constant_p(size)) {
52 int i = 0;
53#define CACHE(x) \
54 if (size <= x) \
55 goto found; \
56 else \
57 i++;
58#include "kmalloc_sizes.h"
59#undef CACHE
60 {
61 extern void __you_cannot_kzalloc_that_much(void);
62 __you_cannot_kzalloc_that_much();
63 }
64found:
65 return kmem_cache_zalloc((flags & GFP_DMA) ?
66 malloc_sizes[i].cs_dmacachep :
67 malloc_sizes[i].cs_cachep, flags);
68 }
69 return __kzalloc(size, flags);
70}
71
72#ifdef CONFIG_NUMA
73extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
74
75static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
76{
77 if (__builtin_constant_p(size)) {
78 int i = 0;
79#define CACHE(x) \
80 if (size <= x) \
81 goto found; \
82 else \
83 i++;
84#include "kmalloc_sizes.h"
85#undef CACHE
86 {
87 extern void __you_cannot_kmalloc_that_much(void);
88 __you_cannot_kmalloc_that_much();
89 }
90found:
91 return kmem_cache_alloc_node((flags & GFP_DMA) ?
92 malloc_sizes[i].cs_dmacachep :
93 malloc_sizes[i].cs_cachep, flags, node);
94 }
95 return __kmalloc_node(size, flags, node);
96}
97
98#endif /* CONFIG_NUMA */
99
100#endif /* _LINUX_SLAB_DEF_H */
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
index 5b4ae2cc445c..3aa97aa4277f 100644
--- a/include/linux/smb_fs_sb.h
+++ b/include/linux/smb_fs_sb.h
@@ -55,7 +55,7 @@ struct smb_sb_info {
55 * generation is incremented. 55 * generation is incremented.
56 */ 56 */
57 unsigned int generation; 57 unsigned int generation;
58 pid_t conn_pid; 58 struct pid *conn_pid;
59 struct smb_conn_opt opt; 59 struct smb_conn_opt opt;
60 wait_queue_head_t conn_wq; 60 wait_queue_head_t conn_wq;
61 int conn_complete; 61 int conn_complete;
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 51649987f691..7ba23ec8211b 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -99,6 +99,13 @@ static inline int up_smp_call_function(void)
99static inline void smp_send_reschedule(int cpu) { } 99static inline void smp_send_reschedule(int cpu) { }
100#define num_booting_cpus() 1 100#define num_booting_cpus() 1
101#define smp_prepare_boot_cpu() do {} while (0) 101#define smp_prepare_boot_cpu() do {} while (0)
102static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
103 void *info, int retry, int wait)
104{
105 /* Disable interrupts here? */
106 func(info);
107 return 0;
108}
102 109
103#endif /* !SMP */ 110#endif /* !SMP */
104 111
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 361409094649..92cd38efad7f 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -264,6 +264,7 @@ struct ucred {
264#define SOL_IPV6 41 264#define SOL_IPV6 41
265#define SOL_ICMPV6 58 265#define SOL_ICMPV6 58
266#define SOL_SCTP 132 266#define SOL_SCTP 132
267#define SOL_UDPLITE 136 /* UDP-Lite (RFC 3828) */
267#define SOL_RAW 255 268#define SOL_RAW 255
268#define SOL_IPX 256 269#define SOL_IPX 256
269#define SOL_AX25 257 270#define SOL_AX25 257
@@ -292,7 +293,7 @@ extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov,
292extern int csum_partial_copy_fromiovecend(unsigned char *kdata, 293extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
293 struct iovec *iov, 294 struct iovec *iov,
294 int offset, 295 int offset,
295 unsigned int len, int *csump); 296 unsigned int len, __wsum *csump);
296 297
297extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); 298extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode);
298extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 299extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
diff --git a/include/linux/sockios.h b/include/linux/sockios.h
index e6b9d1d36ea2..abef7596655a 100644
--- a/include/linux/sockios.h
+++ b/include/linux/sockios.h
@@ -72,8 +72,8 @@
72#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ 72#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
73#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ 73#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
74 74
75#define SIOCGIFDIVERT 0x8944 /* Frame diversion support */ 75/* SIOCGIFDIVERT was: 0x8944 Frame diversion support */
76#define SIOCSIFDIVERT 0x8945 /* Set frame diversion options */ 76/* SIOCSIFDIVERT was: 0x8945 Set frame diversion options */
77 77
78#define SIOCETHTOOL 0x8946 /* Ethtool interface */ 78#define SIOCETHTOOL 0x8946 /* Ethtool interface */
79 79
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index c8bb68099eb9..176f6e36dbfa 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -289,7 +289,7 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
289 * the data being transferred; that may reduce overhead, when the 289 * the data being transferred; that may reduce overhead, when the
290 * underlying driver uses dma. 290 * underlying driver uses dma.
291 * 291 *
292 * If the transmit buffer is null, undefined data will be shifted out 292 * If the transmit buffer is null, zeroes will be shifted out
293 * while filling rx_buf. If the receive buffer is null, the data 293 * while filling rx_buf. If the receive buffer is null, the data
294 * shifted in will be discarded. Only "len" bytes shift out (or in). 294 * shifted in will be discarded. Only "len" bytes shift out (or in).
295 * It's an error to try to shift out a partial word. (For example, by 295 * It's an error to try to shift out a partial word. (For example, by
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 8451052ca66f..94b767d64275 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -52,6 +52,7 @@
52#include <linux/thread_info.h> 52#include <linux/thread_info.h>
53#include <linux/kernel.h> 53#include <linux/kernel.h>
54#include <linux/stringify.h> 54#include <linux/stringify.h>
55#include <linux/bottom_half.h>
55 56
56#include <asm/system.h> 57#include <asm/system.h>
57 58
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index 13a37f137ea2..4a0a329beafb 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -52,11 +52,11 @@
52 * protection - since "write" code only needs to change the head, and 52 * protection - since "write" code only needs to change the head, and
53 * interrupt code only needs to change the tail. 53 * interrupt code only needs to change the tail.
54 */ 54 */
55typedef struct { 55struct stlrq {
56 char *buf; 56 char *buf;
57 char *head; 57 char *head;
58 char *tail; 58 char *tail;
59} stlrq_t; 59};
60 60
61/* 61/*
62 * Port, panel and board structures to hold status info about each. 62 * Port, panel and board structures to hold status info about each.
@@ -67,14 +67,14 @@ typedef struct {
67 * is associated with, this makes it (fairly) easy to get back to the 67 * is associated with, this makes it (fairly) easy to get back to the
68 * board/panel info for a port. 68 * board/panel info for a port.
69 */ 69 */
70typedef struct stlport { 70struct stlport {
71 unsigned long magic; 71 unsigned long magic;
72 int portnr; 72 unsigned int portnr;
73 int panelnr; 73 unsigned int panelnr;
74 int brdnr; 74 unsigned int brdnr;
75 int ioaddr; 75 int ioaddr;
76 int uartaddr; 76 int uartaddr;
77 int pagenr; 77 unsigned int pagenr;
78 long istate; 78 long istate;
79 int flags; 79 int flags;
80 int baud_base; 80 int baud_base;
@@ -97,31 +97,31 @@ typedef struct stlport {
97 wait_queue_head_t close_wait; 97 wait_queue_head_t close_wait;
98 struct work_struct tqueue; 98 struct work_struct tqueue;
99 comstats_t stats; 99 comstats_t stats;
100 stlrq_t tx; 100 struct stlrq tx;
101} stlport_t; 101};
102 102
103typedef struct stlpanel { 103struct stlpanel {
104 unsigned long magic; 104 unsigned long magic;
105 int panelnr; 105 unsigned int panelnr;
106 int brdnr; 106 unsigned int brdnr;
107 int pagenr; 107 unsigned int pagenr;
108 int nrports; 108 unsigned int nrports;
109 int iobase; 109 int iobase;
110 void *uartp; 110 void *uartp;
111 void (*isr)(struct stlpanel *panelp, unsigned int iobase); 111 void (*isr)(struct stlpanel *panelp, unsigned int iobase);
112 unsigned int hwid; 112 unsigned int hwid;
113 unsigned int ackmask; 113 unsigned int ackmask;
114 stlport_t *ports[STL_PORTSPERPANEL]; 114 struct stlport *ports[STL_PORTSPERPANEL];
115} stlpanel_t; 115};
116 116
117typedef struct stlbrd { 117struct stlbrd {
118 unsigned long magic; 118 unsigned long magic;
119 int brdnr; 119 unsigned int brdnr;
120 int brdtype; 120 unsigned int brdtype;
121 int state; 121 unsigned int state;
122 int nrpanels; 122 unsigned int nrpanels;
123 int nrports; 123 unsigned int nrports;
124 int nrbnks; 124 unsigned int nrbnks;
125 int irq; 125 int irq;
126 int irqtype; 126 int irqtype;
127 int (*isr)(struct stlbrd *brdp); 127 int (*isr)(struct stlbrd *brdp);
@@ -136,9 +136,9 @@ typedef struct stlbrd {
136 unsigned long clk; 136 unsigned long clk;
137 unsigned int bnkpageaddr[STL_MAXBANKS]; 137 unsigned int bnkpageaddr[STL_MAXBANKS];
138 unsigned int bnkstataddr[STL_MAXBANKS]; 138 unsigned int bnkstataddr[STL_MAXBANKS];
139 stlpanel_t *bnk2panel[STL_MAXBANKS]; 139 struct stlpanel *bnk2panel[STL_MAXBANKS];
140 stlpanel_t *panels[STL_MAXPANELS]; 140 struct stlpanel *panels[STL_MAXPANELS];
141} stlbrd_t; 141};
142 142
143 143
144/* 144/*
diff --git a/include/linux/start_kernel.h b/include/linux/start_kernel.h
new file mode 100644
index 000000000000..d3e5f2756545
--- /dev/null
+++ b/include/linux/start_kernel.h
@@ -0,0 +1,12 @@
1#ifndef _LINUX_START_KERNEL_H
2#define _LINUX_START_KERNEL_H
3
4#include <linux/linkage.h>
5#include <linux/init.h>
6
7/* Define the prototype for start_kernel here, rather than cluttering
8 up something else. */
9
10extern asmlinkage void __init start_kernel(void);
11
12#endif /* _LINUX_START_KERNEL_H */
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index 97b62e97dd8d..2db2fbf34947 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -90,8 +90,6 @@ struct gss_cred {
90#define gc_flags gc_base.cr_flags 90#define gc_flags gc_base.cr_flags
91#define gc_expire gc_base.cr_expire 91#define gc_expire gc_base.cr_expire
92 92
93void print_hexl(u32 *p, u_int length, u_int offset);
94
95#endif /* __KERNEL__ */ 93#endif /* __KERNEL__ */
96#endif /* _LINUX_SUNRPC_AUTH_GSS_H */ 94#endif /* _LINUX_SUNRPC_AUTH_GSS_H */
97 95
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index f6d1d646ce05..a1be89deb3af 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -53,6 +53,7 @@ struct rpc_clnt {
53 struct dentry * cl_dentry; /* inode */ 53 struct dentry * cl_dentry; /* inode */
54 struct rpc_clnt * cl_parent; /* Points to parent of clones */ 54 struct rpc_clnt * cl_parent; /* Points to parent of clones */
55 struct rpc_rtt cl_rtt_default; 55 struct rpc_rtt cl_rtt_default;
56 struct rpc_program * cl_program;
56 char cl_inline_name[32]; 57 char cl_inline_name[32];
57}; 58};
58 59
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index e4729aa67654..60fce3c92857 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -62,12 +62,6 @@ extern unsigned int nlm_debug;
62# define RPC_IFDEBUG(x) 62# define RPC_IFDEBUG(x)
63#endif 63#endif
64 64
65#ifdef RPC_PROFILE
66# define pprintk(args...) printk(## args)
67#else
68# define pprintk(args...) do ; while (0)
69#endif
70
71/* 65/*
72 * Sysctl interface for RPC debugging 66 * Sysctl interface for RPC debugging
73 */ 67 */
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
index e30ba201910a..5a4b1e0206e3 100644
--- a/include/linux/sunrpc/gss_krb5.h
+++ b/include/linux/sunrpc/gss_krb5.h
@@ -42,10 +42,6 @@
42 42
43struct krb5_ctx { 43struct krb5_ctx {
44 int initiate; /* 1 = initiating, 0 = accepting */ 44 int initiate; /* 1 = initiating, 0 = accepting */
45 int seed_init;
46 unsigned char seed[16];
47 int signalg;
48 int sealalg;
49 struct crypto_blkcipher *enc; 45 struct crypto_blkcipher *enc;
50 struct crypto_blkcipher *seq; 46 struct crypto_blkcipher *seq;
51 s32 endtime; 47 s32 endtime;
@@ -117,7 +113,7 @@ enum seal_alg {
117#define ENCTYPE_UNKNOWN 0x01ff 113#define ENCTYPE_UNKNOWN 0x01ff
118 114
119s32 115s32
120make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, 116make_checksum(char *, char *header, int hdrlen, struct xdr_buf *body,
121 int body_offset, struct xdr_netobj *cksum); 117 int body_offset, struct xdr_netobj *cksum);
122 118
123u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, 119u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *,
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h
index 2cf3fbb40b4f..e3e6a3437f8b 100644
--- a/include/linux/sunrpc/gss_spkm3.h
+++ b/include/linux/sunrpc/gss_spkm3.h
@@ -12,27 +12,19 @@
12#include <linux/sunrpc/gss_asn1.h> 12#include <linux/sunrpc/gss_asn1.h>
13 13
14struct spkm3_ctx { 14struct spkm3_ctx {
15 struct xdr_netobj ctx_id; /* per message context id */ 15 struct xdr_netobj ctx_id; /* per message context id */
16 int qop; /* negotiated qop */ 16 int endtime; /* endtime of the context */
17 struct xdr_netobj mech_used; 17 struct xdr_netobj mech_used;
18 unsigned int ret_flags ; 18 unsigned int ret_flags ;
19 unsigned int req_flags ; 19 struct xdr_netobj conf_alg;
20 struct xdr_netobj share_key; 20 struct xdr_netobj derived_conf_key;
21 int conf_alg; 21 struct xdr_netobj intg_alg;
22 struct crypto_blkcipher *derived_conf_key; 22 struct xdr_netobj derived_integ_key;
23 int intg_alg;
24 struct crypto_blkcipher *derived_integ_key;
25 int keyestb_alg; /* alg used to get share_key */
26 int owf_alg; /* one way function */
27}; 23};
28 24
29/* from openssl/objects.h */ 25/* OIDs declarations for K-ALG, I-ALG, C-ALG, and OWF-ALG */
30/* XXX need SEAL_ALG_NONE */ 26extern const struct xdr_netobj hmac_md5_oid;
31#define NID_md5 4 27extern const struct xdr_netobj cast5_cbc_oid;
32#define NID_dhKeyAgreement 28
33#define NID_des_cbc 31
34#define NID_sha1 64
35#define NID_cast5_cbc 108
36 28
37/* SPKM InnerContext Token types */ 29/* SPKM InnerContext Token types */
38 30
@@ -46,11 +38,13 @@ u32 spkm3_make_token(struct spkm3_ctx *ctx, struct xdr_buf * text, struct xdr_ne
46u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int toktype); 38u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int toktype);
47 39
48#define CKSUMTYPE_RSA_MD5 0x0007 40#define CKSUMTYPE_RSA_MD5 0x0007
41#define CKSUMTYPE_HMAC_MD5 0x0008
49 42
50s32 make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, 43s32 make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header,
51 int body_offset, struct xdr_netobj *cksum); 44 unsigned int hdrlen, struct xdr_buf *body,
45 unsigned int body_offset, struct xdr_netobj *cksum);
52void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits); 46void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits);
53int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, 47int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen,
54 int explen); 48 int explen);
55void spkm3_mic_header(unsigned char **hdrbuf, unsigned int *hdrlen, 49void spkm3_mic_header(unsigned char **hdrbuf, unsigned int *hdrlen,
56 unsigned char *ctxhdr, int elen, int zbit); 50 unsigned char *ctxhdr, int elen, int zbit);
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index a2eb9b4a9de3..4a68125b6de6 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -30,7 +30,7 @@ struct rpc_inode {
30#define RPC_PIPE_WAIT_FOR_OPEN 1 30#define RPC_PIPE_WAIT_FOR_OPEN 1
31 int flags; 31 int flags;
32 struct rpc_pipe_ops *ops; 32 struct rpc_pipe_ops *ops;
33 struct work_struct queue_timeout; 33 struct delayed_work queue_timeout;
34}; 34};
35 35
36static inline struct rpc_inode * 36static inline struct rpc_inode *
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index f399c138f79d..97c761652581 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/timer.h> 12#include <linux/timer.h>
13#include <linux/sunrpc/types.h> 13#include <linux/sunrpc/types.h>
14#include <linux/rcupdate.h>
14#include <linux/spinlock.h> 15#include <linux/spinlock.h>
15#include <linux/wait.h> 16#include <linux/wait.h>
16#include <linux/workqueue.h> 17#include <linux/workqueue.h>
@@ -85,6 +86,7 @@ struct rpc_task {
85 union { 86 union {
86 struct work_struct tk_work; /* Async task work queue */ 87 struct work_struct tk_work; /* Async task work queue */
87 struct rpc_wait tk_wait; /* RPC wait */ 88 struct rpc_wait tk_wait; /* RPC wait */
89 struct rcu_head tk_rcu; /* for task deletion */
88 } u; 90 } u;
89 91
90 unsigned short tk_timeouts; /* maj timeouts */ 92 unsigned short tk_timeouts; /* maj timeouts */
@@ -178,13 +180,6 @@ struct rpc_call_ops {
178 } while (0) 180 } while (0)
179 181
180#define RPC_IS_ACTIVATED(t) (test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)) 182#define RPC_IS_ACTIVATED(t) (test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate))
181#define rpc_set_active(t) (set_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate))
182#define rpc_clear_active(t) \
183 do { \
184 smp_mb__before_clear_bit(); \
185 clear_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate); \
186 smp_mb__after_clear_bit(); \
187 } while(0)
188 183
189/* 184/*
190 * Task priorities. 185 * Task priorities.
@@ -222,7 +217,7 @@ struct rpc_wait_queue {
222 217
223#ifndef RPC_DEBUG 218#ifndef RPC_DEBUG
224# define RPC_WAITQ_INIT(var,qname) { \ 219# define RPC_WAITQ_INIT(var,qname) { \
225 .lock = SPIN_LOCK_UNLOCKED, \ 220 .lock = __SPIN_LOCK_UNLOCKED(var.lock), \
226 .tasks = { \ 221 .tasks = { \
227 [0] = LIST_HEAD_INIT(var.tasks[0]), \ 222 [0] = LIST_HEAD_INIT(var.tasks[0]), \
228 [1] = LIST_HEAD_INIT(var.tasks[1]), \ 223 [1] = LIST_HEAD_INIT(var.tasks[1]), \
@@ -231,7 +226,7 @@ struct rpc_wait_queue {
231 } 226 }
232#else 227#else
233# define RPC_WAITQ_INIT(var,qname) { \ 228# define RPC_WAITQ_INIT(var,qname) { \
234 .lock = SPIN_LOCK_UNLOCKED, \ 229 .lock = __SPIN_LOCK_UNLOCKED(var.lock), \
235 .tasks = { \ 230 .tasks = { \
236 [0] = LIST_HEAD_INIT(var.tasks[0]), \ 231 [0] = LIST_HEAD_INIT(var.tasks[0]), \
237 [1] = LIST_HEAD_INIT(var.tasks[1]), \ 232 [1] = LIST_HEAD_INIT(var.tasks[1]), \
@@ -254,8 +249,10 @@ struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags,
254void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, 249void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt,
255 int flags, const struct rpc_call_ops *ops, 250 int flags, const struct rpc_call_ops *ops,
256 void *data); 251 void *data);
252void rpc_put_task(struct rpc_task *);
257void rpc_release_task(struct rpc_task *); 253void rpc_release_task(struct rpc_task *);
258void rpc_exit_task(struct rpc_task *); 254void rpc_exit_task(struct rpc_task *);
255void rpc_release_calldata(const struct rpc_call_ops *, void *);
259void rpc_killall_tasks(struct rpc_clnt *); 256void rpc_killall_tasks(struct rpc_clnt *);
260int rpc_execute(struct rpc_task *); 257int rpc_execute(struct rpc_task *);
261void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); 258void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index ac69e5511606..9e340fa23c06 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <asm/byteorder.h> 13#include <asm/byteorder.h>
14#include <linux/scatterlist.h>
14 15
15/* 16/*
16 * Buffer adjustment 17 * Buffer adjustment
@@ -139,29 +140,30 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p)
139 */ 140 */
140extern void xdr_shift_buf(struct xdr_buf *, size_t); 141extern void xdr_shift_buf(struct xdr_buf *, size_t);
141extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); 142extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
142extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int); 143extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int);
143extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int); 144extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int);
144extern int read_bytes_from_xdr_buf(struct xdr_buf *, int, void *, int); 145extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
145extern int write_bytes_to_xdr_buf(struct xdr_buf *, int, void *, int); 146extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
146 147
147/* 148/*
148 * Helper structure for copying from an sk_buff. 149 * Helper structure for copying from an sk_buff.
149 */ 150 */
150typedef struct { 151struct xdr_skb_reader {
151 struct sk_buff *skb; 152 struct sk_buff *skb;
152 unsigned int offset; 153 unsigned int offset;
153 size_t count; 154 size_t count;
154 unsigned int csum; 155 __wsum csum;
155} skb_reader_t; 156};
156 157
157typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); 158typedef size_t (*xdr_skb_read_actor)(struct xdr_skb_reader *desc, void *to, size_t len);
158 159
160size_t xdr_skb_read_bits(struct xdr_skb_reader *desc, void *to, size_t len);
159extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *); 161extern int csum_partial_copy_to_xdr(struct xdr_buf *, struct sk_buff *);
160extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, 162extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int,
161 skb_reader_t *, skb_read_actor_t); 163 struct xdr_skb_reader *, xdr_skb_read_actor);
162 164
163extern int xdr_encode_word(struct xdr_buf *, int, u32); 165extern int xdr_encode_word(struct xdr_buf *, unsigned int, u32);
164extern int xdr_decode_word(struct xdr_buf *, int, u32 *); 166extern int xdr_decode_word(struct xdr_buf *, unsigned int, u32 *);
165 167
166struct xdr_array2_desc; 168struct xdr_array2_desc;
167typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *desc, void *elem); 169typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *desc, void *elem);
@@ -196,6 +198,7 @@ extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32
196extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); 198extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
197extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); 199extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
198extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); 200extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
201extern int xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, int (*actor)(struct scatterlist *, void *), void *data);
199 202
200#endif /* __KERNEL__ */ 203#endif /* __KERNEL__ */
201 204
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 60394fbc4c70..f780e72fc417 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -106,7 +106,6 @@ struct rpc_rqst {
106 106
107struct rpc_xprt_ops { 107struct rpc_xprt_ops {
108 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); 108 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
109 char * (*print_addr)(struct rpc_xprt *xprt, enum rpc_display_format_t format);
110 int (*reserve_xprt)(struct rpc_task *task); 109 int (*reserve_xprt)(struct rpc_task *task);
111 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 110 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
112 void (*rpcbind)(struct rpc_task *task); 111 void (*rpcbind)(struct rpc_task *task);
@@ -126,8 +125,6 @@ struct rpc_xprt_ops {
126struct rpc_xprt { 125struct rpc_xprt {
127 struct kref kref; /* Reference count */ 126 struct kref kref; /* Reference count */
128 struct rpc_xprt_ops * ops; /* transport methods */ 127 struct rpc_xprt_ops * ops; /* transport methods */
129 struct socket * sock; /* BSD socket layer */
130 struct sock * inet; /* INET layer */
131 128
132 struct rpc_timeout timeout; /* timeout parms */ 129 struct rpc_timeout timeout; /* timeout parms */
133 struct sockaddr_storage addr; /* server address */ 130 struct sockaddr_storage addr; /* server address */
@@ -137,9 +134,6 @@ struct rpc_xprt {
137 unsigned long cong; /* current congestion */ 134 unsigned long cong; /* current congestion */
138 unsigned long cwnd; /* congestion window */ 135 unsigned long cwnd; /* congestion window */
139 136
140 size_t rcvsize, /* transport rcv buffer size */
141 sndsize; /* transport send buffer size */
142
143 size_t max_payload; /* largest RPC payload size, 137 size_t max_payload; /* largest RPC payload size,
144 in bytes */ 138 in bytes */
145 unsigned int tsh_size; /* size of transport specific 139 unsigned int tsh_size; /* size of transport specific
@@ -158,27 +152,11 @@ struct rpc_xprt {
158 resvport : 1; /* use a reserved port */ 152 resvport : 1; /* use a reserved port */
159 153
160 /* 154 /*
161 * XID
162 */
163 __u32 xid; /* Next XID value to use */
164
165 /*
166 * State of TCP reply receive stuff
167 */
168 __be32 tcp_recm, /* Fragment header */
169 tcp_xid; /* Current XID */
170 u32 tcp_reclen, /* fragment length */
171 tcp_offset; /* fragment offset */
172 unsigned long tcp_copied, /* copied to request */
173 tcp_flags;
174 /*
175 * Connection of transports 155 * Connection of transports
176 */ 156 */
177 unsigned long connect_timeout, 157 unsigned long connect_timeout,
178 bind_timeout, 158 bind_timeout,
179 reestablish_timeout; 159 reestablish_timeout;
180 struct work_struct connect_worker;
181 unsigned short port;
182 160
183 /* 161 /*
184 * Disconnection of idle transports 162 * Disconnection of idle transports
@@ -193,8 +171,8 @@ struct rpc_xprt {
193 */ 171 */
194 spinlock_t transport_lock; /* lock transport info */ 172 spinlock_t transport_lock; /* lock transport info */
195 spinlock_t reserve_lock; /* lock slot table */ 173 spinlock_t reserve_lock; /* lock slot table */
174 u32 xid; /* Next XID value to use */
196 struct rpc_task * snd_task; /* Task blocked in send */ 175 struct rpc_task * snd_task; /* Task blocked in send */
197
198 struct list_head recv; 176 struct list_head recv;
199 177
200 struct { 178 struct {
@@ -210,18 +188,9 @@ struct rpc_xprt {
210 bklog_u; /* backlog queue utilization */ 188 bklog_u; /* backlog queue utilization */
211 } stat; 189 } stat;
212 190
213 void (*old_data_ready)(struct sock *, int);
214 void (*old_state_change)(struct sock *);
215 void (*old_write_space)(struct sock *);
216
217 char * address_strings[RPC_DISPLAY_MAX]; 191 char * address_strings[RPC_DISPLAY_MAX];
218}; 192};
219 193
220#define XPRT_LAST_FRAG (1 << 0)
221#define XPRT_COPY_RECM (1 << 1)
222#define XPRT_COPY_XID (1 << 2)
223#define XPRT_COPY_DATA (1 << 3)
224
225#ifdef __KERNEL__ 194#ifdef __KERNEL__
226 195
227/* 196/*
@@ -270,8 +239,8 @@ void xprt_disconnect(struct rpc_xprt *xprt);
270/* 239/*
271 * Socket transport setup operations 240 * Socket transport setup operations
272 */ 241 */
273int xs_setup_udp(struct rpc_xprt *xprt, struct rpc_timeout *to); 242struct rpc_xprt * xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to);
274int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to); 243struct rpc_xprt * xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to);
275 244
276/* 245/*
277 * Reserved bit positions in xprt->state 246 * Reserved bit positions in xprt->state
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index b1237f16ecde..bf99bd49f8ef 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -9,10 +9,13 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/pm.h> 10#include <linux/pm.h>
11 11
12/* page backup entry */ 12/* struct pbe is used for creating lists of pages that should be restored
13 * atomically during the resume from disk, because the page frames they have
14 * occupied before the suspend are in use.
15 */
13struct pbe { 16struct pbe {
14 unsigned long address; /* address of the copy */ 17 void *address; /* address of the copy */
15 unsigned long orig_address; /* original address of page */ 18 void *orig_address; /* original address of a page */
16 struct pbe *next; 19 struct pbe *next;
17}; 20};
18 21
diff --git a/include/linux/swap.h b/include/linux/swap.h
index e7c36ba2a2db..5423559a44a6 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -218,8 +218,6 @@ extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *);
218/* linux/mm/page_io.c */ 218/* linux/mm/page_io.c */
219extern int swap_readpage(struct file *, struct page *); 219extern int swap_readpage(struct file *, struct page *);
220extern int swap_writepage(struct page *page, struct writeback_control *wbc); 220extern int swap_writepage(struct page *page, struct writeback_control *wbc);
221extern int rw_swap_page_sync(int rw, swp_entry_t entry, struct page *page,
222 struct bio **bio_chain);
223extern int end_swap_bio_read(struct bio *bio, unsigned int bytes_done, int err); 221extern int end_swap_bio_read(struct bio *bio, unsigned int bytes_done, int err);
224 222
225/* linux/mm/swap_state.c */ 223/* linux/mm/swap_state.c */
@@ -247,9 +245,10 @@ extern int swap_duplicate(swp_entry_t);
247extern int valid_swaphandles(swp_entry_t, unsigned long *); 245extern int valid_swaphandles(swp_entry_t, unsigned long *);
248extern void swap_free(swp_entry_t); 246extern void swap_free(swp_entry_t);
249extern void free_swap_and_cache(swp_entry_t); 247extern void free_swap_and_cache(swp_entry_t);
250extern int swap_type_of(dev_t); 248extern int swap_type_of(dev_t, sector_t, struct block_device **);
251extern unsigned int count_swap_pages(int, int); 249extern unsigned int count_swap_pages(int, int);
252extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); 250extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t);
251extern sector_t swapdev_block(int, pgoff_t);
253extern struct swap_info_struct *get_swap_info_struct(unsigned); 252extern struct swap_info_struct *get_swap_info_struct(unsigned);
254extern int can_share_swap_page(struct page *); 253extern int can_share_swap_page(struct page *);
255extern int remove_exclusive_swap_page(struct page *); 254extern int remove_exclusive_swap_page(struct page *);
@@ -259,7 +258,6 @@ extern spinlock_t swap_lock;
259 258
260/* linux/mm/thrash.c */ 259/* linux/mm/thrash.c */
261extern struct mm_struct * swap_token_mm; 260extern struct mm_struct * swap_token_mm;
262extern unsigned long swap_token_default_timeout;
263extern void grab_swap_token(void); 261extern void grab_swap_token(void);
264extern void __put_swap_token(struct mm_struct *); 262extern void __put_swap_token(struct mm_struct *);
265 263
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index d98562f1df76..81480e613467 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -11,7 +11,7 @@
11 ** the sysctl() binary interface. Do *NOT* change the 11 ** the sysctl() binary interface. Do *NOT* change the
12 ** numbering of any existing values here, and do not change 12 ** numbering of any existing values here, and do not change
13 ** any numbers within any one set of values. If you have to 13 ** any numbers within any one set of values. If you have to
14 ** have to redefine an existing interface, use a new number for it. 14 ** redefine an existing interface, use a new number for it.
15 ** The kernel will then return -ENOTDIR to any application using 15 ** The kernel will then return -ENOTDIR to any application using
16 ** the old binary interface. 16 ** the old binary interface.
17 ** 17 **
@@ -426,6 +426,8 @@ enum
426 NET_CIPSOV4_CACHE_BUCKET_SIZE=119, 426 NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
427 NET_CIPSOV4_RBM_OPTFMT=120, 427 NET_CIPSOV4_RBM_OPTFMT=120,
428 NET_CIPSOV4_RBM_STRICTVALID=121, 428 NET_CIPSOV4_RBM_STRICTVALID=121,
429 NET_TCP_AVAIL_CONG_CONTROL=122,
430 NET_TCP_ALLOWED_CONG_CONTROL=123,
429}; 431};
430 432
431enum { 433enum {
@@ -604,16 +606,6 @@ enum {
604 NET_DCCP_DEFAULT=1, 606 NET_DCCP_DEFAULT=1,
605}; 607};
606 608
607/* /proc/sys/net/dccp/default */
608enum {
609 NET_DCCP_DEFAULT_SEQ_WINDOW = 1,
610 NET_DCCP_DEFAULT_RX_CCID = 2,
611 NET_DCCP_DEFAULT_TX_CCID = 3,
612 NET_DCCP_DEFAULT_ACK_RATIO = 4,
613 NET_DCCP_DEFAULT_SEND_ACKVEC = 5,
614 NET_DCCP_DEFAULT_SEND_NDP = 6,
615};
616
617/* /proc/sys/net/ipx */ 609/* /proc/sys/net/ipx */
618enum { 610enum {
619 NET_IPX_PPROP_BROADCASTING=1, 611 NET_IPX_PPROP_BROADCASTING=1,
@@ -926,8 +918,7 @@ typedef struct ctl_table ctl_table;
926 918
927typedef int ctl_handler (ctl_table *table, int __user *name, int nlen, 919typedef int ctl_handler (ctl_table *table, int __user *name, int nlen,
928 void __user *oldval, size_t __user *oldlenp, 920 void __user *oldval, size_t __user *oldlenp,
929 void __user *newval, size_t newlen, 921 void __user *newval, size_t newlen);
930 void **context);
931 922
932typedef int proc_handler (ctl_table *ctl, int write, struct file * filp, 923typedef int proc_handler (ctl_table *ctl, int write, struct file * filp,
933 void __user *buffer, size_t *lenp, loff_t *ppos); 924 void __user *buffer, size_t *lenp, loff_t *ppos);
@@ -958,7 +949,7 @@ extern int do_sysctl (int __user *name, int nlen,
958extern int do_sysctl_strategy (ctl_table *table, 949extern int do_sysctl_strategy (ctl_table *table,
959 int __user *name, int nlen, 950 int __user *name, int nlen,
960 void __user *oldval, size_t __user *oldlenp, 951 void __user *oldval, size_t __user *oldlenp,
961 void __user *newval, size_t newlen, void ** context); 952 void __user *newval, size_t newlen);
962 953
963extern ctl_handler sysctl_string; 954extern ctl_handler sysctl_string;
964extern ctl_handler sysctl_intvec; 955extern ctl_handler sysctl_intvec;
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 6d5c43d31dec..2129d1b6c874 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -97,6 +97,9 @@ extern int __must_check
97sysfs_rename_dir(struct kobject *, const char *new_name); 97sysfs_rename_dir(struct kobject *, const char *new_name);
98 98
99extern int __must_check 99extern int __must_check
100sysfs_move_dir(struct kobject *, struct kobject *);
101
102extern int __must_check
100sysfs_create_file(struct kobject *, const struct attribute *); 103sysfs_create_file(struct kobject *, const struct attribute *);
101 104
102extern int __must_check 105extern int __must_check
@@ -142,6 +145,11 @@ static inline int sysfs_rename_dir(struct kobject * k, const char *new_name)
142 return 0; 145 return 0;
143} 146}
144 147
148static inline int sysfs_move_dir(struct kobject * k, struct kobject * new_parent)
149{
150 return 0;
151}
152
145static inline int sysfs_create_file(struct kobject * k, const struct attribute * a) 153static inline int sysfs_create_file(struct kobject * k, const struct attribute * a)
146{ 154{
147 return 0; 155 return 0;
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h
index 9df8833670cb..98a1d8cfb73d 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -37,23 +37,37 @@ struct sysrq_key_op {
37 37
38#ifdef CONFIG_MAGIC_SYSRQ 38#ifdef CONFIG_MAGIC_SYSRQ
39 39
40extern int sysrq_on(void);
41
42/*
43 * Do not use this one directly:
44 */
45extern int __sysrq_enabled;
46
40/* Generic SysRq interface -- you may call it from any device driver, supplying 47/* Generic SysRq interface -- you may call it from any device driver, supplying
41 * ASCII code of the key, pointer to registers and kbd/tty structs (if they 48 * ASCII code of the key, pointer to registers and kbd/tty structs (if they
42 * are available -- else NULL's). 49 * are available -- else NULL's).
43 */ 50 */
44 51
45void handle_sysrq(int, struct tty_struct *); 52void handle_sysrq(int key, struct tty_struct *tty);
46void __handle_sysrq(int, struct tty_struct *, int check_mask); 53void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
47int register_sysrq_key(int, struct sysrq_key_op *); 54int register_sysrq_key(int key, struct sysrq_key_op *op);
48int unregister_sysrq_key(int, struct sysrq_key_op *); 55int unregister_sysrq_key(int key, struct sysrq_key_op *op);
49struct sysrq_key_op *__sysrq_get_key_op(int key); 56struct sysrq_key_op *__sysrq_get_key_op(int key);
50 57
51#else 58#else
52 59
60static inline int sysrq_on(void)
61{
62 return 0;
63}
53static inline int __reterr(void) 64static inline int __reterr(void)
54{ 65{
55 return -EINVAL; 66 return -EINVAL;
56} 67}
68static inline void handle_sysrq(int key, struct tty_struct *tty)
69{
70}
57 71
58#define register_sysrq_key(ig,nore) __reterr() 72#define register_sysrq_key(ig,nore) __reterr()
59#define unregister_sysrq_key(ig,nore) __reterr() 73#define unregister_sysrq_key(ig,nore) __reterr()
diff --git a/include/linux/task_io_accounting.h b/include/linux/task_io_accounting.h
new file mode 100644
index 000000000000..44d00e9cceea
--- /dev/null
+++ b/include/linux/task_io_accounting.h
@@ -0,0 +1,37 @@
1/*
2 * task_io_accounting: a structure which is used for recording a single task's
3 * IO statistics.
4 *
5 * Don't include this header file directly - it is designed to be dragged in via
6 * sched.h.
7 *
8 * Blame akpm@osdl.org for all this.
9 */
10
11#ifdef CONFIG_TASK_IO_ACCOUNTING
12struct task_io_accounting {
13 /*
14 * The number of bytes which this task has caused to be read from
15 * storage.
16 */
17 u64 read_bytes;
18
19 /*
20 * The number of bytes which this task has caused, or shall cause to be
21 * written to disk.
22 */
23 u64 write_bytes;
24
25 /*
26 * A task can cause "negative" IO too. If this task truncates some
27 * dirty pagecache, some IO which another task has been accounted for
28 * (in its write_bytes) will not be happening. We _could_ just
29 * subtract that from the truncating task's write_bytes, but there is
30 * information loss in doing that.
31 */
32 u64 cancelled_write_bytes;
33};
34#else
35struct task_io_accounting {
36};
37#endif
diff --git a/include/linux/task_io_accounting_ops.h b/include/linux/task_io_accounting_ops.h
new file mode 100644
index 000000000000..df2a319106b2
--- /dev/null
+++ b/include/linux/task_io_accounting_ops.h
@@ -0,0 +1,47 @@
1/*
2 * Task I/O accounting operations
3 */
4#ifndef __TASK_IO_ACCOUNTING_OPS_INCLUDED
5#define __TASK_IO_ACCOUNTING_OPS_INCLUDED
6
7#ifdef CONFIG_TASK_IO_ACCOUNTING
8static inline void task_io_account_read(size_t bytes)
9{
10 current->ioac.read_bytes += bytes;
11}
12
13static inline void task_io_account_write(size_t bytes)
14{
15 current->ioac.write_bytes += bytes;
16}
17
18static inline void task_io_account_cancelled_write(size_t bytes)
19{
20 current->ioac.cancelled_write_bytes += bytes;
21}
22
23static inline void task_io_accounting_init(struct task_struct *tsk)
24{
25 memset(&tsk->ioac, 0, sizeof(tsk->ioac));
26}
27
28#else
29
30static inline void task_io_account_read(size_t bytes)
31{
32}
33
34static inline void task_io_account_write(size_t bytes)
35{
36}
37
38static inline void task_io_account_cancelled_write(size_t bytes)
39{
40}
41
42static inline void task_io_accounting_init(struct task_struct *tsk)
43{
44}
45
46#endif /* CONFIG_TASK_IO_ACCOUNTING */
47#endif /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index 45248806ae9c..3fced4798255 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33 33
34#define TASKSTATS_VERSION 2 34#define TASKSTATS_VERSION 3
35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN 35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
36 * in linux/sched.h */ 36 * in linux/sched.h */
37 37
@@ -115,31 +115,37 @@ struct taskstats {
115 __u64 ac_majflt; /* Major Page Fault Count */ 115 __u64 ac_majflt; /* Major Page Fault Count */
116 /* Basic Accounting Fields end */ 116 /* Basic Accounting Fields end */
117 117
118 /* Extended accounting fields start */ 118 /* Extended accounting fields start */
119 /* Accumulated RSS usage in duration of a task, in MBytes-usecs. 119 /* Accumulated RSS usage in duration of a task, in MBytes-usecs.
120 * The current rss usage is added to this counter every time 120 * The current rss usage is added to this counter every time
121 * a tick is charged to a task's system time. So, at the end we 121 * a tick is charged to a task's system time. So, at the end we
122 * will have memory usage multiplied by system time. Thus an 122 * will have memory usage multiplied by system time. Thus an
123 * average usage per system time unit can be calculated. 123 * average usage per system time unit can be calculated.
124 */ 124 */
125 __u64 coremem; /* accumulated RSS usage in MB-usec */ 125 __u64 coremem; /* accumulated RSS usage in MB-usec */
126 /* Accumulated virtual memory usage in duration of a task. 126 /* Accumulated virtual memory usage in duration of a task.
127 * Same as acct_rss_mem1 above except that we keep track of VM usage. 127 * Same as acct_rss_mem1 above except that we keep track of VM usage.
128 */ 128 */
129 __u64 virtmem; /* accumulated VM usage in MB-usec */ 129 __u64 virtmem; /* accumulated VM usage in MB-usec */
130 130
131 /* High watermark of RSS and virtual memory usage in duration of 131 /* High watermark of RSS and virtual memory usage in duration of
132 * a task, in KBytes. 132 * a task, in KBytes.
133 */ 133 */
134 __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */ 134 __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */
135 __u64 hiwater_vm; /* High-water VM usage, in KB */ 135 __u64 hiwater_vm; /* High-water VM usage, in KB */
136 136
137 /* The following four fields are I/O statistics of a task. */ 137 /* The following four fields are I/O statistics of a task. */
138 __u64 read_char; /* bytes read */ 138 __u64 read_char; /* bytes read */
139 __u64 write_char; /* bytes written */ 139 __u64 write_char; /* bytes written */
140 __u64 read_syscalls; /* read syscalls */ 140 __u64 read_syscalls; /* read syscalls */
141 __u64 write_syscalls; /* write syscalls */ 141 __u64 write_syscalls; /* write syscalls */
142 /* Extended accounting fields end */ 142 /* Extended accounting fields end */
143
144#define TASKSTATS_HAS_IO_ACCOUNTING
145 /* Per-task storage I/O accounting starts */
146 __u64 read_bytes; /* bytes of read I/O */
147 __u64 write_bytes; /* bytes of write I/O */
148 __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */
143}; 149};
144 150
145 151
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h
index 6562a2050a25..7e9680f4afdd 100644
--- a/include/linux/taskstats_kern.h
+++ b/include/linux/taskstats_kern.h
@@ -12,64 +12,27 @@
12#include <net/genetlink.h> 12#include <net/genetlink.h>
13 13
14#ifdef CONFIG_TASKSTATS 14#ifdef CONFIG_TASKSTATS
15extern kmem_cache_t *taskstats_cache; 15extern struct kmem_cache *taskstats_cache;
16extern struct mutex taskstats_exit_mutex; 16extern struct mutex taskstats_exit_mutex;
17 17
18static inline void taskstats_exit_free(struct taskstats *tidstats)
19{
20 if (tidstats)
21 kmem_cache_free(taskstats_cache, tidstats);
22}
23
24static inline void taskstats_tgid_init(struct signal_struct *sig) 18static inline void taskstats_tgid_init(struct signal_struct *sig)
25{ 19{
26 sig->stats = NULL; 20 sig->stats = NULL;
27} 21}
28 22
29static inline void taskstats_tgid_alloc(struct task_struct *tsk)
30{
31 struct signal_struct *sig = tsk->signal;
32 struct taskstats *stats;
33
34 if (sig->stats != NULL)
35 return;
36
37 /* No problem if kmem_cache_zalloc() fails */
38 stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
39
40 spin_lock_irq(&tsk->sighand->siglock);
41 if (!sig->stats) {
42 sig->stats = stats;
43 stats = NULL;
44 }
45 spin_unlock_irq(&tsk->sighand->siglock);
46
47 if (stats)
48 kmem_cache_free(taskstats_cache, stats);
49}
50
51static inline void taskstats_tgid_free(struct signal_struct *sig) 23static inline void taskstats_tgid_free(struct signal_struct *sig)
52{ 24{
53 if (sig->stats) 25 if (sig->stats)
54 kmem_cache_free(taskstats_cache, sig->stats); 26 kmem_cache_free(taskstats_cache, sig->stats);
55} 27}
56 28
57extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); 29extern void taskstats_exit(struct task_struct *, int group_dead);
58extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int);
59extern void taskstats_init_early(void); 30extern void taskstats_init_early(void);
60#else 31#else
61static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) 32static inline void taskstats_exit(struct task_struct *tsk, int group_dead)
62{}
63static inline void taskstats_exit_free(struct taskstats *ptidstats)
64{}
65static inline void taskstats_exit_send(struct task_struct *tsk,
66 struct taskstats *tidstats,
67 int group_dead, unsigned int cpu)
68{} 33{}
69static inline void taskstats_tgid_init(struct signal_struct *sig) 34static inline void taskstats_tgid_init(struct signal_struct *sig)
70{} 35{}
71static inline void taskstats_tgid_alloc(struct task_struct *tsk)
72{}
73static inline void taskstats_tgid_free(struct signal_struct *sig) 36static inline void taskstats_tgid_free(struct signal_struct *sig)
74{} 37{}
75static inline void taskstats_init_early(void) 38static inline void taskstats_init_early(void)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 2d36f6db3706..3cc70d1a3504 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -19,6 +19,7 @@
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <asm/byteorder.h> 21#include <asm/byteorder.h>
22#include <linux/socket.h>
22 23
23struct tcphdr { 24struct tcphdr {
24 __be16 source; 25 __be16 source;
@@ -51,7 +52,7 @@ struct tcphdr {
51#error "Adjust your <asm/byteorder.h> defines" 52#error "Adjust your <asm/byteorder.h> defines"
52#endif 53#endif
53 __be16 window; 54 __be16 window;
54 __be16 check; 55 __sum16 check;
55 __be16 urg_ptr; 56 __be16 urg_ptr;
56}; 57};
57 58
@@ -94,6 +95,7 @@ enum {
94#define TCP_INFO 11 /* Information about this connection. */ 95#define TCP_INFO 11 /* Information about this connection. */
95#define TCP_QUICKACK 12 /* Block/reenable quick acks */ 96#define TCP_QUICKACK 12 /* Block/reenable quick acks */
96#define TCP_CONGESTION 13 /* Congestion control algorithm */ 97#define TCP_CONGESTION 13 /* Congestion control algorithm */
98#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
97 99
98#define TCPI_OPT_TIMESTAMPS 1 100#define TCPI_OPT_TIMESTAMPS 1
99#define TCPI_OPT_SACK 2 101#define TCPI_OPT_SACK 2
@@ -157,6 +159,17 @@ struct tcp_info
157 __u32 tcpi_total_retrans; 159 __u32 tcpi_total_retrans;
158}; 160};
159 161
162/* for TCP_MD5SIG socket option */
163#define TCP_MD5SIG_MAXKEYLEN 80
164
165struct tcp_md5sig {
166 struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
167 __u16 __tcpm_pad1; /* zero */
168 __u16 tcpm_keylen; /* key length */
169 __u32 __tcpm_pad2; /* zero */
170 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
171};
172
160#ifdef __KERNEL__ 173#ifdef __KERNEL__
161 174
162#include <linux/skbuff.h> 175#include <linux/skbuff.h>
@@ -172,17 +185,17 @@ struct tcp_sack_block_wire {
172}; 185};
173 186
174struct tcp_sack_block { 187struct tcp_sack_block {
175 __u32 start_seq; 188 u32 start_seq;
176 __u32 end_seq; 189 u32 end_seq;
177}; 190};
178 191
179struct tcp_options_received { 192struct tcp_options_received {
180/* PAWS/RTTM data */ 193/* PAWS/RTTM data */
181 long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ 194 long ts_recent_stamp;/* Time we stored ts_recent (for aging) */
182 __u32 ts_recent; /* Time stamp to echo next */ 195 u32 ts_recent; /* Time stamp to echo next */
183 __u32 rcv_tsval; /* Time stamp value */ 196 u32 rcv_tsval; /* Time stamp value */
184 __u32 rcv_tsecr; /* Time stamp echo reply */ 197 u32 rcv_tsecr; /* Time stamp echo reply */
185 __u16 saw_tstamp : 1, /* Saw TIMESTAMP on last packet */ 198 u16 saw_tstamp : 1, /* Saw TIMESTAMP on last packet */
186 tstamp_ok : 1, /* TIMESTAMP seen on SYN packet */ 199 tstamp_ok : 1, /* TIMESTAMP seen on SYN packet */
187 dsack : 1, /* D-SACK is scheduled */ 200 dsack : 1, /* D-SACK is scheduled */
188 wscale_ok : 1, /* Wscale seen on SYN packet */ 201 wscale_ok : 1, /* Wscale seen on SYN packet */
@@ -190,16 +203,20 @@ struct tcp_options_received {
190 snd_wscale : 4, /* Window scaling received from sender */ 203 snd_wscale : 4, /* Window scaling received from sender */
191 rcv_wscale : 4; /* Window scaling to send to receiver */ 204 rcv_wscale : 4; /* Window scaling to send to receiver */
192/* SACKs data */ 205/* SACKs data */
193 __u8 eff_sacks; /* Size of SACK array to send with next packet */ 206 u8 eff_sacks; /* Size of SACK array to send with next packet */
194 __u8 num_sacks; /* Number of SACK blocks */ 207 u8 num_sacks; /* Number of SACK blocks */
195 __u16 user_mss; /* mss requested by user in ioctl */ 208 u16 user_mss; /* mss requested by user in ioctl */
196 __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ 209 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
197}; 210};
198 211
199struct tcp_request_sock { 212struct tcp_request_sock {
200 struct inet_request_sock req; 213 struct inet_request_sock req;
201 __u32 rcv_isn; 214#ifdef CONFIG_TCP_MD5SIG
202 __u32 snt_isn; 215 /* Only used by TCP MD5 Signature so far. */
216 struct tcp_request_sock_ops *af_specific;
217#endif
218 u32 rcv_isn;
219 u32 snt_isn;
203}; 220};
204 221
205static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) 222static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
@@ -210,7 +227,8 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
210struct tcp_sock { 227struct tcp_sock {
211 /* inet_connection_sock has to be the first member of tcp_sock */ 228 /* inet_connection_sock has to be the first member of tcp_sock */
212 struct inet_connection_sock inet_conn; 229 struct inet_connection_sock inet_conn;
213 int tcp_header_len; /* Bytes of tcp header to send */ 230 u16 tcp_header_len; /* Bytes of tcp header to send */
231 u16 xmit_size_goal; /* Goal for segmenting output packets */
214 232
215/* 233/*
216 * Header prediction flags 234 * Header prediction flags
@@ -223,13 +241,13 @@ struct tcp_sock {
223 * read the code and the spec side by side (and laugh ...) 241 * read the code and the spec side by side (and laugh ...)
224 * See RFC793 and RFC1122. The RFC writes these in capitals. 242 * See RFC793 and RFC1122. The RFC writes these in capitals.
225 */ 243 */
226 __u32 rcv_nxt; /* What we want to receive next */ 244 u32 rcv_nxt; /* What we want to receive next */
227 __u32 snd_nxt; /* Next sequence we send */ 245 u32 snd_nxt; /* Next sequence we send */
228 246
229 __u32 snd_una; /* First byte we want an ack for */ 247 u32 snd_una; /* First byte we want an ack for */
230 __u32 snd_sml; /* Last byte of the most recently transmitted small packet */ 248 u32 snd_sml; /* Last byte of the most recently transmitted small packet */
231 __u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ 249 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
232 __u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ 250 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */
233 251
234 /* Data for direct copy to user */ 252 /* Data for direct copy to user */
235 struct { 253 struct {
@@ -247,32 +265,30 @@ struct tcp_sock {
247#endif 265#endif
248 } ucopy; 266 } ucopy;
249 267
250 __u32 snd_wl1; /* Sequence for window update */ 268 u32 snd_wl1; /* Sequence for window update */
251 __u32 snd_wnd; /* The window we expect to receive */ 269 u32 snd_wnd; /* The window we expect to receive */
252 __u32 max_window; /* Maximal window ever seen from peer */ 270 u32 max_window; /* Maximal window ever seen from peer */
253 __u32 mss_cache; /* Cached effective mss, not including SACKS */ 271 u32 mss_cache; /* Cached effective mss, not including SACKS */
254 __u16 xmit_size_goal; /* Goal for segmenting output packets */
255 /* XXX Two bytes hole, try to pack */
256 272
257 __u32 window_clamp; /* Maximal window to advertise */ 273 u32 window_clamp; /* Maximal window to advertise */
258 __u32 rcv_ssthresh; /* Current window clamp */ 274 u32 rcv_ssthresh; /* Current window clamp */
259 275
260 __u32 frto_highmark; /* snd_nxt when RTO occurred */ 276 u32 frto_highmark; /* snd_nxt when RTO occurred */
261 __u8 reordering; /* Packet reordering metric. */ 277 u8 reordering; /* Packet reordering metric. */
262 __u8 frto_counter; /* Number of new acks after RTO */ 278 u8 frto_counter; /* Number of new acks after RTO */
263 __u8 nonagle; /* Disable Nagle algorithm? */ 279 u8 nonagle; /* Disable Nagle algorithm? */
264 __u8 keepalive_probes; /* num of allowed keep alive probes */ 280 u8 keepalive_probes; /* num of allowed keep alive probes */
265 281
266/* RTT measurement */ 282/* RTT measurement */
267 __u32 srtt; /* smoothed round trip time << 3 */ 283 u32 srtt; /* smoothed round trip time << 3 */
268 __u32 mdev; /* medium deviation */ 284 u32 mdev; /* medium deviation */
269 __u32 mdev_max; /* maximal mdev for the last rtt period */ 285 u32 mdev_max; /* maximal mdev for the last rtt period */
270 __u32 rttvar; /* smoothed mdev_max */ 286 u32 rttvar; /* smoothed mdev_max */
271 __u32 rtt_seq; /* sequence number to update rttvar */ 287 u32 rtt_seq; /* sequence number to update rttvar */
272 288
273 __u32 packets_out; /* Packets which are "in flight" */ 289 u32 packets_out; /* Packets which are "in flight" */
274 __u32 left_out; /* Packets which leaved network */ 290 u32 left_out; /* Packets which leaved network */
275 __u32 retrans_out; /* Retransmitted packets out */ 291 u32 retrans_out; /* Retransmitted packets out */
276/* 292/*
277 * Options received (usually on last packet, some only on SYN packets). 293 * Options received (usually on last packet, some only on SYN packets).
278 */ 294 */
@@ -281,20 +297,20 @@ struct tcp_sock {
281/* 297/*
282 * Slow start and congestion control (see also Nagle, and Karn & Partridge) 298 * Slow start and congestion control (see also Nagle, and Karn & Partridge)
283 */ 299 */
284 __u32 snd_ssthresh; /* Slow start size threshold */ 300 u32 snd_ssthresh; /* Slow start size threshold */
285 __u32 snd_cwnd; /* Sending congestion window */ 301 u32 snd_cwnd; /* Sending congestion window */
286 __u16 snd_cwnd_cnt; /* Linear increase counter */ 302 u16 snd_cwnd_cnt; /* Linear increase counter */
287 __u16 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ 303 u16 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
288 __u32 snd_cwnd_used; 304 u32 snd_cwnd_used;
289 __u32 snd_cwnd_stamp; 305 u32 snd_cwnd_stamp;
290 306
291 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ 307 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
292 308
293 __u32 rcv_wnd; /* Current receiver window */ 309 u32 rcv_wnd; /* Current receiver window */
294 __u32 rcv_wup; /* rcv_nxt on last window update sent */ 310 u32 rcv_wup; /* rcv_nxt on last window update sent */
295 __u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 311 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
296 __u32 pushed_seq; /* Last pushed seq, required to talk to windows */ 312 u32 pushed_seq; /* Last pushed seq, required to talk to windows */
297 __u32 copied_seq; /* Head of yet unread data */ 313 u32 copied_seq; /* Head of yet unread data */
298 314
299/* SACKs data */ 315/* SACKs data */
300 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 316 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
@@ -315,26 +331,26 @@ struct tcp_sock {
315 int retransmit_cnt_hint; 331 int retransmit_cnt_hint;
316 int forward_cnt_hint; 332 int forward_cnt_hint;
317 333
318 __u16 advmss; /* Advertised MSS */ 334 u16 advmss; /* Advertised MSS */
319 __u16 prior_ssthresh; /* ssthresh saved at recovery start */ 335 u16 prior_ssthresh; /* ssthresh saved at recovery start */
320 __u32 lost_out; /* Lost packets */ 336 u32 lost_out; /* Lost packets */
321 __u32 sacked_out; /* SACK'd packets */ 337 u32 sacked_out; /* SACK'd packets */
322 __u32 fackets_out; /* FACK'd packets */ 338 u32 fackets_out; /* FACK'd packets */
323 __u32 high_seq; /* snd_nxt at onset of congestion */ 339 u32 high_seq; /* snd_nxt at onset of congestion */
324 340
325 __u32 retrans_stamp; /* Timestamp of the last retransmit, 341 u32 retrans_stamp; /* Timestamp of the last retransmit,
326 * also used in SYN-SENT to remember stamp of 342 * also used in SYN-SENT to remember stamp of
327 * the first SYN. */ 343 * the first SYN. */
328 __u32 undo_marker; /* tracking retrans started here. */ 344 u32 undo_marker; /* tracking retrans started here. */
329 int undo_retrans; /* number of undoable retransmissions. */ 345 int undo_retrans; /* number of undoable retransmissions. */
330 __u32 urg_seq; /* Seq of received urgent pointer */ 346 u32 urg_seq; /* Seq of received urgent pointer */
331 __u16 urg_data; /* Saved octet of OOB data and control flags */ 347 u16 urg_data; /* Saved octet of OOB data and control flags */
332 __u8 urg_mode; /* In urgent mode */ 348 u8 urg_mode; /* In urgent mode */
333 __u8 ecn_flags; /* ECN status bits. */ 349 u8 ecn_flags; /* ECN status bits. */
334 __u32 snd_up; /* Urgent pointer */ 350 u32 snd_up; /* Urgent pointer */
335 351
336 __u32 total_retrans; /* Total retransmits for entire connection */ 352 u32 total_retrans; /* Total retransmits for entire connection */
337 __u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */ 353 u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */
338 354
339 unsigned int keepalive_time; /* time before keep alive takes place */ 355 unsigned int keepalive_time; /* time before keep alive takes place */
340 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 356 unsigned int keepalive_intvl; /* time interval between keep alive probes */
@@ -342,27 +358,35 @@ struct tcp_sock {
342 358
343 unsigned long last_synq_overflow; 359 unsigned long last_synq_overflow;
344 360
345 __u32 tso_deferred; 361 u32 tso_deferred;
346 362
347/* Receiver side RTT estimation */ 363/* Receiver side RTT estimation */
348 struct { 364 struct {
349 __u32 rtt; 365 u32 rtt;
350 __u32 seq; 366 u32 seq;
351 __u32 time; 367 u32 time;
352 } rcv_rtt_est; 368 } rcv_rtt_est;
353 369
354/* Receiver queue space */ 370/* Receiver queue space */
355 struct { 371 struct {
356 int space; 372 int space;
357 __u32 seq; 373 u32 seq;
358 __u32 time; 374 u32 time;
359 } rcvq_space; 375 } rcvq_space;
360 376
361/* TCP-specific MTU probe information. */ 377/* TCP-specific MTU probe information. */
362 struct { 378 struct {
363 __u32 probe_seq_start; 379 u32 probe_seq_start;
364 __u32 probe_seq_end; 380 u32 probe_seq_end;
365 } mtu_probe; 381 } mtu_probe;
382
383#ifdef CONFIG_TCP_MD5SIG
384/* TCP AF-Specific parts; only used by MD5 Signature support so far */
385 struct tcp_sock_af_ops *af_specific;
386
387/* TCP MD5 Signagure Option information */
388 struct tcp_md5sig_info *md5sig_info;
389#endif
366}; 390};
367 391
368static inline struct tcp_sock *tcp_sk(const struct sock *sk) 392static inline struct tcp_sock *tcp_sk(const struct sock *sk)
@@ -372,11 +396,15 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk)
372 396
373struct tcp_timewait_sock { 397struct tcp_timewait_sock {
374 struct inet_timewait_sock tw_sk; 398 struct inet_timewait_sock tw_sk;
375 __u32 tw_rcv_nxt; 399 u32 tw_rcv_nxt;
376 __u32 tw_snd_nxt; 400 u32 tw_snd_nxt;
377 __u32 tw_rcv_wnd; 401 u32 tw_rcv_wnd;
378 __u32 tw_ts_recent; 402 u32 tw_ts_recent;
379 long tw_ts_recent_stamp; 403 long tw_ts_recent_stamp;
404#ifdef CONFIG_TCP_MD5SIG
405 u16 tw_md5_keylen;
406 u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN];
407#endif
380}; 408};
381 409
382static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) 410static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index 7dac8f04d28e..004808a6df1d 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -20,7 +20,7 @@ struct ts_config;
20/** 20/**
21 * struct ts_state - search state 21 * struct ts_state - search state
22 * @offset: offset for next match 22 * @offset: offset for next match
23 * @cb: control buffer, for persistant variables of get_next_block() 23 * @cb: control buffer, for persistent variables of get_next_block()
24 */ 24 */
25struct ts_state 25struct ts_state
26{ 26{
@@ -71,7 +71,7 @@ struct ts_config
71 * Called repeatedly until 0 is returned. Must assign the 71 * Called repeatedly until 0 is returned. Must assign the
72 * head of the next block of data to &*dst and return the length 72 * head of the next block of data to &*dst and return the length
73 * of the block or 0 if at the end. consumed == 0 indicates 73 * of the block or 0 if at the end. consumed == 0 indicates
74 * a new search. May store/read persistant values in state->cb. 74 * a new search. May store/read persistent values in state->cb.
75 */ 75 */
76 unsigned int (*get_next_block)(unsigned int consumed, 76 unsigned int (*get_next_block)(unsigned int consumed,
77 const u8 **dst, 77 const u8 **dst,
diff --git a/include/linux/tfrc.h b/include/linux/tfrc.h
index 7dab7831c3cb..8a8462b4a4dd 100644
--- a/include/linux/tfrc.h
+++ b/include/linux/tfrc.h
@@ -1,7 +1,8 @@
1#ifndef _LINUX_TFRC_H_ 1#ifndef _LINUX_TFRC_H_
2#define _LINUX_TFRC_H_ 2#define _LINUX_TFRC_H_
3/* 3/*
4 * include/linux/tfrc.h 4 * TFRC - Data Structures for the TCP-Friendly Rate Control congestion
5 * control mechanism as specified in RFC 3448.
5 * 6 *
6 * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. 7 * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand.
7 * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz> 8 * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz>
@@ -13,18 +14,37 @@
13 * the Free Software Foundation; either version 2 of the License, or 14 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version. 15 * (at your option) any later version.
15 */ 16 */
16
17#include <linux/types.h> 17#include <linux/types.h>
18 18
19/** tfrc_rx_info - TFRC Receiver Data Structure
20 *
21 * @tfrcrx_x_recv: receiver estimate of sending rate (3.2.2)
22 * @tfrcrx_rtt: round-trip-time (communicated by sender)
23 * @tfrcrx_p: current estimate of loss event rate (3.2.2)
24 */
19struct tfrc_rx_info { 25struct tfrc_rx_info {
20 __u32 tfrcrx_x_recv; 26 __u32 tfrcrx_x_recv;
21 __u32 tfrcrx_rtt; 27 __u32 tfrcrx_rtt;
22 __u32 tfrcrx_p; 28 __u32 tfrcrx_p;
23}; 29};
24 30
31/** tfrc_tx_info - TFRC Sender Data Structure
32 *
33 * @tfrctx_x: computed transmit rate (4.3 (4))
34 * @tfrctx_x_recv: receiver estimate of send rate (4.3)
35 * @tfrctx_x_calc: return value of throughput equation (3.1)
36 * @tfrctx_rtt: (moving average) estimate of RTT (4.3)
37 * @tfrctx_p: current loss event rate (5.4)
38 * @tfrctx_rto: estimate of RTO, equals 4*RTT (4.3)
39 * @tfrctx_ipi: inter-packet interval (4.6)
40 *
41 * Note: X and X_recv are both maintained in units of 64 * bytes/second. This
42 * enables a finer resolution of sending rates and avoids problems with
43 * integer arithmetic; u32 is not sufficient as scaling consumes 6 bits.
44 */
25struct tfrc_tx_info { 45struct tfrc_tx_info {
26 __u32 tfrctx_x; 46 __u64 tfrctx_x;
27 __u32 tfrctx_x_recv; 47 __u64 tfrctx_x_recv;
28 __u32 tfrctx_x_calc; 48 __u32 tfrctx_x_calc;
29 __u32 tfrctx_rtt; 49 __u32 tfrctx_rtt;
30 __u32 tfrctx_p; 50 __u32 tfrctx_p;
diff --git a/include/linux/timer.h b/include/linux/timer.h
index c982304dbafd..eeef6643d4c6 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -98,4 +98,10 @@ extern void run_local_timers(void);
98struct hrtimer; 98struct hrtimer;
99extern int it_real_fn(struct hrtimer *); 99extern int it_real_fn(struct hrtimer *);
100 100
101unsigned long __round_jiffies(unsigned long j, int cpu);
102unsigned long __round_jiffies_relative(unsigned long j, int cpu);
103unsigned long round_jiffies(unsigned long j);
104unsigned long round_jiffies_relative(unsigned long j);
105
106
101#endif 107#endif
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 33a653913d94..b0c916d1f375 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -194,34 +194,34 @@
194 194
195 195
196struct tipc_node_info { 196struct tipc_node_info {
197 __u32 addr; /* network address of node */ 197 __be32 addr; /* network address of node */
198 __u32 up; /* 0=down, 1= up */ 198 __be32 up; /* 0=down, 1= up */
199}; 199};
200 200
201struct tipc_link_info { 201struct tipc_link_info {
202 __u32 dest; /* network address of peer node */ 202 __be32 dest; /* network address of peer node */
203 __u32 up; /* 0=down, 1=up */ 203 __be32 up; /* 0=down, 1=up */
204 char str[TIPC_MAX_LINK_NAME]; /* link name */ 204 char str[TIPC_MAX_LINK_NAME]; /* link name */
205}; 205};
206 206
207struct tipc_bearer_config { 207struct tipc_bearer_config {
208 __u32 priority; /* Range [1,31]. Override per link */ 208 __be32 priority; /* Range [1,31]. Override per link */
209 __u32 detect_scope; 209 __be32 detect_scope;
210 char name[TIPC_MAX_BEARER_NAME]; 210 char name[TIPC_MAX_BEARER_NAME];
211}; 211};
212 212
213struct tipc_link_config { 213struct tipc_link_config {
214 __u32 value; 214 __be32 value;
215 char name[TIPC_MAX_LINK_NAME]; 215 char name[TIPC_MAX_LINK_NAME];
216}; 216};
217 217
218#define TIPC_NTQ_ALLTYPES 0x80000000 218#define TIPC_NTQ_ALLTYPES 0x80000000
219 219
220struct tipc_name_table_query { 220struct tipc_name_table_query {
221 __u32 depth; /* 1:type, 2:+name info, 3:+port info, 4+:+debug info */ 221 __be32 depth; /* 1:type, 2:+name info, 3:+port info, 4+:+debug info */
222 __u32 type; /* {t,l,u} info ignored if high bit of "depth" is set */ 222 __be32 type; /* {t,l,u} info ignored if high bit of "depth" is set */
223 __u32 lowbound; /* (i.e. displays all entries of name table) */ 223 __be32 lowbound; /* (i.e. displays all entries of name table) */
224 __u32 upbound; 224 __be32 upbound;
225}; 225};
226 226
227/* 227/*
@@ -262,8 +262,8 @@ struct tipc_route_info {
262 */ 262 */
263 263
264struct tlv_desc { 264struct tlv_desc {
265 __u16 tlv_len; /* TLV length (descriptor + value) */ 265 __be16 tlv_len; /* TLV length (descriptor + value) */
266 __u16 tlv_type; /* TLV identifier */ 266 __be16 tlv_type; /* TLV identifier */
267}; 267};
268 268
269#define TLV_ALIGNTO 4 269#define TLV_ALIGNTO 4
@@ -377,9 +377,9 @@ struct tipc_genlmsghdr {
377 377
378struct tipc_cfg_msg_hdr 378struct tipc_cfg_msg_hdr
379{ 379{
380 __u32 tcm_len; /* Message length (including header) */ 380 __be32 tcm_len; /* Message length (including header) */
381 __u16 tcm_type; /* Command type */ 381 __be16 tcm_type; /* Command type */
382 __u16 tcm_flags; /* Additional flags */ 382 __be16 tcm_flags; /* Additional flags */
383 char tcm_reserved[8]; /* Unused */ 383 char tcm_reserved[8]; /* Unused */
384}; 384};
385 385
diff --git a/include/linux/topology.h b/include/linux/topology.h
index da508d1998e4..6c5a6e6e813b 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -93,7 +93,7 @@
93 .groups = NULL, \ 93 .groups = NULL, \
94 .min_interval = 1, \ 94 .min_interval = 1, \
95 .max_interval = 2, \ 95 .max_interval = 2, \
96 .busy_factor = 8, \ 96 .busy_factor = 64, \
97 .imbalance_pct = 110, \ 97 .imbalance_pct = 110, \
98 .cache_nice_tries = 0, \ 98 .cache_nice_tries = 0, \
99 .per_cpu_gain = 25, \ 99 .per_cpu_gain = 25, \
@@ -194,7 +194,8 @@
194 .wake_idx = 0, /* unused */ \ 194 .wake_idx = 0, /* unused */ \
195 .forkexec_idx = 0, /* unused */ \ 195 .forkexec_idx = 0, /* unused */ \
196 .per_cpu_gain = 100, \ 196 .per_cpu_gain = 100, \
197 .flags = SD_LOAD_BALANCE, \ 197 .flags = SD_LOAD_BALANCE \
198 | SD_SERIALIZE, \
198 .last_balance = jiffies, \ 199 .last_balance = jiffies, \
199 .balance_interval = 64, \ 200 .balance_interval = 64, \
200 .nr_balance_failed = 0, \ 201 .nr_balance_failed = 0, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 44091c0db0b4..65cbcf22c31e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -53,7 +53,7 @@ struct tty_buffer {
53}; 53};
54 54
55struct tty_bufhead { 55struct tty_bufhead {
56 struct work_struct work; 56 struct delayed_work work;
57 struct semaphore pty_sem; 57 struct semaphore pty_sem;
58 spinlock_t lock; 58 spinlock_t lock;
59 struct tty_buffer *head; /* Queue head */ 59 struct tty_buffer *head; /* Queue head */
@@ -175,7 +175,7 @@ struct tty_struct {
175 int index; 175 int index;
176 struct tty_ldisc ldisc; 176 struct tty_ldisc ldisc;
177 struct mutex termios_mutex; 177 struct mutex termios_mutex;
178 struct termios *termios, *termios_locked; 178 struct ktermios *termios, *termios_locked;
179 char name[64]; 179 char name[64];
180 int pgrp; 180 int pgrp;
181 int session; 181 int session;
@@ -258,7 +258,7 @@ struct tty_struct {
258 258
259extern void tty_write_flush(struct tty_struct *); 259extern void tty_write_flush(struct tty_struct *);
260 260
261extern struct termios tty_std_termios; 261extern struct ktermios tty_std_termios;
262 262
263extern int kmsg_redirect; 263extern int kmsg_redirect;
264 264
@@ -276,9 +276,8 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
276extern int tty_unregister_ldisc(int disc); 276extern int tty_unregister_ldisc(int disc);
277extern int tty_register_driver(struct tty_driver *driver); 277extern int tty_register_driver(struct tty_driver *driver);
278extern int tty_unregister_driver(struct tty_driver *driver); 278extern int tty_unregister_driver(struct tty_driver *driver);
279extern struct class_device *tty_register_device(struct tty_driver *driver, 279extern struct device *tty_register_device(struct tty_driver *driver,
280 unsigned index, 280 unsigned index, struct device *dev);
281 struct device *dev);
282extern void tty_unregister_device(struct tty_driver *driver, unsigned index); 281extern void tty_unregister_device(struct tty_driver *driver, unsigned index);
283extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, 282extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
284 int buflen); 283 int buflen);
@@ -294,8 +293,9 @@ extern int tty_hung_up_p(struct file * filp);
294extern void do_SAK(struct tty_struct *tty); 293extern void do_SAK(struct tty_struct *tty);
295extern void disassociate_ctty(int priv); 294extern void disassociate_ctty(int priv);
296extern void tty_flip_buffer_push(struct tty_struct *tty); 295extern void tty_flip_buffer_push(struct tty_struct *tty);
297extern int tty_get_baud_rate(struct tty_struct *tty); 296extern speed_t tty_get_baud_rate(struct tty_struct *tty);
298extern int tty_termios_baud_rate(struct termios *termios); 297extern speed_t tty_termios_baud_rate(struct ktermios *termios);
298extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
299 299
300extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *); 300extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);
301extern void tty_ldisc_deref(struct tty_ldisc *); 301extern void tty_ldisc_deref(struct tty_ldisc *);
@@ -310,6 +310,12 @@ extern void tty_ldisc_flush(struct tty_struct *tty);
310extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 310extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
311 unsigned long arg); 311 unsigned long arg);
312 312
313extern dev_t tty_devnum(struct tty_struct *tty);
314extern void proc_clear_tty(struct task_struct *p);
315extern void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty);
316extern void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty);
317extern struct tty_struct *get_current_tty(void);
318
313extern struct mutex tty_mutex; 319extern struct mutex tty_mutex;
314 320
315/* n_tty.c */ 321/* n_tty.c */
@@ -336,10 +342,5 @@ extern void console_print(const char *);
336extern int vt_ioctl(struct tty_struct *tty, struct file * file, 342extern int vt_ioctl(struct tty_struct *tty, struct file * file,
337 unsigned int cmd, unsigned long arg); 343 unsigned int cmd, unsigned long arg);
338 344
339static inline dev_t tty_devnum(struct tty_struct *tty)
340{
341 return MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index;
342}
343
344#endif /* __KERNEL__ */ 345#endif /* __KERNEL__ */
345#endif 346#endif
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 5c8473bb6882..659487e3ebeb 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -53,7 +53,7 @@
53 * device-specific ioctl's. If the ioctl number passed in cmd 53 * device-specific ioctl's. If the ioctl number passed in cmd
54 * is not recognized by the driver, it should return ENOIOCTLCMD. 54 * is not recognized by the driver, it should return ENOIOCTLCMD.
55 * 55 *
56 * void (*set_termios)(struct tty_struct *tty, struct termios * old); 56 * void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
57 * 57 *
58 * This routine allows the tty driver to be notified when 58 * This routine allows the tty driver to be notified when
59 * device's termios settings have changed. Note that a 59 * device's termios settings have changed. Note that a
@@ -132,7 +132,7 @@ struct tty_operations {
132 int (*chars_in_buffer)(struct tty_struct *tty); 132 int (*chars_in_buffer)(struct tty_struct *tty);
133 int (*ioctl)(struct tty_struct *tty, struct file * file, 133 int (*ioctl)(struct tty_struct *tty, struct file * file,
134 unsigned int cmd, unsigned long arg); 134 unsigned int cmd, unsigned long arg);
135 void (*set_termios)(struct tty_struct *tty, struct termios * old); 135 void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
136 void (*throttle)(struct tty_struct * tty); 136 void (*throttle)(struct tty_struct * tty);
137 void (*unthrottle)(struct tty_struct * tty); 137 void (*unthrottle)(struct tty_struct * tty);
138 void (*stop)(struct tty_struct *tty); 138 void (*stop)(struct tty_struct *tty);
@@ -165,7 +165,7 @@ struct tty_driver {
165 int num; /* number of devices allocated */ 165 int num; /* number of devices allocated */
166 short type; /* type of tty driver */ 166 short type; /* type of tty driver */
167 short subtype; /* subtype of tty driver */ 167 short subtype; /* subtype of tty driver */
168 struct termios init_termios; /* Initial termios */ 168 struct ktermios init_termios; /* Initial termios */
169 int flags; /* tty driver flags */ 169 int flags; /* tty driver flags */
170 int refcount; /* for loadable tty drivers */ 170 int refcount; /* for loadable tty drivers */
171 struct proc_dir_entry *proc_entry; /* /proc fs entry */ 171 struct proc_dir_entry *proc_entry; /* /proc fs entry */
@@ -175,8 +175,8 @@ struct tty_driver {
175 * Pointer to the tty data structures 175 * Pointer to the tty data structures
176 */ 176 */
177 struct tty_struct **ttys; 177 struct tty_struct **ttys;
178 struct termios **termios; 178 struct ktermios **termios;
179 struct termios **termios_locked; 179 struct ktermios **termios_locked;
180 void *driver_state; /* only used for the PTY driver */ 180 void *driver_state; /* only used for the PTY driver */
181 181
182 /* 182 /*
@@ -193,7 +193,7 @@ struct tty_driver {
193 int (*chars_in_buffer)(struct tty_struct *tty); 193 int (*chars_in_buffer)(struct tty_struct *tty);
194 int (*ioctl)(struct tty_struct *tty, struct file * file, 194 int (*ioctl)(struct tty_struct *tty, struct file * file,
195 unsigned int cmd, unsigned long arg); 195 unsigned int cmd, unsigned long arg);
196 void (*set_termios)(struct tty_struct *tty, struct termios * old); 196 void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
197 void (*throttle)(struct tty_struct * tty); 197 void (*throttle)(struct tty_struct * tty);
198 void (*unthrottle)(struct tty_struct * tty); 198 void (*unthrottle)(struct tty_struct * tty);
199 void (*stop)(struct tty_struct *tty); 199 void (*stop)(struct tty_struct *tty);
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 83c6e6c10ebb..d75932e27710 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -59,7 +59,7 @@
59 * low-level driver can "grab" an ioctl request before the line 59 * low-level driver can "grab" an ioctl request before the line
60 * discpline has a chance to see it. 60 * discpline has a chance to see it.
61 * 61 *
62 * void (*set_termios)(struct tty_struct *tty, struct termios * old); 62 * void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
63 * 63 *
64 * This function notifies the line discpline that a change has 64 * This function notifies the line discpline that a change has
65 * been made to the termios structure. 65 * been made to the termios structure.
@@ -118,7 +118,7 @@ struct tty_ldisc {
118 const unsigned char * buf, size_t nr); 118 const unsigned char * buf, size_t nr);
119 int (*ioctl)(struct tty_struct * tty, struct file * file, 119 int (*ioctl)(struct tty_struct * tty, struct file * file,
120 unsigned int cmd, unsigned long arg); 120 unsigned int cmd, unsigned long arg);
121 void (*set_termios)(struct tty_struct *tty, struct termios * old); 121 void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
122 unsigned int (*poll)(struct tty_struct *, struct file *, 122 unsigned int (*poll)(struct tty_struct *, struct file *,
123 struct poll_table_struct *); 123 struct poll_table_struct *);
124 int (*hangup)(struct tty_struct *tty); 124 int (*hangup)(struct tty_struct *tty);
diff --git a/include/linux/types.h b/include/linux/types.h
index 750f085fa564..0351bf2fac85 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -128,21 +128,27 @@ typedef __s64 int64_t;
128 128
129/* this is a special 64bit data type that is 8-byte aligned */ 129/* this is a special 64bit data type that is 8-byte aligned */
130#define aligned_u64 unsigned long long __attribute__((aligned(8))) 130#define aligned_u64 unsigned long long __attribute__((aligned(8)))
131#define aligned_be64 __be64 __attribute__((aligned(8)))
132#define aligned_le64 __le64 __attribute__((aligned(8)))
131 133
132/** 134/**
133 * The type used for indexing onto a disc or disc partition. 135 * The type used for indexing onto a disc or disc partition.
134 * 136 *
135 * Linux always considers sectors to be 512 bytes long independently 137 * Linux always considers sectors to be 512 bytes long independently
136 * of the devices real block size. 138 * of the devices real block size.
137 *
138 * If required, asm/types.h can override it and define
139 * HAVE_SECTOR_T
140 */ 139 */
141#ifndef HAVE_SECTOR_T 140#ifdef CONFIG_LBD
141typedef u64 sector_t;
142#else
142typedef unsigned long sector_t; 143typedef unsigned long sector_t;
143#endif 144#endif
144 145
145#ifndef HAVE_BLKCNT_T 146/*
147 * The type of the inode's block count.
148 */
149#ifdef CONFIG_LSF
150typedef u64 blkcnt_t;
151#else
146typedef unsigned long blkcnt_t; 152typedef unsigned long blkcnt_t;
147#endif 153#endif
148 154
@@ -180,6 +186,8 @@ typedef __u32 __bitwise __be32;
180typedef __u64 __bitwise __le64; 186typedef __u64 __bitwise __le64;
181typedef __u64 __bitwise __be64; 187typedef __u64 __bitwise __be64;
182#endif 188#endif
189typedef __u16 __bitwise __sum16;
190typedef __u32 __bitwise __wsum;
183 191
184#ifdef __KERNEL__ 192#ifdef __KERNEL__
185typedef unsigned __bitwise__ gfp_t; 193typedef unsigned __bitwise__ gfp_t;
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index a48d7f11c7be..975c963e5789 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -1,8 +1,43 @@
1#ifndef __LINUX_UACCESS_H__ 1#ifndef __LINUX_UACCESS_H__
2#define __LINUX_UACCESS_H__ 2#define __LINUX_UACCESS_H__
3 3
4#include <linux/preempt.h>
4#include <asm/uaccess.h> 5#include <asm/uaccess.h>
5 6
7/*
8 * These routines enable/disable the pagefault handler in that
9 * it will not take any locks and go straight to the fixup table.
10 *
11 * They have great resemblance to the preempt_disable/enable calls
12 * and in fact they are identical; this is because currently there is
13 * no other way to make the pagefault handlers do this. So we do
14 * disable preemption but we don't necessarily care about that.
15 */
16static inline void pagefault_disable(void)
17{
18 inc_preempt_count();
19 /*
20 * make sure to have issued the store before a pagefault
21 * can hit.
22 */
23 barrier();
24}
25
26static inline void pagefault_enable(void)
27{
28 /*
29 * make sure to issue those last loads/stores before enabling
30 * the pagefault handler again.
31 */
32 barrier();
33 dec_preempt_count();
34 /*
35 * make sure we do..
36 */
37 barrier();
38 preempt_check_resched();
39}
40
6#ifndef ARCH_HAS_NOCACHE_UACCESS 41#ifndef ARCH_HAS_NOCACHE_UACCESS
7 42
8static inline unsigned long __copy_from_user_inatomic_nocache(void *to, 43static inline unsigned long __copy_from_user_inatomic_nocache(void *to,
@@ -30,14 +65,22 @@ static inline unsigned long __copy_from_user_nocache(void *to,
30 * do_page_fault() doesn't attempt to take mmap_sem. This makes 65 * do_page_fault() doesn't attempt to take mmap_sem. This makes
31 * probe_kernel_address() suitable for use within regions where the caller 66 * probe_kernel_address() suitable for use within regions where the caller
32 * already holds mmap_sem, or other locks which nest inside mmap_sem. 67 * already holds mmap_sem, or other locks which nest inside mmap_sem.
68 * This must be a macro because __get_user() needs to know the types of the
69 * args.
70 *
71 * We don't include enough header files to be able to do the set_fs(). We
72 * require that the probe_kernel_address() caller will do that.
33 */ 73 */
34#define probe_kernel_address(addr, retval) \ 74#define probe_kernel_address(addr, retval) \
35 ({ \ 75 ({ \
36 long ret; \ 76 long ret; \
77 mm_segment_t old_fs = get_fs(); \
37 \ 78 \
38 inc_preempt_count(); \ 79 set_fs(KERNEL_DS); \
39 ret = __get_user(retval, addr); \ 80 pagefault_disable(); \
40 dec_preempt_count(); \ 81 ret = __get_user(retval, (__force typeof(retval) __user *)(addr)); \
82 pagefault_enable(); \
83 set_fs(old_fs); \
41 ret; \ 84 ret; \
42 }) 85 })
43 86
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 014b41d1e308..7e08c07efe0f 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -23,7 +23,7 @@ struct udphdr {
23 __be16 source; 23 __be16 source;
24 __be16 dest; 24 __be16 dest;
25 __be16 len; 25 __be16 len;
26 __be16 check; 26 __sum16 check;
27}; 27};
28 28
29/* UDP socket options */ 29/* UDP socket options */
@@ -38,6 +38,7 @@ struct udphdr {
38#include <linux/types.h> 38#include <linux/types.h>
39 39
40#include <net/inet_sock.h> 40#include <net/inet_sock.h>
41#define UDP_HTABLE_SIZE 128
41 42
42struct udp_sock { 43struct udp_sock {
43 /* inet_sock has to be the first member */ 44 /* inet_sock has to be the first member */
@@ -50,12 +51,23 @@ struct udp_sock {
50 * when the socket is uncorked. 51 * when the socket is uncorked.
51 */ 52 */
52 __u16 len; /* total length of pending frames */ 53 __u16 len; /* total length of pending frames */
54 /*
55 * Fields specific to UDP-Lite.
56 */
57 __u16 pcslen;
58 __u16 pcrlen;
59/* indicator bits used by pcflag: */
60#define UDPLITE_BIT 0x1 /* set by udplite proto init function */
61#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */
62#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */
63 __u8 pcflag; /* marks socket as UDP-Lite if > 0 */
53}; 64};
54 65
55static inline struct udp_sock *udp_sk(const struct sock *sk) 66static inline struct udp_sock *udp_sk(const struct sock *sk)
56{ 67{
57 return (struct udp_sock *)sk; 68 return (struct udp_sock *)sk;
58} 69}
70#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
59 71
60#endif 72#endif
61 73
diff --git a/include/linux/unwind.h b/include/linux/unwind.h
index 749928c161fb..7760860fa170 100644
--- a/include/linux/unwind.h
+++ b/include/linux/unwind.h
@@ -14,63 +14,6 @@
14 14
15struct module; 15struct module;
16 16
17#ifdef CONFIG_STACK_UNWIND
18
19#include <asm/unwind.h>
20
21#ifndef ARCH_UNWIND_SECTION_NAME
22#define ARCH_UNWIND_SECTION_NAME ".eh_frame"
23#endif
24
25/*
26 * Initialize unwind support.
27 */
28extern void unwind_init(void);
29extern void unwind_setup(void);
30
31#ifdef CONFIG_MODULES
32
33extern void *unwind_add_table(struct module *,
34 const void *table_start,
35 unsigned long table_size);
36
37extern void unwind_remove_table(void *handle, int init_only);
38
39#endif
40
41extern int unwind_init_frame_info(struct unwind_frame_info *,
42 struct task_struct *,
43 /*const*/ struct pt_regs *);
44
45/*
46 * Prepare to unwind a blocked task.
47 */
48extern int unwind_init_blocked(struct unwind_frame_info *,
49 struct task_struct *);
50
51/*
52 * Prepare to unwind the currently running thread.
53 */
54extern int unwind_init_running(struct unwind_frame_info *,
55 asmlinkage int (*callback)(struct unwind_frame_info *,
56 void *arg),
57 void *arg);
58
59/*
60 * Unwind to previous to frame. Returns 0 if successful, negative
61 * number in case of an error.
62 */
63extern int unwind(struct unwind_frame_info *);
64
65/*
66 * Unwind until the return pointer is in user-land (or until an error
67 * occurs). Returns 0 if successful, negative number in case of
68 * error.
69 */
70extern int unwind_to_user(struct unwind_frame_info *);
71
72#else
73
74struct unwind_frame_info {}; 17struct unwind_frame_info {};
75 18
76static inline void unwind_init(void) {} 19static inline void unwind_init(void) {}
@@ -85,12 +28,12 @@ static inline void *unwind_add_table(struct module *mod,
85 return NULL; 28 return NULL;
86} 29}
87 30
88#endif
89
90static inline void unwind_remove_table(void *handle, int init_only) 31static inline void unwind_remove_table(void *handle, int init_only)
91{ 32{
92} 33}
93 34
35#endif
36
94static inline int unwind_init_frame_info(struct unwind_frame_info *info, 37static inline int unwind_init_frame_info(struct unwind_frame_info *info,
95 struct task_struct *tsk, 38 struct task_struct *tsk,
96 const struct pt_regs *regs) 39 const struct pt_regs *regs)
@@ -122,6 +65,4 @@ static inline int unwind_to_user(struct unwind_frame_info *info)
122 return -ENOSYS; 65 return -ENOSYS;
123} 66}
124 67
125#endif
126
127#endif /* _LINUX_UNWIND_H */ 68#endif /* _LINUX_UNWIND_H */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 5482bfb3303d..aab5b1b72021 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -313,8 +313,13 @@ struct usb_bus {
313/* This is arbitrary. 313/* This is arbitrary.
314 * From USB 2.0 spec Table 11-13, offset 7, a hub can 314 * From USB 2.0 spec Table 11-13, offset 7, a hub can
315 * have up to 255 ports. The most yet reported is 10. 315 * have up to 255 ports. The most yet reported is 10.
316 *
317 * Current Wireless USB host hardware (Intel i1480 for example) allows
318 * up to 22 devices to connect. Upcoming hardware might raise that
319 * limit. Because the arrays need to add a bit for hub status data, we
320 * do 31, so plus one evens out to four bytes.
316 */ 321 */
317#define USB_MAXCHILDREN (16) 322#define USB_MAXCHILDREN (31)
318 323
319struct usb_tt; 324struct usb_tt;
320 325
@@ -357,7 +362,8 @@ struct usb_device {
357 u8 portnum; /* Parent port number (origin 1) */ 362 u8 portnum; /* Parent port number (origin 1) */
358 u8 level; /* Number of USB hub ancestors */ 363 u8 level; /* Number of USB hub ancestors */
359 364
360 int have_langid; /* whether string_langid is valid */ 365 unsigned discon_suspended:1; /* Disconnected while suspended */
366 unsigned have_langid:1; /* whether string_langid is valid */
361 int string_langid; /* language ID for strings */ 367 int string_langid; /* language ID for strings */
362 368
363 /* static strings from the device */ 369 /* static strings from the device */
@@ -382,7 +388,7 @@ struct usb_device {
382 388
383 int pm_usage_cnt; /* usage counter for autosuspend */ 389 int pm_usage_cnt; /* usage counter for autosuspend */
384#ifdef CONFIG_PM 390#ifdef CONFIG_PM
385 struct work_struct autosuspend; /* for delayed autosuspends */ 391 struct delayed_work autosuspend; /* for delayed autosuspends */
386 struct mutex pm_mutex; /* protects PM operations */ 392 struct mutex pm_mutex; /* protects PM operations */
387 393
388 unsigned auto_pm:1; /* autosuspend/resume in progress */ 394 unsigned auto_pm:1; /* autosuspend/resume in progress */
@@ -410,14 +416,37 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
410 416
411/* USB autosuspend and autoresume */ 417/* USB autosuspend and autoresume */
412#ifdef CONFIG_USB_SUSPEND 418#ifdef CONFIG_USB_SUSPEND
419extern int usb_autopm_set_interface(struct usb_interface *intf);
413extern int usb_autopm_get_interface(struct usb_interface *intf); 420extern int usb_autopm_get_interface(struct usb_interface *intf);
414extern void usb_autopm_put_interface(struct usb_interface *intf); 421extern void usb_autopm_put_interface(struct usb_interface *intf);
415 422
423static inline void usb_autopm_enable(struct usb_interface *intf)
424{
425 intf->pm_usage_cnt = 0;
426 usb_autopm_set_interface(intf);
427}
428
429static inline void usb_autopm_disable(struct usb_interface *intf)
430{
431 intf->pm_usage_cnt = 1;
432 usb_autopm_set_interface(intf);
433}
434
416#else 435#else
417#define usb_autopm_get_interface(intf) 0
418#define usb_autopm_put_interface(intf) do {} while (0)
419#endif
420 436
437static inline int usb_autopm_set_interface(struct usb_interface *intf)
438{ return 0; }
439
440static inline int usb_autopm_get_interface(struct usb_interface *intf)
441{ return 0; }
442
443static inline void usb_autopm_put_interface(struct usb_interface *intf)
444{ }
445static inline void usb_autopm_enable(struct usb_interface *intf)
446{ }
447static inline void usb_autopm_disable(struct usb_interface *intf)
448{ }
449#endif
421 450
422/*-------------------------------------------------------------------------*/ 451/*-------------------------------------------------------------------------*/
423 452
@@ -490,17 +519,137 @@ static inline int usb_make_path (struct usb_device *dev, char *buf,
490 519
491/*-------------------------------------------------------------------------*/ 520/*-------------------------------------------------------------------------*/
492 521
493extern int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd); 522/**
494extern int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd); 523 * usb_endpoint_dir_in - check if the endpoint has IN direction
495extern int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd); 524 * @epd: endpoint to be checked
496extern int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd); 525 *
497extern int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd); 526 * Returns true if the endpoint is of type IN, otherwise it returns false.
498extern int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd); 527 */
499extern int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd); 528static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
500extern int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd); 529{
501extern int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd); 530 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
502extern int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd); 531}
503extern int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd); 532
533/**
534 * usb_endpoint_dir_out - check if the endpoint has OUT direction
535 * @epd: endpoint to be checked
536 *
537 * Returns true if the endpoint is of type OUT, otherwise it returns false.
538 */
539static inline int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd)
540{
541 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
542}
543
544/**
545 * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type
546 * @epd: endpoint to be checked
547 *
548 * Returns true if the endpoint is of type bulk, otherwise it returns false.
549 */
550static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd)
551{
552 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
553 USB_ENDPOINT_XFER_BULK);
554}
555
556/**
557 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
558 * @epd: endpoint to be checked
559 *
560 * Returns true if the endpoint is of type interrupt, otherwise it returns
561 * false.
562 */
563static inline int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd)
564{
565 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
566 USB_ENDPOINT_XFER_INT);
567}
568
569/**
570 * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type
571 * @epd: endpoint to be checked
572 *
573 * Returns true if the endpoint is of type isochronous, otherwise it returns
574 * false.
575 */
576static inline int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd)
577{
578 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
579 USB_ENDPOINT_XFER_ISOC);
580}
581
582/**
583 * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN
584 * @epd: endpoint to be checked
585 *
586 * Returns true if the endpoint has bulk transfer type and IN direction,
587 * otherwise it returns false.
588 */
589static inline int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd)
590{
591 return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd));
592}
593
594/**
595 * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT
596 * @epd: endpoint to be checked
597 *
598 * Returns true if the endpoint has bulk transfer type and OUT direction,
599 * otherwise it returns false.
600 */
601static inline int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd)
602{
603 return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd));
604}
605
606/**
607 * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
608 * @epd: endpoint to be checked
609 *
610 * Returns true if the endpoint has interrupt transfer type and IN direction,
611 * otherwise it returns false.
612 */
613static inline int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd)
614{
615 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd));
616}
617
618/**
619 * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
620 * @epd: endpoint to be checked
621 *
622 * Returns true if the endpoint has interrupt transfer type and OUT direction,
623 * otherwise it returns false.
624 */
625static inline int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd)
626{
627 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd));
628}
629
630/**
631 * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN
632 * @epd: endpoint to be checked
633 *
634 * Returns true if the endpoint has isochronous transfer type and IN direction,
635 * otherwise it returns false.
636 */
637static inline int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd)
638{
639 return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd));
640}
641
642/**
643 * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT
644 * @epd: endpoint to be checked
645 *
646 * Returns true if the endpoint has isochronous transfer type and OUT direction,
647 * otherwise it returns false.
648 */
649static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd)
650{
651 return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd));
652}
504 653
505/*-------------------------------------------------------------------------*/ 654/*-------------------------------------------------------------------------*/
506 655
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 91b3ea2bbb14..10f99e5f1a97 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -218,7 +218,7 @@ struct usb_serial_driver {
218 int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); 218 int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count);
219 int (*write_room) (struct usb_serial_port *port); 219 int (*write_room) (struct usb_serial_port *port);
220 int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); 220 int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg);
221 void (*set_termios) (struct usb_serial_port *port, struct termios * old); 221 void (*set_termios) (struct usb_serial_port *port, struct ktermios * old);
222 void (*break_ctl) (struct usb_serial_port *port, int break_state); 222 void (*break_ctl) (struct usb_serial_port *port, int break_state);
223 int (*chars_in_buffer) (struct usb_serial_port *port); 223 int (*chars_in_buffer) (struct usb_serial_port *port);
224 void (*throttle) (struct usb_serial_port *port); 224 void (*throttle) (struct usb_serial_port *port);
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index df5c4654360d..5cb380a559fd 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -244,6 +244,7 @@ struct v4l2_pix_format
244#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ 244#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */
245#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ 245#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */
246#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */ 246#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:2:0 16x16 macroblocks */
247#define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R','4','4','4') /* 16 xxxxrrrr ggggbbbb */
247 248
248/* see http://www.siliconimaging.com/RGB%20Bayer.htm */ 249/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
249#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ 250#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index c89df55f6e03..5e9803ed17fc 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -10,8 +10,9 @@
10/* 10/*
11 * Light weight per cpu counter implementation. 11 * Light weight per cpu counter implementation.
12 * 12 *
13 * Counters should only be incremented and no critical kernel component 13 * Counters should only be incremented. You need to set EMBEDDED
14 * should rely on the counter values. 14 * to disable VM_EVENT_COUNTERS. Things like procps (vmstat,
15 * top, etc) use /proc/vmstat and depend on these counters.
15 * 16 *
16 * Counters are handled completely inline. On many platforms the code 17 * Counters are handled completely inline. On many platforms the code
17 * generated will simply be the increment of a global address. 18 * generated will simply be the increment of a global address.
@@ -73,7 +74,13 @@ static inline void count_vm_events(enum vm_event_item item, long delta)
73} 74}
74 75
75extern void all_vm_events(unsigned long *); 76extern void all_vm_events(unsigned long *);
77#ifdef CONFIG_HOTPLUG
76extern void vm_events_fold_cpu(int cpu); 78extern void vm_events_fold_cpu(int cpu);
79#else
80static inline void vm_events_fold_cpu(int cpu)
81{
82}
83#endif
77 84
78#else 85#else
79 86
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index a50a0130fd9e..7c269f4992eb 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -546,6 +546,8 @@
546/* MLME requests (SIOCSIWMLME / struct iw_mlme) */ 546/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
547#define IW_MLME_DEAUTH 0 547#define IW_MLME_DEAUTH 0
548#define IW_MLME_DISASSOC 1 548#define IW_MLME_DISASSOC 1
549#define IW_MLME_AUTH 2
550#define IW_MLME_ASSOC 3
549 551
550/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */ 552/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
551#define IW_AUTH_INDEX 0x0FFF 553#define IW_AUTH_INDEX 0x0FFF
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 9bca3539a1e5..2a7b38d87018 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -8,15 +8,34 @@
8#include <linux/timer.h> 8#include <linux/timer.h>
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <linux/bitops.h> 10#include <linux/bitops.h>
11#include <asm/atomic.h>
11 12
12struct workqueue_struct; 13struct workqueue_struct;
13 14
15struct work_struct;
16typedef void (*work_func_t)(struct work_struct *work);
17
18/*
19 * The first word is the work queue pointer and the flags rolled into
20 * one
21 */
22#define work_data_bits(work) ((unsigned long *)(&(work)->data))
23
14struct work_struct { 24struct work_struct {
15 unsigned long pending; 25 atomic_long_t data;
26#define WORK_STRUCT_PENDING 0 /* T if work item pending execution */
27#define WORK_STRUCT_NOAUTOREL 1 /* F if work item automatically released on exec */
28#define WORK_STRUCT_FLAG_MASK (3UL)
29#define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK)
16 struct list_head entry; 30 struct list_head entry;
17 void (*func)(void *); 31 work_func_t func;
18 void *data; 32};
19 void *wq_data; 33
34#define WORK_DATA_INIT(autorelease) \
35 ATOMIC_LONG_INIT((autorelease) << WORK_STRUCT_NOAUTOREL)
36
37struct delayed_work {
38 struct work_struct work;
20 struct timer_list timer; 39 struct timer_list timer;
21}; 40};
22 41
@@ -24,77 +43,164 @@ struct execute_work {
24 struct work_struct work; 43 struct work_struct work;
25}; 44};
26 45
27#define __WORK_INITIALIZER(n, f, d) { \ 46#define __WORK_INITIALIZER(n, f) { \
47 .data = WORK_DATA_INIT(0), \
48 .entry = { &(n).entry, &(n).entry }, \
49 .func = (f), \
50 }
51
52#define __WORK_INITIALIZER_NAR(n, f) { \
53 .data = WORK_DATA_INIT(1), \
28 .entry = { &(n).entry, &(n).entry }, \ 54 .entry = { &(n).entry, &(n).entry }, \
29 .func = (f), \ 55 .func = (f), \
30 .data = (d), \ 56 }
57
58#define __DELAYED_WORK_INITIALIZER(n, f) { \
59 .work = __WORK_INITIALIZER((n).work, (f)), \
31 .timer = TIMER_INITIALIZER(NULL, 0, 0), \ 60 .timer = TIMER_INITIALIZER(NULL, 0, 0), \
32 } 61 }
33 62
34#define DECLARE_WORK(n, f, d) \ 63#define __DELAYED_WORK_INITIALIZER_NAR(n, f) { \
35 struct work_struct n = __WORK_INITIALIZER(n, f, d) 64 .work = __WORK_INITIALIZER_NAR((n).work, (f)), \
65 .timer = TIMER_INITIALIZER(NULL, 0, 0), \
66 }
67
68#define DECLARE_WORK(n, f) \
69 struct work_struct n = __WORK_INITIALIZER(n, f)
70
71#define DECLARE_WORK_NAR(n, f) \
72 struct work_struct n = __WORK_INITIALIZER_NAR(n, f)
73
74#define DECLARE_DELAYED_WORK(n, f) \
75 struct delayed_work n = __DELAYED_WORK_INITIALIZER(n, f)
76
77#define DECLARE_DELAYED_WORK_NAR(n, f) \
78 struct dwork_struct n = __DELAYED_WORK_INITIALIZER_NAR(n, f)
36 79
37/* 80/*
38 * initialize a work-struct's func and data pointers: 81 * initialize a work item's function pointer
39 */ 82 */
40#define PREPARE_WORK(_work, _func, _data) \ 83#define PREPARE_WORK(_work, _func) \
41 do { \ 84 do { \
42 (_work)->func = _func; \ 85 (_work)->func = (_func); \
43 (_work)->data = _data; \
44 } while (0) 86 } while (0)
45 87
88#define PREPARE_DELAYED_WORK(_work, _func) \
89 PREPARE_WORK(&(_work)->work, (_func))
90
46/* 91/*
47 * initialize all of a work-struct: 92 * initialize all of a work item in one go
93 *
94 * NOTE! No point in using "atomic_long_set()": useing a direct
95 * assignment of the work data initializer allows the compiler
96 * to generate better code.
48 */ 97 */
49#define INIT_WORK(_work, _func, _data) \ 98#define INIT_WORK(_work, _func) \
50 do { \ 99 do { \
100 (_work)->data = (atomic_long_t) WORK_DATA_INIT(0); \
51 INIT_LIST_HEAD(&(_work)->entry); \ 101 INIT_LIST_HEAD(&(_work)->entry); \
52 (_work)->pending = 0; \ 102 PREPARE_WORK((_work), (_func)); \
53 PREPARE_WORK((_work), (_func), (_data)); \ 103 } while (0)
104
105#define INIT_WORK_NAR(_work, _func) \
106 do { \
107 (_work)->data = (atomic_long_t) WORK_DATA_INIT(1); \
108 INIT_LIST_HEAD(&(_work)->entry); \
109 PREPARE_WORK((_work), (_func)); \
110 } while (0)
111
112#define INIT_DELAYED_WORK(_work, _func) \
113 do { \
114 INIT_WORK(&(_work)->work, (_func)); \
115 init_timer(&(_work)->timer); \
116 } while (0)
117
118#define INIT_DELAYED_WORK_NAR(_work, _func) \
119 do { \
120 INIT_WORK_NAR(&(_work)->work, (_func)); \
54 init_timer(&(_work)->timer); \ 121 init_timer(&(_work)->timer); \
55 } while (0) 122 } while (0)
56 123
124/**
125 * work_pending - Find out whether a work item is currently pending
126 * @work: The work item in question
127 */
128#define work_pending(work) \
129 test_bit(WORK_STRUCT_PENDING, work_data_bits(work))
130
131/**
132 * delayed_work_pending - Find out whether a delayable work item is currently
133 * pending
134 * @work: The work item in question
135 */
136#define delayed_work_pending(w) \
137 work_pending(&(w)->work)
138
139/**
140 * work_release - Release a work item under execution
141 * @work: The work item to release
142 *
143 * This is used to release a work item that has been initialised with automatic
144 * release mode disabled (WORK_STRUCT_NOAUTOREL is set). This gives the work
145 * function the opportunity to grab auxiliary data from the container of the
146 * work_struct before clearing the pending bit as the work_struct may be
147 * subject to deallocation the moment the pending bit is cleared.
148 *
149 * In such a case, this should be called in the work function after it has
150 * fetched any data it may require from the containter of the work_struct.
151 * After this function has been called, the work_struct may be scheduled for
152 * further execution or it may be deallocated unless other precautions are
153 * taken.
154 *
155 * This should also be used to release a delayed work item.
156 */
157#define work_release(work) \
158 clear_bit(WORK_STRUCT_PENDING, work_data_bits(work))
159
160
57extern struct workqueue_struct *__create_workqueue(const char *name, 161extern struct workqueue_struct *__create_workqueue(const char *name,
58 int singlethread); 162 int singlethread,
59#define create_workqueue(name) __create_workqueue((name), 0) 163 int freezeable);
60#define create_singlethread_workqueue(name) __create_workqueue((name), 1) 164#define create_workqueue(name) __create_workqueue((name), 0, 0)
165#define create_freezeable_workqueue(name) __create_workqueue((name), 0, 1)
166#define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0)
61 167
62extern void destroy_workqueue(struct workqueue_struct *wq); 168extern void destroy_workqueue(struct workqueue_struct *wq);
63 169
64extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work)); 170extern int FASTCALL(queue_work(struct workqueue_struct *wq, struct work_struct *work));
65extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, struct work_struct *work, unsigned long delay)); 171extern int FASTCALL(queue_delayed_work(struct workqueue_struct *wq, struct delayed_work *work, unsigned long delay));
66extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, 172extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
67 struct work_struct *work, unsigned long delay); 173 struct delayed_work *work, unsigned long delay);
68extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq)); 174extern void FASTCALL(flush_workqueue(struct workqueue_struct *wq));
69 175
70extern int FASTCALL(schedule_work(struct work_struct *work)); 176extern int FASTCALL(schedule_work(struct work_struct *work));
71extern int FASTCALL(schedule_delayed_work(struct work_struct *work, unsigned long delay)); 177extern int FASTCALL(run_scheduled_work(struct work_struct *work));
178extern int FASTCALL(schedule_delayed_work(struct delayed_work *work, unsigned long delay));
72 179
73extern int schedule_delayed_work_on(int cpu, struct work_struct *work, unsigned long delay); 180extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, unsigned long delay);
74extern int schedule_on_each_cpu(void (*func)(void *info), void *info); 181extern int schedule_on_each_cpu(work_func_t func);
75extern void flush_scheduled_work(void); 182extern void flush_scheduled_work(void);
76extern int current_is_keventd(void); 183extern int current_is_keventd(void);
77extern int keventd_up(void); 184extern int keventd_up(void);
78 185
79extern void init_workqueues(void); 186extern void init_workqueues(void);
80void cancel_rearming_delayed_work(struct work_struct *work); 187void cancel_rearming_delayed_work(struct delayed_work *work);
81void cancel_rearming_delayed_workqueue(struct workqueue_struct *, 188void cancel_rearming_delayed_workqueue(struct workqueue_struct *,
82 struct work_struct *); 189 struct delayed_work *);
83int execute_in_process_context(void (*fn)(void *), void *, 190int execute_in_process_context(work_func_t fn, struct execute_work *);
84 struct execute_work *);
85 191
86/* 192/*
87 * Kill off a pending schedule_delayed_work(). Note that the work callback 193 * Kill off a pending schedule_delayed_work(). Note that the work callback
88 * function may still be running on return from cancel_delayed_work(). Run 194 * function may still be running on return from cancel_delayed_work(). Run
89 * flush_scheduled_work() to wait on it. 195 * flush_scheduled_work() to wait on it.
90 */ 196 */
91static inline int cancel_delayed_work(struct work_struct *work) 197static inline int cancel_delayed_work(struct delayed_work *work)
92{ 198{
93 int ret; 199 int ret;
94 200
95 ret = del_timer_sync(&work->timer); 201 ret = del_timer_sync(&work->timer);
96 if (ret) 202 if (ret)
97 clear_bit(0, &work->pending); 203 work_release(&work->work);
98 return ret; 204 return ret;
99} 205}
100 206
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 8ae7f744917b..9529ea1ae392 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -211,8 +211,8 @@ struct xfrm_user_tmpl {
211 211
212struct xfrm_encap_tmpl { 212struct xfrm_encap_tmpl {
213 __u16 encap_type; 213 __u16 encap_type;
214 __u16 encap_sport; 214 __be16 encap_sport;
215 __u16 encap_dport; 215 __be16 encap_dport;
216 xfrm_address_t encap_oa; 216 xfrm_address_t encap_oa;
217}; 217};
218 218
@@ -289,7 +289,9 @@ struct xfrm_usersa_id {
289 289
290struct xfrm_aevent_id { 290struct xfrm_aevent_id {
291 struct xfrm_usersa_id sa_id; 291 struct xfrm_usersa_id sa_id;
292 xfrm_address_t saddr;
292 __u32 flags; 293 __u32 flags;
294 __u32 reqid;
293}; 295};
294 296
295struct xfrm_userspi_info { 297struct xfrm_userspi_info {
@@ -355,7 +357,7 @@ struct xfrm_user_report {
355#define XFRMGRP_EXPIRE 2 357#define XFRMGRP_EXPIRE 2
356#define XFRMGRP_SA 4 358#define XFRMGRP_SA 4
357#define XFRMGRP_POLICY 8 359#define XFRMGRP_POLICY 8
358#define XFRMGRP_REPORT 0x10 360#define XFRMGRP_REPORT 0x20
359#endif 361#endif
360 362
361enum xfrm_nlgroups { 363enum xfrm_nlgroups {
diff --git a/include/linux/zftape.h b/include/linux/zftape.h
deleted file mode 100644
index b057c65366c6..000000000000
--- a/include/linux/zftape.h
+++ /dev/null
@@ -1,87 +0,0 @@
1#ifndef _ZFTAPE_H
2#define _ZFTAPE_H
3
4/*
5 * Copyright (C) 1996, 1997 Claus-Justus Heine.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 *
22 * $Source: /homes/cvs/ftape-stacked/include/linux/zftape.h,v $
23 * $Revision: 1.12 $
24 * $Date: 1997/10/21 11:02:37 $
25 *
26 * Special ioctl and other global info for the zftape VFS
27 * interface for the QIC-40/80/3010/3020 floppy-tape driver for
28 * Linux.
29 */
30
31#define ZFTAPE_VERSION "zftape for " FTAPE_VERSION
32
33#include <linux/ftape.h>
34
35#define ZFTAPE_LABEL "Ftape - The Linux Floppy Tape Project!"
36
37/* Bits of the minor device number that control the operation mode */
38#define ZFT_Q80_MODE (1 << 3)
39#define ZFT_ZIP_MODE (1 << 4)
40#define ZFT_RAW_MODE (1 << 5)
41#define ZFT_MINOR_OP_MASK (ZFT_Q80_MODE | \
42 ZFT_ZIP_MODE | \
43 ZFT_RAW_MODE)
44#define ZFT_MINOR_MASK (FTAPE_SEL_MASK | \
45 ZFT_MINOR_OP_MASK | \
46 FTAPE_NO_REWIND)
47
48#ifdef ZFT_OBSOLETE
49struct mtblksz {
50 unsigned int mt_blksz;
51};
52#define MTIOC_ZFTAPE_GETBLKSZ _IOR('m', 104, struct mtblksz)
53#endif
54
55#ifdef __KERNEL__
56
57extern int zft_init(void);
58
59static inline __s64 zft_div_blksz(__s64 value, __u32 blk_sz)
60{
61 if (blk_sz == 1) {
62 return value;
63 } else {
64 return (__s64)(((__u32)(value >> 10) + (blk_sz >> 10) - 1)
65 / (blk_sz >> 10));
66 }
67}
68
69static inline __s64 zft_mul_blksz(__s64 value, __u32 blk_sz)
70{
71 if (blk_sz == 1) {
72 return value;
73 } else {
74 /* if blk_sz != 1, then it is a multiple of 1024. In
75 * this case, `value' will also fit into 32 bits.
76 *
77 * Actually, this limits the capacity to 42
78 * bits. This is (2^32)*1024, roughly a thousand
79 * times 2GB, or 3 Terabytes. Hopefully this is enough
80 */
81 return(__s64)(((__u32)(value)*(blk_sz>>10))<<10);
82 }
83}
84
85#endif
86
87#endif