aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-04-09 10:17:41 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-04-09 10:21:12 -0400
commit87d8a69709d971913e6cc7210450fcb8be963667 (patch)
tree4f8eb95c588f7df84554dcf97d67540664333a7b /include/linux
parent0b8973a81876d90f916507ac40d1381068dc986a (diff)
parent2eaa9cfdf33b8d7fb7aff27792192e0019ae8fc6 (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/Kbuild4
-rw-r--r--include/linux/acct.h3
-rw-r--r--include/linux/acpi.h30
-rw-r--r--include/linux/amba/bus.h6
-rw-r--r--include/linux/amba/clcd.h33
-rw-r--r--include/linux/ata.h7
-rw-r--r--include/linux/audit.h11
-rw-r--r--include/linux/backlight.h7
-rw-r--r--include/linux/binfmts.h12
-rw-r--r--include/linux/bitops.h33
-rw-r--r--include/linux/blkdev.h79
-rw-r--r--include/linux/blktrace_api.h4
-rw-r--r--include/linux/bootmem.h7
-rw-r--r--include/linux/brcmphy.h11
-rw-r--r--include/linux/btree-128.h109
-rw-r--r--include/linux/btree-type.h147
-rw-r--r--include/linux/btree.h243
-rw-r--r--include/linux/can/dev.h27
-rw-r--r--include/linux/can/netlink.h17
-rw-r--r--include/linux/can/platform/ti_hecc.h8
-rw-r--r--include/linux/cciss_defs.h130
-rw-r--r--include/linux/cciss_ioctl.h128
-rw-r--r--include/linux/cgroup.h58
-rw-r--r--include/linux/circ_buf.h4
-rw-r--r--include/linux/clockchips.h2
-rw-r--r--include/linux/clocksource.h5
-rw-r--r--include/linux/compat.h3
-rw-r--r--include/linux/compiler.h4
-rw-r--r--include/linux/connector.h32
-rw-r--r--include/linux/coredump.h45
-rw-r--r--include/linux/cpumask.h22
-rw-r--r--include/linux/cred.h2
-rw-r--r--include/linux/davinci_emac.h39
-rw-r--r--include/linux/decompress/mm.h18
-rw-r--r--include/linux/decompress/unlzo.h10
-rw-r--r--include/linux/device-mapper.h5
-rw-r--r--include/linux/device.h69
-rw-r--r--include/linux/dm-io.h4
-rw-r--r--include/linux/dm-ioctl.h9
-rw-r--r--include/linux/dm9000.h2
-rw-r--r--include/linux/dma-mapping.h24
-rw-r--r--include/linux/dmaengine.h6
-rw-r--r--include/linux/drbd.h2
-rw-r--r--include/linux/drbd_nl.h1
-rw-r--r--include/linux/dst.h587
-rw-r--r--include/linux/early_res.h23
-rw-r--r--include/linux/elf.h42
-rw-r--r--include/linux/elfcore.h17
-rw-r--r--include/linux/enclosure.h2
-rw-r--r--include/linux/ethtool.h69
-rw-r--r--include/linux/eventfd.h16
-rw-r--r--include/linux/exportfs.h7
-rw-r--r--include/linux/ext3_fs.h35
-rw-r--r--include/linux/ext3_fs_i.h2
-rw-r--r--include/linux/ext3_fs_sb.h2
-rw-r--r--include/linux/ext3_jbd.h7
-rw-r--r--include/linux/fault-inject.h5
-rw-r--r--include/linux/fb.h2
-rw-r--r--include/linux/fdtable.h11
-rw-r--r--include/linux/fiemap.h2
-rw-r--r--include/linux/file.h8
-rw-r--r--include/linux/firewire-cdev.h47
-rw-r--r--include/linux/firewire.h15
-rw-r--r--include/linux/firmware-map.h6
-rw-r--r--include/linux/fs.h101
-rw-r--r--include/linux/fs_stack.h6
-rw-r--r--include/linux/fscache-cache.h2
-rw-r--r--include/linux/fsnotify.h11
-rw-r--r--include/linux/ftrace.h13
-rw-r--r--include/linux/ftrace_event.h40
-rw-r--r--include/linux/gameport.h1
-rw-r--r--include/linux/generic_acl.h41
-rw-r--r--include/linux/genhd.h8
-rw-r--r--include/linux/gfp.h12
-rw-r--r--include/linux/gfs2_ondisk.h30
-rw-r--r--include/linux/gpio_keys.h1
-rw-r--r--include/linux/hid.h5
-rw-r--r--include/linux/highmem.h8
-rw-r--r--include/linux/hil.h16
-rw-r--r--include/linux/htcpld.h24
-rw-r--r--include/linux/hw_breakpoint.h12
-rw-r--r--include/linux/i2c-algo-bit.h2
-rw-r--r--include/linux/i2c-pnx.h19
-rw-r--r--include/linux/i2c-smbus.h50
-rw-r--r--include/linux/i2c-xiic.h43
-rw-r--r--include/linux/i2c.h8
-rw-r--r--include/linux/i2c/adp5588.h12
-rw-r--r--include/linux/i2c/pca953x.h11
-rw-r--r--include/linux/i2c/twl.h32
-rw-r--r--include/linux/i2o.h2
-rw-r--r--include/linux/i8042.h18
-rw-r--r--include/linux/icmpv6.h3
-rw-r--r--include/linux/ide.h7
-rw-r--r--include/linux/ieee80211.h110
-rw-r--r--include/linux/if_link.h30
-rw-r--r--include/linux/if_macvlan.h84
-rw-r--r--include/linux/if_packet.h1
-rw-r--r--include/linux/if_tun.h17
-rw-r--r--include/linux/if_tunnel.h1
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/ima.h12
-rw-r--r--include/linux/in.h2
-rw-r--r--include/linux/inetdevice.h44
-rw-r--r--include/linux/init.h2
-rw-r--r--include/linux/init_task.h16
-rw-r--r--include/linux/input.h81
-rw-r--r--include/linux/input/sh_keysc.h7
-rw-r--r--include/linux/iocontext.h31
-rw-r--r--include/linux/ioport.h27
-rw-r--r--include/linux/ipc_namespace.h5
-rw-r--r--include/linux/ipmi_smi.h1
-rw-r--r--include/linux/irq.h4
-rw-r--r--include/linux/isdn/capilli.h8
-rw-r--r--include/linux/jbd.h11
-rw-r--r--include/linux/jbd2.h23
-rw-r--r--include/linux/kbd_kern.h3
-rw-r--r--include/linux/kernel-page-flags.h46
-rw-r--r--include/linux/kernel.h22
-rw-r--r--include/linux/kernelcapi.h17
-rw-r--r--include/linux/kexec.h2
-rw-r--r--include/linux/kfifo.h566
-rw-r--r--include/linux/kgdb.h7
-rw-r--r--include/linux/kmemcheck.h110
-rw-r--r--include/linux/kmemleak.h6
-rw-r--r--include/linux/kmod.h1
-rw-r--r--include/linux/kmsg_dump.h61
-rw-r--r--include/linux/kobject.h14
-rw-r--r--include/linux/kprobes.h44
-rw-r--r--include/linux/kvm.h10
-rw-r--r--include/linux/kvm_host.h71
-rw-r--r--include/linux/leds-lp3944.h3
-rw-r--r--include/linux/leds-pca9532.h2
-rw-r--r--include/linux/leds-regulator.h46
-rw-r--r--include/linux/libata.h8
-rw-r--r--include/linux/list.h20
-rw-r--r--include/linux/list_sort.h11
-rw-r--r--include/linux/llc.h7
-rw-r--r--include/linux/lmb.h2
-rw-r--r--include/linux/lockdep.h8
-rw-r--r--include/linux/lru_cache.h2
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/memcontrol.h19
-rw-r--r--include/linux/memory.h29
-rw-r--r--include/linux/mfd/88pm8607.h217
-rw-r--r--include/linux/mfd/88pm860x.h375
-rw-r--r--include/linux/mfd/ab3100.h3
-rw-r--r--include/linux/mfd/max8925.h253
-rw-r--r--include/linux/mfd/mc13783.h28
-rw-r--r--include/linux/mfd/tmio.h42
-rw-r--r--include/linux/mfd/ucb1x00.h1
-rw-r--r--include/linux/mfd/wm831x/core.h6
-rw-r--r--include/linux/mfd/wm831x/gpio.h4
-rw-r--r--include/linux/mfd/wm831x/pdata.h17
-rw-r--r--include/linux/mfd/wm8350/core.h49
-rw-r--r--include/linux/mfd/wm8350/gpio.h1
-rw-r--r--include/linux/mfd/wm8350/pmic.h28
-rw-r--r--include/linux/mfd/wm8350/rtc.h1
-rw-r--r--include/linux/mfd/wm8994/core.h54
-rw-r--r--include/linux/mfd/wm8994/gpio.h72
-rw-r--r--include/linux/mfd/wm8994/pdata.h97
-rw-r--r--include/linux/mfd/wm8994/registers.h4292
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/device.h1
-rw-r--r--include/linux/mm.h142
-rw-r--r--include/linux/mm_types.h49
-rw-r--r--include/linux/mmc/card.h7
-rw-r--r--include/linux/mmc/host.h5
-rw-r--r--include/linux/mmc/mmc.h1
-rw-r--r--include/linux/mmc/pm.h30
-rw-r--r--include/linux/mmc/sdio.h2
-rw-r--r--include/linux/mmc/sdio_func.h5
-rw-r--r--include/linux/mmdebug.h2
-rw-r--r--include/linux/mmzone.h25
-rw-r--r--include/linux/mnt_namespace.h1
-rw-r--r--include/linux/module.h44
-rw-r--r--include/linux/mount.h16
-rw-r--r--include/linux/msdos_fs.h3
-rw-r--r--include/linux/mtd/bbm.h35
-rw-r--r--include/linux/mtd/cfi.h9
-rw-r--r--include/linux/mtd/flashchip.h9
-rw-r--r--include/linux/mtd/nand.h97
-rw-r--r--include/linux/mtd/nand_ecc.h10
-rw-r--r--include/linux/mtd/onenand.h23
-rw-r--r--include/linux/mtd/onenand_regs.h2
-rw-r--r--include/linux/mtd/pismo.h17
-rw-r--r--include/linux/mtd/sh_flctl.h3
-rw-r--r--include/linux/namei.h2
-rw-r--r--include/linux/net.h4
-rw-r--r--include/linux/netdevice.h194
-rw-r--r--include/linux/netfilter.h63
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h22
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h19
-rw-r--r--include/linux/netfilter/nfnetlink.h8
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h2
-rw-r--r--include/linux/netfilter/x_tables.h70
-rw-r--r--include/linux/netfilter/xt_CT.h17
-rw-r--r--include/linux/netfilter_arp/arp_tables.h11
-rw-r--r--include/linux/netfilter_bridge/ebtables.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h18
-rw-r--r--include/linux/netfilter_ipv6.h1
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h17
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/netpoll.h11
-rw-r--r--include/linux/nfs_fs.h14
-rw-r--r--include/linux/nfs_fs_sb.h4
-rw-r--r--include/linux/nfs_xdr.h1
-rw-r--r--include/linux/nfsacl.h1
-rw-r--r--include/linux/nfsd/cache.h86
-rw-r--r--include/linux/nfsd/export.h19
-rw-r--r--include/linux/nfsd/nfsd.h424
-rw-r--r--include/linux/nfsd/nfsfh.h206
-rw-r--r--include/linux/nfsd/state.h404
-rw-r--r--include/linux/nfsd/syscall.h8
-rw-r--r--include/linux/nfsd/xdr.h177
-rw-r--r--include/linux/nfsd/xdr3.h346
-rw-r--r--include/linux/nfsd/xdr4.h563
-rw-r--r--include/linux/nilfs2_fs.h1
-rw-r--r--include/linux/nl80211.h145
-rw-r--r--include/linux/nodemask.h13
-rw-r--r--include/linux/of.h62
-rw-r--r--include/linux/of_fdt.h75
-rw-r--r--include/linux/omapfb.h9
-rw-r--r--include/linux/padata.h88
-rw-r--r--include/linux/page-flags.h6
-rw-r--r--include/linux/page_cgroup.h2
-rw-r--r--include/linux/pagemap.h2
-rw-r--r--include/linux/pci-acpi.h7
-rw-r--r--include/linux/pci-dma.h11
-rw-r--r--include/linux/pci.h226
-rw-r--r--include/linux/pci_hotplug.h41
-rw-r--r--include/linux/pci_ids.h7
-rw-r--r--include/linux/pci_regs.h1
-rw-r--r--include/linux/percpu-defs.h40
-rw-r--r--include/linux/percpu.h44
-rw-r--r--include/linux/percpu_counter.h11
-rw-r--r--include/linux/perf_counter.h444
-rw-r--r--include/linux/perf_event.h164
-rw-r--r--include/linux/pfkeyv2.h1
-rw-r--r--include/linux/phy.h3
-rw-r--r--include/linux/pktcdvd.h10
-rw-r--r--include/linux/platform_device.h9
-rw-r--r--include/linux/plist.h4
-rw-r--r--include/linux/pm.h57
-rw-r--r--include/linux/pm_runtime.h10
-rw-r--r--include/linux/pnp.h13
-rw-r--r--include/linux/poison.h16
-rw-r--r--include/linux/poll.h2
-rw-r--r--include/linux/power_supply.h1
-rw-r--r--include/linux/ptrace.h25
-rw-r--r--include/linux/pwm_backlight.h2
-rw-r--r--include/linux/quota.h38
-rw-r--r--include/linux/quotaops.h304
-rw-r--r--include/linux/raid_class.h1
-rw-r--r--include/linux/range.h30
-rw-r--r--include/linux/rbtree.h8
-rw-r--r--include/linux/rculist.h19
-rw-r--r--include/linux/rculist_nulls.h4
-rw-r--r--include/linux/rcupdate.h185
-rw-r--r--include/linux/rcutiny.h17
-rw-r--r--include/linux/rcutree.h15
-rw-r--r--include/linux/reboot.h1
-rw-r--r--include/linux/regulator/consumer.h6
-rw-r--r--include/linux/regulator/driver.h6
-rw-r--r--include/linux/regulator/fixed.h2
-rw-r--r--include/linux/regulator/machine.h6
-rw-r--r--include/linux/regulator/max8649.h44
-rw-r--r--include/linux/regulator/max8660.h57
-rw-r--r--include/linux/reiserfs_fs.h28
-rw-r--r--include/linux/reiserfs_xattr.h5
-rw-r--r--include/linux/resource.h8
-rw-r--r--include/linux/resume-trace.h7
-rw-r--r--include/linux/rfkill.h2
-rw-r--r--include/linux/rmap.h38
-rw-r--r--include/linux/rtc.h6
-rw-r--r--include/linux/rtmutex.h2
-rw-r--r--include/linux/rtnetlink.h11
-rw-r--r--include/linux/rwlock.h20
-rw-r--r--include/linux/sched.h150
-rw-r--r--include/linux/security.h21
-rw-r--r--include/linux/seq_file.h18
-rw-r--r--include/linux/serial_core.h11
-rw-r--r--include/linux/serial_sci.h10
-rw-r--r--include/linux/serio.h20
-rw-r--r--include/linux/sh_intc.h33
-rw-r--r--include/linux/shmem_fs.h16
-rw-r--r--include/linux/signal.h2
-rw-r--r--include/linux/skbuff.h25
-rw-r--r--include/linux/slab.h5
-rw-r--r--include/linux/slub_def.h27
-rw-r--r--include/linux/smp.h2
-rw-r--r--include/linux/snmp.h3
-rw-r--r--include/linux/socket.h1
-rw-r--r--include/linux/sonypi.h1
-rw-r--r--include/linux/spi/ad7879.h12
-rw-r--r--include/linux/spi/ads7846.h3
-rw-r--r--include/linux/spi/dw_spi.h217
-rw-r--r--include/linux/spi/l4f00242t03.h31
-rw-r--r--include/linux/spi/max7301.h18
-rw-r--r--include/linux/spinlock.h13
-rw-r--r--include/linux/srcu.h97
-rw-r--r--include/linux/stmmac.h53
-rw-r--r--include/linux/string.h5
-rw-r--r--include/linux/sunrpc/bc_xprt.h20
-rw-r--r--include/linux/sunrpc/debug.h3
-rw-r--r--include/linux/sunrpc/rpc_rdma.h2
-rw-r--r--include/linux/sunrpc/sched.h14
-rw-r--r--include/linux/sunrpc/svc.h7
-rw-r--r--include/linux/swap.h9
-rw-r--r--include/linux/syscalls.h51
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--include/linux/sysdev.h21
-rw-r--r--include/linux/sysfs.h70
-rw-r--r--include/linux/syslog.h52
-rw-r--r--include/linux/taskstats_kern.h7
-rw-r--r--include/linux/tcp.h7
-rw-r--r--include/linux/timex.h3
-rw-r--r--include/linux/topology.h2
-rw-r--r--include/linux/tracepoint.h2
-rw-r--r--include/linux/tty.h17
-rw-r--r--include/linux/tty_flip.h7
-rw-r--r--include/linux/tty_ldisc.h8
-rw-r--r--include/linux/uaccess.h4
-rw-r--r--include/linux/usb.h79
-rw-r--r--include/linux/usb/Kbuild1
-rw-r--r--include/linux/usb/atmel_usba_udc.h1
-rw-r--r--include/linux/usb/audio.h120
-rw-r--r--include/linux/usb/ch9.h2
-rw-r--r--include/linux/usb/musb.h26
-rw-r--r--include/linux/usb/otg.h35
-rw-r--r--include/linux/usb/quirks.h3
-rw-r--r--include/linux/usb/serial.h16
-rw-r--r--include/linux/usb/usbnet.h21
-rw-r--r--include/linux/usb/vstusb.h71
-rw-r--r--include/linux/vermagic.h2
-rw-r--r--include/linux/vga_switcheroo.h57
-rw-r--r--include/linux/vhost.h130
-rw-r--r--include/linux/videodev2.h2
-rw-r--r--include/linux/virtio.h5
-rw-r--r--include/linux/virtio_9p.h13
-rw-r--r--include/linux/virtio_balloon.h15
-rw-r--r--include/linux/virtio_blk.h13
-rw-r--r--include/linux/virtio_console.h30
-rw-r--r--include/linux/vmstat.h8
-rw-r--r--include/linux/vt.h4
-rw-r--r--include/linux/writeback.h4
-rw-r--r--include/linux/xattr.h13
-rw-r--r--include/linux/xfrm.h12
348 files changed, 11922 insertions, 5604 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index f72914db2a11..e2ea0b2159cd 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -43,6 +43,7 @@ header-y += blkpg.h
43header-y += bpqether.h 43header-y += bpqether.h
44header-y += bsg.h 44header-y += bsg.h
45header-y += can.h 45header-y += can.h
46header-y += cciss_defs.h
46header-y += cdk.h 47header-y += cdk.h
47header-y += chio.h 48header-y += chio.h
48header-y += coda_psdev.h 49header-y += coda_psdev.h
@@ -118,12 +119,14 @@ header-y += mtio.h
118header-y += ncp_no.h 119header-y += ncp_no.h
119header-y += neighbour.h 120header-y += neighbour.h
120header-y += net_dropmon.h 121header-y += net_dropmon.h
122header-y += net_tstamp.h
121header-y += netfilter_arp.h 123header-y += netfilter_arp.h
122header-y += netrom.h 124header-y += netrom.h
123header-y += nfs2.h 125header-y += nfs2.h
124header-y += nfs4_mount.h 126header-y += nfs4_mount.h
125header-y += nfs_mount.h 127header-y += nfs_mount.h
126header-y += nl80211.h 128header-y += nl80211.h
129header-y += omapfb.h
127header-y += param.h 130header-y += param.h
128header-y += pci_regs.h 131header-y += pci_regs.h
129header-y += perf_event.h 132header-y += perf_event.h
@@ -361,6 +364,7 @@ unifdef-y += uio.h
361unifdef-y += unistd.h 364unifdef-y += unistd.h
362unifdef-y += usbdevice_fs.h 365unifdef-y += usbdevice_fs.h
363unifdef-y += utsname.h 366unifdef-y += utsname.h
367unifdef-y += vhost.h
364unifdef-y += videodev2.h 368unifdef-y += videodev2.h
365unifdef-y += videodev.h 369unifdef-y += videodev.h
366unifdef-y += virtio_config.h 370unifdef-y += virtio_config.h
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 882dc7248766..3e4737fa6cce 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -121,16 +121,15 @@ struct vfsmount;
121struct super_block; 121struct super_block;
122struct pacct_struct; 122struct pacct_struct;
123struct pid_namespace; 123struct pid_namespace;
124extern int acct_parm[]; /* for sysctl */
124extern void acct_auto_close_mnt(struct vfsmount *m); 125extern void acct_auto_close_mnt(struct vfsmount *m);
125extern void acct_auto_close(struct super_block *sb); 126extern void acct_auto_close(struct super_block *sb);
126extern void acct_init_pacct(struct pacct_struct *pacct);
127extern void acct_collect(long exitcode, int group_dead); 127extern void acct_collect(long exitcode, int group_dead);
128extern void acct_process(void); 128extern void acct_process(void);
129extern void acct_exit_ns(struct pid_namespace *); 129extern void acct_exit_ns(struct pid_namespace *);
130#else 130#else
131#define acct_auto_close_mnt(x) do { } while (0) 131#define acct_auto_close_mnt(x) do { } while (0)
132#define acct_auto_close(x) do { } while (0) 132#define acct_auto_close(x) do { } while (0)
133#define acct_init_pacct(x) do { } while (0)
134#define acct_collect(x,y) do { } while (0) 133#define acct_collect(x,y) do { } while (0)
135#define acct_process() do { } while (0) 134#define acct_process() do { } while (0)
136#define acct_exit_ns(ns) do { } while (0) 135#define acct_exit_ns(ns) do { } while (0)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index dfcd920c3e54..b926afe8c03e 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -80,7 +80,7 @@ char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
80void __acpi_unmap_table(char *map, unsigned long size); 80void __acpi_unmap_table(char *map, unsigned long size);
81int early_acpi_boot_init(void); 81int early_acpi_boot_init(void);
82int acpi_boot_init (void); 82int acpi_boot_init (void);
83int acpi_boot_table_init (void); 83void acpi_boot_table_init (void);
84int acpi_mps_check (void); 84int acpi_mps_check (void);
85int acpi_numa_init (void); 85int acpi_numa_init (void);
86 86
@@ -240,7 +240,7 @@ extern int pnpacpi_disabled;
240#define PXM_INVAL (-1) 240#define PXM_INVAL (-1)
241#define NID_INVAL (-1) 241#define NID_INVAL (-1)
242 242
243int acpi_check_resource_conflict(struct resource *res); 243int acpi_check_resource_conflict(const struct resource *res);
244 244
245int acpi_check_region(resource_size_t start, resource_size_t n, 245int acpi_check_region(resource_size_t start, resource_size_t n,
246 const char *name); 246 const char *name);
@@ -251,12 +251,19 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n,
251void __init acpi_no_s4_hw_signature(void); 251void __init acpi_no_s4_hw_signature(void);
252void __init acpi_old_suspend_ordering(void); 252void __init acpi_old_suspend_ordering(void);
253void __init acpi_s4_no_nvs(void); 253void __init acpi_s4_no_nvs(void);
254void __init acpi_set_sci_en_on_resume(void);
254#endif /* CONFIG_PM_SLEEP */ 255#endif /* CONFIG_PM_SLEEP */
255 256
257struct acpi_osc_context {
258 char *uuid_str; /* uuid string */
259 int rev;
260 struct acpi_buffer cap; /* arg2/arg3 */
261 struct acpi_buffer ret; /* free by caller if success */
262};
263
256#define OSC_QUERY_TYPE 0 264#define OSC_QUERY_TYPE 0
257#define OSC_SUPPORT_TYPE 1 265#define OSC_SUPPORT_TYPE 1
258#define OSC_CONTROL_TYPE 2 266#define OSC_CONTROL_TYPE 2
259#define OSC_SUPPORT_MASKS 0x1f
260 267
261/* _OSC DW0 Definition */ 268/* _OSC DW0 Definition */
262#define OSC_QUERY_ENABLE 1 269#define OSC_QUERY_ENABLE 1
@@ -265,12 +272,23 @@ void __init acpi_s4_no_nvs(void);
265#define OSC_INVALID_REVISION_ERROR 8 272#define OSC_INVALID_REVISION_ERROR 8
266#define OSC_CAPABILITIES_MASK_ERROR 16 273#define OSC_CAPABILITIES_MASK_ERROR 16
267 274
275acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
276
277/* platform-wide _OSC bits */
278#define OSC_SB_PAD_SUPPORT 1
279#define OSC_SB_PPC_OST_SUPPORT 2
280#define OSC_SB_PR3_SUPPORT 4
281#define OSC_SB_CPUHP_OST_SUPPORT 8
282#define OSC_SB_APEI_SUPPORT 16
283
284/* PCI defined _OSC bits */
268/* _OSC DW1 Definition (OS Support Fields) */ 285/* _OSC DW1 Definition (OS Support Fields) */
269#define OSC_EXT_PCI_CONFIG_SUPPORT 1 286#define OSC_EXT_PCI_CONFIG_SUPPORT 1
270#define OSC_ACTIVE_STATE_PWR_SUPPORT 2 287#define OSC_ACTIVE_STATE_PWR_SUPPORT 2
271#define OSC_CLOCK_PWR_CAPABILITY_SUPPORT 4 288#define OSC_CLOCK_PWR_CAPABILITY_SUPPORT 4
272#define OSC_PCI_SEGMENT_GROUPS_SUPPORT 8 289#define OSC_PCI_SEGMENT_GROUPS_SUPPORT 8
273#define OSC_MSI_SUPPORT 16 290#define OSC_MSI_SUPPORT 16
291#define OSC_PCI_SUPPORT_MASKS 0x1f
274 292
275/* _OSC DW1 Definition (OS Control Fields) */ 293/* _OSC DW1 Definition (OS Control Fields) */
276#define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 1 294#define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 1
@@ -279,7 +297,7 @@ void __init acpi_s4_no_nvs(void);
279#define OSC_PCI_EXPRESS_AER_CONTROL 8 297#define OSC_PCI_EXPRESS_AER_CONTROL 8
280#define OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL 16 298#define OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL 16
281 299
282#define OSC_CONTROL_MASKS (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \ 300#define OSC_PCI_CONTROL_MASKS (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \
283 OSC_SHPC_NATIVE_HP_CONTROL | \ 301 OSC_SHPC_NATIVE_HP_CONTROL | \
284 OSC_PCI_EXPRESS_PME_CONTROL | \ 302 OSC_PCI_EXPRESS_PME_CONTROL | \
285 OSC_PCI_EXPRESS_AER_CONTROL | \ 303 OSC_PCI_EXPRESS_AER_CONTROL | \
@@ -303,9 +321,9 @@ static inline int acpi_boot_init(void)
303 return 0; 321 return 0;
304} 322}
305 323
306static inline int acpi_boot_table_init(void) 324static inline void acpi_boot_table_init(void)
307{ 325{
308 return 0; 326 return;
309} 327}
310 328
311static inline int acpi_mps_check(void) 329static inline int acpi_mps_check(void)
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index ab94335b4bb9..6816be6c3f77 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -1,5 +1,9 @@
1/* 1/*
2 * linux/include/asm-arm/hardware/amba.h 2 * linux/include/amba/bus.h
3 *
4 * This device type deals with ARM PrimeCells and anything else that
5 * presents a proper CID (0xB105F00D) at the end of the I/O register
6 * region or that is derived from a PrimeCell.
3 * 7 *
4 * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. 8 * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved.
5 * 9 *
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h
index 29c0448265cf..ca16c3801a1e 100644
--- a/include/linux/amba/clcd.h
+++ b/include/linux/amba/clcd.h
@@ -21,22 +21,21 @@
21#define CLCD_UBAS 0x00000010 21#define CLCD_UBAS 0x00000010
22#define CLCD_LBAS 0x00000014 22#define CLCD_LBAS 0x00000014
23 23
24#if !defined(CONFIG_ARCH_VERSATILE) && !defined(CONFIG_ARCH_REALVIEW) 24#define CLCD_PL110_IENB 0x00000018
25#define CLCD_IENB 0x00000018 25#define CLCD_PL110_CNTL 0x0000001c
26#define CLCD_CNTL 0x0000001c 26#define CLCD_PL110_STAT 0x00000020
27#else 27#define CLCD_PL110_INTR 0x00000024
28/* 28#define CLCD_PL110_UCUR 0x00000028
29 * Someone rearranged these two registers on the Versatile 29#define CLCD_PL110_LCUR 0x0000002C
30 * platform... 30
31 */ 31#define CLCD_PL111_CNTL 0x00000018
32#define CLCD_IENB 0x0000001c 32#define CLCD_PL111_IENB 0x0000001c
33#define CLCD_CNTL 0x00000018 33#define CLCD_PL111_RIS 0x00000020
34#endif 34#define CLCD_PL111_MIS 0x00000024
35 35#define CLCD_PL111_ICR 0x00000028
36#define CLCD_STAT 0x00000020 36#define CLCD_PL111_UCUR 0x0000002c
37#define CLCD_INTR 0x00000024 37#define CLCD_PL111_LCUR 0x00000030
38#define CLCD_UCUR 0x00000028 38
39#define CLCD_LCUR 0x0000002C
40#define CLCD_PALL 0x00000200 39#define CLCD_PALL 0x00000200
41#define CLCD_PALETTE 0x00000200 40#define CLCD_PALETTE 0x00000200
42 41
@@ -147,6 +146,8 @@ struct clcd_fb {
147 struct clcd_board *board; 146 struct clcd_board *board;
148 void *board_data; 147 void *board_data;
149 void __iomem *regs; 148 void __iomem *regs;
149 u16 off_ienb;
150 u16 off_cntl;
150 u32 clcd_cntl; 151 u32 clcd_cntl;
151 u32 cmap[16]; 152 u32 cmap[16];
152}; 153};
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 38a6948ce0c2..b4c85e2adef5 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -647,9 +647,9 @@ static inline int ata_id_has_large_logical_sectors(const u16 *id)
647 return id[ATA_ID_SECTOR_SIZE] & (1 << 13); 647 return id[ATA_ID_SECTOR_SIZE] & (1 << 13);
648} 648}
649 649
650static inline u8 ata_id_logical_per_physical_sectors(const u16 *id) 650static inline u16 ata_id_logical_per_physical_sectors(const u16 *id)
651{ 651{
652 return id[ATA_ID_SECTOR_SIZE] & 0xf; 652 return 1 << (id[ATA_ID_SECTOR_SIZE] & 0xf);
653} 653}
654 654
655static inline int ata_id_has_lba48(const u16 *id) 655static inline int ata_id_has_lba48(const u16 *id)
@@ -841,7 +841,8 @@ static inline int ata_id_current_chs_valid(const u16 *id)
841 841
842static inline int ata_id_is_cfa(const u16 *id) 842static inline int ata_id_is_cfa(const u16 *id)
843{ 843{
844 if (id[ATA_ID_CONFIG] == 0x848A) /* Traditional CF */ 844 if ((id[ATA_ID_CONFIG] == 0x848A) || /* Traditional CF */
845 (id[ATA_ID_CONFIG] == 0x844A)) /* Delkin Devices CF */
845 return 1; 846 return 1;
846 /* 847 /*
847 * CF specs don't require specific value in the word 0 anymore and yet 848 * CF specs don't require specific value in the word 0 anymore and yet
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 3c7a358241a7..f391d45c8aea 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -424,7 +424,7 @@ extern void audit_syscall_exit(int failed, long return_code);
424extern void __audit_getname(const char *name); 424extern void __audit_getname(const char *name);
425extern void audit_putname(const char *name); 425extern void audit_putname(const char *name);
426extern void __audit_inode(const char *name, const struct dentry *dentry); 426extern void __audit_inode(const char *name, const struct dentry *dentry);
427extern void __audit_inode_child(const char *dname, const struct dentry *dentry, 427extern void __audit_inode_child(const struct dentry *dentry,
428 const struct inode *parent); 428 const struct inode *parent);
429extern void __audit_ptrace(struct task_struct *t); 429extern void __audit_ptrace(struct task_struct *t);
430 430
@@ -442,11 +442,10 @@ static inline void audit_inode(const char *name, const struct dentry *dentry) {
442 if (unlikely(!audit_dummy_context())) 442 if (unlikely(!audit_dummy_context()))
443 __audit_inode(name, dentry); 443 __audit_inode(name, dentry);
444} 444}
445static inline void audit_inode_child(const char *dname, 445static inline void audit_inode_child(const struct dentry *dentry,
446 const struct dentry *dentry,
447 const struct inode *parent) { 446 const struct inode *parent) {
448 if (unlikely(!audit_dummy_context())) 447 if (unlikely(!audit_dummy_context()))
449 __audit_inode_child(dname, dentry, parent); 448 __audit_inode_child(dentry, parent);
450} 449}
451void audit_core_dumps(long signr); 450void audit_core_dumps(long signr);
452 451
@@ -544,9 +543,9 @@ extern int audit_signals;
544#define audit_getname(n) do { ; } while (0) 543#define audit_getname(n) do { ; } while (0)
545#define audit_putname(n) do { ; } while (0) 544#define audit_putname(n) do { ; } while (0)
546#define __audit_inode(n,d) do { ; } while (0) 545#define __audit_inode(n,d) do { ; } while (0)
547#define __audit_inode_child(d,i,p) do { ; } while (0) 546#define __audit_inode_child(i,p) do { ; } while (0)
548#define audit_inode(n,d) do { ; } while (0) 547#define audit_inode(n,d) do { ; } while (0)
549#define audit_inode_child(d,i,p) do { ; } while (0) 548#define audit_inode_child(i,p) do { ; } while (0)
550#define audit_core_dumps(i) do { ; } while (0) 549#define audit_core_dumps(i) do { ; } while (0)
551#define auditsc_get_stamp(c,t,s) (0) 550#define auditsc_get_stamp(c,t,s) (0)
552#define audit_get_loginuid(t) (-1) 551#define audit_get_loginuid(t) (-1)
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 0f5f57858a23..4a3d52e545e1 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -47,7 +47,7 @@ struct backlight_ops {
47 int (*get_brightness)(struct backlight_device *); 47 int (*get_brightness)(struct backlight_device *);
48 /* Check if given framebuffer device is the one bound to this backlight; 48 /* Check if given framebuffer device is the one bound to this backlight;
49 return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ 49 return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */
50 int (*check_fb)(struct fb_info *); 50 int (*check_fb)(struct backlight_device *, struct fb_info *);
51}; 51};
52 52
53/* This structure defines all the properties of a backlight */ 53/* This structure defines all the properties of a backlight */
@@ -86,7 +86,7 @@ struct backlight_device {
86 registered this device has been unloaded, and if class_get_devdata() 86 registered this device has been unloaded, and if class_get_devdata()
87 points to something in the body of that driver, it is also invalid. */ 87 points to something in the body of that driver, it is also invalid. */
88 struct mutex ops_lock; 88 struct mutex ops_lock;
89 struct backlight_ops *ops; 89 const struct backlight_ops *ops;
90 90
91 /* The framebuffer notifier block */ 91 /* The framebuffer notifier block */
92 struct notifier_block fb_notif; 92 struct notifier_block fb_notif;
@@ -103,7 +103,8 @@ static inline void backlight_update_status(struct backlight_device *bd)
103} 103}
104 104
105extern struct backlight_device *backlight_device_register(const char *name, 105extern struct backlight_device *backlight_device_register(const char *name,
106 struct device *dev, void *devdata, struct backlight_ops *ops); 106 struct device *dev, void *devdata, const struct backlight_ops *ops,
107 const struct backlight_properties *props);
107extern void backlight_device_unregister(struct backlight_device *bd); 108extern void backlight_device_unregister(struct backlight_device *bd);
108extern void backlight_force_update(struct backlight_device *bd, 109extern void backlight_force_update(struct backlight_device *bd,
109 enum backlight_update_reason reason); 110 enum backlight_update_reason reason);
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index aece486ac734..c809e286d213 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -68,6 +68,15 @@ struct linux_binprm{
68 68
69#define BINPRM_MAX_RECURSION 4 69#define BINPRM_MAX_RECURSION 4
70 70
71/* Function parameter for binfmt->coredump */
72struct coredump_params {
73 long signr;
74 struct pt_regs *regs;
75 struct file *file;
76 unsigned long limit;
77 unsigned long mm_flags;
78};
79
71/* 80/*
72 * This structure defines the functions that are used to load the binary formats that 81 * This structure defines the functions that are used to load the binary formats that
73 * linux accepts. 82 * linux accepts.
@@ -77,7 +86,7 @@ struct linux_binfmt {
77 struct module *module; 86 struct module *module;
78 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); 87 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
79 int (*load_shlib)(struct file *); 88 int (*load_shlib)(struct file *);
80 int (*core_dump)(long signr, struct pt_regs *regs, struct file *file, unsigned long limit); 89 int (*core_dump)(struct coredump_params *cprm);
81 unsigned long min_coredump; /* minimal dump size */ 90 unsigned long min_coredump; /* minimal dump size */
82 int hasvdso; 91 int hasvdso;
83}; 92};
@@ -101,6 +110,7 @@ extern int prepare_binprm(struct linux_binprm *);
101extern int __must_check remove_arg_zero(struct linux_binprm *); 110extern int __must_check remove_arg_zero(struct linux_binprm *);
102extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); 111extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
103extern int flush_old_exec(struct linux_binprm * bprm); 112extern int flush_old_exec(struct linux_binprm * bprm);
113extern void setup_new_exec(struct linux_binprm * bprm);
104 114
105extern int suid_dumpable; 115extern int suid_dumpable;
106#define SUID_DUMP_DISABLE 0 /* No setuid dumping */ 116#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index c05a29cb9bb2..b79389879238 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -16,16 +16,18 @@
16 */ 16 */
17#include <asm/bitops.h> 17#include <asm/bitops.h>
18 18
19#define for_each_bit(bit, addr, size) \ 19#define for_each_set_bit(bit, addr, size) \
20 for ((bit) = find_first_bit((addr), (size)); \ 20 for ((bit) = find_first_bit((addr), (size)); \
21 (bit) < (size); \ 21 (bit) < (size); \
22 (bit) = find_next_bit((addr), (size), (bit) + 1)) 22 (bit) = find_next_bit((addr), (size), (bit) + 1))
23 23
24/* Temporary */
25#define for_each_bit(bit, addr, size) for_each_set_bit(bit, addr, size)
24 26
25static __inline__ int get_bitmask_order(unsigned int count) 27static __inline__ int get_bitmask_order(unsigned int count)
26{ 28{
27 int order; 29 int order;
28 30
29 order = fls(count); 31 order = fls(count);
30 return order; /* We could be slightly more clever with -1 here... */ 32 return order; /* We could be slightly more clever with -1 here... */
31} 33}
@@ -33,7 +35,7 @@ static __inline__ int get_bitmask_order(unsigned int count)
33static __inline__ int get_count_order(unsigned int count) 35static __inline__ int get_count_order(unsigned int count)
34{ 36{
35 int order; 37 int order;
36 38
37 order = fls(count) - 1; 39 order = fls(count) - 1;
38 if (count & (count - 1)) 40 if (count & (count - 1))
39 order++; 41 order++;
@@ -45,6 +47,31 @@ static inline unsigned long hweight_long(unsigned long w)
45 return sizeof(w) == 4 ? hweight32(w) : hweight64(w); 47 return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
46} 48}
47 49
50/*
51 * Clearly slow versions of the hweightN() functions, their benefit is
52 * of course compile time evaluation of constant arguments.
53 */
54#define HWEIGHT8(w) \
55 ( BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + \
56 (!!((w) & (1ULL << 0))) + \
57 (!!((w) & (1ULL << 1))) + \
58 (!!((w) & (1ULL << 2))) + \
59 (!!((w) & (1ULL << 3))) + \
60 (!!((w) & (1ULL << 4))) + \
61 (!!((w) & (1ULL << 5))) + \
62 (!!((w) & (1ULL << 6))) + \
63 (!!((w) & (1ULL << 7))) )
64
65#define HWEIGHT16(w) (HWEIGHT8(w) + HWEIGHT8((w) >> 8))
66#define HWEIGHT32(w) (HWEIGHT16(w) + HWEIGHT16((w) >> 16))
67#define HWEIGHT64(w) (HWEIGHT32(w) + HWEIGHT32((w) >> 32))
68
69/*
70 * Type invariant version that simply casts things to the
71 * largest type.
72 */
73#define HWEIGHT(w) HWEIGHT64((u64)(w))
74
48/** 75/**
49 * rol32 - rotate a 32-bit value left 76 * rol32 - rotate a 32-bit value left
50 * @word: value to rotate 77 * @word: value to rotate
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 784a919aa0d0..ebd22dbed861 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -316,8 +316,7 @@ struct queue_limits {
316 unsigned int discard_alignment; 316 unsigned int discard_alignment;
317 317
318 unsigned short logical_block_size; 318 unsigned short logical_block_size;
319 unsigned short max_hw_segments; 319 unsigned short max_segments;
320 unsigned short max_phys_segments;
321 320
322 unsigned char misaligned; 321 unsigned char misaligned;
323 unsigned char discard_misaligned; 322 unsigned char discard_misaligned;
@@ -461,8 +460,8 @@ struct request_queue
461#define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ 460#define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */
462#define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ 461#define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */
463#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ 462#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */
464#define QUEUE_FLAG_CQ 16 /* hardware does queuing */ 463#define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */
465#define QUEUE_FLAG_DISCARD 17 /* supports DISCARD */ 464#define QUEUE_FLAG_NOXMERGES 17 /* No extended merges */
466 465
467#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ 466#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
468 (1 << QUEUE_FLAG_CLUSTER) | \ 467 (1 << QUEUE_FLAG_CLUSTER) | \
@@ -586,9 +585,10 @@ enum {
586 585
587#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) 586#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
588#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) 587#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
589#define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags)
590#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 588#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
591#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) 589#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
590#define blk_queue_noxmerges(q) \
591 test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags)
592#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) 592#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags)
593#define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) 593#define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
594#define blk_queue_flushing(q) ((q)->ordseq) 594#define blk_queue_flushing(q) ((q)->ordseq)
@@ -845,7 +845,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev)
845 * blk_rq_err_bytes() : bytes left till the next error boundary 845 * blk_rq_err_bytes() : bytes left till the next error boundary
846 * blk_rq_sectors() : sectors left in the entire request 846 * blk_rq_sectors() : sectors left in the entire request
847 * blk_rq_cur_sectors() : sectors left in the current segment 847 * blk_rq_cur_sectors() : sectors left in the current segment
848 * blk_rq_err_sectors() : sectors left till the next error boundary
849 */ 848 */
850static inline sector_t blk_rq_pos(const struct request *rq) 849static inline sector_t blk_rq_pos(const struct request *rq)
851{ 850{
@@ -874,11 +873,6 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
874 return blk_rq_cur_bytes(rq) >> 9; 873 return blk_rq_cur_bytes(rq) >> 9;
875} 874}
876 875
877static inline unsigned int blk_rq_err_sectors(const struct request *rq)
878{
879 return blk_rq_err_bytes(rq) >> 9;
880}
881
882/* 876/*
883 * Request issue related functions. 877 * Request issue related functions.
884 */ 878 */
@@ -926,10 +920,27 @@ extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
926extern void blk_cleanup_queue(struct request_queue *); 920extern void blk_cleanup_queue(struct request_queue *);
927extern void blk_queue_make_request(struct request_queue *, make_request_fn *); 921extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
928extern void blk_queue_bounce_limit(struct request_queue *, u64); 922extern void blk_queue_bounce_limit(struct request_queue *, u64);
929extern void blk_queue_max_sectors(struct request_queue *, unsigned int);
930extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); 923extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int);
931extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short); 924
932extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short); 925/* Temporary compatibility wrapper */
926static inline void blk_queue_max_sectors(struct request_queue *q, unsigned int max)
927{
928 blk_queue_max_hw_sectors(q, max);
929}
930
931extern void blk_queue_max_segments(struct request_queue *, unsigned short);
932
933static inline void blk_queue_max_phys_segments(struct request_queue *q, unsigned short max)
934{
935 blk_queue_max_segments(q, max);
936}
937
938static inline void blk_queue_max_hw_segments(struct request_queue *q, unsigned short max)
939{
940 blk_queue_max_segments(q, max);
941}
942
943
933extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); 944extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
934extern void blk_queue_max_discard_sectors(struct request_queue *q, 945extern void blk_queue_max_discard_sectors(struct request_queue *q,
935 unsigned int max_discard_sectors); 946 unsigned int max_discard_sectors);
@@ -944,6 +955,8 @@ extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
944extern void blk_set_default_limits(struct queue_limits *lim); 955extern void blk_set_default_limits(struct queue_limits *lim);
945extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, 956extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
946 sector_t offset); 957 sector_t offset);
958extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev,
959 sector_t offset);
947extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, 960extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
948 sector_t offset); 961 sector_t offset);
949extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); 962extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
@@ -1020,11 +1033,15 @@ extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
1020#define MAX_PHYS_SEGMENTS 128 1033#define MAX_PHYS_SEGMENTS 128
1021#define MAX_HW_SEGMENTS 128 1034#define MAX_HW_SEGMENTS 128
1022#define SAFE_MAX_SECTORS 255 1035#define SAFE_MAX_SECTORS 255
1023#define BLK_DEF_MAX_SECTORS 1024
1024
1025#define MAX_SEGMENT_SIZE 65536 1036#define MAX_SEGMENT_SIZE 65536
1026 1037
1027#define BLK_SEG_BOUNDARY_MASK 0xFFFFFFFFUL 1038enum blk_default_limits {
1039 BLK_MAX_SEGMENTS = 128,
1040 BLK_SAFE_MAX_SECTORS = 255,
1041 BLK_DEF_MAX_SECTORS = 1024,
1042 BLK_MAX_SEGMENT_SIZE = 65536,
1043 BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL,
1044};
1028 1045
1029#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) 1046#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
1030 1047
@@ -1048,14 +1065,9 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
1048 return q->limits.max_hw_sectors; 1065 return q->limits.max_hw_sectors;
1049} 1066}
1050 1067
1051static inline unsigned short queue_max_hw_segments(struct request_queue *q) 1068static inline unsigned short queue_max_segments(struct request_queue *q)
1052{ 1069{
1053 return q->limits.max_hw_segments; 1070 return q->limits.max_segments;
1054}
1055
1056static inline unsigned short queue_max_phys_segments(struct request_queue *q)
1057{
1058 return q->limits.max_phys_segments;
1059} 1071}
1060 1072
1061static inline unsigned int queue_max_segment_size(struct request_queue *q) 1073static inline unsigned int queue_max_segment_size(struct request_queue *q)
@@ -1116,11 +1128,13 @@ static inline int queue_alignment_offset(struct request_queue *q)
1116 return q->limits.alignment_offset; 1128 return q->limits.alignment_offset;
1117} 1129}
1118 1130
1119static inline int queue_sector_alignment_offset(struct request_queue *q, 1131static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
1120 sector_t sector)
1121{ 1132{
1122 return ((sector << 9) - q->limits.alignment_offset) 1133 unsigned int granularity = max(lim->physical_block_size, lim->io_min);
1123 & (q->limits.io_min - 1); 1134 unsigned int alignment = (sector << 9) & (granularity - 1);
1135
1136 return (granularity + lim->alignment_offset - alignment)
1137 & (granularity - 1);
1124} 1138}
1125 1139
1126static inline int bdev_alignment_offset(struct block_device *bdev) 1140static inline int bdev_alignment_offset(struct block_device *bdev)
@@ -1144,11 +1158,12 @@ static inline int queue_discard_alignment(struct request_queue *q)
1144 return q->limits.discard_alignment; 1158 return q->limits.discard_alignment;
1145} 1159}
1146 1160
1147static inline int queue_sector_discard_alignment(struct request_queue *q, 1161static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
1148 sector_t sector)
1149{ 1162{
1150 return ((sector << 9) - q->limits.discard_alignment) 1163 unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1);
1151 & (q->limits.discard_granularity - 1); 1164
1165 return (lim->discard_granularity + lim->discard_alignment - alignment)
1166 & (lim->discard_granularity - 1);
1152} 1167}
1153 1168
1154static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) 1169static inline unsigned int queue_discard_zeroes_data(struct request_queue *q)
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 3b73b9992b26..416bf62d6d46 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -150,8 +150,8 @@ struct blk_user_trace_setup {
150struct blk_trace { 150struct blk_trace {
151 int trace_state; 151 int trace_state;
152 struct rchan *rchan; 152 struct rchan *rchan;
153 unsigned long *sequence; 153 unsigned long __percpu *sequence;
154 unsigned char *msg_data; 154 unsigned char __percpu *msg_data;
155 u16 act_mask; 155 u16 act_mask;
156 u64 start_lba; 156 u64 start_lba;
157 u64 end_lba; 157 u64 end_lba;
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index b10ec49ee2dd..266ab9291232 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -23,6 +23,7 @@ extern unsigned long max_pfn;
23extern unsigned long saved_max_pfn; 23extern unsigned long saved_max_pfn;
24#endif 24#endif
25 25
26#ifndef CONFIG_NO_BOOTMEM
26/* 27/*
27 * node_bootmem_map is a map pointer - the bits represent all physical 28 * node_bootmem_map is a map pointer - the bits represent all physical
28 * memory pages (including holes) on the node. 29 * memory pages (including holes) on the node.
@@ -37,6 +38,7 @@ typedef struct bootmem_data {
37} bootmem_data_t; 38} bootmem_data_t;
38 39
39extern bootmem_data_t bootmem_node_data[]; 40extern bootmem_data_t bootmem_node_data[];
41#endif
40 42
41extern unsigned long bootmem_bootmap_pages(unsigned long); 43extern unsigned long bootmem_bootmap_pages(unsigned long);
42 44
@@ -46,6 +48,7 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
46 unsigned long endpfn); 48 unsigned long endpfn);
47extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); 49extern unsigned long init_bootmem(unsigned long addr, unsigned long memend);
48 50
51unsigned long free_all_memory_core_early(int nodeid);
49extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); 52extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);
50extern unsigned long free_all_bootmem(void); 53extern unsigned long free_all_bootmem(void);
51 54
@@ -84,6 +87,10 @@ extern void *__alloc_bootmem_node(pg_data_t *pgdat,
84 unsigned long size, 87 unsigned long size,
85 unsigned long align, 88 unsigned long align,
86 unsigned long goal); 89 unsigned long goal);
90void *__alloc_bootmem_node_high(pg_data_t *pgdat,
91 unsigned long size,
92 unsigned long align,
93 unsigned long goal);
87extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat, 94extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat,
88 unsigned long size, 95 unsigned long size,
89 unsigned long align, 96 unsigned long align,
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 2b31b91f5871..7f437ca1ed44 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -1,3 +1,14 @@
1#define PHY_ID_BCM50610 0x0143bd60
2#define PHY_ID_BCM50610M 0x0143bd70
3#define PHY_ID_BCMAC131 0x0143bc70
4#define PHY_ID_BCM57780 0x03625d90
5
6#define PHY_BCM_OUI_MASK 0xfffffc00
7#define PHY_BCM_OUI_1 0x00206000
8#define PHY_BCM_OUI_2 0x0143bc00
9#define PHY_BCM_OUI_3 0x03625c00
10
11
1#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001 12#define PHY_BCM_FLAGS_MODE_COPPER 0x00000001
2#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002 13#define PHY_BCM_FLAGS_MODE_1000BX 0x00000002
3#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010 14#define PHY_BCM_FLAGS_INTF_SGMII 0x00000010
diff --git a/include/linux/btree-128.h b/include/linux/btree-128.h
new file mode 100644
index 000000000000..0b3414c4c928
--- /dev/null
+++ b/include/linux/btree-128.h
@@ -0,0 +1,109 @@
1extern struct btree_geo btree_geo128;
2
3struct btree_head128 { struct btree_head h; };
4
5static inline void btree_init_mempool128(struct btree_head128 *head,
6 mempool_t *mempool)
7{
8 btree_init_mempool(&head->h, mempool);
9}
10
11static inline int btree_init128(struct btree_head128 *head)
12{
13 return btree_init(&head->h);
14}
15
16static inline void btree_destroy128(struct btree_head128 *head)
17{
18 btree_destroy(&head->h);
19}
20
21static inline void *btree_lookup128(struct btree_head128 *head, u64 k1, u64 k2)
22{
23 u64 key[2] = {k1, k2};
24 return btree_lookup(&head->h, &btree_geo128, (unsigned long *)&key);
25}
26
27static inline void *btree_get_prev128(struct btree_head128 *head,
28 u64 *k1, u64 *k2)
29{
30 u64 key[2] = {*k1, *k2};
31 void *val;
32
33 val = btree_get_prev(&head->h, &btree_geo128,
34 (unsigned long *)&key);
35 *k1 = key[0];
36 *k2 = key[1];
37 return val;
38}
39
40static inline int btree_insert128(struct btree_head128 *head, u64 k1, u64 k2,
41 void *val, gfp_t gfp)
42{
43 u64 key[2] = {k1, k2};
44 return btree_insert(&head->h, &btree_geo128,
45 (unsigned long *)&key, val, gfp);
46}
47
48static inline int btree_update128(struct btree_head128 *head, u64 k1, u64 k2,
49 void *val)
50{
51 u64 key[2] = {k1, k2};
52 return btree_update(&head->h, &btree_geo128,
53 (unsigned long *)&key, val);
54}
55
56static inline void *btree_remove128(struct btree_head128 *head, u64 k1, u64 k2)
57{
58 u64 key[2] = {k1, k2};
59 return btree_remove(&head->h, &btree_geo128, (unsigned long *)&key);
60}
61
62static inline void *btree_last128(struct btree_head128 *head, u64 *k1, u64 *k2)
63{
64 u64 key[2];
65 void *val;
66
67 val = btree_last(&head->h, &btree_geo128, (unsigned long *)&key[0]);
68 if (val) {
69 *k1 = key[0];
70 *k2 = key[1];
71 }
72
73 return val;
74}
75
76static inline int btree_merge128(struct btree_head128 *target,
77 struct btree_head128 *victim,
78 gfp_t gfp)
79{
80 return btree_merge(&target->h, &victim->h, &btree_geo128, gfp);
81}
82
83void visitor128(void *elem, unsigned long opaque, unsigned long *__key,
84 size_t index, void *__func);
85
86typedef void (*visitor128_t)(void *elem, unsigned long opaque,
87 u64 key1, u64 key2, size_t index);
88
89static inline size_t btree_visitor128(struct btree_head128 *head,
90 unsigned long opaque,
91 visitor128_t func2)
92{
93 return btree_visitor(&head->h, &btree_geo128, opaque,
94 visitor128, func2);
95}
96
97static inline size_t btree_grim_visitor128(struct btree_head128 *head,
98 unsigned long opaque,
99 visitor128_t func2)
100{
101 return btree_grim_visitor(&head->h, &btree_geo128, opaque,
102 visitor128, func2);
103}
104
105#define btree_for_each_safe128(head, k1, k2, val) \
106 for (val = btree_last128(head, &k1, &k2); \
107 val; \
108 val = btree_get_prev128(head, &k1, &k2))
109
diff --git a/include/linux/btree-type.h b/include/linux/btree-type.h
new file mode 100644
index 000000000000..9a1147ef8563
--- /dev/null
+++ b/include/linux/btree-type.h
@@ -0,0 +1,147 @@
1#define __BTREE_TP(pfx, type, sfx) pfx ## type ## sfx
2#define _BTREE_TP(pfx, type, sfx) __BTREE_TP(pfx, type, sfx)
3#define BTREE_TP(pfx) _BTREE_TP(pfx, BTREE_TYPE_SUFFIX,)
4#define BTREE_FN(name) BTREE_TP(btree_ ## name)
5#define BTREE_TYPE_HEAD BTREE_TP(struct btree_head)
6#define VISITOR_FN BTREE_TP(visitor)
7#define VISITOR_FN_T _BTREE_TP(visitor, BTREE_TYPE_SUFFIX, _t)
8
9BTREE_TYPE_HEAD {
10 struct btree_head h;
11};
12
13static inline void BTREE_FN(init_mempool)(BTREE_TYPE_HEAD *head,
14 mempool_t *mempool)
15{
16 btree_init_mempool(&head->h, mempool);
17}
18
19static inline int BTREE_FN(init)(BTREE_TYPE_HEAD *head)
20{
21 return btree_init(&head->h);
22}
23
24static inline void BTREE_FN(destroy)(BTREE_TYPE_HEAD *head)
25{
26 btree_destroy(&head->h);
27}
28
29static inline int BTREE_FN(merge)(BTREE_TYPE_HEAD *target,
30 BTREE_TYPE_HEAD *victim,
31 gfp_t gfp)
32{
33 return btree_merge(&target->h, &victim->h, BTREE_TYPE_GEO, gfp);
34}
35
36#if (BITS_PER_LONG > BTREE_TYPE_BITS)
37static inline void *BTREE_FN(lookup)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
38{
39 unsigned long _key = key;
40 return btree_lookup(&head->h, BTREE_TYPE_GEO, &_key);
41}
42
43static inline int BTREE_FN(insert)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
44 void *val, gfp_t gfp)
45{
46 unsigned long _key = key;
47 return btree_insert(&head->h, BTREE_TYPE_GEO, &_key, val, gfp);
48}
49
50static inline int BTREE_FN(update)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
51 void *val)
52{
53 unsigned long _key = key;
54 return btree_update(&head->h, BTREE_TYPE_GEO, &_key, val);
55}
56
57static inline void *BTREE_FN(remove)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
58{
59 unsigned long _key = key;
60 return btree_remove(&head->h, BTREE_TYPE_GEO, &_key);
61}
62
63static inline void *BTREE_FN(last)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
64{
65 unsigned long _key;
66 void *val = btree_last(&head->h, BTREE_TYPE_GEO, &_key);
67 if (val)
68 *key = _key;
69 return val;
70}
71
72static inline void *BTREE_FN(get_prev)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
73{
74 unsigned long _key = *key;
75 void *val = btree_get_prev(&head->h, BTREE_TYPE_GEO, &_key);
76 if (val)
77 *key = _key;
78 return val;
79}
80#else
81static inline void *BTREE_FN(lookup)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
82{
83 return btree_lookup(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key);
84}
85
86static inline int BTREE_FN(insert)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
87 void *val, gfp_t gfp)
88{
89 return btree_insert(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key,
90 val, gfp);
91}
92
93static inline int BTREE_FN(update)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key,
94 void *val)
95{
96 return btree_update(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key, val);
97}
98
99static inline void *BTREE_FN(remove)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE key)
100{
101 return btree_remove(&head->h, BTREE_TYPE_GEO, (unsigned long *)&key);
102}
103
104static inline void *BTREE_FN(last)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
105{
106 return btree_last(&head->h, BTREE_TYPE_GEO, (unsigned long *)key);
107}
108
109static inline void *BTREE_FN(get_prev)(BTREE_TYPE_HEAD *head, BTREE_KEYTYPE *key)
110{
111 return btree_get_prev(&head->h, BTREE_TYPE_GEO, (unsigned long *)key);
112}
113#endif
114
115void VISITOR_FN(void *elem, unsigned long opaque, unsigned long *key,
116 size_t index, void *__func);
117
118typedef void (*VISITOR_FN_T)(void *elem, unsigned long opaque,
119 BTREE_KEYTYPE key, size_t index);
120
121static inline size_t BTREE_FN(visitor)(BTREE_TYPE_HEAD *head,
122 unsigned long opaque,
123 VISITOR_FN_T func2)
124{
125 return btree_visitor(&head->h, BTREE_TYPE_GEO, opaque,
126 visitorl, func2);
127}
128
129static inline size_t BTREE_FN(grim_visitor)(BTREE_TYPE_HEAD *head,
130 unsigned long opaque,
131 VISITOR_FN_T func2)
132{
133 return btree_grim_visitor(&head->h, BTREE_TYPE_GEO, opaque,
134 visitorl, func2);
135}
136
137#undef VISITOR_FN
138#undef VISITOR_FN_T
139#undef __BTREE_TP
140#undef _BTREE_TP
141#undef BTREE_TP
142#undef BTREE_FN
143#undef BTREE_TYPE_HEAD
144#undef BTREE_TYPE_SUFFIX
145#undef BTREE_TYPE_GEO
146#undef BTREE_KEYTYPE
147#undef BTREE_TYPE_BITS
diff --git a/include/linux/btree.h b/include/linux/btree.h
new file mode 100644
index 000000000000..65b5bb058324
--- /dev/null
+++ b/include/linux/btree.h
@@ -0,0 +1,243 @@
1#ifndef BTREE_H
2#define BTREE_H
3
4#include <linux/kernel.h>
5#include <linux/mempool.h>
6
7/**
8 * DOC: B+Tree basics
9 *
10 * A B+Tree is a data structure for looking up arbitrary (currently allowing
11 * unsigned long, u32, u64 and 2 * u64) keys into pointers. The data structure
12 * is described at http://en.wikipedia.org/wiki/B-tree, we currently do not
13 * use binary search to find the key on lookups.
14 *
15 * Each B+Tree consists of a head, that contains bookkeeping information and
16 * a variable number (starting with zero) nodes. Each node contains the keys
17 * and pointers to sub-nodes, or, for leaf nodes, the keys and values for the
18 * tree entries.
19 *
20 * Each node in this implementation has the following layout:
21 * [key1, key2, ..., keyN] [val1, val2, ..., valN]
22 *
23 * Each key here is an array of unsigned longs, geo->no_longs in total. The
24 * number of keys and values (N) is geo->no_pairs.
25 */
26
27/**
28 * struct btree_head - btree head
29 *
30 * @node: the first node in the tree
31 * @mempool: mempool used for node allocations
32 * @height: current of the tree
33 */
34struct btree_head {
35 unsigned long *node;
36 mempool_t *mempool;
37 int height;
38};
39
40/* btree geometry */
41struct btree_geo;
42
43/**
44 * btree_alloc - allocate function for the mempool
45 * @gfp_mask: gfp mask for the allocation
46 * @pool_data: unused
47 */
48void *btree_alloc(gfp_t gfp_mask, void *pool_data);
49
50/**
51 * btree_free - free function for the mempool
52 * @element: the element to free
53 * @pool_data: unused
54 */
55void btree_free(void *element, void *pool_data);
56
57/**
58 * btree_init_mempool - initialise a btree with given mempool
59 *
60 * @head: the btree head to initialise
61 * @mempool: the mempool to use
62 *
63 * When this function is used, there is no need to destroy
64 * the mempool.
65 */
66void btree_init_mempool(struct btree_head *head, mempool_t *mempool);
67
68/**
69 * btree_init - initialise a btree
70 *
71 * @head: the btree head to initialise
72 *
73 * This function allocates the memory pool that the
74 * btree needs. Returns zero or a negative error code
75 * (-%ENOMEM) when memory allocation fails.
76 *
77 */
78int __must_check btree_init(struct btree_head *head);
79
80/**
81 * btree_destroy - destroy mempool
82 *
83 * @head: the btree head to destroy
84 *
85 * This function destroys the internal memory pool, use only
86 * when using btree_init(), not with btree_init_mempool().
87 */
88void btree_destroy(struct btree_head *head);
89
90/**
91 * btree_lookup - look up a key in the btree
92 *
93 * @head: the btree to look in
94 * @geo: the btree geometry
95 * @key: the key to look up
96 *
97 * This function returns the value for the given key, or %NULL.
98 */
99void *btree_lookup(struct btree_head *head, struct btree_geo *geo,
100 unsigned long *key);
101
102/**
103 * btree_insert - insert an entry into the btree
104 *
105 * @head: the btree to add to
106 * @geo: the btree geometry
107 * @key: the key to add (must not already be present)
108 * @val: the value to add (must not be %NULL)
109 * @gfp: allocation flags for node allocations
110 *
111 * This function returns 0 if the item could be added, or an
112 * error code if it failed (may fail due to memory pressure).
113 */
114int __must_check btree_insert(struct btree_head *head, struct btree_geo *geo,
115 unsigned long *key, void *val, gfp_t gfp);
116/**
117 * btree_update - update an entry in the btree
118 *
119 * @head: the btree to update
120 * @geo: the btree geometry
121 * @key: the key to update
122 * @val: the value to change it to (must not be %NULL)
123 *
124 * This function returns 0 if the update was successful, or
125 * -%ENOENT if the key could not be found.
126 */
127int btree_update(struct btree_head *head, struct btree_geo *geo,
128 unsigned long *key, void *val);
129/**
130 * btree_remove - remove an entry from the btree
131 *
132 * @head: the btree to update
133 * @geo: the btree geometry
134 * @key: the key to remove
135 *
136 * This function returns the removed entry, or %NULL if the key
137 * could not be found.
138 */
139void *btree_remove(struct btree_head *head, struct btree_geo *geo,
140 unsigned long *key);
141
142/**
143 * btree_merge - merge two btrees
144 *
145 * @target: the tree that gets all the entries
146 * @victim: the tree that gets merged into @target
147 * @geo: the btree geometry
148 * @gfp: allocation flags
149 *
150 * The two trees @target and @victim may not contain the same keys,
151 * that is a bug and triggers a BUG(). This function returns zero
152 * if the trees were merged successfully, and may return a failure
153 * when memory allocation fails, in which case both trees might have
154 * been partially merged, i.e. some entries have been moved from
155 * @victim to @target.
156 */
157int btree_merge(struct btree_head *target, struct btree_head *victim,
158 struct btree_geo *geo, gfp_t gfp);
159
160/**
161 * btree_last - get last entry in btree
162 *
163 * @head: btree head
164 * @geo: btree geometry
165 * @key: last key
166 *
167 * Returns the last entry in the btree, and sets @key to the key
168 * of that entry; returns NULL if the tree is empty, in that case
169 * key is not changed.
170 */
171void *btree_last(struct btree_head *head, struct btree_geo *geo,
172 unsigned long *key);
173
174/**
175 * btree_get_prev - get previous entry
176 *
177 * @head: btree head
178 * @geo: btree geometry
179 * @key: pointer to key
180 *
181 * The function returns the next item right before the value pointed to by
182 * @key, and updates @key with its key, or returns %NULL when there is no
183 * entry with a key smaller than the given key.
184 */
185void *btree_get_prev(struct btree_head *head, struct btree_geo *geo,
186 unsigned long *key);
187
188
189/* internal use, use btree_visitor{l,32,64,128} */
190size_t btree_visitor(struct btree_head *head, struct btree_geo *geo,
191 unsigned long opaque,
192 void (*func)(void *elem, unsigned long opaque,
193 unsigned long *key, size_t index,
194 void *func2),
195 void *func2);
196
197/* internal use, use btree_grim_visitor{l,32,64,128} */
198size_t btree_grim_visitor(struct btree_head *head, struct btree_geo *geo,
199 unsigned long opaque,
200 void (*func)(void *elem, unsigned long opaque,
201 unsigned long *key,
202 size_t index, void *func2),
203 void *func2);
204
205
206#include <linux/btree-128.h>
207
208extern struct btree_geo btree_geo32;
209#define BTREE_TYPE_SUFFIX l
210#define BTREE_TYPE_BITS BITS_PER_LONG
211#define BTREE_TYPE_GEO &btree_geo32
212#define BTREE_KEYTYPE unsigned long
213#include <linux/btree-type.h>
214
215#define btree_for_each_safel(head, key, val) \
216 for (val = btree_lastl(head, &key); \
217 val; \
218 val = btree_get_prevl(head, &key))
219
220#define BTREE_TYPE_SUFFIX 32
221#define BTREE_TYPE_BITS 32
222#define BTREE_TYPE_GEO &btree_geo32
223#define BTREE_KEYTYPE u32
224#include <linux/btree-type.h>
225
226#define btree_for_each_safe32(head, key, val) \
227 for (val = btree_last32(head, &key); \
228 val; \
229 val = btree_get_prev32(head, &key))
230
231extern struct btree_geo btree_geo64;
232#define BTREE_TYPE_SUFFIX 64
233#define BTREE_TYPE_BITS 64
234#define BTREE_TYPE_GEO &btree_geo64
235#define BTREE_KEYTYPE u64
236#include <linux/btree-type.h>
237
238#define btree_for_each_safe64(head, key, val) \
239 for (val = btree_last64(head, &key); \
240 val; \
241 val = btree_get_prev64(head, &key))
242
243#endif
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 1ed2a5cc03f5..6e5a7f00223d 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -38,6 +38,7 @@ struct can_priv {
38 38
39 enum can_state state; 39 enum can_state state;
40 u32 ctrlmode; 40 u32 ctrlmode;
41 u32 ctrlmode_supported;
41 42
42 int restart_ms; 43 int restart_ms;
43 struct timer_list restart_timer; 44 struct timer_list restart_timer;
@@ -46,11 +47,37 @@ struct can_priv {
46 int (*do_set_mode)(struct net_device *dev, enum can_mode mode); 47 int (*do_set_mode)(struct net_device *dev, enum can_mode mode);
47 int (*do_get_state)(const struct net_device *dev, 48 int (*do_get_state)(const struct net_device *dev,
48 enum can_state *state); 49 enum can_state *state);
50 int (*do_get_berr_counter)(const struct net_device *dev,
51 struct can_berr_counter *bec);
49 52
50 unsigned int echo_skb_max; 53 unsigned int echo_skb_max;
51 struct sk_buff **echo_skb; 54 struct sk_buff **echo_skb;
52}; 55};
53 56
57/*
58 * get_can_dlc(value) - helper macro to cast a given data length code (dlc)
59 * to __u8 and ensure the dlc value to be max. 8 bytes.
60 *
61 * To be used in the CAN netdriver receive path to ensure conformance with
62 * ISO 11898-1 Chapter 8.4.2.3 (DLC field)
63 */
64#define get_can_dlc(i) (min_t(__u8, (i), 8))
65
66/* Drop a given socketbuffer if it does not contain a valid CAN frame. */
67static inline int can_dropped_invalid_skb(struct net_device *dev,
68 struct sk_buff *skb)
69{
70 const struct can_frame *cf = (struct can_frame *)skb->data;
71
72 if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) {
73 kfree_skb(skb);
74 dev->stats.tx_dropped++;
75 return 1;
76 }
77
78 return 0;
79}
80
54struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); 81struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max);
55void free_candev(struct net_device *dev); 82void free_candev(struct net_device *dev);
56 83
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h
index 9ecbb7871c0e..3250de935e1a 100644
--- a/include/linux/can/netlink.h
+++ b/include/linux/can/netlink.h
@@ -70,6 +70,14 @@ enum can_state {
70}; 70};
71 71
72/* 72/*
73 * CAN bus error counters
74 */
75struct can_berr_counter {
76 __u16 txerr;
77 __u16 rxerr;
78};
79
80/*
73 * CAN controller mode 81 * CAN controller mode
74 */ 82 */
75struct can_ctrlmode { 83struct can_ctrlmode {
@@ -77,9 +85,11 @@ struct can_ctrlmode {
77 __u32 flags; 85 __u32 flags;
78}; 86};
79 87
80#define CAN_CTRLMODE_LOOPBACK 0x1 /* Loopback mode */ 88#define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */
81#define CAN_CTRLMODE_LISTENONLY 0x2 /* Listen-only mode */ 89#define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */
82#define CAN_CTRLMODE_3_SAMPLES 0x4 /* Triple sampling mode */ 90#define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */
91#define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */
92#define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */
83 93
84/* 94/*
85 * CAN device statistics 95 * CAN device statistics
@@ -105,6 +115,7 @@ enum {
105 IFLA_CAN_CTRLMODE, 115 IFLA_CAN_CTRLMODE,
106 IFLA_CAN_RESTART_MS, 116 IFLA_CAN_RESTART_MS,
107 IFLA_CAN_RESTART, 117 IFLA_CAN_RESTART,
118 IFLA_CAN_BERR_COUNTER,
108 __IFLA_CAN_MAX 119 __IFLA_CAN_MAX
109}; 120};
110 121
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h
index 4688c7bb1bd1..af17cb3f7a84 100644
--- a/include/linux/can/platform/ti_hecc.h
+++ b/include/linux/can/platform/ti_hecc.h
@@ -1,3 +1,6 @@
1#ifndef __CAN_PLATFORM_TI_HECC_H__
2#define __CAN_PLATFORM_TI_HECC_H__
3
1/* 4/*
2 * TI HECC (High End CAN Controller) driver platform header 5 * TI HECC (High End CAN Controller) driver platform header
3 * 6 *
@@ -23,6 +26,7 @@
23 * @mbx_offset: Mailbox RAM offset 26 * @mbx_offset: Mailbox RAM offset
24 * @int_line: Interrupt line to use - 0 or 1 27 * @int_line: Interrupt line to use - 0 or 1
25 * @version: version for future use 28 * @version: version for future use
29 * @transceiver_switch: platform specific callback fn for transceiver control
26 * 30 *
27 * Platform data structure to get all platform specific settings. 31 * Platform data structure to get all platform specific settings.
28 * this structure also accounts the fact that the IP may have different 32 * this structure also accounts the fact that the IP may have different
@@ -35,6 +39,6 @@ struct ti_hecc_platform_data {
35 u32 mbx_offset; 39 u32 mbx_offset;
36 u32 int_line; 40 u32 int_line;
37 u32 version; 41 u32 version;
42 void (*transceiver_switch) (int);
38}; 43};
39 44#endif
40
diff --git a/include/linux/cciss_defs.h b/include/linux/cciss_defs.h
new file mode 100644
index 000000000000..316b670d4e33
--- /dev/null
+++ b/include/linux/cciss_defs.h
@@ -0,0 +1,130 @@
1#ifndef CCISS_DEFS_H
2#define CCISS_DEFS_H
3
4#include <linux/types.h>
5
6/* general boundary definitions */
7#define SENSEINFOBYTES 32 /* note that this value may vary
8 between host implementations */
9
10/* Command Status value */
11#define CMD_SUCCESS 0x0000
12#define CMD_TARGET_STATUS 0x0001
13#define CMD_DATA_UNDERRUN 0x0002
14#define CMD_DATA_OVERRUN 0x0003
15#define CMD_INVALID 0x0004
16#define CMD_PROTOCOL_ERR 0x0005
17#define CMD_HARDWARE_ERR 0x0006
18#define CMD_CONNECTION_LOST 0x0007
19#define CMD_ABORTED 0x0008
20#define CMD_ABORT_FAILED 0x0009
21#define CMD_UNSOLICITED_ABORT 0x000A
22#define CMD_TIMEOUT 0x000B
23#define CMD_UNABORTABLE 0x000C
24
25/* transfer direction */
26#define XFER_NONE 0x00
27#define XFER_WRITE 0x01
28#define XFER_READ 0x02
29#define XFER_RSVD 0x03
30
31/* task attribute */
32#define ATTR_UNTAGGED 0x00
33#define ATTR_SIMPLE 0x04
34#define ATTR_HEADOFQUEUE 0x05
35#define ATTR_ORDERED 0x06
36#define ATTR_ACA 0x07
37
38/* cdb type */
39#define TYPE_CMD 0x00
40#define TYPE_MSG 0x01
41
42/* Type defs used in the following structs */
43#define BYTE __u8
44#define WORD __u16
45#define HWORD __u16
46#define DWORD __u32
47
48#define CISS_MAX_LUN 1024
49
50#define LEVEL2LUN 1 /* index into Target(x) structure, due to byte swapping */
51#define LEVEL3LUN 0
52
53#pragma pack(1)
54
55/* Command List Structure */
56typedef union _SCSI3Addr_struct {
57 struct {
58 BYTE Dev;
59 BYTE Bus:6;
60 BYTE Mode:2; /* b00 */
61 } PeripDev;
62 struct {
63 BYTE DevLSB;
64 BYTE DevMSB:6;
65 BYTE Mode:2; /* b01 */
66 } LogDev;
67 struct {
68 BYTE Dev:5;
69 BYTE Bus:3;
70 BYTE Targ:6;
71 BYTE Mode:2; /* b10 */
72 } LogUnit;
73} SCSI3Addr_struct;
74
75typedef struct _PhysDevAddr_struct {
76 DWORD TargetId:24;
77 DWORD Bus:6;
78 DWORD Mode:2;
79 SCSI3Addr_struct Target[2]; /* 2 level target device addr */
80} PhysDevAddr_struct;
81
82typedef struct _LogDevAddr_struct {
83 DWORD VolId:30;
84 DWORD Mode:2;
85 BYTE reserved[4];
86} LogDevAddr_struct;
87
88typedef union _LUNAddr_struct {
89 BYTE LunAddrBytes[8];
90 SCSI3Addr_struct SCSI3Lun[4];
91 PhysDevAddr_struct PhysDev;
92 LogDevAddr_struct LogDev;
93} LUNAddr_struct;
94
95typedef struct _RequestBlock_struct {
96 BYTE CDBLen;
97 struct {
98 BYTE Type:3;
99 BYTE Attribute:3;
100 BYTE Direction:2;
101 } Type;
102 HWORD Timeout;
103 BYTE CDB[16];
104} RequestBlock_struct;
105
106typedef union _MoreErrInfo_struct{
107 struct {
108 BYTE Reserved[3];
109 BYTE Type;
110 DWORD ErrorInfo;
111 } Common_Info;
112 struct{
113 BYTE Reserved[2];
114 BYTE offense_size; /* size of offending entry */
115 BYTE offense_num; /* byte # of offense 0-base */
116 DWORD offense_value;
117 } Invalid_Cmd;
118} MoreErrInfo_struct;
119typedef struct _ErrorInfo_struct {
120 BYTE ScsiStatus;
121 BYTE SenseLen;
122 HWORD CommandStatus;
123 DWORD ResidualCnt;
124 MoreErrInfo_struct MoreErrInfo;
125 BYTE SenseInfo[SENSEINFOBYTES];
126} ErrorInfo_struct;
127
128#pragma pack()
129
130#endif /* CCISS_DEFS_H */
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index eb130b4d8e72..986493f5b92b 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/ioctl.h> 5#include <linux/ioctl.h>
6#include <linux/cciss_defs.h>
6 7
7#define CCISS_IOC_MAGIC 'B' 8#define CCISS_IOC_MAGIC 'B'
8 9
@@ -36,133 +37,6 @@ typedef __u32 DriverVer_type;
36 37
37#define MAX_KMALLOC_SIZE 128000 38#define MAX_KMALLOC_SIZE 128000
38 39
39#ifndef CCISS_CMD_H
40// This defines are duplicated in cciss_cmd.h in the driver directory
41
42//general boundary definitions
43#define SENSEINFOBYTES 32//note that this value may vary between host implementations
44
45//Command Status value
46#define CMD_SUCCESS 0x0000
47#define CMD_TARGET_STATUS 0x0001
48#define CMD_DATA_UNDERRUN 0x0002
49#define CMD_DATA_OVERRUN 0x0003
50#define CMD_INVALID 0x0004
51#define CMD_PROTOCOL_ERR 0x0005
52#define CMD_HARDWARE_ERR 0x0006
53#define CMD_CONNECTION_LOST 0x0007
54#define CMD_ABORTED 0x0008
55#define CMD_ABORT_FAILED 0x0009
56#define CMD_UNSOLICITED_ABORT 0x000A
57#define CMD_TIMEOUT 0x000B
58#define CMD_UNABORTABLE 0x000C
59
60//transfer direction
61#define XFER_NONE 0x00
62#define XFER_WRITE 0x01
63#define XFER_READ 0x02
64#define XFER_RSVD 0x03
65
66//task attribute
67#define ATTR_UNTAGGED 0x00
68#define ATTR_SIMPLE 0x04
69#define ATTR_HEADOFQUEUE 0x05
70#define ATTR_ORDERED 0x06
71#define ATTR_ACA 0x07
72
73//cdb type
74#define TYPE_CMD 0x00
75#define TYPE_MSG 0x01
76
77// Type defs used in the following structs
78#define BYTE __u8
79#define WORD __u16
80#define HWORD __u16
81#define DWORD __u32
82
83#define CISS_MAX_LUN 1024
84
85#define LEVEL2LUN 1 // index into Target(x) structure, due to byte swapping
86#define LEVEL3LUN 0
87
88#pragma pack(1)
89
90//Command List Structure
91typedef union _SCSI3Addr_struct {
92 struct {
93 BYTE Dev;
94 BYTE Bus:6;
95 BYTE Mode:2; // b00
96 } PeripDev;
97 struct {
98 BYTE DevLSB;
99 BYTE DevMSB:6;
100 BYTE Mode:2; // b01
101 } LogDev;
102 struct {
103 BYTE Dev:5;
104 BYTE Bus:3;
105 BYTE Targ:6;
106 BYTE Mode:2; // b10
107 } LogUnit;
108} SCSI3Addr_struct;
109
110typedef struct _PhysDevAddr_struct {
111 DWORD TargetId:24;
112 DWORD Bus:6;
113 DWORD Mode:2;
114 SCSI3Addr_struct Target[2]; //2 level target device addr
115} PhysDevAddr_struct;
116
117typedef struct _LogDevAddr_struct {
118 DWORD VolId:30;
119 DWORD Mode:2;
120 BYTE reserved[4];
121} LogDevAddr_struct;
122
123typedef union _LUNAddr_struct {
124 BYTE LunAddrBytes[8];
125 SCSI3Addr_struct SCSI3Lun[4];
126 PhysDevAddr_struct PhysDev;
127 LogDevAddr_struct LogDev;
128} LUNAddr_struct;
129
130typedef struct _RequestBlock_struct {
131 BYTE CDBLen;
132 struct {
133 BYTE Type:3;
134 BYTE Attribute:3;
135 BYTE Direction:2;
136 } Type;
137 HWORD Timeout;
138 BYTE CDB[16];
139} RequestBlock_struct;
140
141typedef union _MoreErrInfo_struct{
142 struct {
143 BYTE Reserved[3];
144 BYTE Type;
145 DWORD ErrorInfo;
146 }Common_Info;
147 struct{
148 BYTE Reserved[2];
149 BYTE offense_size;//size of offending entry
150 BYTE offense_num; //byte # of offense 0-base
151 DWORD offense_value;
152 }Invalid_Cmd;
153}MoreErrInfo_struct;
154typedef struct _ErrorInfo_struct {
155 BYTE ScsiStatus;
156 BYTE SenseLen;
157 HWORD CommandStatus;
158 DWORD ResidualCnt;
159 MoreErrInfo_struct MoreErrInfo;
160 BYTE SenseInfo[SENSEINFOBYTES];
161} ErrorInfo_struct;
162
163#pragma pack()
164#endif /* CCISS_CMD_H */
165
166typedef struct _IOCTL_Command_struct { 40typedef struct _IOCTL_Command_struct {
167 LUNAddr_struct LUN_info; 41 LUNAddr_struct LUN_info;
168 RequestBlock_struct Request; 42 RequestBlock_struct Request;
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 0008dee66514..b8ad1ea99586 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -28,6 +28,7 @@ struct css_id;
28extern int cgroup_init_early(void); 28extern int cgroup_init_early(void);
29extern int cgroup_init(void); 29extern int cgroup_init(void);
30extern void cgroup_lock(void); 30extern void cgroup_lock(void);
31extern int cgroup_lock_is_held(void);
31extern bool cgroup_lock_live_group(struct cgroup *cgrp); 32extern bool cgroup_lock_live_group(struct cgroup *cgrp);
32extern void cgroup_unlock(void); 33extern void cgroup_unlock(void);
33extern void cgroup_fork(struct task_struct *p); 34extern void cgroup_fork(struct task_struct *p);
@@ -36,16 +37,24 @@ extern void cgroup_post_fork(struct task_struct *p);
36extern void cgroup_exit(struct task_struct *p, int run_callbacks); 37extern void cgroup_exit(struct task_struct *p, int run_callbacks);
37extern int cgroupstats_build(struct cgroupstats *stats, 38extern int cgroupstats_build(struct cgroupstats *stats,
38 struct dentry *dentry); 39 struct dentry *dentry);
40extern int cgroup_load_subsys(struct cgroup_subsys *ss);
41extern void cgroup_unload_subsys(struct cgroup_subsys *ss);
39 42
40extern const struct file_operations proc_cgroup_operations; 43extern const struct file_operations proc_cgroup_operations;
41 44
42/* Define the enumeration of all cgroup subsystems */ 45/* Define the enumeration of all builtin cgroup subsystems */
43#define SUBSYS(_x) _x ## _subsys_id, 46#define SUBSYS(_x) _x ## _subsys_id,
44enum cgroup_subsys_id { 47enum cgroup_subsys_id {
45#include <linux/cgroup_subsys.h> 48#include <linux/cgroup_subsys.h>
46 CGROUP_SUBSYS_COUNT 49 CGROUP_BUILTIN_SUBSYS_COUNT
47}; 50};
48#undef SUBSYS 51#undef SUBSYS
52/*
53 * This define indicates the maximum number of subsystems that can be loaded
54 * at once. We limit to this many since cgroupfs_root has subsys_bits to keep
55 * track of all of them.
56 */
57#define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long))
49 58
50/* Per-subsystem/per-cgroup state maintained by the system. */ 59/* Per-subsystem/per-cgroup state maintained by the system. */
51struct cgroup_subsys_state { 60struct cgroup_subsys_state {
@@ -75,6 +84,12 @@ enum {
75 CSS_REMOVED, /* This CSS is dead */ 84 CSS_REMOVED, /* This CSS is dead */
76}; 85};
77 86
87/* Caller must verify that the css is not for root cgroup */
88static inline void __css_get(struct cgroup_subsys_state *css, int count)
89{
90 atomic_add(count, &css->refcnt);
91}
92
78/* 93/*
79 * Call css_get() to hold a reference on the css; it can be used 94 * Call css_get() to hold a reference on the css; it can be used
80 * for a reference obtained via: 95 * for a reference obtained via:
@@ -86,7 +101,7 @@ static inline void css_get(struct cgroup_subsys_state *css)
86{ 101{
87 /* We don't need to reference count the root state */ 102 /* We don't need to reference count the root state */
88 if (!test_bit(CSS_ROOT, &css->flags)) 103 if (!test_bit(CSS_ROOT, &css->flags))
89 atomic_inc(&css->refcnt); 104 __css_get(css, 1);
90} 105}
91 106
92static inline bool css_is_removed(struct cgroup_subsys_state *css) 107static inline bool css_is_removed(struct cgroup_subsys_state *css)
@@ -117,11 +132,11 @@ static inline bool css_tryget(struct cgroup_subsys_state *css)
117 * css_get() or css_tryget() 132 * css_get() or css_tryget()
118 */ 133 */
119 134
120extern void __css_put(struct cgroup_subsys_state *css); 135extern void __css_put(struct cgroup_subsys_state *css, int count);
121static inline void css_put(struct cgroup_subsys_state *css) 136static inline void css_put(struct cgroup_subsys_state *css)
122{ 137{
123 if (!test_bit(CSS_ROOT, &css->flags)) 138 if (!test_bit(CSS_ROOT, &css->flags))
124 __css_put(css); 139 __css_put(css, 1);
125} 140}
126 141
127/* bits in struct cgroup flags field */ 142/* bits in struct cgroup flags field */
@@ -220,6 +235,10 @@ struct cgroup {
220 235
221 /* For RCU-protected deletion */ 236 /* For RCU-protected deletion */
222 struct rcu_head rcu_head; 237 struct rcu_head rcu_head;
238
239 /* List of events which userspace want to recieve */
240 struct list_head event_list;
241 spinlock_t event_list_lock;
223}; 242};
224 243
225/* 244/*
@@ -257,7 +276,8 @@ struct css_set {
257 /* 276 /*
258 * Set of subsystem states, one for each subsystem. This array 277 * Set of subsystem states, one for each subsystem. This array
259 * is immutable after creation apart from the init_css_set 278 * is immutable after creation apart from the init_css_set
260 * during subsystem registration (at boot time). 279 * during subsystem registration (at boot time) and modular subsystem
280 * loading/unloading.
261 */ 281 */
262 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; 282 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
263 283
@@ -362,6 +382,23 @@ struct cftype {
362 int (*trigger)(struct cgroup *cgrp, unsigned int event); 382 int (*trigger)(struct cgroup *cgrp, unsigned int event);
363 383
364 int (*release)(struct inode *inode, struct file *file); 384 int (*release)(struct inode *inode, struct file *file);
385
386 /*
387 * register_event() callback will be used to add new userspace
388 * waiter for changes related to the cftype. Implement it if
389 * you want to provide this functionality. Use eventfd_signal()
390 * on eventfd to send notification to userspace.
391 */
392 int (*register_event)(struct cgroup *cgrp, struct cftype *cft,
393 struct eventfd_ctx *eventfd, const char *args);
394 /*
395 * unregister_event() callback will be called when userspace
396 * closes the eventfd or on cgroup removing.
397 * This callback must be implemented, if you want provide
398 * notification functionality.
399 */
400 int (*unregister_event)(struct cgroup *cgrp, struct cftype *cft,
401 struct eventfd_ctx *eventfd);
365}; 402};
366 403
367struct cgroup_scanner { 404struct cgroup_scanner {
@@ -427,6 +464,8 @@ struct cgroup_subsys {
427 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); 464 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
428 int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 465 int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
429 struct task_struct *tsk, bool threadgroup); 466 struct task_struct *tsk, bool threadgroup);
467 void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
468 struct task_struct *tsk, bool threadgroup);
430 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 469 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
431 struct cgroup *old_cgrp, struct task_struct *tsk, 470 struct cgroup *old_cgrp, struct task_struct *tsk,
432 bool threadgroup); 471 bool threadgroup);
@@ -471,6 +510,9 @@ struct cgroup_subsys {
471 /* used when use_id == true */ 510 /* used when use_id == true */
472 struct idr idr; 511 struct idr idr;
473 spinlock_t id_lock; 512 spinlock_t id_lock;
513
514 /* should be defined only by modular subsystems */
515 struct module *module;
474}; 516};
475 517
476#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; 518#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys;
@@ -486,7 +528,9 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state(
486static inline struct cgroup_subsys_state *task_subsys_state( 528static inline struct cgroup_subsys_state *task_subsys_state(
487 struct task_struct *task, int subsys_id) 529 struct task_struct *task, int subsys_id)
488{ 530{
489 return rcu_dereference(task->cgroups->subsys[subsys_id]); 531 return rcu_dereference_check(task->cgroups->subsys[subsys_id],
532 rcu_read_lock_held() ||
533 cgroup_lock_is_held());
490} 534}
491 535
492static inline struct cgroup* task_cgroup(struct task_struct *task, 536static inline struct cgroup* task_cgroup(struct task_struct *task,
diff --git a/include/linux/circ_buf.h b/include/linux/circ_buf.h
index a2ed0591fb19..90f2471dc6f2 100644
--- a/include/linux/circ_buf.h
+++ b/include/linux/circ_buf.h
@@ -1,3 +1,7 @@
1/*
2 * See Documentation/circular-buffers.txt for more information.
3 */
4
1#ifndef _LINUX_CIRC_BUF_H 5#ifndef _LINUX_CIRC_BUF_H
2#define _LINUX_CIRC_BUF_H 1 6#define _LINUX_CIRC_BUF_H 1
3 7
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 0cf725bdd2a1..fc53492b6ad7 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -73,6 +73,7 @@ enum clock_event_nofitiers {
73 * @list: list head for the management code 73 * @list: list head for the management code
74 * @mode: operating mode assigned by the management code 74 * @mode: operating mode assigned by the management code
75 * @next_event: local storage for the next event in oneshot mode 75 * @next_event: local storage for the next event in oneshot mode
76 * @retries: number of forced programming retries
76 */ 77 */
77struct clock_event_device { 78struct clock_event_device {
78 const char *name; 79 const char *name;
@@ -93,6 +94,7 @@ struct clock_event_device {
93 struct list_head list; 94 struct list_head list;
94 enum clock_event_mode mode; 95 enum clock_event_mode mode;
95 ktime_t next_event; 96 ktime_t next_event;
97 unsigned long retries;
96}; 98};
97 99
98/* 100/*
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 8a4a130cc196..4bca8b60cdf7 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -154,6 +154,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
154 * @max_idle_ns: max idle time permitted by the clocksource (nsecs) 154 * @max_idle_ns: max idle time permitted by the clocksource (nsecs)
155 * @flags: flags describing special properties 155 * @flags: flags describing special properties
156 * @vread: vsyscall based read 156 * @vread: vsyscall based read
157 * @suspend: suspend function for the clocksource, if necessary
157 * @resume: resume function for the clocksource, if necessary 158 * @resume: resume function for the clocksource, if necessary
158 */ 159 */
159struct clocksource { 160struct clocksource {
@@ -172,7 +173,8 @@ struct clocksource {
172 u64 max_idle_ns; 173 u64 max_idle_ns;
173 unsigned long flags; 174 unsigned long flags;
174 cycle_t (*vread)(void); 175 cycle_t (*vread)(void);
175 void (*resume)(void); 176 void (*suspend)(struct clocksource *cs);
177 void (*resume)(struct clocksource *cs);
176#ifdef CONFIG_IA64 178#ifdef CONFIG_IA64
177 void *fsys_mmio; /* used by fsyscall asm code */ 179 void *fsys_mmio; /* used by fsyscall asm code */
178#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) 180#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
@@ -277,6 +279,7 @@ extern void clocksource_unregister(struct clocksource*);
277extern void clocksource_touch_watchdog(void); 279extern void clocksource_touch_watchdog(void);
278extern struct clocksource* clocksource_get_next(void); 280extern struct clocksource* clocksource_get_next(void);
279extern void clocksource_change_rating(struct clocksource *cs, int rating); 281extern void clocksource_change_rating(struct clocksource *cs, int rating);
282extern void clocksource_suspend(void);
280extern void clocksource_resume(void); 283extern void clocksource_resume(void);
281extern struct clocksource * __init __weak clocksource_default_clock(void); 284extern struct clocksource * __init __weak clocksource_default_clock(void);
282extern void clocksource_mark_unstable(struct clocksource *cs); 285extern void clocksource_mark_unstable(struct clocksource *cs);
diff --git a/include/linux/compat.h b/include/linux/compat.h
index ef68119a4fd2..717c691ecd8e 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -23,6 +23,7 @@
23typedef __compat_uid32_t compat_uid_t; 23typedef __compat_uid32_t compat_uid_t;
24typedef __compat_gid32_t compat_gid_t; 24typedef __compat_gid32_t compat_gid_t;
25 25
26struct compat_sel_arg_struct;
26struct rusage; 27struct rusage;
27 28
28struct compat_itimerspec { 29struct compat_itimerspec {
@@ -249,6 +250,8 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
249 compat_ulong_t __user *outp, compat_ulong_t __user *exp, 250 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
250 struct compat_timeval __user *tvp); 251 struct compat_timeval __user *tvp);
251 252
253asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg);
254
252asmlinkage long compat_sys_wait4(compat_pid_t pid, 255asmlinkage long compat_sys_wait4(compat_pid_t pid,
253 compat_uint_t __user *stat_addr, int options, 256 compat_uint_t __user *stat_addr, int options,
254 struct compat_rusage __user *ru); 257 struct compat_rusage __user *ru);
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 5be3dab4a695..a5a472b10746 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -5,7 +5,7 @@
5 5
6#ifdef __CHECKER__ 6#ifdef __CHECKER__
7# define __user __attribute__((noderef, address_space(1))) 7# define __user __attribute__((noderef, address_space(1)))
8# define __kernel /* default address space */ 8# define __kernel __attribute__((address_space(0)))
9# define __safe __attribute__((safe)) 9# define __safe __attribute__((safe))
10# define __force __attribute__((force)) 10# define __force __attribute__((force))
11# define __nocast __attribute__((nocast)) 11# define __nocast __attribute__((nocast))
@@ -15,6 +15,7 @@
15# define __acquire(x) __context__(x,1) 15# define __acquire(x) __context__(x,1)
16# define __release(x) __context__(x,-1) 16# define __release(x) __context__(x,-1)
17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) 17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
18# define __percpu __attribute__((noderef, address_space(3)))
18extern void __chk_user_ptr(const volatile void __user *); 19extern void __chk_user_ptr(const volatile void __user *);
19extern void __chk_io_ptr(const volatile void __iomem *); 20extern void __chk_io_ptr(const volatile void __iomem *);
20#else 21#else
@@ -32,6 +33,7 @@ extern void __chk_io_ptr(const volatile void __iomem *);
32# define __acquire(x) (void)0 33# define __acquire(x) (void)0
33# define __release(x) (void)0 34# define __release(x) (void)0
34# define __cond_lock(x,c) (c) 35# define __cond_lock(x,c) (c)
36# define __percpu
35#endif 37#endif
36 38
37#ifdef __KERNEL__ 39#ifdef __KERNEL__
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 72ba63eb83c5..3a779ffba60b 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -24,9 +24,6 @@
24 24
25#include <linux/types.h> 25#include <linux/types.h>
26 26
27#define CN_IDX_CONNECTOR 0xffffffff
28#define CN_VAL_CONNECTOR 0xffffffff
29
30/* 27/*
31 * Process Events connector unique ids -- used for message routing 28 * Process Events connector unique ids -- used for message routing
32 */ 29 */
@@ -75,30 +72,6 @@ struct cn_msg {
75 __u8 data[0]; 72 __u8 data[0];
76}; 73};
77 74
78/*
79 * Notify structure - requests notification about
80 * registering/unregistering idx/val in range [first, first+range].
81 */
82struct cn_notify_req {
83 __u32 first;
84 __u32 range;
85};
86
87/*
88 * Main notification control message
89 * *_notify_num - number of appropriate cn_notify_req structures after
90 * this struct.
91 * group - notification receiver's idx.
92 * len - total length of the attached data.
93 */
94struct cn_ctl_msg {
95 __u32 idx_notify_num;
96 __u32 val_notify_num;
97 __u32 group;
98 __u32 len;
99 __u8 data[0];
100};
101
102#ifdef __KERNEL__ 75#ifdef __KERNEL__
103 76
104#include <asm/atomic.h> 77#include <asm/atomic.h>
@@ -151,11 +124,6 @@ struct cn_callback_entry {
151 u32 seq, group; 124 u32 seq, group;
152}; 125};
153 126
154struct cn_ctl_entry {
155 struct list_head notify_entry;
156 struct cn_ctl_msg *msg;
157};
158
159struct cn_dev { 127struct cn_dev {
160 struct cb_id id; 128 struct cb_id id;
161 129
diff --git a/include/linux/coredump.h b/include/linux/coredump.h
new file mode 100644
index 000000000000..8ba66a9d9022
--- /dev/null
+++ b/include/linux/coredump.h
@@ -0,0 +1,45 @@
1#ifndef _LINUX_COREDUMP_H
2#define _LINUX_COREDUMP_H
3
4#include <linux/types.h>
5#include <linux/mm.h>
6#include <linux/fs.h>
7
8/*
9 * These are the only things you should do on a core-file: use only these
10 * functions to write out all the necessary info.
11 */
12static inline int dump_write(struct file *file, const void *addr, int nr)
13{
14 return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
15}
16
17static inline int dump_seek(struct file *file, loff_t off)
18{
19 int ret = 1;
20
21 if (file->f_op->llseek && file->f_op->llseek != no_llseek) {
22 if (file->f_op->llseek(file, off, SEEK_CUR) < 0)
23 return 0;
24 } else {
25 char *buf = (char *)get_zeroed_page(GFP_KERNEL);
26
27 if (!buf)
28 return 0;
29 while (off > 0) {
30 unsigned long n = off;
31
32 if (n > PAGE_SIZE)
33 n = PAGE_SIZE;
34 if (!dump_write(file, buf, n)) {
35 ret = 0;
36 break;
37 }
38 off -= n;
39 }
40 free_page((unsigned long)buf);
41 }
42 return ret;
43}
44
45#endif /* _LINUX_COREDUMP_H */
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index d77b54733c5b..bae6fe24d1f9 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -90,10 +90,10 @@ extern const struct cpumask *const cpu_active_mask;
90#define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask) 90#define cpu_present(cpu) cpumask_test_cpu((cpu), cpu_present_mask)
91#define cpu_active(cpu) cpumask_test_cpu((cpu), cpu_active_mask) 91#define cpu_active(cpu) cpumask_test_cpu((cpu), cpu_active_mask)
92#else 92#else
93#define num_online_cpus() 1 93#define num_online_cpus() 1U
94#define num_possible_cpus() 1 94#define num_possible_cpus() 1U
95#define num_present_cpus() 1 95#define num_present_cpus() 1U
96#define num_active_cpus() 1 96#define num_active_cpus() 1U
97#define cpu_online(cpu) ((cpu) == 0) 97#define cpu_online(cpu) ((cpu) == 0)
98#define cpu_possible(cpu) ((cpu) == 0) 98#define cpu_possible(cpu) ((cpu) == 0)
99#define cpu_present(cpu) ((cpu) == 0) 99#define cpu_present(cpu) ((cpu) == 0)
@@ -143,6 +143,8 @@ static inline unsigned int cpumask_any_but(const struct cpumask *mask,
143 143
144#define for_each_cpu(cpu, mask) \ 144#define for_each_cpu(cpu, mask) \
145 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) 145 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
146#define for_each_cpu_not(cpu, mask) \
147 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
146#define for_each_cpu_and(cpu, mask, and) \ 148#define for_each_cpu_and(cpu, mask, and) \
147 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) 149 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and)
148#else 150#else
@@ -203,6 +205,18 @@ int cpumask_any_but(const struct cpumask *mask, unsigned int cpu);
203 (cpu) < nr_cpu_ids;) 205 (cpu) < nr_cpu_ids;)
204 206
205/** 207/**
208 * for_each_cpu_not - iterate over every cpu in a complemented mask
209 * @cpu: the (optionally unsigned) integer iterator
210 * @mask: the cpumask pointer
211 *
212 * After the loop, cpu is >= nr_cpu_ids.
213 */
214#define for_each_cpu_not(cpu, mask) \
215 for ((cpu) = -1; \
216 (cpu) = cpumask_next_zero((cpu), (mask)), \
217 (cpu) < nr_cpu_ids;)
218
219/**
206 * for_each_cpu_and - iterate over every cpu in both masks 220 * for_each_cpu_and - iterate over every cpu in both masks
207 * @cpu: the (optionally unsigned) integer iterator 221 * @cpu: the (optionally unsigned) integer iterator
208 * @mask: the first cpumask pointer 222 * @mask: the first cpumask pointer
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 4e3387a89cb9..52507c3e1387 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -280,7 +280,7 @@ static inline void put_cred(const struct cred *_cred)
280 * task or by holding tasklist_lock to prevent it from being unlinked. 280 * task or by holding tasklist_lock to prevent it from being unlinked.
281 */ 281 */
282#define __task_cred(task) \ 282#define __task_cred(task) \
283 ((const struct cred *)(rcu_dereference((task)->real_cred))) 283 ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_tasklist_lock_is_held())))
284 284
285/** 285/**
286 * get_task_cred - Get another task's objective credentials 286 * get_task_cred - Get another task's objective credentials
diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h
new file mode 100644
index 000000000000..7c930dba477c
--- /dev/null
+++ b/include/linux/davinci_emac.h
@@ -0,0 +1,39 @@
1/*
2 * TI DaVinci EMAC platform support
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. 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#ifndef _LINUX_DAVINCI_EMAC_H
12#define _LINUX_DAVINCI_EMAC_H
13
14#include <linux/if_ether.h>
15#include <linux/memory.h>
16
17struct emac_platform_data {
18 char mac_addr[ETH_ALEN];
19 u32 ctrl_reg_offset;
20 u32 ctrl_mod_reg_offset;
21 u32 ctrl_ram_offset;
22 u32 hw_ram_addr;
23 u32 mdio_reg_offset;
24 u32 ctrl_ram_size;
25 u32 phy_mask;
26 u32 mdio_max_freq;
27 u8 rmii_en;
28 u8 version;
29 void (*interrupt_enable) (void);
30 void (*interrupt_disable) (void);
31};
32
33enum {
34 EMAC_VERSION_1, /* DM644x */
35 EMAC_VERSION_2, /* DM646x */
36};
37
38void davinci_get_mac_addr(struct memory_accessor *mem_acc, void *context);
39#endif
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h
index 12ff8c3f1d05..ad5ec1d0475e 100644
--- a/include/linux/decompress/mm.h
+++ b/include/linux/decompress/mm.h
@@ -14,18 +14,28 @@
14 14
15/* Code active when included from pre-boot environment: */ 15/* Code active when included from pre-boot environment: */
16 16
17/*
18 * Some architectures want to ensure there is no local data in their
19 * pre-boot environment, so that data can arbitarily relocated (via
20 * GOT references). This is achieved by defining STATIC_RW_DATA to
21 * be null.
22 */
23#ifndef STATIC_RW_DATA
24#define STATIC_RW_DATA static
25#endif
26
17/* A trivial malloc implementation, adapted from 27/* A trivial malloc implementation, adapted from
18 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 28 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
19 */ 29 */
20static unsigned long malloc_ptr; 30STATIC_RW_DATA unsigned long malloc_ptr;
21static int malloc_count; 31STATIC_RW_DATA int malloc_count;
22 32
23static void *malloc(int size) 33static void *malloc(int size)
24{ 34{
25 void *p; 35 void *p;
26 36
27 if (size < 0) 37 if (size < 0)
28 error("Malloc error"); 38 return NULL;
29 if (!malloc_ptr) 39 if (!malloc_ptr)
30 malloc_ptr = free_mem_ptr; 40 malloc_ptr = free_mem_ptr;
31 41
@@ -35,7 +45,7 @@ static void *malloc(int size)
35 malloc_ptr += size; 45 malloc_ptr += size;
36 46
37 if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr) 47 if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr)
38 error("Out of memory"); 48 return NULL;
39 49
40 malloc_count++; 50 malloc_count++;
41 return p; 51 return p;
diff --git a/include/linux/decompress/unlzo.h b/include/linux/decompress/unlzo.h
new file mode 100644
index 000000000000..987229752519
--- /dev/null
+++ b/include/linux/decompress/unlzo.h
@@ -0,0 +1,10 @@
1#ifndef DECOMPRESS_UNLZO_H
2#define DECOMPRESS_UNLZO_H
3
4int unlzo(unsigned char *inbuf, int len,
5 int(*fill)(void*, unsigned int),
6 int(*flush)(void*, unsigned int),
7 unsigned char *output,
8 int *pos,
9 void(*error)(char *x));
10#endif
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index d4c9c0b88adc..1381cd97b4ed 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -118,10 +118,9 @@ struct dm_dev {
118/* 118/*
119 * Constructors should call these functions to ensure destination devices 119 * Constructors should call these functions to ensure destination devices
120 * are opened/closed correctly. 120 * are opened/closed correctly.
121 * FIXME: too many arguments.
122 */ 121 */
123int dm_get_device(struct dm_target *ti, const char *path, sector_t start, 122int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode,
124 sector_t len, fmode_t mode, struct dm_dev **result); 123 struct dm_dev **result);
125void dm_put_device(struct dm_target *ti, struct dm_dev *d); 124void dm_put_device(struct dm_target *ti, struct dm_dev *d);
126 125
127/* 126/*
diff --git a/include/linux/device.h b/include/linux/device.h
index 2a73d9bcbc9c..182192892d45 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -106,7 +106,7 @@ extern int bus_unregister_notifier(struct bus_type *bus,
106 106
107/* All 4 notifers below get called with the target struct device * 107/* All 4 notifers below get called with the target struct device *
108 * as an argument. Note that those functions are likely to be called 108 * as an argument. Note that those functions are likely to be called
109 * with the device semaphore held in the core, so be careful. 109 * with the device lock held in the core, so be careful.
110 */ 110 */
111#define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ 111#define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */
112#define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ 112#define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */
@@ -166,9 +166,9 @@ struct driver_attribute driver_attr_##_name = \
166 __ATTR(_name, _mode, _show, _store) 166 __ATTR(_name, _mode, _show, _store)
167 167
168extern int __must_check driver_create_file(struct device_driver *driver, 168extern int __must_check driver_create_file(struct device_driver *driver,
169 struct driver_attribute *attr); 169 const struct driver_attribute *attr);
170extern void driver_remove_file(struct device_driver *driver, 170extern void driver_remove_file(struct device_driver *driver,
171 struct driver_attribute *attr); 171 const struct driver_attribute *attr);
172 172
173extern int __must_check driver_add_kobj(struct device_driver *drv, 173extern int __must_check driver_add_kobj(struct device_driver *drv,
174 struct kobject *kobj, 174 struct kobject *kobj,
@@ -251,8 +251,10 @@ extern struct device *class_find_device(struct class *class,
251 251
252struct class_attribute { 252struct class_attribute {
253 struct attribute attr; 253 struct attribute attr;
254 ssize_t (*show)(struct class *class, char *buf); 254 ssize_t (*show)(struct class *class, struct class_attribute *attr,
255 ssize_t (*store)(struct class *class, const char *buf, size_t count); 255 char *buf);
256 ssize_t (*store)(struct class *class, struct class_attribute *attr,
257 const char *buf, size_t count);
256}; 258};
257 259
258#define CLASS_ATTR(_name, _mode, _show, _store) \ 260#define CLASS_ATTR(_name, _mode, _show, _store) \
@@ -263,6 +265,23 @@ extern int __must_check class_create_file(struct class *class,
263extern void class_remove_file(struct class *class, 265extern void class_remove_file(struct class *class,
264 const struct class_attribute *attr); 266 const struct class_attribute *attr);
265 267
268/* Simple class attribute that is just a static string */
269
270struct class_attribute_string {
271 struct class_attribute attr;
272 char *str;
273};
274
275/* Currently read-only only */
276#define _CLASS_ATTR_STRING(_name, _mode, _str) \
277 { __ATTR(_name, _mode, show_class_attr_string, NULL), _str }
278#define CLASS_ATTR_STRING(_name, _mode, _str) \
279 struct class_attribute_string class_attr_##_name = \
280 _CLASS_ATTR_STRING(_name, _mode, _str)
281
282extern ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr,
283 char *buf);
284
266struct class_interface { 285struct class_interface {
267 struct list_head node; 286 struct list_head node;
268 struct class *class; 287 struct class *class;
@@ -319,13 +338,13 @@ struct device_attribute {
319struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) 338struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
320 339
321extern int __must_check device_create_file(struct device *device, 340extern int __must_check device_create_file(struct device *device,
322 struct device_attribute *entry); 341 const struct device_attribute *entry);
323extern void device_remove_file(struct device *dev, 342extern void device_remove_file(struct device *dev,
324 struct device_attribute *attr); 343 const struct device_attribute *attr);
325extern int __must_check device_create_bin_file(struct device *dev, 344extern int __must_check device_create_bin_file(struct device *dev,
326 struct bin_attribute *attr); 345 const struct bin_attribute *attr);
327extern void device_remove_bin_file(struct device *dev, 346extern void device_remove_bin_file(struct device *dev,
328 struct bin_attribute *attr); 347 const struct bin_attribute *attr);
329extern int device_schedule_callback_owner(struct device *dev, 348extern int device_schedule_callback_owner(struct device *dev,
330 void (*func)(struct device *dev), struct module *owner); 349 void (*func)(struct device *dev), struct module *owner);
331 350
@@ -472,6 +491,38 @@ static inline int device_is_registered(struct device *dev)
472 return dev->kobj.state_in_sysfs; 491 return dev->kobj.state_in_sysfs;
473} 492}
474 493
494static inline void device_enable_async_suspend(struct device *dev)
495{
496 if (dev->power.status == DPM_ON)
497 dev->power.async_suspend = true;
498}
499
500static inline void device_disable_async_suspend(struct device *dev)
501{
502 if (dev->power.status == DPM_ON)
503 dev->power.async_suspend = false;
504}
505
506static inline bool device_async_suspend_enabled(struct device *dev)
507{
508 return !!dev->power.async_suspend;
509}
510
511static inline void device_lock(struct device *dev)
512{
513 down(&dev->sem);
514}
515
516static inline int device_trylock(struct device *dev)
517{
518 return down_trylock(&dev->sem);
519}
520
521static inline void device_unlock(struct device *dev)
522{
523 up(&dev->sem);
524}
525
475void driver_init(void); 526void driver_init(void);
476 527
477/* 528/*
diff --git a/include/linux/dm-io.h b/include/linux/dm-io.h
index b6bf17ee2f61..5c9186b93fff 100644
--- a/include/linux/dm-io.h
+++ b/include/linux/dm-io.h
@@ -37,14 +37,14 @@ enum dm_io_mem_type {
37struct dm_io_memory { 37struct dm_io_memory {
38 enum dm_io_mem_type type; 38 enum dm_io_mem_type type;
39 39
40 unsigned offset;
41
40 union { 42 union {
41 struct page_list *pl; 43 struct page_list *pl;
42 struct bio_vec *bvec; 44 struct bio_vec *bvec;
43 void *vma; 45 void *vma;
44 void *addr; 46 void *addr;
45 } ptr; 47 } ptr;
46
47 unsigned offset;
48}; 48};
49 49
50struct dm_io_notify { 50struct dm_io_notify {
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index aa95508d2f95..2c445e113790 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -266,9 +266,9 @@ enum {
266#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 266#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
267 267
268#define DM_VERSION_MAJOR 4 268#define DM_VERSION_MAJOR 4
269#define DM_VERSION_MINOR 16 269#define DM_VERSION_MINOR 17
270#define DM_VERSION_PATCHLEVEL 0 270#define DM_VERSION_PATCHLEVEL 0
271#define DM_VERSION_EXTRA "-ioctl (2009-11-05)" 271#define DM_VERSION_EXTRA "-ioctl (2010-03-05)"
272 272
273/* Status bits */ 273/* Status bits */
274#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 274#define DM_READONLY_FLAG (1 << 0) /* In/Out */
@@ -316,4 +316,9 @@ enum {
316 */ 316 */
317#define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) /* In */ 317#define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) /* In */
318 318
319/*
320 * If set, a uevent was generated for which the caller may need to wait.
321 */
322#define DM_UEVENT_GENERATED_FLAG (1 << 13) /* Out */
323
319#endif /* _LINUX_DM_IOCTL_H */ 324#endif /* _LINUX_DM_IOCTL_H */
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index c30879cf93bc..96e87693d933 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -23,7 +23,7 @@
23#define DM9000_PLATF_NO_EEPROM (0x0010) 23#define DM9000_PLATF_NO_EEPROM (0x0010)
24#define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */ 24#define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */
25 25
26/* platfrom data for platfrom device structure's platfrom_data field */ 26/* platform data for platform device structure's platform_data field */
27 27
28struct dm9000_plat_data { 28struct dm9000_plat_data {
29 unsigned int flags; 29 unsigned int flags;
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 91b761846061..ca32ed78b057 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -127,6 +127,14 @@ static inline u64 dma_get_mask(struct device *dev)
127 return DMA_BIT_MASK(32); 127 return DMA_BIT_MASK(32);
128} 128}
129 129
130static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
131{
132 if (!dma_supported(dev, mask))
133 return -EIO;
134 dev->coherent_dma_mask = mask;
135 return 0;
136}
137
130extern u64 dma_get_required_mask(struct device *dev); 138extern u64 dma_get_required_mask(struct device *dev);
131 139
132static inline unsigned int dma_get_max_seg_size(struct device *dev) 140static inline unsigned int dma_get_max_seg_size(struct device *dev)
@@ -232,4 +240,20 @@ struct dma_attrs;
232 240
233#endif /* CONFIG_HAVE_DMA_ATTRS */ 241#endif /* CONFIG_HAVE_DMA_ATTRS */
234 242
243#ifdef CONFIG_NEED_DMA_MAP_STATE
244#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME
245#define DEFINE_DMA_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME
246#define dma_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
247#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
248#define dma_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
249#define dma_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
250#else
251#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)
252#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)
253#define dma_unmap_addr(PTR, ADDR_NAME) (0)
254#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
255#define dma_unmap_len(PTR, LEN_NAME) (0)
256#define dma_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
257#endif
258
235#endif 259#endif
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 2b9f2ac7ed60..20ea12c86fd0 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -31,6 +31,8 @@
31 * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code 31 * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code
32 */ 32 */
33typedef s32 dma_cookie_t; 33typedef s32 dma_cookie_t;
34#define DMA_MIN_COOKIE 1
35#define DMA_MAX_COOKIE INT_MAX
34 36
35#define dma_submit_error(cookie) ((cookie) < 0 ? 1 : 0) 37#define dma_submit_error(cookie) ((cookie) < 0 ? 1 : 0)
36 38
@@ -74,7 +76,7 @@ enum dma_transaction_type {
74 * control completion, and communicate status. 76 * control completion, and communicate status.
75 * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of 77 * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
76 * this transaction 78 * this transaction
77 * @DMA_CTRL_ACK - the descriptor cannot be reused until the client 79 * @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client
78 * acknowledges receipt, i.e. has has a chance to establish any dependency 80 * acknowledges receipt, i.e. has has a chance to establish any dependency
79 * chains 81 * chains
80 * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) 82 * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s)
@@ -162,7 +164,7 @@ struct dma_chan {
162 struct dma_chan_dev *dev; 164 struct dma_chan_dev *dev;
163 165
164 struct list_head device_node; 166 struct list_head device_node;
165 struct dma_chan_percpu *local; 167 struct dma_chan_percpu __percpu *local;
166 int client_count; 168 int client_count;
167 int table_count; 169 int table_count;
168 void *private; 170 void *private;
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index e84f4733cb55..78962272338a 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -53,7 +53,7 @@
53 53
54 54
55extern const char *drbd_buildtag(void); 55extern const char *drbd_buildtag(void);
56#define REL_VERSION "8.3.6" 56#define REL_VERSION "8.3.7"
57#define API_VERSION 88 57#define API_VERSION 88
58#define PRO_VERSION_MIN 86 58#define PRO_VERSION_MIN 86
59#define PRO_VERSION_MAX 91 59#define PRO_VERSION_MAX 91
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h
index db5721ad50d1..a4d82f895994 100644
--- a/include/linux/drbd_nl.h
+++ b/include/linux/drbd_nl.h
@@ -69,6 +69,7 @@ NL_PACKET(disconnect, 6, )
69 69
70NL_PACKET(resize, 7, 70NL_PACKET(resize, 7,
71 NL_INT64( 29, T_MAY_IGNORE, resize_size) 71 NL_INT64( 29, T_MAY_IGNORE, resize_size)
72 NL_BIT( 68, T_MAY_IGNORE, resize_force)
72) 73)
73 74
74NL_PACKET(syncer_conf, 8, 75NL_PACKET(syncer_conf, 8,
diff --git a/include/linux/dst.h b/include/linux/dst.h
deleted file mode 100644
index e26fed84b1aa..000000000000
--- a/include/linux/dst.h
+++ /dev/null
@@ -1,587 +0,0 @@
1/*
2 * 2007+ Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru>
3 * All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __DST_H
17#define __DST_H
18
19#include <linux/types.h>
20#include <linux/connector.h>
21
22#define DST_NAMELEN 32
23#define DST_NAME "dst"
24
25enum {
26 /* Remove node with given id from storage */
27 DST_DEL_NODE = 0,
28 /* Add remote node with given id to the storage */
29 DST_ADD_REMOTE,
30 /* Add local node with given id to the storage to be exported and used by remote peers */
31 DST_ADD_EXPORT,
32 /* Crypto initialization command (hash/cipher used to protect the connection) */
33 DST_CRYPTO,
34 /* Security attributes for given connection (permissions for example) */
35 DST_SECURITY,
36 /* Register given node in the block layer subsystem */
37 DST_START,
38 DST_CMD_MAX
39};
40
41struct dst_ctl
42{
43 /* Storage name */
44 char name[DST_NAMELEN];
45 /* Command flags */
46 __u32 flags;
47 /* Command itself (see above) */
48 __u32 cmd;
49 /* Maximum number of pages per single request in this device */
50 __u32 max_pages;
51 /* Stale/error transaction scanning timeout in milliseconds */
52 __u32 trans_scan_timeout;
53 /* Maximum number of retry sends before completing transaction as broken */
54 __u32 trans_max_retries;
55 /* Storage size */
56 __u64 size;
57};
58
59/* Reply command carries completion status */
60struct dst_ctl_ack
61{
62 struct cn_msg msg;
63 int error;
64 int unused[3];
65};
66
67/*
68 * Unfortunaltely socket address structure is not exported to userspace
69 * and is redefined there.
70 */
71#define SADDR_MAX_DATA 128
72
73struct saddr {
74 /* address family, AF_xxx */
75 unsigned short sa_family;
76 /* 14 bytes of protocol address */
77 char sa_data[SADDR_MAX_DATA];
78 /* Number of bytes used in sa_data */
79 unsigned short sa_data_len;
80};
81
82/* Address structure */
83struct dst_network_ctl
84{
85 /* Socket type: datagram, stream...*/
86 unsigned int type;
87 /* Let me guess, is it a Jupiter diameter? */
88 unsigned int proto;
89 /* Peer's address */
90 struct saddr addr;
91};
92
93struct dst_crypto_ctl
94{
95 /* Cipher and hash names */
96 char cipher_algo[DST_NAMELEN];
97 char hash_algo[DST_NAMELEN];
98
99 /* Key sizes. Can be zero for digest for example */
100 unsigned int cipher_keysize, hash_keysize;
101 /* Alignment. Calculated by the DST itself. */
102 unsigned int crypto_attached_size;
103 /* Number of threads to perform crypto operations */
104 int thread_num;
105};
106
107/* Export security attributes have this bits checked in when client connects */
108#define DST_PERM_READ (1<<0)
109#define DST_PERM_WRITE (1<<1)
110
111/*
112 * Right now it is simple model, where each remote address
113 * is assigned to set of permissions it is allowed to perform.
114 * In real world block device does not know anything but
115 * reading and writing, so it should be more than enough.
116 */
117struct dst_secure_user
118{
119 unsigned int permissions;
120 struct saddr addr;
121};
122
123/*
124 * Export control command: device to export and network address to accept
125 * clients to work with given device
126 */
127struct dst_export_ctl
128{
129 char device[DST_NAMELEN];
130 struct dst_network_ctl ctl;
131};
132
133enum {
134 DST_CFG = 1, /* Request remote configuration */
135 DST_IO, /* IO command */
136 DST_IO_RESPONSE, /* IO response */
137 DST_PING, /* Keepalive message */
138 DST_NCMD_MAX,
139};
140
141struct dst_cmd
142{
143 /* Network command itself, see above */
144 __u32 cmd;
145 /*
146 * Size of the attached data
147 * (in most cases, for READ command it means how many bytes were requested)
148 */
149 __u32 size;
150 /* Crypto size: number of attached bytes with digest/hmac */
151 __u32 csize;
152 /* Here we can carry secret data */
153 __u32 reserved;
154 /* Read/write bits, see how they are encoded in bio structure */
155 __u64 rw;
156 /* BIO flags */
157 __u64 flags;
158 /* Unique command id (like transaction ID) */
159 __u64 id;
160 /* Sector to start IO from */
161 __u64 sector;
162 /* Hash data is placed after this header */
163 __u8 hash[0];
164};
165
166/*
167 * Convert command to/from network byte order.
168 * We do not use hton*() functions, since there is
169 * no 64-bit implementation.
170 */
171static inline void dst_convert_cmd(struct dst_cmd *c)
172{
173 c->cmd = __cpu_to_be32(c->cmd);
174 c->csize = __cpu_to_be32(c->csize);
175 c->size = __cpu_to_be32(c->size);
176 c->sector = __cpu_to_be64(c->sector);
177 c->id = __cpu_to_be64(c->id);
178 c->flags = __cpu_to_be64(c->flags);
179 c->rw = __cpu_to_be64(c->rw);
180}
181
182/* Transaction id */
183typedef __u64 dst_gen_t;
184
185#ifdef __KERNEL__
186
187#include <linux/blkdev.h>
188#include <linux/bio.h>
189#include <linux/device.h>
190#include <linux/mempool.h>
191#include <linux/net.h>
192#include <linux/poll.h>
193#include <linux/rbtree.h>
194
195#ifdef CONFIG_DST_DEBUG
196#define dprintk(f, a...) printk(KERN_NOTICE f, ##a)
197#else
198static inline void __attribute__ ((format (printf, 1, 2)))
199 dprintk(const char *fmt, ...) {}
200#endif
201
202struct dst_node;
203
204struct dst_trans
205{
206 /* DST node we are working with */
207 struct dst_node *n;
208
209 /* Entry inside transaction tree */
210 struct rb_node trans_entry;
211
212 /* Merlin kills this transaction when this memory cell equals zero */
213 atomic_t refcnt;
214
215 /* How this transaction should be processed by crypto engine */
216 short enc;
217 /* How many times this transaction was resent */
218 short retries;
219 /* Completion status */
220 int error;
221
222 /* When did we send it to the remote peer */
223 long send_time;
224
225 /* My name is...
226 * Well, computers does not speak, they have unique id instead */
227 dst_gen_t gen;
228
229 /* Block IO we are working with */
230 struct bio *bio;
231
232 /* Network command for above block IO request */
233 struct dst_cmd cmd;
234};
235
236struct dst_crypto_engine
237{
238 /* What should we do with all block requests */
239 struct crypto_hash *hash;
240 struct crypto_ablkcipher *cipher;
241
242 /* Pool of pages used to encrypt data into before sending */
243 int page_num;
244 struct page **pages;
245
246 /* What to do with current request */
247 int enc;
248 /* Who we are and where do we go */
249 struct scatterlist *src, *dst;
250
251 /* Maximum timeout waiting for encryption to be completed */
252 long timeout;
253 /* IV is a 64-bit sequential counter */
254 u64 iv;
255
256 /* Secret data */
257 void *private;
258
259 /* Cached temporary data lives here */
260 int size;
261 void *data;
262};
263
264struct dst_state
265{
266 /* The main state protection */
267 struct mutex state_lock;
268
269 /* Polling machinery for sockets */
270 wait_queue_t wait;
271 wait_queue_head_t *whead;
272 /* Most of events are being waited here */
273 wait_queue_head_t thread_wait;
274
275 /* Who owns this? */
276 struct dst_node *node;
277
278 /* Network address for this state */
279 struct dst_network_ctl ctl;
280
281 /* Permissions to work with: read-only or rw connection */
282 u32 permissions;
283
284 /* Called when we need to clean private data */
285 void (* cleanup)(struct dst_state *st);
286
287 /* Used by the server: BIO completion queues BIOs here */
288 struct list_head request_list;
289 spinlock_t request_lock;
290
291 /* Guess what? No, it is not number of planets */
292 atomic_t refcnt;
293
294 /* This flags is set when connection should be dropped */
295 int need_exit;
296
297 /*
298 * Socket to work with. Second pointer is used for
299 * lockless check if socket was changed before performing
300 * next action (like working with cached polling result)
301 */
302 struct socket *socket, *read_socket;
303
304 /* Cached preallocated data */
305 void *data;
306 unsigned int size;
307
308 /* Currently processed command */
309 struct dst_cmd cmd;
310};
311
312struct dst_info
313{
314 /* Device size */
315 u64 size;
316
317 /* Local device name for export devices */
318 char local[DST_NAMELEN];
319
320 /* Network setup */
321 struct dst_network_ctl net;
322
323 /* Sysfs bits use this */
324 struct device device;
325};
326
327struct dst_node
328{
329 struct list_head node_entry;
330
331 /* Hi, my name is stored here */
332 char name[DST_NAMELEN];
333 /* My cache name is stored here */
334 char cache_name[DST_NAMELEN];
335
336 /* Block device attached to given node.
337 * Only valid for exporting nodes */
338 struct block_device *bdev;
339 /* Network state machine for given peer */
340 struct dst_state *state;
341
342 /* Block IO machinery */
343 struct request_queue *queue;
344 struct gendisk *disk;
345
346 /* Number of threads in processing pool */
347 int thread_num;
348 /* Maximum number of pages in single IO */
349 int max_pages;
350
351 /* I'm that big in bytes */
352 loff_t size;
353
354 /* Exported to userspace node information */
355 struct dst_info *info;
356
357 /*
358 * Security attribute list.
359 * Used only by exporting node currently.
360 */
361 struct list_head security_list;
362 struct mutex security_lock;
363
364 /*
365 * When this unerflows below zero, university collapses.
366 * But this will not happen, since node will be freed,
367 * when reference counter reaches zero.
368 */
369 atomic_t refcnt;
370
371 /* How precisely should I be started? */
372 int (*start)(struct dst_node *);
373
374 /* Crypto capabilities */
375 struct dst_crypto_ctl crypto;
376 u8 *hash_key;
377 u8 *cipher_key;
378
379 /* Pool of processing thread */
380 struct thread_pool *pool;
381
382 /* Transaction IDs live here */
383 atomic_long_t gen;
384
385 /*
386 * How frequently and how many times transaction
387 * tree should be scanned to drop stale objects.
388 */
389 long trans_scan_timeout;
390 int trans_max_retries;
391
392 /* Small gnomes live here */
393 struct rb_root trans_root;
394 struct mutex trans_lock;
395
396 /*
397 * Transaction cache/memory pool.
398 * It is big enough to contain not only transaction
399 * itself, but additional crypto data (digest/hmac).
400 */
401 struct kmem_cache *trans_cache;
402 mempool_t *trans_pool;
403
404 /* This entity scans transaction tree */
405 struct delayed_work trans_work;
406
407 wait_queue_head_t wait;
408};
409
410/* Kernel representation of the security attribute */
411struct dst_secure
412{
413 struct list_head sec_entry;
414 struct dst_secure_user sec;
415};
416
417int dst_process_bio(struct dst_node *n, struct bio *bio);
418
419int dst_node_init_connected(struct dst_node *n, struct dst_network_ctl *r);
420int dst_node_init_listened(struct dst_node *n, struct dst_export_ctl *le);
421
422static inline struct dst_state *dst_state_get(struct dst_state *st)
423{
424 BUG_ON(atomic_read(&st->refcnt) == 0);
425 atomic_inc(&st->refcnt);
426 return st;
427}
428
429void dst_state_put(struct dst_state *st);
430
431struct dst_state *dst_state_alloc(struct dst_node *n);
432int dst_state_socket_create(struct dst_state *st);
433void dst_state_socket_release(struct dst_state *st);
434
435void dst_state_exit_connected(struct dst_state *st);
436
437int dst_state_schedule_receiver(struct dst_state *st);
438
439void dst_dump_addr(struct socket *sk, struct sockaddr *sa, char *str);
440
441static inline void dst_state_lock(struct dst_state *st)
442{
443 mutex_lock(&st->state_lock);
444}
445
446static inline void dst_state_unlock(struct dst_state *st)
447{
448 mutex_unlock(&st->state_lock);
449}
450
451void dst_poll_exit(struct dst_state *st);
452int dst_poll_init(struct dst_state *st);
453
454static inline unsigned int dst_state_poll(struct dst_state *st)
455{
456 unsigned int revents = POLLHUP | POLLERR;
457
458 dst_state_lock(st);
459 if (st->socket)
460 revents = st->socket->ops->poll(NULL, st->socket, NULL);
461 dst_state_unlock(st);
462
463 return revents;
464}
465
466static inline int dst_thread_setup(void *private, void *data)
467{
468 return 0;
469}
470
471void dst_node_put(struct dst_node *n);
472
473static inline struct dst_node *dst_node_get(struct dst_node *n)
474{
475 atomic_inc(&n->refcnt);
476 return n;
477}
478
479int dst_data_recv(struct dst_state *st, void *data, unsigned int size);
480int dst_recv_cdata(struct dst_state *st, void *cdata);
481int dst_data_send_header(struct socket *sock,
482 void *data, unsigned int size, int more);
483
484int dst_send_bio(struct dst_state *st, struct dst_cmd *cmd, struct bio *bio);
485
486int dst_process_io(struct dst_state *st);
487int dst_export_crypto(struct dst_node *n, struct bio *bio);
488int dst_export_send_bio(struct bio *bio);
489int dst_start_export(struct dst_node *n);
490
491int __init dst_export_init(void);
492void dst_export_exit(void);
493
494/* Private structure for export block IO requests */
495struct dst_export_priv
496{
497 struct list_head request_entry;
498 struct dst_state *state;
499 struct bio *bio;
500 struct dst_cmd cmd;
501};
502
503static inline void dst_trans_get(struct dst_trans *t)
504{
505 atomic_inc(&t->refcnt);
506}
507
508struct dst_trans *dst_trans_search(struct dst_node *node, dst_gen_t gen);
509int dst_trans_remove(struct dst_trans *t);
510int dst_trans_remove_nolock(struct dst_trans *t);
511void dst_trans_put(struct dst_trans *t);
512
513/*
514 * Convert bio into network command.
515 */
516static inline void dst_bio_to_cmd(struct bio *bio, struct dst_cmd *cmd,
517 u32 command, u64 id)
518{
519 cmd->cmd = command;
520 cmd->flags = (bio->bi_flags << BIO_POOL_BITS) >> BIO_POOL_BITS;
521 cmd->rw = bio->bi_rw;
522 cmd->size = bio->bi_size;
523 cmd->csize = 0;
524 cmd->id = id;
525 cmd->sector = bio->bi_sector;
526};
527
528int dst_trans_send(struct dst_trans *t);
529int dst_trans_crypto(struct dst_trans *t);
530
531int dst_node_crypto_init(struct dst_node *n, struct dst_crypto_ctl *ctl);
532void dst_node_crypto_exit(struct dst_node *n);
533
534static inline int dst_need_crypto(struct dst_node *n)
535{
536 struct dst_crypto_ctl *c = &n->crypto;
537 /*
538 * Logical OR is appropriate here, but boolean one produces
539 * more optimal code, so it is used instead.
540 */
541 return (c->hash_algo[0] | c->cipher_algo[0]);
542}
543
544int dst_node_trans_init(struct dst_node *n, unsigned int size);
545void dst_node_trans_exit(struct dst_node *n);
546
547/*
548 * Pool of threads.
549 * Ready list contains threads currently free to be used,
550 * active one contains threads with some work scheduled for them.
551 * Caller can wait in given queue when thread is ready.
552 */
553struct thread_pool
554{
555 int thread_num;
556 struct mutex thread_lock;
557 struct list_head ready_list, active_list;
558
559 wait_queue_head_t wait;
560};
561
562void thread_pool_del_worker(struct thread_pool *p);
563void thread_pool_del_worker_id(struct thread_pool *p, unsigned int id);
564int thread_pool_add_worker(struct thread_pool *p,
565 char *name,
566 unsigned int id,
567 void *(* init)(void *data),
568 void (* cleanup)(void *data),
569 void *data);
570
571void thread_pool_destroy(struct thread_pool *p);
572struct thread_pool *thread_pool_create(int num, char *name,
573 void *(* init)(void *data),
574 void (* cleanup)(void *data),
575 void *data);
576
577int thread_pool_schedule(struct thread_pool *p,
578 int (* setup)(void *stored_private, void *setup_data),
579 int (* action)(void *stored_private, void *setup_data),
580 void *setup_data, long timeout);
581int thread_pool_schedule_private(struct thread_pool *p,
582 int (* setup)(void *private, void *data),
583 int (* action)(void *private, void *data),
584 void *data, long timeout, void *id);
585
586#endif /* __KERNEL__ */
587#endif /* __DST_H */
diff --git a/include/linux/early_res.h b/include/linux/early_res.h
new file mode 100644
index 000000000000..29c09f57a13c
--- /dev/null
+++ b/include/linux/early_res.h
@@ -0,0 +1,23 @@
1#ifndef _LINUX_EARLY_RES_H
2#define _LINUX_EARLY_RES_H
3#ifdef __KERNEL__
4
5extern void reserve_early(u64 start, u64 end, char *name);
6extern void reserve_early_overlap_ok(u64 start, u64 end, char *name);
7extern void free_early(u64 start, u64 end);
8void free_early_partial(u64 start, u64 end);
9extern void early_res_to_bootmem(u64 start, u64 end);
10
11void reserve_early_without_check(u64 start, u64 end, char *name);
12u64 find_early_area(u64 ei_start, u64 ei_last, u64 start, u64 end,
13 u64 size, u64 align);
14u64 find_early_area_size(u64 ei_start, u64 ei_last, u64 start,
15 u64 *sizep, u64 align);
16u64 find_fw_memmap_area(u64 start, u64 end, u64 size, u64 align);
17u64 get_max_mapped(void);
18#include <linux/range.h>
19int get_free_all_memory_range(struct range **rangep, int nodeid);
20
21#endif /* __KERNEL__ */
22
23#endif /* _LINUX_EARLY_RES_H */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 90a4ed0ea0e5..597858418051 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -50,6 +50,28 @@ typedef __s64 Elf64_Sxword;
50 50
51#define PT_GNU_STACK (PT_LOOS + 0x474e551) 51#define PT_GNU_STACK (PT_LOOS + 0x474e551)
52 52
53/*
54 * Extended Numbering
55 *
56 * If the real number of program header table entries is larger than
57 * or equal to PN_XNUM(0xffff), it is set to sh_info field of the
58 * section header at index 0, and PN_XNUM is set to e_phnum
59 * field. Otherwise, the section header at index 0 is zero
60 * initialized, if it exists.
61 *
62 * Specifications are available in:
63 *
64 * - Sun microsystems: Linker and Libraries.
65 * Part No: 817-1984-17, September 2008.
66 * URL: http://docs.sun.com/app/docs/doc/817-1984
67 *
68 * - System V ABI AMD64 Architecture Processor Supplement
69 * Draft Version 0.99.,
70 * May 11, 2009.
71 * URL: http://www.x86-64.org/
72 */
73#define PN_XNUM 0xffff
74
53/* These constants define the different elf file types */ 75/* These constants define the different elf file types */
54#define ET_NONE 0 76#define ET_NONE 0
55#define ET_REL 1 77#define ET_REL 1
@@ -286,7 +308,7 @@ typedef struct elf64_phdr {
286#define SHN_COMMON 0xfff2 308#define SHN_COMMON 0xfff2
287#define SHN_HIRESERVE 0xffff 309#define SHN_HIRESERVE 0xffff
288 310
289typedef struct { 311typedef struct elf32_shdr {
290 Elf32_Word sh_name; 312 Elf32_Word sh_name;
291 Elf32_Word sh_type; 313 Elf32_Word sh_type;
292 Elf32_Word sh_flags; 314 Elf32_Word sh_flags;
@@ -349,7 +371,11 @@ typedef struct elf64_shdr {
349#define ELF_OSABI ELFOSABI_NONE 371#define ELF_OSABI ELFOSABI_NONE
350#endif 372#endif
351 373
352/* Notes used in ET_CORE */ 374/*
375 * Notes used in ET_CORE. Architectures export some of the arch register sets
376 * using the corresponding note types via the PTRACE_GETREGSET and
377 * PTRACE_SETREGSET requests.
378 */
353#define NT_PRSTATUS 1 379#define NT_PRSTATUS 1
354#define NT_PRFPREG 2 380#define NT_PRFPREG 2
355#define NT_PRPSINFO 3 381#define NT_PRPSINFO 3
@@ -361,7 +387,13 @@ typedef struct elf64_shdr {
361#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ 387#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
362#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ 388#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
363#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ 389#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
364#define NT_PRXSTATUS 0x300 /* s390 upper register halves */ 390#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
391#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
392#define NT_S390_TIMER 0x301 /* s390 timer register */
393#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
394#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
395#define NT_S390_CTRS 0x304 /* s390 control registers */
396#define NT_S390_PREFIX 0x305 /* s390 prefix register */
365 397
366 398
367/* Note header in a PT_NOTE section */ 399/* Note header in a PT_NOTE section */
@@ -384,16 +416,20 @@ typedef struct elf64_note {
384extern Elf32_Dyn _DYNAMIC []; 416extern Elf32_Dyn _DYNAMIC [];
385#define elfhdr elf32_hdr 417#define elfhdr elf32_hdr
386#define elf_phdr elf32_phdr 418#define elf_phdr elf32_phdr
419#define elf_shdr elf32_shdr
387#define elf_note elf32_note 420#define elf_note elf32_note
388#define elf_addr_t Elf32_Off 421#define elf_addr_t Elf32_Off
422#define Elf_Half Elf32_Half
389 423
390#else 424#else
391 425
392extern Elf64_Dyn _DYNAMIC []; 426extern Elf64_Dyn _DYNAMIC [];
393#define elfhdr elf64_hdr 427#define elfhdr elf64_hdr
394#define elf_phdr elf64_phdr 428#define elf_phdr elf64_phdr
429#define elf_shdr elf64_shdr
395#define elf_note elf64_note 430#define elf_note elf64_note
396#define elf_addr_t Elf64_Off 431#define elf_addr_t Elf64_Off
432#define Elf_Half Elf64_Half
397 433
398#endif 434#endif
399 435
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 00d6a68d0421..e687bc3ba4da 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -8,6 +8,8 @@
8#include <linux/user.h> 8#include <linux/user.h>
9#endif 9#endif
10#include <linux/ptrace.h> 10#include <linux/ptrace.h>
11#include <linux/elf.h>
12#include <linux/fs.h>
11 13
12struct elf_siginfo 14struct elf_siginfo
13{ 15{
@@ -150,5 +152,20 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
150 152
151#endif /* __KERNEL__ */ 153#endif /* __KERNEL__ */
152 154
155/*
156 * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
157 * extra segments containing the gate DSO contents. Dumping its
158 * contents makes post-mortem fully interpretable later without matching up
159 * the same kernel and hardware config to see what PC values meant.
160 * Dumping its extra ELF program headers includes all the other information
161 * a debugger needs to easily find how the gate DSO was being used.
162 */
163extern Elf_Half elf_core_extra_phdrs(void);
164extern int
165elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,
166 unsigned long limit);
167extern int
168elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
169extern size_t elf_core_extra_data_size(void);
153 170
154#endif /* _LINUX_ELFCORE_H */ 171#endif /* _LINUX_ELFCORE_H */
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h
index 90d1c2184112..9a33c5f7e126 100644
--- a/include/linux/enclosure.h
+++ b/include/linux/enclosure.h
@@ -42,6 +42,8 @@ enum enclosure_status {
42 ENCLOSURE_STATUS_NOT_INSTALLED, 42 ENCLOSURE_STATUS_NOT_INSTALLED,
43 ENCLOSURE_STATUS_UNKNOWN, 43 ENCLOSURE_STATUS_UNKNOWN,
44 ENCLOSURE_STATUS_UNAVAILABLE, 44 ENCLOSURE_STATUS_UNAVAILABLE,
45 /* last element for counting purposes */
46 ENCLOSURE_STATUS_MAX
45}; 47};
46 48
47/* SFF-8485 activity light settings */ 49/* SFF-8485 activity light settings */
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index ef4a2d84d922..b33f316bb92e 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -61,6 +61,13 @@ struct ethtool_drvinfo {
61 /* For PCI devices, use pci_name(pci_dev). */ 61 /* For PCI devices, use pci_name(pci_dev). */
62 char reserved1[32]; 62 char reserved1[32];
63 char reserved2[12]; 63 char reserved2[12];
64 /*
65 * Some struct members below are filled in
66 * using ops->get_sset_count(). Obtaining
67 * this info from ethtool_drvinfo is now
68 * deprecated; Use ETHTOOL_GSSET_INFO
69 * instead.
70 */
64 __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ 71 __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */
65 __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ 72 __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
66 __u32 testinfo_len; 73 __u32 testinfo_len;
@@ -242,6 +249,7 @@ enum ethtool_stringset {
242 ETH_SS_TEST = 0, 249 ETH_SS_TEST = 0,
243 ETH_SS_STATS, 250 ETH_SS_STATS,
244 ETH_SS_PRIV_FLAGS, 251 ETH_SS_PRIV_FLAGS,
252 ETH_SS_NTUPLE_FILTERS,
245}; 253};
246 254
247/* for passing string sets for data tagging */ 255/* for passing string sets for data tagging */
@@ -252,6 +260,17 @@ struct ethtool_gstrings {
252 __u8 data[0]; 260 __u8 data[0];
253}; 261};
254 262
263struct ethtool_sset_info {
264 __u32 cmd; /* ETHTOOL_GSSET_INFO */
265 __u32 reserved;
266 __u64 sset_mask; /* input: each bit selects an sset to query */
267 /* output: each bit a returned sset */
268 __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits
269 in sset_mask. One bit implies one
270 __u32, two bits implies two
271 __u32's, etc. */
272};
273
255enum ethtool_test_flags { 274enum ethtool_test_flags {
256 ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ 275 ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */
257 ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ 276 ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */
@@ -290,6 +309,7 @@ struct ethtool_perm_addr {
290 */ 309 */
291enum ethtool_flags { 310enum ethtool_flags {
292 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ 311 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
312 ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */
293}; 313};
294 314
295/* The following structures are for supporting RX network flow 315/* The following structures are for supporting RX network flow
@@ -363,6 +383,35 @@ struct ethtool_rxnfc {
363 __u32 rule_locs[0]; 383 __u32 rule_locs[0];
364}; 384};
365 385
386struct ethtool_rx_ntuple_flow_spec {
387 __u32 flow_type;
388 union {
389 struct ethtool_tcpip4_spec tcp_ip4_spec;
390 struct ethtool_tcpip4_spec udp_ip4_spec;
391 struct ethtool_tcpip4_spec sctp_ip4_spec;
392 struct ethtool_ah_espip4_spec ah_ip4_spec;
393 struct ethtool_ah_espip4_spec esp_ip4_spec;
394 struct ethtool_rawip4_spec raw_ip4_spec;
395 struct ethtool_ether_spec ether_spec;
396 struct ethtool_usrip4_spec usr_ip4_spec;
397 __u8 hdata[64];
398 } h_u, m_u; /* entry, mask */
399
400 __u16 vlan_tag;
401 __u16 vlan_tag_mask;
402 __u64 data; /* user-defined flow spec data */
403 __u64 data_mask; /* user-defined flow spec mask */
404
405 /* signed to distinguish between queue and actions (DROP) */
406 __s32 action;
407#define ETHTOOL_RXNTUPLE_ACTION_DROP -1
408};
409
410struct ethtool_rx_ntuple {
411 __u32 cmd;
412 struct ethtool_rx_ntuple_flow_spec fs;
413};
414
366#define ETHTOOL_FLASH_MAX_FILENAME 128 415#define ETHTOOL_FLASH_MAX_FILENAME 128
367enum ethtool_flash_op_type { 416enum ethtool_flash_op_type {
368 ETHTOOL_FLASH_ALL_REGIONS = 0, 417 ETHTOOL_FLASH_ALL_REGIONS = 0,
@@ -377,6 +426,20 @@ struct ethtool_flash {
377 426
378#ifdef __KERNEL__ 427#ifdef __KERNEL__
379 428
429#include <linux/rculist.h>
430
431struct ethtool_rx_ntuple_flow_spec_container {
432 struct ethtool_rx_ntuple_flow_spec fs;
433 struct list_head list;
434};
435
436struct ethtool_rx_ntuple_list {
437#define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024
438#define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14
439 struct list_head list;
440 unsigned int count;
441};
442
380struct net_device; 443struct net_device;
381 444
382/* Some generic methods drivers may use in their ethtool_ops */ 445/* Some generic methods drivers may use in their ethtool_ops */
@@ -394,6 +457,7 @@ u32 ethtool_op_get_ufo(struct net_device *dev);
394int ethtool_op_set_ufo(struct net_device *dev, u32 data); 457int ethtool_op_set_ufo(struct net_device *dev, u32 data);
395u32 ethtool_op_get_flags(struct net_device *dev); 458u32 ethtool_op_get_flags(struct net_device *dev);
396int ethtool_op_set_flags(struct net_device *dev, u32 data); 459int ethtool_op_set_flags(struct net_device *dev, u32 data);
460void ethtool_ntuple_flush(struct net_device *dev);
397 461
398/** 462/**
399 * &ethtool_ops - Alter and report network device settings 463 * &ethtool_ops - Alter and report network device settings
@@ -500,6 +564,8 @@ struct ethtool_ops {
500 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 564 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
501 int (*flash_device)(struct net_device *, struct ethtool_flash *); 565 int (*flash_device)(struct net_device *, struct ethtool_flash *);
502 int (*reset)(struct net_device *, u32 *); 566 int (*reset)(struct net_device *, u32 *);
567 int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *);
568 int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *);
503}; 569};
504#endif /* __KERNEL__ */ 570#endif /* __KERNEL__ */
505 571
@@ -558,6 +624,9 @@ struct ethtool_ops {
558#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ 624#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
559#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ 625#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
560#define ETHTOOL_RESET 0x00000034 /* Reset hardware */ 626#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
627#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
628#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */
629#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
561 630
562/* compatibility with older code */ 631/* compatibility with older code */
563#define SPARC_ETH_GSET ETHTOOL_GSET 632#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h
index 94dd10366a78..91bb4f27238c 100644
--- a/include/linux/eventfd.h
+++ b/include/linux/eventfd.h
@@ -10,6 +10,7 @@
10 10
11#include <linux/fcntl.h> 11#include <linux/fcntl.h>
12#include <linux/file.h> 12#include <linux/file.h>
13#include <linux/wait.h>
13 14
14/* 15/*
15 * CAREFUL: Check include/asm-generic/fcntl.h when defining 16 * CAREFUL: Check include/asm-generic/fcntl.h when defining
@@ -34,6 +35,9 @@ struct file *eventfd_fget(int fd);
34struct eventfd_ctx *eventfd_ctx_fdget(int fd); 35struct eventfd_ctx *eventfd_ctx_fdget(int fd);
35struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); 36struct eventfd_ctx *eventfd_ctx_fileget(struct file *file);
36int eventfd_signal(struct eventfd_ctx *ctx, int n); 37int eventfd_signal(struct eventfd_ctx *ctx, int n);
38ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, __u64 *cnt);
39int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_t *wait,
40 __u64 *cnt);
37 41
38#else /* CONFIG_EVENTFD */ 42#else /* CONFIG_EVENTFD */
39 43
@@ -61,6 +65,18 @@ static inline void eventfd_ctx_put(struct eventfd_ctx *ctx)
61 65
62} 66}
63 67
68static inline ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait,
69 __u64 *cnt)
70{
71 return -ENOSYS;
72}
73
74static inline int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx,
75 wait_queue_t *wait, __u64 *cnt)
76{
77 return -ENOSYS;
78}
79
64#endif 80#endif
65 81
66#endif /* _LINUX_EVENTFD_H */ 82#endif /* _LINUX_EVENTFD_H */
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index 27e772cefb6a..a9cd507f8cd2 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -96,8 +96,9 @@ struct fid {
96 * @fh_to_parent: find the implied object's parent and get a dentry for it 96 * @fh_to_parent: find the implied object's parent and get a dentry for it
97 * @get_name: find the name for a given inode in a given directory 97 * @get_name: find the name for a given inode in a given directory
98 * @get_parent: find the parent of a given directory 98 * @get_parent: find the parent of a given directory
99 * @commit_metadata: commit metadata changes to stable storage
99 * 100 *
100 * See Documentation/filesystems/Exporting for details on how to use 101 * See Documentation/filesystems/nfs/Exporting for details on how to use
101 * this interface correctly. 102 * this interface correctly.
102 * 103 *
103 * encode_fh: 104 * encode_fh:
@@ -137,6 +138,9 @@ struct fid {
137 * is also a directory. In the event that it cannot be found, or storage 138 * is also a directory. In the event that it cannot be found, or storage
138 * space cannot be allocated, a %ERR_PTR should be returned. 139 * space cannot be allocated, a %ERR_PTR should be returned.
139 * 140 *
141 * commit_metadata:
142 * @commit_metadata should commit metadata changes to stable storage.
143 *
140 * Locking rules: 144 * Locking rules:
141 * get_parent is called with child->d_inode->i_mutex down 145 * get_parent is called with child->d_inode->i_mutex down
142 * get_name is not (which is possibly inconsistent) 146 * get_name is not (which is possibly inconsistent)
@@ -152,6 +156,7 @@ struct export_operations {
152 int (*get_name)(struct dentry *parent, char *name, 156 int (*get_name)(struct dentry *parent, char *name,
153 struct dentry *child); 157 struct dentry *child);
154 struct dentry * (*get_parent)(struct dentry *child); 158 struct dentry * (*get_parent)(struct dentry *child);
159 int (*commit_metadata)(struct inode *inode);
155}; 160};
156 161
157extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, 162extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid,
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 6b049030fbe6..5f494b465097 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -202,14 +202,6 @@ static inline __u32 ext3_mask_flags(umode_t mode, __u32 flags)
202 return flags & EXT3_OTHER_FLMASK; 202 return flags & EXT3_OTHER_FLMASK;
203} 203}
204 204
205/*
206 * Inode dynamic state flags
207 */
208#define EXT3_STATE_JDATA 0x00000001 /* journaled data exists */
209#define EXT3_STATE_NEW 0x00000002 /* inode is newly created */
210#define EXT3_STATE_XATTR 0x00000004 /* has in-inode xattrs */
211#define EXT3_STATE_FLUSH_ON_CLOSE 0x00000008
212
213/* Used to pass group descriptor data when online resize is done */ 205/* Used to pass group descriptor data when online resize is done */
214struct ext3_new_group_input { 206struct ext3_new_group_input {
215 __u32 group; /* Group number for this data */ 207 __u32 group; /* Group number for this data */
@@ -560,6 +552,31 @@ static inline int ext3_valid_inum(struct super_block *sb, unsigned long ino)
560 (ino >= EXT3_FIRST_INO(sb) && 552 (ino >= EXT3_FIRST_INO(sb) &&
561 ino <= le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count)); 553 ino <= le32_to_cpu(EXT3_SB(sb)->s_es->s_inodes_count));
562} 554}
555
556/*
557 * Inode dynamic state flags
558 */
559enum {
560 EXT3_STATE_JDATA, /* journaled data exists */
561 EXT3_STATE_NEW, /* inode is newly created */
562 EXT3_STATE_XATTR, /* has in-inode xattrs */
563 EXT3_STATE_FLUSH_ON_CLOSE, /* flush dirty pages on close */
564};
565
566static inline int ext3_test_inode_state(struct inode *inode, int bit)
567{
568 return test_bit(bit, &EXT3_I(inode)->i_state_flags);
569}
570
571static inline void ext3_set_inode_state(struct inode *inode, int bit)
572{
573 set_bit(bit, &EXT3_I(inode)->i_state_flags);
574}
575
576static inline void ext3_clear_inode_state(struct inode *inode, int bit)
577{
578 clear_bit(bit, &EXT3_I(inode)->i_state_flags);
579}
563#else 580#else
564/* Assume that user mode programs are passing in an ext3fs superblock, not 581/* Assume that user mode programs are passing in an ext3fs superblock, not
565 * a kernel struct super_block. This will allow us to call the feature-test 582 * a kernel struct super_block. This will allow us to call the feature-test
@@ -877,7 +894,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
877 int create); 894 int create);
878 895
879extern struct inode *ext3_iget(struct super_block *, unsigned long); 896extern struct inode *ext3_iget(struct super_block *, unsigned long);
880extern int ext3_write_inode (struct inode *, int); 897extern int ext3_write_inode (struct inode *, struct writeback_control *);
881extern int ext3_setattr (struct dentry *, struct iattr *); 898extern int ext3_setattr (struct dentry *, struct iattr *);
882extern void ext3_delete_inode (struct inode *); 899extern void ext3_delete_inode (struct inode *);
883extern int ext3_sync_inode (handle_t *, struct inode *); 900extern int ext3_sync_inode (handle_t *, struct inode *);
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h
index 93e7428156ba..f42c098aed8d 100644
--- a/include/linux/ext3_fs_i.h
+++ b/include/linux/ext3_fs_i.h
@@ -87,7 +87,7 @@ struct ext3_inode_info {
87 * near to their parent directory's inode. 87 * near to their parent directory's inode.
88 */ 88 */
89 __u32 i_block_group; 89 __u32 i_block_group;
90 __u32 i_state; /* Dynamic state flags for ext3 */ 90 unsigned long i_state_flags; /* Dynamic state flags for ext3 */
91 91
92 /* block reservation info */ 92 /* block reservation info */
93 struct ext3_block_alloc_info *i_block_alloc_info; 93 struct ext3_block_alloc_info *i_block_alloc_info;
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
index f07f34de2f0e..258088ab3c6b 100644
--- a/include/linux/ext3_fs_sb.h
+++ b/include/linux/ext3_fs_sb.h
@@ -72,6 +72,8 @@ struct ext3_sb_info {
72 struct inode * s_journal_inode; 72 struct inode * s_journal_inode;
73 struct journal_s * s_journal; 73 struct journal_s * s_journal;
74 struct list_head s_orphan; 74 struct list_head s_orphan;
75 struct mutex s_orphan_lock;
76 struct mutex s_resize_lock;
75 unsigned long s_commit_interval; 77 unsigned long s_commit_interval;
76 struct block_device *journal_bdev; 78 struct block_device *journal_bdev;
77#ifdef CONFIG_JBD_DEBUG 79#ifdef CONFIG_JBD_DEBUG
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h
index cf82d519be40..d7b5ddca99c2 100644
--- a/include/linux/ext3_jbd.h
+++ b/include/linux/ext3_jbd.h
@@ -44,13 +44,13 @@
44 44
45#define EXT3_DATA_TRANS_BLOCKS(sb) (EXT3_SINGLEDATA_TRANS_BLOCKS + \ 45#define EXT3_DATA_TRANS_BLOCKS(sb) (EXT3_SINGLEDATA_TRANS_BLOCKS + \
46 EXT3_XATTR_TRANS_BLOCKS - 2 + \ 46 EXT3_XATTR_TRANS_BLOCKS - 2 + \
47 2*EXT3_QUOTA_TRANS_BLOCKS(sb)) 47 EXT3_MAXQUOTAS_TRANS_BLOCKS(sb))
48 48
49/* Delete operations potentially hit one directory's namespace plus an 49/* Delete operations potentially hit one directory's namespace plus an
50 * entire inode, plus arbitrary amounts of bitmap/indirection data. Be 50 * entire inode, plus arbitrary amounts of bitmap/indirection data. Be
51 * generous. We can grow the delete transaction later if necessary. */ 51 * generous. We can grow the delete transaction later if necessary. */
52 52
53#define EXT3_DELETE_TRANS_BLOCKS(sb) (2 * EXT3_DATA_TRANS_BLOCKS(sb) + 64) 53#define EXT3_DELETE_TRANS_BLOCKS(sb) (EXT3_MAXQUOTAS_TRANS_BLOCKS(sb) + 64)
54 54
55/* Define an arbitrary limit for the amount of data we will anticipate 55/* Define an arbitrary limit for the amount of data we will anticipate
56 * writing to any given transaction. For unbounded transactions such as 56 * writing to any given transaction. For unbounded transactions such as
@@ -86,6 +86,9 @@
86#define EXT3_QUOTA_INIT_BLOCKS(sb) 0 86#define EXT3_QUOTA_INIT_BLOCKS(sb) 0
87#define EXT3_QUOTA_DEL_BLOCKS(sb) 0 87#define EXT3_QUOTA_DEL_BLOCKS(sb) 0
88#endif 88#endif
89#define EXT3_MAXQUOTAS_TRANS_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_TRANS_BLOCKS(sb))
90#define EXT3_MAXQUOTAS_INIT_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_INIT_BLOCKS(sb))
91#define EXT3_MAXQUOTAS_DEL_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_DEL_BLOCKS(sb))
89 92
90int 93int
91ext3_mark_iloc_dirty(handle_t *handle, 94ext3_mark_iloc_dirty(handle_t *handle,
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
index 06ca9b21dad2..7b64ad40e4ce 100644
--- a/include/linux/fault-inject.h
+++ b/include/linux/fault-inject.h
@@ -82,9 +82,10 @@ static inline void cleanup_fault_attr_dentries(struct fault_attr *attr)
82#endif /* CONFIG_FAULT_INJECTION */ 82#endif /* CONFIG_FAULT_INJECTION */
83 83
84#ifdef CONFIG_FAILSLAB 84#ifdef CONFIG_FAILSLAB
85extern bool should_failslab(size_t size, gfp_t gfpflags); 85extern bool should_failslab(size_t size, gfp_t gfpflags, unsigned long flags);
86#else 86#else
87static inline bool should_failslab(size_t size, gfp_t gfpflags) 87static inline bool should_failslab(size_t size, gfp_t gfpflags,
88 unsigned long flags)
88{ 89{
89 return false; 90 return false;
90} 91}
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 369767bd873e..c10163b4c40e 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -543,6 +543,8 @@ struct fb_cursor_user {
543#define FB_EVENT_GET_REQ 0x0D 543#define FB_EVENT_GET_REQ 0x0D
544/* Unbind from the console if possible */ 544/* Unbind from the console if possible */
545#define FB_EVENT_FB_UNBIND 0x0E 545#define FB_EVENT_FB_UNBIND 0x0E
546/* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga switcheroo */
547#define FB_EVENT_REMAP_ALL_CONSOLE 0x0F
546 548
547struct fb_event { 549struct fb_event {
548 struct fb_info *info; 550 struct fb_info *info;
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index a2ec74bc4812..013dc529e95f 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -57,7 +57,14 @@ struct files_struct {
57 struct file * fd_array[NR_OPEN_DEFAULT]; 57 struct file * fd_array[NR_OPEN_DEFAULT];
58}; 58};
59 59
60#define files_fdtable(files) (rcu_dereference((files)->fdt)) 60#define rcu_dereference_check_fdtable(files, fdtfd) \
61 (rcu_dereference_check((fdtfd), \
62 rcu_read_lock_held() || \
63 lockdep_is_held(&(files)->file_lock) || \
64 atomic_read(&(files)->count) == 1))
65
66#define files_fdtable(files) \
67 (rcu_dereference_check_fdtable((files), (files)->fdt))
61 68
62struct file_operations; 69struct file_operations;
63struct vfsmount; 70struct vfsmount;
@@ -78,7 +85,7 @@ static inline struct file * fcheck_files(struct files_struct *files, unsigned in
78 struct fdtable *fdt = files_fdtable(files); 85 struct fdtable *fdt = files_fdtable(files);
79 86
80 if (fd < fdt->max_fds) 87 if (fd < fdt->max_fds)
81 file = rcu_dereference(fdt->fd[fd]); 88 file = rcu_dereference_check_fdtable(files, fdt->fd[fd]);
82 return file; 89 return file;
83} 90}
84 91
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h
index 934e22d65801..d830747f5c0b 100644
--- a/include/linux/fiemap.h
+++ b/include/linux/fiemap.h
@@ -62,5 +62,7 @@ struct fiemap {
62#define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively 62#define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively
63 * support extents. Result 63 * support extents. Result
64 * merged for efficiency. */ 64 * merged for efficiency. */
65#define FIEMAP_EXTENT_SHARED 0x00002000 /* Space shared with other
66 * files. */
65 67
66#endif /* _LINUX_FIEMAP_H */ 68#endif /* _LINUX_FIEMAP_H */
diff --git a/include/linux/file.h b/include/linux/file.h
index 335a0a5c316e..5555508fd517 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -18,11 +18,9 @@ extern void drop_file_write_access(struct file *file);
18struct file_operations; 18struct file_operations;
19struct vfsmount; 19struct vfsmount;
20struct dentry; 20struct dentry;
21extern int init_file(struct file *, struct vfsmount *mnt, 21struct path;
22 struct dentry *dentry, fmode_t mode, 22extern struct file *alloc_file(struct path *, fmode_t mode,
23 const struct file_operations *fop); 23 const struct file_operations *fop);
24extern struct file *alloc_file(struct vfsmount *, struct dentry *dentry,
25 fmode_t mode, const struct file_operations *fop);
26 24
27static inline void fput_light(struct file *file, int fput_needed) 25static inline void fput_light(struct file *file, int fput_needed)
28{ 26{
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index c6b3ca3af6df..40b11013408e 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -248,13 +248,20 @@ union fw_cdev_event {
248#define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request) 248#define FW_CDEV_IOC_SEND_BROADCAST_REQUEST _IOW('#', 0x12, struct fw_cdev_send_request)
249#define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet) 249#define FW_CDEV_IOC_SEND_STREAM_PACKET _IOW('#', 0x13, struct fw_cdev_send_stream_packet)
250 250
251/* available since kernel version 2.6.34 */
252#define FW_CDEV_IOC_GET_CYCLE_TIMER2 _IOWR('#', 0x14, struct fw_cdev_get_cycle_timer2)
253
251/* 254/*
252 * FW_CDEV_VERSION History 255 * FW_CDEV_VERSION History
253 * 1 (2.6.22) - initial version 256 * 1 (2.6.22) - initial version
254 * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if 257 * 2 (2.6.30) - changed &fw_cdev_event_iso_interrupt.header if
255 * &fw_cdev_create_iso_context.header_size is 8 or more 258 * &fw_cdev_create_iso_context.header_size is 8 or more
259 * (2.6.32) - added time stamp to xmit &fw_cdev_event_iso_interrupt
260 * (2.6.33) - IR has always packet-per-buffer semantics now, not one of
261 * dual-buffer or packet-per-buffer depending on hardware
262 * 3 (2.6.34) - made &fw_cdev_get_cycle_timer reliable
256 */ 263 */
257#define FW_CDEV_VERSION 2 264#define FW_CDEV_VERSION 3
258 265
259/** 266/**
260 * struct fw_cdev_get_info - General purpose information ioctl 267 * struct fw_cdev_get_info - General purpose information ioctl
@@ -340,6 +347,9 @@ struct fw_cdev_send_response {
340 * The @closure field is passed back to userspace in the response event. 347 * The @closure field is passed back to userspace in the response event.
341 * The @handle field is an out parameter, returning a handle to the allocated 348 * The @handle field is an out parameter, returning a handle to the allocated
342 * range to be used for later deallocation of the range. 349 * range to be used for later deallocation of the range.
350 *
351 * The address range is allocated on all local nodes. The address allocation
352 * is exclusive except for the FCP command and response registers.
343 */ 353 */
344struct fw_cdev_allocate { 354struct fw_cdev_allocate {
345 __u64 offset; 355 __u64 offset;
@@ -377,7 +387,7 @@ struct fw_cdev_initiate_bus_reset {
377 * @immediate: If non-zero, immediate key to insert before pointer 387 * @immediate: If non-zero, immediate key to insert before pointer
378 * @key: Upper 8 bits of root directory pointer 388 * @key: Upper 8 bits of root directory pointer
379 * @data: Userspace pointer to contents of descriptor block 389 * @data: Userspace pointer to contents of descriptor block
380 * @length: Length of descriptor block data, in bytes 390 * @length: Length of descriptor block data, in quadlets
381 * @handle: Handle to the descriptor, written by the kernel 391 * @handle: Handle to the descriptor, written by the kernel
382 * 392 *
383 * Add a descriptor block and optionally a preceding immediate key to the local 393 * Add a descriptor block and optionally a preceding immediate key to the local
@@ -391,6 +401,8 @@ struct fw_cdev_initiate_bus_reset {
391 * If not 0, the @immediate field specifies an immediate key which will be 401 * If not 0, the @immediate field specifies an immediate key which will be
392 * inserted before the root directory pointer. 402 * inserted before the root directory pointer.
393 * 403 *
404 * @immediate, @key, and @data array elements are CPU-endian quadlets.
405 *
394 * If successful, the kernel adds the descriptor and writes back a handle to the 406 * If successful, the kernel adds the descriptor and writes back a handle to the
395 * kernel-side object to be used for later removal of the descriptor block and 407 * kernel-side object to be used for later removal of the descriptor block and
396 * immediate key. 408 * immediate key.
@@ -539,14 +551,18 @@ struct fw_cdev_stop_iso {
539/** 551/**
540 * struct fw_cdev_get_cycle_timer - read cycle timer register 552 * struct fw_cdev_get_cycle_timer - read cycle timer register
541 * @local_time: system time, in microseconds since the Epoch 553 * @local_time: system time, in microseconds since the Epoch
542 * @cycle_timer: isochronous cycle timer, as per OHCI 1.1 clause 5.13 554 * @cycle_timer: Cycle Time register contents
543 * 555 *
544 * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer 556 * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer
545 * and also the system clock. This allows to express the receive time of an 557 * and also the system clock (%CLOCK_REALTIME). This allows to express the
546 * isochronous packet as a system time with microsecond accuracy. 558 * receive time of an isochronous packet as a system time.
547 * 559 *
548 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and 560 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
549 * 12 bits cycleOffset, in host byte order. 561 * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
562 * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
563 *
564 * In version 1 and 2 of the ABI, this ioctl returned unreliable (non-
565 * monotonic) @cycle_timer values on certain controllers.
550 */ 566 */
551struct fw_cdev_get_cycle_timer { 567struct fw_cdev_get_cycle_timer {
552 __u64 local_time; 568 __u64 local_time;
@@ -554,6 +570,25 @@ struct fw_cdev_get_cycle_timer {
554}; 570};
555 571
556/** 572/**
573 * struct fw_cdev_get_cycle_timer2 - read cycle timer register
574 * @tv_sec: system time, seconds
575 * @tv_nsec: system time, sub-seconds part in nanoseconds
576 * @clk_id: input parameter, clock from which to get the system time
577 * @cycle_timer: Cycle Time register contents
578 *
579 * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 works like
580 * %FW_CDEV_IOC_GET_CYCLE_TIMER but lets you choose a clock like with POSIX'
581 * clock_gettime function. Supported @clk_id values are POSIX' %CLOCK_REALTIME
582 * and %CLOCK_MONOTONIC and Linux' %CLOCK_MONOTONIC_RAW.
583 */
584struct fw_cdev_get_cycle_timer2 {
585 __s64 tv_sec;
586 __s32 tv_nsec;
587 __s32 clk_id;
588 __u32 cycle_timer;
589};
590
591/**
557 * struct fw_cdev_allocate_iso_resource - (De)allocate a channel or bandwidth 592 * struct fw_cdev_allocate_iso_resource - (De)allocate a channel or bandwidth
558 * @closure: Passed back to userspace in correponding iso resource events 593 * @closure: Passed back to userspace in correponding iso resource events
559 * @channels: Isochronous channels of which one is to be (de)allocated 594 * @channels: Isochronous channels of which one is to be (de)allocated
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 9416a461b696..4bd94bf5e739 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -65,12 +65,13 @@
65#define CSR_DIRECTORY_ID 0x20 65#define CSR_DIRECTORY_ID 0x20
66 66
67struct fw_csr_iterator { 67struct fw_csr_iterator {
68 u32 *p; 68 const u32 *p;
69 u32 *end; 69 const u32 *end;
70}; 70};
71 71
72void fw_csr_iterator_init(struct fw_csr_iterator *ci, u32 *p); 72void fw_csr_iterator_init(struct fw_csr_iterator *ci, const u32 *p);
73int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value); 73int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value);
74int fw_csr_string(const u32 *directory, int key, char *buf, size_t size);
74 75
75extern struct bus_type fw_bus_type; 76extern struct bus_type fw_bus_type;
76 77
@@ -162,7 +163,7 @@ struct fw_device {
162 struct mutex client_list_mutex; 163 struct mutex client_list_mutex;
163 struct list_head client_list; 164 struct list_head client_list;
164 165
165 u32 *config_rom; 166 const u32 *config_rom;
166 size_t config_rom_length; 167 size_t config_rom_length;
167 int config_rom_retries; 168 int config_rom_retries;
168 unsigned is_local:1; 169 unsigned is_local:1;
@@ -204,7 +205,7 @@ int fw_device_enable_phys_dma(struct fw_device *device);
204 */ 205 */
205struct fw_unit { 206struct fw_unit {
206 struct device device; 207 struct device device;
207 u32 *directory; 208 const u32 *directory;
208 struct fw_attribute_group attribute_group; 209 struct fw_attribute_group attribute_group;
209}; 210};
210 211
@@ -248,8 +249,8 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode,
248 void *data, size_t length, 249 void *data, size_t length,
249 void *callback_data); 250 void *callback_data);
250/* 251/*
251 * Important note: The callback must guarantee that either fw_send_response() 252 * Important note: Except for the FCP registers, the callback must guarantee
252 * or kfree() is called on the @request. 253 * that either fw_send_response() or kfree() is called on the @request.
253 */ 254 */
254typedef void (*fw_address_callback_t)(struct fw_card *card, 255typedef void (*fw_address_callback_t)(struct fw_card *card,
255 struct fw_request *request, 256 struct fw_request *request,
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h
index 875451f1373a..c6dcc1dfe781 100644
--- a/include/linux/firmware-map.h
+++ b/include/linux/firmware-map.h
@@ -24,17 +24,17 @@
24 */ 24 */
25#ifdef CONFIG_FIRMWARE_MEMMAP 25#ifdef CONFIG_FIRMWARE_MEMMAP
26 26
27int firmware_map_add(u64 start, u64 end, const char *type);
28int firmware_map_add_early(u64 start, u64 end, const char *type); 27int firmware_map_add_early(u64 start, u64 end, const char *type);
28int firmware_map_add_hotplug(u64 start, u64 end, const char *type);
29 29
30#else /* CONFIG_FIRMWARE_MEMMAP */ 30#else /* CONFIG_FIRMWARE_MEMMAP */
31 31
32static inline int firmware_map_add(u64 start, u64 end, const char *type) 32static inline int firmware_map_add_early(u64 start, u64 end, const char *type)
33{ 33{
34 return 0; 34 return 0;
35} 35}
36 36
37static inline int firmware_map_add_early(u64 start, u64 end, const char *type) 37static inline int firmware_map_add_hotplug(u64 start, u64 end, const char *type)
38{ 38{
39 return 0; 39 return 0;
40} 40}
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b23a7018eb90..10b8dedcd18b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -60,24 +60,24 @@ struct inodes_stat_t {
60 */ 60 */
61 61
62/* file is open for reading */ 62/* file is open for reading */
63#define FMODE_READ ((__force fmode_t)1) 63#define FMODE_READ ((__force fmode_t)0x1)
64/* file is open for writing */ 64/* file is open for writing */
65#define FMODE_WRITE ((__force fmode_t)2) 65#define FMODE_WRITE ((__force fmode_t)0x2)
66/* file is seekable */ 66/* file is seekable */
67#define FMODE_LSEEK ((__force fmode_t)4) 67#define FMODE_LSEEK ((__force fmode_t)0x4)
68/* file can be accessed using pread */ 68/* file can be accessed using pread */
69#define FMODE_PREAD ((__force fmode_t)8) 69#define FMODE_PREAD ((__force fmode_t)0x8)
70/* file can be accessed using pwrite */ 70/* file can be accessed using pwrite */
71#define FMODE_PWRITE ((__force fmode_t)16) 71#define FMODE_PWRITE ((__force fmode_t)0x10)
72/* File is opened for execution with sys_execve / sys_uselib */ 72/* File is opened for execution with sys_execve / sys_uselib */
73#define FMODE_EXEC ((__force fmode_t)32) 73#define FMODE_EXEC ((__force fmode_t)0x20)
74/* File is opened with O_NDELAY (only set for block devices) */ 74/* File is opened with O_NDELAY (only set for block devices) */
75#define FMODE_NDELAY ((__force fmode_t)64) 75#define FMODE_NDELAY ((__force fmode_t)0x40)
76/* File is opened with O_EXCL (only set for block devices) */ 76/* File is opened with O_EXCL (only set for block devices) */
77#define FMODE_EXCL ((__force fmode_t)128) 77#define FMODE_EXCL ((__force fmode_t)0x80)
78/* File is opened using open(.., 3, ..) and is writeable only for ioctls 78/* File is opened using open(.., 3, ..) and is writeable only for ioctls
79 (specialy hack for floppy.c) */ 79 (specialy hack for floppy.c) */
80#define FMODE_WRITE_IOCTL ((__force fmode_t)256) 80#define FMODE_WRITE_IOCTL ((__force fmode_t)0x100)
81 81
82/* 82/*
83 * Don't update ctime and mtime. 83 * Don't update ctime and mtime.
@@ -85,7 +85,10 @@ struct inodes_stat_t {
85 * Currently a special hack for the XFS open_by_handle ioctl, but we'll 85 * Currently a special hack for the XFS open_by_handle ioctl, but we'll
86 * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon. 86 * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
87 */ 87 */
88#define FMODE_NOCMTIME ((__force fmode_t)2048) 88#define FMODE_NOCMTIME ((__force fmode_t)0x800)
89
90/* Expect random access pattern */
91#define FMODE_RANDOM ((__force fmode_t)0x1000)
89 92
90/* 93/*
91 * The below are the various read and write types that we support. Some of 94 * The below are the various read and write types that we support. Some of
@@ -152,6 +155,7 @@ struct inodes_stat_t {
152#define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) 155#define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
153#define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) 156#define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))
154#define WRITE_ODIRECT_PLUG (WRITE | (1 << BIO_RW_SYNCIO)) 157#define WRITE_ODIRECT_PLUG (WRITE | (1 << BIO_RW_SYNCIO))
158#define WRITE_META (WRITE | (1 << BIO_RW_META))
155#define SWRITE_SYNC_PLUG \ 159#define SWRITE_SYNC_PLUG \
156 (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) 160 (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
157#define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) 161#define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG))
@@ -728,6 +732,7 @@ struct inode {
728 uid_t i_uid; 732 uid_t i_uid;
729 gid_t i_gid; 733 gid_t i_gid;
730 dev_t i_rdev; 734 dev_t i_rdev;
735 unsigned int i_blkbits;
731 u64 i_version; 736 u64 i_version;
732 loff_t i_size; 737 loff_t i_size;
733#ifdef __NEED_I_SIZE_ORDERED 738#ifdef __NEED_I_SIZE_ORDERED
@@ -737,7 +742,6 @@ struct inode {
737 struct timespec i_mtime; 742 struct timespec i_mtime;
738 struct timespec i_ctime; 743 struct timespec i_ctime;
739 blkcnt_t i_blocks; 744 blkcnt_t i_blocks;
740 unsigned int i_blkbits;
741 unsigned short i_bytes; 745 unsigned short i_bytes;
742 umode_t i_mode; 746 umode_t i_mode;
743 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 747 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
@@ -1094,10 +1098,6 @@ struct file_lock {
1094 1098
1095extern void send_sigio(struct fown_struct *fown, int fd, int band); 1099extern void send_sigio(struct fown_struct *fown, int fd, int band);
1096 1100
1097/* fs/sync.c */
1098extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
1099 loff_t endbyte, unsigned int flags);
1100
1101#ifdef CONFIG_FILE_LOCKING 1101#ifdef CONFIG_FILE_LOCKING
1102extern int fcntl_getlk(struct file *, struct flock __user *); 1102extern int fcntl_getlk(struct file *, struct flock __user *);
1103extern int fcntl_setlk(unsigned int, struct file *, unsigned int, 1103extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
@@ -1308,6 +1308,8 @@ extern int send_sigurg(struct fown_struct *fown);
1308#define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */ 1308#define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */
1309#define MNT_DETACH 0x00000002 /* Just detach from the tree */ 1309#define MNT_DETACH 0x00000002 /* Just detach from the tree */
1310#define MNT_EXPIRE 0x00000004 /* Mark for expiry */ 1310#define MNT_EXPIRE 0x00000004 /* Mark for expiry */
1311#define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */
1312#define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */
1311 1313
1312extern struct list_head super_blocks; 1314extern struct list_head super_blocks;
1313extern spinlock_t sb_lock; 1315extern spinlock_t sb_lock;
@@ -1317,9 +1319,9 @@ extern spinlock_t sb_lock;
1317struct super_block { 1319struct super_block {
1318 struct list_head s_list; /* Keep this first */ 1320 struct list_head s_list; /* Keep this first */
1319 dev_t s_dev; /* search index; _not_ kdev_t */ 1321 dev_t s_dev; /* search index; _not_ kdev_t */
1320 unsigned long s_blocksize;
1321 unsigned char s_blocksize_bits;
1322 unsigned char s_dirt; 1322 unsigned char s_dirt;
1323 unsigned char s_blocksize_bits;
1324 unsigned long s_blocksize;
1323 loff_t s_maxbytes; /* Max file size */ 1325 loff_t s_maxbytes; /* Max file size */
1324 struct file_system_type *s_type; 1326 struct file_system_type *s_type;
1325 const struct super_operations *s_op; 1327 const struct super_operations *s_op;
@@ -1360,16 +1362,16 @@ struct super_block {
1360 void *s_fs_info; /* Filesystem private info */ 1362 void *s_fs_info; /* Filesystem private info */
1361 fmode_t s_mode; 1363 fmode_t s_mode;
1362 1364
1365 /* Granularity of c/m/atime in ns.
1366 Cannot be worse than a second */
1367 u32 s_time_gran;
1368
1363 /* 1369 /*
1364 * The next field is for VFS *only*. No filesystems have any business 1370 * The next field is for VFS *only*. No filesystems have any business
1365 * even looking at it. You had been warned. 1371 * even looking at it. You had been warned.
1366 */ 1372 */
1367 struct mutex s_vfs_rename_mutex; /* Kludge */ 1373 struct mutex s_vfs_rename_mutex; /* Kludge */
1368 1374
1369 /* Granularity of c/m/atime in ns.
1370 Cannot be worse than a second */
1371 u32 s_time_gran;
1372
1373 /* 1375 /*
1374 * Filesystem subtype. If non-empty the filesystem type field 1376 * Filesystem subtype. If non-empty the filesystem type field
1375 * in /proc/mounts will be "type.subtype" 1377 * in /proc/mounts will be "type.subtype"
@@ -1558,7 +1560,7 @@ struct super_operations {
1558 void (*destroy_inode)(struct inode *); 1560 void (*destroy_inode)(struct inode *);
1559 1561
1560 void (*dirty_inode) (struct inode *); 1562 void (*dirty_inode) (struct inode *);
1561 int (*write_inode) (struct inode *, int); 1563 int (*write_inode) (struct inode *, struct writeback_control *wbc);
1562 void (*drop_inode) (struct inode *); 1564 void (*drop_inode) (struct inode *);
1563 void (*delete_inode) (struct inode *); 1565 void (*delete_inode) (struct inode *);
1564 void (*put_super) (struct super_block *); 1566 void (*put_super) (struct super_block *);
@@ -1590,7 +1592,7 @@ struct super_operations {
1590 * until that flag is cleared. I_WILL_FREE, I_FREEING and I_CLEAR are set at 1592 * until that flag is cleared. I_WILL_FREE, I_FREEING and I_CLEAR are set at
1591 * various stages of removing an inode. 1593 * various stages of removing an inode.
1592 * 1594 *
1593 * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. 1595 * Two bits are used for locking and completion notification, I_NEW and I_SYNC.
1594 * 1596 *
1595 * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on 1597 * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on
1596 * fdatasync(). i_atime is the usual cause. 1598 * fdatasync(). i_atime is the usual cause.
@@ -1599,8 +1601,14 @@ struct super_operations {
1599 * don't have to write inode on fdatasync() when only 1601 * don't have to write inode on fdatasync() when only
1600 * mtime has changed in it. 1602 * mtime has changed in it.
1601 * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. 1603 * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean.
1602 * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both 1604 * I_NEW Serves as both a mutex and completion notification.
1603 * are cleared by unlock_new_inode(), called from iget(). 1605 * New inodes set I_NEW. If two processes both create
1606 * the same inode, one of them will release its inode and
1607 * wait for I_NEW to be released before returning.
1608 * Inodes in I_WILL_FREE, I_FREEING or I_CLEAR state can
1609 * also cause waiting on I_NEW, without I_NEW actually
1610 * being set. find_inode() uses this to prevent returning
1611 * nearly-dead inodes.
1604 * I_WILL_FREE Must be set when calling write_inode_now() if i_count 1612 * I_WILL_FREE Must be set when calling write_inode_now() if i_count
1605 * is zero. I_FREEING must be set when I_WILL_FREE is 1613 * is zero. I_FREEING must be set when I_WILL_FREE is
1606 * cleared. 1614 * cleared.
@@ -1614,35 +1622,23 @@ struct super_operations {
1614 * prohibited for many purposes. iget() must wait for 1622 * prohibited for many purposes. iget() must wait for
1615 * the inode to be completely released, then create it 1623 * the inode to be completely released, then create it
1616 * anew. Other functions will just ignore such inodes, 1624 * anew. Other functions will just ignore such inodes,
1617 * if appropriate. I_LOCK is used for waiting. 1625 * if appropriate. I_NEW is used for waiting.
1618 * 1626 *
1619 * I_LOCK Serves as both a mutex and completion notification. 1627 * I_SYNC Synchonized write of dirty inode data. The bits is
1620 * New inodes set I_LOCK. If two processes both create 1628 * set during data writeback, and cleared with a wakeup
1621 * the same inode, one of them will release its inode and 1629 * on the bit address once it is done.
1622 * wait for I_LOCK to be released before returning.
1623 * Inodes in I_WILL_FREE, I_FREEING or I_CLEAR state can
1624 * also cause waiting on I_LOCK, without I_LOCK actually
1625 * being set. find_inode() uses this to prevent returning
1626 * nearly-dead inodes.
1627 * I_SYNC Similar to I_LOCK, but limited in scope to writeback
1628 * of inode dirty data. Having a separate lock for this
1629 * purpose reduces latency and prevents some filesystem-
1630 * specific deadlocks.
1631 * 1630 *
1632 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1631 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1633 * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on
1634 * I_CLEAR? If not, why?
1635 */ 1632 */
1636#define I_DIRTY_SYNC 1 1633#define I_DIRTY_SYNC 1
1637#define I_DIRTY_DATASYNC 2 1634#define I_DIRTY_DATASYNC 2
1638#define I_DIRTY_PAGES 4 1635#define I_DIRTY_PAGES 4
1639#define I_NEW 8 1636#define __I_NEW 3
1637#define I_NEW (1 << __I_NEW)
1640#define I_WILL_FREE 16 1638#define I_WILL_FREE 16
1641#define I_FREEING 32 1639#define I_FREEING 32
1642#define I_CLEAR 64 1640#define I_CLEAR 64
1643#define __I_LOCK 7 1641#define __I_SYNC 7
1644#define I_LOCK (1 << __I_LOCK)
1645#define __I_SYNC 8
1646#define I_SYNC (1 << __I_SYNC) 1642#define I_SYNC (1 << __I_SYNC)
1647 1643
1648#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1644#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
@@ -1803,7 +1799,8 @@ extern int may_umount(struct vfsmount *);
1803extern long do_mount(char *, char *, char *, unsigned long, void *); 1799extern long do_mount(char *, char *, char *, unsigned long, void *);
1804extern struct vfsmount *collect_mounts(struct path *); 1800extern struct vfsmount *collect_mounts(struct path *);
1805extern void drop_collected_mounts(struct vfsmount *); 1801extern void drop_collected_mounts(struct vfsmount *);
1806 1802extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
1803 struct vfsmount *);
1807extern int vfs_statfs(struct dentry *, struct kstatfs *); 1804extern int vfs_statfs(struct dentry *, struct kstatfs *);
1808 1805
1809extern int current_umask(void); 1806extern int current_umask(void);
@@ -2067,12 +2064,6 @@ extern int invalidate_inodes(struct super_block *);
2067unsigned long invalidate_mapping_pages(struct address_space *mapping, 2064unsigned long invalidate_mapping_pages(struct address_space *mapping,
2068 pgoff_t start, pgoff_t end); 2065 pgoff_t start, pgoff_t end);
2069 2066
2070static inline unsigned long __deprecated
2071invalidate_inode_pages(struct address_space *mapping)
2072{
2073 return invalidate_mapping_pages(mapping, 0, ~0UL);
2074}
2075
2076static inline void invalidate_remote_inode(struct inode *inode) 2067static inline void invalidate_remote_inode(struct inode *inode)
2077{ 2068{
2078 if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || 2069 if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) ||
@@ -2141,6 +2132,7 @@ extern struct file * open_exec(const char *);
2141 2132
2142/* fs/dcache.c -- generic fs support functions */ 2133/* fs/dcache.c -- generic fs support functions */
2143extern int is_subdir(struct dentry *, struct dentry *); 2134extern int is_subdir(struct dentry *, struct dentry *);
2135extern int path_is_under(struct path *, struct path *);
2144extern ino_t find_inode_number(struct dentry *, struct qstr *); 2136extern ino_t find_inode_number(struct dentry *, struct qstr *);
2145 2137
2146#include <linux/err.h> 2138#include <linux/err.h>
@@ -2189,7 +2181,6 @@ static inline void insert_inode_hash(struct inode *inode) {
2189 __insert_inode_hash(inode, inode->i_ino); 2181 __insert_inode_hash(inode, inode->i_ino);
2190} 2182}
2191 2183
2192extern struct file * get_empty_filp(void);
2193extern void file_move(struct file *f, struct list_head *list); 2184extern void file_move(struct file *f, struct list_head *list);
2194extern void file_kill(struct file *f); 2185extern void file_kill(struct file *f);
2195#ifdef CONFIG_BLOCK 2186#ifdef CONFIG_BLOCK
@@ -2307,6 +2298,7 @@ extern const struct inode_operations page_symlink_inode_operations;
2307extern int generic_readlink(struct dentry *, char __user *, int); 2298extern int generic_readlink(struct dentry *, char __user *, int);
2308extern void generic_fillattr(struct inode *, struct kstat *); 2299extern void generic_fillattr(struct inode *, struct kstat *);
2309extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 2300extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
2301void __inode_add_bytes(struct inode *inode, loff_t bytes);
2310void inode_add_bytes(struct inode *inode, loff_t bytes); 2302void inode_add_bytes(struct inode *inode, loff_t bytes);
2311void inode_sub_bytes(struct inode *inode, loff_t bytes); 2303void inode_sub_bytes(struct inode *inode, loff_t bytes);
2312loff_t inode_get_bytes(struct inode *inode); 2304loff_t inode_get_bytes(struct inode *inode);
@@ -2349,8 +2341,6 @@ extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct
2349extern int simple_sync_file(struct file *, struct dentry *, int); 2341extern int simple_sync_file(struct file *, struct dentry *, int);
2350extern int simple_empty(struct dentry *); 2342extern int simple_empty(struct dentry *);
2351extern int simple_readpage(struct file *file, struct page *page); 2343extern int simple_readpage(struct file *file, struct page *page);
2352extern int simple_prepare_write(struct file *file, struct page *page,
2353 unsigned offset, unsigned to);
2354extern int simple_write_begin(struct file *file, struct address_space *mapping, 2344extern int simple_write_begin(struct file *file, struct address_space *mapping,
2355 loff_t pos, unsigned len, unsigned flags, 2345 loff_t pos, unsigned len, unsigned flags,
2356 struct page **pagep, void **fsdata); 2346 struct page **pagep, void **fsdata);
@@ -2472,5 +2462,8 @@ int proc_nr_files(struct ctl_table *table, int write,
2472 2462
2473int __init get_filesystem_list(char *buf); 2463int __init get_filesystem_list(char *buf);
2474 2464
2465#define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE])
2466#define OPEN_FMODE(flag) ((__force fmode_t)((flag + 1) & O_ACCMODE))
2467
2475#endif /* __KERNEL__ */ 2468#endif /* __KERNEL__ */
2476#endif /* _LINUX_FS_H */ 2469#endif /* _LINUX_FS_H */
diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h
index bb516ceeefc9..da317c7163ab 100644
--- a/include/linux/fs_stack.h
+++ b/include/linux/fs_stack.h
@@ -8,10 +8,8 @@
8#include <linux/fs.h> 8#include <linux/fs.h>
9 9
10/* externs for fs/stack.c */ 10/* externs for fs/stack.c */
11extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src, 11extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src);
12 int (*get_nlinks)(struct inode *)); 12extern void fsstack_copy_inode_size(struct inode *dst, struct inode *src);
13
14extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src);
15 13
16/* inlines */ 14/* inlines */
17static inline void fsstack_copy_attr_atime(struct inode *dest, 15static inline void fsstack_copy_attr_atime(struct inode *dest,
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
index 7be0c6fbe880..c57db27ac861 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -105,7 +105,7 @@ struct fscache_operation {
105 /* operation releaser */ 105 /* operation releaser */
106 fscache_operation_release_t release; 106 fscache_operation_release_t release;
107 107
108#ifdef CONFIG_SLOW_WORK_PROC 108#ifdef CONFIG_SLOW_WORK_DEBUG
109 const char *name; /* operation name */ 109 const char *name; /* operation name */
110 const char *state; /* operation state */ 110 const char *state; /* operation state */
111#define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0) 111#define fscache_set_op_name(OP, N) do { (OP)->name = (N); } while(0)
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 936f9aa8bb97..df8fd9a3b214 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -65,7 +65,7 @@ static inline void fsnotify_link_count(struct inode *inode)
65 * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir 65 * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir
66 */ 66 */
67static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, 67static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
68 const char *old_name, const char *new_name, 68 const char *old_name,
69 int isdir, struct inode *target, struct dentry *moved) 69 int isdir, struct inode *target, struct dentry *moved)
70{ 70{
71 struct inode *source = moved->d_inode; 71 struct inode *source = moved->d_inode;
@@ -73,6 +73,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
73 u32 fs_cookie = fsnotify_get_cookie(); 73 u32 fs_cookie = fsnotify_get_cookie();
74 __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM); 74 __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM);
75 __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO); 75 __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO);
76 const char *new_name = moved->d_name.name;
76 77
77 if (old_dir == new_dir) 78 if (old_dir == new_dir)
78 old_dir_mask |= FS_DN_RENAME; 79 old_dir_mask |= FS_DN_RENAME;
@@ -103,7 +104,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
103 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); 104 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL);
104 fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0); 105 fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0);
105 } 106 }
106 audit_inode_child(new_name, moved, new_dir); 107 audit_inode_child(moved, new_dir);
107} 108}
108 109
109/* 110/*
@@ -146,7 +147,7 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
146{ 147{
147 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, 148 inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name,
148 dentry->d_inode); 149 dentry->d_inode);
149 audit_inode_child(dentry->d_name.name, dentry, inode); 150 audit_inode_child(dentry, inode);
150 151
151 fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); 152 fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0);
152} 153}
@@ -161,7 +162,7 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct
161 inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name, 162 inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name,
162 inode); 163 inode);
163 fsnotify_link_count(inode); 164 fsnotify_link_count(inode);
164 audit_inode_child(new_dentry->d_name.name, new_dentry, dir); 165 audit_inode_child(new_dentry, dir);
165 166
166 fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0); 167 fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0);
167} 168}
@@ -175,7 +176,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
175 struct inode *d_inode = dentry->d_inode; 176 struct inode *d_inode = dentry->d_inode;
176 177
177 inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode); 178 inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode);
178 audit_inode_child(dentry->d_name.name, dentry, inode); 179 audit_inode_child(dentry, inode);
179 180
180 fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); 181 fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0);
181} 182}
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 0b4f97d24d7f..01e6adea07ec 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -134,6 +134,8 @@ extern void
134unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops); 134unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
135extern void unregister_ftrace_function_probe_all(char *glob); 135extern void unregister_ftrace_function_probe_all(char *glob);
136 136
137extern int ftrace_text_reserved(void *start, void *end);
138
137enum { 139enum {
138 FTRACE_FL_FREE = (1 << 0), 140 FTRACE_FL_FREE = (1 << 0),
139 FTRACE_FL_FAILED = (1 << 1), 141 FTRACE_FL_FAILED = (1 << 1),
@@ -141,7 +143,6 @@ enum {
141 FTRACE_FL_ENABLED = (1 << 3), 143 FTRACE_FL_ENABLED = (1 << 3),
142 FTRACE_FL_NOTRACE = (1 << 4), 144 FTRACE_FL_NOTRACE = (1 << 4),
143 FTRACE_FL_CONVERTED = (1 << 5), 145 FTRACE_FL_CONVERTED = (1 << 5),
144 FTRACE_FL_FROZEN = (1 << 6),
145}; 146};
146 147
147struct dyn_ftrace { 148struct dyn_ftrace {
@@ -250,6 +251,10 @@ static inline int unregister_ftrace_command(char *cmd_name)
250{ 251{
251 return -EINVAL; 252 return -EINVAL;
252} 253}
254static inline int ftrace_text_reserved(void *start, void *end)
255{
256 return 0;
257}
253#endif /* CONFIG_DYNAMIC_FTRACE */ 258#endif /* CONFIG_DYNAMIC_FTRACE */
254 259
255/* totally disable ftrace - can not re-enable after this */ 260/* totally disable ftrace - can not re-enable after this */
@@ -511,4 +516,10 @@ static inline void trace_hw_branch_oops(void) {}
511 516
512#endif /* CONFIG_HW_BRANCH_TRACER */ 517#endif /* CONFIG_HW_BRANCH_TRACER */
513 518
519#ifdef CONFIG_FTRACE_SYSCALLS
520
521unsigned long arch_syscall_addr(int nr);
522
523#endif /* CONFIG_FTRACE_SYSCALLS */
524
514#endif /* _LINUX_FTRACE_H */ 525#endif /* _LINUX_FTRACE_H */
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 38f8d6553831..c0f4b364c711 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -5,6 +5,7 @@
5#include <linux/trace_seq.h> 5#include <linux/trace_seq.h>
6#include <linux/percpu.h> 6#include <linux/percpu.h>
7#include <linux/hardirq.h> 7#include <linux/hardirq.h>
8#include <linux/perf_event.h>
8 9
9struct trace_array; 10struct trace_array;
10struct tracer; 11struct tracer;
@@ -121,9 +122,8 @@ struct ftrace_event_call {
121 int (*regfunc)(struct ftrace_event_call *); 122 int (*regfunc)(struct ftrace_event_call *);
122 void (*unregfunc)(struct ftrace_event_call *); 123 void (*unregfunc)(struct ftrace_event_call *);
123 int id; 124 int id;
125 const char *print_fmt;
124 int (*raw_init)(struct ftrace_event_call *); 126 int (*raw_init)(struct ftrace_event_call *);
125 int (*show_format)(struct ftrace_event_call *,
126 struct trace_seq *);
127 int (*define_fields)(struct ftrace_event_call *); 127 int (*define_fields)(struct ftrace_event_call *);
128 struct list_head fields; 128 struct list_head fields;
129 int filter_active; 129 int filter_active;
@@ -131,15 +131,12 @@ struct ftrace_event_call {
131 void *mod; 131 void *mod;
132 void *data; 132 void *data;
133 133
134 atomic_t profile_count; 134 int perf_refcount;
135 int (*profile_enable)(struct ftrace_event_call *); 135 int (*perf_event_enable)(struct ftrace_event_call *);
136 void (*profile_disable)(struct ftrace_event_call *); 136 void (*perf_event_disable)(struct ftrace_event_call *);
137}; 137};
138 138
139#define FTRACE_MAX_PROFILE_SIZE 2048 139#define PERF_MAX_TRACE_SIZE 2048
140
141extern char *perf_trace_buf;
142extern char *perf_trace_buf_nmi;
143 140
144#define MAX_FILTER_PRED 32 141#define MAX_FILTER_PRED 32
145#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ 142#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
@@ -158,7 +155,7 @@ enum {
158 FILTER_PTR_STRING, 155 FILTER_PTR_STRING,
159}; 156};
160 157
161extern int trace_define_common_fields(struct ftrace_event_call *call); 158extern int trace_event_raw_init(struct ftrace_event_call *call);
162extern int trace_define_field(struct ftrace_event_call *call, const char *type, 159extern int trace_define_field(struct ftrace_event_call *call, const char *type,
163 const char *name, int offset, int size, 160 const char *name, int offset, int size,
164 int is_signed, int filter_type); 161 int is_signed, int filter_type);
@@ -188,13 +185,30 @@ do { \
188 __trace_printk(ip, fmt, ##args); \ 185 __trace_printk(ip, fmt, ##args); \
189} while (0) 186} while (0)
190 187
191#ifdef CONFIG_EVENT_PROFILE 188#ifdef CONFIG_PERF_EVENTS
192struct perf_event; 189struct perf_event;
193extern int ftrace_profile_enable(int event_id); 190
194extern void ftrace_profile_disable(int event_id); 191DECLARE_PER_CPU(struct pt_regs, perf_trace_regs);
192
193extern int perf_trace_enable(int event_id);
194extern void perf_trace_disable(int event_id);
195extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, 195extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
196 char *filter_str); 196 char *filter_str);
197extern void ftrace_profile_free_filter(struct perf_event *event); 197extern void ftrace_profile_free_filter(struct perf_event *event);
198extern void *
199perf_trace_buf_prepare(int size, unsigned short type, int *rctxp,
200 unsigned long *irq_flags);
201
202static inline void
203perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
204 u64 count, unsigned long irq_flags, struct pt_regs *regs)
205{
206 struct trace_entry *entry = raw_data;
207
208 perf_tp_event(entry->type, addr, count, raw_data, size, regs);
209 perf_swevent_put_recursion_context(rctx);
210 local_irq_restore(irq_flags);
211}
198#endif 212#endif
199 213
200#endif /* _LINUX_FTRACE_EVENT_H */ 214#endif /* _LINUX_FTRACE_EVENT_H */
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index 1bc08541c2b9..48e68da097f6 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -46,7 +46,6 @@ struct gameport {
46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ 46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
47 47
48 struct device dev; 48 struct device dev;
49 unsigned int registered; /* port has been fully registered with driver core */
50 49
51 struct list_head node; 50 struct list_head node;
52}; 51};
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h
index 886f5faa08cb..ca666d18ed67 100644
--- a/include/linux/generic_acl.h
+++ b/include/linux/generic_acl.h
@@ -1,36 +1,15 @@
1/* 1#ifndef LINUX_GENERIC_ACL_H
2 * include/linux/generic_acl.h 2#define LINUX_GENERIC_ACL_H
3 *
4 * (C) 2005 Andreas Gruenbacher <agruen@suse.de>
5 *
6 * This file is released under the GPL.
7 */
8 3
9#ifndef GENERIC_ACL_H 4#include <linux/xattr.h>
10#define GENERIC_ACL_H
11 5
12#include <linux/posix_acl.h> 6struct inode;
13#include <linux/posix_acl_xattr.h>
14 7
15/** 8extern struct xattr_handler generic_acl_access_handler;
16 * struct generic_acl_operations - filesystem operations 9extern struct xattr_handler generic_acl_default_handler;
17 *
18 * Filesystems must make these operations available to the generic
19 * operations.
20 */
21struct generic_acl_operations {
22 struct posix_acl *(*getacl)(struct inode *, int);
23 void (*setacl)(struct inode *, int, struct posix_acl *);
24};
25 10
26size_t generic_acl_list(struct inode *, struct generic_acl_operations *, int, 11int generic_acl_init(struct inode *, struct inode *);
27 char *, size_t); 12int generic_acl_chmod(struct inode *);
28int generic_acl_get(struct inode *, struct generic_acl_operations *, int, 13int generic_check_acl(struct inode *inode, int mask);
29 void *, size_t);
30int generic_acl_set(struct inode *, struct generic_acl_operations *, int,
31 const void *, size_t);
32int generic_acl_init(struct inode *, struct inode *,
33 struct generic_acl_operations *);
34int generic_acl_chmod(struct inode *, struct generic_acl_operations *);
35 14
36#endif 15#endif /* LINUX_GENERIC_ACL_H */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index c6c0c41af35f..56b50514ab25 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -101,7 +101,7 @@ struct hd_struct {
101 unsigned long stamp; 101 unsigned long stamp;
102 int in_flight[2]; 102 int in_flight[2];
103#ifdef CONFIG_SMP 103#ifdef CONFIG_SMP
104 struct disk_stats *dkstats; 104 struct disk_stats __percpu *dkstats;
105#else 105#else
106 struct disk_stats dkstats; 106 struct disk_stats dkstats;
107#endif 107#endif
@@ -256,9 +256,9 @@ extern struct hd_struct *disk_map_sector_rcu(struct gendisk *disk,
256#define part_stat_read(part, field) \ 256#define part_stat_read(part, field) \
257({ \ 257({ \
258 typeof((part)->dkstats->field) res = 0; \ 258 typeof((part)->dkstats->field) res = 0; \
259 int i; \ 259 unsigned int _cpu; \
260 for_each_possible_cpu(i) \ 260 for_each_possible_cpu(_cpu) \
261 res += per_cpu_ptr((part)->dkstats, i)->field; \ 261 res += per_cpu_ptr((part)->dkstats, _cpu)->field; \
262 res; \ 262 res; \
263}) 263})
264 264
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 557bdad320b6..4c6d41333f98 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -30,7 +30,8 @@ struct vm_area_struct;
30 * _might_ fail. This depends upon the particular VM implementation. 30 * _might_ fail. This depends upon the particular VM implementation.
31 * 31 *
32 * __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller 32 * __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller
33 * cannot handle allocation failures. 33 * cannot handle allocation failures. This modifier is deprecated and no new
34 * users should be added.
34 * 35 *
35 * __GFP_NORETRY: The VM implementation must not retry indefinitely. 36 * __GFP_NORETRY: The VM implementation must not retry indefinitely.
36 * 37 *
@@ -83,6 +84,7 @@ struct vm_area_struct;
83#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ 84#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
84 __GFP_HARDWALL | __GFP_HIGHMEM | \ 85 __GFP_HARDWALL | __GFP_HIGHMEM | \
85 __GFP_MOVABLE) 86 __GFP_MOVABLE)
87#define GFP_IOFS (__GFP_IO | __GFP_FS)
86 88
87#ifdef CONFIG_NUMA 89#ifdef CONFIG_NUMA
88#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 90#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
@@ -325,7 +327,7 @@ void free_pages_exact(void *virt, size_t size);
325 327
326extern void __free_pages(struct page *page, unsigned int order); 328extern void __free_pages(struct page *page, unsigned int order);
327extern void free_pages(unsigned long addr, unsigned int order); 329extern void free_pages(unsigned long addr, unsigned int order);
328extern void free_hot_page(struct page *page); 330extern void free_hot_cold_page(struct page *page, int cold);
329 331
330#define __free_page(page) __free_pages((page), 0) 332#define __free_page(page) __free_pages((page), 0)
331#define free_page(addr) free_pages((addr),0) 333#define free_page(addr) free_pages((addr),0)
@@ -337,9 +339,7 @@ void drain_local_pages(void *dummy);
337 339
338extern gfp_t gfp_allowed_mask; 340extern gfp_t gfp_allowed_mask;
339 341
340static inline void set_gfp_allowed_mask(gfp_t mask) 342extern void set_gfp_allowed_mask(gfp_t mask);
341{ 343extern gfp_t clear_gfp_allowed_mask(gfp_t mask);
342 gfp_allowed_mask = mask;
343}
344 344
345#endif /* __LINUX_GFP_H */ 345#endif /* __LINUX_GFP_H */
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index 81f90a59cda6..4f4462974c14 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -180,33 +180,6 @@ struct gfs2_rgrp {
180}; 180};
181 181
182/* 182/*
183 * quota linked list: user quotas and group quotas form two separate
184 * singly linked lists. ll_next stores uids or gids of next quotas in the
185 * linked list.
186
187Given the uid/gid, how to calculate the quota file offsets for the corresponding
188gfs2_quota structures on disk:
189
190for user quotas, given uid,
191offset = uid * sizeof(struct gfs2_quota);
192
193for group quotas, given gid,
194offset = (gid * sizeof(struct gfs2_quota)) + sizeof(struct gfs2_quota);
195
196
197 uid:0 gid:0 uid:12 gid:12 uid:17 gid:17 uid:5142 gid:5142
198+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
199| valid | valid | :: | valid | valid | :: | valid | inval | :: | inval | valid |
200+-------+-------+ +-------+-------+ +-------+- - - -+ +- - - -+-------+
201next:12 next:12 next:17 next:5142 next:NULL next:NULL
202 | | | | |<-- user quota list |
203 \______|___________/ \______|___________/ group quota list -->|
204 | | |
205 \__________________/ \_______________________________________/
206
207*/
208
209/*
210 * quota structure 183 * quota structure
211 */ 184 */
212 185
@@ -214,8 +187,7 @@ struct gfs2_quota {
214 __be64 qu_limit; 187 __be64 qu_limit;
215 __be64 qu_warn; 188 __be64 qu_warn;
216 __be64 qu_value; 189 __be64 qu_value;
217 __be32 qu_ll_next; /* location of next quota in list */ 190 __u8 qu_reserved[64];
218 __u8 qu_reserved[60];
219}; 191};
220 192
221/* 193/*
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index 1289fa7623ca..cd0b3f30f48e 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -10,6 +10,7 @@ struct gpio_keys_button {
10 int type; /* input event type (EV_KEY, EV_SW) */ 10 int type; /* input event type (EV_KEY, EV_SW) */
11 int wakeup; /* configure the button as a wake-up source */ 11 int wakeup; /* configure the button as a wake-up source */
12 int debounce_interval; /* debounce ticks interval in msecs */ 12 int debounce_interval; /* debounce ticks interval in msecs */
13 bool can_disable;
13}; 14};
14 15
15struct gpio_keys_platform_data { 16struct gpio_keys_platform_data {
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 87093652dda8..b1344ec4b7fc 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -501,7 +501,7 @@ struct hid_device { /* device report descriptor */
501 void (*hiddev_report_event) (struct hid_device *, struct hid_report *); 501 void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
502 502
503 /* handler for raw output data, used by hidraw */ 503 /* handler for raw output data, used by hidraw */
504 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); 504 int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char);
505 505
506 /* debugging support via debugfs */ 506 /* debugging support via debugfs */
507 unsigned short debug; 507 unsigned short debug;
@@ -663,7 +663,7 @@ struct hid_ll_driver {
663 663
664/* Applications from HID Usage Tables 4/8/99 Version 1.1 */ 664/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
665/* We ignore a few input applications that are not widely used */ 665/* We ignore a few input applications that are not widely used */
666#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002)) 666#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006)))
667 667
668/* HID core API */ 668/* HID core API */
669 669
@@ -690,6 +690,7 @@ int hid_input_report(struct hid_device *, int type, u8 *, int, int);
690int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); 690int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
691void hid_output_report(struct hid_report *report, __u8 *data); 691void hid_output_report(struct hid_report *report, __u8 *data);
692struct hid_device *hid_allocate_device(void); 692struct hid_device *hid_allocate_device(void);
693struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
693int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); 694int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
694int hid_check_keys_pressed(struct hid_device *hid); 695int hid_check_keys_pressed(struct hid_device *hid);
695int hid_connect(struct hid_device *hid, unsigned int connect_mask); 696int hid_connect(struct hid_device *hid, unsigned int connect_mask);
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 211ff4497269..74152c08ad07 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -17,6 +17,12 @@ static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page
17static inline void flush_kernel_dcache_page(struct page *page) 17static inline void flush_kernel_dcache_page(struct page *page)
18{ 18{
19} 19}
20static inline void flush_kernel_vmap_range(void *vaddr, int size)
21{
22}
23static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
24{
25}
20#endif 26#endif
21 27
22#include <asm/kmap_types.h> 28#include <asm/kmap_types.h>
@@ -46,7 +52,7 @@ void kmap_flush_unused(void);
46 52
47static inline unsigned int nr_free_highpages(void) { return 0; } 53static inline unsigned int nr_free_highpages(void) { return 0; }
48 54
49#define totalhigh_pages 0 55#define totalhigh_pages 0UL
50 56
51#ifndef ARCH_HAS_KMAP 57#ifndef ARCH_HAS_KMAP
52static inline void *kmap(struct page *page) 58static inline void *kmap(struct page *page)
diff --git a/include/linux/hil.h b/include/linux/hil.h
index 13352d7d0caf..523785a9de70 100644
--- a/include/linux/hil.h
+++ b/include/linux/hil.h
@@ -168,14 +168,14 @@ enum hil_command {
168 HIL_CMD_PR6 = 0x45, /* Prompt6 */ 168 HIL_CMD_PR6 = 0x45, /* Prompt6 */
169 HIL_CMD_PR7 = 0x46, /* Prompt7 */ 169 HIL_CMD_PR7 = 0x46, /* Prompt7 */
170 HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */ 170 HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */
171 HIL_CMD_AK1 = 0x48, /* Acknowlege1 */ 171 HIL_CMD_AK1 = 0x48, /* Acknowledge1 */
172 HIL_CMD_AK2 = 0x49, /* Acknowlege2 */ 172 HIL_CMD_AK2 = 0x49, /* Acknowledge2 */
173 HIL_CMD_AK3 = 0x4a, /* Acknowlege3 */ 173 HIL_CMD_AK3 = 0x4a, /* Acknowledge3 */
174 HIL_CMD_AK4 = 0x4b, /* Acknowlege4 */ 174 HIL_CMD_AK4 = 0x4b, /* Acknowledge4 */
175 HIL_CMD_AK5 = 0x4c, /* Acknowlege5 */ 175 HIL_CMD_AK5 = 0x4c, /* Acknowledge5 */
176 HIL_CMD_AK6 = 0x4d, /* Acknowlege6 */ 176 HIL_CMD_AK6 = 0x4d, /* Acknowledge6 */
177 HIL_CMD_AK7 = 0x4e, /* Acknowlege7 */ 177 HIL_CMD_AK7 = 0x4e, /* Acknowledge7 */
178 HIL_CMD_ACK = 0x4f, /* Acknowlege (General Purpose) */ 178 HIL_CMD_ACK = 0x4f, /* Acknowledge (General Purpose) */
179 179
180 /* 0x50 to 0x78 reserved for future use */ 180 /* 0x50 to 0x78 reserved for future use */
181 /* 0x80 to 0xEF device-specific commands */ 181 /* 0x80 to 0xEF device-specific commands */
diff --git a/include/linux/htcpld.h b/include/linux/htcpld.h
new file mode 100644
index 000000000000..ab3f6cb4dddc
--- /dev/null
+++ b/include/linux/htcpld.h
@@ -0,0 +1,24 @@
1#ifndef __LINUX_HTCPLD_H
2#define __LINUX_HTCPLD_H
3
4struct htcpld_chip_platform_data {
5 unsigned int addr;
6 unsigned int reset;
7 unsigned int num_gpios;
8 unsigned int gpio_out_base;
9 unsigned int gpio_in_base;
10 unsigned int irq_base;
11 unsigned int num_irqs;
12};
13
14struct htcpld_core_platform_data {
15 unsigned int int_reset_gpio_hi;
16 unsigned int int_reset_gpio_lo;
17 unsigned int i2c_adapter_id;
18
19 struct htcpld_chip_platform_data *chip;
20 unsigned int num_chip;
21};
22
23#endif /* __LINUX_HTCPLD_H */
24
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index 41235c93e4e9..c70d27af03f9 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -44,7 +44,7 @@ static inline int hw_breakpoint_type(struct perf_event *bp)
44 return bp->attr.bp_type; 44 return bp->attr.bp_type;
45} 45}
46 46
47static inline int hw_breakpoint_len(struct perf_event *bp) 47static inline unsigned long hw_breakpoint_len(struct perf_event *bp)
48{ 48{
49 return bp->attr.bp_len; 49 return bp->attr.bp_len;
50} 50}
@@ -66,15 +66,17 @@ register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
66 perf_overflow_handler_t triggered, 66 perf_overflow_handler_t triggered,
67 int cpu); 67 int cpu);
68 68
69extern struct perf_event ** 69extern struct perf_event * __percpu *
70register_wide_hw_breakpoint(struct perf_event_attr *attr, 70register_wide_hw_breakpoint(struct perf_event_attr *attr,
71 perf_overflow_handler_t triggered); 71 perf_overflow_handler_t triggered);
72 72
73extern int register_perf_hw_breakpoint(struct perf_event *bp); 73extern int register_perf_hw_breakpoint(struct perf_event *bp);
74extern int __register_perf_hw_breakpoint(struct perf_event *bp); 74extern int __register_perf_hw_breakpoint(struct perf_event *bp);
75extern void unregister_hw_breakpoint(struct perf_event *bp); 75extern void unregister_hw_breakpoint(struct perf_event *bp);
76extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); 76extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events);
77 77
78extern int dbg_reserve_bp_slot(struct perf_event *bp);
79extern int dbg_release_bp_slot(struct perf_event *bp);
78extern int reserve_bp_slot(struct perf_event *bp); 80extern int reserve_bp_slot(struct perf_event *bp);
79extern void release_bp_slot(struct perf_event *bp); 81extern void release_bp_slot(struct perf_event *bp);
80 82
@@ -98,7 +100,7 @@ static inline struct perf_event *
98register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, 100register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
99 perf_overflow_handler_t triggered, 101 perf_overflow_handler_t triggered,
100 int cpu) { return NULL; } 102 int cpu) { return NULL; }
101static inline struct perf_event ** 103static inline struct perf_event * __percpu *
102register_wide_hw_breakpoint(struct perf_event_attr *attr, 104register_wide_hw_breakpoint(struct perf_event_attr *attr,
103 perf_overflow_handler_t triggered) { return NULL; } 105 perf_overflow_handler_t triggered) { return NULL; }
104static inline int 106static inline int
@@ -107,7 +109,7 @@ static inline int
107__register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } 109__register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
108static inline void unregister_hw_breakpoint(struct perf_event *bp) { } 110static inline void unregister_hw_breakpoint(struct perf_event *bp) { }
109static inline void 111static inline void
110unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { } 112unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events) { }
111static inline int 113static inline int
112reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } 114reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; }
113static inline void release_bp_slot(struct perf_event *bp) { } 115static inline void release_bp_slot(struct perf_event *bp) { }
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h
index 111334f5b922..4f98148c11c3 100644
--- a/include/linux/i2c-algo-bit.h
+++ b/include/linux/i2c-algo-bit.h
@@ -36,6 +36,8 @@ struct i2c_algo_bit_data {
36 void (*setscl) (void *data, int state); 36 void (*setscl) (void *data, int state);
37 int (*getsda) (void *data); 37 int (*getsda) (void *data);
38 int (*getscl) (void *data); 38 int (*getscl) (void *data);
39 int (*pre_xfer) (struct i2c_adapter *);
40 void (*post_xfer) (struct i2c_adapter *);
39 41
40 /* local settings */ 42 /* local settings */
41 int udelay; /* half clock cycle time in us, 43 int udelay; /* half clock cycle time in us,
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index 9eb07bbc6522..a87124d4d533 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -12,9 +12,8 @@
12#ifndef __I2C_PNX_H__ 12#ifndef __I2C_PNX_H__
13#define __I2C_PNX_H__ 13#define __I2C_PNX_H__
14 14
15#include <linux/pm.h>
16
17struct platform_device; 15struct platform_device;
16struct clk;
18 17
19struct i2c_pnx_mif { 18struct i2c_pnx_mif {
20 int ret; /* Return value */ 19 int ret; /* Return value */
@@ -26,20 +25,18 @@ struct i2c_pnx_mif {
26}; 25};
27 26
28struct i2c_pnx_algo_data { 27struct i2c_pnx_algo_data {
29 u32 base; 28 void __iomem *ioaddr;
30 u32 ioaddr;
31 int irq;
32 struct i2c_pnx_mif mif; 29 struct i2c_pnx_mif mif;
33 int last; 30 int last;
31 struct clk *clk;
32 struct i2c_pnx_data *i2c_pnx;
33 struct i2c_adapter adapter;
34}; 34};
35 35
36struct i2c_pnx_data { 36struct i2c_pnx_data {
37 int (*suspend) (struct platform_device *pdev, pm_message_t state); 37 const char *name;
38 int (*resume) (struct platform_device *pdev); 38 u32 base;
39 u32 (*calculate_input_freq) (struct platform_device *pdev); 39 int irq;
40 int (*set_clock_run) (struct platform_device *pdev);
41 int (*set_clock_stop) (struct platform_device *pdev);
42 struct i2c_adapter *adapter;
43}; 40};
44 41
45#endif /* __I2C_PNX_H__ */ 42#endif /* __I2C_PNX_H__ */
diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h
new file mode 100644
index 000000000000..63f57a8c8b31
--- /dev/null
+++ b/include/linux/i2c-smbus.h
@@ -0,0 +1,50 @@
1/*
2 * i2c-smbus.h - SMBus extensions to the I2C protocol
3 *
4 * Copyright (C) 2010 Jean Delvare <khali@linux-fr.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _LINUX_I2C_SMBUS_H
22#define _LINUX_I2C_SMBUS_H
23
24#include <linux/i2c.h>
25
26
27/**
28 * i2c_smbus_alert_setup - platform data for the smbus_alert i2c client
29 * @alert_edge_triggered: whether the alert interrupt is edge (1) or level (0)
30 * triggered
31 * @irq: IRQ number, if the smbus_alert driver should take care of interrupt
32 * handling
33 *
34 * If irq is not specified, the smbus_alert driver doesn't take care of
35 * interrupt handling. In that case it is up to the I2C bus driver to either
36 * handle the interrupts or to poll for alerts.
37 *
38 * If irq is specified then it it crucial that alert_edge_triggered is
39 * properly set.
40 */
41struct i2c_smbus_alert_setup {
42 unsigned int alert_edge_triggered:1;
43 int irq;
44};
45
46struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter,
47 struct i2c_smbus_alert_setup *setup);
48int i2c_handle_smbus_alert(struct i2c_client *ara);
49
50#endif /* _LINUX_I2C_SMBUS_H */
diff --git a/include/linux/i2c-xiic.h b/include/linux/i2c-xiic.h
new file mode 100644
index 000000000000..4f9f2256a97e
--- /dev/null
+++ b/include/linux/i2c-xiic.h
@@ -0,0 +1,43 @@
1/*
2 * i2c-xiic.h
3 * Copyright (c) 2009 Intel Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19/* Supports:
20 * Xilinx IIC
21 */
22
23#ifndef _LINUX_I2C_XIIC_H
24#define _LINUX_I2C_XIIC_H
25
26/**
27 * struct xiic_i2c_platform_data - Platform data of the Xilinx I2C driver
28 * @num_devices: Number of devices that shall be added when the driver
29 * is probed.
30 * @devices: The actuall devices to add.
31 *
32 * This purpose of this platform data struct is to be able to provide a number
33 * of devices that should be added to the I2C bus. The reason is that sometimes
34 * the I2C board info is not enough, a new PCI board can for instance be
35 * plugged into a standard PC, and the bus number might be unknown at
36 * early init time.
37 */
38struct xiic_i2c_platform_data {
39 u8 num_devices;
40 struct i2c_board_info const *devices;
41};
42
43#endif /* _LINUX_I2C_XIIC_H */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 02fc617782ef..0a5da639b327 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -53,6 +53,7 @@ struct i2c_board_info;
53 * on a bus (or read from them). Apart from two basic transfer functions to 53 * on a bus (or read from them). Apart from two basic transfer functions to
54 * transmit one message at a time, a more complex version can be used to 54 * transmit one message at a time, a more complex version can be used to
55 * transmit an arbitrary number of messages without interruption. 55 * transmit an arbitrary number of messages without interruption.
56 * @count must be be less than 64k since msg.len is u16.
56 */ 57 */
57extern int i2c_master_send(struct i2c_client *client, const char *buf, 58extern int i2c_master_send(struct i2c_client *client, const char *buf,
58 int count); 59 int count);
@@ -152,6 +153,13 @@ struct i2c_driver {
152 int (*suspend)(struct i2c_client *, pm_message_t mesg); 153 int (*suspend)(struct i2c_client *, pm_message_t mesg);
153 int (*resume)(struct i2c_client *); 154 int (*resume)(struct i2c_client *);
154 155
156 /* Alert callback, for example for the SMBus alert protocol.
157 * The format and meaning of the data value depends on the protocol.
158 * For the SMBus alert protocol, there is a single bit of data passed
159 * as the alert response's low bit ("event flag").
160 */
161 void (*alert)(struct i2c_client *, unsigned int data);
162
155 /* a ioctl like command that can be used to perform specific functions 163 /* a ioctl like command that can be used to perform specific functions
156 * with the device. 164 * with the device.
157 */ 165 */
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h
index fc5db826b48e..02c9af374741 100644
--- a/include/linux/i2c/adp5588.h
+++ b/include/linux/i2c/adp5588.h
@@ -89,4 +89,16 @@ struct adp5588_kpad_platform_data {
89 unsigned short unlock_key2; /* Unlock Key 2 */ 89 unsigned short unlock_key2; /* Unlock Key 2 */
90}; 90};
91 91
92struct adp5588_gpio_platform_data {
93 unsigned gpio_start; /* GPIO Chip base # */
94 unsigned pullup_dis_mask; /* Pull-Up Disable Mask */
95 int (*setup)(struct i2c_client *client,
96 int gpio, unsigned ngpio,
97 void *context);
98 int (*teardown)(struct i2c_client *client,
99 int gpio, unsigned ngpio,
100 void *context);
101 void *context;
102};
103
92#endif 104#endif
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h
index 81736d6a8db7..d5c5a60c8a0b 100644
--- a/include/linux/i2c/pca953x.h
+++ b/include/linux/i2c/pca953x.h
@@ -1,3 +1,9 @@
1#ifndef _LINUX_PCA953X_H
2#define _LINUX_PCA953X_H
3
4#include <linux/types.h>
5#include <linux/i2c.h>
6
1/* platform data for the PCA9539 16-bit I/O expander driver */ 7/* platform data for the PCA9539 16-bit I/O expander driver */
2 8
3struct pca953x_platform_data { 9struct pca953x_platform_data {
@@ -7,6 +13,9 @@ struct pca953x_platform_data {
7 /* initial polarity inversion setting */ 13 /* initial polarity inversion setting */
8 uint16_t invert; 14 uint16_t invert;
9 15
16 /* interrupt base */
17 int irq_base;
18
10 void *context; /* param to setup/teardown */ 19 void *context; /* param to setup/teardown */
11 20
12 int (*setup)(struct i2c_client *client, 21 int (*setup)(struct i2c_client *client,
@@ -17,3 +26,5 @@ struct pca953x_platform_data {
17 void *context); 26 void *context);
18 char **names; 27 char **names;
19}; 28};
29
30#endif /* _LINUX_PCA953X_H */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index bf1c5be1f5b6..fb6784e86d5f 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -80,6 +80,11 @@
80#define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER 80#define TWL_MODULE_PM_MASTER TWL4030_MODULE_PM_MASTER
81#define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER 81#define TWL_MODULE_PM_RECEIVER TWL4030_MODULE_PM_RECEIVER
82#define TWL_MODULE_RTC TWL4030_MODULE_RTC 82#define TWL_MODULE_RTC TWL4030_MODULE_RTC
83#define TWL_MODULE_PWM TWL4030_MODULE_PWM0
84
85#define TWL6030_MODULE_ID0 0x0D
86#define TWL6030_MODULE_ID1 0x0E
87#define TWL6030_MODULE_ID2 0x0F
83 88
84#define GPIO_INTR_OFFSET 0 89#define GPIO_INTR_OFFSET 0
85#define KEYPAD_INTR_OFFSET 1 90#define KEYPAD_INTR_OFFSET 1
@@ -239,6 +244,21 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
239 244
240/*----------------------------------------------------------------------*/ 245/*----------------------------------------------------------------------*/
241 246
247/*Interface Bit Register (INTBR) offsets
248 *(Use TWL_4030_MODULE_INTBR)
249 */
250
251#define REG_GPPUPDCTR1 0x0F
252
253/*I2C1 and I2C4(SR) SDA/SCL pull-up control bits */
254
255#define I2C_SCL_CTRL_PU BIT(0)
256#define I2C_SDA_CTRL_PU BIT(2)
257#define SR_I2C_SCL_CTRL_PU BIT(4)
258#define SR_I2C_SDA_CTRL_PU BIT(6)
259
260/*----------------------------------------------------------------------*/
261
242/* 262/*
243 * Keypad register offsets (use TWL4030_MODULE_KEYPAD) 263 * Keypad register offsets (use TWL4030_MODULE_KEYPAD)
244 * ... SIH/interrupt only 264 * ... SIH/interrupt only
@@ -530,6 +550,7 @@ struct twl4030_power_data {
530}; 550};
531 551
532extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); 552extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
553extern int twl4030_remove_script(u8 flags);
533 554
534struct twl4030_codec_audio_data { 555struct twl4030_codec_audio_data {
535 unsigned int audio_mclk; 556 unsigned int audio_mclk;
@@ -547,6 +568,10 @@ struct twl4030_codec_data {
547 unsigned int audio_mclk; 568 unsigned int audio_mclk;
548 struct twl4030_codec_audio_data *audio; 569 struct twl4030_codec_audio_data *audio;
549 struct twl4030_codec_vibra_data *vibra; 570 struct twl4030_codec_vibra_data *vibra;
571
572 /* twl6030 */
573 int audpwron_gpio; /* audio power-on gpio */
574 int naudint_irq; /* audio interrupt */
550}; 575};
551 576
552struct twl4030_platform_data { 577struct twl4030_platform_data {
@@ -601,12 +626,7 @@ int twl4030_sih_setup(int module);
601#define TWL4030_VAUX3_DEV_GRP 0x1F 626#define TWL4030_VAUX3_DEV_GRP 0x1F
602#define TWL4030_VAUX3_DEDICATED 0x22 627#define TWL4030_VAUX3_DEDICATED 0x22
603 628
604#if defined(CONFIG_TWL4030_BCI_BATTERY) || \ 629static inline int twl4030charger_usb_en(int enable) { return 0; }
605 defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
606 extern int twl4030charger_usb_en(int enable);
607#else
608 static inline int twl4030charger_usb_en(int enable) { return 0; }
609#endif
610 630
611/*----------------------------------------------------------------------*/ 631/*----------------------------------------------------------------------*/
612 632
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 4c4e57d1f19d..87018dc5527d 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -385,7 +385,7 @@
385/* defines for max_sectors and max_phys_segments */ 385/* defines for max_sectors and max_phys_segments */
386#define I2O_MAX_SECTORS 1024 386#define I2O_MAX_SECTORS 1024
387#define I2O_MAX_SECTORS_LIMITED 128 387#define I2O_MAX_SECTORS_LIMITED 128
388#define I2O_MAX_PHYS_SEGMENTS MAX_PHYS_SEGMENTS 388#define I2O_MAX_PHYS_SEGMENTS BLK_MAX_SEGMENTS
389 389
390/* 390/*
391 * Message structures 391 * Message structures
diff --git a/include/linux/i8042.h b/include/linux/i8042.h
index 60c3360ef6ad..9bf6870ee5f4 100644
--- a/include/linux/i8042.h
+++ b/include/linux/i8042.h
@@ -39,6 +39,10 @@ void i8042_lock_chip(void);
39void i8042_unlock_chip(void); 39void i8042_unlock_chip(void);
40int i8042_command(unsigned char *param, int command); 40int i8042_command(unsigned char *param, int command);
41bool i8042_check_port_owner(const struct serio *); 41bool i8042_check_port_owner(const struct serio *);
42int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
43 struct serio *serio));
44int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
45 struct serio *serio));
42 46
43#else 47#else
44 48
@@ -52,7 +56,7 @@ void i8042_unlock_chip(void)
52 56
53int i8042_command(unsigned char *param, int command) 57int i8042_command(unsigned char *param, int command)
54{ 58{
55 return -ENOSYS; 59 return -ENODEV;
56} 60}
57 61
58bool i8042_check_port_owner(const struct serio *serio) 62bool i8042_check_port_owner(const struct serio *serio)
@@ -60,6 +64,18 @@ bool i8042_check_port_owner(const struct serio *serio)
60 return false; 64 return false;
61} 65}
62 66
67int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
68 struct serio *serio))
69{
70 return -ENODEV;
71}
72
73int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
74 struct serio *serio))
75{
76 return -ENODEV;
77}
78
63#endif 79#endif
64 80
65#endif 81#endif
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index c0d8357917e2..4c4c74ec5987 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -174,8 +174,7 @@ struct icmp6_filter {
174 174
175extern void icmpv6_send(struct sk_buff *skb, 175extern void icmpv6_send(struct sk_buff *skb,
176 u8 type, u8 code, 176 u8 type, u8 code,
177 __u32 info, 177 __u32 info);
178 struct net_device *dev);
179 178
180extern int icmpv6_init(void); 179extern int icmpv6_init(void);
181extern int icmpv6_err_convert(u8 type, u8 code, 180extern int icmpv6_err_convert(u8 type, u8 code,
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 0ec612959042..97e6ab435184 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -515,6 +515,8 @@ struct ide_drive_s {
515 u8 init_speed; /* transfer rate set at boot */ 515 u8 init_speed; /* transfer rate set at boot */
516 u8 current_speed; /* current transfer rate set */ 516 u8 current_speed; /* current transfer rate set */
517 u8 desired_speed; /* desired transfer rate set */ 517 u8 desired_speed; /* desired transfer rate set */
518 u8 pio_mode; /* for ->set_pio_mode _only_ */
519 u8 dma_mode; /* for ->dma_pio_mode _only_ */
518 u8 dn; /* now wide spread use */ 520 u8 dn; /* now wide spread use */
519 u8 acoustic; /* acoustic management */ 521 u8 acoustic; /* acoustic management */
520 u8 media; /* disk, cdrom, tape, floppy, ... */ 522 u8 media; /* disk, cdrom, tape, floppy, ... */
@@ -622,8 +624,8 @@ extern const struct ide_tp_ops default_tp_ops;
622 */ 624 */
623struct ide_port_ops { 625struct ide_port_ops {
624 void (*init_dev)(ide_drive_t *); 626 void (*init_dev)(ide_drive_t *);
625 void (*set_pio_mode)(ide_drive_t *, const u8); 627 void (*set_pio_mode)(struct hwif_s *, ide_drive_t *);
626 void (*set_dma_mode)(ide_drive_t *, const u8); 628 void (*set_dma_mode)(struct hwif_s *, ide_drive_t *);
627 int (*reset_poll)(ide_drive_t *); 629 int (*reset_poll)(ide_drive_t *);
628 void (*pre_reset)(ide_drive_t *); 630 void (*pre_reset)(ide_drive_t *);
629 void (*resetproc)(ide_drive_t *); 631 void (*resetproc)(ide_drive_t *);
@@ -1494,7 +1496,6 @@ int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int);
1494#ifdef CONFIG_IDE_XFER_MODE 1496#ifdef CONFIG_IDE_XFER_MODE
1495int ide_scan_pio_blacklist(char *); 1497int ide_scan_pio_blacklist(char *);
1496const char *ide_xfer_verbose(u8); 1498const char *ide_xfer_verbose(u8);
1497u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
1498int ide_pio_need_iordy(ide_drive_t *, const u8); 1499int ide_pio_need_iordy(ide_drive_t *, const u8);
1499int ide_set_pio_mode(ide_drive_t *, u8); 1500int ide_set_pio_mode(ide_drive_t *, u8);
1500int ide_set_dma_mode(ide_drive_t *, u8); 1501int ide_set_dma_mode(ide_drive_t *, u8);
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index d9724a28c0c2..19984958ab7b 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -120,6 +120,26 @@
120#define IEEE80211_QOS_CTL_TID_MASK 0x000F 120#define IEEE80211_QOS_CTL_TID_MASK 0x000F
121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
122 122
123/* U-APSD queue for WMM IEs sent by AP */
124#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7)
125
126/* U-APSD queues for WMM IEs sent by STA */
127#define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO (1<<0)
128#define IEEE80211_WMM_IE_STA_QOSINFO_AC_VI (1<<1)
129#define IEEE80211_WMM_IE_STA_QOSINFO_AC_BK (1<<2)
130#define IEEE80211_WMM_IE_STA_QOSINFO_AC_BE (1<<3)
131#define IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK 0x0f
132
133/* U-APSD max SP length for WMM IEs sent by STA */
134#define IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL 0x00
135#define IEEE80211_WMM_IE_STA_QOSINFO_SP_2 0x01
136#define IEEE80211_WMM_IE_STA_QOSINFO_SP_4 0x02
137#define IEEE80211_WMM_IE_STA_QOSINFO_SP_6 0x03
138#define IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK 0x03
139#define IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT 5
140
141#define IEEE80211_HT_CTL_LEN 4
142
123struct ieee80211_hdr { 143struct ieee80211_hdr {
124 __le16 frame_control; 144 __le16 frame_control;
125 __le16 duration_id; 145 __le16 duration_id;
@@ -130,6 +150,25 @@ struct ieee80211_hdr {
130 u8 addr4[6]; 150 u8 addr4[6];
131} __attribute__ ((packed)); 151} __attribute__ ((packed));
132 152
153struct ieee80211_hdr_3addr {
154 __le16 frame_control;
155 __le16 duration_id;
156 u8 addr1[6];
157 u8 addr2[6];
158 u8 addr3[6];
159 __le16 seq_ctrl;
160} __attribute__ ((packed));
161
162struct ieee80211_qos_hdr {
163 __le16 frame_control;
164 __le16 duration_id;
165 u8 addr1[6];
166 u8 addr2[6];
167 u8 addr3[6];
168 __le16 seq_ctrl;
169 __le16 qos_ctrl;
170} __attribute__ ((packed));
171
133/** 172/**
134 * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set 173 * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set
135 * @fc: frame control bytes in little-endian byteorder 174 * @fc: frame control bytes in little-endian byteorder
@@ -707,6 +746,10 @@ struct ieee80211_mgmt {
707 u8 action; 746 u8 action;
708 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; 747 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
709 } __attribute__ ((packed)) sa_query; 748 } __attribute__ ((packed)) sa_query;
749 struct {
750 u8 action;
751 u8 smps_control;
752 } __attribute__ ((packed)) ht_smps;
710 } u; 753 } u;
711 } __attribute__ ((packed)) action; 754 } __attribute__ ((packed)) action;
712 } u; 755 } u;
@@ -771,7 +814,10 @@ struct ieee80211_bar {
771/** 814/**
772 * struct ieee80211_mcs_info - MCS information 815 * struct ieee80211_mcs_info - MCS information
773 * @rx_mask: RX mask 816 * @rx_mask: RX mask
774 * @rx_highest: highest supported RX rate 817 * @rx_highest: highest supported RX rate. If set represents
818 * the highest supported RX data rate in units of 1 Mbps.
819 * If this field is 0 this value should not be used to
820 * consider the highest RX data rate supported.
775 * @tx_params: TX parameters 821 * @tx_params: TX parameters
776 */ 822 */
777struct ieee80211_mcs_info { 823struct ieee80211_mcs_info {
@@ -824,6 +870,7 @@ struct ieee80211_ht_cap {
824#define IEEE80211_HT_CAP_LDPC_CODING 0x0001 870#define IEEE80211_HT_CAP_LDPC_CODING 0x0001
825#define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 871#define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002
826#define IEEE80211_HT_CAP_SM_PS 0x000C 872#define IEEE80211_HT_CAP_SM_PS 0x000C
873#define IEEE80211_HT_CAP_SM_PS_SHIFT 2
827#define IEEE80211_HT_CAP_GRN_FLD 0x0010 874#define IEEE80211_HT_CAP_GRN_FLD 0x0010
828#define IEEE80211_HT_CAP_SGI_20 0x0020 875#define IEEE80211_HT_CAP_SGI_20 0x0020
829#define IEEE80211_HT_CAP_SGI_40 0x0040 876#define IEEE80211_HT_CAP_SGI_40 0x0040
@@ -832,13 +879,14 @@ struct ieee80211_ht_cap {
832#define IEEE80211_HT_CAP_DELAY_BA 0x0400 879#define IEEE80211_HT_CAP_DELAY_BA 0x0400
833#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 880#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
834#define IEEE80211_HT_CAP_DSSSCCK40 0x1000 881#define IEEE80211_HT_CAP_DSSSCCK40 0x1000
835#define IEEE80211_HT_CAP_PSMP_SUPPORT 0x2000 882#define IEEE80211_HT_CAP_RESERVED 0x2000
836#define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 883#define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000
837#define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 884#define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000
838 885
839/* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ 886/* 802.11n HT capability AMPDU settings (for ampdu_params_info) */
840#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 887#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03
841#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C 888#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C
889#define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2
842 890
843/* 891/*
844 * Maximum length of AMPDU that the STA can receive. 892 * Maximum length of AMPDU that the STA can receive.
@@ -922,12 +970,17 @@ struct ieee80211_ht_info {
922#define IEEE80211_MAX_AMPDU_BUF 0x40 970#define IEEE80211_MAX_AMPDU_BUF 0x40
923 971
924 972
925/* Spatial Multiplexing Power Save Modes */ 973/* Spatial Multiplexing Power Save Modes (for capability) */
926#define WLAN_HT_CAP_SM_PS_STATIC 0 974#define WLAN_HT_CAP_SM_PS_STATIC 0
927#define WLAN_HT_CAP_SM_PS_DYNAMIC 1 975#define WLAN_HT_CAP_SM_PS_DYNAMIC 1
928#define WLAN_HT_CAP_SM_PS_INVALID 2 976#define WLAN_HT_CAP_SM_PS_INVALID 2
929#define WLAN_HT_CAP_SM_PS_DISABLED 3 977#define WLAN_HT_CAP_SM_PS_DISABLED 3
930 978
979/* for SM power control field lower two bits */
980#define WLAN_HT_SMPS_CONTROL_DISABLED 0
981#define WLAN_HT_SMPS_CONTROL_STATIC 1
982#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
983
931/* Authentication algorithms */ 984/* Authentication algorithms */
932#define WLAN_AUTH_OPEN 0 985#define WLAN_AUTH_OPEN 0
933#define WLAN_AUTH_SHARED_KEY 1 986#define WLAN_AUTH_SHARED_KEY 1
@@ -1071,12 +1124,12 @@ enum ieee80211_eid {
1071 WLAN_EID_TIM = 5, 1124 WLAN_EID_TIM = 5,
1072 WLAN_EID_IBSS_PARAMS = 6, 1125 WLAN_EID_IBSS_PARAMS = 6,
1073 WLAN_EID_CHALLENGE = 16, 1126 WLAN_EID_CHALLENGE = 16,
1074 /* 802.11d */ 1127
1075 WLAN_EID_COUNTRY = 7, 1128 WLAN_EID_COUNTRY = 7,
1076 WLAN_EID_HP_PARAMS = 8, 1129 WLAN_EID_HP_PARAMS = 8,
1077 WLAN_EID_HP_TABLE = 9, 1130 WLAN_EID_HP_TABLE = 9,
1078 WLAN_EID_REQUEST = 10, 1131 WLAN_EID_REQUEST = 10,
1079 /* 802.11e */ 1132
1080 WLAN_EID_QBSS_LOAD = 11, 1133 WLAN_EID_QBSS_LOAD = 11,
1081 WLAN_EID_EDCA_PARAM_SET = 12, 1134 WLAN_EID_EDCA_PARAM_SET = 12,
1082 WLAN_EID_TSPEC = 13, 1135 WLAN_EID_TSPEC = 13,
@@ -1099,7 +1152,7 @@ enum ieee80211_eid {
1099 WLAN_EID_PREP = 69, 1152 WLAN_EID_PREP = 69,
1100 WLAN_EID_PERR = 70, 1153 WLAN_EID_PERR = 70,
1101 WLAN_EID_RANN = 49, /* compatible with FreeBSD */ 1154 WLAN_EID_RANN = 49, /* compatible with FreeBSD */
1102 /* 802.11h */ 1155
1103 WLAN_EID_PWR_CONSTRAINT = 32, 1156 WLAN_EID_PWR_CONSTRAINT = 32,
1104 WLAN_EID_PWR_CAPABILITY = 33, 1157 WLAN_EID_PWR_CAPABILITY = 33,
1105 WLAN_EID_TPC_REQUEST = 34, 1158 WLAN_EID_TPC_REQUEST = 34,
@@ -1110,20 +1163,41 @@ enum ieee80211_eid {
1110 WLAN_EID_MEASURE_REPORT = 39, 1163 WLAN_EID_MEASURE_REPORT = 39,
1111 WLAN_EID_QUIET = 40, 1164 WLAN_EID_QUIET = 40,
1112 WLAN_EID_IBSS_DFS = 41, 1165 WLAN_EID_IBSS_DFS = 41,
1113 /* 802.11g */ 1166
1114 WLAN_EID_ERP_INFO = 42, 1167 WLAN_EID_ERP_INFO = 42,
1115 WLAN_EID_EXT_SUPP_RATES = 50, 1168 WLAN_EID_EXT_SUPP_RATES = 50,
1116 /* 802.11n */ 1169
1117 WLAN_EID_HT_CAPABILITY = 45, 1170 WLAN_EID_HT_CAPABILITY = 45,
1118 WLAN_EID_HT_INFORMATION = 61, 1171 WLAN_EID_HT_INFORMATION = 61,
1119 /* 802.11i */ 1172
1120 WLAN_EID_RSN = 48, 1173 WLAN_EID_RSN = 48,
1121 WLAN_EID_TIMEOUT_INTERVAL = 56, 1174 WLAN_EID_MMIE = 76,
1122 WLAN_EID_MMIE = 76 /* 802.11w */,
1123 WLAN_EID_WPA = 221, 1175 WLAN_EID_WPA = 221,
1124 WLAN_EID_GENERIC = 221, 1176 WLAN_EID_GENERIC = 221,
1125 WLAN_EID_VENDOR_SPECIFIC = 221, 1177 WLAN_EID_VENDOR_SPECIFIC = 221,
1126 WLAN_EID_QOS_PARAMETER = 222 1178 WLAN_EID_QOS_PARAMETER = 222,
1179
1180 WLAN_EID_AP_CHAN_REPORT = 51,
1181 WLAN_EID_NEIGHBOR_REPORT = 52,
1182 WLAN_EID_RCPI = 53,
1183 WLAN_EID_BSS_AVG_ACCESS_DELAY = 63,
1184 WLAN_EID_ANTENNA_INFO = 64,
1185 WLAN_EID_RSNI = 65,
1186 WLAN_EID_MEASUREMENT_PILOT_TX_INFO = 66,
1187 WLAN_EID_BSS_AVAILABLE_CAPACITY = 67,
1188 WLAN_EID_BSS_AC_ACCESS_DELAY = 68,
1189 WLAN_EID_RRM_ENABLED_CAPABILITIES = 70,
1190 WLAN_EID_MULTIPLE_BSSID = 71,
1191
1192 WLAN_EID_MOBILITY_DOMAIN = 54,
1193 WLAN_EID_FAST_BSS_TRANSITION = 55,
1194 WLAN_EID_TIMEOUT_INTERVAL = 56,
1195 WLAN_EID_RIC_DATA = 57,
1196 WLAN_EID_RIC_DESCRIPTOR = 75,
1197
1198 WLAN_EID_DSE_REGISTERED_LOCATION = 58,
1199 WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59,
1200 WLAN_EID_EXT_CHANSWITCH_ANN = 60,
1127}; 1201};
1128 1202
1129/* Action category code */ 1203/* Action category code */
@@ -1150,6 +1224,18 @@ enum ieee80211_spectrum_mgmt_actioncode {
1150 WLAN_ACTION_SPCT_CHL_SWITCH = 4, 1224 WLAN_ACTION_SPCT_CHL_SWITCH = 4,
1151}; 1225};
1152 1226
1227/* HT action codes */
1228enum ieee80211_ht_actioncode {
1229 WLAN_HT_ACTION_NOTIFY_CHANWIDTH = 0,
1230 WLAN_HT_ACTION_SMPS = 1,
1231 WLAN_HT_ACTION_PSMP = 2,
1232 WLAN_HT_ACTION_PCO_PHASE = 3,
1233 WLAN_HT_ACTION_CSI = 4,
1234 WLAN_HT_ACTION_NONCOMPRESSED_BF = 5,
1235 WLAN_HT_ACTION_COMPRESSED_BF = 6,
1236 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7,
1237};
1238
1153/* Security key length */ 1239/* Security key length */
1154enum ieee80211_key_len { 1240enum ieee80211_key_len {
1155 WLAN_KEY_LEN_WEP40 = 5, 1241 WLAN_KEY_LEN_WEP40 = 5,
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 6674791622ca..c9bf92cd7653 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -78,6 +78,11 @@ enum {
78#define IFLA_LINKINFO IFLA_LINKINFO 78#define IFLA_LINKINFO IFLA_LINKINFO
79 IFLA_NET_NS_PID, 79 IFLA_NET_NS_PID,
80 IFLA_IFALIAS, 80 IFLA_IFALIAS,
81 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
82 IFLA_VF_MAC, /* Hardware queue specific attributes */
83 IFLA_VF_VLAN,
84 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
85 IFLA_VFINFO,
81 __IFLA_MAX 86 __IFLA_MAX
82}; 87};
83 88
@@ -196,4 +201,29 @@ enum macvlan_mode {
196 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ 201 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
197}; 202};
198 203
204/* SR-IOV virtual function managment section */
205
206struct ifla_vf_mac {
207 __u32 vf;
208 __u8 mac[32]; /* MAX_ADDR_LEN */
209};
210
211struct ifla_vf_vlan {
212 __u32 vf;
213 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
214 __u32 qos;
215};
216
217struct ifla_vf_tx_rate {
218 __u32 vf;
219 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
220};
221
222struct ifla_vf_info {
223 __u32 vf;
224 __u8 mac[32];
225 __u32 vlan;
226 __u32 qos;
227 __u32 tx_rate;
228};
199#endif /* _LINUX_IF_LINK_H */ 229#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 5f200bac3749..b78a712247da 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -1,6 +1,90 @@
1#ifndef _LINUX_IF_MACVLAN_H 1#ifndef _LINUX_IF_MACVLAN_H
2#define _LINUX_IF_MACVLAN_H 2#define _LINUX_IF_MACVLAN_H
3 3
4#include <linux/if_link.h>
5#include <linux/list.h>
6#include <linux/netdevice.h>
7#include <linux/netlink.h>
8#include <net/netlink.h>
9
10#if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE)
11struct socket *macvtap_get_socket(struct file *);
12#else
13#include <linux/err.h>
14#include <linux/errno.h>
15struct file;
16struct socket;
17static inline struct socket *macvtap_get_socket(struct file *f)
18{
19 return ERR_PTR(-EINVAL);
20}
21#endif /* CONFIG_MACVTAP */
22
23struct macvlan_port;
24struct macvtap_queue;
25
26/**
27 * struct macvlan_rx_stats - MACVLAN percpu rx stats
28 * @rx_packets: number of received packets
29 * @rx_bytes: number of received bytes
30 * @multicast: number of received multicast packets
31 * @rx_errors: number of errors
32 */
33struct macvlan_rx_stats {
34 unsigned long rx_packets;
35 unsigned long rx_bytes;
36 unsigned long multicast;
37 unsigned long rx_errors;
38};
39
40struct macvlan_dev {
41 struct net_device *dev;
42 struct list_head list;
43 struct hlist_node hlist;
44 struct macvlan_port *port;
45 struct net_device *lowerdev;
46 struct macvlan_rx_stats __percpu *rx_stats;
47 enum macvlan_mode mode;
48 int (*receive)(struct sk_buff *skb);
49 int (*forward)(struct net_device *dev, struct sk_buff *skb);
50 struct macvtap_queue *tap;
51};
52
53static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
54 unsigned int len, bool success,
55 bool multicast)
56{
57 struct macvlan_rx_stats *rx_stats;
58
59 rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id());
60 if (likely(success)) {
61 rx_stats->rx_packets++;;
62 rx_stats->rx_bytes += len;
63 if (multicast)
64 rx_stats->multicast++;
65 } else {
66 rx_stats->rx_errors++;
67 }
68}
69
70extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
71 struct nlattr *tb[], struct nlattr *data[],
72 int (*receive)(struct sk_buff *skb),
73 int (*forward)(struct net_device *dev,
74 struct sk_buff *skb));
75
76extern void macvlan_count_rx(const struct macvlan_dev *vlan,
77 unsigned int len, bool success,
78 bool multicast);
79
80extern void macvlan_dellink(struct net_device *dev, struct list_head *head);
81
82extern int macvlan_link_register(struct rtnl_link_ops *ops);
83
84extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
85 struct net_device *dev);
86
87
4extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); 88extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *);
5 89
6#endif /* _LINUX_IF_MACVLAN_H */ 90#endif /* _LINUX_IF_MACVLAN_H */
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 4021d47cc437..aa57a5f993fc 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -46,6 +46,7 @@ struct sockaddr_ll {
46#define PACKET_RESERVE 12 46#define PACKET_RESERVE 12
47#define PACKET_TX_RING 13 47#define PACKET_TX_RING 13
48#define PACKET_LOSS 14 48#define PACKET_LOSS 14
49#define PACKET_VNET_HDR 15
49 50
50struct tpacket_stats { 51struct tpacket_stats {
51 unsigned int tp_packets; 52 unsigned int tp_packets;
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 3f5fd523b49d..1350a246893a 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -18,6 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/if_ether.h> 20#include <linux/if_ether.h>
21#include <linux/filter.h>
21 22
22/* Read queue size */ 23/* Read queue size */
23#define TUN_READQ_SIZE 500 24#define TUN_READQ_SIZE 500
@@ -48,6 +49,8 @@
48#define TUNGETIFF _IOR('T', 210, unsigned int) 49#define TUNGETIFF _IOR('T', 210, unsigned int)
49#define TUNGETSNDBUF _IOR('T', 211, int) 50#define TUNGETSNDBUF _IOR('T', 211, int)
50#define TUNSETSNDBUF _IOW('T', 212, int) 51#define TUNSETSNDBUF _IOW('T', 212, int)
52#define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog)
53#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
51 54
52/* TUNSETIFF ifr flags */ 55/* TUNSETIFF ifr flags */
53#define IFF_TUN 0x0001 56#define IFF_TUN 0x0001
@@ -86,4 +89,18 @@ struct tun_filter {
86 __u8 addr[0][ETH_ALEN]; 89 __u8 addr[0][ETH_ALEN];
87}; 90};
88 91
92#ifdef __KERNEL__
93#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
94struct socket *tun_get_socket(struct file *);
95#else
96#include <linux/err.h>
97#include <linux/errno.h>
98struct file;
99struct socket;
100static inline struct socket *tun_get_socket(struct file *f)
101{
102 return ERR_PTR(-EINVAL);
103}
104#endif /* CONFIG_TUN */
105#endif /* __KERNEL__ */
89#endif /* __IF_TUN_H */ 106#endif /* __IF_TUN_H */
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 1822d635be6b..16b92d008bed 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -2,6 +2,7 @@
2#define _IF_TUNNEL_H_ 2#define _IF_TUNNEL_H_
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/byteorder.h>
5 6
6#ifdef __KERNEL__ 7#ifdef __KERNEL__
7#include <linux/ip.h> 8#include <linux/ip.h>
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 724c27e5d173..93fc2449af10 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -153,6 +153,7 @@ extern int sysctl_igmp_max_msf;
153struct ip_sf_socklist { 153struct ip_sf_socklist {
154 unsigned int sl_max; 154 unsigned int sl_max;
155 unsigned int sl_count; 155 unsigned int sl_count;
156 struct rcu_head rcu;
156 __be32 sl_addr[0]; 157 __be32 sl_addr[0];
157}; 158};
158 159
@@ -170,6 +171,7 @@ struct ip_mc_socklist {
170 struct ip_mreqn multi; 171 struct ip_mreqn multi;
171 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 172 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
172 struct ip_sf_socklist *sflist; 173 struct ip_sf_socklist *sflist;
174 struct rcu_head rcu;
173}; 175};
174 176
175struct ip_sf_list { 177struct ip_sf_list {
diff --git a/include/linux/ima.h b/include/linux/ima.h
index 0e3f2a4c25f6..975837e7d6c0 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -13,18 +13,14 @@
13#include <linux/fs.h> 13#include <linux/fs.h>
14struct linux_binprm; 14struct linux_binprm;
15 15
16#define IMA_COUNT_UPDATE 1
17#define IMA_COUNT_LEAVE 0
18
19#ifdef CONFIG_IMA 16#ifdef CONFIG_IMA
20extern int ima_bprm_check(struct linux_binprm *bprm); 17extern int ima_bprm_check(struct linux_binprm *bprm);
21extern int ima_inode_alloc(struct inode *inode); 18extern int ima_inode_alloc(struct inode *inode);
22extern void ima_inode_free(struct inode *inode); 19extern void ima_inode_free(struct inode *inode);
23extern int ima_path_check(struct path *path, int mask, int update_counts); 20extern int ima_file_check(struct file *file, int mask);
24extern void ima_file_free(struct file *file); 21extern void ima_file_free(struct file *file);
25extern int ima_file_mmap(struct file *file, unsigned long prot); 22extern int ima_file_mmap(struct file *file, unsigned long prot);
26extern void ima_counts_get(struct file *file); 23extern void ima_counts_get(struct file *file);
27extern void ima_counts_put(struct path *path, int mask);
28 24
29#else 25#else
30static inline int ima_bprm_check(struct linux_binprm *bprm) 26static inline int ima_bprm_check(struct linux_binprm *bprm)
@@ -42,7 +38,7 @@ static inline void ima_inode_free(struct inode *inode)
42 return; 38 return;
43} 39}
44 40
45static inline int ima_path_check(struct path *path, int mask, int update_counts) 41static inline int ima_file_check(struct file *file, int mask)
46{ 42{
47 return 0; 43 return 0;
48} 44}
@@ -62,9 +58,5 @@ static inline void ima_counts_get(struct file *file)
62 return; 58 return;
63} 59}
64 60
65static inline void ima_counts_put(struct path *path, int mask)
66{
67 return;
68}
69#endif /* CONFIG_IMA_H */ 61#endif /* CONFIG_IMA_H */
70#endif /* _LINUX_IMA_H */ 62#endif /* _LINUX_IMA_H */
diff --git a/include/linux/in.h b/include/linux/in.h
index b615649db129..583c76f9c30f 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -84,6 +84,8 @@ struct in_addr {
84#define IP_ORIGDSTADDR 20 84#define IP_ORIGDSTADDR 20
85#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR 85#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
86 86
87#define IP_MINTTL 21
88
87/* IP_MTU_DISCOVER values */ 89/* IP_MTU_DISCOVER values */
88#define IP_PMTUDISC_DONT 0 /* Never send DF frames */ 90#define IP_PMTUDISC_DONT 0 /* Never send DF frames */
89#define IP_PMTUDISC_WANT 1 /* Use per route hints */ 91#define IP_PMTUDISC_WANT 1 /* Use per route hints */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 699e85c01a4d..2be1a1a2beb9 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -10,10 +10,40 @@
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h> 11#include <linux/sysctl.h>
12 12
13enum
14{
15 IPV4_DEVCONF_FORWARDING=1,
16 IPV4_DEVCONF_MC_FORWARDING,
17 IPV4_DEVCONF_PROXY_ARP,
18 IPV4_DEVCONF_ACCEPT_REDIRECTS,
19 IPV4_DEVCONF_SECURE_REDIRECTS,
20 IPV4_DEVCONF_SEND_REDIRECTS,
21 IPV4_DEVCONF_SHARED_MEDIA,
22 IPV4_DEVCONF_RP_FILTER,
23 IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
24 IPV4_DEVCONF_BOOTP_RELAY,
25 IPV4_DEVCONF_LOG_MARTIANS,
26 IPV4_DEVCONF_TAG,
27 IPV4_DEVCONF_ARPFILTER,
28 IPV4_DEVCONF_MEDIUM_ID,
29 IPV4_DEVCONF_NOXFRM,
30 IPV4_DEVCONF_NOPOLICY,
31 IPV4_DEVCONF_FORCE_IGMP_VERSION,
32 IPV4_DEVCONF_ARP_ANNOUNCE,
33 IPV4_DEVCONF_ARP_IGNORE,
34 IPV4_DEVCONF_PROMOTE_SECONDARIES,
35 IPV4_DEVCONF_ARP_ACCEPT,
36 IPV4_DEVCONF_ARP_NOTIFY,
37 IPV4_DEVCONF_ACCEPT_LOCAL,
38 IPV4_DEVCONF_SRC_VMARK,
39 IPV4_DEVCONF_PROXY_ARP_PVLAN,
40 __IPV4_DEVCONF_MAX
41};
42
13struct ipv4_devconf { 43struct ipv4_devconf {
14 void *sysctl; 44 void *sysctl;
15 int data[__NET_IPV4_CONF_MAX - 1]; 45 int data[__IPV4_DEVCONF_MAX - 1];
16 DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); 46 DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1);
17}; 47};
18 48
19struct in_device { 49struct in_device {
@@ -40,7 +70,7 @@ struct in_device {
40 struct rcu_head rcu_head; 70 struct rcu_head rcu_head;
41}; 71};
42 72
43#define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) 73#define IPV4_DEVCONF(cnf, attr) ((cnf).data[IPV4_DEVCONF_ ## attr - 1])
44#define IPV4_DEVCONF_ALL(net, attr) \ 74#define IPV4_DEVCONF_ALL(net, attr) \
45 IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) 75 IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr)
46 76
@@ -60,13 +90,13 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index,
60 90
61static inline void ipv4_devconf_setall(struct in_device *in_dev) 91static inline void ipv4_devconf_setall(struct in_device *in_dev)
62{ 92{
63 bitmap_fill(in_dev->cnf.state, __NET_IPV4_CONF_MAX - 1); 93 bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1);
64} 94}
65 95
66#define IN_DEV_CONF_GET(in_dev, attr) \ 96#define IN_DEV_CONF_GET(in_dev, attr) \
67 ipv4_devconf_get((in_dev), NET_IPV4_CONF_ ## attr) 97 ipv4_devconf_get((in_dev), IPV4_DEVCONF_ ## attr)
68#define IN_DEV_CONF_SET(in_dev, attr, val) \ 98#define IN_DEV_CONF_SET(in_dev, attr, val) \
69 ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) 99 ipv4_devconf_set((in_dev), IPV4_DEVCONF_ ## attr, (val))
70 100
71#define IN_DEV_ANDCONF(in_dev, attr) \ 101#define IN_DEV_ANDCONF(in_dev, attr) \
72 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ 102 (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \
@@ -81,6 +111,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
81#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) 111#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING)
82#define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) 112#define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING)
83#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) 113#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER)
114#define IN_DEV_SRC_VMARK(in_dev) IN_DEV_ORCONF((in_dev), SRC_VMARK)
84#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ 115#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \
85 ACCEPT_SOURCE_ROUTE) 116 ACCEPT_SOURCE_ROUTE)
86#define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL) 117#define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL)
@@ -88,6 +119,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev)
88 119
89#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) 120#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)
90#define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) 121#define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP)
122#define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN)
91#define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA) 123#define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA)
92#define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS) 124#define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS)
93#define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \ 125#define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \
diff --git a/include/linux/init.h b/include/linux/init.h
index ff8bde520d03..ab1d31f9352b 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -149,6 +149,8 @@ void prepare_namespace(void);
149 149
150extern void (*late_time_init)(void); 150extern void (*late_time_init)(void);
151 151
152extern int initcall_debug;
153
152#endif 154#endif
153 155
154#ifndef MODULE 156#ifndef MODULE
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 5ed8b9c50355..b1ed1cd8e2a8 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -32,14 +32,6 @@ extern struct fs_struct init_fs;
32} 32}
33 33
34extern struct nsproxy init_nsproxy; 34extern struct nsproxy init_nsproxy;
35#define INIT_NSPROXY(nsproxy) { \
36 .pid_ns = &init_pid_ns, \
37 .count = ATOMIC_INIT(1), \
38 .uts_ns = &init_uts_ns, \
39 .mnt_ns = NULL, \
40 INIT_NET_NS(net_ns) \
41 INIT_IPC_NS(ipc_ns) \
42}
43 35
44#define INIT_SIGHAND(sighand) { \ 36#define INIT_SIGHAND(sighand) { \
45 .count = ATOMIC_INIT(1), \ 37 .count = ATOMIC_INIT(1), \
@@ -111,12 +103,6 @@ extern struct cred init_cred;
111# define INIT_PERF_EVENTS(tsk) 103# define INIT_PERF_EVENTS(tsk)
112#endif 104#endif
113 105
114#ifdef CONFIG_FS_JOURNAL_INFO
115#define INIT_JOURNAL_INFO .journal_info = NULL,
116#else
117#define INIT_JOURNAL_INFO
118#endif
119
120/* 106/*
121 * INIT_TASK is used to set up the first task table, touch at 107 * INIT_TASK is used to set up the first task table, touch at
122 * your own risk!. Base=0, limit=0x1fffff (=2MB) 108 * your own risk!. Base=0, limit=0x1fffff (=2MB)
@@ -168,6 +154,7 @@ extern struct cred init_cred;
168 .signal = {{0}}}, \ 154 .signal = {{0}}}, \
169 .blocked = {{0}}, \ 155 .blocked = {{0}}, \
170 .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ 156 .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \
157 .journal_info = NULL, \
171 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ 158 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
172 .fs_excl = ATOMIC_INIT(0), \ 159 .fs_excl = ATOMIC_INIT(0), \
173 .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ 160 .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
@@ -178,7 +165,6 @@ extern struct cred init_cred;
178 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ 165 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
179 }, \ 166 }, \
180 .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ 167 .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
181 INIT_JOURNAL_INFO \
182 INIT_IDS \ 168 INIT_IDS \
183 INIT_PERF_EVENTS(tsk) \ 169 INIT_PERF_EVENTS(tsk) \
184 INIT_TRACE_IRQFLAGS \ 170 INIT_TRACE_IRQFLAGS \
diff --git a/include/linux/input.h b/include/linux/input.h
index 7be8a6537b57..7ed2251b33f1 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -58,10 +58,10 @@ struct input_absinfo {
58 58
59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ 59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ 60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
61#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */ 61#define EVIOCGREP _IOR('E', 0x03, unsigned int[2]) /* get repeat settings */
62#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */ 62#define EVIOCSREP _IOW('E', 0x03, unsigned int[2]) /* set repeat settings */
63#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ 63#define EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2]) /* get keycode */
64#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ 64#define EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2]) /* set keycode */
65 65
66#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */ 66#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len) /* get device name */
67#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */ 67#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len) /* get physical location */
@@ -376,8 +376,9 @@ struct input_absinfo {
376#define KEY_DISPLAY_OFF 245 /* display device to off state */ 376#define KEY_DISPLAY_OFF 245 /* display device to off state */
377 377
378#define KEY_WIMAX 246 378#define KEY_WIMAX 246
379#define KEY_RFKILL 247 /* Key that controls all radios */
379 380
380/* Range 248 - 255 is reserved for special needs of AT keyboard driver */ 381/* Code 255 is reserved for special needs of AT keyboard driver */
381 382
382#define BTN_MISC 0x100 383#define BTN_MISC 0x100
383#define BTN_0 0x100 384#define BTN_0 0x100
@@ -596,6 +597,49 @@ struct input_absinfo {
596#define KEY_NUMERIC_POUND 0x20b 597#define KEY_NUMERIC_POUND 0x20b
597 598
598#define KEY_CAMERA_FOCUS 0x210 599#define KEY_CAMERA_FOCUS 0x210
600#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */
601
602#define BTN_TRIGGER_HAPPY 0x2c0
603#define BTN_TRIGGER_HAPPY1 0x2c0
604#define BTN_TRIGGER_HAPPY2 0x2c1
605#define BTN_TRIGGER_HAPPY3 0x2c2
606#define BTN_TRIGGER_HAPPY4 0x2c3
607#define BTN_TRIGGER_HAPPY5 0x2c4
608#define BTN_TRIGGER_HAPPY6 0x2c5
609#define BTN_TRIGGER_HAPPY7 0x2c6
610#define BTN_TRIGGER_HAPPY8 0x2c7
611#define BTN_TRIGGER_HAPPY9 0x2c8
612#define BTN_TRIGGER_HAPPY10 0x2c9
613#define BTN_TRIGGER_HAPPY11 0x2ca
614#define BTN_TRIGGER_HAPPY12 0x2cb
615#define BTN_TRIGGER_HAPPY13 0x2cc
616#define BTN_TRIGGER_HAPPY14 0x2cd
617#define BTN_TRIGGER_HAPPY15 0x2ce
618#define BTN_TRIGGER_HAPPY16 0x2cf
619#define BTN_TRIGGER_HAPPY17 0x2d0
620#define BTN_TRIGGER_HAPPY18 0x2d1
621#define BTN_TRIGGER_HAPPY19 0x2d2
622#define BTN_TRIGGER_HAPPY20 0x2d3
623#define BTN_TRIGGER_HAPPY21 0x2d4
624#define BTN_TRIGGER_HAPPY22 0x2d5
625#define BTN_TRIGGER_HAPPY23 0x2d6
626#define BTN_TRIGGER_HAPPY24 0x2d7
627#define BTN_TRIGGER_HAPPY25 0x2d8
628#define BTN_TRIGGER_HAPPY26 0x2d9
629#define BTN_TRIGGER_HAPPY27 0x2da
630#define BTN_TRIGGER_HAPPY28 0x2db
631#define BTN_TRIGGER_HAPPY29 0x2dc
632#define BTN_TRIGGER_HAPPY30 0x2dd
633#define BTN_TRIGGER_HAPPY31 0x2de
634#define BTN_TRIGGER_HAPPY32 0x2df
635#define BTN_TRIGGER_HAPPY33 0x2e0
636#define BTN_TRIGGER_HAPPY34 0x2e1
637#define BTN_TRIGGER_HAPPY35 0x2e2
638#define BTN_TRIGGER_HAPPY36 0x2e3
639#define BTN_TRIGGER_HAPPY37 0x2e4
640#define BTN_TRIGGER_HAPPY38 0x2e5
641#define BTN_TRIGGER_HAPPY39 0x2e6
642#define BTN_TRIGGER_HAPPY40 0x2e7
599 643
600/* We avoid low common keys in module aliases so they don't get huge. */ 644/* We avoid low common keys in module aliases so they don't get huge. */
601#define KEY_MIN_INTERESTING KEY_MUTE 645#define KEY_MIN_INTERESTING KEY_MUTE
@@ -660,6 +704,7 @@ struct input_absinfo {
660#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ 704#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */
661#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ 705#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */
662#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ 706#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */
707#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */
663 708
664#define ABS_MAX 0x3f 709#define ABS_MAX 0x3f
665#define ABS_CNT (ABS_MAX+1) 710#define ABS_CNT (ABS_MAX+1)
@@ -1097,8 +1142,10 @@ struct input_dev {
1097 unsigned int keycodemax; 1142 unsigned int keycodemax;
1098 unsigned int keycodesize; 1143 unsigned int keycodesize;
1099 void *keycode; 1144 void *keycode;
1100 int (*setkeycode)(struct input_dev *dev, int scancode, int keycode); 1145 int (*setkeycode)(struct input_dev *dev,
1101 int (*getkeycode)(struct input_dev *dev, int scancode, int *keycode); 1146 unsigned int scancode, unsigned int keycode);
1147 int (*getkeycode)(struct input_dev *dev,
1148 unsigned int scancode, unsigned int *keycode);
1102 1149
1103 struct ff_device *ff; 1150 struct ff_device *ff;
1104 1151
@@ -1198,6 +1245,10 @@ struct input_handle;
1198 * @event: event handler. This method is being called by input core with 1245 * @event: event handler. This method is being called by input core with
1199 * interrupts disabled and dev->event_lock spinlock held and so 1246 * interrupts disabled and dev->event_lock spinlock held and so
1200 * it may not sleep 1247 * it may not sleep
1248 * @filter: similar to @event; separates normal event handlers from
1249 * "filters".
1250 * @match: called after comparing device's id with handler's id_table
1251 * to perform fine-grained matching between device and handler
1201 * @connect: called when attaching a handler to an input device 1252 * @connect: called when attaching a handler to an input device
1202 * @disconnect: disconnects a handler from input device 1253 * @disconnect: disconnects a handler from input device
1203 * @start: starts handler for given handle. This function is called by 1254 * @start: starts handler for given handle. This function is called by
@@ -1209,8 +1260,6 @@ struct input_handle;
1209 * @name: name of the handler, to be shown in /proc/bus/input/handlers 1260 * @name: name of the handler, to be shown in /proc/bus/input/handlers
1210 * @id_table: pointer to a table of input_device_ids this driver can 1261 * @id_table: pointer to a table of input_device_ids this driver can
1211 * handle 1262 * handle
1212 * @blacklist: pointer to a table of input_device_ids this driver should
1213 * ignore even if they match @id_table
1214 * @h_list: list of input handles associated with the handler 1263 * @h_list: list of input handles associated with the handler
1215 * @node: for placing the driver onto input_handler_list 1264 * @node: for placing the driver onto input_handler_list
1216 * 1265 *
@@ -1219,6 +1268,11 @@ struct input_handle;
1219 * same time. All of them will get their copy of input event generated by 1268 * same time. All of them will get their copy of input event generated by
1220 * the device. 1269 * the device.
1221 * 1270 *
1271 * The very same structure is used to implement input filters. Input core
1272 * allows filters to run first and will not pass event to regular handlers
1273 * if any of the filters indicate that the event should be filtered (by
1274 * returning %true from their filter() method).
1275 *
1222 * Note that input core serializes calls to connect() and disconnect() 1276 * Note that input core serializes calls to connect() and disconnect()
1223 * methods. 1277 * methods.
1224 */ 1278 */
@@ -1227,6 +1281,8 @@ struct input_handler {
1227 void *private; 1281 void *private;
1228 1282
1229 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); 1283 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
1284 bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
1285 bool (*match)(struct input_handler *handler, struct input_dev *dev);
1230 int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); 1286 int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
1231 void (*disconnect)(struct input_handle *handle); 1287 void (*disconnect)(struct input_handle *handle);
1232 void (*start)(struct input_handle *handle); 1288 void (*start)(struct input_handle *handle);
@@ -1236,7 +1292,6 @@ struct input_handler {
1236 const char *name; 1292 const char *name;
1237 1293
1238 const struct input_device_id *id_table; 1294 const struct input_device_id *id_table;
1239 const struct input_device_id *blacklist;
1240 1295
1241 struct list_head h_list; 1296 struct list_head h_list;
1242 struct list_head node; 1297 struct list_head node;
@@ -1362,8 +1417,10 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
1362 dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); 1417 dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
1363} 1418}
1364 1419
1365int input_get_keycode(struct input_dev *dev, int scancode, int *keycode); 1420int input_get_keycode(struct input_dev *dev,
1366int input_set_keycode(struct input_dev *dev, int scancode, int keycode); 1421 unsigned int scancode, unsigned int *keycode);
1422int input_set_keycode(struct input_dev *dev,
1423 unsigned int scancode, unsigned int keycode);
1367 1424
1368extern struct class input_class; 1425extern struct class input_class;
1369 1426
diff --git a/include/linux/input/sh_keysc.h b/include/linux/input/sh_keysc.h
index c211b5cf08e6..649dc7f12925 100644
--- a/include/linux/input/sh_keysc.h
+++ b/include/linux/input/sh_keysc.h
@@ -1,14 +1,15 @@
1#ifndef __SH_KEYSC_H__ 1#ifndef __SH_KEYSC_H__
2#define __SH_KEYSC_H__ 2#define __SH_KEYSC_H__
3 3
4#define SH_KEYSC_MAXKEYS 30 4#define SH_KEYSC_MAXKEYS 49
5 5
6struct sh_keysc_info { 6struct sh_keysc_info {
7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode; 7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3,
8 SH_KEYSC_MODE_4, SH_KEYSC_MODE_5, SH_KEYSC_MODE_6 } mode;
8 int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */ 9 int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */
9 int delay; 10 int delay;
10 int kycr2_delay; 11 int kycr2_delay;
11 int keycodes[SH_KEYSC_MAXKEYS]; 12 int keycodes[SH_KEYSC_MAXKEYS]; /* KEYIN * KEYOUT */
12}; 13};
13 14
14#endif /* __SH_KEYSC_H__ */ 15#endif /* __SH_KEYSC_H__ */
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index a63235996309..a0bb301afac0 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -4,32 +4,6 @@
4#include <linux/radix-tree.h> 4#include <linux/radix-tree.h>
5#include <linux/rcupdate.h> 5#include <linux/rcupdate.h>
6 6
7/*
8 * This is the per-process anticipatory I/O scheduler state.
9 */
10struct as_io_context {
11 spinlock_t lock;
12
13 void (*dtor)(struct as_io_context *aic); /* destructor */
14 void (*exit)(struct as_io_context *aic); /* called on task exit */
15
16 unsigned long state;
17 atomic_t nr_queued; /* queued reads & sync writes */
18 atomic_t nr_dispatched; /* number of requests gone to the drivers */
19
20 /* IO History tracking */
21 /* Thinktime */
22 unsigned long last_end_request;
23 unsigned long ttime_total;
24 unsigned long ttime_samples;
25 unsigned long ttime_mean;
26 /* Layout pattern */
27 unsigned int seek_samples;
28 sector_t last_request_pos;
29 u64 seek_total;
30 sector_t seek_mean;
31};
32
33struct cfq_queue; 7struct cfq_queue;
34struct cfq_io_context { 8struct cfq_io_context {
35 void *key; 9 void *key;
@@ -68,17 +42,16 @@ struct io_context {
68 unsigned short ioprio; 42 unsigned short ioprio;
69 unsigned short ioprio_changed; 43 unsigned short ioprio_changed;
70 44
71#ifdef CONFIG_BLK_CGROUP 45#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)
72 unsigned short cgroup_changed; 46 unsigned short cgroup_changed;
73#endif 47#endif
74 48
75 /* 49 /*
76 * For request batching 50 * For request batching
77 */ 51 */
78 unsigned long last_waited; /* Time last woken after wait for request */
79 int nr_batch_requests; /* Number of requests left in the batch */ 52 int nr_batch_requests; /* Number of requests left in the batch */
53 unsigned long last_waited; /* Time last woken after wait for request */
80 54
81 struct as_io_context *aic;
82 struct radix_tree_root radix_root; 55 struct radix_tree_root radix_root;
83 struct hlist_head cic_list; 56 struct hlist_head cic_list;
84 void *ioc_data; 57 void *ioc_data;
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 7129504e053d..26fad187d661 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -34,22 +34,24 @@ struct resource_list {
34 */ 34 */
35#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ 35#define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */
36 36
37#define IORESOURCE_TYPE_BITS 0x00000f00 /* Resource type */ 37#define IORESOURCE_TYPE_BITS 0x00001f00 /* Resource type */
38#define IORESOURCE_IO 0x00000100 38#define IORESOURCE_IO 0x00000100
39#define IORESOURCE_MEM 0x00000200 39#define IORESOURCE_MEM 0x00000200
40#define IORESOURCE_IRQ 0x00000400 40#define IORESOURCE_IRQ 0x00000400
41#define IORESOURCE_DMA 0x00000800 41#define IORESOURCE_DMA 0x00000800
42#define IORESOURCE_BUS 0x00001000
42 43
43#define IORESOURCE_PREFETCH 0x00001000 /* No side effects */ 44#define IORESOURCE_PREFETCH 0x00002000 /* No side effects */
44#define IORESOURCE_READONLY 0x00002000 45#define IORESOURCE_READONLY 0x00004000
45#define IORESOURCE_CACHEABLE 0x00004000 46#define IORESOURCE_CACHEABLE 0x00008000
46#define IORESOURCE_RANGELENGTH 0x00008000 47#define IORESOURCE_RANGELENGTH 0x00010000
47#define IORESOURCE_SHADOWABLE 0x00010000 48#define IORESOURCE_SHADOWABLE 0x00020000
48 49
49#define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */ 50#define IORESOURCE_SIZEALIGN 0x00040000 /* size indicates alignment */
50#define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */ 51#define IORESOURCE_STARTALIGN 0x00080000 /* start field is alignment */
51 52
52#define IORESOURCE_MEM_64 0x00100000 53#define IORESOURCE_MEM_64 0x00100000
54#define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */
53 55
54#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ 56#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */
55#define IORESOURCE_DISABLED 0x10000000 57#define IORESOURCE_DISABLED 0x10000000
@@ -110,18 +112,23 @@ struct resource_list {
110extern struct resource ioport_resource; 112extern struct resource ioport_resource;
111extern struct resource iomem_resource; 113extern struct resource iomem_resource;
112 114
115extern struct resource *request_resource_conflict(struct resource *root, struct resource *new);
113extern int request_resource(struct resource *root, struct resource *new); 116extern int request_resource(struct resource *root, struct resource *new);
114extern int release_resource(struct resource *new); 117extern int release_resource(struct resource *new);
118void release_child_resources(struct resource *new);
115extern void reserve_region_with_split(struct resource *root, 119extern void reserve_region_with_split(struct resource *root,
116 resource_size_t start, resource_size_t end, 120 resource_size_t start, resource_size_t end,
117 const char *name); 121 const char *name);
122extern struct resource *insert_resource_conflict(struct resource *parent, struct resource *new);
118extern int insert_resource(struct resource *parent, struct resource *new); 123extern int insert_resource(struct resource *parent, struct resource *new);
119extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); 124extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new);
120extern int allocate_resource(struct resource *root, struct resource *new, 125extern int allocate_resource(struct resource *root, struct resource *new,
121 resource_size_t size, resource_size_t min, 126 resource_size_t size, resource_size_t min,
122 resource_size_t max, resource_size_t align, 127 resource_size_t max, resource_size_t align,
123 void (*alignf)(void *, struct resource *, 128 resource_size_t (*alignf)(void *,
124 resource_size_t, resource_size_t), 129 const struct resource *,
130 resource_size_t,
131 resource_size_t),
125 void *alignf_data); 132 void *alignf_data);
126int adjust_resource(struct resource *res, resource_size_t start, 133int adjust_resource(struct resource *res, resource_size_t start,
127 resource_size_t size); 134 resource_size_t size);
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index 07baa38bce37..51952989ad42 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -62,11 +62,6 @@ extern struct ipc_namespace init_ipc_ns;
62extern atomic_t nr_ipc_ns; 62extern atomic_t nr_ipc_ns;
63 63
64extern spinlock_t mq_lock; 64extern spinlock_t mq_lock;
65#if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC)
66#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
67#else
68#define INIT_IPC_NS(ns)
69#endif
70 65
71#ifdef CONFIG_SYSVIPC 66#ifdef CONFIG_SYSVIPC
72extern int register_ipcns_notifier(struct ipc_namespace *); 67extern int register_ipcns_notifier(struct ipc_namespace *);
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index f7c9c75a2775..4b48318ac542 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -39,7 +39,6 @@
39#include <linux/module.h> 39#include <linux/module.h>
40#include <linux/device.h> 40#include <linux/device.h>
41#include <linux/platform_device.h> 41#include <linux/platform_device.h>
42#include <linux/ipmi_smi.h>
43 42
44/* This files describes the interface for IPMI system management interface 43/* This files describes the interface for IPMI system management interface
45 drivers to bind into the IPMI message handler. */ 44 drivers to bind into the IPMI message handler. */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 451481c082b5..707ab122e2e6 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -90,7 +90,7 @@ struct msi_desc;
90 * @startup: start up the interrupt (defaults to ->enable if NULL) 90 * @startup: start up the interrupt (defaults to ->enable if NULL)
91 * @shutdown: shut down the interrupt (defaults to ->disable if NULL) 91 * @shutdown: shut down the interrupt (defaults to ->disable if NULL)
92 * @enable: enable the interrupt (defaults to chip->unmask if NULL) 92 * @enable: enable the interrupt (defaults to chip->unmask if NULL)
93 * @disable: disable the interrupt (defaults to chip->mask if NULL) 93 * @disable: disable the interrupt
94 * @ack: start of a new interrupt 94 * @ack: start of a new interrupt
95 * @mask: mask an interrupt source 95 * @mask: mask an interrupt source
96 * @mask_ack: ack and mask an interrupt source 96 * @mask_ack: ack and mask an interrupt source
@@ -400,7 +400,9 @@ static inline int irq_has_action(unsigned int irq)
400 400
401/* Dynamic irq helper functions */ 401/* Dynamic irq helper functions */
402extern void dynamic_irq_init(unsigned int irq); 402extern void dynamic_irq_init(unsigned int irq);
403void dynamic_irq_init_keep_chip_data(unsigned int irq);
403extern void dynamic_irq_cleanup(unsigned int irq); 404extern void dynamic_irq_cleanup(unsigned int irq);
405void dynamic_irq_cleanup_keep_chip_data(unsigned int irq);
404 406
405/* Set/get chip/data for an IRQ: */ 407/* Set/get chip/data for an IRQ: */
406extern int set_irq_chip(unsigned int irq, struct irq_chip *chip); 408extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
diff --git a/include/linux/isdn/capilli.h b/include/linux/isdn/capilli.h
index 7acb87a44872..11b57c485854 100644
--- a/include/linux/isdn/capilli.h
+++ b/include/linux/isdn/capilli.h
@@ -50,8 +50,7 @@ struct capi_ctr {
50 u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); 50 u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb);
51 51
52 char *(*procinfo)(struct capi_ctr *); 52 char *(*procinfo)(struct capi_ctr *);
53 int (*ctr_read_proc)(char *page, char **start, off_t off, 53 const struct file_operations *proc_fops;
54 int count, int *eof, struct capi_ctr *card);
55 54
56 /* filled in before calling ready callback */ 55 /* filled in before calling ready callback */
57 u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */ 56 u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */
@@ -67,9 +66,10 @@ struct capi_ctr {
67 unsigned long nsentdatapkt; 66 unsigned long nsentdatapkt;
68 67
69 int cnr; /* controller number */ 68 int cnr; /* controller number */
70 volatile unsigned short cardstate; /* controller state */ 69 unsigned short state; /* controller state */
71 volatile int blocked; /* output blocked */ 70 int blocked; /* output blocked */
72 int traceflag; /* capi trace */ 71 int traceflag; /* capi trace */
72 wait_queue_head_t state_wait_queue;
73 73
74 struct proc_dir_entry *procent; 74 struct proc_dir_entry *procent;
75 char procfn[128]; 75 char procfn[128];
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 331530cd3cc6..f3aa59cb675d 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -246,19 +246,8 @@ typedef struct journal_superblock_s
246 246
247#define J_ASSERT(assert) BUG_ON(!(assert)) 247#define J_ASSERT(assert) BUG_ON(!(assert))
248 248
249#if defined(CONFIG_BUFFER_DEBUG)
250void buffer_assertion_failure(struct buffer_head *bh);
251#define J_ASSERT_BH(bh, expr) \
252 do { \
253 if (!(expr)) \
254 buffer_assertion_failure(bh); \
255 J_ASSERT(expr); \
256 } while (0)
257#define J_ASSERT_JH(jh, expr) J_ASSERT_BH(jh2bh(jh), expr)
258#else
259#define J_ASSERT_BH(bh, expr) J_ASSERT(expr) 249#define J_ASSERT_BH(bh, expr) J_ASSERT(expr)
260#define J_ASSERT_JH(jh, expr) J_ASSERT(expr) 250#define J_ASSERT_JH(jh, expr) J_ASSERT(expr)
261#endif
262 251
263#if defined(JBD_PARANOID_IOFAIL) 252#if defined(JBD_PARANOID_IOFAIL)
264#define J_EXPECT(expr, why...) J_ASSERT(expr) 253#define J_EXPECT(expr, why...) J_ASSERT(expr)
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index f1011f7f3d41..1ec876358180 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -69,15 +69,8 @@ extern u8 jbd2_journal_enable_debug;
69#define jbd_debug(f, a...) /**/ 69#define jbd_debug(f, a...) /**/
70#endif 70#endif
71 71
72static inline void *jbd2_alloc(size_t size, gfp_t flags) 72extern void *jbd2_alloc(size_t size, gfp_t flags);
73{ 73extern void jbd2_free(void *ptr, size_t size);
74 return (void *)__get_free_pages(flags, get_order(size));
75}
76
77static inline void jbd2_free(void *ptr, size_t size)
78{
79 free_pages((unsigned long)ptr, get_order(size));
80};
81 74
82#define JBD2_MIN_JOURNAL_BLOCKS 1024 75#define JBD2_MIN_JOURNAL_BLOCKS 1024
83 76
@@ -284,19 +277,8 @@ typedef struct journal_superblock_s
284 277
285#define J_ASSERT(assert) BUG_ON(!(assert)) 278#define J_ASSERT(assert) BUG_ON(!(assert))
286 279
287#if defined(CONFIG_BUFFER_DEBUG)
288void buffer_assertion_failure(struct buffer_head *bh);
289#define J_ASSERT_BH(bh, expr) \
290 do { \
291 if (!(expr)) \
292 buffer_assertion_failure(bh); \
293 J_ASSERT(expr); \
294 } while (0)
295#define J_ASSERT_JH(jh, expr) J_ASSERT_BH(jh2bh(jh), expr)
296#else
297#define J_ASSERT_BH(bh, expr) J_ASSERT(expr) 280#define J_ASSERT_BH(bh, expr) J_ASSERT(expr)
298#define J_ASSERT_JH(jh, expr) J_ASSERT(expr) 281#define J_ASSERT_JH(jh, expr) J_ASSERT(expr)
299#endif
300 282
301#if defined(JBD2_PARANOID_IOFAIL) 283#if defined(JBD2_PARANOID_IOFAIL)
302#define J_EXPECT(expr, why...) J_ASSERT(expr) 284#define J_EXPECT(expr, why...) J_ASSERT(expr)
@@ -653,6 +635,7 @@ struct transaction_s
653 * waiting for it to finish. 635 * waiting for it to finish.
654 */ 636 */
655 unsigned int t_synchronous_commit:1; 637 unsigned int t_synchronous_commit:1;
638 unsigned int t_flushed_data_blocks:1;
656 639
657 /* 640 /*
658 * For use by the filesystem to store fs-specific data 641 * For use by the filesystem to store fs-specific data
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index 8bdb16bfe5fb..506ad20c18f8 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -161,7 +161,4 @@ static inline void con_schedule_flip(struct tty_struct *t)
161 schedule_delayed_work(&t->buf.work, 0); 161 schedule_delayed_work(&t->buf.work, 0);
162} 162}
163 163
164/* mac_hid.c */
165extern int mac_hid_mouse_emulate_buttons(int, unsigned int, int);
166
167#endif 164#endif
diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h
new file mode 100644
index 000000000000..bd92a89f4b0a
--- /dev/null
+++ b/include/linux/kernel-page-flags.h
@@ -0,0 +1,46 @@
1#ifndef LINUX_KERNEL_PAGE_FLAGS_H
2#define LINUX_KERNEL_PAGE_FLAGS_H
3
4/*
5 * Stable page flag bits exported to user space
6 */
7
8#define KPF_LOCKED 0
9#define KPF_ERROR 1
10#define KPF_REFERENCED 2
11#define KPF_UPTODATE 3
12#define KPF_DIRTY 4
13#define KPF_LRU 5
14#define KPF_ACTIVE 6
15#define KPF_SLAB 7
16#define KPF_WRITEBACK 8
17#define KPF_RECLAIM 9
18#define KPF_BUDDY 10
19
20/* 11-20: new additions in 2.6.31 */
21#define KPF_MMAP 11
22#define KPF_ANON 12
23#define KPF_SWAPCACHE 13
24#define KPF_SWAPBACKED 14
25#define KPF_COMPOUND_HEAD 15
26#define KPF_COMPOUND_TAIL 16
27#define KPF_HUGE 17
28#define KPF_UNEVICTABLE 18
29#define KPF_HWPOISON 19
30#define KPF_NOPAGE 20
31
32#define KPF_KSM 21
33
34/* kernel hacking assistances
35 * WARNING: subject to change, never rely on them!
36 */
37#define KPF_RESERVED 32
38#define KPF_MLOCKED 33
39#define KPF_MAPPEDTODISK 34
40#define KPF_PRIVATE 35
41#define KPF_PRIVATE_2 36
42#define KPF_OWNER_PRIVATE 37
43#define KPF_ARCH 38
44#define KPF_UNCACHED 39
45
46#endif /* LINUX_KERNEL_PAGE_FLAGS_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4d9c916d06d9..7f0707463360 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -44,6 +44,16 @@ extern const char linux_proc_banner[];
44 44
45#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 45#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
46 46
47/*
48 * This looks more complex than it should be. But we need to
49 * get the type for the ~ right in round_down (it needs to be
50 * as wide as the result!), and we want to evaluate the macro
51 * arguments just once each.
52 */
53#define __round_mask(x, y) ((__typeof__(x))((y)-1))
54#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
55#define round_down(x, y) ((x) & ~__round_mask(x, y))
56
47#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 57#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
48#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 58#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
49#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) 59#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
@@ -124,7 +134,7 @@ extern int _cond_resched(void);
124#endif 134#endif
125 135
126#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 136#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
127 void __might_sleep(char *file, int line, int preempt_offset); 137 void __might_sleep(const char *file, int line, int preempt_offset);
128/** 138/**
129 * might_sleep - annotation for functions that can sleep 139 * might_sleep - annotation for functions that can sleep
130 * 140 *
@@ -138,7 +148,8 @@ extern int _cond_resched(void);
138# define might_sleep() \ 148# define might_sleep() \
139 do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) 149 do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
140#else 150#else
141 static inline void __might_sleep(char *file, int line, int preempt_offset) { } 151 static inline void __might_sleep(const char *file, int line,
152 int preempt_offset) { }
142# define might_sleep() do { might_resched(); } while (0) 153# define might_sleep() do { might_resched(); } while (0)
143#endif 154#endif
144 155
@@ -535,6 +546,8 @@ extern int
535__trace_printk(unsigned long ip, const char *fmt, ...) 546__trace_printk(unsigned long ip, const char *fmt, ...)
536 __attribute__ ((format (printf, 2, 3))); 547 __attribute__ ((format (printf, 2, 3)));
537 548
549extern void trace_dump_stack(void);
550
538/* 551/*
539 * The double __builtin_constant_p is because gcc will give us an error 552 * The double __builtin_constant_p is because gcc will give us an error
540 * if we try to allocate the static variable to fmt if it is not a 553 * if we try to allocate the static variable to fmt if it is not a
@@ -568,6 +581,7 @@ trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
568static inline void tracing_start(void) { } 581static inline void tracing_start(void) { }
569static inline void tracing_stop(void) { } 582static inline void tracing_stop(void) { }
570static inline void ftrace_off_permanent(void) { } 583static inline void ftrace_off_permanent(void) { }
584static inline void trace_dump_stack(void) { }
571static inline int 585static inline int
572trace_printk(const char *fmt, ...) 586trace_printk(const char *fmt, ...)
573{ 587{
@@ -731,6 +745,10 @@ struct sysinfo {
731/* Force a compilation error if condition is constant and true */ 745/* Force a compilation error if condition is constant and true */
732#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) 746#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
733 747
748/* Force a compilation error if a constant expression is not a power of 2 */
749#define BUILD_BUG_ON_NOT_POWER_OF_2(n) \
750 BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
751
734/* Force a compilation error if condition is true, but also produce a 752/* Force a compilation error if condition is true, but also produce a
735 result (of value 0 and type size_t), so the expression can be used 753 result (of value 0 and type size_t), so the expression can be used
736 e.g. in a structure initializer (or where-ever else comma expressions 754 e.g. in a structure initializer (or where-ever else comma expressions
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index a53e932f80fb..9c2683929fd3 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -48,9 +48,7 @@ typedef struct kcapi_carddef {
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> 50#include <linux/workqueue.h>
51 51#include <linux/notifier.h>
52#define KCI_CONTRUP 0 /* arg: struct capi_profile */
53#define KCI_CONTRDOWN 1 /* arg: NULL */
54 52
55struct capi20_appl { 53struct capi20_appl {
56 u16 applid; 54 u16 applid;
@@ -67,11 +65,6 @@ struct capi20_appl {
67 struct sk_buff_head recv_queue; 65 struct sk_buff_head recv_queue;
68 struct work_struct recv_work; 66 struct work_struct recv_work;
69 int release_in_progress; 67 int release_in_progress;
70
71 /* ugly hack to allow for notification of added/removed
72 * controllers. The Right Way (tm) is known. XXX
73 */
74 void (*callback) (unsigned int cmd, __u32 contr, void *data);
75}; 68};
76 69
77u16 capi20_isinstalled(void); 70u16 capi20_isinstalled(void);
@@ -84,11 +77,11 @@ u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
84u16 capi20_get_profile(u32 contr, struct capi_profile *profp); 77u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
85int capi20_manufacturer(unsigned int cmd, void __user *data); 78int capi20_manufacturer(unsigned int cmd, void __user *data);
86 79
87/* temporary hack XXX */ 80#define CAPICTR_UP 0
88void capi20_set_callback(struct capi20_appl *ap, 81#define CAPICTR_DOWN 1
89 void (*callback) (unsigned int cmd, __u32 contr, void *data));
90
91 82
83int register_capictr_notifier(struct notifier_block *nb);
84int unregister_capictr_notifier(struct notifier_block *nb);
92 85
93#define CAPI_NOERROR 0x0000 86#define CAPI_NOERROR 0x0000
94 87
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index c356b6914ffd..03e8e8dbc577 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -199,7 +199,7 @@ extern struct kimage *kexec_crash_image;
199 */ 199 */
200extern struct resource crashk_res; 200extern struct resource crashk_res;
201typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4]; 201typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4];
202extern note_buf_t *crash_notes; 202extern note_buf_t __percpu *crash_notes;
203extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; 203extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4];
204extern size_t vmcoreinfo_size; 204extern size_t vmcoreinfo_size;
205extern size_t vmcoreinfo_max_size; 205extern size_t vmcoreinfo_max_size;
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index ad6bdf5a5970..ece0b1c33816 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -1,6 +1,7 @@
1/* 1/*
2 * A simple kernel FIFO implementation. 2 * A generic kernel FIFO implementation.
3 * 3 *
4 * Copyright (C) 2009 Stefani Seibold <stefani@seibold.net>
4 * Copyright (C) 2004 Stelian Pop <stelian@popies.net> 5 * Copyright (C) 2004 Stelian Pop <stelian@popies.net>
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -18,6 +19,25 @@
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 * 20 *
20 */ 21 */
22
23/*
24 * Howto porting drivers to the new generic fifo API:
25 *
26 * - Modify the declaration of the "struct kfifo *" object into a
27 * in-place "struct kfifo" object
28 * - Init the in-place object with kfifo_alloc() or kfifo_init()
29 * Note: The address of the in-place "struct kfifo" object must be
30 * passed as the first argument to this functions
31 * - Replace the use of __kfifo_put into kfifo_in and __kfifo_get
32 * into kfifo_out
33 * - Replace the use of kfifo_put into kfifo_in_locked and kfifo_get
34 * into kfifo_out_locked
35 * Note: the spinlock pointer formerly passed to kfifo_init/kfifo_alloc
36 * must be passed now to the kfifo_in_locked and kfifo_out_locked
37 * as the last parameter.
38 * - All formerly name __kfifo_* functions has been renamed into kfifo_*
39 */
40
21#ifndef _LINUX_KFIFO_H 41#ifndef _LINUX_KFIFO_H
22#define _LINUX_KFIFO_H 42#define _LINUX_KFIFO_H
23 43
@@ -29,26 +49,80 @@ struct kfifo {
29 unsigned int size; /* the size of the allocated buffer */ 49 unsigned int size; /* the size of the allocated buffer */
30 unsigned int in; /* data is added at offset (in % size) */ 50 unsigned int in; /* data is added at offset (in % size) */
31 unsigned int out; /* data is extracted from off. (out % size) */ 51 unsigned int out; /* data is extracted from off. (out % size) */
32 spinlock_t *lock; /* protects concurrent modifications */
33}; 52};
34 53
35extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, 54/*
36 gfp_t gfp_mask, spinlock_t *lock); 55 * Macros for declaration and initialization of the kfifo datatype
37extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, 56 */
38 spinlock_t *lock); 57
58/* helper macro */
59#define __kfifo_initializer(s, b) \
60 (struct kfifo) { \
61 .size = s, \
62 .in = 0, \
63 .out = 0, \
64 .buffer = b \
65 }
66
67/**
68 * DECLARE_KFIFO - macro to declare a kfifo and the associated buffer
69 * @name: name of the declared kfifo datatype
70 * @size: size of the fifo buffer. Must be a power of two.
71 *
72 * Note1: the macro can be used inside struct or union declaration
73 * Note2: the macro creates two objects:
74 * A kfifo object with the given name and a buffer for the kfifo
75 * object named name##kfifo_buffer
76 */
77#define DECLARE_KFIFO(name, size) \
78union { \
79 struct kfifo name; \
80 unsigned char name##kfifo_buffer[size + sizeof(struct kfifo)]; \
81}
82
83/**
84 * INIT_KFIFO - Initialize a kfifo declared by DECLARE_KFIFO
85 * @name: name of the declared kfifo datatype
86 */
87#define INIT_KFIFO(name) \
88 name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \
89 sizeof(struct kfifo), name##kfifo_buffer)
90
91/**
92 * DEFINE_KFIFO - macro to define and initialize a kfifo
93 * @name: name of the declared kfifo datatype
94 * @size: size of the fifo buffer. Must be a power of two.
95 *
96 * Note1: the macro can be used for global and local kfifo data type variables
97 * Note2: the macro creates two objects:
98 * A kfifo object with the given name and a buffer for the kfifo
99 * object named name##kfifo_buffer
100 */
101#define DEFINE_KFIFO(name, size) \
102 unsigned char name##kfifo_buffer[size]; \
103 struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer)
104
105extern void kfifo_init(struct kfifo *fifo, void *buffer,
106 unsigned int size);
107extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size,
108 gfp_t gfp_mask);
39extern void kfifo_free(struct kfifo *fifo); 109extern void kfifo_free(struct kfifo *fifo);
40extern unsigned int __kfifo_put(struct kfifo *fifo, 110extern unsigned int kfifo_in(struct kfifo *fifo,
41 const unsigned char *buffer, unsigned int len); 111 const void *from, unsigned int len);
42extern unsigned int __kfifo_get(struct kfifo *fifo, 112extern __must_check unsigned int kfifo_out(struct kfifo *fifo,
43 unsigned char *buffer, unsigned int len); 113 void *to, unsigned int len);
114extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo,
115 void *to, unsigned int len, unsigned offset);
44 116
45/** 117/**
46 * __kfifo_reset - removes the entire FIFO contents, no locking version 118 * kfifo_initialized - Check if kfifo is initialized.
47 * @fifo: the fifo to be emptied. 119 * @fifo: fifo to check
120 * Return %true if FIFO is initialized, otherwise %false.
121 * Assumes the fifo was 0 before.
48 */ 122 */
49static inline void __kfifo_reset(struct kfifo *fifo) 123static inline bool kfifo_initialized(struct kfifo *fifo)
50{ 124{
51 fifo->in = fifo->out = 0; 125 return fifo->buffer != NULL;
52} 126}
53 127
54/** 128/**
@@ -57,96 +131,484 @@ static inline void __kfifo_reset(struct kfifo *fifo)
57 */ 131 */
58static inline void kfifo_reset(struct kfifo *fifo) 132static inline void kfifo_reset(struct kfifo *fifo)
59{ 133{
60 unsigned long flags; 134 fifo->in = fifo->out = 0;
135}
61 136
62 spin_lock_irqsave(fifo->lock, flags); 137/**
138 * kfifo_reset_out - skip FIFO contents
139 * @fifo: the fifo to be emptied.
140 */
141static inline void kfifo_reset_out(struct kfifo *fifo)
142{
143 smp_mb();
144 fifo->out = fifo->in;
145}
63 146
64 __kfifo_reset(fifo); 147/**
148 * kfifo_size - returns the size of the fifo in bytes
149 * @fifo: the fifo to be used.
150 */
151static inline __must_check unsigned int kfifo_size(struct kfifo *fifo)
152{
153 return fifo->size;
154}
65 155
66 spin_unlock_irqrestore(fifo->lock, flags); 156/**
157 * kfifo_len - returns the number of used bytes in the FIFO
158 * @fifo: the fifo to be used.
159 */
160static inline unsigned int kfifo_len(struct kfifo *fifo)
161{
162 register unsigned int out;
163
164 out = fifo->out;
165 smp_rmb();
166 return fifo->in - out;
67} 167}
68 168
69/** 169/**
70 * kfifo_put - puts some data into the FIFO 170 * kfifo_is_empty - returns true if the fifo is empty
71 * @fifo: the fifo to be used. 171 * @fifo: the fifo to be used.
72 * @buffer: the data to be added. 172 */
73 * @len: the length of the data to be added. 173static inline __must_check int kfifo_is_empty(struct kfifo *fifo)
174{
175 return fifo->in == fifo->out;
176}
177
178/**
179 * kfifo_is_full - returns true if the fifo is full
180 * @fifo: the fifo to be used.
181 */
182static inline __must_check int kfifo_is_full(struct kfifo *fifo)
183{
184 return kfifo_len(fifo) == kfifo_size(fifo);
185}
186
187/**
188 * kfifo_avail - returns the number of bytes available in the FIFO
189 * @fifo: the fifo to be used.
190 */
191static inline __must_check unsigned int kfifo_avail(struct kfifo *fifo)
192{
193 return kfifo_size(fifo) - kfifo_len(fifo);
194}
195
196/**
197 * kfifo_in_locked - puts some data into the FIFO using a spinlock for locking
198 * @fifo: the fifo to be used.
199 * @from: the data to be added.
200 * @n: the length of the data to be added.
201 * @lock: pointer to the spinlock to use for locking.
74 * 202 *
75 * This function copies at most @len bytes from the @buffer into 203 * This function copies at most @len bytes from the @from buffer into
76 * the FIFO depending on the free space, and returns the number of 204 * the FIFO depending on the free space, and returns the number of
77 * bytes copied. 205 * bytes copied.
78 */ 206 */
79static inline unsigned int kfifo_put(struct kfifo *fifo, 207static inline unsigned int kfifo_in_locked(struct kfifo *fifo,
80 const unsigned char *buffer, unsigned int len) 208 const void *from, unsigned int n, spinlock_t *lock)
81{ 209{
82 unsigned long flags; 210 unsigned long flags;
83 unsigned int ret; 211 unsigned int ret;
84 212
85 spin_lock_irqsave(fifo->lock, flags); 213 spin_lock_irqsave(lock, flags);
86 214
87 ret = __kfifo_put(fifo, buffer, len); 215 ret = kfifo_in(fifo, from, n);
88 216
89 spin_unlock_irqrestore(fifo->lock, flags); 217 spin_unlock_irqrestore(lock, flags);
90 218
91 return ret; 219 return ret;
92} 220}
93 221
94/** 222/**
95 * kfifo_get - gets some data from the FIFO 223 * kfifo_out_locked - gets some data from the FIFO using a spinlock for locking
96 * @fifo: the fifo to be used. 224 * @fifo: the fifo to be used.
97 * @buffer: where the data must be copied. 225 * @to: where the data must be copied.
98 * @len: the size of the destination buffer. 226 * @n: the size of the destination buffer.
227 * @lock: pointer to the spinlock to use for locking.
99 * 228 *
100 * This function copies at most @len bytes from the FIFO into the 229 * This function copies at most @len bytes from the FIFO into the
101 * @buffer and returns the number of copied bytes. 230 * @to buffer and returns the number of copied bytes.
102 */ 231 */
103static inline unsigned int kfifo_get(struct kfifo *fifo, 232static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo,
104 unsigned char *buffer, unsigned int len) 233 void *to, unsigned int n, spinlock_t *lock)
105{ 234{
106 unsigned long flags; 235 unsigned long flags;
107 unsigned int ret; 236 unsigned int ret;
108 237
109 spin_lock_irqsave(fifo->lock, flags); 238 spin_lock_irqsave(lock, flags);
239
240 ret = kfifo_out(fifo, to, n);
241
242 spin_unlock_irqrestore(lock, flags);
243
244 return ret;
245}
246
247extern void kfifo_skip(struct kfifo *fifo, unsigned int len);
248
249extern __must_check int kfifo_from_user(struct kfifo *fifo,
250 const void __user *from, unsigned int n, unsigned *lenout);
251
252extern __must_check int kfifo_to_user(struct kfifo *fifo,
253 void __user *to, unsigned int n, unsigned *lenout);
254
255/*
256 * __kfifo_add_out internal helper function for updating the out offset
257 */
258static inline void __kfifo_add_out(struct kfifo *fifo,
259 unsigned int off)
260{
261 smp_mb();
262 fifo->out += off;
263}
264
265/*
266 * __kfifo_add_in internal helper function for updating the in offset
267 */
268static inline void __kfifo_add_in(struct kfifo *fifo,
269 unsigned int off)
270{
271 smp_wmb();
272 fifo->in += off;
273}
110 274
111 ret = __kfifo_get(fifo, buffer, len); 275/*
276 * __kfifo_off internal helper function for calculating the index of a
277 * given offeset
278 */
279static inline unsigned int __kfifo_off(struct kfifo *fifo, unsigned int off)
280{
281 return off & (fifo->size - 1);
282}
112 283
113 /* 284/*
114 * optimization: if the FIFO is empty, set the indices to 0 285 * __kfifo_peek_n internal helper function for determinate the length of
115 * so we don't wrap the next time 286 * the next record in the fifo
116 */ 287 */
117 if (fifo->in == fifo->out) 288static inline unsigned int __kfifo_peek_n(struct kfifo *fifo,
118 fifo->in = fifo->out = 0; 289 unsigned int recsize)
290{
291#define __KFIFO_GET(fifo, off, shift) \
292 ((fifo)->buffer[__kfifo_off((fifo), (fifo)->out+(off))] << (shift))
293
294 unsigned int l;
295
296 l = __KFIFO_GET(fifo, 0, 0);
297
298 if (--recsize)
299 l |= __KFIFO_GET(fifo, 1, 8);
119 300
120 spin_unlock_irqrestore(fifo->lock, flags); 301 return l;
302#undef __KFIFO_GET
303}
304
305/*
306 * __kfifo_poke_n internal helper function for storing the length of
307 * the next record into the fifo
308 */
309static inline void __kfifo_poke_n(struct kfifo *fifo,
310 unsigned int recsize, unsigned int n)
311{
312#define __KFIFO_PUT(fifo, off, val, shift) \
313 ( \
314 (fifo)->buffer[__kfifo_off((fifo), (fifo)->in+(off))] = \
315 (unsigned char)((val) >> (shift)) \
316 )
121 317
318 __KFIFO_PUT(fifo, 0, n, 0);
319
320 if (--recsize)
321 __KFIFO_PUT(fifo, 1, n, 8);
322#undef __KFIFO_PUT
323}
324
325/*
326 * __kfifo_in_... internal functions for put date into the fifo
327 * do not call it directly, use kfifo_in_rec() instead
328 */
329extern unsigned int __kfifo_in_n(struct kfifo *fifo,
330 const void *from, unsigned int n, unsigned int recsize);
331
332extern unsigned int __kfifo_in_generic(struct kfifo *fifo,
333 const void *from, unsigned int n, unsigned int recsize);
334
335static inline unsigned int __kfifo_in_rec(struct kfifo *fifo,
336 const void *from, unsigned int n, unsigned int recsize)
337{
338 unsigned int ret;
339
340 ret = __kfifo_in_n(fifo, from, n, recsize);
341
342 if (likely(ret == 0)) {
343 if (recsize)
344 __kfifo_poke_n(fifo, recsize, n);
345 __kfifo_add_in(fifo, n + recsize);
346 }
122 return ret; 347 return ret;
123} 348}
124 349
125/** 350/**
126 * __kfifo_len - returns the number of bytes available in the FIFO, no locking version 351 * kfifo_in_rec - puts some record data into the FIFO
127 * @fifo: the fifo to be used. 352 * @fifo: the fifo to be used.
353 * @from: the data to be added.
354 * @n: the length of the data to be added.
355 * @recsize: size of record field
356 *
357 * This function copies @n bytes from the @from into the FIFO and returns
358 * the number of bytes which cannot be copied.
359 * A returned value greater than the @n value means that the record doesn't
360 * fit into the buffer.
361 *
362 * Note that with only one concurrent reader and one concurrent
363 * writer, you don't need extra locking to use these functions.
128 */ 364 */
129static inline unsigned int __kfifo_len(struct kfifo *fifo) 365static inline __must_check unsigned int kfifo_in_rec(struct kfifo *fifo,
366 void *from, unsigned int n, unsigned int recsize)
130{ 367{
131 return fifo->in - fifo->out; 368 if (!__builtin_constant_p(recsize))
369 return __kfifo_in_generic(fifo, from, n, recsize);
370 return __kfifo_in_rec(fifo, from, n, recsize);
371}
372
373/*
374 * __kfifo_out_... internal functions for get date from the fifo
375 * do not call it directly, use kfifo_out_rec() instead
376 */
377extern unsigned int __kfifo_out_n(struct kfifo *fifo,
378 void *to, unsigned int reclen, unsigned int recsize);
379
380extern unsigned int __kfifo_out_generic(struct kfifo *fifo,
381 void *to, unsigned int n,
382 unsigned int recsize, unsigned int *total);
383
384static inline unsigned int __kfifo_out_rec(struct kfifo *fifo,
385 void *to, unsigned int n, unsigned int recsize,
386 unsigned int *total)
387{
388 unsigned int l;
389
390 if (!recsize) {
391 l = n;
392 if (total)
393 *total = l;
394 } else {
395 l = __kfifo_peek_n(fifo, recsize);
396 if (total)
397 *total = l;
398 if (n < l)
399 return l;
400 }
401
402 return __kfifo_out_n(fifo, to, l, recsize);
132} 403}
133 404
134/** 405/**
135 * kfifo_len - returns the number of bytes available in the FIFO 406 * kfifo_out_rec - gets some record data from the FIFO
136 * @fifo: the fifo to be used. 407 * @fifo: the fifo to be used.
408 * @to: where the data must be copied.
409 * @n: the size of the destination buffer.
410 * @recsize: size of record field
411 * @total: pointer where the total number of to copied bytes should stored
412 *
413 * This function copies at most @n bytes from the FIFO to @to and returns the
414 * number of bytes which cannot be copied.
415 * A returned value greater than the @n value means that the record doesn't
416 * fit into the @to buffer.
417 *
418 * Note that with only one concurrent reader and one concurrent
419 * writer, you don't need extra locking to use these functions.
137 */ 420 */
138static inline unsigned int kfifo_len(struct kfifo *fifo) 421static inline __must_check unsigned int kfifo_out_rec(struct kfifo *fifo,
422 void *to, unsigned int n, unsigned int recsize,
423 unsigned int *total)
424
139{ 425{
140 unsigned long flags; 426 if (!__builtin_constant_p(recsize))
141 unsigned int ret; 427 return __kfifo_out_generic(fifo, to, n, recsize, total);
428 return __kfifo_out_rec(fifo, to, n, recsize, total);
429}
142 430
143 spin_lock_irqsave(fifo->lock, flags); 431/*
432 * __kfifo_from_user_... internal functions for transfer from user space into
433 * the fifo. do not call it directly, use kfifo_from_user_rec() instead
434 */
435extern unsigned int __kfifo_from_user_n(struct kfifo *fifo,
436 const void __user *from, unsigned int n, unsigned int recsize);
437
438extern unsigned int __kfifo_from_user_generic(struct kfifo *fifo,
439 const void __user *from, unsigned int n, unsigned int recsize);
144 440
145 ret = __kfifo_len(fifo); 441static inline unsigned int __kfifo_from_user_rec(struct kfifo *fifo,
442 const void __user *from, unsigned int n, unsigned int recsize)
443{
444 unsigned int ret;
146 445
147 spin_unlock_irqrestore(fifo->lock, flags); 446 ret = __kfifo_from_user_n(fifo, from, n, recsize);
148 447
448 if (likely(ret == 0)) {
449 if (recsize)
450 __kfifo_poke_n(fifo, recsize, n);
451 __kfifo_add_in(fifo, n + recsize);
452 }
149 return ret; 453 return ret;
150} 454}
151 455
456/**
457 * kfifo_from_user_rec - puts some data from user space into the FIFO
458 * @fifo: the fifo to be used.
459 * @from: pointer to the data to be added.
460 * @n: the length of the data to be added.
461 * @recsize: size of record field
462 *
463 * This function copies @n bytes from the @from into the
464 * FIFO and returns the number of bytes which cannot be copied.
465 *
466 * If the returned value is equal or less the @n value, the copy_from_user()
467 * functions has failed. Otherwise the record doesn't fit into the buffer.
468 *
469 * Note that with only one concurrent reader and one concurrent
470 * writer, you don't need extra locking to use these functions.
471 */
472static inline __must_check unsigned int kfifo_from_user_rec(struct kfifo *fifo,
473 const void __user *from, unsigned int n, unsigned int recsize)
474{
475 if (!__builtin_constant_p(recsize))
476 return __kfifo_from_user_generic(fifo, from, n, recsize);
477 return __kfifo_from_user_rec(fifo, from, n, recsize);
478}
479
480/*
481 * __kfifo_to_user_... internal functions for transfer fifo data into user space
482 * do not call it directly, use kfifo_to_user_rec() instead
483 */
484extern unsigned int __kfifo_to_user_n(struct kfifo *fifo,
485 void __user *to, unsigned int n, unsigned int reclen,
486 unsigned int recsize);
487
488extern unsigned int __kfifo_to_user_generic(struct kfifo *fifo,
489 void __user *to, unsigned int n, unsigned int recsize,
490 unsigned int *total);
491
492static inline unsigned int __kfifo_to_user_rec(struct kfifo *fifo,
493 void __user *to, unsigned int n,
494 unsigned int recsize, unsigned int *total)
495{
496 unsigned int l;
497
498 if (!recsize) {
499 l = n;
500 if (total)
501 *total = l;
502 } else {
503 l = __kfifo_peek_n(fifo, recsize);
504 if (total)
505 *total = l;
506 if (n < l)
507 return l;
508 }
509
510 return __kfifo_to_user_n(fifo, to, n, l, recsize);
511}
512
513/**
514 * kfifo_to_user_rec - gets data from the FIFO and write it to user space
515 * @fifo: the fifo to be used.
516 * @to: where the data must be copied.
517 * @n: the size of the destination buffer.
518 * @recsize: size of record field
519 * @total: pointer where the total number of to copied bytes should stored
520 *
521 * This function copies at most @n bytes from the FIFO to the @to.
522 * In case of an error, the function returns the number of bytes which cannot
523 * be copied.
524 * If the returned value is equal or less the @n value, the copy_to_user()
525 * functions has failed. Otherwise the record doesn't fit into the @to buffer.
526 *
527 * Note that with only one concurrent reader and one concurrent
528 * writer, you don't need extra locking to use these functions.
529 */
530static inline __must_check unsigned int kfifo_to_user_rec(struct kfifo *fifo,
531 void __user *to, unsigned int n, unsigned int recsize,
532 unsigned int *total)
533{
534 if (!__builtin_constant_p(recsize))
535 return __kfifo_to_user_generic(fifo, to, n, recsize, total);
536 return __kfifo_to_user_rec(fifo, to, n, recsize, total);
537}
538
539/*
540 * __kfifo_peek_... internal functions for peek into the next fifo record
541 * do not call it directly, use kfifo_peek_rec() instead
542 */
543extern unsigned int __kfifo_peek_generic(struct kfifo *fifo,
544 unsigned int recsize);
545
546/**
547 * kfifo_peek_rec - gets the size of the next FIFO record data
548 * @fifo: the fifo to be used.
549 * @recsize: size of record field
550 *
551 * This function returns the size of the next FIFO record in number of bytes
552 */
553static inline __must_check unsigned int kfifo_peek_rec(struct kfifo *fifo,
554 unsigned int recsize)
555{
556 if (!__builtin_constant_p(recsize))
557 return __kfifo_peek_generic(fifo, recsize);
558 if (!recsize)
559 return kfifo_len(fifo);
560 return __kfifo_peek_n(fifo, recsize);
561}
562
563/*
564 * __kfifo_skip_... internal functions for skip the next fifo record
565 * do not call it directly, use kfifo_skip_rec() instead
566 */
567extern void __kfifo_skip_generic(struct kfifo *fifo, unsigned int recsize);
568
569static inline void __kfifo_skip_rec(struct kfifo *fifo,
570 unsigned int recsize)
571{
572 unsigned int l;
573
574 if (recsize) {
575 l = __kfifo_peek_n(fifo, recsize);
576
577 if (l + recsize <= kfifo_len(fifo)) {
578 __kfifo_add_out(fifo, l + recsize);
579 return;
580 }
581 }
582 kfifo_reset_out(fifo);
583}
584
585/**
586 * kfifo_skip_rec - skip the next fifo out record
587 * @fifo: the fifo to be used.
588 * @recsize: size of record field
589 *
590 * This function skips the next FIFO record
591 */
592static inline void kfifo_skip_rec(struct kfifo *fifo,
593 unsigned int recsize)
594{
595 if (!__builtin_constant_p(recsize))
596 __kfifo_skip_generic(fifo, recsize);
597 else
598 __kfifo_skip_rec(fifo, recsize);
599}
600
601/**
602 * kfifo_avail_rec - returns the number of bytes available in a record FIFO
603 * @fifo: the fifo to be used.
604 * @recsize: size of record field
605 */
606static inline __must_check unsigned int kfifo_avail_rec(struct kfifo *fifo,
607 unsigned int recsize)
608{
609 unsigned int l = kfifo_size(fifo) - kfifo_len(fifo);
610
611 return (l > recsize) ? l - recsize : 0;
612}
613
152#endif 614#endif
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index 6adcc297e354..19ec41a183f5 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -29,8 +29,7 @@ struct pt_regs;
29 * 29 *
30 * On some architectures it is required to skip a breakpoint 30 * On some architectures it is required to skip a breakpoint
31 * exception when it occurs after a breakpoint has been removed. 31 * exception when it occurs after a breakpoint has been removed.
32 * This can be implemented in the architecture specific portion of 32 * This can be implemented in the architecture specific portion of kgdb.
33 * for kgdb.
34 */ 33 */
35extern int kgdb_skipexception(int exception, struct pt_regs *regs); 34extern int kgdb_skipexception(int exception, struct pt_regs *regs);
36 35
@@ -65,7 +64,7 @@ struct uart_port;
65/** 64/**
66 * kgdb_breakpoint - compiled in breakpoint 65 * kgdb_breakpoint - compiled in breakpoint
67 * 66 *
68 * This will be impelmented a static inline per architecture. This 67 * This will be implemented as a static inline per architecture. This
69 * function is called by the kgdb core to execute an architecture 68 * function is called by the kgdb core to execute an architecture
70 * specific trap to cause kgdb to enter the exception processing. 69 * specific trap to cause kgdb to enter the exception processing.
71 * 70 *
@@ -190,7 +189,7 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code,
190 * @flags: Current IRQ state 189 * @flags: Current IRQ state
191 * 190 *
192 * On SMP systems, we need to get the attention of the other CPUs 191 * On SMP systems, we need to get the attention of the other CPUs
193 * and get them be in a known state. This should do what is needed 192 * and get them into a known state. This should do what is needed
194 * to get the other CPUs to call kgdb_wait(). Note that on some arches, 193 * to get the other CPUs to call kgdb_wait(). Note that on some arches,
195 * the NMI approach is not used for rounding up all the CPUs. For example, 194 * the NMI approach is not used for rounding up all the CPUs. For example,
196 * in case of MIPS, smp_call_function() is used to roundup CPUs. In 195 * in case of MIPS, smp_call_function() is used to roundup CPUs. In
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h
index e880d4cf9e22..08d7dc4ddf40 100644
--- a/include/linux/kmemcheck.h
+++ b/include/linux/kmemcheck.h
@@ -36,6 +36,56 @@ int kmemcheck_hide_addr(unsigned long address);
36 36
37bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); 37bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size);
38 38
39/*
40 * Bitfield annotations
41 *
42 * How to use: If you have a struct using bitfields, for example
43 *
44 * struct a {
45 * int x:8, y:8;
46 * };
47 *
48 * then this should be rewritten as
49 *
50 * struct a {
51 * kmemcheck_bitfield_begin(flags);
52 * int x:8, y:8;
53 * kmemcheck_bitfield_end(flags);
54 * };
55 *
56 * Now the "flags_begin" and "flags_end" members may be used to refer to the
57 * beginning and end, respectively, of the bitfield (and things like
58 * &x.flags_begin is allowed). As soon as the struct is allocated, the bit-
59 * fields should be annotated:
60 *
61 * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL);
62 * kmemcheck_annotate_bitfield(a, flags);
63 */
64#define kmemcheck_bitfield_begin(name) \
65 int name##_begin[0];
66
67#define kmemcheck_bitfield_end(name) \
68 int name##_end[0];
69
70#define kmemcheck_annotate_bitfield(ptr, name) \
71 do { \
72 int _n; \
73 \
74 if (!ptr) \
75 break; \
76 \
77 _n = (long) &((ptr)->name##_end) \
78 - (long) &((ptr)->name##_begin); \
79 MAYBE_BUILD_BUG_ON(_n < 0); \
80 \
81 kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \
82 } while (0)
83
84#define kmemcheck_annotate_variable(var) \
85 do { \
86 kmemcheck_mark_initialized(&(var), sizeof(var)); \
87 } while (0) \
88
39#else 89#else
40#define kmemcheck_enabled 0 90#define kmemcheck_enabled 0
41 91
@@ -106,60 +156,16 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size)
106 return true; 156 return true;
107} 157}
108 158
109#endif /* CONFIG_KMEMCHECK */ 159#define kmemcheck_bitfield_begin(name)
110 160#define kmemcheck_bitfield_end(name)
111/* 161#define kmemcheck_annotate_bitfield(ptr, name) \
112 * Bitfield annotations 162 do { \
113 * 163 } while (0)
114 * How to use: If you have a struct using bitfields, for example
115 *
116 * struct a {
117 * int x:8, y:8;
118 * };
119 *
120 * then this should be rewritten as
121 *
122 * struct a {
123 * kmemcheck_bitfield_begin(flags);
124 * int x:8, y:8;
125 * kmemcheck_bitfield_end(flags);
126 * };
127 *
128 * Now the "flags_begin" and "flags_end" members may be used to refer to the
129 * beginning and end, respectively, of the bitfield (and things like
130 * &x.flags_begin is allowed). As soon as the struct is allocated, the bit-
131 * fields should be annotated:
132 *
133 * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL);
134 * kmemcheck_annotate_bitfield(a, flags);
135 *
136 * Note: We provide the same definitions for both kmemcheck and non-
137 * kmemcheck kernels. This makes it harder to introduce accidental errors. It
138 * is also allowed to pass NULL pointers to kmemcheck_annotate_bitfield().
139 */
140#define kmemcheck_bitfield_begin(name) \
141 int name##_begin[0];
142
143#define kmemcheck_bitfield_end(name) \
144 int name##_end[0];
145 164
146#define kmemcheck_annotate_bitfield(ptr, name) \ 165#define kmemcheck_annotate_variable(var) \
147 do { \ 166 do { \
148 int _n; \
149 \
150 if (!ptr) \
151 break; \
152 \
153 _n = (long) &((ptr)->name##_end) \
154 - (long) &((ptr)->name##_begin); \
155 MAYBE_BUILD_BUG_ON(_n < 0); \
156 \
157 kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \
158 } while (0) 167 } while (0)
159 168
160#define kmemcheck_annotate_variable(var) \ 169#endif /* CONFIG_KMEMCHECK */
161 do { \
162 kmemcheck_mark_initialized(&(var), sizeof(var)); \
163 } while (0) \
164 170
165#endif /* LINUX_KMEMCHECK_H */ 171#endif /* LINUX_KMEMCHECK_H */
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h
index 3c7497d46ee9..99d9a6766f7e 100644
--- a/include/linux/kmemleak.h
+++ b/include/linux/kmemleak.h
@@ -32,8 +32,7 @@ extern void kmemleak_padding(const void *ptr, unsigned long offset,
32 size_t size) __ref; 32 size_t size) __ref;
33extern void kmemleak_not_leak(const void *ptr) __ref; 33extern void kmemleak_not_leak(const void *ptr) __ref;
34extern void kmemleak_ignore(const void *ptr) __ref; 34extern void kmemleak_ignore(const void *ptr) __ref;
35extern void kmemleak_scan_area(const void *ptr, unsigned long offset, 35extern void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp) __ref;
36 size_t length, gfp_t gfp) __ref;
37extern void kmemleak_no_scan(const void *ptr) __ref; 36extern void kmemleak_no_scan(const void *ptr) __ref;
38 37
39static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, 38static inline void kmemleak_alloc_recursive(const void *ptr, size_t size,
@@ -84,8 +83,7 @@ static inline void kmemleak_not_leak(const void *ptr)
84static inline void kmemleak_ignore(const void *ptr) 83static inline void kmemleak_ignore(const void *ptr)
85{ 84{
86} 85}
87static inline void kmemleak_scan_area(const void *ptr, unsigned long offset, 86static inline void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp)
88 size_t length, gfp_t gfp)
89{ 87{
90} 88}
91static inline void kmemleak_erase(void **ptr) 89static inline void kmemleak_erase(void **ptr)
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 384ca8bbf1ac..facb27fe7de0 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -27,6 +27,7 @@
27#define KMOD_PATH_LEN 256 27#define KMOD_PATH_LEN 256
28 28
29#ifdef CONFIG_MODULES 29#ifdef CONFIG_MODULES
30extern char modprobe_path[]; /* for sysctl */
30/* modprobe exit status on success, -ve on error. Return value 31/* modprobe exit status on success, -ve on error. Return value
31 * usually useless though. */ 32 * usually useless though. */
32extern int __request_module(bool wait, const char *name, ...) \ 33extern int __request_module(bool wait, const char *name, ...) \
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h
new file mode 100644
index 000000000000..24b44145a886
--- /dev/null
+++ b/include/linux/kmsg_dump.h
@@ -0,0 +1,61 @@
1/*
2 * linux/include/kmsg_dump.h
3 *
4 * Copyright (C) 2009 Net Insight AB
5 *
6 * Author: Simon Kagstrom <simon.kagstrom@netinsight.net>
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file COPYING in the main directory of this archive
10 * for more details.
11 */
12#ifndef _LINUX_KMSG_DUMP_H
13#define _LINUX_KMSG_DUMP_H
14
15#include <linux/list.h>
16
17enum kmsg_dump_reason {
18 KMSG_DUMP_OOPS,
19 KMSG_DUMP_PANIC,
20 KMSG_DUMP_KEXEC,
21};
22
23/**
24 * struct kmsg_dumper - kernel crash message dumper structure
25 * @dump: The callback which gets called on crashes. The buffer is passed
26 * as two sections, where s1 (length l1) contains the older
27 * messages and s2 (length l2) contains the newer.
28 * @list: Entry in the dumper list (private)
29 * @registered: Flag that specifies if this is already registered
30 */
31struct kmsg_dumper {
32 void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason,
33 const char *s1, unsigned long l1,
34 const char *s2, unsigned long l2);
35 struct list_head list;
36 int registered;
37};
38
39#ifdef CONFIG_PRINTK
40void kmsg_dump(enum kmsg_dump_reason reason);
41
42int kmsg_dump_register(struct kmsg_dumper *dumper);
43
44int kmsg_dump_unregister(struct kmsg_dumper *dumper);
45#else
46static inline void kmsg_dump(enum kmsg_dump_reason reason)
47{
48}
49
50static inline int kmsg_dump_register(struct kmsg_dumper *dumper)
51{
52 return -EINVAL;
53}
54
55static inline int kmsg_dump_unregister(struct kmsg_dumper *dumper)
56{
57 return -EINVAL;
58}
59#endif
60
61#endif /* _LINUX_KMSG_DUMP_H */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 58ae8e00fcdd..3950d3c2850d 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -106,7 +106,7 @@ extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);
106 106
107struct kobj_type { 107struct kobj_type {
108 void (*release)(struct kobject *kobj); 108 void (*release)(struct kobject *kobj);
109 struct sysfs_ops *sysfs_ops; 109 const struct sysfs_ops *sysfs_ops;
110 struct attribute **default_attrs; 110 struct attribute **default_attrs;
111}; 111};
112 112
@@ -118,9 +118,9 @@ struct kobj_uevent_env {
118}; 118};
119 119
120struct kset_uevent_ops { 120struct kset_uevent_ops {
121 int (*filter)(struct kset *kset, struct kobject *kobj); 121 int (* const filter)(struct kset *kset, struct kobject *kobj);
122 const char *(*name)(struct kset *kset, struct kobject *kobj); 122 const char *(* const name)(struct kset *kset, struct kobject *kobj);
123 int (*uevent)(struct kset *kset, struct kobject *kobj, 123 int (* const uevent)(struct kset *kset, struct kobject *kobj,
124 struct kobj_uevent_env *env); 124 struct kobj_uevent_env *env);
125}; 125};
126 126
@@ -132,7 +132,7 @@ struct kobj_attribute {
132 const char *buf, size_t count); 132 const char *buf, size_t count);
133}; 133};
134 134
135extern struct sysfs_ops kobj_sysfs_ops; 135extern const struct sysfs_ops kobj_sysfs_ops;
136 136
137/** 137/**
138 * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem. 138 * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
@@ -155,14 +155,14 @@ struct kset {
155 struct list_head list; 155 struct list_head list;
156 spinlock_t list_lock; 156 spinlock_t list_lock;
157 struct kobject kobj; 157 struct kobject kobj;
158 struct kset_uevent_ops *uevent_ops; 158 const struct kset_uevent_ops *uevent_ops;
159}; 159};
160 160
161extern void kset_init(struct kset *kset); 161extern void kset_init(struct kset *kset);
162extern int __must_check kset_register(struct kset *kset); 162extern int __must_check kset_register(struct kset *kset);
163extern void kset_unregister(struct kset *kset); 163extern void kset_unregister(struct kset *kset);
164extern struct kset * __must_check kset_create_and_add(const char *name, 164extern struct kset * __must_check kset_create_and_add(const char *name,
165 struct kset_uevent_ops *u, 165 const struct kset_uevent_ops *u,
166 struct kobject *parent_kobj); 166 struct kobject *parent_kobj);
167 167
168static inline struct kset *to_kset(struct kobject *kobj) 168static inline struct kset *to_kset(struct kobject *kobj)
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 1b672f74a32f..e7d1b2e0070d 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -122,6 +122,11 @@ struct kprobe {
122/* Kprobe status flags */ 122/* Kprobe status flags */
123#define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */ 123#define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */
124#define KPROBE_FLAG_DISABLED 2 /* probe is temporarily disabled */ 124#define KPROBE_FLAG_DISABLED 2 /* probe is temporarily disabled */
125#define KPROBE_FLAG_OPTIMIZED 4 /*
126 * probe is really optimized.
127 * NOTE:
128 * this flag is only for optimized_kprobe.
129 */
125 130
126/* Has this kprobe gone ? */ 131/* Has this kprobe gone ? */
127static inline int kprobe_gone(struct kprobe *p) 132static inline int kprobe_gone(struct kprobe *p)
@@ -134,6 +139,12 @@ static inline int kprobe_disabled(struct kprobe *p)
134{ 139{
135 return p->flags & (KPROBE_FLAG_DISABLED | KPROBE_FLAG_GONE); 140 return p->flags & (KPROBE_FLAG_DISABLED | KPROBE_FLAG_GONE);
136} 141}
142
143/* Is this kprobe really running optimized path ? */
144static inline int kprobe_optimized(struct kprobe *p)
145{
146 return p->flags & KPROBE_FLAG_OPTIMIZED;
147}
137/* 148/*
138 * Special probe type that uses setjmp-longjmp type tricks to resume 149 * Special probe type that uses setjmp-longjmp type tricks to resume
139 * execution at a specified entry with a matching prototype corresponding 150 * execution at a specified entry with a matching prototype corresponding
@@ -249,6 +260,39 @@ extern kprobe_opcode_t *get_insn_slot(void);
249extern void free_insn_slot(kprobe_opcode_t *slot, int dirty); 260extern void free_insn_slot(kprobe_opcode_t *slot, int dirty);
250extern void kprobes_inc_nmissed_count(struct kprobe *p); 261extern void kprobes_inc_nmissed_count(struct kprobe *p);
251 262
263#ifdef CONFIG_OPTPROBES
264/*
265 * Internal structure for direct jump optimized probe
266 */
267struct optimized_kprobe {
268 struct kprobe kp;
269 struct list_head list; /* list for optimizing queue */
270 struct arch_optimized_insn optinsn;
271};
272
273/* Architecture dependent functions for direct jump optimization */
274extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn);
275extern int arch_check_optimized_kprobe(struct optimized_kprobe *op);
276extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op);
277extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op);
278extern int arch_optimize_kprobe(struct optimized_kprobe *op);
279extern void arch_unoptimize_kprobe(struct optimized_kprobe *op);
280extern kprobe_opcode_t *get_optinsn_slot(void);
281extern void free_optinsn_slot(kprobe_opcode_t *slot, int dirty);
282extern int arch_within_optimized_kprobe(struct optimized_kprobe *op,
283 unsigned long addr);
284
285extern void opt_pre_handler(struct kprobe *p, struct pt_regs *regs);
286
287#ifdef CONFIG_SYSCTL
288extern int sysctl_kprobes_optimization;
289extern int proc_kprobes_optimization_handler(struct ctl_table *table,
290 int write, void __user *buffer,
291 size_t *length, loff_t *ppos);
292#endif
293
294#endif /* CONFIG_OPTPROBES */
295
252/* Get the kprobe at this addr (if any) - called with preemption disabled */ 296/* Get the kprobe at this addr (if any) - called with preemption disabled */
253struct kprobe *get_kprobe(void *addr); 297struct kprobe *get_kprobe(void *addr);
254void kretprobe_hash_lock(struct task_struct *tsk, 298void kretprobe_hash_lock(struct task_struct *tsk,
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index a24de0b1858e..60df9c84ecae 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -103,7 +103,7 @@ struct kvm_userspace_memory_region {
103 103
104/* for kvm_memory_region::flags */ 104/* for kvm_memory_region::flags */
105#define KVM_MEM_LOG_DIRTY_PAGES 1UL 105#define KVM_MEM_LOG_DIRTY_PAGES 1UL
106 106#define KVM_MEMSLOT_INVALID (1UL << 1)
107 107
108/* for KVM_IRQ_LINE */ 108/* for KVM_IRQ_LINE */
109struct kvm_irq_level { 109struct kvm_irq_level {
@@ -497,6 +497,11 @@ struct kvm_ioeventfd {
497#endif 497#endif
498#define KVM_CAP_S390_PSW 42 498#define KVM_CAP_S390_PSW 42
499#define KVM_CAP_PPC_SEGSTATE 43 499#define KVM_CAP_PPC_SEGSTATE 43
500#define KVM_CAP_HYPERV 44
501#define KVM_CAP_HYPERV_VAPIC 45
502#define KVM_CAP_HYPERV_SPIN 46
503#define KVM_CAP_PCI_SEGMENT 47
504#define KVM_CAP_X86_ROBUST_SINGLESTEP 51
500 505
501#ifdef KVM_CAP_IRQ_ROUTING 506#ifdef KVM_CAP_IRQ_ROUTING
502 507
@@ -691,8 +696,9 @@ struct kvm_assigned_pci_dev {
691 __u32 busnr; 696 __u32 busnr;
692 __u32 devfn; 697 __u32 devfn;
693 __u32 flags; 698 __u32 flags;
699 __u32 segnr;
694 union { 700 union {
695 __u32 reserved[12]; 701 __u32 reserved[11];
696 }; 702 };
697}; 703};
698 704
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index bd5a616d9373..a3fd0f91d943 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -38,6 +38,7 @@
38#define KVM_REQ_MMU_SYNC 7 38#define KVM_REQ_MMU_SYNC 7
39#define KVM_REQ_KVMCLOCK_UPDATE 8 39#define KVM_REQ_KVMCLOCK_UPDATE 8
40#define KVM_REQ_KICK 9 40#define KVM_REQ_KICK 9
41#define KVM_REQ_DEACTIVATE_FPU 10
41 42
42#define KVM_USERSPACE_IRQ_SOURCE_ID 0 43#define KVM_USERSPACE_IRQ_SOURCE_ID 0
43 44
@@ -57,20 +58,20 @@ struct kvm_io_bus {
57 struct kvm_io_device *devs[NR_IOBUS_DEVS]; 58 struct kvm_io_device *devs[NR_IOBUS_DEVS];
58}; 59};
59 60
60void kvm_io_bus_init(struct kvm_io_bus *bus); 61enum kvm_bus {
61void kvm_io_bus_destroy(struct kvm_io_bus *bus); 62 KVM_MMIO_BUS,
62int kvm_io_bus_write(struct kvm_io_bus *bus, gpa_t addr, int len, 63 KVM_PIO_BUS,
63 const void *val); 64 KVM_NR_BUSES
64int kvm_io_bus_read(struct kvm_io_bus *bus, gpa_t addr, int len, 65};
66
67int kvm_io_bus_write(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
68 int len, const void *val);
69int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len,
65 void *val); 70 void *val);
66int __kvm_io_bus_register_dev(struct kvm_io_bus *bus, 71int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx,
67 struct kvm_io_device *dev);
68int kvm_io_bus_register_dev(struct kvm *kvm, struct kvm_io_bus *bus,
69 struct kvm_io_device *dev); 72 struct kvm_io_device *dev);
70void __kvm_io_bus_unregister_dev(struct kvm_io_bus *bus, 73int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
71 struct kvm_io_device *dev); 74 struct kvm_io_device *dev);
72void kvm_io_bus_unregister_dev(struct kvm *kvm, struct kvm_io_bus *bus,
73 struct kvm_io_device *dev);
74 75
75struct kvm_vcpu { 76struct kvm_vcpu {
76 struct kvm *kvm; 77 struct kvm *kvm;
@@ -83,6 +84,8 @@ struct kvm_vcpu {
83 struct kvm_run *run; 84 struct kvm_run *run;
84 unsigned long requests; 85 unsigned long requests;
85 unsigned long guest_debug; 86 unsigned long guest_debug;
87 int srcu_idx;
88
86 int fpu_active; 89 int fpu_active;
87 int guest_fpu_loaded; 90 int guest_fpu_loaded;
88 wait_queue_head_t wq; 91 wait_queue_head_t wq;
@@ -150,14 +153,19 @@ struct kvm_irq_routing_table {};
150 153
151#endif 154#endif
152 155
153struct kvm { 156struct kvm_memslots {
154 spinlock_t mmu_lock;
155 spinlock_t requests_lock;
156 struct rw_semaphore slots_lock;
157 struct mm_struct *mm; /* userspace tied to this vm */
158 int nmemslots; 157 int nmemslots;
159 struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + 158 struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
160 KVM_PRIVATE_MEM_SLOTS]; 159 KVM_PRIVATE_MEM_SLOTS];
160};
161
162struct kvm {
163 spinlock_t mmu_lock;
164 raw_spinlock_t requests_lock;
165 struct mutex slots_lock;
166 struct mm_struct *mm; /* userspace tied to this vm */
167 struct kvm_memslots *memslots;
168 struct srcu_struct srcu;
161#ifdef CONFIG_KVM_APIC_ARCHITECTURE 169#ifdef CONFIG_KVM_APIC_ARCHITECTURE
162 u32 bsp_vcpu_id; 170 u32 bsp_vcpu_id;
163 struct kvm_vcpu *bsp_vcpu; 171 struct kvm_vcpu *bsp_vcpu;
@@ -166,8 +174,7 @@ struct kvm {
166 atomic_t online_vcpus; 174 atomic_t online_vcpus;
167 struct list_head vm_list; 175 struct list_head vm_list;
168 struct mutex lock; 176 struct mutex lock;
169 struct kvm_io_bus mmio_bus; 177 struct kvm_io_bus *buses[KVM_NR_BUSES];
170 struct kvm_io_bus pio_bus;
171#ifdef CONFIG_HAVE_KVM_EVENTFD 178#ifdef CONFIG_HAVE_KVM_EVENTFD
172 struct { 179 struct {
173 spinlock_t lock; 180 spinlock_t lock;
@@ -249,13 +256,20 @@ int kvm_set_memory_region(struct kvm *kvm,
249int __kvm_set_memory_region(struct kvm *kvm, 256int __kvm_set_memory_region(struct kvm *kvm,
250 struct kvm_userspace_memory_region *mem, 257 struct kvm_userspace_memory_region *mem,
251 int user_alloc); 258 int user_alloc);
252int kvm_arch_set_memory_region(struct kvm *kvm, 259int kvm_arch_prepare_memory_region(struct kvm *kvm,
260 struct kvm_memory_slot *memslot,
261 struct kvm_memory_slot old,
262 struct kvm_userspace_memory_region *mem,
263 int user_alloc);
264void kvm_arch_commit_memory_region(struct kvm *kvm,
253 struct kvm_userspace_memory_region *mem, 265 struct kvm_userspace_memory_region *mem,
254 struct kvm_memory_slot old, 266 struct kvm_memory_slot old,
255 int user_alloc); 267 int user_alloc);
256void kvm_disable_largepages(void); 268void kvm_disable_largepages(void);
257void kvm_arch_flush_shadow(struct kvm *kvm); 269void kvm_arch_flush_shadow(struct kvm *kvm);
258gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); 270gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
271gfn_t unalias_gfn_instantiation(struct kvm *kvm, gfn_t gfn);
272
259struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); 273struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
260unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); 274unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
261void kvm_release_page_clean(struct page *page); 275void kvm_release_page_clean(struct page *page);
@@ -264,6 +278,9 @@ void kvm_set_page_dirty(struct page *page);
264void kvm_set_page_accessed(struct page *page); 278void kvm_set_page_accessed(struct page *page);
265 279
266pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn); 280pfn_t gfn_to_pfn(struct kvm *kvm, gfn_t gfn);
281pfn_t gfn_to_pfn_memslot(struct kvm *kvm,
282 struct kvm_memory_slot *slot, gfn_t gfn);
283int memslot_id(struct kvm *kvm, gfn_t gfn);
267void kvm_release_pfn_dirty(pfn_t); 284void kvm_release_pfn_dirty(pfn_t);
268void kvm_release_pfn_clean(pfn_t pfn); 285void kvm_release_pfn_clean(pfn_t pfn);
269void kvm_set_pfn_dirty(pfn_t pfn); 286void kvm_set_pfn_dirty(pfn_t pfn);
@@ -283,6 +300,7 @@ int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len);
283int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); 300int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len);
284struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); 301struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
285int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); 302int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
303unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn);
286void mark_page_dirty(struct kvm *kvm, gfn_t gfn); 304void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
287 305
288void kvm_vcpu_block(struct kvm_vcpu *vcpu); 306void kvm_vcpu_block(struct kvm_vcpu *vcpu);
@@ -383,6 +401,7 @@ struct kvm_assigned_dev_kernel {
383 struct work_struct interrupt_work; 401 struct work_struct interrupt_work;
384 struct list_head list; 402 struct list_head list;
385 int assigned_dev_id; 403 int assigned_dev_id;
404 int host_segnr;
386 int host_busnr; 405 int host_busnr;
387 int host_devfn; 406 int host_devfn;
388 unsigned int entries_nr; 407 unsigned int entries_nr;
@@ -429,8 +448,7 @@ void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id);
429#define KVM_IOMMU_CACHE_COHERENCY 0x1 448#define KVM_IOMMU_CACHE_COHERENCY 0x1
430 449
431#ifdef CONFIG_IOMMU_API 450#ifdef CONFIG_IOMMU_API
432int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, 451int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot);
433 unsigned long npages);
434int kvm_iommu_map_guest(struct kvm *kvm); 452int kvm_iommu_map_guest(struct kvm *kvm);
435int kvm_iommu_unmap_guest(struct kvm *kvm); 453int kvm_iommu_unmap_guest(struct kvm *kvm);
436int kvm_assign_device(struct kvm *kvm, 454int kvm_assign_device(struct kvm *kvm,
@@ -480,11 +498,6 @@ static inline void kvm_guest_exit(void)
480 current->flags &= ~PF_VCPU; 498 current->flags &= ~PF_VCPU;
481} 499}
482 500
483static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot)
484{
485 return slot - kvm->memslots;
486}
487
488static inline gpa_t gfn_to_gpa(gfn_t gfn) 501static inline gpa_t gfn_to_gpa(gfn_t gfn)
489{ 502{
490 return (gpa_t)gfn << PAGE_SHIFT; 503 return (gpa_t)gfn << PAGE_SHIFT;
@@ -532,6 +545,10 @@ static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_se
532} 545}
533#endif 546#endif
534 547
548#ifndef KVM_ARCH_HAS_UNALIAS_INSTANTIATION
549#define unalias_gfn_instantiation unalias_gfn
550#endif
551
535#ifdef CONFIG_HAVE_KVM_IRQCHIP 552#ifdef CONFIG_HAVE_KVM_IRQCHIP
536 553
537#define KVM_MAX_IRQ_ROUTES 1024 554#define KVM_MAX_IRQ_ROUTES 1024
diff --git a/include/linux/leds-lp3944.h b/include/linux/leds-lp3944.h
index afc9f9fd70f5..2618aa9063bc 100644
--- a/include/linux/leds-lp3944.h
+++ b/include/linux/leds-lp3944.h
@@ -12,9 +12,6 @@
12#ifndef __LINUX_LEDS_LP3944_H 12#ifndef __LINUX_LEDS_LP3944_H
13#define __LINUX_LEDS_LP3944_H 13#define __LINUX_LEDS_LP3944_H
14 14
15#include <linux/leds.h>
16#include <linux/workqueue.h>
17
18#define LP3944_LED0 0 15#define LP3944_LED0 0
19#define LP3944_LED1 1 16#define LP3944_LED1 1
20#define LP3944_LED2 2 17#define LP3944_LED2 2
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h
index 96eea90f01a8..f158eb1149aa 100644
--- a/include/linux/leds-pca9532.h
+++ b/include/linux/leds-pca9532.h
@@ -32,7 +32,7 @@ struct pca9532_led {
32 struct i2c_client *client; 32 struct i2c_client *client;
33 char *name; 33 char *name;
34 struct led_classdev ldev; 34 struct led_classdev ldev;
35 struct work_struct work; 35 struct work_struct work;
36 enum pca9532_type type; 36 enum pca9532_type type;
37 enum pca9532_state state; 37 enum pca9532_state state;
38}; 38};
diff --git a/include/linux/leds-regulator.h b/include/linux/leds-regulator.h
new file mode 100644
index 000000000000..5a8eb389aab8
--- /dev/null
+++ b/include/linux/leds-regulator.h
@@ -0,0 +1,46 @@
1/*
2 * leds-regulator.h - platform data structure for regulator driven LEDs.
3 *
4 * Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#ifndef __LINUX_LEDS_REGULATOR_H
13#define __LINUX_LEDS_REGULATOR_H
14
15/*
16 * Use "vled" as supply id when declaring the regulator consumer:
17 *
18 * static struct regulator_consumer_supply pcap_regulator_VVIB_consumers [] = {
19 * { .dev_name = "leds-regulator.0", supply = "vled" },
20 * };
21 *
22 * If you have several regulator driven LEDs, you can append a numerical id to
23 * .dev_name as done above, and use the same id when declaring the platform
24 * device:
25 *
26 * static struct led_regulator_platform_data a780_vibrator_data = {
27 * .name = "a780::vibrator",
28 * };
29 *
30 * static struct platform_device a780_vibrator = {
31 * .name = "leds-regulator",
32 * .id = 0,
33 * .dev = {
34 * .platform_data = &a780_vibrator_data,
35 * },
36 * };
37 */
38
39#include <linux/leds.h>
40
41struct led_regulator_platform_data {
42 char *name; /* LED name as expected by LED class */
43 enum led_brightness brightness; /* initial brightness value */
44};
45
46#endif /* __LINUX_LEDS_REGULATOR_H */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 6a9c4ddd3d95..f8ea71e6d0e2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -354,6 +354,9 @@ enum {
354 /* max tries if error condition is still set after ->error_handler */ 354 /* max tries if error condition is still set after ->error_handler */
355 ATA_EH_MAX_TRIES = 5, 355 ATA_EH_MAX_TRIES = 5,
356 356
357 /* sometimes resuming a link requires several retries */
358 ATA_LINK_RESUME_TRIES = 5,
359
357 /* how hard are we gonna try to probe/recover devices */ 360 /* how hard are we gonna try to probe/recover devices */
358 ATA_PROBE_MAX_TRIES = 3, 361 ATA_PROBE_MAX_TRIES = 3,
359 ATA_EH_DEV_TRIES = 3, 362 ATA_EH_DEV_TRIES = 3,
@@ -854,6 +857,7 @@ struct ata_port_operations {
854 unsigned int (*sff_data_xfer)(struct ata_device *dev, 857 unsigned int (*sff_data_xfer)(struct ata_device *dev,
855 unsigned char *buf, unsigned int buflen, int rw); 858 unsigned char *buf, unsigned int buflen, int rw);
856 u8 (*sff_irq_on)(struct ata_port *); 859 u8 (*sff_irq_on)(struct ata_port *);
860 bool (*sff_irq_check)(struct ata_port *);
857 void (*sff_irq_clear)(struct ata_port *); 861 void (*sff_irq_clear)(struct ata_port *);
858 862
859 void (*bmdma_setup)(struct ata_queued_cmd *qc); 863 void (*bmdma_setup)(struct ata_queued_cmd *qc);
@@ -1639,8 +1643,8 @@ extern int ata_pci_sff_activate_host(struct ata_host *host,
1639 irq_handler_t irq_handler, 1643 irq_handler_t irq_handler,
1640 struct scsi_host_template *sht); 1644 struct scsi_host_template *sht);
1641extern int ata_pci_sff_init_one(struct pci_dev *pdev, 1645extern int ata_pci_sff_init_one(struct pci_dev *pdev,
1642 const struct ata_port_info * const * ppi, 1646 const struct ata_port_info * const * ppi,
1643 struct scsi_host_template *sht, void *host_priv); 1647 struct scsi_host_template *sht, void *host_priv, int hflags);
1644#endif /* CONFIG_PCI */ 1648#endif /* CONFIG_PCI */
1645 1649
1646/** 1650/**
diff --git a/include/linux/list.h b/include/linux/list.h
index 969f6e92d089..8392884a2977 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -206,6 +206,20 @@ static inline int list_empty_careful(const struct list_head *head)
206} 206}
207 207
208/** 208/**
209 * list_rotate_left - rotate the list to the left
210 * @head: the head of the list
211 */
212static inline void list_rotate_left(struct list_head *head)
213{
214 struct list_head *first;
215
216 if (!list_empty(head)) {
217 first = head->next;
218 list_move_tail(first, head);
219 }
220}
221
222/**
209 * list_is_singular - tests whether a list has just one entry. 223 * list_is_singular - tests whether a list has just one entry.
210 * @head: the list to test. 224 * @head: the list to test.
211 */ 225 */
@@ -484,7 +498,7 @@ static inline void list_splice_tail_init(struct list_head *list,
484 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 498 pos = n, n = list_entry(n->member.next, typeof(*n), member))
485 499
486/** 500/**
487 * list_for_each_entry_safe_continue 501 * list_for_each_entry_safe_continue - continue list iteration safe against removal
488 * @pos: the type * to use as a loop cursor. 502 * @pos: the type * to use as a loop cursor.
489 * @n: another type * to use as temporary storage 503 * @n: another type * to use as temporary storage
490 * @head: the head for your list. 504 * @head: the head for your list.
@@ -500,7 +514,7 @@ static inline void list_splice_tail_init(struct list_head *list,
500 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 514 pos = n, n = list_entry(n->member.next, typeof(*n), member))
501 515
502/** 516/**
503 * list_for_each_entry_safe_from 517 * list_for_each_entry_safe_from - iterate over list from current point safe against removal
504 * @pos: the type * to use as a loop cursor. 518 * @pos: the type * to use as a loop cursor.
505 * @n: another type * to use as temporary storage 519 * @n: another type * to use as temporary storage
506 * @head: the head for your list. 520 * @head: the head for your list.
@@ -515,7 +529,7 @@ static inline void list_splice_tail_init(struct list_head *list,
515 pos = n, n = list_entry(n->member.next, typeof(*n), member)) 529 pos = n, n = list_entry(n->member.next, typeof(*n), member))
516 530
517/** 531/**
518 * list_for_each_entry_safe_reverse 532 * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal
519 * @pos: the type * to use as a loop cursor. 533 * @pos: the type * to use as a loop cursor.
520 * @n: another type * to use as temporary storage 534 * @n: another type * to use as temporary storage
521 * @head: the head for your list. 535 * @head: the head for your list.
diff --git a/include/linux/list_sort.h b/include/linux/list_sort.h
new file mode 100644
index 000000000000..1a2df2efb771
--- /dev/null
+++ b/include/linux/list_sort.h
@@ -0,0 +1,11 @@
1#ifndef _LINUX_LIST_SORT_H
2#define _LINUX_LIST_SORT_H
3
4#include <linux/types.h>
5
6struct list_head;
7
8void list_sort(void *priv, struct list_head *head,
9 int (*cmp)(void *priv, struct list_head *a,
10 struct list_head *b));
11#endif
diff --git a/include/linux/llc.h b/include/linux/llc.h
index 7733585603f1..ad7074ba81af 100644
--- a/include/linux/llc.h
+++ b/include/linux/llc.h
@@ -36,6 +36,7 @@ enum llc_sockopts {
36 LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */ 36 LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */
37 LLC_OPT_TX_WIN, /* tx window size. */ 37 LLC_OPT_TX_WIN, /* tx window size. */
38 LLC_OPT_RX_WIN, /* rx window size. */ 38 LLC_OPT_RX_WIN, /* rx window size. */
39 LLC_OPT_PKTINFO, /* ancillary packet information. */
39 LLC_OPT_MAX 40 LLC_OPT_MAX
40}; 41};
41 42
@@ -70,6 +71,12 @@ enum llc_sockopts {
70#define LLC_SAP_RM 0xD4 /* Resource Management */ 71#define LLC_SAP_RM 0xD4 /* Resource Management */
71#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */ 72#define LLC_SAP_GLOBAL 0xFF /* Global SAP. */
72 73
74struct llc_pktinfo {
75 int lpi_ifindex;
76 unsigned char lpi_sap;
77 unsigned char lpi_mac[IFHWADDRLEN];
78};
79
73#ifdef __KERNEL__ 80#ifdef __KERNEL__
74#define LLC_SAP_DYN_START 0xC0 81#define LLC_SAP_DYN_START 0xC0
75#define LLC_SAP_DYN_STOP 0xDE 82#define LLC_SAP_DYN_STOP 0xDE
diff --git a/include/linux/lmb.h b/include/linux/lmb.h
index 2442e3f3d033..f3d14333ebed 100644
--- a/include/linux/lmb.h
+++ b/include/linux/lmb.h
@@ -42,6 +42,7 @@ extern void __init lmb_init(void);
42extern void __init lmb_analyze(void); 42extern void __init lmb_analyze(void);
43extern long lmb_add(u64 base, u64 size); 43extern long lmb_add(u64 base, u64 size);
44extern long lmb_remove(u64 base, u64 size); 44extern long lmb_remove(u64 base, u64 size);
45extern long __init lmb_free(u64 base, u64 size);
45extern long __init lmb_reserve(u64 base, u64 size); 46extern long __init lmb_reserve(u64 base, u64 size);
46extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid, 47extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid,
47 u64 (*nid_range)(u64, u64, int *)); 48 u64 (*nid_range)(u64, u64, int *));
@@ -54,6 +55,7 @@ extern u64 __init lmb_phys_mem_size(void);
54extern u64 lmb_end_of_DRAM(void); 55extern u64 lmb_end_of_DRAM(void);
55extern void __init lmb_enforce_memory_limit(u64 memory_limit); 56extern void __init lmb_enforce_memory_limit(u64 memory_limit);
56extern int __init lmb_is_reserved(u64 addr); 57extern int __init lmb_is_reserved(u64 addr);
58extern int lmb_is_region_reserved(u64 base, u64 size);
57extern int lmb_find(struct lmb_property *res); 59extern int lmb_find(struct lmb_property *res);
58 60
59extern void lmb_dump_all(void); 61extern void lmb_dump_all(void);
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 9ccf0e286b2a..a03977a96d7e 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -12,6 +12,10 @@
12struct task_struct; 12struct task_struct;
13struct lockdep_map; 13struct lockdep_map;
14 14
15/* for sysctl */
16extern int prove_locking;
17extern int lock_stat;
18
15#ifdef CONFIG_LOCKDEP 19#ifdef CONFIG_LOCKDEP
16 20
17#include <linux/linkage.h> 21#include <linux/linkage.h>
@@ -534,4 +538,8 @@ do { \
534# define might_lock_read(lock) do { } while (0) 538# define might_lock_read(lock) do { } while (0)
535#endif 539#endif
536 540
541#ifdef CONFIG_PROVE_RCU
542extern void lockdep_rcu_dereference(const char *file, const int line);
543#endif
544
537#endif /* __LINUX_LOCKDEP_H */ 545#endif /* __LINUX_LOCKDEP_H */
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h
index 3a2b2d9b0472..de48d167568b 100644
--- a/include/linux/lru_cache.h
+++ b/include/linux/lru_cache.h
@@ -64,7 +64,7 @@ For crash recovery after replication node failure,
64 usually the condition is softened to regions that _may_ have been target of 64 usually the condition is softened to regions that _may_ have been target of
65 in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent 65 in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent
66 bitmap, trading frequency of meta data transactions against amount of 66 bitmap, trading frequency of meta data transactions against amount of
67 (possibly unneccessary) resync traffic. 67 (possibly unnecessary) resync traffic.
68 68
69 If we set a hard limit on the area that may be "hot" at any given time, we 69 If we set a hard limit on the area that may be "hot" at any given time, we
70 limit the amount of resync traffic needed for crash recovery. 70 limit the amount of resync traffic needed for crash recovery.
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 76285e01b39e..eb9800f05782 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -52,7 +52,6 @@
52#define CGROUP_SUPER_MAGIC 0x27e0eb 52#define CGROUP_SUPER_MAGIC 0x27e0eb
53 53
54#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA 54#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
55#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
56 55
57#define STACK_END_MAGIC 0x57AC6E9D 56#define STACK_END_MAGIC 0x57AC6E9D
58 57
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 0b46c2068b96..44301c6affa8 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -73,6 +73,7 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
73extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 73extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
74int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 74int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
75 75
76extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
76extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); 77extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
77 78
78static inline 79static inline
@@ -85,6 +86,8 @@ int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
85 return cgroup == mem; 86 return cgroup == mem;
86} 87}
87 88
89extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem);
90
88extern int 91extern int
89mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); 92mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr);
90extern void mem_cgroup_end_migration(struct mem_cgroup *mem, 93extern void mem_cgroup_end_migration(struct mem_cgroup *mem,
@@ -121,7 +124,6 @@ static inline bool mem_cgroup_disabled(void)
121 return false; 124 return false;
122} 125}
123 126
124extern bool mem_cgroup_oom_called(struct task_struct *task);
125void mem_cgroup_update_file_mapped(struct page *page, int val); 127void mem_cgroup_update_file_mapped(struct page *page, int val);
126unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, 128unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
127 gfp_t gfp_mask, int nid, 129 gfp_t gfp_mask, int nid,
@@ -202,6 +204,11 @@ mem_cgroup_move_lists(struct page *page, enum lru_list from, enum lru_list to)
202{ 204{
203} 205}
204 206
207static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page)
208{
209 return NULL;
210}
211
205static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) 212static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem)
206{ 213{
207 return 1; 214 return 1;
@@ -213,6 +220,11 @@ static inline int task_in_mem_cgroup(struct task_struct *task,
213 return 1; 220 return 1;
214} 221}
215 222
223static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem)
224{
225 return NULL;
226}
227
216static inline int 228static inline int
217mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr) 229mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr)
218{ 230{
@@ -245,11 +257,6 @@ static inline bool mem_cgroup_disabled(void)
245 return true; 257 return true;
246} 258}
247 259
248static inline bool mem_cgroup_oom_called(struct task_struct *task)
249{
250 return false;
251}
252
253static inline int 260static inline int
254mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) 261mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg)
255{ 262{
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 37fa19b34ef5..85582e1bcee9 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -36,6 +36,8 @@ struct memory_block {
36 struct sys_device sysdev; 36 struct sys_device sysdev;
37}; 37};
38 38
39int arch_get_memory_phys_device(unsigned long start_pfn);
40
39/* These states are exposed to userspace as text strings in sysfs */ 41/* These states are exposed to userspace as text strings in sysfs */
40#define MEM_ONLINE (1<<0) /* exposed to userspace */ 42#define MEM_ONLINE (1<<0) /* exposed to userspace */
41#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */ 43#define MEM_GOING_OFFLINE (1<<1) /* exposed to userspace */
@@ -50,6 +52,19 @@ struct memory_notify {
50 int status_change_nid; 52 int status_change_nid;
51}; 53};
52 54
55/*
56 * During pageblock isolation, count the number of pages within the
57 * range [start_pfn, start_pfn + nr_pages) which are owned by code
58 * in the notifier chain.
59 */
60#define MEM_ISOLATE_COUNT (1<<0)
61
62struct memory_isolate_notify {
63 unsigned long start_pfn; /* Start of range to check */
64 unsigned int nr_pages; /* # pages in range to check */
65 unsigned int pages_found; /* # pages owned found by callbacks */
66};
67
53struct notifier_block; 68struct notifier_block;
54struct mem_section; 69struct mem_section;
55 70
@@ -76,14 +91,28 @@ static inline int memory_notify(unsigned long val, void *v)
76{ 91{
77 return 0; 92 return 0;
78} 93}
94static inline int register_memory_isolate_notifier(struct notifier_block *nb)
95{
96 return 0;
97}
98static inline void unregister_memory_isolate_notifier(struct notifier_block *nb)
99{
100}
101static inline int memory_isolate_notify(unsigned long val, void *v)
102{
103 return 0;
104}
79#else 105#else
80extern int register_memory_notifier(struct notifier_block *nb); 106extern int register_memory_notifier(struct notifier_block *nb);
81extern void unregister_memory_notifier(struct notifier_block *nb); 107extern void unregister_memory_notifier(struct notifier_block *nb);
108extern int register_memory_isolate_notifier(struct notifier_block *nb);
109extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
82extern int register_new_memory(int, struct mem_section *); 110extern int register_new_memory(int, struct mem_section *);
83extern int unregister_memory_section(struct mem_section *); 111extern int unregister_memory_section(struct mem_section *);
84extern int memory_dev_init(void); 112extern int memory_dev_init(void);
85extern int remove_memory_block(unsigned long, struct mem_section *, int); 113extern int remove_memory_block(unsigned long, struct mem_section *, int);
86extern int memory_notify(unsigned long val, void *v); 114extern int memory_notify(unsigned long val, void *v);
115extern int memory_isolate_notify(unsigned long val, void *v);
87extern struct memory_block *find_memory_block(struct mem_section *); 116extern struct memory_block *find_memory_block(struct mem_section *);
88#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) 117#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
89enum mem_add_context { BOOT, HOTPLUG }; 118enum mem_add_context { BOOT, HOTPLUG };
diff --git a/include/linux/mfd/88pm8607.h b/include/linux/mfd/88pm8607.h
deleted file mode 100644
index f41b428d2cec..000000000000
--- a/include/linux/mfd/88pm8607.h
+++ /dev/null
@@ -1,217 +0,0 @@
1/*
2 * Marvell 88PM8607 Interface
3 *
4 * Copyright (C) 2009 Marvell International Ltd.
5 * Haojian Zhuang <haojian.zhuang@marvell.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_MFD_88PM8607_H
13#define __LINUX_MFD_88PM8607_H
14
15enum {
16 PM8607_ID_BUCK1 = 0,
17 PM8607_ID_BUCK2,
18 PM8607_ID_BUCK3,
19
20 PM8607_ID_LDO1,
21 PM8607_ID_LDO2,
22 PM8607_ID_LDO3,
23 PM8607_ID_LDO4,
24 PM8607_ID_LDO5,
25 PM8607_ID_LDO6,
26 PM8607_ID_LDO7,
27 PM8607_ID_LDO8,
28 PM8607_ID_LDO9,
29 PM8607_ID_LDO10,
30 PM8607_ID_LDO12,
31 PM8607_ID_LDO14,
32
33 PM8607_ID_RG_MAX,
34};
35
36#define CHIP_ID (0x40)
37#define CHIP_ID_MASK (0xF8)
38
39/* Interrupt Registers */
40#define PM8607_STATUS_1 (0x01)
41#define PM8607_STATUS_2 (0x02)
42#define PM8607_INT_STATUS1 (0x03)
43#define PM8607_INT_STATUS2 (0x04)
44#define PM8607_INT_STATUS3 (0x05)
45#define PM8607_INT_MASK_1 (0x06)
46#define PM8607_INT_MASK_2 (0x07)
47#define PM8607_INT_MASK_3 (0x08)
48
49/* Regulator Control Registers */
50#define PM8607_LDO1 (0x10)
51#define PM8607_LDO2 (0x11)
52#define PM8607_LDO3 (0x12)
53#define PM8607_LDO4 (0x13)
54#define PM8607_LDO5 (0x14)
55#define PM8607_LDO6 (0x15)
56#define PM8607_LDO7 (0x16)
57#define PM8607_LDO8 (0x17)
58#define PM8607_LDO9 (0x18)
59#define PM8607_LDO10 (0x19)
60#define PM8607_LDO12 (0x1A)
61#define PM8607_LDO14 (0x1B)
62#define PM8607_SLEEP_MODE1 (0x1C)
63#define PM8607_SLEEP_MODE2 (0x1D)
64#define PM8607_SLEEP_MODE3 (0x1E)
65#define PM8607_SLEEP_MODE4 (0x1F)
66#define PM8607_GO (0x20)
67#define PM8607_SLEEP_BUCK1 (0x21)
68#define PM8607_SLEEP_BUCK2 (0x22)
69#define PM8607_SLEEP_BUCK3 (0x23)
70#define PM8607_BUCK1 (0x24)
71#define PM8607_BUCK2 (0x25)
72#define PM8607_BUCK3 (0x26)
73#define PM8607_BUCK_CONTROLS (0x27)
74#define PM8607_SUPPLIES_EN11 (0x2B)
75#define PM8607_SUPPLIES_EN12 (0x2C)
76#define PM8607_GROUP1 (0x2D)
77#define PM8607_GROUP2 (0x2E)
78#define PM8607_GROUP3 (0x2F)
79#define PM8607_GROUP4 (0x30)
80#define PM8607_GROUP5 (0x31)
81#define PM8607_GROUP6 (0x32)
82#define PM8607_SUPPLIES_EN21 (0x33)
83#define PM8607_SUPPLIES_EN22 (0x34)
84
85/* RTC Control Registers */
86#define PM8607_RTC1 (0xA0)
87#define PM8607_RTC_COUNTER1 (0xA1)
88#define PM8607_RTC_COUNTER2 (0xA2)
89#define PM8607_RTC_COUNTER3 (0xA3)
90#define PM8607_RTC_COUNTER4 (0xA4)
91#define PM8607_RTC_EXPIRE1 (0xA5)
92#define PM8607_RTC_EXPIRE2 (0xA6)
93#define PM8607_RTC_EXPIRE3 (0xA7)
94#define PM8607_RTC_EXPIRE4 (0xA8)
95#define PM8607_RTC_TRIM1 (0xA9)
96#define PM8607_RTC_TRIM2 (0xAA)
97#define PM8607_RTC_TRIM3 (0xAB)
98#define PM8607_RTC_TRIM4 (0xAC)
99#define PM8607_RTC_MISC1 (0xAD)
100#define PM8607_RTC_MISC2 (0xAE)
101#define PM8607_RTC_MISC3 (0xAF)
102
103/* Misc Registers */
104#define PM8607_CHIP_ID (0x00)
105#define PM8607_LDO1 (0x10)
106#define PM8607_DVC3 (0x26)
107#define PM8607_MISC1 (0x40)
108
109/* bit definitions for PM8607 events */
110#define PM8607_EVENT_ONKEY (1 << 0)
111#define PM8607_EVENT_EXTON (1 << 1)
112#define PM8607_EVENT_CHG (1 << 2)
113#define PM8607_EVENT_BAT (1 << 3)
114#define PM8607_EVENT_RTC (1 << 4)
115#define PM8607_EVENT_CC (1 << 5)
116#define PM8607_EVENT_VBAT (1 << 8)
117#define PM8607_EVENT_VCHG (1 << 9)
118#define PM8607_EVENT_VSYS (1 << 10)
119#define PM8607_EVENT_TINT (1 << 11)
120#define PM8607_EVENT_GPADC0 (1 << 12)
121#define PM8607_EVENT_GPADC1 (1 << 13)
122#define PM8607_EVENT_GPADC2 (1 << 14)
123#define PM8607_EVENT_GPADC3 (1 << 15)
124#define PM8607_EVENT_AUDIO_SHORT (1 << 16)
125#define PM8607_EVENT_PEN (1 << 17)
126#define PM8607_EVENT_HEADSET (1 << 18)
127#define PM8607_EVENT_HOOK (1 << 19)
128#define PM8607_EVENT_MICIN (1 << 20)
129#define PM8607_EVENT_CHG_TIMEOUT (1 << 21)
130#define PM8607_EVENT_CHG_DONE (1 << 22)
131#define PM8607_EVENT_CHG_FAULT (1 << 23)
132
133/* bit definitions of Status Query Interface */
134#define PM8607_STATUS_CC (1 << 3)
135#define PM8607_STATUS_PEN (1 << 4)
136#define PM8607_STATUS_HEADSET (1 << 5)
137#define PM8607_STATUS_HOOK (1 << 6)
138#define PM8607_STATUS_MICIN (1 << 7)
139#define PM8607_STATUS_ONKEY (1 << 8)
140#define PM8607_STATUS_EXTON (1 << 9)
141#define PM8607_STATUS_CHG (1 << 10)
142#define PM8607_STATUS_BAT (1 << 11)
143#define PM8607_STATUS_VBUS (1 << 12)
144#define PM8607_STATUS_OV (1 << 13)
145
146/* bit definitions of BUCK3 */
147#define PM8607_BUCK3_DOUBLE (1 << 6)
148
149/* bit definitions of Misc1 */
150#define PM8607_MISC1_PI2C (1 << 0)
151
152/* Interrupt Number in 88PM8607 */
153enum {
154 PM8607_IRQ_ONKEY = 0,
155 PM8607_IRQ_EXTON,
156 PM8607_IRQ_CHG,
157 PM8607_IRQ_BAT,
158 PM8607_IRQ_RTC,
159 PM8607_IRQ_VBAT = 8,
160 PM8607_IRQ_VCHG,
161 PM8607_IRQ_VSYS,
162 PM8607_IRQ_TINT,
163 PM8607_IRQ_GPADC0,
164 PM8607_IRQ_GPADC1,
165 PM8607_IRQ_GPADC2,
166 PM8607_IRQ_GPADC3,
167 PM8607_IRQ_AUDIO_SHORT = 16,
168 PM8607_IRQ_PEN,
169 PM8607_IRQ_HEADSET,
170 PM8607_IRQ_HOOK,
171 PM8607_IRQ_MICIN,
172 PM8607_IRQ_CHG_FAIL,
173 PM8607_IRQ_CHG_DONE,
174 PM8607_IRQ_CHG_FAULT,
175};
176
177enum {
178 PM8607_CHIP_A0 = 0x40,
179 PM8607_CHIP_A1 = 0x41,
180 PM8607_CHIP_B0 = 0x48,
181};
182
183
184struct pm8607_chip {
185 struct device *dev;
186 struct mutex io_lock;
187 struct i2c_client *client;
188
189 int (*read)(struct pm8607_chip *chip, int reg, int bytes, void *dest);
190 int (*write)(struct pm8607_chip *chip, int reg, int bytes, void *src);
191
192 int buck3_double; /* DVC ramp slope double */
193 unsigned char chip_id;
194
195};
196
197#define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */
198
199enum {
200 GI2C_PORT = 0,
201 PI2C_PORT,
202};
203
204struct pm8607_platform_data {
205 int i2c_port; /* Controlled by GI2C or PI2C */
206 struct regulator_init_data *regulator[PM8607_MAX_REGULATOR];
207};
208
209extern int pm8607_reg_read(struct pm8607_chip *, int);
210extern int pm8607_reg_write(struct pm8607_chip *, int, unsigned char);
211extern int pm8607_bulk_read(struct pm8607_chip *, int, int,
212 unsigned char *);
213extern int pm8607_bulk_write(struct pm8607_chip *, int, int,
214 unsigned char *);
215extern int pm8607_set_bits(struct pm8607_chip *, int, unsigned char,
216 unsigned char);
217#endif /* __LINUX_MFD_88PM8607_H */
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
new file mode 100644
index 000000000000..73f92c5feea2
--- /dev/null
+++ b/include/linux/mfd/88pm860x.h
@@ -0,0 +1,375 @@
1/*
2 * Marvell 88PM860x Interface
3 *
4 * Copyright (C) 2009 Marvell International Ltd.
5 * Haojian Zhuang <haojian.zhuang@marvell.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_MFD_88PM860X_H
13#define __LINUX_MFD_88PM860X_H
14
15#include <linux/interrupt.h>
16
17#define MFD_NAME_SIZE (40)
18
19enum {
20 CHIP_INVALID = 0,
21 CHIP_PM8606,
22 CHIP_PM8607,
23 CHIP_MAX,
24};
25
26enum {
27 PM8606_ID_INVALID,
28 PM8606_ID_BACKLIGHT,
29 PM8606_ID_LED,
30 PM8606_ID_VIBRATOR,
31 PM8606_ID_TOUCH,
32 PM8606_ID_SOUND,
33 PM8606_ID_CHARGER,
34 PM8606_ID_MAX,
35};
36
37enum {
38 PM8606_BACKLIGHT1 = 0,
39 PM8606_BACKLIGHT2,
40 PM8606_BACKLIGHT3,
41};
42
43enum {
44 PM8606_LED1_RED = 0,
45 PM8606_LED1_GREEN,
46 PM8606_LED1_BLUE,
47 PM8606_LED2_RED,
48 PM8606_LED2_GREEN,
49 PM8606_LED2_BLUE,
50 PM8607_LED_VIBRATOR,
51};
52
53
54/* 8606 Registers */
55#define PM8606_DCM_BOOST (0x00)
56#define PM8606_PWM (0x01)
57
58/* Backlight Registers */
59#define PM8606_WLED1A (0x02)
60#define PM8606_WLED1B (0x03)
61#define PM8606_WLED2A (0x04)
62#define PM8606_WLED2B (0x05)
63#define PM8606_WLED3A (0x06)
64#define PM8606_WLED3B (0x07)
65
66/* LED Registers */
67#define PM8606_RGB2A (0x08)
68#define PM8606_RGB2B (0x09)
69#define PM8606_RGB2C (0x0A)
70#define PM8606_RGB2D (0x0B)
71#define PM8606_RGB1A (0x0C)
72#define PM8606_RGB1B (0x0D)
73#define PM8606_RGB1C (0x0E)
74#define PM8606_RGB1D (0x0F)
75
76#define PM8606_PREREGULATORA (0x10)
77#define PM8606_PREREGULATORB (0x11)
78#define PM8606_VIBRATORA (0x12)
79#define PM8606_VIBRATORB (0x13)
80#define PM8606_VCHG (0x14)
81#define PM8606_VSYS (0x15)
82#define PM8606_MISC (0x16)
83#define PM8606_CHIP_ID (0x17)
84#define PM8606_STATUS (0x18)
85#define PM8606_FLAGS (0x19)
86#define PM8606_PROTECTA (0x1A)
87#define PM8606_PROTECTB (0x1B)
88#define PM8606_PROTECTC (0x1C)
89
90/* Bit definitions of PM8606 registers */
91#define PM8606_DCM_500MA (0x0) /* current limit */
92#define PM8606_DCM_750MA (0x1)
93#define PM8606_DCM_1000MA (0x2)
94#define PM8606_DCM_1250MA (0x3)
95#define PM8606_DCM_250MV (0x0 << 2)
96#define PM8606_DCM_300MV (0x1 << 2)
97#define PM8606_DCM_350MV (0x2 << 2)
98#define PM8606_DCM_400MV (0x3 << 2)
99
100#define PM8606_PWM_31200HZ (0x0)
101#define PM8606_PWM_15600HZ (0x1)
102#define PM8606_PWM_7800HZ (0x2)
103#define PM8606_PWM_3900HZ (0x3)
104#define PM8606_PWM_1950HZ (0x4)
105#define PM8606_PWM_976HZ (0x5)
106#define PM8606_PWM_488HZ (0x6)
107#define PM8606_PWM_244HZ (0x7)
108#define PM8606_PWM_FREQ_MASK (0x7)
109
110#define PM8606_WLED_ON (1 << 0)
111#define PM8606_WLED_CURRENT(x) ((x & 0x1F) << 1)
112
113#define PM8606_LED_CURRENT(x) (((x >> 2) & 0x07) << 5)
114
115#define PM8606_VSYS_EN (1 << 1)
116
117#define PM8606_MISC_OSC_EN (1 << 4)
118
119enum {
120 PM8607_ID_BUCK1 = 0,
121 PM8607_ID_BUCK2,
122 PM8607_ID_BUCK3,
123
124 PM8607_ID_LDO1,
125 PM8607_ID_LDO2,
126 PM8607_ID_LDO3,
127 PM8607_ID_LDO4,
128 PM8607_ID_LDO5,
129 PM8607_ID_LDO6,
130 PM8607_ID_LDO7,
131 PM8607_ID_LDO8,
132 PM8607_ID_LDO9,
133 PM8607_ID_LDO10,
134 PM8607_ID_LDO12,
135 PM8607_ID_LDO14,
136
137 PM8607_ID_RG_MAX,
138};
139
140#define PM8607_VERSION (0x40) /* 8607 chip ID */
141#define PM8607_VERSION_MASK (0xF0) /* 8607 chip ID mask */
142
143/* Interrupt Registers */
144#define PM8607_STATUS_1 (0x01)
145#define PM8607_STATUS_2 (0x02)
146#define PM8607_INT_STATUS1 (0x03)
147#define PM8607_INT_STATUS2 (0x04)
148#define PM8607_INT_STATUS3 (0x05)
149#define PM8607_INT_MASK_1 (0x06)
150#define PM8607_INT_MASK_2 (0x07)
151#define PM8607_INT_MASK_3 (0x08)
152
153/* Regulator Control Registers */
154#define PM8607_LDO1 (0x10)
155#define PM8607_LDO2 (0x11)
156#define PM8607_LDO3 (0x12)
157#define PM8607_LDO4 (0x13)
158#define PM8607_LDO5 (0x14)
159#define PM8607_LDO6 (0x15)
160#define PM8607_LDO7 (0x16)
161#define PM8607_LDO8 (0x17)
162#define PM8607_LDO9 (0x18)
163#define PM8607_LDO10 (0x19)
164#define PM8607_LDO12 (0x1A)
165#define PM8607_LDO14 (0x1B)
166#define PM8607_SLEEP_MODE1 (0x1C)
167#define PM8607_SLEEP_MODE2 (0x1D)
168#define PM8607_SLEEP_MODE3 (0x1E)
169#define PM8607_SLEEP_MODE4 (0x1F)
170#define PM8607_GO (0x20)
171#define PM8607_SLEEP_BUCK1 (0x21)
172#define PM8607_SLEEP_BUCK2 (0x22)
173#define PM8607_SLEEP_BUCK3 (0x23)
174#define PM8607_BUCK1 (0x24)
175#define PM8607_BUCK2 (0x25)
176#define PM8607_BUCK3 (0x26)
177#define PM8607_BUCK_CONTROLS (0x27)
178#define PM8607_SUPPLIES_EN11 (0x2B)
179#define PM8607_SUPPLIES_EN12 (0x2C)
180#define PM8607_GROUP1 (0x2D)
181#define PM8607_GROUP2 (0x2E)
182#define PM8607_GROUP3 (0x2F)
183#define PM8607_GROUP4 (0x30)
184#define PM8607_GROUP5 (0x31)
185#define PM8607_GROUP6 (0x32)
186#define PM8607_SUPPLIES_EN21 (0x33)
187#define PM8607_SUPPLIES_EN22 (0x34)
188
189/* Vibrator Control Registers */
190#define PM8607_VIBRATOR_SET (0x28)
191#define PM8607_VIBRATOR_PWM (0x29)
192
193/* GPADC Registers */
194#define PM8607_GP_BIAS1 (0x4F)
195#define PM8607_MEAS_EN1 (0x50)
196#define PM8607_MEAS_EN2 (0x51)
197#define PM8607_MEAS_EN3 (0x52)
198#define PM8607_MEAS_OFF_TIME1 (0x53)
199#define PM8607_MEAS_OFF_TIME2 (0x54)
200#define PM8607_TSI_PREBIAS (0x55) /* prebias time */
201#define PM8607_PD_PREBIAS (0x56) /* prebias time */
202#define PM8607_GPADC_MISC1 (0x57)
203
204/* RTC Control Registers */
205#define PM8607_RTC1 (0xA0)
206#define PM8607_RTC_COUNTER1 (0xA1)
207#define PM8607_RTC_COUNTER2 (0xA2)
208#define PM8607_RTC_COUNTER3 (0xA3)
209#define PM8607_RTC_COUNTER4 (0xA4)
210#define PM8607_RTC_EXPIRE1 (0xA5)
211#define PM8607_RTC_EXPIRE2 (0xA6)
212#define PM8607_RTC_EXPIRE3 (0xA7)
213#define PM8607_RTC_EXPIRE4 (0xA8)
214#define PM8607_RTC_TRIM1 (0xA9)
215#define PM8607_RTC_TRIM2 (0xAA)
216#define PM8607_RTC_TRIM3 (0xAB)
217#define PM8607_RTC_TRIM4 (0xAC)
218#define PM8607_RTC_MISC1 (0xAD)
219#define PM8607_RTC_MISC2 (0xAE)
220#define PM8607_RTC_MISC3 (0xAF)
221
222/* Misc Registers */
223#define PM8607_CHIP_ID (0x00)
224#define PM8607_B0_MISC1 (0x0C)
225#define PM8607_LDO1 (0x10)
226#define PM8607_DVC3 (0x26)
227#define PM8607_A1_MISC1 (0x40)
228
229/* bit definitions of Status Query Interface */
230#define PM8607_STATUS_CC (1 << 3)
231#define PM8607_STATUS_PEN (1 << 4)
232#define PM8607_STATUS_HEADSET (1 << 5)
233#define PM8607_STATUS_HOOK (1 << 6)
234#define PM8607_STATUS_MICIN (1 << 7)
235#define PM8607_STATUS_ONKEY (1 << 8)
236#define PM8607_STATUS_EXTON (1 << 9)
237#define PM8607_STATUS_CHG (1 << 10)
238#define PM8607_STATUS_BAT (1 << 11)
239#define PM8607_STATUS_VBUS (1 << 12)
240#define PM8607_STATUS_OV (1 << 13)
241
242/* bit definitions of BUCK3 */
243#define PM8607_BUCK3_DOUBLE (1 << 6)
244
245/* bit definitions of Misc1 */
246#define PM8607_A1_MISC1_PI2C (1 << 0)
247#define PM8607_B0_MISC1_INV_INT (1 << 0)
248#define PM8607_B0_MISC1_INT_CLEAR (1 << 1)
249#define PM8607_B0_MISC1_INT_MASK (1 << 2)
250#define PM8607_B0_MISC1_PI2C (1 << 3)
251#define PM8607_B0_MISC1_RESET (1 << 6)
252
253/* bits definitions of GPADC */
254#define PM8607_GPADC_EN (1 << 0)
255#define PM8607_GPADC_PREBIAS_MASK (3 << 1)
256#define PM8607_GPADC_SLOT_CYCLE_MASK (3 << 3) /* slow mode */
257#define PM8607_GPADC_OFF_SCALE_MASK (3 << 5) /* GP sleep mode */
258#define PM8607_GPADC_SW_CAL_MASK (1 << 7)
259
260#define PM8607_PD_PREBIAS_MASK (0x1F << 0)
261#define PM8607_PD_PRECHG_MASK (7 << 5)
262
263/* Interrupt Number in 88PM8607 */
264enum {
265 PM8607_IRQ_ONKEY,
266 PM8607_IRQ_EXTON,
267 PM8607_IRQ_CHG,
268 PM8607_IRQ_BAT,
269 PM8607_IRQ_RTC,
270 PM8607_IRQ_CC,
271 PM8607_IRQ_VBAT,
272 PM8607_IRQ_VCHG,
273 PM8607_IRQ_VSYS,
274 PM8607_IRQ_TINT,
275 PM8607_IRQ_GPADC0,
276 PM8607_IRQ_GPADC1,
277 PM8607_IRQ_GPADC2,
278 PM8607_IRQ_GPADC3,
279 PM8607_IRQ_AUDIO_SHORT,
280 PM8607_IRQ_PEN,
281 PM8607_IRQ_HEADSET,
282 PM8607_IRQ_HOOK,
283 PM8607_IRQ_MICIN,
284 PM8607_IRQ_CHG_FAIL,
285 PM8607_IRQ_CHG_DONE,
286 PM8607_IRQ_CHG_FAULT,
287};
288
289enum {
290 PM8607_CHIP_A0 = 0x40,
291 PM8607_CHIP_A1 = 0x41,
292 PM8607_CHIP_B0 = 0x48,
293};
294
295struct pm860x_chip {
296 struct device *dev;
297 struct mutex io_lock;
298 struct mutex irq_lock;
299 struct i2c_client *client;
300 struct i2c_client *companion; /* companion chip client */
301
302 int buck3_double; /* DVC ramp slope double */
303 unsigned short companion_addr;
304 int id;
305 int irq_mode;
306 int irq_base;
307 int core_irq;
308 unsigned char chip_version;
309
310};
311
312#define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */
313
314enum {
315 GI2C_PORT = 0,
316 PI2C_PORT,
317};
318
319struct pm860x_backlight_pdata {
320 int id;
321 int pwm;
322 int iset;
323 unsigned long flags;
324};
325
326struct pm860x_led_pdata {
327 int id;
328 int iset;
329 unsigned long flags;
330};
331
332struct pm860x_touch_pdata {
333 int gpadc_prebias;
334 int slot_cycle;
335 int off_scale;
336 int sw_cal;
337 int tsi_prebias; /* time, slot */
338 int pen_prebias; /* time, slot */
339 int pen_prechg; /* time, slot */
340 int res_x; /* resistor of Xplate */
341 unsigned long flags;
342};
343
344struct pm860x_power_pdata {
345 unsigned fast_charge; /* charge current */
346};
347
348struct pm860x_platform_data {
349 struct pm860x_backlight_pdata *backlight;
350 struct pm860x_led_pdata *led;
351 struct pm860x_touch_pdata *touch;
352 struct pm860x_power_pdata *power;
353
354 unsigned short companion_addr; /* I2C address of companion chip */
355 int i2c_port; /* Controlled by GI2C or PI2C */
356 int irq_mode; /* Clear interrupt by read/write(0/1) */
357 int irq_base; /* IRQ base number of 88pm860x */
358 struct regulator_init_data *regulator[PM8607_MAX_REGULATOR];
359};
360
361extern char pm860x_backlight_name[][MFD_NAME_SIZE];
362extern char pm860x_led_name[][MFD_NAME_SIZE];
363
364extern int pm860x_reg_read(struct i2c_client *, int);
365extern int pm860x_reg_write(struct i2c_client *, int, unsigned char);
366extern int pm860x_bulk_read(struct i2c_client *, int, int, unsigned char *);
367extern int pm860x_bulk_write(struct i2c_client *, int, int, unsigned char *);
368extern int pm860x_set_bits(struct i2c_client *, int, unsigned char,
369 unsigned char);
370
371extern int pm860x_device_init(struct pm860x_chip *chip,
372 struct pm860x_platform_data *pdata);
373extern void pm860x_device_exit(struct pm860x_chip *chip);
374
375#endif /* __LINUX_MFD_88PM860X_H */
diff --git a/include/linux/mfd/ab3100.h b/include/linux/mfd/ab3100.h
index e9aa4c9d749d..9a881c305a50 100644
--- a/include/linux/mfd/ab3100.h
+++ b/include/linux/mfd/ab3100.h
@@ -6,7 +6,6 @@
6 */ 6 */
7 7
8#include <linux/device.h> 8#include <linux/device.h>
9#include <linux/workqueue.h>
10#include <linux/regulator/machine.h> 9#include <linux/regulator/machine.h>
11 10
12#ifndef MFD_AB3100_H 11#ifndef MFD_AB3100_H
@@ -74,7 +73,6 @@
74 * @testreg_client: secondary client for test registers 73 * @testreg_client: secondary client for test registers
75 * @chip_name: name of this chip variant 74 * @chip_name: name of this chip variant
76 * @chip_id: 8 bit chip ID for this chip variant 75 * @chip_id: 8 bit chip ID for this chip variant
77 * @work: an event handling worker
78 * @event_subscribers: event subscribers are listed here 76 * @event_subscribers: event subscribers are listed here
79 * @startup_events: a copy of the first reading of the event registers 77 * @startup_events: a copy of the first reading of the event registers
80 * @startup_events_read: whether the first events have been read 78 * @startup_events_read: whether the first events have been read
@@ -90,7 +88,6 @@ struct ab3100 {
90 struct i2c_client *testreg_client; 88 struct i2c_client *testreg_client;
91 char chip_name[32]; 89 char chip_name[32];
92 u8 chip_id; 90 u8 chip_id;
93 struct work_struct work;
94 struct blocking_notifier_head event_subscribers; 91 struct blocking_notifier_head event_subscribers;
95 u32 startup_events; 92 u32 startup_events;
96 bool startup_events_read; 93 bool startup_events_read;
diff --git a/include/linux/mfd/max8925.h b/include/linux/mfd/max8925.h
new file mode 100644
index 000000000000..5259dfe8c585
--- /dev/null
+++ b/include/linux/mfd/max8925.h
@@ -0,0 +1,253 @@
1/*
2 * Maxim8925 Interface
3 *
4 * Copyright (C) 2009 Marvell International Ltd.
5 * Haojian Zhuang <haojian.zhuang@marvell.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_MFD_MAX8925_H
13#define __LINUX_MFD_MAX8925_H
14
15#include <linux/mutex.h>
16#include <linux/interrupt.h>
17
18/* Unified sub device IDs for MAX8925 */
19enum {
20 MAX8925_ID_SD1,
21 MAX8925_ID_SD2,
22 MAX8925_ID_SD3,
23 MAX8925_ID_LDO1,
24 MAX8925_ID_LDO2,
25 MAX8925_ID_LDO3,
26 MAX8925_ID_LDO4,
27 MAX8925_ID_LDO5,
28 MAX8925_ID_LDO6,
29 MAX8925_ID_LDO7,
30 MAX8925_ID_LDO8,
31 MAX8925_ID_LDO9,
32 MAX8925_ID_LDO10,
33 MAX8925_ID_LDO11,
34 MAX8925_ID_LDO12,
35 MAX8925_ID_LDO13,
36 MAX8925_ID_LDO14,
37 MAX8925_ID_LDO15,
38 MAX8925_ID_LDO16,
39 MAX8925_ID_LDO17,
40 MAX8925_ID_LDO18,
41 MAX8925_ID_LDO19,
42 MAX8925_ID_LDO20,
43 MAX8925_ID_MAX,
44};
45
46enum {
47 /*
48 * Charging current threshold trigger going from fast charge
49 * to TOPOFF charge. From 5% to 20% of fasting charging current.
50 */
51 MAX8925_TOPOFF_THR_5PER,
52 MAX8925_TOPOFF_THR_10PER,
53 MAX8925_TOPOFF_THR_15PER,
54 MAX8925_TOPOFF_THR_20PER,
55};
56
57enum {
58 /* Fast charging current */
59 MAX8925_FCHG_85MA,
60 MAX8925_FCHG_300MA,
61 MAX8925_FCHG_460MA,
62 MAX8925_FCHG_600MA,
63 MAX8925_FCHG_700MA,
64 MAX8925_FCHG_800MA,
65 MAX8925_FCHG_900MA,
66 MAX8925_FCHG_1000MA,
67};
68
69/* Charger registers */
70#define MAX8925_CHG_IRQ1 (0x7e)
71#define MAX8925_CHG_IRQ2 (0x7f)
72#define MAX8925_CHG_IRQ1_MASK (0x80)
73#define MAX8925_CHG_IRQ2_MASK (0x81)
74#define MAX8925_CHG_STATUS (0x82)
75
76/* GPM registers */
77#define MAX8925_SYSENSEL (0x00)
78#define MAX8925_ON_OFF_IRQ1 (0x01)
79#define MAX8925_ON_OFF_IRQ1_MASK (0x02)
80#define MAX8925_ON_OFF_STATUS (0x03)
81#define MAX8925_ON_OFF_IRQ2 (0x0d)
82#define MAX8925_ON_OFF_IRQ2_MASK (0x0e)
83#define MAX8925_RESET_CNFG (0x0f)
84
85/* Touch registers */
86#define MAX8925_TSC_IRQ (0x00)
87#define MAX8925_TSC_IRQ_MASK (0x01)
88#define MAX8925_TSC_CNFG1 (0x02)
89#define MAX8925_ADC_SCHED (0x10)
90#define MAX8925_ADC_RES_END (0x6f)
91
92#define MAX8925_NREF_OK (1 << 4)
93
94/* RTC registers */
95#define MAX8925_ALARM0_CNTL (0x18)
96#define MAX8925_ALARM1_CNTL (0x19)
97#define MAX8925_RTC_IRQ (0x1c)
98#define MAX8925_RTC_IRQ_MASK (0x1d)
99#define MAX8925_MPL_CNTL (0x1e)
100
101/* WLED registers */
102#define MAX8925_WLED_MODE_CNTL (0x84)
103#define MAX8925_WLED_CNTL (0x85)
104
105/* MAX8925 Registers */
106#define MAX8925_SDCTL1 (0x04)
107#define MAX8925_SDCTL2 (0x07)
108#define MAX8925_SDCTL3 (0x0A)
109#define MAX8925_SDV1 (0x06)
110#define MAX8925_SDV2 (0x09)
111#define MAX8925_SDV3 (0x0C)
112#define MAX8925_LDOCTL1 (0x18)
113#define MAX8925_LDOCTL2 (0x1C)
114#define MAX8925_LDOCTL3 (0x20)
115#define MAX8925_LDOCTL4 (0x24)
116#define MAX8925_LDOCTL5 (0x28)
117#define MAX8925_LDOCTL6 (0x2C)
118#define MAX8925_LDOCTL7 (0x30)
119#define MAX8925_LDOCTL8 (0x34)
120#define MAX8925_LDOCTL9 (0x38)
121#define MAX8925_LDOCTL10 (0x3C)
122#define MAX8925_LDOCTL11 (0x40)
123#define MAX8925_LDOCTL12 (0x44)
124#define MAX8925_LDOCTL13 (0x48)
125#define MAX8925_LDOCTL14 (0x4C)
126#define MAX8925_LDOCTL15 (0x50)
127#define MAX8925_LDOCTL16 (0x10)
128#define MAX8925_LDOCTL17 (0x14)
129#define MAX8925_LDOCTL18 (0x72)
130#define MAX8925_LDOCTL19 (0x5C)
131#define MAX8925_LDOCTL20 (0x9C)
132#define MAX8925_LDOVOUT1 (0x1A)
133#define MAX8925_LDOVOUT2 (0x1E)
134#define MAX8925_LDOVOUT3 (0x22)
135#define MAX8925_LDOVOUT4 (0x26)
136#define MAX8925_LDOVOUT5 (0x2A)
137#define MAX8925_LDOVOUT6 (0x2E)
138#define MAX8925_LDOVOUT7 (0x32)
139#define MAX8925_LDOVOUT8 (0x36)
140#define MAX8925_LDOVOUT9 (0x3A)
141#define MAX8925_LDOVOUT10 (0x3E)
142#define MAX8925_LDOVOUT11 (0x42)
143#define MAX8925_LDOVOUT12 (0x46)
144#define MAX8925_LDOVOUT13 (0x4A)
145#define MAX8925_LDOVOUT14 (0x4E)
146#define MAX8925_LDOVOUT15 (0x52)
147#define MAX8925_LDOVOUT16 (0x12)
148#define MAX8925_LDOVOUT17 (0x16)
149#define MAX8925_LDOVOUT18 (0x74)
150#define MAX8925_LDOVOUT19 (0x5E)
151#define MAX8925_LDOVOUT20 (0x9E)
152
153/* bit definitions */
154#define CHG_IRQ1_MASK (0x07)
155#define CHG_IRQ2_MASK (0xff)
156#define ON_OFF_IRQ1_MASK (0xff)
157#define ON_OFF_IRQ2_MASK (0x03)
158#define TSC_IRQ_MASK (0x03)
159#define RTC_IRQ_MASK (0x0c)
160
161#define MAX8925_MAX_REGULATOR (23)
162
163#define MAX8925_NAME_SIZE (32)
164
165/* IRQ definitions */
166enum {
167 MAX8925_IRQ_VCHG_DC_OVP,
168 MAX8925_IRQ_VCHG_DC_F,
169 MAX8925_IRQ_VCHG_DC_R,
170 MAX8925_IRQ_VCHG_USB_OVP,
171 MAX8925_IRQ_VCHG_USB_F,
172 MAX8925_IRQ_VCHG_USB_R,
173 MAX8925_IRQ_VCHG_THM_OK_R,
174 MAX8925_IRQ_VCHG_THM_OK_F,
175 MAX8925_IRQ_VCHG_SYSLOW_F,
176 MAX8925_IRQ_VCHG_SYSLOW_R,
177 MAX8925_IRQ_VCHG_RST,
178 MAX8925_IRQ_VCHG_DONE,
179 MAX8925_IRQ_VCHG_TOPOFF,
180 MAX8925_IRQ_VCHG_TMR_FAULT,
181 MAX8925_IRQ_GPM_RSTIN,
182 MAX8925_IRQ_GPM_MPL,
183 MAX8925_IRQ_GPM_SW_3SEC,
184 MAX8925_IRQ_GPM_EXTON_F,
185 MAX8925_IRQ_GPM_EXTON_R,
186 MAX8925_IRQ_GPM_SW_1SEC,
187 MAX8925_IRQ_GPM_SW_F,
188 MAX8925_IRQ_GPM_SW_R,
189 MAX8925_IRQ_GPM_SYSCKEN_F,
190 MAX8925_IRQ_GPM_SYSCKEN_R,
191 MAX8925_IRQ_RTC_ALARM1,
192 MAX8925_IRQ_RTC_ALARM0,
193 MAX8925_IRQ_TSC_STICK,
194 MAX8925_IRQ_TSC_NSTICK,
195 MAX8925_NR_IRQS,
196};
197
198struct max8925_chip {
199 struct device *dev;
200 struct i2c_client *i2c;
201 struct i2c_client *adc;
202 struct i2c_client *rtc;
203 struct mutex io_lock;
204 struct mutex irq_lock;
205
206 int irq_base;
207 int core_irq;
208 int tsc_irq;
209};
210
211struct max8925_backlight_pdata {
212 int lxw_scl; /* 0/1 -- 0.8Ohm/0.4Ohm */
213 int lxw_freq; /* 700KHz ~ 1400KHz */
214 int dual_string; /* 0/1 -- single/dual string */
215};
216
217struct max8925_touch_pdata {
218 unsigned int flags;
219};
220
221struct max8925_power_pdata {
222 int (*set_charger)(int);
223 unsigned batt_detect:1;
224 unsigned topoff_threshold:2;
225 unsigned fast_charge:3; /* charge current */
226};
227
228/*
229 * irq_base: stores IRQ base number of MAX8925 in platform
230 * tsc_irq: stores IRQ number of MAX8925 TSC
231 */
232struct max8925_platform_data {
233 struct max8925_backlight_pdata *backlight;
234 struct max8925_touch_pdata *touch;
235 struct max8925_power_pdata *power;
236 struct regulator_init_data *regulator[MAX8925_MAX_REGULATOR];
237
238 int irq_base;
239 int tsc_irq;
240};
241
242extern int max8925_reg_read(struct i2c_client *, int);
243extern int max8925_reg_write(struct i2c_client *, int, unsigned char);
244extern int max8925_bulk_read(struct i2c_client *, int, int, unsigned char *);
245extern int max8925_bulk_write(struct i2c_client *, int, int, unsigned char *);
246extern int max8925_set_bits(struct i2c_client *, int, unsigned char,
247 unsigned char);
248
249extern int max8925_device_init(struct max8925_chip *,
250 struct max8925_platform_data *);
251extern void max8925_device_exit(struct max8925_chip *);
252#endif /* __LINUX_MFD_MAX8925_H */
253
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 35680409b8cf..8895d9d8879c 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -26,10 +26,30 @@ int mc13783_irq_request(struct mc13783 *mc13783, int irq,
26int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq, 26int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
27 irq_handler_t handler, const char *name, void *dev); 27 irq_handler_t handler, const char *name, void *dev);
28int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev); 28int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev);
29int mc13783_ackirq(struct mc13783 *mc13783, int irq);
30 29
31int mc13783_mask(struct mc13783 *mc13783, int irq); 30int mc13783_irq_mask(struct mc13783 *mc13783, int irq);
32int mc13783_unmask(struct mc13783 *mc13783, int irq); 31int mc13783_irq_unmask(struct mc13783 *mc13783, int irq);
32int mc13783_irq_status(struct mc13783 *mc13783, int irq,
33 int *enabled, int *pending);
34int mc13783_irq_ack(struct mc13783 *mc13783, int irq);
35
36static inline int mc13783_mask(struct mc13783 *mc13783, int irq) __deprecated;
37static inline int mc13783_mask(struct mc13783 *mc13783, int irq)
38{
39 return mc13783_irq_mask(mc13783, irq);
40}
41
42static inline int mc13783_unmask(struct mc13783 *mc13783, int irq) __deprecated;
43static inline int mc13783_unmask(struct mc13783 *mc13783, int irq)
44{
45 return mc13783_irq_unmask(mc13783, irq);
46}
47
48static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) __deprecated;
49static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
50{
51 return mc13783_irq_ack(mc13783, irq);
52}
33 53
34#define MC13783_ADC0 43 54#define MC13783_ADC0 43
35#define MC13783_ADC0_ADREFEN (1 << 10) 55#define MC13783_ADC0_ADREFEN (1 << 10)
@@ -108,6 +128,8 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
108#define MC13783_REGU_V2 28 128#define MC13783_REGU_V2 28
109#define MC13783_REGU_V3 29 129#define MC13783_REGU_V3 29
110#define MC13783_REGU_V4 30 130#define MC13783_REGU_V4 30
131#define MC13783_REGU_PWGT1SPI 31
132#define MC13783_REGU_PWGT2SPI 32
111 133
112#define MC13783_IRQ_ADCDONE 0 134#define MC13783_IRQ_ADCDONE 0
113#define MC13783_IRQ_ADCBISDONE 1 135#define MC13783_IRQ_ADCBISDONE 1
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 6b9c5d06690c..c3f7dff8effc 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -2,6 +2,8 @@
2#define MFD_TMIO_H 2#define MFD_TMIO_H
3 3
4#include <linux/fb.h> 4#include <linux/fb.h>
5#include <linux/io.h>
6#include <linux/platform_device.h>
5 7
6#define tmio_ioread8(addr) readb(addr) 8#define tmio_ioread8(addr) readb(addr)
7#define tmio_ioread16(addr) readw(addr) 9#define tmio_ioread16(addr) readw(addr)
@@ -18,11 +20,49 @@
18 writew((val) >> 16, (addr) + 2); \ 20 writew((val) >> 16, (addr) + 2); \
19 } while (0) 21 } while (0)
20 22
23#define CNF_CMD 0x04
24#define CNF_CTL_BASE 0x10
25#define CNF_INT_PIN 0x3d
26#define CNF_STOP_CLK_CTL 0x40
27#define CNF_GCLK_CTL 0x41
28#define CNF_SD_CLK_MODE 0x42
29#define CNF_PIN_STATUS 0x44
30#define CNF_PWR_CTL_1 0x48
31#define CNF_PWR_CTL_2 0x49
32#define CNF_PWR_CTL_3 0x4a
33#define CNF_CARD_DETECT_MODE 0x4c
34#define CNF_SD_SLOT 0x50
35#define CNF_EXT_GCLK_CTL_1 0xf0
36#define CNF_EXT_GCLK_CTL_2 0xf1
37#define CNF_EXT_GCLK_CTL_3 0xf9
38#define CNF_SD_LED_EN_1 0xfa
39#define CNF_SD_LED_EN_2 0xfe
40
41#define SDCREN 0x2 /* Enable access to MMC CTL regs. (flag in COMMAND_REG)*/
42
43#define sd_config_write8(base, shift, reg, val) \
44 tmio_iowrite8((val), (base) + ((reg) << (shift)))
45#define sd_config_write16(base, shift, reg, val) \
46 tmio_iowrite16((val), (base) + ((reg) << (shift)))
47#define sd_config_write32(base, shift, reg, val) \
48 do { \
49 tmio_iowrite16((val), (base) + ((reg) << (shift))); \
50 tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \
51 } while (0)
52
53int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
54int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
55void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
56void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
57
21/* 58/*
22 * data for the MMC controller 59 * data for the MMC controller
23 */ 60 */
24struct tmio_mmc_data { 61struct tmio_mmc_data {
25 const unsigned int hclk; 62 unsigned int hclk;
63 unsigned long capabilities;
64 void (*set_pwr)(struct platform_device *host, int state);
65 void (*set_clk_div)(struct platform_device *host, int state);
26}; 66};
27 67
28/* 68/*
diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h
index aa9c3789bed4..4321f044d1e4 100644
--- a/include/linux/mfd/ucb1x00.h
+++ b/include/linux/mfd/ucb1x00.h
@@ -12,6 +12,7 @@
12 12
13#include <linux/mfd/mcp.h> 13#include <linux/mfd/mcp.h>
14#include <linux/gpio.h> 14#include <linux/gpio.h>
15#include <linux/semaphore.h>
15 16
16#define UCB_IO_DATA 0x00 17#define UCB_IO_DATA 0x00
17#define UCB_IO_DIR 0x01 18#define UCB_IO_DIR 0x01
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index 5184b79c700b..5915f6e3d9ab 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -15,6 +15,7 @@
15#ifndef __MFD_WM831X_CORE_H__ 15#ifndef __MFD_WM831X_CORE_H__
16#define __MFD_WM831X_CORE_H__ 16#define __MFD_WM831X_CORE_H__
17 17
18#include <linux/completion.h>
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19 20
20/* 21/*
@@ -254,9 +255,14 @@ struct wm831x {
254 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ 255 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */
255 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ 256 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
256 257
258 /* Chip revision based flags */
259 unsigned has_gpio_ena:1; /* Has GPIO enable bit */
260 unsigned has_cs_sts:1; /* Has current sink status bit */
261
257 int num_gpio; 262 int num_gpio;
258 263
259 struct mutex auxadc_lock; 264 struct mutex auxadc_lock;
265 struct completion auxadc_done;
260 266
261 /* The WM831x has a security key blocking access to certain 267 /* The WM831x has a security key blocking access to certain
262 * registers. The mutex is taken by the accessors for locking 268 * registers. The mutex is taken by the accessors for locking
diff --git a/include/linux/mfd/wm831x/gpio.h b/include/linux/mfd/wm831x/gpio.h
index 2835614af0e3..9b163c58865f 100644
--- a/include/linux/mfd/wm831x/gpio.h
+++ b/include/linux/mfd/wm831x/gpio.h
@@ -41,6 +41,10 @@
41#define WM831X_GPN_OD_MASK 0x0200 /* GPN_OD */ 41#define WM831X_GPN_OD_MASK 0x0200 /* GPN_OD */
42#define WM831X_GPN_OD_SHIFT 9 /* GPN_OD */ 42#define WM831X_GPN_OD_SHIFT 9 /* GPN_OD */
43#define WM831X_GPN_OD_WIDTH 1 /* GPN_OD */ 43#define WM831X_GPN_OD_WIDTH 1 /* GPN_OD */
44#define WM831X_GPN_ENA 0x0080 /* GPN_ENA */
45#define WM831X_GPN_ENA_MASK 0x0080 /* GPN_ENA */
46#define WM831X_GPN_ENA_SHIFT 7 /* GPN_ENA */
47#define WM831X_GPN_ENA_WIDTH 1 /* GPN_ENA */
44#define WM831X_GPN_TRI 0x0080 /* GPN_TRI */ 48#define WM831X_GPN_TRI 0x0080 /* GPN_TRI */
45#define WM831X_GPN_TRI_MASK 0x0080 /* GPN_TRI */ 49#define WM831X_GPN_TRI_MASK 0x0080 /* GPN_TRI */
46#define WM831X_GPN_TRI_SHIFT 7 /* GPN_TRI */ 50#define WM831X_GPN_TRI_SHIFT 7 /* GPN_TRI */
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index 415c228743d5..fd322aca33ba 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -41,6 +41,23 @@ struct wm831x_battery_pdata {
41 int timeout; /** Charge cycle timeout, in minutes */ 41 int timeout; /** Charge cycle timeout, in minutes */
42}; 42};
43 43
44/**
45 * Configuration for the WM831x DC-DC BuckWise convertors. This
46 * should be passed as driver_data in the regulator_init_data.
47 *
48 * Currently all the configuration is for the fast DVS switching
49 * support of the devices. This allows MFPs on the device to be
50 * configured as an input to switch between two output voltages,
51 * allowing voltage transitions without the expense of an access over
52 * I2C or SPI buses.
53 */
54struct wm831x_buckv_pdata {
55 int dvs_gpio; /** CPU GPIO to use for DVS switching */
56 int dvs_control_src; /** Hardware DVS source to use (1 or 2) */
57 int dvs_init_state; /** DVS state to expect on startup */
58 int dvs_state_gpio; /** CPU GPIO to use for monitoring status */
59};
60
44/* Sources for status LED configuration. Values are register values 61/* Sources for status LED configuration. Values are register values
45 * plus 1 to allow for a zero default for preserve. 62 * plus 1 to allow for a zero default for preserve.
46 */ 63 */
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h
index 43868899bf49..98fcc977e82b 100644
--- a/include/linux/mfd/wm8350/core.h
+++ b/include/linux/mfd/wm8350/core.h
@@ -16,6 +16,7 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/completion.h>
19 20
20#include <linux/mfd/wm8350/audio.h> 21#include <linux/mfd/wm8350/audio.h>
21#include <linux/mfd/wm8350/gpio.h> 22#include <linux/mfd/wm8350/gpio.h>
@@ -579,6 +580,8 @@
579 580
580#define WM8350_NUM_IRQ 63 581#define WM8350_NUM_IRQ 63
581 582
583#define WM8350_NUM_IRQ_REGS 7
584
582struct wm8350_reg_access { 585struct wm8350_reg_access {
583 u16 readable; /* Mask of readable bits */ 586 u16 readable; /* Mask of readable bits */
584 u16 writable; /* Mask of writable bits */ 587 u16 writable; /* Mask of writable bits */
@@ -600,11 +603,6 @@ extern const u16 wm8352_mode3_defaults[];
600 603
601struct wm8350; 604struct wm8350;
602 605
603struct wm8350_irq {
604 irq_handler_t handler;
605 void *data;
606};
607
608struct wm8350_hwmon { 606struct wm8350_hwmon {
609 struct platform_device *pdev; 607 struct platform_device *pdev;
610 struct device *classdev; 608 struct device *classdev;
@@ -624,11 +622,13 @@ struct wm8350 {
624 u16 *reg_cache; 622 u16 *reg_cache;
625 623
626 struct mutex auxadc_mutex; 624 struct mutex auxadc_mutex;
625 struct completion auxadc_done;
627 626
628 /* Interrupt handling */ 627 /* Interrupt handling */
629 struct mutex irq_mutex; /* IRQ table mutex */ 628 struct mutex irq_lock;
630 struct wm8350_irq irq[WM8350_NUM_IRQ];
631 int chip_irq; 629 int chip_irq;
630 int irq_base;
631 u16 irq_masks[WM8350_NUM_IRQ_REGS];
632 632
633 /* Client devices */ 633 /* Client devices */
634 struct wm8350_codec codec; 634 struct wm8350_codec codec;
@@ -647,11 +647,13 @@ struct wm8350 {
647 * used by the platform to configure GPIO functions and similar. 647 * used by the platform to configure GPIO functions and similar.
648 * @irq_high: Set if WM8350 IRQ is active high. 648 * @irq_high: Set if WM8350 IRQ is active high.
649 * @irq_base: Base IRQ for genirq (not currently used). 649 * @irq_base: Base IRQ for genirq (not currently used).
650 * @gpio_base: Base for gpiolib.
650 */ 651 */
651struct wm8350_platform_data { 652struct wm8350_platform_data {
652 int (*init)(struct wm8350 *wm8350); 653 int (*init)(struct wm8350 *wm8350);
653 int irq_high; 654 int irq_high;
654 int irq_base; 655 int irq_base;
656 int gpio_base;
655}; 657};
656 658
657 659
@@ -677,12 +679,33 @@ int wm8350_block_write(struct wm8350 *wm8350, int reg, int size, u16 *src);
677/* 679/*
678 * WM8350 internal interrupts 680 * WM8350 internal interrupts
679 */ 681 */
680int wm8350_register_irq(struct wm8350 *wm8350, int irq, 682static inline int wm8350_register_irq(struct wm8350 *wm8350, int irq,
681 irq_handler_t handler, unsigned long flags, 683 irq_handler_t handler,
682 const char *name, void *data); 684 unsigned long flags,
683int wm8350_free_irq(struct wm8350 *wm8350, int irq); 685 const char *name, void *data)
684int wm8350_mask_irq(struct wm8350 *wm8350, int irq); 686{
685int wm8350_unmask_irq(struct wm8350 *wm8350, int irq); 687 if (!wm8350->irq_base)
688 return -ENODEV;
689
690 return request_threaded_irq(irq + wm8350->irq_base, NULL,
691 handler, flags, name, data);
692}
693
694static inline void wm8350_free_irq(struct wm8350 *wm8350, int irq, void *data)
695{
696 free_irq(irq + wm8350->irq_base, data);
697}
698
699static inline void wm8350_mask_irq(struct wm8350 *wm8350, int irq)
700{
701 disable_irq(irq + wm8350->irq_base);
702}
703
704static inline void wm8350_unmask_irq(struct wm8350 *wm8350, int irq)
705{
706 enable_irq(irq + wm8350->irq_base);
707}
708
686int wm8350_irq_init(struct wm8350 *wm8350, int irq, 709int wm8350_irq_init(struct wm8350 *wm8350, int irq,
687 struct wm8350_platform_data *pdata); 710 struct wm8350_platform_data *pdata);
688int wm8350_irq_exit(struct wm8350 *wm8350); 711int wm8350_irq_exit(struct wm8350 *wm8350);
diff --git a/include/linux/mfd/wm8350/gpio.h b/include/linux/mfd/wm8350/gpio.h
index 71af3d6ebe9d..d657bcd6d955 100644
--- a/include/linux/mfd/wm8350/gpio.h
+++ b/include/linux/mfd/wm8350/gpio.h
@@ -29,6 +29,7 @@
29#define WM8350_GPIO_FUNCTION_SELECT_2 0x8D 29#define WM8350_GPIO_FUNCTION_SELECT_2 0x8D
30#define WM8350_GPIO_FUNCTION_SELECT_3 0x8E 30#define WM8350_GPIO_FUNCTION_SELECT_3 0x8E
31#define WM8350_GPIO_FUNCTION_SELECT_4 0x8F 31#define WM8350_GPIO_FUNCTION_SELECT_4 0x8F
32#define WM8350_GPIO_LEVEL 0xE6
32 33
33/* 34/*
34 * GPIO Functions 35 * GPIO Functions
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h
index be3264e286e0..e786fe9841ef 100644
--- a/include/linux/mfd/wm8350/pmic.h
+++ b/include/linux/mfd/wm8350/pmic.h
@@ -666,20 +666,20 @@
666#define WM8350_ISINK_FLASH_DUR_64MS (1 << 8) 666#define WM8350_ISINK_FLASH_DUR_64MS (1 << 8)
667#define WM8350_ISINK_FLASH_DUR_96MS (2 << 8) 667#define WM8350_ISINK_FLASH_DUR_96MS (2 << 8)
668#define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8) 668#define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8)
669#define WM8350_ISINK_FLASH_ON_INSTANT (0 << 4) 669#define WM8350_ISINK_FLASH_ON_INSTANT (0 << 0)
670#define WM8350_ISINK_FLASH_ON_0_25S (1 << 4) 670#define WM8350_ISINK_FLASH_ON_0_25S (1 << 0)
671#define WM8350_ISINK_FLASH_ON_0_50S (2 << 4) 671#define WM8350_ISINK_FLASH_ON_0_50S (2 << 0)
672#define WM8350_ISINK_FLASH_ON_1_00S (3 << 4) 672#define WM8350_ISINK_FLASH_ON_1_00S (3 << 0)
673#define WM8350_ISINK_FLASH_ON_1_95S (1 << 4) 673#define WM8350_ISINK_FLASH_ON_1_95S (1 << 0)
674#define WM8350_ISINK_FLASH_ON_3_91S (2 << 4) 674#define WM8350_ISINK_FLASH_ON_3_91S (2 << 0)
675#define WM8350_ISINK_FLASH_ON_7_80S (3 << 4) 675#define WM8350_ISINK_FLASH_ON_7_80S (3 << 0)
676#define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 0) 676#define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 4)
677#define WM8350_ISINK_FLASH_OFF_0_25S (1 << 0) 677#define WM8350_ISINK_FLASH_OFF_0_25S (1 << 4)
678#define WM8350_ISINK_FLASH_OFF_0_50S (2 << 0) 678#define WM8350_ISINK_FLASH_OFF_0_50S (2 << 4)
679#define WM8350_ISINK_FLASH_OFF_1_00S (3 << 0) 679#define WM8350_ISINK_FLASH_OFF_1_00S (3 << 4)
680#define WM8350_ISINK_FLASH_OFF_1_95S (1 << 0) 680#define WM8350_ISINK_FLASH_OFF_1_95S (1 << 4)
681#define WM8350_ISINK_FLASH_OFF_3_91S (2 << 0) 681#define WM8350_ISINK_FLASH_OFF_3_91S (2 << 4)
682#define WM8350_ISINK_FLASH_OFF_7_80S (3 << 0) 682#define WM8350_ISINK_FLASH_OFF_7_80S (3 << 4)
683 683
684/* 684/*
685 * Regulator Interrupts. 685 * Regulator Interrupts.
diff --git a/include/linux/mfd/wm8350/rtc.h b/include/linux/mfd/wm8350/rtc.h
index 24add2bef6c9..ebd72ffc62d1 100644
--- a/include/linux/mfd/wm8350/rtc.h
+++ b/include/linux/mfd/wm8350/rtc.h
@@ -263,6 +263,7 @@ struct wm8350_rtc {
263 struct platform_device *pdev; 263 struct platform_device *pdev;
264 struct rtc_device *rtc; 264 struct rtc_device *rtc;
265 int alarm_enabled; /* used over suspend/resume */ 265 int alarm_enabled; /* used over suspend/resume */
266 int update_enabled;
266}; 267};
267 268
268#endif 269#endif
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
new file mode 100644
index 000000000000..b06ff2846748
--- /dev/null
+++ b/include/linux/mfd/wm8994/core.h
@@ -0,0 +1,54 @@
1/*
2 * include/linux/mfd/wm8994/core.h -- Core interface for WM8994
3 *
4 * Copyright 2009 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __MFD_WM8994_CORE_H__
16#define __MFD_WM8994_CORE_H__
17
18struct regulator_dev;
19struct regulator_bulk_data;
20
21#define WM8994_NUM_GPIO_REGS 11
22#define WM8994_NUM_LDO_REGS 2
23
24struct wm8994 {
25 struct mutex io_lock;
26
27 struct device *dev;
28 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg,
29 int bytes, void *dest);
30 int (*write_dev)(struct wm8994 *wm8994, unsigned short reg,
31 int bytes, void *src);
32
33 void *control_data;
34
35 int gpio_base;
36
37 /* Used over suspend/resume */
38 u16 ldo_regs[WM8994_NUM_LDO_REGS];
39 u16 gpio_regs[WM8994_NUM_GPIO_REGS];
40
41 struct regulator_dev *dbvdd;
42 struct regulator_bulk_data *supplies;
43};
44
45/* Device I/O API */
46int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg);
47int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg,
48 unsigned short val);
49int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
50 unsigned short mask, unsigned short val);
51int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
52 int count, u16 *buf);
53
54#endif
diff --git a/include/linux/mfd/wm8994/gpio.h b/include/linux/mfd/wm8994/gpio.h
new file mode 100644
index 000000000000..b4d4c22991e8
--- /dev/null
+++ b/include/linux/mfd/wm8994/gpio.h
@@ -0,0 +1,72 @@
1/*
2 * include/linux/mfd/wm8994/gpio.h - GPIO configuration for WM8994
3 *
4 * Copyright 2009 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __MFD_WM8994_GPIO_H__
16#define __MFD_WM8994_GPIO_H__
17
18#define WM8994_GPIO_MAX 11
19
20#define WM8994_GP_FN_PIN_SPECIFIC 0
21#define WM8994_GP_FN_GPIO 1
22#define WM8994_GP_FN_SDOUT 2
23#define WM8994_GP_FN_IRQ 3
24#define WM8994_GP_FN_TEMPERATURE 4
25#define WM8994_GP_FN_MICBIAS1_DET 5
26#define WM8994_GP_FN_MICBIAS1_SHORT 6
27#define WM8994_GP_FN_MICBIAS2_DET 7
28#define WM8994_GP_FN_MICBIAS2_SHORT 8
29#define WM8994_GP_FN_FLL1_LOCK 9
30#define WM8994_GP_FN_FLL2_LOCK 10
31#define WM8994_GP_FN_SRC1_LOCK 11
32#define WM8994_GP_FN_SRC2_LOCK 12
33#define WM8994_GP_FN_DRC1_ACT 13
34#define WM8994_GP_FN_DRC2_ACT 14
35#define WM8994_GP_FN_DRC3_ACT 15
36#define WM8994_GP_FN_WSEQ_STATUS 16
37#define WM8994_GP_FN_FIFO_ERROR 17
38#define WM8994_GP_FN_OPCLK 18
39
40#define WM8994_GPN_DIR 0x8000 /* GPN_DIR */
41#define WM8994_GPN_DIR_MASK 0x8000 /* GPN_DIR */
42#define WM8994_GPN_DIR_SHIFT 15 /* GPN_DIR */
43#define WM8994_GPN_DIR_WIDTH 1 /* GPN_DIR */
44#define WM8994_GPN_PU 0x4000 /* GPN_PU */
45#define WM8994_GPN_PU_MASK 0x4000 /* GPN_PU */
46#define WM8994_GPN_PU_SHIFT 14 /* GPN_PU */
47#define WM8994_GPN_PU_WIDTH 1 /* GPN_PU */
48#define WM8994_GPN_PD 0x2000 /* GPN_PD */
49#define WM8994_GPN_PD_MASK 0x2000 /* GPN_PD */
50#define WM8994_GPN_PD_SHIFT 13 /* GPN_PD */
51#define WM8994_GPN_PD_WIDTH 1 /* GPN_PD */
52#define WM8994_GPN_POL 0x0400 /* GPN_POL */
53#define WM8994_GPN_POL_MASK 0x0400 /* GPN_POL */
54#define WM8994_GPN_POL_SHIFT 10 /* GPN_POL */
55#define WM8994_GPN_POL_WIDTH 1 /* GPN_POL */
56#define WM8994_GPN_OP_CFG 0x0200 /* GPN_OP_CFG */
57#define WM8994_GPN_OP_CFG_MASK 0x0200 /* GPN_OP_CFG */
58#define WM8994_GPN_OP_CFG_SHIFT 9 /* GPN_OP_CFG */
59#define WM8994_GPN_OP_CFG_WIDTH 1 /* GPN_OP_CFG */
60#define WM8994_GPN_DB 0x0100 /* GPN_DB */
61#define WM8994_GPN_DB_MASK 0x0100 /* GPN_DB */
62#define WM8994_GPN_DB_SHIFT 8 /* GPN_DB */
63#define WM8994_GPN_DB_WIDTH 1 /* GPN_DB */
64#define WM8994_GPN_LVL 0x0040 /* GPN_LVL */
65#define WM8994_GPN_LVL_MASK 0x0040 /* GPN_LVL */
66#define WM8994_GPN_LVL_SHIFT 6 /* GPN_LVL */
67#define WM8994_GPN_LVL_WIDTH 1 /* GPN_LVL */
68#define WM8994_GPN_FN_MASK 0x001F /* GPN_FN - [4:0] */
69#define WM8994_GPN_FN_SHIFT 0 /* GPN_FN - [4:0] */
70#define WM8994_GPN_FN_WIDTH 5 /* GPN_FN - [4:0] */
71
72#endif
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
new file mode 100644
index 000000000000..70d6a8687dc5
--- /dev/null
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -0,0 +1,97 @@
1/*
2 * include/linux/mfd/wm8994/pdata.h -- Platform data for WM8994
3 *
4 * Copyright 2009 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __MFD_WM8994_PDATA_H__
16#define __MFD_WM8994_PDATA_H__
17
18#define WM8994_NUM_LDO 2
19#define WM8994_NUM_GPIO 11
20
21struct wm8994_ldo_pdata {
22 /** GPIOs to enable regulator, 0 or less if not available */
23 int enable;
24
25 const char *supply;
26 struct regulator_init_data *init_data;
27};
28
29#define WM8994_CONFIGURE_GPIO 0x8000
30
31#define WM8994_DRC_REGS 5
32#define WM8994_EQ_REGS 19
33
34/**
35 * DRC configurations are specified with a label and a set of register
36 * values to write (the enable bits will be ignored). At runtime an
37 * enumerated control will be presented for each DRC block allowing
38 * the user to choose the configration to use.
39 *
40 * Configurations may be generated by hand or by using the DRC control
41 * panel provided by the WISCE - see http://www.wolfsonmicro.com/wisce/
42 * for details.
43 */
44struct wm8994_drc_cfg {
45 const char *name;
46 u16 regs[WM8994_DRC_REGS];
47};
48
49/**
50 * ReTune Mobile configurations are specified with a label, sample
51 * rate and set of values to write (the enable bits will be ignored).
52 *
53 * Configurations are expected to be generated using the ReTune Mobile
54 * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/
55 */
56struct wm8994_retune_mobile_cfg {
57 const char *name;
58 unsigned int rate;
59 u16 regs[WM8994_EQ_REGS];
60};
61
62struct wm8994_pdata {
63 int gpio_base;
64
65 /**
66 * Default values for GPIOs if non-zero, WM8994_CONFIGURE_GPIO
67 * can be used for all zero values.
68 */
69 int gpio_defaults[WM8994_NUM_GPIO];
70
71 struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO];
72
73
74 int num_drc_cfgs;
75 struct wm8994_drc_cfg *drc_cfgs;
76
77 int num_retune_mobile_cfgs;
78 struct wm8994_retune_mobile_cfg *retune_mobile_cfgs;
79
80 /* LINEOUT can be differential or single ended */
81 unsigned int lineout1_diff:1;
82 unsigned int lineout2_diff:1;
83
84 /* Common mode feedback */
85 unsigned int lineout1fb:1;
86 unsigned int lineout2fb:1;
87
88 /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */
89 unsigned int micbias1_lvl:1;
90 unsigned int micbias2_lvl:1;
91
92 /* Jack detect threashold levels, see datasheet for values */
93 unsigned int jd_scthr:2;
94 unsigned int jd_thr:2;
95};
96
97#endif
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h
new file mode 100644
index 000000000000..967f62f54159
--- /dev/null
+++ b/include/linux/mfd/wm8994/registers.h
@@ -0,0 +1,4292 @@
1/*
2 * include/linux/mfd/wm8994/registers.h -- Register definitions for WM8994
3 *
4 * Copyright 2009 Wolfson Microelectronics PLC.
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __MFD_WM8994_REGISTERS_H__
16#define __MFD_WM8994_REGISTERS_H__
17
18/*
19 * Register values.
20 */
21#define WM8994_SOFTWARE_RESET 0x00
22#define WM8994_POWER_MANAGEMENT_1 0x01
23#define WM8994_POWER_MANAGEMENT_2 0x02
24#define WM8994_POWER_MANAGEMENT_3 0x03
25#define WM8994_POWER_MANAGEMENT_4 0x04
26#define WM8994_POWER_MANAGEMENT_5 0x05
27#define WM8994_POWER_MANAGEMENT_6 0x06
28#define WM8994_INPUT_MIXER_1 0x15
29#define WM8994_LEFT_LINE_INPUT_1_2_VOLUME 0x18
30#define WM8994_LEFT_LINE_INPUT_3_4_VOLUME 0x19
31#define WM8994_RIGHT_LINE_INPUT_1_2_VOLUME 0x1A
32#define WM8994_RIGHT_LINE_INPUT_3_4_VOLUME 0x1B
33#define WM8994_LEFT_OUTPUT_VOLUME 0x1C
34#define WM8994_RIGHT_OUTPUT_VOLUME 0x1D
35#define WM8994_LINE_OUTPUTS_VOLUME 0x1E
36#define WM8994_HPOUT2_VOLUME 0x1F
37#define WM8994_LEFT_OPGA_VOLUME 0x20
38#define WM8994_RIGHT_OPGA_VOLUME 0x21
39#define WM8994_SPKMIXL_ATTENUATION 0x22
40#define WM8994_SPKMIXR_ATTENUATION 0x23
41#define WM8994_SPKOUT_MIXERS 0x24
42#define WM8994_CLASSD 0x25
43#define WM8994_SPEAKER_VOLUME_LEFT 0x26
44#define WM8994_SPEAKER_VOLUME_RIGHT 0x27
45#define WM8994_INPUT_MIXER_2 0x28
46#define WM8994_INPUT_MIXER_3 0x29
47#define WM8994_INPUT_MIXER_4 0x2A
48#define WM8994_INPUT_MIXER_5 0x2B
49#define WM8994_INPUT_MIXER_6 0x2C
50#define WM8994_OUTPUT_MIXER_1 0x2D
51#define WM8994_OUTPUT_MIXER_2 0x2E
52#define WM8994_OUTPUT_MIXER_3 0x2F
53#define WM8994_OUTPUT_MIXER_4 0x30
54#define WM8994_OUTPUT_MIXER_5 0x31
55#define WM8994_OUTPUT_MIXER_6 0x32
56#define WM8994_HPOUT2_MIXER 0x33
57#define WM8994_LINE_MIXER_1 0x34
58#define WM8994_LINE_MIXER_2 0x35
59#define WM8994_SPEAKER_MIXER 0x36
60#define WM8994_ADDITIONAL_CONTROL 0x37
61#define WM8994_ANTIPOP_1 0x38
62#define WM8994_ANTIPOP_2 0x39
63#define WM8994_MICBIAS 0x3A
64#define WM8994_LDO_1 0x3B
65#define WM8994_LDO_2 0x3C
66#define WM8994_CHARGE_PUMP_1 0x4C
67#define WM8994_CLASS_W_1 0x51
68#define WM8994_DC_SERVO_1 0x54
69#define WM8994_DC_SERVO_2 0x55
70#define WM8994_DC_SERVO_4 0x57
71#define WM8994_DC_SERVO_READBACK 0x58
72#define WM8994_ANALOGUE_HP_1 0x60
73#define WM8994_CHIP_REVISION 0x100
74#define WM8994_CONTROL_INTERFACE 0x101
75#define WM8994_WRITE_SEQUENCER_CTRL_1 0x110
76#define WM8994_WRITE_SEQUENCER_CTRL_2 0x111
77#define WM8994_AIF1_CLOCKING_1 0x200
78#define WM8994_AIF1_CLOCKING_2 0x201
79#define WM8994_AIF2_CLOCKING_1 0x204
80#define WM8994_AIF2_CLOCKING_2 0x205
81#define WM8994_CLOCKING_1 0x208
82#define WM8994_CLOCKING_2 0x209
83#define WM8994_AIF1_RATE 0x210
84#define WM8994_AIF2_RATE 0x211
85#define WM8994_RATE_STATUS 0x212
86#define WM8994_FLL1_CONTROL_1 0x220
87#define WM8994_FLL1_CONTROL_2 0x221
88#define WM8994_FLL1_CONTROL_3 0x222
89#define WM8994_FLL1_CONTROL_4 0x223
90#define WM8994_FLL1_CONTROL_5 0x224
91#define WM8994_FLL2_CONTROL_1 0x240
92#define WM8994_FLL2_CONTROL_2 0x241
93#define WM8994_FLL2_CONTROL_3 0x242
94#define WM8994_FLL2_CONTROL_4 0x243
95#define WM8994_FLL2_CONTROL_5 0x244
96#define WM8994_AIF1_CONTROL_1 0x300
97#define WM8994_AIF1_CONTROL_2 0x301
98#define WM8994_AIF1_MASTER_SLAVE 0x302
99#define WM8994_AIF1_BCLK 0x303
100#define WM8994_AIF1ADC_LRCLK 0x304
101#define WM8994_AIF1DAC_LRCLK 0x305
102#define WM8994_AIF1DAC_DATA 0x306
103#define WM8994_AIF1ADC_DATA 0x307
104#define WM8994_AIF2_CONTROL_1 0x310
105#define WM8994_AIF2_CONTROL_2 0x311
106#define WM8994_AIF2_MASTER_SLAVE 0x312
107#define WM8994_AIF2_BCLK 0x313
108#define WM8994_AIF2ADC_LRCLK 0x314
109#define WM8994_AIF2DAC_LRCLK 0x315
110#define WM8994_AIF2DAC_DATA 0x316
111#define WM8994_AIF2ADC_DATA 0x317
112#define WM8994_AIF1_ADC1_LEFT_VOLUME 0x400
113#define WM8994_AIF1_ADC1_RIGHT_VOLUME 0x401
114#define WM8994_AIF1_DAC1_LEFT_VOLUME 0x402
115#define WM8994_AIF1_DAC1_RIGHT_VOLUME 0x403
116#define WM8994_AIF1_ADC2_LEFT_VOLUME 0x404
117#define WM8994_AIF1_ADC2_RIGHT_VOLUME 0x405
118#define WM8994_AIF1_DAC2_LEFT_VOLUME 0x406
119#define WM8994_AIF1_DAC2_RIGHT_VOLUME 0x407
120#define WM8994_AIF1_ADC1_FILTERS 0x410
121#define WM8994_AIF1_ADC2_FILTERS 0x411
122#define WM8994_AIF1_DAC1_FILTERS_1 0x420
123#define WM8994_AIF1_DAC1_FILTERS_2 0x421
124#define WM8994_AIF1_DAC2_FILTERS_1 0x422
125#define WM8994_AIF1_DAC2_FILTERS_2 0x423
126#define WM8994_AIF1_DRC1_1 0x440
127#define WM8994_AIF1_DRC1_2 0x441
128#define WM8994_AIF1_DRC1_3 0x442
129#define WM8994_AIF1_DRC1_4 0x443
130#define WM8994_AIF1_DRC1_5 0x444
131#define WM8994_AIF1_DRC2_1 0x450
132#define WM8994_AIF1_DRC2_2 0x451
133#define WM8994_AIF1_DRC2_3 0x452
134#define WM8994_AIF1_DRC2_4 0x453
135#define WM8994_AIF1_DRC2_5 0x454
136#define WM8994_AIF1_DAC1_EQ_GAINS_1 0x480
137#define WM8994_AIF1_DAC1_EQ_GAINS_2 0x481
138#define WM8994_AIF1_DAC1_EQ_BAND_1_A 0x482
139#define WM8994_AIF1_DAC1_EQ_BAND_1_B 0x483
140#define WM8994_AIF1_DAC1_EQ_BAND_1_PG 0x484
141#define WM8994_AIF1_DAC1_EQ_BAND_2_A 0x485
142#define WM8994_AIF1_DAC1_EQ_BAND_2_B 0x486
143#define WM8994_AIF1_DAC1_EQ_BAND_2_C 0x487
144#define WM8994_AIF1_DAC1_EQ_BAND_2_PG 0x488
145#define WM8994_AIF1_DAC1_EQ_BAND_3_A 0x489
146#define WM8994_AIF1_DAC1_EQ_BAND_3_B 0x48A
147#define WM8994_AIF1_DAC1_EQ_BAND_3_C 0x48B
148#define WM8994_AIF1_DAC1_EQ_BAND_3_PG 0x48C
149#define WM8994_AIF1_DAC1_EQ_BAND_4_A 0x48D
150#define WM8994_AIF1_DAC1_EQ_BAND_4_B 0x48E
151#define WM8994_AIF1_DAC1_EQ_BAND_4_C 0x48F
152#define WM8994_AIF1_DAC1_EQ_BAND_4_PG 0x490
153#define WM8994_AIF1_DAC1_EQ_BAND_5_A 0x491
154#define WM8994_AIF1_DAC1_EQ_BAND_5_B 0x492
155#define WM8994_AIF1_DAC1_EQ_BAND_5_PG 0x493
156#define WM8994_AIF1_DAC2_EQ_GAINS_1 0x4A0
157#define WM8994_AIF1_DAC2_EQ_GAINS_2 0x4A1
158#define WM8994_AIF1_DAC2_EQ_BAND_1_A 0x4A2
159#define WM8994_AIF1_DAC2_EQ_BAND_1_B 0x4A3
160#define WM8994_AIF1_DAC2_EQ_BAND_1_PG 0x4A4
161#define WM8994_AIF1_DAC2_EQ_BAND_2_A 0x4A5
162#define WM8994_AIF1_DAC2_EQ_BAND_2_B 0x4A6
163#define WM8994_AIF1_DAC2_EQ_BAND_2_C 0x4A7
164#define WM8994_AIF1_DAC2_EQ_BAND_2_PG 0x4A8
165#define WM8994_AIF1_DAC2_EQ_BAND_3_A 0x4A9
166#define WM8994_AIF1_DAC2_EQ_BAND_3_B 0x4AA
167#define WM8994_AIF1_DAC2_EQ_BAND_3_C 0x4AB
168#define WM8994_AIF1_DAC2_EQ_BAND_3_PG 0x4AC
169#define WM8994_AIF1_DAC2_EQ_BAND_4_A 0x4AD
170#define WM8994_AIF1_DAC2_EQ_BAND_4_B 0x4AE
171#define WM8994_AIF1_DAC2_EQ_BAND_4_C 0x4AF
172#define WM8994_AIF1_DAC2_EQ_BAND_4_PG 0x4B0
173#define WM8994_AIF1_DAC2_EQ_BAND_5_A 0x4B1
174#define WM8994_AIF1_DAC2_EQ_BAND_5_B 0x4B2
175#define WM8994_AIF1_DAC2_EQ_BAND_5_PG 0x4B3
176#define WM8994_AIF2_ADC_LEFT_VOLUME 0x500
177#define WM8994_AIF2_ADC_RIGHT_VOLUME 0x501
178#define WM8994_AIF2_DAC_LEFT_VOLUME 0x502
179#define WM8994_AIF2_DAC_RIGHT_VOLUME 0x503
180#define WM8994_AIF2_ADC_FILTERS 0x510
181#define WM8994_AIF2_DAC_FILTERS_1 0x520
182#define WM8994_AIF2_DAC_FILTERS_2 0x521
183#define WM8994_AIF2_DRC_1 0x540
184#define WM8994_AIF2_DRC_2 0x541
185#define WM8994_AIF2_DRC_3 0x542
186#define WM8994_AIF2_DRC_4 0x543
187#define WM8994_AIF2_DRC_5 0x544
188#define WM8994_AIF2_EQ_GAINS_1 0x580
189#define WM8994_AIF2_EQ_GAINS_2 0x581
190#define WM8994_AIF2_EQ_BAND_1_A 0x582
191#define WM8994_AIF2_EQ_BAND_1_B 0x583
192#define WM8994_AIF2_EQ_BAND_1_PG 0x584
193#define WM8994_AIF2_EQ_BAND_2_A 0x585
194#define WM8994_AIF2_EQ_BAND_2_B 0x586
195#define WM8994_AIF2_EQ_BAND_2_C 0x587
196#define WM8994_AIF2_EQ_BAND_2_PG 0x588
197#define WM8994_AIF2_EQ_BAND_3_A 0x589
198#define WM8994_AIF2_EQ_BAND_3_B 0x58A
199#define WM8994_AIF2_EQ_BAND_3_C 0x58B
200#define WM8994_AIF2_EQ_BAND_3_PG 0x58C
201#define WM8994_AIF2_EQ_BAND_4_A 0x58D
202#define WM8994_AIF2_EQ_BAND_4_B 0x58E
203#define WM8994_AIF2_EQ_BAND_4_C 0x58F
204#define WM8994_AIF2_EQ_BAND_4_PG 0x590
205#define WM8994_AIF2_EQ_BAND_5_A 0x591
206#define WM8994_AIF2_EQ_BAND_5_B 0x592
207#define WM8994_AIF2_EQ_BAND_5_PG 0x593
208#define WM8994_DAC1_MIXER_VOLUMES 0x600
209#define WM8994_DAC1_LEFT_MIXER_ROUTING 0x601
210#define WM8994_DAC1_RIGHT_MIXER_ROUTING 0x602
211#define WM8994_DAC2_MIXER_VOLUMES 0x603
212#define WM8994_DAC2_LEFT_MIXER_ROUTING 0x604
213#define WM8994_DAC2_RIGHT_MIXER_ROUTING 0x605
214#define WM8994_AIF1_ADC1_LEFT_MIXER_ROUTING 0x606
215#define WM8994_AIF1_ADC1_RIGHT_MIXER_ROUTING 0x607
216#define WM8994_AIF1_ADC2_LEFT_MIXER_ROUTING 0x608
217#define WM8994_AIF1_ADC2_RIGHT_MIXER_ROUTING 0x609
218#define WM8994_DAC1_LEFT_VOLUME 0x610
219#define WM8994_DAC1_RIGHT_VOLUME 0x611
220#define WM8994_DAC2_LEFT_VOLUME 0x612
221#define WM8994_DAC2_RIGHT_VOLUME 0x613
222#define WM8994_DAC_SOFTMUTE 0x614
223#define WM8994_OVERSAMPLING 0x620
224#define WM8994_SIDETONE 0x621
225#define WM8994_GPIO_1 0x700
226#define WM8994_GPIO_2 0x701
227#define WM8994_GPIO_3 0x702
228#define WM8994_GPIO_4 0x703
229#define WM8994_GPIO_5 0x704
230#define WM8994_GPIO_6 0x705
231#define WM8994_GPIO_7 0x706
232#define WM8994_GPIO_8 0x707
233#define WM8994_GPIO_9 0x708
234#define WM8994_GPIO_10 0x709
235#define WM8994_GPIO_11 0x70A
236#define WM8994_PULL_CONTROL_1 0x720
237#define WM8994_PULL_CONTROL_2 0x721
238#define WM8994_INTERRUPT_STATUS_1 0x730
239#define WM8994_INTERRUPT_STATUS_2 0x731
240#define WM8994_INTERRUPT_RAW_STATUS_2 0x732
241#define WM8994_INTERRUPT_STATUS_1_MASK 0x738
242#define WM8994_INTERRUPT_STATUS_2_MASK 0x739
243#define WM8994_INTERRUPT_CONTROL 0x740
244#define WM8994_IRQ_DEBOUNCE 0x748
245#define WM8994_WRITE_SEQUENCER_0 0x3000
246#define WM8994_WRITE_SEQUENCER_1 0x3001
247#define WM8994_WRITE_SEQUENCER_2 0x3002
248#define WM8994_WRITE_SEQUENCER_3 0x3003
249#define WM8994_WRITE_SEQUENCER_4 0x3004
250#define WM8994_WRITE_SEQUENCER_5 0x3005
251#define WM8994_WRITE_SEQUENCER_6 0x3006
252#define WM8994_WRITE_SEQUENCER_7 0x3007
253#define WM8994_WRITE_SEQUENCER_8 0x3008
254#define WM8994_WRITE_SEQUENCER_9 0x3009
255#define WM8994_WRITE_SEQUENCER_10 0x300A
256#define WM8994_WRITE_SEQUENCER_11 0x300B
257#define WM8994_WRITE_SEQUENCER_12 0x300C
258#define WM8994_WRITE_SEQUENCER_13 0x300D
259#define WM8994_WRITE_SEQUENCER_14 0x300E
260#define WM8994_WRITE_SEQUENCER_15 0x300F
261#define WM8994_WRITE_SEQUENCER_16 0x3010
262#define WM8994_WRITE_SEQUENCER_17 0x3011
263#define WM8994_WRITE_SEQUENCER_18 0x3012
264#define WM8994_WRITE_SEQUENCER_19 0x3013
265#define WM8994_WRITE_SEQUENCER_20 0x3014
266#define WM8994_WRITE_SEQUENCER_21 0x3015
267#define WM8994_WRITE_SEQUENCER_22 0x3016
268#define WM8994_WRITE_SEQUENCER_23 0x3017
269#define WM8994_WRITE_SEQUENCER_24 0x3018
270#define WM8994_WRITE_SEQUENCER_25 0x3019
271#define WM8994_WRITE_SEQUENCER_26 0x301A
272#define WM8994_WRITE_SEQUENCER_27 0x301B
273#define WM8994_WRITE_SEQUENCER_28 0x301C
274#define WM8994_WRITE_SEQUENCER_29 0x301D
275#define WM8994_WRITE_SEQUENCER_30 0x301E
276#define WM8994_WRITE_SEQUENCER_31 0x301F
277#define WM8994_WRITE_SEQUENCER_32 0x3020
278#define WM8994_WRITE_SEQUENCER_33 0x3021
279#define WM8994_WRITE_SEQUENCER_34 0x3022
280#define WM8994_WRITE_SEQUENCER_35 0x3023
281#define WM8994_WRITE_SEQUENCER_36 0x3024
282#define WM8994_WRITE_SEQUENCER_37 0x3025
283#define WM8994_WRITE_SEQUENCER_38 0x3026
284#define WM8994_WRITE_SEQUENCER_39 0x3027
285#define WM8994_WRITE_SEQUENCER_40 0x3028
286#define WM8994_WRITE_SEQUENCER_41 0x3029
287#define WM8994_WRITE_SEQUENCER_42 0x302A
288#define WM8994_WRITE_SEQUENCER_43 0x302B
289#define WM8994_WRITE_SEQUENCER_44 0x302C
290#define WM8994_WRITE_SEQUENCER_45 0x302D
291#define WM8994_WRITE_SEQUENCER_46 0x302E
292#define WM8994_WRITE_SEQUENCER_47 0x302F
293#define WM8994_WRITE_SEQUENCER_48 0x3030
294#define WM8994_WRITE_SEQUENCER_49 0x3031
295#define WM8994_WRITE_SEQUENCER_50 0x3032
296#define WM8994_WRITE_SEQUENCER_51 0x3033
297#define WM8994_WRITE_SEQUENCER_52 0x3034
298#define WM8994_WRITE_SEQUENCER_53 0x3035
299#define WM8994_WRITE_SEQUENCER_54 0x3036
300#define WM8994_WRITE_SEQUENCER_55 0x3037
301#define WM8994_WRITE_SEQUENCER_56 0x3038
302#define WM8994_WRITE_SEQUENCER_57 0x3039
303#define WM8994_WRITE_SEQUENCER_58 0x303A
304#define WM8994_WRITE_SEQUENCER_59 0x303B
305#define WM8994_WRITE_SEQUENCER_60 0x303C
306#define WM8994_WRITE_SEQUENCER_61 0x303D
307#define WM8994_WRITE_SEQUENCER_62 0x303E
308#define WM8994_WRITE_SEQUENCER_63 0x303F
309#define WM8994_WRITE_SEQUENCER_64 0x3040
310#define WM8994_WRITE_SEQUENCER_65 0x3041
311#define WM8994_WRITE_SEQUENCER_66 0x3042
312#define WM8994_WRITE_SEQUENCER_67 0x3043
313#define WM8994_WRITE_SEQUENCER_68 0x3044
314#define WM8994_WRITE_SEQUENCER_69 0x3045
315#define WM8994_WRITE_SEQUENCER_70 0x3046
316#define WM8994_WRITE_SEQUENCER_71 0x3047
317#define WM8994_WRITE_SEQUENCER_72 0x3048
318#define WM8994_WRITE_SEQUENCER_73 0x3049
319#define WM8994_WRITE_SEQUENCER_74 0x304A
320#define WM8994_WRITE_SEQUENCER_75 0x304B
321#define WM8994_WRITE_SEQUENCER_76 0x304C
322#define WM8994_WRITE_SEQUENCER_77 0x304D
323#define WM8994_WRITE_SEQUENCER_78 0x304E
324#define WM8994_WRITE_SEQUENCER_79 0x304F
325#define WM8994_WRITE_SEQUENCER_80 0x3050
326#define WM8994_WRITE_SEQUENCER_81 0x3051
327#define WM8994_WRITE_SEQUENCER_82 0x3052
328#define WM8994_WRITE_SEQUENCER_83 0x3053
329#define WM8994_WRITE_SEQUENCER_84 0x3054
330#define WM8994_WRITE_SEQUENCER_85 0x3055
331#define WM8994_WRITE_SEQUENCER_86 0x3056
332#define WM8994_WRITE_SEQUENCER_87 0x3057
333#define WM8994_WRITE_SEQUENCER_88 0x3058
334#define WM8994_WRITE_SEQUENCER_89 0x3059
335#define WM8994_WRITE_SEQUENCER_90 0x305A
336#define WM8994_WRITE_SEQUENCER_91 0x305B
337#define WM8994_WRITE_SEQUENCER_92 0x305C
338#define WM8994_WRITE_SEQUENCER_93 0x305D
339#define WM8994_WRITE_SEQUENCER_94 0x305E
340#define WM8994_WRITE_SEQUENCER_95 0x305F
341#define WM8994_WRITE_SEQUENCER_96 0x3060
342#define WM8994_WRITE_SEQUENCER_97 0x3061
343#define WM8994_WRITE_SEQUENCER_98 0x3062
344#define WM8994_WRITE_SEQUENCER_99 0x3063
345#define WM8994_WRITE_SEQUENCER_100 0x3064
346#define WM8994_WRITE_SEQUENCER_101 0x3065
347#define WM8994_WRITE_SEQUENCER_102 0x3066
348#define WM8994_WRITE_SEQUENCER_103 0x3067
349#define WM8994_WRITE_SEQUENCER_104 0x3068
350#define WM8994_WRITE_SEQUENCER_105 0x3069
351#define WM8994_WRITE_SEQUENCER_106 0x306A
352#define WM8994_WRITE_SEQUENCER_107 0x306B
353#define WM8994_WRITE_SEQUENCER_108 0x306C
354#define WM8994_WRITE_SEQUENCER_109 0x306D
355#define WM8994_WRITE_SEQUENCER_110 0x306E
356#define WM8994_WRITE_SEQUENCER_111 0x306F
357#define WM8994_WRITE_SEQUENCER_112 0x3070
358#define WM8994_WRITE_SEQUENCER_113 0x3071
359#define WM8994_WRITE_SEQUENCER_114 0x3072
360#define WM8994_WRITE_SEQUENCER_115 0x3073
361#define WM8994_WRITE_SEQUENCER_116 0x3074
362#define WM8994_WRITE_SEQUENCER_117 0x3075
363#define WM8994_WRITE_SEQUENCER_118 0x3076
364#define WM8994_WRITE_SEQUENCER_119 0x3077
365#define WM8994_WRITE_SEQUENCER_120 0x3078
366#define WM8994_WRITE_SEQUENCER_121 0x3079
367#define WM8994_WRITE_SEQUENCER_122 0x307A
368#define WM8994_WRITE_SEQUENCER_123 0x307B
369#define WM8994_WRITE_SEQUENCER_124 0x307C
370#define WM8994_WRITE_SEQUENCER_125 0x307D
371#define WM8994_WRITE_SEQUENCER_126 0x307E
372#define WM8994_WRITE_SEQUENCER_127 0x307F
373#define WM8994_WRITE_SEQUENCER_128 0x3080
374#define WM8994_WRITE_SEQUENCER_129 0x3081
375#define WM8994_WRITE_SEQUENCER_130 0x3082
376#define WM8994_WRITE_SEQUENCER_131 0x3083
377#define WM8994_WRITE_SEQUENCER_132 0x3084
378#define WM8994_WRITE_SEQUENCER_133 0x3085
379#define WM8994_WRITE_SEQUENCER_134 0x3086
380#define WM8994_WRITE_SEQUENCER_135 0x3087
381#define WM8994_WRITE_SEQUENCER_136 0x3088
382#define WM8994_WRITE_SEQUENCER_137 0x3089
383#define WM8994_WRITE_SEQUENCER_138 0x308A
384#define WM8994_WRITE_SEQUENCER_139 0x308B
385#define WM8994_WRITE_SEQUENCER_140 0x308C
386#define WM8994_WRITE_SEQUENCER_141 0x308D
387#define WM8994_WRITE_SEQUENCER_142 0x308E
388#define WM8994_WRITE_SEQUENCER_143 0x308F
389#define WM8994_WRITE_SEQUENCER_144 0x3090
390#define WM8994_WRITE_SEQUENCER_145 0x3091
391#define WM8994_WRITE_SEQUENCER_146 0x3092
392#define WM8994_WRITE_SEQUENCER_147 0x3093
393#define WM8994_WRITE_SEQUENCER_148 0x3094
394#define WM8994_WRITE_SEQUENCER_149 0x3095
395#define WM8994_WRITE_SEQUENCER_150 0x3096
396#define WM8994_WRITE_SEQUENCER_151 0x3097
397#define WM8994_WRITE_SEQUENCER_152 0x3098
398#define WM8994_WRITE_SEQUENCER_153 0x3099
399#define WM8994_WRITE_SEQUENCER_154 0x309A
400#define WM8994_WRITE_SEQUENCER_155 0x309B
401#define WM8994_WRITE_SEQUENCER_156 0x309C
402#define WM8994_WRITE_SEQUENCER_157 0x309D
403#define WM8994_WRITE_SEQUENCER_158 0x309E
404#define WM8994_WRITE_SEQUENCER_159 0x309F
405#define WM8994_WRITE_SEQUENCER_160 0x30A0
406#define WM8994_WRITE_SEQUENCER_161 0x30A1
407#define WM8994_WRITE_SEQUENCER_162 0x30A2
408#define WM8994_WRITE_SEQUENCER_163 0x30A3
409#define WM8994_WRITE_SEQUENCER_164 0x30A4
410#define WM8994_WRITE_SEQUENCER_165 0x30A5
411#define WM8994_WRITE_SEQUENCER_166 0x30A6
412#define WM8994_WRITE_SEQUENCER_167 0x30A7
413#define WM8994_WRITE_SEQUENCER_168 0x30A8
414#define WM8994_WRITE_SEQUENCER_169 0x30A9
415#define WM8994_WRITE_SEQUENCER_170 0x30AA
416#define WM8994_WRITE_SEQUENCER_171 0x30AB
417#define WM8994_WRITE_SEQUENCER_172 0x30AC
418#define WM8994_WRITE_SEQUENCER_173 0x30AD
419#define WM8994_WRITE_SEQUENCER_174 0x30AE
420#define WM8994_WRITE_SEQUENCER_175 0x30AF
421#define WM8994_WRITE_SEQUENCER_176 0x30B0
422#define WM8994_WRITE_SEQUENCER_177 0x30B1
423#define WM8994_WRITE_SEQUENCER_178 0x30B2
424#define WM8994_WRITE_SEQUENCER_179 0x30B3
425#define WM8994_WRITE_SEQUENCER_180 0x30B4
426#define WM8994_WRITE_SEQUENCER_181 0x30B5
427#define WM8994_WRITE_SEQUENCER_182 0x30B6
428#define WM8994_WRITE_SEQUENCER_183 0x30B7
429#define WM8994_WRITE_SEQUENCER_184 0x30B8
430#define WM8994_WRITE_SEQUENCER_185 0x30B9
431#define WM8994_WRITE_SEQUENCER_186 0x30BA
432#define WM8994_WRITE_SEQUENCER_187 0x30BB
433#define WM8994_WRITE_SEQUENCER_188 0x30BC
434#define WM8994_WRITE_SEQUENCER_189 0x30BD
435#define WM8994_WRITE_SEQUENCER_190 0x30BE
436#define WM8994_WRITE_SEQUENCER_191 0x30BF
437#define WM8994_WRITE_SEQUENCER_192 0x30C0
438#define WM8994_WRITE_SEQUENCER_193 0x30C1
439#define WM8994_WRITE_SEQUENCER_194 0x30C2
440#define WM8994_WRITE_SEQUENCER_195 0x30C3
441#define WM8994_WRITE_SEQUENCER_196 0x30C4
442#define WM8994_WRITE_SEQUENCER_197 0x30C5
443#define WM8994_WRITE_SEQUENCER_198 0x30C6
444#define WM8994_WRITE_SEQUENCER_199 0x30C7
445#define WM8994_WRITE_SEQUENCER_200 0x30C8
446#define WM8994_WRITE_SEQUENCER_201 0x30C9
447#define WM8994_WRITE_SEQUENCER_202 0x30CA
448#define WM8994_WRITE_SEQUENCER_203 0x30CB
449#define WM8994_WRITE_SEQUENCER_204 0x30CC
450#define WM8994_WRITE_SEQUENCER_205 0x30CD
451#define WM8994_WRITE_SEQUENCER_206 0x30CE
452#define WM8994_WRITE_SEQUENCER_207 0x30CF
453#define WM8994_WRITE_SEQUENCER_208 0x30D0
454#define WM8994_WRITE_SEQUENCER_209 0x30D1
455#define WM8994_WRITE_SEQUENCER_210 0x30D2
456#define WM8994_WRITE_SEQUENCER_211 0x30D3
457#define WM8994_WRITE_SEQUENCER_212 0x30D4
458#define WM8994_WRITE_SEQUENCER_213 0x30D5
459#define WM8994_WRITE_SEQUENCER_214 0x30D6
460#define WM8994_WRITE_SEQUENCER_215 0x30D7
461#define WM8994_WRITE_SEQUENCER_216 0x30D8
462#define WM8994_WRITE_SEQUENCER_217 0x30D9
463#define WM8994_WRITE_SEQUENCER_218 0x30DA
464#define WM8994_WRITE_SEQUENCER_219 0x30DB
465#define WM8994_WRITE_SEQUENCER_220 0x30DC
466#define WM8994_WRITE_SEQUENCER_221 0x30DD
467#define WM8994_WRITE_SEQUENCER_222 0x30DE
468#define WM8994_WRITE_SEQUENCER_223 0x30DF
469#define WM8994_WRITE_SEQUENCER_224 0x30E0
470#define WM8994_WRITE_SEQUENCER_225 0x30E1
471#define WM8994_WRITE_SEQUENCER_226 0x30E2
472#define WM8994_WRITE_SEQUENCER_227 0x30E3
473#define WM8994_WRITE_SEQUENCER_228 0x30E4
474#define WM8994_WRITE_SEQUENCER_229 0x30E5
475#define WM8994_WRITE_SEQUENCER_230 0x30E6
476#define WM8994_WRITE_SEQUENCER_231 0x30E7
477#define WM8994_WRITE_SEQUENCER_232 0x30E8
478#define WM8994_WRITE_SEQUENCER_233 0x30E9
479#define WM8994_WRITE_SEQUENCER_234 0x30EA
480#define WM8994_WRITE_SEQUENCER_235 0x30EB
481#define WM8994_WRITE_SEQUENCER_236 0x30EC
482#define WM8994_WRITE_SEQUENCER_237 0x30ED
483#define WM8994_WRITE_SEQUENCER_238 0x30EE
484#define WM8994_WRITE_SEQUENCER_239 0x30EF
485#define WM8994_WRITE_SEQUENCER_240 0x30F0
486#define WM8994_WRITE_SEQUENCER_241 0x30F1
487#define WM8994_WRITE_SEQUENCER_242 0x30F2
488#define WM8994_WRITE_SEQUENCER_243 0x30F3
489#define WM8994_WRITE_SEQUENCER_244 0x30F4
490#define WM8994_WRITE_SEQUENCER_245 0x30F5
491#define WM8994_WRITE_SEQUENCER_246 0x30F6
492#define WM8994_WRITE_SEQUENCER_247 0x30F7
493#define WM8994_WRITE_SEQUENCER_248 0x30F8
494#define WM8994_WRITE_SEQUENCER_249 0x30F9
495#define WM8994_WRITE_SEQUENCER_250 0x30FA
496#define WM8994_WRITE_SEQUENCER_251 0x30FB
497#define WM8994_WRITE_SEQUENCER_252 0x30FC
498#define WM8994_WRITE_SEQUENCER_253 0x30FD
499#define WM8994_WRITE_SEQUENCER_254 0x30FE
500#define WM8994_WRITE_SEQUENCER_255 0x30FF
501#define WM8994_WRITE_SEQUENCER_256 0x3100
502#define WM8994_WRITE_SEQUENCER_257 0x3101
503#define WM8994_WRITE_SEQUENCER_258 0x3102
504#define WM8994_WRITE_SEQUENCER_259 0x3103
505#define WM8994_WRITE_SEQUENCER_260 0x3104
506#define WM8994_WRITE_SEQUENCER_261 0x3105
507#define WM8994_WRITE_SEQUENCER_262 0x3106
508#define WM8994_WRITE_SEQUENCER_263 0x3107
509#define WM8994_WRITE_SEQUENCER_264 0x3108
510#define WM8994_WRITE_SEQUENCER_265 0x3109
511#define WM8994_WRITE_SEQUENCER_266 0x310A
512#define WM8994_WRITE_SEQUENCER_267 0x310B
513#define WM8994_WRITE_SEQUENCER_268 0x310C
514#define WM8994_WRITE_SEQUENCER_269 0x310D
515#define WM8994_WRITE_SEQUENCER_270 0x310E
516#define WM8994_WRITE_SEQUENCER_271 0x310F
517#define WM8994_WRITE_SEQUENCER_272 0x3110
518#define WM8994_WRITE_SEQUENCER_273 0x3111
519#define WM8994_WRITE_SEQUENCER_274 0x3112
520#define WM8994_WRITE_SEQUENCER_275 0x3113
521#define WM8994_WRITE_SEQUENCER_276 0x3114
522#define WM8994_WRITE_SEQUENCER_277 0x3115
523#define WM8994_WRITE_SEQUENCER_278 0x3116
524#define WM8994_WRITE_SEQUENCER_279 0x3117
525#define WM8994_WRITE_SEQUENCER_280 0x3118
526#define WM8994_WRITE_SEQUENCER_281 0x3119
527#define WM8994_WRITE_SEQUENCER_282 0x311A
528#define WM8994_WRITE_SEQUENCER_283 0x311B
529#define WM8994_WRITE_SEQUENCER_284 0x311C
530#define WM8994_WRITE_SEQUENCER_285 0x311D
531#define WM8994_WRITE_SEQUENCER_286 0x311E
532#define WM8994_WRITE_SEQUENCER_287 0x311F
533#define WM8994_WRITE_SEQUENCER_288 0x3120
534#define WM8994_WRITE_SEQUENCER_289 0x3121
535#define WM8994_WRITE_SEQUENCER_290 0x3122
536#define WM8994_WRITE_SEQUENCER_291 0x3123
537#define WM8994_WRITE_SEQUENCER_292 0x3124
538#define WM8994_WRITE_SEQUENCER_293 0x3125
539#define WM8994_WRITE_SEQUENCER_294 0x3126
540#define WM8994_WRITE_SEQUENCER_295 0x3127
541#define WM8994_WRITE_SEQUENCER_296 0x3128
542#define WM8994_WRITE_SEQUENCER_297 0x3129
543#define WM8994_WRITE_SEQUENCER_298 0x312A
544#define WM8994_WRITE_SEQUENCER_299 0x312B
545#define WM8994_WRITE_SEQUENCER_300 0x312C
546#define WM8994_WRITE_SEQUENCER_301 0x312D
547#define WM8994_WRITE_SEQUENCER_302 0x312E
548#define WM8994_WRITE_SEQUENCER_303 0x312F
549#define WM8994_WRITE_SEQUENCER_304 0x3130
550#define WM8994_WRITE_SEQUENCER_305 0x3131
551#define WM8994_WRITE_SEQUENCER_306 0x3132
552#define WM8994_WRITE_SEQUENCER_307 0x3133
553#define WM8994_WRITE_SEQUENCER_308 0x3134
554#define WM8994_WRITE_SEQUENCER_309 0x3135
555#define WM8994_WRITE_SEQUENCER_310 0x3136
556#define WM8994_WRITE_SEQUENCER_311 0x3137
557#define WM8994_WRITE_SEQUENCER_312 0x3138
558#define WM8994_WRITE_SEQUENCER_313 0x3139
559#define WM8994_WRITE_SEQUENCER_314 0x313A
560#define WM8994_WRITE_SEQUENCER_315 0x313B
561#define WM8994_WRITE_SEQUENCER_316 0x313C
562#define WM8994_WRITE_SEQUENCER_317 0x313D
563#define WM8994_WRITE_SEQUENCER_318 0x313E
564#define WM8994_WRITE_SEQUENCER_319 0x313F
565#define WM8994_WRITE_SEQUENCER_320 0x3140
566#define WM8994_WRITE_SEQUENCER_321 0x3141
567#define WM8994_WRITE_SEQUENCER_322 0x3142
568#define WM8994_WRITE_SEQUENCER_323 0x3143
569#define WM8994_WRITE_SEQUENCER_324 0x3144
570#define WM8994_WRITE_SEQUENCER_325 0x3145
571#define WM8994_WRITE_SEQUENCER_326 0x3146
572#define WM8994_WRITE_SEQUENCER_327 0x3147
573#define WM8994_WRITE_SEQUENCER_328 0x3148
574#define WM8994_WRITE_SEQUENCER_329 0x3149
575#define WM8994_WRITE_SEQUENCER_330 0x314A
576#define WM8994_WRITE_SEQUENCER_331 0x314B
577#define WM8994_WRITE_SEQUENCER_332 0x314C
578#define WM8994_WRITE_SEQUENCER_333 0x314D
579#define WM8994_WRITE_SEQUENCER_334 0x314E
580#define WM8994_WRITE_SEQUENCER_335 0x314F
581#define WM8994_WRITE_SEQUENCER_336 0x3150
582#define WM8994_WRITE_SEQUENCER_337 0x3151
583#define WM8994_WRITE_SEQUENCER_338 0x3152
584#define WM8994_WRITE_SEQUENCER_339 0x3153
585#define WM8994_WRITE_SEQUENCER_340 0x3154
586#define WM8994_WRITE_SEQUENCER_341 0x3155
587#define WM8994_WRITE_SEQUENCER_342 0x3156
588#define WM8994_WRITE_SEQUENCER_343 0x3157
589#define WM8994_WRITE_SEQUENCER_344 0x3158
590#define WM8994_WRITE_SEQUENCER_345 0x3159
591#define WM8994_WRITE_SEQUENCER_346 0x315A
592#define WM8994_WRITE_SEQUENCER_347 0x315B
593#define WM8994_WRITE_SEQUENCER_348 0x315C
594#define WM8994_WRITE_SEQUENCER_349 0x315D
595#define WM8994_WRITE_SEQUENCER_350 0x315E
596#define WM8994_WRITE_SEQUENCER_351 0x315F
597#define WM8994_WRITE_SEQUENCER_352 0x3160
598#define WM8994_WRITE_SEQUENCER_353 0x3161
599#define WM8994_WRITE_SEQUENCER_354 0x3162
600#define WM8994_WRITE_SEQUENCER_355 0x3163
601#define WM8994_WRITE_SEQUENCER_356 0x3164
602#define WM8994_WRITE_SEQUENCER_357 0x3165
603#define WM8994_WRITE_SEQUENCER_358 0x3166
604#define WM8994_WRITE_SEQUENCER_359 0x3167
605#define WM8994_WRITE_SEQUENCER_360 0x3168
606#define WM8994_WRITE_SEQUENCER_361 0x3169
607#define WM8994_WRITE_SEQUENCER_362 0x316A
608#define WM8994_WRITE_SEQUENCER_363 0x316B
609#define WM8994_WRITE_SEQUENCER_364 0x316C
610#define WM8994_WRITE_SEQUENCER_365 0x316D
611#define WM8994_WRITE_SEQUENCER_366 0x316E
612#define WM8994_WRITE_SEQUENCER_367 0x316F
613#define WM8994_WRITE_SEQUENCER_368 0x3170
614#define WM8994_WRITE_SEQUENCER_369 0x3171
615#define WM8994_WRITE_SEQUENCER_370 0x3172
616#define WM8994_WRITE_SEQUENCER_371 0x3173
617#define WM8994_WRITE_SEQUENCER_372 0x3174
618#define WM8994_WRITE_SEQUENCER_373 0x3175
619#define WM8994_WRITE_SEQUENCER_374 0x3176
620#define WM8994_WRITE_SEQUENCER_375 0x3177
621#define WM8994_WRITE_SEQUENCER_376 0x3178
622#define WM8994_WRITE_SEQUENCER_377 0x3179
623#define WM8994_WRITE_SEQUENCER_378 0x317A
624#define WM8994_WRITE_SEQUENCER_379 0x317B
625#define WM8994_WRITE_SEQUENCER_380 0x317C
626#define WM8994_WRITE_SEQUENCER_381 0x317D
627#define WM8994_WRITE_SEQUENCER_382 0x317E
628#define WM8994_WRITE_SEQUENCER_383 0x317F
629#define WM8994_WRITE_SEQUENCER_384 0x3180
630#define WM8994_WRITE_SEQUENCER_385 0x3181
631#define WM8994_WRITE_SEQUENCER_386 0x3182
632#define WM8994_WRITE_SEQUENCER_387 0x3183
633#define WM8994_WRITE_SEQUENCER_388 0x3184
634#define WM8994_WRITE_SEQUENCER_389 0x3185
635#define WM8994_WRITE_SEQUENCER_390 0x3186
636#define WM8994_WRITE_SEQUENCER_391 0x3187
637#define WM8994_WRITE_SEQUENCER_392 0x3188
638#define WM8994_WRITE_SEQUENCER_393 0x3189
639#define WM8994_WRITE_SEQUENCER_394 0x318A
640#define WM8994_WRITE_SEQUENCER_395 0x318B
641#define WM8994_WRITE_SEQUENCER_396 0x318C
642#define WM8994_WRITE_SEQUENCER_397 0x318D
643#define WM8994_WRITE_SEQUENCER_398 0x318E
644#define WM8994_WRITE_SEQUENCER_399 0x318F
645#define WM8994_WRITE_SEQUENCER_400 0x3190
646#define WM8994_WRITE_SEQUENCER_401 0x3191
647#define WM8994_WRITE_SEQUENCER_402 0x3192
648#define WM8994_WRITE_SEQUENCER_403 0x3193
649#define WM8994_WRITE_SEQUENCER_404 0x3194
650#define WM8994_WRITE_SEQUENCER_405 0x3195
651#define WM8994_WRITE_SEQUENCER_406 0x3196
652#define WM8994_WRITE_SEQUENCER_407 0x3197
653#define WM8994_WRITE_SEQUENCER_408 0x3198
654#define WM8994_WRITE_SEQUENCER_409 0x3199
655#define WM8994_WRITE_SEQUENCER_410 0x319A
656#define WM8994_WRITE_SEQUENCER_411 0x319B
657#define WM8994_WRITE_SEQUENCER_412 0x319C
658#define WM8994_WRITE_SEQUENCER_413 0x319D
659#define WM8994_WRITE_SEQUENCER_414 0x319E
660#define WM8994_WRITE_SEQUENCER_415 0x319F
661#define WM8994_WRITE_SEQUENCER_416 0x31A0
662#define WM8994_WRITE_SEQUENCER_417 0x31A1
663#define WM8994_WRITE_SEQUENCER_418 0x31A2
664#define WM8994_WRITE_SEQUENCER_419 0x31A3
665#define WM8994_WRITE_SEQUENCER_420 0x31A4
666#define WM8994_WRITE_SEQUENCER_421 0x31A5
667#define WM8994_WRITE_SEQUENCER_422 0x31A6
668#define WM8994_WRITE_SEQUENCER_423 0x31A7
669#define WM8994_WRITE_SEQUENCER_424 0x31A8
670#define WM8994_WRITE_SEQUENCER_425 0x31A9
671#define WM8994_WRITE_SEQUENCER_426 0x31AA
672#define WM8994_WRITE_SEQUENCER_427 0x31AB
673#define WM8994_WRITE_SEQUENCER_428 0x31AC
674#define WM8994_WRITE_SEQUENCER_429 0x31AD
675#define WM8994_WRITE_SEQUENCER_430 0x31AE
676#define WM8994_WRITE_SEQUENCER_431 0x31AF
677#define WM8994_WRITE_SEQUENCER_432 0x31B0
678#define WM8994_WRITE_SEQUENCER_433 0x31B1
679#define WM8994_WRITE_SEQUENCER_434 0x31B2
680#define WM8994_WRITE_SEQUENCER_435 0x31B3
681#define WM8994_WRITE_SEQUENCER_436 0x31B4
682#define WM8994_WRITE_SEQUENCER_437 0x31B5
683#define WM8994_WRITE_SEQUENCER_438 0x31B6
684#define WM8994_WRITE_SEQUENCER_439 0x31B7
685#define WM8994_WRITE_SEQUENCER_440 0x31B8
686#define WM8994_WRITE_SEQUENCER_441 0x31B9
687#define WM8994_WRITE_SEQUENCER_442 0x31BA
688#define WM8994_WRITE_SEQUENCER_443 0x31BB
689#define WM8994_WRITE_SEQUENCER_444 0x31BC
690#define WM8994_WRITE_SEQUENCER_445 0x31BD
691#define WM8994_WRITE_SEQUENCER_446 0x31BE
692#define WM8994_WRITE_SEQUENCER_447 0x31BF
693#define WM8994_WRITE_SEQUENCER_448 0x31C0
694#define WM8994_WRITE_SEQUENCER_449 0x31C1
695#define WM8994_WRITE_SEQUENCER_450 0x31C2
696#define WM8994_WRITE_SEQUENCER_451 0x31C3
697#define WM8994_WRITE_SEQUENCER_452 0x31C4
698#define WM8994_WRITE_SEQUENCER_453 0x31C5
699#define WM8994_WRITE_SEQUENCER_454 0x31C6
700#define WM8994_WRITE_SEQUENCER_455 0x31C7
701#define WM8994_WRITE_SEQUENCER_456 0x31C8
702#define WM8994_WRITE_SEQUENCER_457 0x31C9
703#define WM8994_WRITE_SEQUENCER_458 0x31CA
704#define WM8994_WRITE_SEQUENCER_459 0x31CB
705#define WM8994_WRITE_SEQUENCER_460 0x31CC
706#define WM8994_WRITE_SEQUENCER_461 0x31CD
707#define WM8994_WRITE_SEQUENCER_462 0x31CE
708#define WM8994_WRITE_SEQUENCER_463 0x31CF
709#define WM8994_WRITE_SEQUENCER_464 0x31D0
710#define WM8994_WRITE_SEQUENCER_465 0x31D1
711#define WM8994_WRITE_SEQUENCER_466 0x31D2
712#define WM8994_WRITE_SEQUENCER_467 0x31D3
713#define WM8994_WRITE_SEQUENCER_468 0x31D4
714#define WM8994_WRITE_SEQUENCER_469 0x31D5
715#define WM8994_WRITE_SEQUENCER_470 0x31D6
716#define WM8994_WRITE_SEQUENCER_471 0x31D7
717#define WM8994_WRITE_SEQUENCER_472 0x31D8
718#define WM8994_WRITE_SEQUENCER_473 0x31D9
719#define WM8994_WRITE_SEQUENCER_474 0x31DA
720#define WM8994_WRITE_SEQUENCER_475 0x31DB
721#define WM8994_WRITE_SEQUENCER_476 0x31DC
722#define WM8994_WRITE_SEQUENCER_477 0x31DD
723#define WM8994_WRITE_SEQUENCER_478 0x31DE
724#define WM8994_WRITE_SEQUENCER_479 0x31DF
725#define WM8994_WRITE_SEQUENCER_480 0x31E0
726#define WM8994_WRITE_SEQUENCER_481 0x31E1
727#define WM8994_WRITE_SEQUENCER_482 0x31E2
728#define WM8994_WRITE_SEQUENCER_483 0x31E3
729#define WM8994_WRITE_SEQUENCER_484 0x31E4
730#define WM8994_WRITE_SEQUENCER_485 0x31E5
731#define WM8994_WRITE_SEQUENCER_486 0x31E6
732#define WM8994_WRITE_SEQUENCER_487 0x31E7
733#define WM8994_WRITE_SEQUENCER_488 0x31E8
734#define WM8994_WRITE_SEQUENCER_489 0x31E9
735#define WM8994_WRITE_SEQUENCER_490 0x31EA
736#define WM8994_WRITE_SEQUENCER_491 0x31EB
737#define WM8994_WRITE_SEQUENCER_492 0x31EC
738#define WM8994_WRITE_SEQUENCER_493 0x31ED
739#define WM8994_WRITE_SEQUENCER_494 0x31EE
740#define WM8994_WRITE_SEQUENCER_495 0x31EF
741#define WM8994_WRITE_SEQUENCER_496 0x31F0
742#define WM8994_WRITE_SEQUENCER_497 0x31F1
743#define WM8994_WRITE_SEQUENCER_498 0x31F2
744#define WM8994_WRITE_SEQUENCER_499 0x31F3
745#define WM8994_WRITE_SEQUENCER_500 0x31F4
746#define WM8994_WRITE_SEQUENCER_501 0x31F5
747#define WM8994_WRITE_SEQUENCER_502 0x31F6
748#define WM8994_WRITE_SEQUENCER_503 0x31F7
749#define WM8994_WRITE_SEQUENCER_504 0x31F8
750#define WM8994_WRITE_SEQUENCER_505 0x31F9
751#define WM8994_WRITE_SEQUENCER_506 0x31FA
752#define WM8994_WRITE_SEQUENCER_507 0x31FB
753#define WM8994_WRITE_SEQUENCER_508 0x31FC
754#define WM8994_WRITE_SEQUENCER_509 0x31FD
755#define WM8994_WRITE_SEQUENCER_510 0x31FE
756#define WM8994_WRITE_SEQUENCER_511 0x31FF
757
758#define WM8994_REGISTER_COUNT 736
759#define WM8994_MAX_REGISTER 0x31FF
760#define WM8994_MAX_CACHED_REGISTER 0x749
761
762/*
763 * Field Definitions.
764 */
765
766/*
767 * R0 (0x00) - Software Reset
768 */
769#define WM8994_SW_RESET_MASK 0xFFFF /* SW_RESET - [15:0] */
770#define WM8994_SW_RESET_SHIFT 0 /* SW_RESET - [15:0] */
771#define WM8994_SW_RESET_WIDTH 16 /* SW_RESET - [15:0] */
772
773/*
774 * R1 (0x01) - Power Management (1)
775 */
776#define WM8994_SPKOUTR_ENA 0x2000 /* SPKOUTR_ENA */
777#define WM8994_SPKOUTR_ENA_MASK 0x2000 /* SPKOUTR_ENA */
778#define WM8994_SPKOUTR_ENA_SHIFT 13 /* SPKOUTR_ENA */
779#define WM8994_SPKOUTR_ENA_WIDTH 1 /* SPKOUTR_ENA */
780#define WM8994_SPKOUTL_ENA 0x1000 /* SPKOUTL_ENA */
781#define WM8994_SPKOUTL_ENA_MASK 0x1000 /* SPKOUTL_ENA */
782#define WM8994_SPKOUTL_ENA_SHIFT 12 /* SPKOUTL_ENA */
783#define WM8994_SPKOUTL_ENA_WIDTH 1 /* SPKOUTL_ENA */
784#define WM8994_HPOUT2_ENA 0x0800 /* HPOUT2_ENA */
785#define WM8994_HPOUT2_ENA_MASK 0x0800 /* HPOUT2_ENA */
786#define WM8994_HPOUT2_ENA_SHIFT 11 /* HPOUT2_ENA */
787#define WM8994_HPOUT2_ENA_WIDTH 1 /* HPOUT2_ENA */
788#define WM8994_HPOUT1L_ENA 0x0200 /* HPOUT1L_ENA */
789#define WM8994_HPOUT1L_ENA_MASK 0x0200 /* HPOUT1L_ENA */
790#define WM8994_HPOUT1L_ENA_SHIFT 9 /* HPOUT1L_ENA */
791#define WM8994_HPOUT1L_ENA_WIDTH 1 /* HPOUT1L_ENA */
792#define WM8994_HPOUT1R_ENA 0x0100 /* HPOUT1R_ENA */
793#define WM8994_HPOUT1R_ENA_MASK 0x0100 /* HPOUT1R_ENA */
794#define WM8994_HPOUT1R_ENA_SHIFT 8 /* HPOUT1R_ENA */
795#define WM8994_HPOUT1R_ENA_WIDTH 1 /* HPOUT1R_ENA */
796#define WM8994_MICB2_ENA 0x0020 /* MICB2_ENA */
797#define WM8994_MICB2_ENA_MASK 0x0020 /* MICB2_ENA */
798#define WM8994_MICB2_ENA_SHIFT 5 /* MICB2_ENA */
799#define WM8994_MICB2_ENA_WIDTH 1 /* MICB2_ENA */
800#define WM8994_MICB1_ENA 0x0010 /* MICB1_ENA */
801#define WM8994_MICB1_ENA_MASK 0x0010 /* MICB1_ENA */
802#define WM8994_MICB1_ENA_SHIFT 4 /* MICB1_ENA */
803#define WM8994_MICB1_ENA_WIDTH 1 /* MICB1_ENA */
804#define WM8994_VMID_SEL_MASK 0x0006 /* VMID_SEL - [2:1] */
805#define WM8994_VMID_SEL_SHIFT 1 /* VMID_SEL - [2:1] */
806#define WM8994_VMID_SEL_WIDTH 2 /* VMID_SEL - [2:1] */
807#define WM8994_BIAS_ENA 0x0001 /* BIAS_ENA */
808#define WM8994_BIAS_ENA_MASK 0x0001 /* BIAS_ENA */
809#define WM8994_BIAS_ENA_SHIFT 0 /* BIAS_ENA */
810#define WM8994_BIAS_ENA_WIDTH 1 /* BIAS_ENA */
811
812/*
813 * R2 (0x02) - Power Management (2)
814 */
815#define WM8994_TSHUT_ENA 0x4000 /* TSHUT_ENA */
816#define WM8994_TSHUT_ENA_MASK 0x4000 /* TSHUT_ENA */
817#define WM8994_TSHUT_ENA_SHIFT 14 /* TSHUT_ENA */
818#define WM8994_TSHUT_ENA_WIDTH 1 /* TSHUT_ENA */
819#define WM8994_TSHUT_OPDIS 0x2000 /* TSHUT_OPDIS */
820#define WM8994_TSHUT_OPDIS_MASK 0x2000 /* TSHUT_OPDIS */
821#define WM8994_TSHUT_OPDIS_SHIFT 13 /* TSHUT_OPDIS */
822#define WM8994_TSHUT_OPDIS_WIDTH 1 /* TSHUT_OPDIS */
823#define WM8994_OPCLK_ENA 0x0800 /* OPCLK_ENA */
824#define WM8994_OPCLK_ENA_MASK 0x0800 /* OPCLK_ENA */
825#define WM8994_OPCLK_ENA_SHIFT 11 /* OPCLK_ENA */
826#define WM8994_OPCLK_ENA_WIDTH 1 /* OPCLK_ENA */
827#define WM8994_MIXINL_ENA 0x0200 /* MIXINL_ENA */
828#define WM8994_MIXINL_ENA_MASK 0x0200 /* MIXINL_ENA */
829#define WM8994_MIXINL_ENA_SHIFT 9 /* MIXINL_ENA */
830#define WM8994_MIXINL_ENA_WIDTH 1 /* MIXINL_ENA */
831#define WM8994_MIXINR_ENA 0x0100 /* MIXINR_ENA */
832#define WM8994_MIXINR_ENA_MASK 0x0100 /* MIXINR_ENA */
833#define WM8994_MIXINR_ENA_SHIFT 8 /* MIXINR_ENA */
834#define WM8994_MIXINR_ENA_WIDTH 1 /* MIXINR_ENA */
835#define WM8994_IN2L_ENA 0x0080 /* IN2L_ENA */
836#define WM8994_IN2L_ENA_MASK 0x0080 /* IN2L_ENA */
837#define WM8994_IN2L_ENA_SHIFT 7 /* IN2L_ENA */
838#define WM8994_IN2L_ENA_WIDTH 1 /* IN2L_ENA */
839#define WM8994_IN1L_ENA 0x0040 /* IN1L_ENA */
840#define WM8994_IN1L_ENA_MASK 0x0040 /* IN1L_ENA */
841#define WM8994_IN1L_ENA_SHIFT 6 /* IN1L_ENA */
842#define WM8994_IN1L_ENA_WIDTH 1 /* IN1L_ENA */
843#define WM8994_IN2R_ENA 0x0020 /* IN2R_ENA */
844#define WM8994_IN2R_ENA_MASK 0x0020 /* IN2R_ENA */
845#define WM8994_IN2R_ENA_SHIFT 5 /* IN2R_ENA */
846#define WM8994_IN2R_ENA_WIDTH 1 /* IN2R_ENA */
847#define WM8994_IN1R_ENA 0x0010 /* IN1R_ENA */
848#define WM8994_IN1R_ENA_MASK 0x0010 /* IN1R_ENA */
849#define WM8994_IN1R_ENA_SHIFT 4 /* IN1R_ENA */
850#define WM8994_IN1R_ENA_WIDTH 1 /* IN1R_ENA */
851
852/*
853 * R3 (0x03) - Power Management (3)
854 */
855#define WM8994_LINEOUT1N_ENA 0x2000 /* LINEOUT1N_ENA */
856#define WM8994_LINEOUT1N_ENA_MASK 0x2000 /* LINEOUT1N_ENA */
857#define WM8994_LINEOUT1N_ENA_SHIFT 13 /* LINEOUT1N_ENA */
858#define WM8994_LINEOUT1N_ENA_WIDTH 1 /* LINEOUT1N_ENA */
859#define WM8994_LINEOUT1P_ENA 0x1000 /* LINEOUT1P_ENA */
860#define WM8994_LINEOUT1P_ENA_MASK 0x1000 /* LINEOUT1P_ENA */
861#define WM8994_LINEOUT1P_ENA_SHIFT 12 /* LINEOUT1P_ENA */
862#define WM8994_LINEOUT1P_ENA_WIDTH 1 /* LINEOUT1P_ENA */
863#define WM8994_LINEOUT2N_ENA 0x0800 /* LINEOUT2N_ENA */
864#define WM8994_LINEOUT2N_ENA_MASK 0x0800 /* LINEOUT2N_ENA */
865#define WM8994_LINEOUT2N_ENA_SHIFT 11 /* LINEOUT2N_ENA */
866#define WM8994_LINEOUT2N_ENA_WIDTH 1 /* LINEOUT2N_ENA */
867#define WM8994_LINEOUT2P_ENA 0x0400 /* LINEOUT2P_ENA */
868#define WM8994_LINEOUT2P_ENA_MASK 0x0400 /* LINEOUT2P_ENA */
869#define WM8994_LINEOUT2P_ENA_SHIFT 10 /* LINEOUT2P_ENA */
870#define WM8994_LINEOUT2P_ENA_WIDTH 1 /* LINEOUT2P_ENA */
871#define WM8994_SPKRVOL_ENA 0x0200 /* SPKRVOL_ENA */
872#define WM8994_SPKRVOL_ENA_MASK 0x0200 /* SPKRVOL_ENA */
873#define WM8994_SPKRVOL_ENA_SHIFT 9 /* SPKRVOL_ENA */
874#define WM8994_SPKRVOL_ENA_WIDTH 1 /* SPKRVOL_ENA */
875#define WM8994_SPKLVOL_ENA 0x0100 /* SPKLVOL_ENA */
876#define WM8994_SPKLVOL_ENA_MASK 0x0100 /* SPKLVOL_ENA */
877#define WM8994_SPKLVOL_ENA_SHIFT 8 /* SPKLVOL_ENA */
878#define WM8994_SPKLVOL_ENA_WIDTH 1 /* SPKLVOL_ENA */
879#define WM8994_MIXOUTLVOL_ENA 0x0080 /* MIXOUTLVOL_ENA */
880#define WM8994_MIXOUTLVOL_ENA_MASK 0x0080 /* MIXOUTLVOL_ENA */
881#define WM8994_MIXOUTLVOL_ENA_SHIFT 7 /* MIXOUTLVOL_ENA */
882#define WM8994_MIXOUTLVOL_ENA_WIDTH 1 /* MIXOUTLVOL_ENA */
883#define WM8994_MIXOUTRVOL_ENA 0x0040 /* MIXOUTRVOL_ENA */
884#define WM8994_MIXOUTRVOL_ENA_MASK 0x0040 /* MIXOUTRVOL_ENA */
885#define WM8994_MIXOUTRVOL_ENA_SHIFT 6 /* MIXOUTRVOL_ENA */
886#define WM8994_MIXOUTRVOL_ENA_WIDTH 1 /* MIXOUTRVOL_ENA */
887#define WM8994_MIXOUTL_ENA 0x0020 /* MIXOUTL_ENA */
888#define WM8994_MIXOUTL_ENA_MASK 0x0020 /* MIXOUTL_ENA */
889#define WM8994_MIXOUTL_ENA_SHIFT 5 /* MIXOUTL_ENA */
890#define WM8994_MIXOUTL_ENA_WIDTH 1 /* MIXOUTL_ENA */
891#define WM8994_MIXOUTR_ENA 0x0010 /* MIXOUTR_ENA */
892#define WM8994_MIXOUTR_ENA_MASK 0x0010 /* MIXOUTR_ENA */
893#define WM8994_MIXOUTR_ENA_SHIFT 4 /* MIXOUTR_ENA */
894#define WM8994_MIXOUTR_ENA_WIDTH 1 /* MIXOUTR_ENA */
895
896/*
897 * R4 (0x04) - Power Management (4)
898 */
899#define WM8994_AIF2ADCL_ENA 0x2000 /* AIF2ADCL_ENA */
900#define WM8994_AIF2ADCL_ENA_MASK 0x2000 /* AIF2ADCL_ENA */
901#define WM8994_AIF2ADCL_ENA_SHIFT 13 /* AIF2ADCL_ENA */
902#define WM8994_AIF2ADCL_ENA_WIDTH 1 /* AIF2ADCL_ENA */
903#define WM8994_AIF2ADCR_ENA 0x1000 /* AIF2ADCR_ENA */
904#define WM8994_AIF2ADCR_ENA_MASK 0x1000 /* AIF2ADCR_ENA */
905#define WM8994_AIF2ADCR_ENA_SHIFT 12 /* AIF2ADCR_ENA */
906#define WM8994_AIF2ADCR_ENA_WIDTH 1 /* AIF2ADCR_ENA */
907#define WM8994_AIF1ADC2L_ENA 0x0800 /* AIF1ADC2L_ENA */
908#define WM8994_AIF1ADC2L_ENA_MASK 0x0800 /* AIF1ADC2L_ENA */
909#define WM8994_AIF1ADC2L_ENA_SHIFT 11 /* AIF1ADC2L_ENA */
910#define WM8994_AIF1ADC2L_ENA_WIDTH 1 /* AIF1ADC2L_ENA */
911#define WM8994_AIF1ADC2R_ENA 0x0400 /* AIF1ADC2R_ENA */
912#define WM8994_AIF1ADC2R_ENA_MASK 0x0400 /* AIF1ADC2R_ENA */
913#define WM8994_AIF1ADC2R_ENA_SHIFT 10 /* AIF1ADC2R_ENA */
914#define WM8994_AIF1ADC2R_ENA_WIDTH 1 /* AIF1ADC2R_ENA */
915#define WM8994_AIF1ADC1L_ENA 0x0200 /* AIF1ADC1L_ENA */
916#define WM8994_AIF1ADC1L_ENA_MASK 0x0200 /* AIF1ADC1L_ENA */
917#define WM8994_AIF1ADC1L_ENA_SHIFT 9 /* AIF1ADC1L_ENA */
918#define WM8994_AIF1ADC1L_ENA_WIDTH 1 /* AIF1ADC1L_ENA */
919#define WM8994_AIF1ADC1R_ENA 0x0100 /* AIF1ADC1R_ENA */
920#define WM8994_AIF1ADC1R_ENA_MASK 0x0100 /* AIF1ADC1R_ENA */
921#define WM8994_AIF1ADC1R_ENA_SHIFT 8 /* AIF1ADC1R_ENA */
922#define WM8994_AIF1ADC1R_ENA_WIDTH 1 /* AIF1ADC1R_ENA */
923#define WM8994_DMIC2L_ENA 0x0020 /* DMIC2L_ENA */
924#define WM8994_DMIC2L_ENA_MASK 0x0020 /* DMIC2L_ENA */
925#define WM8994_DMIC2L_ENA_SHIFT 5 /* DMIC2L_ENA */
926#define WM8994_DMIC2L_ENA_WIDTH 1 /* DMIC2L_ENA */
927#define WM8994_DMIC2R_ENA 0x0010 /* DMIC2R_ENA */
928#define WM8994_DMIC2R_ENA_MASK 0x0010 /* DMIC2R_ENA */
929#define WM8994_DMIC2R_ENA_SHIFT 4 /* DMIC2R_ENA */
930#define WM8994_DMIC2R_ENA_WIDTH 1 /* DMIC2R_ENA */
931#define WM8994_DMIC1L_ENA 0x0008 /* DMIC1L_ENA */
932#define WM8994_DMIC1L_ENA_MASK 0x0008 /* DMIC1L_ENA */
933#define WM8994_DMIC1L_ENA_SHIFT 3 /* DMIC1L_ENA */
934#define WM8994_DMIC1L_ENA_WIDTH 1 /* DMIC1L_ENA */
935#define WM8994_DMIC1R_ENA 0x0004 /* DMIC1R_ENA */
936#define WM8994_DMIC1R_ENA_MASK 0x0004 /* DMIC1R_ENA */
937#define WM8994_DMIC1R_ENA_SHIFT 2 /* DMIC1R_ENA */
938#define WM8994_DMIC1R_ENA_WIDTH 1 /* DMIC1R_ENA */
939#define WM8994_ADCL_ENA 0x0002 /* ADCL_ENA */
940#define WM8994_ADCL_ENA_MASK 0x0002 /* ADCL_ENA */
941#define WM8994_ADCL_ENA_SHIFT 1 /* ADCL_ENA */
942#define WM8994_ADCL_ENA_WIDTH 1 /* ADCL_ENA */
943#define WM8994_ADCR_ENA 0x0001 /* ADCR_ENA */
944#define WM8994_ADCR_ENA_MASK 0x0001 /* ADCR_ENA */
945#define WM8994_ADCR_ENA_SHIFT 0 /* ADCR_ENA */
946#define WM8994_ADCR_ENA_WIDTH 1 /* ADCR_ENA */
947
948/*
949 * R5 (0x05) - Power Management (5)
950 */
951#define WM8994_AIF2DACL_ENA 0x2000 /* AIF2DACL_ENA */
952#define WM8994_AIF2DACL_ENA_MASK 0x2000 /* AIF2DACL_ENA */
953#define WM8994_AIF2DACL_ENA_SHIFT 13 /* AIF2DACL_ENA */
954#define WM8994_AIF2DACL_ENA_WIDTH 1 /* AIF2DACL_ENA */
955#define WM8994_AIF2DACR_ENA 0x1000 /* AIF2DACR_ENA */
956#define WM8994_AIF2DACR_ENA_MASK 0x1000 /* AIF2DACR_ENA */
957#define WM8994_AIF2DACR_ENA_SHIFT 12 /* AIF2DACR_ENA */
958#define WM8994_AIF2DACR_ENA_WIDTH 1 /* AIF2DACR_ENA */
959#define WM8994_AIF1DAC2L_ENA 0x0800 /* AIF1DAC2L_ENA */
960#define WM8994_AIF1DAC2L_ENA_MASK 0x0800 /* AIF1DAC2L_ENA */
961#define WM8994_AIF1DAC2L_ENA_SHIFT 11 /* AIF1DAC2L_ENA */
962#define WM8994_AIF1DAC2L_ENA_WIDTH 1 /* AIF1DAC2L_ENA */
963#define WM8994_AIF1DAC2R_ENA 0x0400 /* AIF1DAC2R_ENA */
964#define WM8994_AIF1DAC2R_ENA_MASK 0x0400 /* AIF1DAC2R_ENA */
965#define WM8994_AIF1DAC2R_ENA_SHIFT 10 /* AIF1DAC2R_ENA */
966#define WM8994_AIF1DAC2R_ENA_WIDTH 1 /* AIF1DAC2R_ENA */
967#define WM8994_AIF1DAC1L_ENA 0x0200 /* AIF1DAC1L_ENA */
968#define WM8994_AIF1DAC1L_ENA_MASK 0x0200 /* AIF1DAC1L_ENA */
969#define WM8994_AIF1DAC1L_ENA_SHIFT 9 /* AIF1DAC1L_ENA */
970#define WM8994_AIF1DAC1L_ENA_WIDTH 1 /* AIF1DAC1L_ENA */
971#define WM8994_AIF1DAC1R_ENA 0x0100 /* AIF1DAC1R_ENA */
972#define WM8994_AIF1DAC1R_ENA_MASK 0x0100 /* AIF1DAC1R_ENA */
973#define WM8994_AIF1DAC1R_ENA_SHIFT 8 /* AIF1DAC1R_ENA */
974#define WM8994_AIF1DAC1R_ENA_WIDTH 1 /* AIF1DAC1R_ENA */
975#define WM8994_DAC2L_ENA 0x0008 /* DAC2L_ENA */
976#define WM8994_DAC2L_ENA_MASK 0x0008 /* DAC2L_ENA */
977#define WM8994_DAC2L_ENA_SHIFT 3 /* DAC2L_ENA */
978#define WM8994_DAC2L_ENA_WIDTH 1 /* DAC2L_ENA */
979#define WM8994_DAC2R_ENA 0x0004 /* DAC2R_ENA */
980#define WM8994_DAC2R_ENA_MASK 0x0004 /* DAC2R_ENA */
981#define WM8994_DAC2R_ENA_SHIFT 2 /* DAC2R_ENA */
982#define WM8994_DAC2R_ENA_WIDTH 1 /* DAC2R_ENA */
983#define WM8994_DAC1L_ENA 0x0002 /* DAC1L_ENA */
984#define WM8994_DAC1L_ENA_MASK 0x0002 /* DAC1L_ENA */
985#define WM8994_DAC1L_ENA_SHIFT 1 /* DAC1L_ENA */
986#define WM8994_DAC1L_ENA_WIDTH 1 /* DAC1L_ENA */
987#define WM8994_DAC1R_ENA 0x0001 /* DAC1R_ENA */
988#define WM8994_DAC1R_ENA_MASK 0x0001 /* DAC1R_ENA */
989#define WM8994_DAC1R_ENA_SHIFT 0 /* DAC1R_ENA */
990#define WM8994_DAC1R_ENA_WIDTH 1 /* DAC1R_ENA */
991
992/*
993 * R6 (0x06) - Power Management (6)
994 */
995#define WM8994_AIF3_TRI 0x0020 /* AIF3_TRI */
996#define WM8994_AIF3_TRI_MASK 0x0020 /* AIF3_TRI */
997#define WM8994_AIF3_TRI_SHIFT 5 /* AIF3_TRI */
998#define WM8994_AIF3_TRI_WIDTH 1 /* AIF3_TRI */
999#define WM8994_AIF3_ADCDAT_SRC_MASK 0x0018 /* AIF3_ADCDAT_SRC - [4:3] */
1000#define WM8994_AIF3_ADCDAT_SRC_SHIFT 3 /* AIF3_ADCDAT_SRC - [4:3] */
1001#define WM8994_AIF3_ADCDAT_SRC_WIDTH 2 /* AIF3_ADCDAT_SRC - [4:3] */
1002#define WM8994_AIF2_ADCDAT_SRC 0x0004 /* AIF2_ADCDAT_SRC */
1003#define WM8994_AIF2_ADCDAT_SRC_MASK 0x0004 /* AIF2_ADCDAT_SRC */
1004#define WM8994_AIF2_ADCDAT_SRC_SHIFT 2 /* AIF2_ADCDAT_SRC */
1005#define WM8994_AIF2_ADCDAT_SRC_WIDTH 1 /* AIF2_ADCDAT_SRC */
1006#define WM8994_AIF2_DACDAT_SRC 0x0002 /* AIF2_DACDAT_SRC */
1007#define WM8994_AIF2_DACDAT_SRC_MASK 0x0002 /* AIF2_DACDAT_SRC */
1008#define WM8994_AIF2_DACDAT_SRC_SHIFT 1 /* AIF2_DACDAT_SRC */
1009#define WM8994_AIF2_DACDAT_SRC_WIDTH 1 /* AIF2_DACDAT_SRC */
1010#define WM8994_AIF1_DACDAT_SRC 0x0001 /* AIF1_DACDAT_SRC */
1011#define WM8994_AIF1_DACDAT_SRC_MASK 0x0001 /* AIF1_DACDAT_SRC */
1012#define WM8994_AIF1_DACDAT_SRC_SHIFT 0 /* AIF1_DACDAT_SRC */
1013#define WM8994_AIF1_DACDAT_SRC_WIDTH 1 /* AIF1_DACDAT_SRC */
1014
1015/*
1016 * R21 (0x15) - Input Mixer (1)
1017 */
1018#define WM8994_IN1RP_MIXINR_BOOST 0x0100 /* IN1RP_MIXINR_BOOST */
1019#define WM8994_IN1RP_MIXINR_BOOST_MASK 0x0100 /* IN1RP_MIXINR_BOOST */
1020#define WM8994_IN1RP_MIXINR_BOOST_SHIFT 8 /* IN1RP_MIXINR_BOOST */
1021#define WM8994_IN1RP_MIXINR_BOOST_WIDTH 1 /* IN1RP_MIXINR_BOOST */
1022#define WM8994_IN1LP_MIXINL_BOOST 0x0080 /* IN1LP_MIXINL_BOOST */
1023#define WM8994_IN1LP_MIXINL_BOOST_MASK 0x0080 /* IN1LP_MIXINL_BOOST */
1024#define WM8994_IN1LP_MIXINL_BOOST_SHIFT 7 /* IN1LP_MIXINL_BOOST */
1025#define WM8994_IN1LP_MIXINL_BOOST_WIDTH 1 /* IN1LP_MIXINL_BOOST */
1026#define WM8994_INPUTS_CLAMP 0x0040 /* INPUTS_CLAMP */
1027#define WM8994_INPUTS_CLAMP_MASK 0x0040 /* INPUTS_CLAMP */
1028#define WM8994_INPUTS_CLAMP_SHIFT 6 /* INPUTS_CLAMP */
1029#define WM8994_INPUTS_CLAMP_WIDTH 1 /* INPUTS_CLAMP */
1030
1031/*
1032 * R24 (0x18) - Left Line Input 1&2 Volume
1033 */
1034#define WM8994_IN1_VU 0x0100 /* IN1_VU */
1035#define WM8994_IN1_VU_MASK 0x0100 /* IN1_VU */
1036#define WM8994_IN1_VU_SHIFT 8 /* IN1_VU */
1037#define WM8994_IN1_VU_WIDTH 1 /* IN1_VU */
1038#define WM8994_IN1L_MUTE 0x0080 /* IN1L_MUTE */
1039#define WM8994_IN1L_MUTE_MASK 0x0080 /* IN1L_MUTE */
1040#define WM8994_IN1L_MUTE_SHIFT 7 /* IN1L_MUTE */
1041#define WM8994_IN1L_MUTE_WIDTH 1 /* IN1L_MUTE */
1042#define WM8994_IN1L_ZC 0x0040 /* IN1L_ZC */
1043#define WM8994_IN1L_ZC_MASK 0x0040 /* IN1L_ZC */
1044#define WM8994_IN1L_ZC_SHIFT 6 /* IN1L_ZC */
1045#define WM8994_IN1L_ZC_WIDTH 1 /* IN1L_ZC */
1046#define WM8994_IN1L_VOL_MASK 0x001F /* IN1L_VOL - [4:0] */
1047#define WM8994_IN1L_VOL_SHIFT 0 /* IN1L_VOL - [4:0] */
1048#define WM8994_IN1L_VOL_WIDTH 5 /* IN1L_VOL - [4:0] */
1049
1050/*
1051 * R25 (0x19) - Left Line Input 3&4 Volume
1052 */
1053#define WM8994_IN2_VU 0x0100 /* IN2_VU */
1054#define WM8994_IN2_VU_MASK 0x0100 /* IN2_VU */
1055#define WM8994_IN2_VU_SHIFT 8 /* IN2_VU */
1056#define WM8994_IN2_VU_WIDTH 1 /* IN2_VU */
1057#define WM8994_IN2L_MUTE 0x0080 /* IN2L_MUTE */
1058#define WM8994_IN2L_MUTE_MASK 0x0080 /* IN2L_MUTE */
1059#define WM8994_IN2L_MUTE_SHIFT 7 /* IN2L_MUTE */
1060#define WM8994_IN2L_MUTE_WIDTH 1 /* IN2L_MUTE */
1061#define WM8994_IN2L_ZC 0x0040 /* IN2L_ZC */
1062#define WM8994_IN2L_ZC_MASK 0x0040 /* IN2L_ZC */
1063#define WM8994_IN2L_ZC_SHIFT 6 /* IN2L_ZC */
1064#define WM8994_IN2L_ZC_WIDTH 1 /* IN2L_ZC */
1065#define WM8994_IN2L_VOL_MASK 0x001F /* IN2L_VOL - [4:0] */
1066#define WM8994_IN2L_VOL_SHIFT 0 /* IN2L_VOL - [4:0] */
1067#define WM8994_IN2L_VOL_WIDTH 5 /* IN2L_VOL - [4:0] */
1068
1069/*
1070 * R26 (0x1A) - Right Line Input 1&2 Volume
1071 */
1072#define WM8994_IN1_VU 0x0100 /* IN1_VU */
1073#define WM8994_IN1_VU_MASK 0x0100 /* IN1_VU */
1074#define WM8994_IN1_VU_SHIFT 8 /* IN1_VU */
1075#define WM8994_IN1_VU_WIDTH 1 /* IN1_VU */
1076#define WM8994_IN1R_MUTE 0x0080 /* IN1R_MUTE */
1077#define WM8994_IN1R_MUTE_MASK 0x0080 /* IN1R_MUTE */
1078#define WM8994_IN1R_MUTE_SHIFT 7 /* IN1R_MUTE */
1079#define WM8994_IN1R_MUTE_WIDTH 1 /* IN1R_MUTE */
1080#define WM8994_IN1R_ZC 0x0040 /* IN1R_ZC */
1081#define WM8994_IN1R_ZC_MASK 0x0040 /* IN1R_ZC */
1082#define WM8994_IN1R_ZC_SHIFT 6 /* IN1R_ZC */
1083#define WM8994_IN1R_ZC_WIDTH 1 /* IN1R_ZC */
1084#define WM8994_IN1R_VOL_MASK 0x001F /* IN1R_VOL - [4:0] */
1085#define WM8994_IN1R_VOL_SHIFT 0 /* IN1R_VOL - [4:0] */
1086#define WM8994_IN1R_VOL_WIDTH 5 /* IN1R_VOL - [4:0] */
1087
1088/*
1089 * R27 (0x1B) - Right Line Input 3&4 Volume
1090 */
1091#define WM8994_IN2_VU 0x0100 /* IN2_VU */
1092#define WM8994_IN2_VU_MASK 0x0100 /* IN2_VU */
1093#define WM8994_IN2_VU_SHIFT 8 /* IN2_VU */
1094#define WM8994_IN2_VU_WIDTH 1 /* IN2_VU */
1095#define WM8994_IN2R_MUTE 0x0080 /* IN2R_MUTE */
1096#define WM8994_IN2R_MUTE_MASK 0x0080 /* IN2R_MUTE */
1097#define WM8994_IN2R_MUTE_SHIFT 7 /* IN2R_MUTE */
1098#define WM8994_IN2R_MUTE_WIDTH 1 /* IN2R_MUTE */
1099#define WM8994_IN2R_ZC 0x0040 /* IN2R_ZC */
1100#define WM8994_IN2R_ZC_MASK 0x0040 /* IN2R_ZC */
1101#define WM8994_IN2R_ZC_SHIFT 6 /* IN2R_ZC */
1102#define WM8994_IN2R_ZC_WIDTH 1 /* IN2R_ZC */
1103#define WM8994_IN2R_VOL_MASK 0x001F /* IN2R_VOL - [4:0] */
1104#define WM8994_IN2R_VOL_SHIFT 0 /* IN2R_VOL - [4:0] */
1105#define WM8994_IN2R_VOL_WIDTH 5 /* IN2R_VOL - [4:0] */
1106
1107/*
1108 * R28 (0x1C) - Left Output Volume
1109 */
1110#define WM8994_HPOUT1_VU 0x0100 /* HPOUT1_VU */
1111#define WM8994_HPOUT1_VU_MASK 0x0100 /* HPOUT1_VU */
1112#define WM8994_HPOUT1_VU_SHIFT 8 /* HPOUT1_VU */
1113#define WM8994_HPOUT1_VU_WIDTH 1 /* HPOUT1_VU */
1114#define WM8994_HPOUT1L_ZC 0x0080 /* HPOUT1L_ZC */
1115#define WM8994_HPOUT1L_ZC_MASK 0x0080 /* HPOUT1L_ZC */
1116#define WM8994_HPOUT1L_ZC_SHIFT 7 /* HPOUT1L_ZC */
1117#define WM8994_HPOUT1L_ZC_WIDTH 1 /* HPOUT1L_ZC */
1118#define WM8994_HPOUT1L_MUTE_N 0x0040 /* HPOUT1L_MUTE_N */
1119#define WM8994_HPOUT1L_MUTE_N_MASK 0x0040 /* HPOUT1L_MUTE_N */
1120#define WM8994_HPOUT1L_MUTE_N_SHIFT 6 /* HPOUT1L_MUTE_N */
1121#define WM8994_HPOUT1L_MUTE_N_WIDTH 1 /* HPOUT1L_MUTE_N */
1122#define WM8994_HPOUT1L_VOL_MASK 0x003F /* HPOUT1L_VOL - [5:0] */
1123#define WM8994_HPOUT1L_VOL_SHIFT 0 /* HPOUT1L_VOL - [5:0] */
1124#define WM8994_HPOUT1L_VOL_WIDTH 6 /* HPOUT1L_VOL - [5:0] */
1125
1126/*
1127 * R29 (0x1D) - Right Output Volume
1128 */
1129#define WM8994_HPOUT1_VU 0x0100 /* HPOUT1_VU */
1130#define WM8994_HPOUT1_VU_MASK 0x0100 /* HPOUT1_VU */
1131#define WM8994_HPOUT1_VU_SHIFT 8 /* HPOUT1_VU */
1132#define WM8994_HPOUT1_VU_WIDTH 1 /* HPOUT1_VU */
1133#define WM8994_HPOUT1R_ZC 0x0080 /* HPOUT1R_ZC */
1134#define WM8994_HPOUT1R_ZC_MASK 0x0080 /* HPOUT1R_ZC */
1135#define WM8994_HPOUT1R_ZC_SHIFT 7 /* HPOUT1R_ZC */
1136#define WM8994_HPOUT1R_ZC_WIDTH 1 /* HPOUT1R_ZC */
1137#define WM8994_HPOUT1R_MUTE_N 0x0040 /* HPOUT1R_MUTE_N */
1138#define WM8994_HPOUT1R_MUTE_N_MASK 0x0040 /* HPOUT1R_MUTE_N */
1139#define WM8994_HPOUT1R_MUTE_N_SHIFT 6 /* HPOUT1R_MUTE_N */
1140#define WM8994_HPOUT1R_MUTE_N_WIDTH 1 /* HPOUT1R_MUTE_N */
1141#define WM8994_HPOUT1R_VOL_MASK 0x003F /* HPOUT1R_VOL - [5:0] */
1142#define WM8994_HPOUT1R_VOL_SHIFT 0 /* HPOUT1R_VOL - [5:0] */
1143#define WM8994_HPOUT1R_VOL_WIDTH 6 /* HPOUT1R_VOL - [5:0] */
1144
1145/*
1146 * R30 (0x1E) - Line Outputs Volume
1147 */
1148#define WM8994_LINEOUT1N_MUTE 0x0040 /* LINEOUT1N_MUTE */
1149#define WM8994_LINEOUT1N_MUTE_MASK 0x0040 /* LINEOUT1N_MUTE */
1150#define WM8994_LINEOUT1N_MUTE_SHIFT 6 /* LINEOUT1N_MUTE */
1151#define WM8994_LINEOUT1N_MUTE_WIDTH 1 /* LINEOUT1N_MUTE */
1152#define WM8994_LINEOUT1P_MUTE 0x0020 /* LINEOUT1P_MUTE */
1153#define WM8994_LINEOUT1P_MUTE_MASK 0x0020 /* LINEOUT1P_MUTE */
1154#define WM8994_LINEOUT1P_MUTE_SHIFT 5 /* LINEOUT1P_MUTE */
1155#define WM8994_LINEOUT1P_MUTE_WIDTH 1 /* LINEOUT1P_MUTE */
1156#define WM8994_LINEOUT1_VOL 0x0010 /* LINEOUT1_VOL */
1157#define WM8994_LINEOUT1_VOL_MASK 0x0010 /* LINEOUT1_VOL */
1158#define WM8994_LINEOUT1_VOL_SHIFT 4 /* LINEOUT1_VOL */
1159#define WM8994_LINEOUT1_VOL_WIDTH 1 /* LINEOUT1_VOL */
1160#define WM8994_LINEOUT2N_MUTE 0x0004 /* LINEOUT2N_MUTE */
1161#define WM8994_LINEOUT2N_MUTE_MASK 0x0004 /* LINEOUT2N_MUTE */
1162#define WM8994_LINEOUT2N_MUTE_SHIFT 2 /* LINEOUT2N_MUTE */
1163#define WM8994_LINEOUT2N_MUTE_WIDTH 1 /* LINEOUT2N_MUTE */
1164#define WM8994_LINEOUT2P_MUTE 0x0002 /* LINEOUT2P_MUTE */
1165#define WM8994_LINEOUT2P_MUTE_MASK 0x0002 /* LINEOUT2P_MUTE */
1166#define WM8994_LINEOUT2P_MUTE_SHIFT 1 /* LINEOUT2P_MUTE */
1167#define WM8994_LINEOUT2P_MUTE_WIDTH 1 /* LINEOUT2P_MUTE */
1168#define WM8994_LINEOUT2_VOL 0x0001 /* LINEOUT2_VOL */
1169#define WM8994_LINEOUT2_VOL_MASK 0x0001 /* LINEOUT2_VOL */
1170#define WM8994_LINEOUT2_VOL_SHIFT 0 /* LINEOUT2_VOL */
1171#define WM8994_LINEOUT2_VOL_WIDTH 1 /* LINEOUT2_VOL */
1172
1173/*
1174 * R31 (0x1F) - HPOUT2 Volume
1175 */
1176#define WM8994_HPOUT2_MUTE 0x0020 /* HPOUT2_MUTE */
1177#define WM8994_HPOUT2_MUTE_MASK 0x0020 /* HPOUT2_MUTE */
1178#define WM8994_HPOUT2_MUTE_SHIFT 5 /* HPOUT2_MUTE */
1179#define WM8994_HPOUT2_MUTE_WIDTH 1 /* HPOUT2_MUTE */
1180#define WM8994_HPOUT2_VOL 0x0010 /* HPOUT2_VOL */
1181#define WM8994_HPOUT2_VOL_MASK 0x0010 /* HPOUT2_VOL */
1182#define WM8994_HPOUT2_VOL_SHIFT 4 /* HPOUT2_VOL */
1183#define WM8994_HPOUT2_VOL_WIDTH 1 /* HPOUT2_VOL */
1184
1185/*
1186 * R32 (0x20) - Left OPGA Volume
1187 */
1188#define WM8994_MIXOUT_VU 0x0100 /* MIXOUT_VU */
1189#define WM8994_MIXOUT_VU_MASK 0x0100 /* MIXOUT_VU */
1190#define WM8994_MIXOUT_VU_SHIFT 8 /* MIXOUT_VU */
1191#define WM8994_MIXOUT_VU_WIDTH 1 /* MIXOUT_VU */
1192#define WM8994_MIXOUTL_ZC 0x0080 /* MIXOUTL_ZC */
1193#define WM8994_MIXOUTL_ZC_MASK 0x0080 /* MIXOUTL_ZC */
1194#define WM8994_MIXOUTL_ZC_SHIFT 7 /* MIXOUTL_ZC */
1195#define WM8994_MIXOUTL_ZC_WIDTH 1 /* MIXOUTL_ZC */
1196#define WM8994_MIXOUTL_MUTE_N 0x0040 /* MIXOUTL_MUTE_N */
1197#define WM8994_MIXOUTL_MUTE_N_MASK 0x0040 /* MIXOUTL_MUTE_N */
1198#define WM8994_MIXOUTL_MUTE_N_SHIFT 6 /* MIXOUTL_MUTE_N */
1199#define WM8994_MIXOUTL_MUTE_N_WIDTH 1 /* MIXOUTL_MUTE_N */
1200#define WM8994_MIXOUTL_VOL_MASK 0x003F /* MIXOUTL_VOL - [5:0] */
1201#define WM8994_MIXOUTL_VOL_SHIFT 0 /* MIXOUTL_VOL - [5:0] */
1202#define WM8994_MIXOUTL_VOL_WIDTH 6 /* MIXOUTL_VOL - [5:0] */
1203
1204/*
1205 * R33 (0x21) - Right OPGA Volume
1206 */
1207#define WM8994_MIXOUT_VU 0x0100 /* MIXOUT_VU */
1208#define WM8994_MIXOUT_VU_MASK 0x0100 /* MIXOUT_VU */
1209#define WM8994_MIXOUT_VU_SHIFT 8 /* MIXOUT_VU */
1210#define WM8994_MIXOUT_VU_WIDTH 1 /* MIXOUT_VU */
1211#define WM8994_MIXOUTR_ZC 0x0080 /* MIXOUTR_ZC */
1212#define WM8994_MIXOUTR_ZC_MASK 0x0080 /* MIXOUTR_ZC */
1213#define WM8994_MIXOUTR_ZC_SHIFT 7 /* MIXOUTR_ZC */
1214#define WM8994_MIXOUTR_ZC_WIDTH 1 /* MIXOUTR_ZC */
1215#define WM8994_MIXOUTR_MUTE_N 0x0040 /* MIXOUTR_MUTE_N */
1216#define WM8994_MIXOUTR_MUTE_N_MASK 0x0040 /* MIXOUTR_MUTE_N */
1217#define WM8994_MIXOUTR_MUTE_N_SHIFT 6 /* MIXOUTR_MUTE_N */
1218#define WM8994_MIXOUTR_MUTE_N_WIDTH 1 /* MIXOUTR_MUTE_N */
1219#define WM8994_MIXOUTR_VOL_MASK 0x003F /* MIXOUTR_VOL - [5:0] */
1220#define WM8994_MIXOUTR_VOL_SHIFT 0 /* MIXOUTR_VOL - [5:0] */
1221#define WM8994_MIXOUTR_VOL_WIDTH 6 /* MIXOUTR_VOL - [5:0] */
1222
1223/*
1224 * R34 (0x22) - SPKMIXL Attenuation
1225 */
1226#define WM8994_DAC2L_SPKMIXL_VOL 0x0040 /* DAC2L_SPKMIXL_VOL */
1227#define WM8994_DAC2L_SPKMIXL_VOL_MASK 0x0040 /* DAC2L_SPKMIXL_VOL */
1228#define WM8994_DAC2L_SPKMIXL_VOL_SHIFT 6 /* DAC2L_SPKMIXL_VOL */
1229#define WM8994_DAC2L_SPKMIXL_VOL_WIDTH 1 /* DAC2L_SPKMIXL_VOL */
1230#define WM8994_MIXINL_SPKMIXL_VOL 0x0020 /* MIXINL_SPKMIXL_VOL */
1231#define WM8994_MIXINL_SPKMIXL_VOL_MASK 0x0020 /* MIXINL_SPKMIXL_VOL */
1232#define WM8994_MIXINL_SPKMIXL_VOL_SHIFT 5 /* MIXINL_SPKMIXL_VOL */
1233#define WM8994_MIXINL_SPKMIXL_VOL_WIDTH 1 /* MIXINL_SPKMIXL_VOL */
1234#define WM8994_IN1LP_SPKMIXL_VOL 0x0010 /* IN1LP_SPKMIXL_VOL */
1235#define WM8994_IN1LP_SPKMIXL_VOL_MASK 0x0010 /* IN1LP_SPKMIXL_VOL */
1236#define WM8994_IN1LP_SPKMIXL_VOL_SHIFT 4 /* IN1LP_SPKMIXL_VOL */
1237#define WM8994_IN1LP_SPKMIXL_VOL_WIDTH 1 /* IN1LP_SPKMIXL_VOL */
1238#define WM8994_MIXOUTL_SPKMIXL_VOL 0x0008 /* MIXOUTL_SPKMIXL_VOL */
1239#define WM8994_MIXOUTL_SPKMIXL_VOL_MASK 0x0008 /* MIXOUTL_SPKMIXL_VOL */
1240#define WM8994_MIXOUTL_SPKMIXL_VOL_SHIFT 3 /* MIXOUTL_SPKMIXL_VOL */
1241#define WM8994_MIXOUTL_SPKMIXL_VOL_WIDTH 1 /* MIXOUTL_SPKMIXL_VOL */
1242#define WM8994_DAC1L_SPKMIXL_VOL 0x0004 /* DAC1L_SPKMIXL_VOL */
1243#define WM8994_DAC1L_SPKMIXL_VOL_MASK 0x0004 /* DAC1L_SPKMIXL_VOL */
1244#define WM8994_DAC1L_SPKMIXL_VOL_SHIFT 2 /* DAC1L_SPKMIXL_VOL */
1245#define WM8994_DAC1L_SPKMIXL_VOL_WIDTH 1 /* DAC1L_SPKMIXL_VOL */
1246#define WM8994_SPKMIXL_VOL_MASK 0x0003 /* SPKMIXL_VOL - [1:0] */
1247#define WM8994_SPKMIXL_VOL_SHIFT 0 /* SPKMIXL_VOL - [1:0] */
1248#define WM8994_SPKMIXL_VOL_WIDTH 2 /* SPKMIXL_VOL - [1:0] */
1249
1250/*
1251 * R35 (0x23) - SPKMIXR Attenuation
1252 */
1253#define WM8994_SPKOUT_CLASSAB 0x0100 /* SPKOUT_CLASSAB */
1254#define WM8994_SPKOUT_CLASSAB_MASK 0x0100 /* SPKOUT_CLASSAB */
1255#define WM8994_SPKOUT_CLASSAB_SHIFT 8 /* SPKOUT_CLASSAB */
1256#define WM8994_SPKOUT_CLASSAB_WIDTH 1 /* SPKOUT_CLASSAB */
1257#define WM8994_DAC2R_SPKMIXR_VOL 0x0040 /* DAC2R_SPKMIXR_VOL */
1258#define WM8994_DAC2R_SPKMIXR_VOL_MASK 0x0040 /* DAC2R_SPKMIXR_VOL */
1259#define WM8994_DAC2R_SPKMIXR_VOL_SHIFT 6 /* DAC2R_SPKMIXR_VOL */
1260#define WM8994_DAC2R_SPKMIXR_VOL_WIDTH 1 /* DAC2R_SPKMIXR_VOL */
1261#define WM8994_MIXINR_SPKMIXR_VOL 0x0020 /* MIXINR_SPKMIXR_VOL */
1262#define WM8994_MIXINR_SPKMIXR_VOL_MASK 0x0020 /* MIXINR_SPKMIXR_VOL */
1263#define WM8994_MIXINR_SPKMIXR_VOL_SHIFT 5 /* MIXINR_SPKMIXR_VOL */
1264#define WM8994_MIXINR_SPKMIXR_VOL_WIDTH 1 /* MIXINR_SPKMIXR_VOL */
1265#define WM8994_IN1RP_SPKMIXR_VOL 0x0010 /* IN1RP_SPKMIXR_VOL */
1266#define WM8994_IN1RP_SPKMIXR_VOL_MASK 0x0010 /* IN1RP_SPKMIXR_VOL */
1267#define WM8994_IN1RP_SPKMIXR_VOL_SHIFT 4 /* IN1RP_SPKMIXR_VOL */
1268#define WM8994_IN1RP_SPKMIXR_VOL_WIDTH 1 /* IN1RP_SPKMIXR_VOL */
1269#define WM8994_MIXOUTR_SPKMIXR_VOL 0x0008 /* MIXOUTR_SPKMIXR_VOL */
1270#define WM8994_MIXOUTR_SPKMIXR_VOL_MASK 0x0008 /* MIXOUTR_SPKMIXR_VOL */
1271#define WM8994_MIXOUTR_SPKMIXR_VOL_SHIFT 3 /* MIXOUTR_SPKMIXR_VOL */
1272#define WM8994_MIXOUTR_SPKMIXR_VOL_WIDTH 1 /* MIXOUTR_SPKMIXR_VOL */
1273#define WM8994_DAC1R_SPKMIXR_VOL 0x0004 /* DAC1R_SPKMIXR_VOL */
1274#define WM8994_DAC1R_SPKMIXR_VOL_MASK 0x0004 /* DAC1R_SPKMIXR_VOL */
1275#define WM8994_DAC1R_SPKMIXR_VOL_SHIFT 2 /* DAC1R_SPKMIXR_VOL */
1276#define WM8994_DAC1R_SPKMIXR_VOL_WIDTH 1 /* DAC1R_SPKMIXR_VOL */
1277#define WM8994_SPKMIXR_VOL_MASK 0x0003 /* SPKMIXR_VOL - [1:0] */
1278#define WM8994_SPKMIXR_VOL_SHIFT 0 /* SPKMIXR_VOL - [1:0] */
1279#define WM8994_SPKMIXR_VOL_WIDTH 2 /* SPKMIXR_VOL - [1:0] */
1280
1281/*
1282 * R36 (0x24) - SPKOUT Mixers
1283 */
1284#define WM8994_IN2LRP_TO_SPKOUTL 0x0020 /* IN2LRP_TO_SPKOUTL */
1285#define WM8994_IN2LRP_TO_SPKOUTL_MASK 0x0020 /* IN2LRP_TO_SPKOUTL */
1286#define WM8994_IN2LRP_TO_SPKOUTL_SHIFT 5 /* IN2LRP_TO_SPKOUTL */
1287#define WM8994_IN2LRP_TO_SPKOUTL_WIDTH 1 /* IN2LRP_TO_SPKOUTL */
1288#define WM8994_SPKMIXL_TO_SPKOUTL 0x0010 /* SPKMIXL_TO_SPKOUTL */
1289#define WM8994_SPKMIXL_TO_SPKOUTL_MASK 0x0010 /* SPKMIXL_TO_SPKOUTL */
1290#define WM8994_SPKMIXL_TO_SPKOUTL_SHIFT 4 /* SPKMIXL_TO_SPKOUTL */
1291#define WM8994_SPKMIXL_TO_SPKOUTL_WIDTH 1 /* SPKMIXL_TO_SPKOUTL */
1292#define WM8994_SPKMIXR_TO_SPKOUTL 0x0008 /* SPKMIXR_TO_SPKOUTL */
1293#define WM8994_SPKMIXR_TO_SPKOUTL_MASK 0x0008 /* SPKMIXR_TO_SPKOUTL */
1294#define WM8994_SPKMIXR_TO_SPKOUTL_SHIFT 3 /* SPKMIXR_TO_SPKOUTL */
1295#define WM8994_SPKMIXR_TO_SPKOUTL_WIDTH 1 /* SPKMIXR_TO_SPKOUTL */
1296#define WM8994_IN2LRP_TO_SPKOUTR 0x0004 /* IN2LRP_TO_SPKOUTR */
1297#define WM8994_IN2LRP_TO_SPKOUTR_MASK 0x0004 /* IN2LRP_TO_SPKOUTR */
1298#define WM8994_IN2LRP_TO_SPKOUTR_SHIFT 2 /* IN2LRP_TO_SPKOUTR */
1299#define WM8994_IN2LRP_TO_SPKOUTR_WIDTH 1 /* IN2LRP_TO_SPKOUTR */
1300#define WM8994_SPKMIXL_TO_SPKOUTR 0x0002 /* SPKMIXL_TO_SPKOUTR */
1301#define WM8994_SPKMIXL_TO_SPKOUTR_MASK 0x0002 /* SPKMIXL_TO_SPKOUTR */
1302#define WM8994_SPKMIXL_TO_SPKOUTR_SHIFT 1 /* SPKMIXL_TO_SPKOUTR */
1303#define WM8994_SPKMIXL_TO_SPKOUTR_WIDTH 1 /* SPKMIXL_TO_SPKOUTR */
1304#define WM8994_SPKMIXR_TO_SPKOUTR 0x0001 /* SPKMIXR_TO_SPKOUTR */
1305#define WM8994_SPKMIXR_TO_SPKOUTR_MASK 0x0001 /* SPKMIXR_TO_SPKOUTR */
1306#define WM8994_SPKMIXR_TO_SPKOUTR_SHIFT 0 /* SPKMIXR_TO_SPKOUTR */
1307#define WM8994_SPKMIXR_TO_SPKOUTR_WIDTH 1 /* SPKMIXR_TO_SPKOUTR */
1308
1309/*
1310 * R37 (0x25) - ClassD
1311 */
1312#define WM8994_SPKOUTL_BOOST_MASK 0x0038 /* SPKOUTL_BOOST - [5:3] */
1313#define WM8994_SPKOUTL_BOOST_SHIFT 3 /* SPKOUTL_BOOST - [5:3] */
1314#define WM8994_SPKOUTL_BOOST_WIDTH 3 /* SPKOUTL_BOOST - [5:3] */
1315#define WM8994_SPKOUTR_BOOST_MASK 0x0007 /* SPKOUTR_BOOST - [2:0] */
1316#define WM8994_SPKOUTR_BOOST_SHIFT 0 /* SPKOUTR_BOOST - [2:0] */
1317#define WM8994_SPKOUTR_BOOST_WIDTH 3 /* SPKOUTR_BOOST - [2:0] */
1318
1319/*
1320 * R38 (0x26) - Speaker Volume Left
1321 */
1322#define WM8994_SPKOUT_VU 0x0100 /* SPKOUT_VU */
1323#define WM8994_SPKOUT_VU_MASK 0x0100 /* SPKOUT_VU */
1324#define WM8994_SPKOUT_VU_SHIFT 8 /* SPKOUT_VU */
1325#define WM8994_SPKOUT_VU_WIDTH 1 /* SPKOUT_VU */
1326#define WM8994_SPKOUTL_ZC 0x0080 /* SPKOUTL_ZC */
1327#define WM8994_SPKOUTL_ZC_MASK 0x0080 /* SPKOUTL_ZC */
1328#define WM8994_SPKOUTL_ZC_SHIFT 7 /* SPKOUTL_ZC */
1329#define WM8994_SPKOUTL_ZC_WIDTH 1 /* SPKOUTL_ZC */
1330#define WM8994_SPKOUTL_MUTE_N 0x0040 /* SPKOUTL_MUTE_N */
1331#define WM8994_SPKOUTL_MUTE_N_MASK 0x0040 /* SPKOUTL_MUTE_N */
1332#define WM8994_SPKOUTL_MUTE_N_SHIFT 6 /* SPKOUTL_MUTE_N */
1333#define WM8994_SPKOUTL_MUTE_N_WIDTH 1 /* SPKOUTL_MUTE_N */
1334#define WM8994_SPKOUTL_VOL_MASK 0x003F /* SPKOUTL_VOL - [5:0] */
1335#define WM8994_SPKOUTL_VOL_SHIFT 0 /* SPKOUTL_VOL - [5:0] */
1336#define WM8994_SPKOUTL_VOL_WIDTH 6 /* SPKOUTL_VOL - [5:0] */
1337
1338/*
1339 * R39 (0x27) - Speaker Volume Right
1340 */
1341#define WM8994_SPKOUT_VU 0x0100 /* SPKOUT_VU */
1342#define WM8994_SPKOUT_VU_MASK 0x0100 /* SPKOUT_VU */
1343#define WM8994_SPKOUT_VU_SHIFT 8 /* SPKOUT_VU */
1344#define WM8994_SPKOUT_VU_WIDTH 1 /* SPKOUT_VU */
1345#define WM8994_SPKOUTR_ZC 0x0080 /* SPKOUTR_ZC */
1346#define WM8994_SPKOUTR_ZC_MASK 0x0080 /* SPKOUTR_ZC */
1347#define WM8994_SPKOUTR_ZC_SHIFT 7 /* SPKOUTR_ZC */
1348#define WM8994_SPKOUTR_ZC_WIDTH 1 /* SPKOUTR_ZC */
1349#define WM8994_SPKOUTR_MUTE_N 0x0040 /* SPKOUTR_MUTE_N */
1350#define WM8994_SPKOUTR_MUTE_N_MASK 0x0040 /* SPKOUTR_MUTE_N */
1351#define WM8994_SPKOUTR_MUTE_N_SHIFT 6 /* SPKOUTR_MUTE_N */
1352#define WM8994_SPKOUTR_MUTE_N_WIDTH 1 /* SPKOUTR_MUTE_N */
1353#define WM8994_SPKOUTR_VOL_MASK 0x003F /* SPKOUTR_VOL - [5:0] */
1354#define WM8994_SPKOUTR_VOL_SHIFT 0 /* SPKOUTR_VOL - [5:0] */
1355#define WM8994_SPKOUTR_VOL_WIDTH 6 /* SPKOUTR_VOL - [5:0] */
1356
1357/*
1358 * R40 (0x28) - Input Mixer (2)
1359 */
1360#define WM8994_IN2LP_TO_IN2L 0x0080 /* IN2LP_TO_IN2L */
1361#define WM8994_IN2LP_TO_IN2L_MASK 0x0080 /* IN2LP_TO_IN2L */
1362#define WM8994_IN2LP_TO_IN2L_SHIFT 7 /* IN2LP_TO_IN2L */
1363#define WM8994_IN2LP_TO_IN2L_WIDTH 1 /* IN2LP_TO_IN2L */
1364#define WM8994_IN2LN_TO_IN2L 0x0040 /* IN2LN_TO_IN2L */
1365#define WM8994_IN2LN_TO_IN2L_MASK 0x0040 /* IN2LN_TO_IN2L */
1366#define WM8994_IN2LN_TO_IN2L_SHIFT 6 /* IN2LN_TO_IN2L */
1367#define WM8994_IN2LN_TO_IN2L_WIDTH 1 /* IN2LN_TO_IN2L */
1368#define WM8994_IN1LP_TO_IN1L 0x0020 /* IN1LP_TO_IN1L */
1369#define WM8994_IN1LP_TO_IN1L_MASK 0x0020 /* IN1LP_TO_IN1L */
1370#define WM8994_IN1LP_TO_IN1L_SHIFT 5 /* IN1LP_TO_IN1L */
1371#define WM8994_IN1LP_TO_IN1L_WIDTH 1 /* IN1LP_TO_IN1L */
1372#define WM8994_IN1LN_TO_IN1L 0x0010 /* IN1LN_TO_IN1L */
1373#define WM8994_IN1LN_TO_IN1L_MASK 0x0010 /* IN1LN_TO_IN1L */
1374#define WM8994_IN1LN_TO_IN1L_SHIFT 4 /* IN1LN_TO_IN1L */
1375#define WM8994_IN1LN_TO_IN1L_WIDTH 1 /* IN1LN_TO_IN1L */
1376#define WM8994_IN2RP_TO_IN2R 0x0008 /* IN2RP_TO_IN2R */
1377#define WM8994_IN2RP_TO_IN2R_MASK 0x0008 /* IN2RP_TO_IN2R */
1378#define WM8994_IN2RP_TO_IN2R_SHIFT 3 /* IN2RP_TO_IN2R */
1379#define WM8994_IN2RP_TO_IN2R_WIDTH 1 /* IN2RP_TO_IN2R */
1380#define WM8994_IN2RN_TO_IN2R 0x0004 /* IN2RN_TO_IN2R */
1381#define WM8994_IN2RN_TO_IN2R_MASK 0x0004 /* IN2RN_TO_IN2R */
1382#define WM8994_IN2RN_TO_IN2R_SHIFT 2 /* IN2RN_TO_IN2R */
1383#define WM8994_IN2RN_TO_IN2R_WIDTH 1 /* IN2RN_TO_IN2R */
1384#define WM8994_IN1RP_TO_IN1R 0x0002 /* IN1RP_TO_IN1R */
1385#define WM8994_IN1RP_TO_IN1R_MASK 0x0002 /* IN1RP_TO_IN1R */
1386#define WM8994_IN1RP_TO_IN1R_SHIFT 1 /* IN1RP_TO_IN1R */
1387#define WM8994_IN1RP_TO_IN1R_WIDTH 1 /* IN1RP_TO_IN1R */
1388#define WM8994_IN1RN_TO_IN1R 0x0001 /* IN1RN_TO_IN1R */
1389#define WM8994_IN1RN_TO_IN1R_MASK 0x0001 /* IN1RN_TO_IN1R */
1390#define WM8994_IN1RN_TO_IN1R_SHIFT 0 /* IN1RN_TO_IN1R */
1391#define WM8994_IN1RN_TO_IN1R_WIDTH 1 /* IN1RN_TO_IN1R */
1392
1393/*
1394 * R41 (0x29) - Input Mixer (3)
1395 */
1396#define WM8994_IN2L_TO_MIXINL 0x0100 /* IN2L_TO_MIXINL */
1397#define WM8994_IN2L_TO_MIXINL_MASK 0x0100 /* IN2L_TO_MIXINL */
1398#define WM8994_IN2L_TO_MIXINL_SHIFT 8 /* IN2L_TO_MIXINL */
1399#define WM8994_IN2L_TO_MIXINL_WIDTH 1 /* IN2L_TO_MIXINL */
1400#define WM8994_IN2L_MIXINL_VOL 0x0080 /* IN2L_MIXINL_VOL */
1401#define WM8994_IN2L_MIXINL_VOL_MASK 0x0080 /* IN2L_MIXINL_VOL */
1402#define WM8994_IN2L_MIXINL_VOL_SHIFT 7 /* IN2L_MIXINL_VOL */
1403#define WM8994_IN2L_MIXINL_VOL_WIDTH 1 /* IN2L_MIXINL_VOL */
1404#define WM8994_IN1L_TO_MIXINL 0x0020 /* IN1L_TO_MIXINL */
1405#define WM8994_IN1L_TO_MIXINL_MASK 0x0020 /* IN1L_TO_MIXINL */
1406#define WM8994_IN1L_TO_MIXINL_SHIFT 5 /* IN1L_TO_MIXINL */
1407#define WM8994_IN1L_TO_MIXINL_WIDTH 1 /* IN1L_TO_MIXINL */
1408#define WM8994_IN1L_MIXINL_VOL 0x0010 /* IN1L_MIXINL_VOL */
1409#define WM8994_IN1L_MIXINL_VOL_MASK 0x0010 /* IN1L_MIXINL_VOL */
1410#define WM8994_IN1L_MIXINL_VOL_SHIFT 4 /* IN1L_MIXINL_VOL */
1411#define WM8994_IN1L_MIXINL_VOL_WIDTH 1 /* IN1L_MIXINL_VOL */
1412#define WM8994_MIXOUTL_MIXINL_VOL_MASK 0x0007 /* MIXOUTL_MIXINL_VOL - [2:0] */
1413#define WM8994_MIXOUTL_MIXINL_VOL_SHIFT 0 /* MIXOUTL_MIXINL_VOL - [2:0] */
1414#define WM8994_MIXOUTL_MIXINL_VOL_WIDTH 3 /* MIXOUTL_MIXINL_VOL - [2:0] */
1415
1416/*
1417 * R42 (0x2A) - Input Mixer (4)
1418 */
1419#define WM8994_IN2R_TO_MIXINR 0x0100 /* IN2R_TO_MIXINR */
1420#define WM8994_IN2R_TO_MIXINR_MASK 0x0100 /* IN2R_TO_MIXINR */
1421#define WM8994_IN2R_TO_MIXINR_SHIFT 8 /* IN2R_TO_MIXINR */
1422#define WM8994_IN2R_TO_MIXINR_WIDTH 1 /* IN2R_TO_MIXINR */
1423#define WM8994_IN2R_MIXINR_VOL 0x0080 /* IN2R_MIXINR_VOL */
1424#define WM8994_IN2R_MIXINR_VOL_MASK 0x0080 /* IN2R_MIXINR_VOL */
1425#define WM8994_IN2R_MIXINR_VOL_SHIFT 7 /* IN2R_MIXINR_VOL */
1426#define WM8994_IN2R_MIXINR_VOL_WIDTH 1 /* IN2R_MIXINR_VOL */
1427#define WM8994_IN1R_TO_MIXINR 0x0020 /* IN1R_TO_MIXINR */
1428#define WM8994_IN1R_TO_MIXINR_MASK 0x0020 /* IN1R_TO_MIXINR */
1429#define WM8994_IN1R_TO_MIXINR_SHIFT 5 /* IN1R_TO_MIXINR */
1430#define WM8994_IN1R_TO_MIXINR_WIDTH 1 /* IN1R_TO_MIXINR */
1431#define WM8994_IN1R_MIXINR_VOL 0x0010 /* IN1R_MIXINR_VOL */
1432#define WM8994_IN1R_MIXINR_VOL_MASK 0x0010 /* IN1R_MIXINR_VOL */
1433#define WM8994_IN1R_MIXINR_VOL_SHIFT 4 /* IN1R_MIXINR_VOL */
1434#define WM8994_IN1R_MIXINR_VOL_WIDTH 1 /* IN1R_MIXINR_VOL */
1435#define WM8994_MIXOUTR_MIXINR_VOL_MASK 0x0007 /* MIXOUTR_MIXINR_VOL - [2:0] */
1436#define WM8994_MIXOUTR_MIXINR_VOL_SHIFT 0 /* MIXOUTR_MIXINR_VOL - [2:0] */
1437#define WM8994_MIXOUTR_MIXINR_VOL_WIDTH 3 /* MIXOUTR_MIXINR_VOL - [2:0] */
1438
1439/*
1440 * R43 (0x2B) - Input Mixer (5)
1441 */
1442#define WM8994_IN1LP_MIXINL_VOL_MASK 0x01C0 /* IN1LP_MIXINL_VOL - [8:6] */
1443#define WM8994_IN1LP_MIXINL_VOL_SHIFT 6 /* IN1LP_MIXINL_VOL - [8:6] */
1444#define WM8994_IN1LP_MIXINL_VOL_WIDTH 3 /* IN1LP_MIXINL_VOL - [8:6] */
1445#define WM8994_IN2LRP_MIXINL_VOL_MASK 0x0007 /* IN2LRP_MIXINL_VOL - [2:0] */
1446#define WM8994_IN2LRP_MIXINL_VOL_SHIFT 0 /* IN2LRP_MIXINL_VOL - [2:0] */
1447#define WM8994_IN2LRP_MIXINL_VOL_WIDTH 3 /* IN2LRP_MIXINL_VOL - [2:0] */
1448
1449/*
1450 * R44 (0x2C) - Input Mixer (6)
1451 */
1452#define WM8994_IN1RP_MIXINR_VOL_MASK 0x01C0 /* IN1RP_MIXINR_VOL - [8:6] */
1453#define WM8994_IN1RP_MIXINR_VOL_SHIFT 6 /* IN1RP_MIXINR_VOL - [8:6] */
1454#define WM8994_IN1RP_MIXINR_VOL_WIDTH 3 /* IN1RP_MIXINR_VOL - [8:6] */
1455#define WM8994_IN2LRP_MIXINR_VOL_MASK 0x0007 /* IN2LRP_MIXINR_VOL - [2:0] */
1456#define WM8994_IN2LRP_MIXINR_VOL_SHIFT 0 /* IN2LRP_MIXINR_VOL - [2:0] */
1457#define WM8994_IN2LRP_MIXINR_VOL_WIDTH 3 /* IN2LRP_MIXINR_VOL - [2:0] */
1458
1459/*
1460 * R45 (0x2D) - Output Mixer (1)
1461 */
1462#define WM8994_DAC1L_TO_HPOUT1L 0x0100 /* DAC1L_TO_HPOUT1L */
1463#define WM8994_DAC1L_TO_HPOUT1L_MASK 0x0100 /* DAC1L_TO_HPOUT1L */
1464#define WM8994_DAC1L_TO_HPOUT1L_SHIFT 8 /* DAC1L_TO_HPOUT1L */
1465#define WM8994_DAC1L_TO_HPOUT1L_WIDTH 1 /* DAC1L_TO_HPOUT1L */
1466#define WM8994_MIXINR_TO_MIXOUTL 0x0080 /* MIXINR_TO_MIXOUTL */
1467#define WM8994_MIXINR_TO_MIXOUTL_MASK 0x0080 /* MIXINR_TO_MIXOUTL */
1468#define WM8994_MIXINR_TO_MIXOUTL_SHIFT 7 /* MIXINR_TO_MIXOUTL */
1469#define WM8994_MIXINR_TO_MIXOUTL_WIDTH 1 /* MIXINR_TO_MIXOUTL */
1470#define WM8994_MIXINL_TO_MIXOUTL 0x0040 /* MIXINL_TO_MIXOUTL */
1471#define WM8994_MIXINL_TO_MIXOUTL_MASK 0x0040 /* MIXINL_TO_MIXOUTL */
1472#define WM8994_MIXINL_TO_MIXOUTL_SHIFT 6 /* MIXINL_TO_MIXOUTL */
1473#define WM8994_MIXINL_TO_MIXOUTL_WIDTH 1 /* MIXINL_TO_MIXOUTL */
1474#define WM8994_IN2RN_TO_MIXOUTL 0x0020 /* IN2RN_TO_MIXOUTL */
1475#define WM8994_IN2RN_TO_MIXOUTL_MASK 0x0020 /* IN2RN_TO_MIXOUTL */
1476#define WM8994_IN2RN_TO_MIXOUTL_SHIFT 5 /* IN2RN_TO_MIXOUTL */
1477#define WM8994_IN2RN_TO_MIXOUTL_WIDTH 1 /* IN2RN_TO_MIXOUTL */
1478#define WM8994_IN2LN_TO_MIXOUTL 0x0010 /* IN2LN_TO_MIXOUTL */
1479#define WM8994_IN2LN_TO_MIXOUTL_MASK 0x0010 /* IN2LN_TO_MIXOUTL */
1480#define WM8994_IN2LN_TO_MIXOUTL_SHIFT 4 /* IN2LN_TO_MIXOUTL */
1481#define WM8994_IN2LN_TO_MIXOUTL_WIDTH 1 /* IN2LN_TO_MIXOUTL */
1482#define WM8994_IN1R_TO_MIXOUTL 0x0008 /* IN1R_TO_MIXOUTL */
1483#define WM8994_IN1R_TO_MIXOUTL_MASK 0x0008 /* IN1R_TO_MIXOUTL */
1484#define WM8994_IN1R_TO_MIXOUTL_SHIFT 3 /* IN1R_TO_MIXOUTL */
1485#define WM8994_IN1R_TO_MIXOUTL_WIDTH 1 /* IN1R_TO_MIXOUTL */
1486#define WM8994_IN1L_TO_MIXOUTL 0x0004 /* IN1L_TO_MIXOUTL */
1487#define WM8994_IN1L_TO_MIXOUTL_MASK 0x0004 /* IN1L_TO_MIXOUTL */
1488#define WM8994_IN1L_TO_MIXOUTL_SHIFT 2 /* IN1L_TO_MIXOUTL */
1489#define WM8994_IN1L_TO_MIXOUTL_WIDTH 1 /* IN1L_TO_MIXOUTL */
1490#define WM8994_IN2LP_TO_MIXOUTL 0x0002 /* IN2LP_TO_MIXOUTL */
1491#define WM8994_IN2LP_TO_MIXOUTL_MASK 0x0002 /* IN2LP_TO_MIXOUTL */
1492#define WM8994_IN2LP_TO_MIXOUTL_SHIFT 1 /* IN2LP_TO_MIXOUTL */
1493#define WM8994_IN2LP_TO_MIXOUTL_WIDTH 1 /* IN2LP_TO_MIXOUTL */
1494#define WM8994_DAC1L_TO_MIXOUTL 0x0001 /* DAC1L_TO_MIXOUTL */
1495#define WM8994_DAC1L_TO_MIXOUTL_MASK 0x0001 /* DAC1L_TO_MIXOUTL */
1496#define WM8994_DAC1L_TO_MIXOUTL_SHIFT 0 /* DAC1L_TO_MIXOUTL */
1497#define WM8994_DAC1L_TO_MIXOUTL_WIDTH 1 /* DAC1L_TO_MIXOUTL */
1498
1499/*
1500 * R46 (0x2E) - Output Mixer (2)
1501 */
1502#define WM8994_DAC1R_TO_HPOUT1R 0x0100 /* DAC1R_TO_HPOUT1R */
1503#define WM8994_DAC1R_TO_HPOUT1R_MASK 0x0100 /* DAC1R_TO_HPOUT1R */
1504#define WM8994_DAC1R_TO_HPOUT1R_SHIFT 8 /* DAC1R_TO_HPOUT1R */
1505#define WM8994_DAC1R_TO_HPOUT1R_WIDTH 1 /* DAC1R_TO_HPOUT1R */
1506#define WM8994_MIXINL_TO_MIXOUTR 0x0080 /* MIXINL_TO_MIXOUTR */
1507#define WM8994_MIXINL_TO_MIXOUTR_MASK 0x0080 /* MIXINL_TO_MIXOUTR */
1508#define WM8994_MIXINL_TO_MIXOUTR_SHIFT 7 /* MIXINL_TO_MIXOUTR */
1509#define WM8994_MIXINL_TO_MIXOUTR_WIDTH 1 /* MIXINL_TO_MIXOUTR */
1510#define WM8994_MIXINR_TO_MIXOUTR 0x0040 /* MIXINR_TO_MIXOUTR */
1511#define WM8994_MIXINR_TO_MIXOUTR_MASK 0x0040 /* MIXINR_TO_MIXOUTR */
1512#define WM8994_MIXINR_TO_MIXOUTR_SHIFT 6 /* MIXINR_TO_MIXOUTR */
1513#define WM8994_MIXINR_TO_MIXOUTR_WIDTH 1 /* MIXINR_TO_MIXOUTR */
1514#define WM8994_IN2LN_TO_MIXOUTR 0x0020 /* IN2LN_TO_MIXOUTR */
1515#define WM8994_IN2LN_TO_MIXOUTR_MASK 0x0020 /* IN2LN_TO_MIXOUTR */
1516#define WM8994_IN2LN_TO_MIXOUTR_SHIFT 5 /* IN2LN_TO_MIXOUTR */
1517#define WM8994_IN2LN_TO_MIXOUTR_WIDTH 1 /* IN2LN_TO_MIXOUTR */
1518#define WM8994_IN2RN_TO_MIXOUTR 0x0010 /* IN2RN_TO_MIXOUTR */
1519#define WM8994_IN2RN_TO_MIXOUTR_MASK 0x0010 /* IN2RN_TO_MIXOUTR */
1520#define WM8994_IN2RN_TO_MIXOUTR_SHIFT 4 /* IN2RN_TO_MIXOUTR */
1521#define WM8994_IN2RN_TO_MIXOUTR_WIDTH 1 /* IN2RN_TO_MIXOUTR */
1522#define WM8994_IN1L_TO_MIXOUTR 0x0008 /* IN1L_TO_MIXOUTR */
1523#define WM8994_IN1L_TO_MIXOUTR_MASK 0x0008 /* IN1L_TO_MIXOUTR */
1524#define WM8994_IN1L_TO_MIXOUTR_SHIFT 3 /* IN1L_TO_MIXOUTR */
1525#define WM8994_IN1L_TO_MIXOUTR_WIDTH 1 /* IN1L_TO_MIXOUTR */
1526#define WM8994_IN1R_TO_MIXOUTR 0x0004 /* IN1R_TO_MIXOUTR */
1527#define WM8994_IN1R_TO_MIXOUTR_MASK 0x0004 /* IN1R_TO_MIXOUTR */
1528#define WM8994_IN1R_TO_MIXOUTR_SHIFT 2 /* IN1R_TO_MIXOUTR */
1529#define WM8994_IN1R_TO_MIXOUTR_WIDTH 1 /* IN1R_TO_MIXOUTR */
1530#define WM8994_IN2RP_TO_MIXOUTR 0x0002 /* IN2RP_TO_MIXOUTR */
1531#define WM8994_IN2RP_TO_MIXOUTR_MASK 0x0002 /* IN2RP_TO_MIXOUTR */
1532#define WM8994_IN2RP_TO_MIXOUTR_SHIFT 1 /* IN2RP_TO_MIXOUTR */
1533#define WM8994_IN2RP_TO_MIXOUTR_WIDTH 1 /* IN2RP_TO_MIXOUTR */
1534#define WM8994_DAC1R_TO_MIXOUTR 0x0001 /* DAC1R_TO_MIXOUTR */
1535#define WM8994_DAC1R_TO_MIXOUTR_MASK 0x0001 /* DAC1R_TO_MIXOUTR */
1536#define WM8994_DAC1R_TO_MIXOUTR_SHIFT 0 /* DAC1R_TO_MIXOUTR */
1537#define WM8994_DAC1R_TO_MIXOUTR_WIDTH 1 /* DAC1R_TO_MIXOUTR */
1538
1539/*
1540 * R47 (0x2F) - Output Mixer (3)
1541 */
1542#define WM8994_IN2LP_MIXOUTL_VOL_MASK 0x0E00 /* IN2LP_MIXOUTL_VOL - [11:9] */
1543#define WM8994_IN2LP_MIXOUTL_VOL_SHIFT 9 /* IN2LP_MIXOUTL_VOL - [11:9] */
1544#define WM8994_IN2LP_MIXOUTL_VOL_WIDTH 3 /* IN2LP_MIXOUTL_VOL - [11:9] */
1545#define WM8994_IN2LN_MIXOUTL_VOL_MASK 0x01C0 /* IN2LN_MIXOUTL_VOL - [8:6] */
1546#define WM8994_IN2LN_MIXOUTL_VOL_SHIFT 6 /* IN2LN_MIXOUTL_VOL - [8:6] */
1547#define WM8994_IN2LN_MIXOUTL_VOL_WIDTH 3 /* IN2LN_MIXOUTL_VOL - [8:6] */
1548#define WM8994_IN1R_MIXOUTL_VOL_MASK 0x0038 /* IN1R_MIXOUTL_VOL - [5:3] */
1549#define WM8994_IN1R_MIXOUTL_VOL_SHIFT 3 /* IN1R_MIXOUTL_VOL - [5:3] */
1550#define WM8994_IN1R_MIXOUTL_VOL_WIDTH 3 /* IN1R_MIXOUTL_VOL - [5:3] */
1551#define WM8994_IN1L_MIXOUTL_VOL_MASK 0x0007 /* IN1L_MIXOUTL_VOL - [2:0] */
1552#define WM8994_IN1L_MIXOUTL_VOL_SHIFT 0 /* IN1L_MIXOUTL_VOL - [2:0] */
1553#define WM8994_IN1L_MIXOUTL_VOL_WIDTH 3 /* IN1L_MIXOUTL_VOL - [2:0] */
1554
1555/*
1556 * R48 (0x30) - Output Mixer (4)
1557 */
1558#define WM8994_IN2RP_MIXOUTR_VOL_MASK 0x0E00 /* IN2RP_MIXOUTR_VOL - [11:9] */
1559#define WM8994_IN2RP_MIXOUTR_VOL_SHIFT 9 /* IN2RP_MIXOUTR_VOL - [11:9] */
1560#define WM8994_IN2RP_MIXOUTR_VOL_WIDTH 3 /* IN2RP_MIXOUTR_VOL - [11:9] */
1561#define WM8994_IN2RN_MIXOUTR_VOL_MASK 0x01C0 /* IN2RN_MIXOUTR_VOL - [8:6] */
1562#define WM8994_IN2RN_MIXOUTR_VOL_SHIFT 6 /* IN2RN_MIXOUTR_VOL - [8:6] */
1563#define WM8994_IN2RN_MIXOUTR_VOL_WIDTH 3 /* IN2RN_MIXOUTR_VOL - [8:6] */
1564#define WM8994_IN1L_MIXOUTR_VOL_MASK 0x0038 /* IN1L_MIXOUTR_VOL - [5:3] */
1565#define WM8994_IN1L_MIXOUTR_VOL_SHIFT 3 /* IN1L_MIXOUTR_VOL - [5:3] */
1566#define WM8994_IN1L_MIXOUTR_VOL_WIDTH 3 /* IN1L_MIXOUTR_VOL - [5:3] */
1567#define WM8994_IN1R_MIXOUTR_VOL_MASK 0x0007 /* IN1R_MIXOUTR_VOL - [2:0] */
1568#define WM8994_IN1R_MIXOUTR_VOL_SHIFT 0 /* IN1R_MIXOUTR_VOL - [2:0] */
1569#define WM8994_IN1R_MIXOUTR_VOL_WIDTH 3 /* IN1R_MIXOUTR_VOL - [2:0] */
1570
1571/*
1572 * R49 (0x31) - Output Mixer (5)
1573 */
1574#define WM8994_DAC1L_MIXOUTL_VOL_MASK 0x0E00 /* DAC1L_MIXOUTL_VOL - [11:9] */
1575#define WM8994_DAC1L_MIXOUTL_VOL_SHIFT 9 /* DAC1L_MIXOUTL_VOL - [11:9] */
1576#define WM8994_DAC1L_MIXOUTL_VOL_WIDTH 3 /* DAC1L_MIXOUTL_VOL - [11:9] */
1577#define WM8994_IN2RN_MIXOUTL_VOL_MASK 0x01C0 /* IN2RN_MIXOUTL_VOL - [8:6] */
1578#define WM8994_IN2RN_MIXOUTL_VOL_SHIFT 6 /* IN2RN_MIXOUTL_VOL - [8:6] */
1579#define WM8994_IN2RN_MIXOUTL_VOL_WIDTH 3 /* IN2RN_MIXOUTL_VOL - [8:6] */
1580#define WM8994_MIXINR_MIXOUTL_VOL_MASK 0x0038 /* MIXINR_MIXOUTL_VOL - [5:3] */
1581#define WM8994_MIXINR_MIXOUTL_VOL_SHIFT 3 /* MIXINR_MIXOUTL_VOL - [5:3] */
1582#define WM8994_MIXINR_MIXOUTL_VOL_WIDTH 3 /* MIXINR_MIXOUTL_VOL - [5:3] */
1583#define WM8994_MIXINL_MIXOUTL_VOL_MASK 0x0007 /* MIXINL_MIXOUTL_VOL - [2:0] */
1584#define WM8994_MIXINL_MIXOUTL_VOL_SHIFT 0 /* MIXINL_MIXOUTL_VOL - [2:0] */
1585#define WM8994_MIXINL_MIXOUTL_VOL_WIDTH 3 /* MIXINL_MIXOUTL_VOL - [2:0] */
1586
1587/*
1588 * R50 (0x32) - Output Mixer (6)
1589 */
1590#define WM8994_DAC1R_MIXOUTR_VOL_MASK 0x0E00 /* DAC1R_MIXOUTR_VOL - [11:9] */
1591#define WM8994_DAC1R_MIXOUTR_VOL_SHIFT 9 /* DAC1R_MIXOUTR_VOL - [11:9] */
1592#define WM8994_DAC1R_MIXOUTR_VOL_WIDTH 3 /* DAC1R_MIXOUTR_VOL - [11:9] */
1593#define WM8994_IN2LN_MIXOUTR_VOL_MASK 0x01C0 /* IN2LN_MIXOUTR_VOL - [8:6] */
1594#define WM8994_IN2LN_MIXOUTR_VOL_SHIFT 6 /* IN2LN_MIXOUTR_VOL - [8:6] */
1595#define WM8994_IN2LN_MIXOUTR_VOL_WIDTH 3 /* IN2LN_MIXOUTR_VOL - [8:6] */
1596#define WM8994_MIXINL_MIXOUTR_VOL_MASK 0x0038 /* MIXINL_MIXOUTR_VOL - [5:3] */
1597#define WM8994_MIXINL_MIXOUTR_VOL_SHIFT 3 /* MIXINL_MIXOUTR_VOL - [5:3] */
1598#define WM8994_MIXINL_MIXOUTR_VOL_WIDTH 3 /* MIXINL_MIXOUTR_VOL - [5:3] */
1599#define WM8994_MIXINR_MIXOUTR_VOL_MASK 0x0007 /* MIXINR_MIXOUTR_VOL - [2:0] */
1600#define WM8994_MIXINR_MIXOUTR_VOL_SHIFT 0 /* MIXINR_MIXOUTR_VOL - [2:0] */
1601#define WM8994_MIXINR_MIXOUTR_VOL_WIDTH 3 /* MIXINR_MIXOUTR_VOL - [2:0] */
1602
1603/*
1604 * R51 (0x33) - HPOUT2 Mixer
1605 */
1606#define WM8994_IN2LRP_TO_HPOUT2 0x0020 /* IN2LRP_TO_HPOUT2 */
1607#define WM8994_IN2LRP_TO_HPOUT2_MASK 0x0020 /* IN2LRP_TO_HPOUT2 */
1608#define WM8994_IN2LRP_TO_HPOUT2_SHIFT 5 /* IN2LRP_TO_HPOUT2 */
1609#define WM8994_IN2LRP_TO_HPOUT2_WIDTH 1 /* IN2LRP_TO_HPOUT2 */
1610#define WM8994_MIXOUTLVOL_TO_HPOUT2 0x0010 /* MIXOUTLVOL_TO_HPOUT2 */
1611#define WM8994_MIXOUTLVOL_TO_HPOUT2_MASK 0x0010 /* MIXOUTLVOL_TO_HPOUT2 */
1612#define WM8994_MIXOUTLVOL_TO_HPOUT2_SHIFT 4 /* MIXOUTLVOL_TO_HPOUT2 */
1613#define WM8994_MIXOUTLVOL_TO_HPOUT2_WIDTH 1 /* MIXOUTLVOL_TO_HPOUT2 */
1614#define WM8994_MIXOUTRVOL_TO_HPOUT2 0x0008 /* MIXOUTRVOL_TO_HPOUT2 */
1615#define WM8994_MIXOUTRVOL_TO_HPOUT2_MASK 0x0008 /* MIXOUTRVOL_TO_HPOUT2 */
1616#define WM8994_MIXOUTRVOL_TO_HPOUT2_SHIFT 3 /* MIXOUTRVOL_TO_HPOUT2 */
1617#define WM8994_MIXOUTRVOL_TO_HPOUT2_WIDTH 1 /* MIXOUTRVOL_TO_HPOUT2 */
1618
1619/*
1620 * R52 (0x34) - Line Mixer (1)
1621 */
1622#define WM8994_MIXOUTL_TO_LINEOUT1N 0x0040 /* MIXOUTL_TO_LINEOUT1N */
1623#define WM8994_MIXOUTL_TO_LINEOUT1N_MASK 0x0040 /* MIXOUTL_TO_LINEOUT1N */
1624#define WM8994_MIXOUTL_TO_LINEOUT1N_SHIFT 6 /* MIXOUTL_TO_LINEOUT1N */
1625#define WM8994_MIXOUTL_TO_LINEOUT1N_WIDTH 1 /* MIXOUTL_TO_LINEOUT1N */
1626#define WM8994_MIXOUTR_TO_LINEOUT1N 0x0020 /* MIXOUTR_TO_LINEOUT1N */
1627#define WM8994_MIXOUTR_TO_LINEOUT1N_MASK 0x0020 /* MIXOUTR_TO_LINEOUT1N */
1628#define WM8994_MIXOUTR_TO_LINEOUT1N_SHIFT 5 /* MIXOUTR_TO_LINEOUT1N */
1629#define WM8994_MIXOUTR_TO_LINEOUT1N_WIDTH 1 /* MIXOUTR_TO_LINEOUT1N */
1630#define WM8994_LINEOUT1_MODE 0x0010 /* LINEOUT1_MODE */
1631#define WM8994_LINEOUT1_MODE_MASK 0x0010 /* LINEOUT1_MODE */
1632#define WM8994_LINEOUT1_MODE_SHIFT 4 /* LINEOUT1_MODE */
1633#define WM8994_LINEOUT1_MODE_WIDTH 1 /* LINEOUT1_MODE */
1634#define WM8994_IN1R_TO_LINEOUT1P 0x0004 /* IN1R_TO_LINEOUT1P */
1635#define WM8994_IN1R_TO_LINEOUT1P_MASK 0x0004 /* IN1R_TO_LINEOUT1P */
1636#define WM8994_IN1R_TO_LINEOUT1P_SHIFT 2 /* IN1R_TO_LINEOUT1P */
1637#define WM8994_IN1R_TO_LINEOUT1P_WIDTH 1 /* IN1R_TO_LINEOUT1P */
1638#define WM8994_IN1L_TO_LINEOUT1P 0x0002 /* IN1L_TO_LINEOUT1P */
1639#define WM8994_IN1L_TO_LINEOUT1P_MASK 0x0002 /* IN1L_TO_LINEOUT1P */
1640#define WM8994_IN1L_TO_LINEOUT1P_SHIFT 1 /* IN1L_TO_LINEOUT1P */
1641#define WM8994_IN1L_TO_LINEOUT1P_WIDTH 1 /* IN1L_TO_LINEOUT1P */
1642#define WM8994_MIXOUTL_TO_LINEOUT1P 0x0001 /* MIXOUTL_TO_LINEOUT1P */
1643#define WM8994_MIXOUTL_TO_LINEOUT1P_MASK 0x0001 /* MIXOUTL_TO_LINEOUT1P */
1644#define WM8994_MIXOUTL_TO_LINEOUT1P_SHIFT 0 /* MIXOUTL_TO_LINEOUT1P */
1645#define WM8994_MIXOUTL_TO_LINEOUT1P_WIDTH 1 /* MIXOUTL_TO_LINEOUT1P */
1646
1647/*
1648 * R53 (0x35) - Line Mixer (2)
1649 */
1650#define WM8994_MIXOUTR_TO_LINEOUT2N 0x0040 /* MIXOUTR_TO_LINEOUT2N */
1651#define WM8994_MIXOUTR_TO_LINEOUT2N_MASK 0x0040 /* MIXOUTR_TO_LINEOUT2N */
1652#define WM8994_MIXOUTR_TO_LINEOUT2N_SHIFT 6 /* MIXOUTR_TO_LINEOUT2N */
1653#define WM8994_MIXOUTR_TO_LINEOUT2N_WIDTH 1 /* MIXOUTR_TO_LINEOUT2N */
1654#define WM8994_MIXOUTL_TO_LINEOUT2N 0x0020 /* MIXOUTL_TO_LINEOUT2N */
1655#define WM8994_MIXOUTL_TO_LINEOUT2N_MASK 0x0020 /* MIXOUTL_TO_LINEOUT2N */
1656#define WM8994_MIXOUTL_TO_LINEOUT2N_SHIFT 5 /* MIXOUTL_TO_LINEOUT2N */
1657#define WM8994_MIXOUTL_TO_LINEOUT2N_WIDTH 1 /* MIXOUTL_TO_LINEOUT2N */
1658#define WM8994_LINEOUT2_MODE 0x0010 /* LINEOUT2_MODE */
1659#define WM8994_LINEOUT2_MODE_MASK 0x0010 /* LINEOUT2_MODE */
1660#define WM8994_LINEOUT2_MODE_SHIFT 4 /* LINEOUT2_MODE */
1661#define WM8994_LINEOUT2_MODE_WIDTH 1 /* LINEOUT2_MODE */
1662#define WM8994_IN1L_TO_LINEOUT2P 0x0004 /* IN1L_TO_LINEOUT2P */
1663#define WM8994_IN1L_TO_LINEOUT2P_MASK 0x0004 /* IN1L_TO_LINEOUT2P */
1664#define WM8994_IN1L_TO_LINEOUT2P_SHIFT 2 /* IN1L_TO_LINEOUT2P */
1665#define WM8994_IN1L_TO_LINEOUT2P_WIDTH 1 /* IN1L_TO_LINEOUT2P */
1666#define WM8994_IN1R_TO_LINEOUT2P 0x0002 /* IN1R_TO_LINEOUT2P */
1667#define WM8994_IN1R_TO_LINEOUT2P_MASK 0x0002 /* IN1R_TO_LINEOUT2P */
1668#define WM8994_IN1R_TO_LINEOUT2P_SHIFT 1 /* IN1R_TO_LINEOUT2P */
1669#define WM8994_IN1R_TO_LINEOUT2P_WIDTH 1 /* IN1R_TO_LINEOUT2P */
1670#define WM8994_MIXOUTR_TO_LINEOUT2P 0x0001 /* MIXOUTR_TO_LINEOUT2P */
1671#define WM8994_MIXOUTR_TO_LINEOUT2P_MASK 0x0001 /* MIXOUTR_TO_LINEOUT2P */
1672#define WM8994_MIXOUTR_TO_LINEOUT2P_SHIFT 0 /* MIXOUTR_TO_LINEOUT2P */
1673#define WM8994_MIXOUTR_TO_LINEOUT2P_WIDTH 1 /* MIXOUTR_TO_LINEOUT2P */
1674
1675/*
1676 * R54 (0x36) - Speaker Mixer
1677 */
1678#define WM8994_DAC2L_TO_SPKMIXL 0x0200 /* DAC2L_TO_SPKMIXL */
1679#define WM8994_DAC2L_TO_SPKMIXL_MASK 0x0200 /* DAC2L_TO_SPKMIXL */
1680#define WM8994_DAC2L_TO_SPKMIXL_SHIFT 9 /* DAC2L_TO_SPKMIXL */
1681#define WM8994_DAC2L_TO_SPKMIXL_WIDTH 1 /* DAC2L_TO_SPKMIXL */
1682#define WM8994_DAC2R_TO_SPKMIXR 0x0100 /* DAC2R_TO_SPKMIXR */
1683#define WM8994_DAC2R_TO_SPKMIXR_MASK 0x0100 /* DAC2R_TO_SPKMIXR */
1684#define WM8994_DAC2R_TO_SPKMIXR_SHIFT 8 /* DAC2R_TO_SPKMIXR */
1685#define WM8994_DAC2R_TO_SPKMIXR_WIDTH 1 /* DAC2R_TO_SPKMIXR */
1686#define WM8994_MIXINL_TO_SPKMIXL 0x0080 /* MIXINL_TO_SPKMIXL */
1687#define WM8994_MIXINL_TO_SPKMIXL_MASK 0x0080 /* MIXINL_TO_SPKMIXL */
1688#define WM8994_MIXINL_TO_SPKMIXL_SHIFT 7 /* MIXINL_TO_SPKMIXL */
1689#define WM8994_MIXINL_TO_SPKMIXL_WIDTH 1 /* MIXINL_TO_SPKMIXL */
1690#define WM8994_MIXINR_TO_SPKMIXR 0x0040 /* MIXINR_TO_SPKMIXR */
1691#define WM8994_MIXINR_TO_SPKMIXR_MASK 0x0040 /* MIXINR_TO_SPKMIXR */
1692#define WM8994_MIXINR_TO_SPKMIXR_SHIFT 6 /* MIXINR_TO_SPKMIXR */
1693#define WM8994_MIXINR_TO_SPKMIXR_WIDTH 1 /* MIXINR_TO_SPKMIXR */
1694#define WM8994_IN1LP_TO_SPKMIXL 0x0020 /* IN1LP_TO_SPKMIXL */
1695#define WM8994_IN1LP_TO_SPKMIXL_MASK 0x0020 /* IN1LP_TO_SPKMIXL */
1696#define WM8994_IN1LP_TO_SPKMIXL_SHIFT 5 /* IN1LP_TO_SPKMIXL */
1697#define WM8994_IN1LP_TO_SPKMIXL_WIDTH 1 /* IN1LP_TO_SPKMIXL */
1698#define WM8994_IN1RP_TO_SPKMIXR 0x0010 /* IN1RP_TO_SPKMIXR */
1699#define WM8994_IN1RP_TO_SPKMIXR_MASK 0x0010 /* IN1RP_TO_SPKMIXR */
1700#define WM8994_IN1RP_TO_SPKMIXR_SHIFT 4 /* IN1RP_TO_SPKMIXR */
1701#define WM8994_IN1RP_TO_SPKMIXR_WIDTH 1 /* IN1RP_TO_SPKMIXR */
1702#define WM8994_MIXOUTL_TO_SPKMIXL 0x0008 /* MIXOUTL_TO_SPKMIXL */
1703#define WM8994_MIXOUTL_TO_SPKMIXL_MASK 0x0008 /* MIXOUTL_TO_SPKMIXL */
1704#define WM8994_MIXOUTL_TO_SPKMIXL_SHIFT 3 /* MIXOUTL_TO_SPKMIXL */
1705#define WM8994_MIXOUTL_TO_SPKMIXL_WIDTH 1 /* MIXOUTL_TO_SPKMIXL */
1706#define WM8994_MIXOUTR_TO_SPKMIXR 0x0004 /* MIXOUTR_TO_SPKMIXR */
1707#define WM8994_MIXOUTR_TO_SPKMIXR_MASK 0x0004 /* MIXOUTR_TO_SPKMIXR */
1708#define WM8994_MIXOUTR_TO_SPKMIXR_SHIFT 2 /* MIXOUTR_TO_SPKMIXR */
1709#define WM8994_MIXOUTR_TO_SPKMIXR_WIDTH 1 /* MIXOUTR_TO_SPKMIXR */
1710#define WM8994_DAC1L_TO_SPKMIXL 0x0002 /* DAC1L_TO_SPKMIXL */
1711#define WM8994_DAC1L_TO_SPKMIXL_MASK 0x0002 /* DAC1L_TO_SPKMIXL */
1712#define WM8994_DAC1L_TO_SPKMIXL_SHIFT 1 /* DAC1L_TO_SPKMIXL */
1713#define WM8994_DAC1L_TO_SPKMIXL_WIDTH 1 /* DAC1L_TO_SPKMIXL */
1714#define WM8994_DAC1R_TO_SPKMIXR 0x0001 /* DAC1R_TO_SPKMIXR */
1715#define WM8994_DAC1R_TO_SPKMIXR_MASK 0x0001 /* DAC1R_TO_SPKMIXR */
1716#define WM8994_DAC1R_TO_SPKMIXR_SHIFT 0 /* DAC1R_TO_SPKMIXR */
1717#define WM8994_DAC1R_TO_SPKMIXR_WIDTH 1 /* DAC1R_TO_SPKMIXR */
1718
1719/*
1720 * R55 (0x37) - Additional Control
1721 */
1722#define WM8994_LINEOUT1_FB 0x0080 /* LINEOUT1_FB */
1723#define WM8994_LINEOUT1_FB_MASK 0x0080 /* LINEOUT1_FB */
1724#define WM8994_LINEOUT1_FB_SHIFT 7 /* LINEOUT1_FB */
1725#define WM8994_LINEOUT1_FB_WIDTH 1 /* LINEOUT1_FB */
1726#define WM8994_LINEOUT2_FB 0x0040 /* LINEOUT2_FB */
1727#define WM8994_LINEOUT2_FB_MASK 0x0040 /* LINEOUT2_FB */
1728#define WM8994_LINEOUT2_FB_SHIFT 6 /* LINEOUT2_FB */
1729#define WM8994_LINEOUT2_FB_WIDTH 1 /* LINEOUT2_FB */
1730#define WM8994_VROI 0x0001 /* VROI */
1731#define WM8994_VROI_MASK 0x0001 /* VROI */
1732#define WM8994_VROI_SHIFT 0 /* VROI */
1733#define WM8994_VROI_WIDTH 1 /* VROI */
1734
1735/*
1736 * R56 (0x38) - AntiPOP (1)
1737 */
1738#define WM8994_LINEOUT_VMID_BUF_ENA 0x0080 /* LINEOUT_VMID_BUF_ENA */
1739#define WM8994_LINEOUT_VMID_BUF_ENA_MASK 0x0080 /* LINEOUT_VMID_BUF_ENA */
1740#define WM8994_LINEOUT_VMID_BUF_ENA_SHIFT 7 /* LINEOUT_VMID_BUF_ENA */
1741#define WM8994_LINEOUT_VMID_BUF_ENA_WIDTH 1 /* LINEOUT_VMID_BUF_ENA */
1742#define WM8994_HPOUT2_IN_ENA 0x0040 /* HPOUT2_IN_ENA */
1743#define WM8994_HPOUT2_IN_ENA_MASK 0x0040 /* HPOUT2_IN_ENA */
1744#define WM8994_HPOUT2_IN_ENA_SHIFT 6 /* HPOUT2_IN_ENA */
1745#define WM8994_HPOUT2_IN_ENA_WIDTH 1 /* HPOUT2_IN_ENA */
1746#define WM8994_LINEOUT1_DISCH 0x0020 /* LINEOUT1_DISCH */
1747#define WM8994_LINEOUT1_DISCH_MASK 0x0020 /* LINEOUT1_DISCH */
1748#define WM8994_LINEOUT1_DISCH_SHIFT 5 /* LINEOUT1_DISCH */
1749#define WM8994_LINEOUT1_DISCH_WIDTH 1 /* LINEOUT1_DISCH */
1750#define WM8994_LINEOUT2_DISCH 0x0010 /* LINEOUT2_DISCH */
1751#define WM8994_LINEOUT2_DISCH_MASK 0x0010 /* LINEOUT2_DISCH */
1752#define WM8994_LINEOUT2_DISCH_SHIFT 4 /* LINEOUT2_DISCH */
1753#define WM8994_LINEOUT2_DISCH_WIDTH 1 /* LINEOUT2_DISCH */
1754
1755/*
1756 * R57 (0x39) - AntiPOP (2)
1757 */
1758#define WM8994_MICB2_DISCH 0x0100 /* MICB2_DISCH */
1759#define WM8994_MICB2_DISCH_MASK 0x0100 /* MICB2_DISCH */
1760#define WM8994_MICB2_DISCH_SHIFT 8 /* MICB2_DISCH */
1761#define WM8994_MICB2_DISCH_WIDTH 1 /* MICB2_DISCH */
1762#define WM8994_MICB1_DISCH 0x0080 /* MICB1_DISCH */
1763#define WM8994_MICB1_DISCH_MASK 0x0080 /* MICB1_DISCH */
1764#define WM8994_MICB1_DISCH_SHIFT 7 /* MICB1_DISCH */
1765#define WM8994_MICB1_DISCH_WIDTH 1 /* MICB1_DISCH */
1766#define WM8994_VMID_RAMP_MASK 0x0060 /* VMID_RAMP - [6:5] */
1767#define WM8994_VMID_RAMP_SHIFT 5 /* VMID_RAMP - [6:5] */
1768#define WM8994_VMID_RAMP_WIDTH 2 /* VMID_RAMP - [6:5] */
1769#define WM8994_VMID_BUF_ENA 0x0008 /* VMID_BUF_ENA */
1770#define WM8994_VMID_BUF_ENA_MASK 0x0008 /* VMID_BUF_ENA */
1771#define WM8994_VMID_BUF_ENA_SHIFT 3 /* VMID_BUF_ENA */
1772#define WM8994_VMID_BUF_ENA_WIDTH 1 /* VMID_BUF_ENA */
1773#define WM8994_STARTUP_BIAS_ENA 0x0004 /* STARTUP_BIAS_ENA */
1774#define WM8994_STARTUP_BIAS_ENA_MASK 0x0004 /* STARTUP_BIAS_ENA */
1775#define WM8994_STARTUP_BIAS_ENA_SHIFT 2 /* STARTUP_BIAS_ENA */
1776#define WM8994_STARTUP_BIAS_ENA_WIDTH 1 /* STARTUP_BIAS_ENA */
1777#define WM8994_BIAS_SRC 0x0002 /* BIAS_SRC */
1778#define WM8994_BIAS_SRC_MASK 0x0002 /* BIAS_SRC */
1779#define WM8994_BIAS_SRC_SHIFT 1 /* BIAS_SRC */
1780#define WM8994_BIAS_SRC_WIDTH 1 /* BIAS_SRC */
1781#define WM8994_VMID_DISCH 0x0001 /* VMID_DISCH */
1782#define WM8994_VMID_DISCH_MASK 0x0001 /* VMID_DISCH */
1783#define WM8994_VMID_DISCH_SHIFT 0 /* VMID_DISCH */
1784#define WM8994_VMID_DISCH_WIDTH 1 /* VMID_DISCH */
1785
1786/*
1787 * R58 (0x3A) - MICBIAS
1788 */
1789#define WM8994_MICD_SCTHR_MASK 0x00C0 /* MICD_SCTHR - [7:6] */
1790#define WM8994_MICD_SCTHR_SHIFT 6 /* MICD_SCTHR - [7:6] */
1791#define WM8994_MICD_SCTHR_WIDTH 2 /* MICD_SCTHR - [7:6] */
1792#define WM8994_MICD_THR_MASK 0x0038 /* MICD_THR - [5:3] */
1793#define WM8994_MICD_THR_SHIFT 3 /* MICD_THR - [5:3] */
1794#define WM8994_MICD_THR_WIDTH 3 /* MICD_THR - [5:3] */
1795#define WM8994_MICD_ENA 0x0004 /* MICD_ENA */
1796#define WM8994_MICD_ENA_MASK 0x0004 /* MICD_ENA */
1797#define WM8994_MICD_ENA_SHIFT 2 /* MICD_ENA */
1798#define WM8994_MICD_ENA_WIDTH 1 /* MICD_ENA */
1799#define WM8994_MICB2_LVL 0x0002 /* MICB2_LVL */
1800#define WM8994_MICB2_LVL_MASK 0x0002 /* MICB2_LVL */
1801#define WM8994_MICB2_LVL_SHIFT 1 /* MICB2_LVL */
1802#define WM8994_MICB2_LVL_WIDTH 1 /* MICB2_LVL */
1803#define WM8994_MICB1_LVL 0x0001 /* MICB1_LVL */
1804#define WM8994_MICB1_LVL_MASK 0x0001 /* MICB1_LVL */
1805#define WM8994_MICB1_LVL_SHIFT 0 /* MICB1_LVL */
1806#define WM8994_MICB1_LVL_WIDTH 1 /* MICB1_LVL */
1807
1808/*
1809 * R59 (0x3B) - LDO 1
1810 */
1811#define WM8994_LDO1_VSEL_MASK 0x000E /* LDO1_VSEL - [3:1] */
1812#define WM8994_LDO1_VSEL_SHIFT 1 /* LDO1_VSEL - [3:1] */
1813#define WM8994_LDO1_VSEL_WIDTH 3 /* LDO1_VSEL - [3:1] */
1814#define WM8994_LDO1_DISCH 0x0001 /* LDO1_DISCH */
1815#define WM8994_LDO1_DISCH_MASK 0x0001 /* LDO1_DISCH */
1816#define WM8994_LDO1_DISCH_SHIFT 0 /* LDO1_DISCH */
1817#define WM8994_LDO1_DISCH_WIDTH 1 /* LDO1_DISCH */
1818
1819/*
1820 * R60 (0x3C) - LDO 2
1821 */
1822#define WM8994_LDO2_VSEL_MASK 0x0006 /* LDO2_VSEL - [2:1] */
1823#define WM8994_LDO2_VSEL_SHIFT 1 /* LDO2_VSEL - [2:1] */
1824#define WM8994_LDO2_VSEL_WIDTH 2 /* LDO2_VSEL - [2:1] */
1825#define WM8994_LDO2_DISCH 0x0001 /* LDO2_DISCH */
1826#define WM8994_LDO2_DISCH_MASK 0x0001 /* LDO2_DISCH */
1827#define WM8994_LDO2_DISCH_SHIFT 0 /* LDO2_DISCH */
1828#define WM8994_LDO2_DISCH_WIDTH 1 /* LDO2_DISCH */
1829
1830/*
1831 * R76 (0x4C) - Charge Pump (1)
1832 */
1833#define WM8994_CP_ENA 0x8000 /* CP_ENA */
1834#define WM8994_CP_ENA_MASK 0x8000 /* CP_ENA */
1835#define WM8994_CP_ENA_SHIFT 15 /* CP_ENA */
1836#define WM8994_CP_ENA_WIDTH 1 /* CP_ENA */
1837
1838/*
1839 * R81 (0x51) - Class W (1)
1840 */
1841#define WM8994_CP_DYN_SRC_SEL_MASK 0x0300 /* CP_DYN_SRC_SEL - [9:8] */
1842#define WM8994_CP_DYN_SRC_SEL_SHIFT 8 /* CP_DYN_SRC_SEL - [9:8] */
1843#define WM8994_CP_DYN_SRC_SEL_WIDTH 2 /* CP_DYN_SRC_SEL - [9:8] */
1844#define WM8994_CP_DYN_PWR 0x0001 /* CP_DYN_PWR */
1845#define WM8994_CP_DYN_PWR_MASK 0x0001 /* CP_DYN_PWR */
1846#define WM8994_CP_DYN_PWR_SHIFT 0 /* CP_DYN_PWR */
1847#define WM8994_CP_DYN_PWR_WIDTH 1 /* CP_DYN_PWR */
1848
1849/*
1850 * R84 (0x54) - DC Servo (1)
1851 */
1852#define WM8994_DCS_TRIG_SINGLE_1 0x2000 /* DCS_TRIG_SINGLE_1 */
1853#define WM8994_DCS_TRIG_SINGLE_1_MASK 0x2000 /* DCS_TRIG_SINGLE_1 */
1854#define WM8994_DCS_TRIG_SINGLE_1_SHIFT 13 /* DCS_TRIG_SINGLE_1 */
1855#define WM8994_DCS_TRIG_SINGLE_1_WIDTH 1 /* DCS_TRIG_SINGLE_1 */
1856#define WM8994_DCS_TRIG_SINGLE_0 0x1000 /* DCS_TRIG_SINGLE_0 */
1857#define WM8994_DCS_TRIG_SINGLE_0_MASK 0x1000 /* DCS_TRIG_SINGLE_0 */
1858#define WM8994_DCS_TRIG_SINGLE_0_SHIFT 12 /* DCS_TRIG_SINGLE_0 */
1859#define WM8994_DCS_TRIG_SINGLE_0_WIDTH 1 /* DCS_TRIG_SINGLE_0 */
1860#define WM8994_DCS_TRIG_SERIES_1 0x0200 /* DCS_TRIG_SERIES_1 */
1861#define WM8994_DCS_TRIG_SERIES_1_MASK 0x0200 /* DCS_TRIG_SERIES_1 */
1862#define WM8994_DCS_TRIG_SERIES_1_SHIFT 9 /* DCS_TRIG_SERIES_1 */
1863#define WM8994_DCS_TRIG_SERIES_1_WIDTH 1 /* DCS_TRIG_SERIES_1 */
1864#define WM8994_DCS_TRIG_SERIES_0 0x0100 /* DCS_TRIG_SERIES_0 */
1865#define WM8994_DCS_TRIG_SERIES_0_MASK 0x0100 /* DCS_TRIG_SERIES_0 */
1866#define WM8994_DCS_TRIG_SERIES_0_SHIFT 8 /* DCS_TRIG_SERIES_0 */
1867#define WM8994_DCS_TRIG_SERIES_0_WIDTH 1 /* DCS_TRIG_SERIES_0 */
1868#define WM8994_DCS_TRIG_STARTUP_1 0x0020 /* DCS_TRIG_STARTUP_1 */
1869#define WM8994_DCS_TRIG_STARTUP_1_MASK 0x0020 /* DCS_TRIG_STARTUP_1 */
1870#define WM8994_DCS_TRIG_STARTUP_1_SHIFT 5 /* DCS_TRIG_STARTUP_1 */
1871#define WM8994_DCS_TRIG_STARTUP_1_WIDTH 1 /* DCS_TRIG_STARTUP_1 */
1872#define WM8994_DCS_TRIG_STARTUP_0 0x0010 /* DCS_TRIG_STARTUP_0 */
1873#define WM8994_DCS_TRIG_STARTUP_0_MASK 0x0010 /* DCS_TRIG_STARTUP_0 */
1874#define WM8994_DCS_TRIG_STARTUP_0_SHIFT 4 /* DCS_TRIG_STARTUP_0 */
1875#define WM8994_DCS_TRIG_STARTUP_0_WIDTH 1 /* DCS_TRIG_STARTUP_0 */
1876#define WM8994_DCS_TRIG_DAC_WR_1 0x0008 /* DCS_TRIG_DAC_WR_1 */
1877#define WM8994_DCS_TRIG_DAC_WR_1_MASK 0x0008 /* DCS_TRIG_DAC_WR_1 */
1878#define WM8994_DCS_TRIG_DAC_WR_1_SHIFT 3 /* DCS_TRIG_DAC_WR_1 */
1879#define WM8994_DCS_TRIG_DAC_WR_1_WIDTH 1 /* DCS_TRIG_DAC_WR_1 */
1880#define WM8994_DCS_TRIG_DAC_WR_0 0x0004 /* DCS_TRIG_DAC_WR_0 */
1881#define WM8994_DCS_TRIG_DAC_WR_0_MASK 0x0004 /* DCS_TRIG_DAC_WR_0 */
1882#define WM8994_DCS_TRIG_DAC_WR_0_SHIFT 2 /* DCS_TRIG_DAC_WR_0 */
1883#define WM8994_DCS_TRIG_DAC_WR_0_WIDTH 1 /* DCS_TRIG_DAC_WR_0 */
1884#define WM8994_DCS_ENA_CHAN_1 0x0002 /* DCS_ENA_CHAN_1 */
1885#define WM8994_DCS_ENA_CHAN_1_MASK 0x0002 /* DCS_ENA_CHAN_1 */
1886#define WM8994_DCS_ENA_CHAN_1_SHIFT 1 /* DCS_ENA_CHAN_1 */
1887#define WM8994_DCS_ENA_CHAN_1_WIDTH 1 /* DCS_ENA_CHAN_1 */
1888#define WM8994_DCS_ENA_CHAN_0 0x0001 /* DCS_ENA_CHAN_0 */
1889#define WM8994_DCS_ENA_CHAN_0_MASK 0x0001 /* DCS_ENA_CHAN_0 */
1890#define WM8994_DCS_ENA_CHAN_0_SHIFT 0 /* DCS_ENA_CHAN_0 */
1891#define WM8994_DCS_ENA_CHAN_0_WIDTH 1 /* DCS_ENA_CHAN_0 */
1892
1893/*
1894 * R85 (0x55) - DC Servo (2)
1895 */
1896#define WM8994_DCS_SERIES_NO_01_MASK 0x0FE0 /* DCS_SERIES_NO_01 - [11:5] */
1897#define WM8994_DCS_SERIES_NO_01_SHIFT 5 /* DCS_SERIES_NO_01 - [11:5] */
1898#define WM8994_DCS_SERIES_NO_01_WIDTH 7 /* DCS_SERIES_NO_01 - [11:5] */
1899#define WM8994_DCS_TIMER_PERIOD_01_MASK 0x000F /* DCS_TIMER_PERIOD_01 - [3:0] */
1900#define WM8994_DCS_TIMER_PERIOD_01_SHIFT 0 /* DCS_TIMER_PERIOD_01 - [3:0] */
1901#define WM8994_DCS_TIMER_PERIOD_01_WIDTH 4 /* DCS_TIMER_PERIOD_01 - [3:0] */
1902
1903/*
1904 * R87 (0x57) - DC Servo (4)
1905 */
1906#define WM8994_DCS_DAC_WR_VAL_1_MASK 0xFF00 /* DCS_DAC_WR_VAL_1 - [15:8] */
1907#define WM8994_DCS_DAC_WR_VAL_1_SHIFT 8 /* DCS_DAC_WR_VAL_1 - [15:8] */
1908#define WM8994_DCS_DAC_WR_VAL_1_WIDTH 8 /* DCS_DAC_WR_VAL_1 - [15:8] */
1909#define WM8994_DCS_DAC_WR_VAL_0_MASK 0x00FF /* DCS_DAC_WR_VAL_0 - [7:0] */
1910#define WM8994_DCS_DAC_WR_VAL_0_SHIFT 0 /* DCS_DAC_WR_VAL_0 - [7:0] */
1911#define WM8994_DCS_DAC_WR_VAL_0_WIDTH 8 /* DCS_DAC_WR_VAL_0 - [7:0] */
1912
1913/*
1914 * R88 (0x58) - DC Servo Readback
1915 */
1916#define WM8994_DCS_CAL_COMPLETE_MASK 0x0300 /* DCS_CAL_COMPLETE - [9:8] */
1917#define WM8994_DCS_CAL_COMPLETE_SHIFT 8 /* DCS_CAL_COMPLETE - [9:8] */
1918#define WM8994_DCS_CAL_COMPLETE_WIDTH 2 /* DCS_CAL_COMPLETE - [9:8] */
1919#define WM8994_DCS_DAC_WR_COMPLETE_MASK 0x0030 /* DCS_DAC_WR_COMPLETE - [5:4] */
1920#define WM8994_DCS_DAC_WR_COMPLETE_SHIFT 4 /* DCS_DAC_WR_COMPLETE - [5:4] */
1921#define WM8994_DCS_DAC_WR_COMPLETE_WIDTH 2 /* DCS_DAC_WR_COMPLETE - [5:4] */
1922#define WM8994_DCS_STARTUP_COMPLETE_MASK 0x0003 /* DCS_STARTUP_COMPLETE - [1:0] */
1923#define WM8994_DCS_STARTUP_COMPLETE_SHIFT 0 /* DCS_STARTUP_COMPLETE - [1:0] */
1924#define WM8994_DCS_STARTUP_COMPLETE_WIDTH 2 /* DCS_STARTUP_COMPLETE - [1:0] */
1925
1926/*
1927 * R96 (0x60) - Analogue HP (1)
1928 */
1929#define WM8994_HPOUT1L_RMV_SHORT 0x0080 /* HPOUT1L_RMV_SHORT */
1930#define WM8994_HPOUT1L_RMV_SHORT_MASK 0x0080 /* HPOUT1L_RMV_SHORT */
1931#define WM8994_HPOUT1L_RMV_SHORT_SHIFT 7 /* HPOUT1L_RMV_SHORT */
1932#define WM8994_HPOUT1L_RMV_SHORT_WIDTH 1 /* HPOUT1L_RMV_SHORT */
1933#define WM8994_HPOUT1L_OUTP 0x0040 /* HPOUT1L_OUTP */
1934#define WM8994_HPOUT1L_OUTP_MASK 0x0040 /* HPOUT1L_OUTP */
1935#define WM8994_HPOUT1L_OUTP_SHIFT 6 /* HPOUT1L_OUTP */
1936#define WM8994_HPOUT1L_OUTP_WIDTH 1 /* HPOUT1L_OUTP */
1937#define WM8994_HPOUT1L_DLY 0x0020 /* HPOUT1L_DLY */
1938#define WM8994_HPOUT1L_DLY_MASK 0x0020 /* HPOUT1L_DLY */
1939#define WM8994_HPOUT1L_DLY_SHIFT 5 /* HPOUT1L_DLY */
1940#define WM8994_HPOUT1L_DLY_WIDTH 1 /* HPOUT1L_DLY */
1941#define WM8994_HPOUT1R_RMV_SHORT 0x0008 /* HPOUT1R_RMV_SHORT */
1942#define WM8994_HPOUT1R_RMV_SHORT_MASK 0x0008 /* HPOUT1R_RMV_SHORT */
1943#define WM8994_HPOUT1R_RMV_SHORT_SHIFT 3 /* HPOUT1R_RMV_SHORT */
1944#define WM8994_HPOUT1R_RMV_SHORT_WIDTH 1 /* HPOUT1R_RMV_SHORT */
1945#define WM8994_HPOUT1R_OUTP 0x0004 /* HPOUT1R_OUTP */
1946#define WM8994_HPOUT1R_OUTP_MASK 0x0004 /* HPOUT1R_OUTP */
1947#define WM8994_HPOUT1R_OUTP_SHIFT 2 /* HPOUT1R_OUTP */
1948#define WM8994_HPOUT1R_OUTP_WIDTH 1 /* HPOUT1R_OUTP */
1949#define WM8994_HPOUT1R_DLY 0x0002 /* HPOUT1R_DLY */
1950#define WM8994_HPOUT1R_DLY_MASK 0x0002 /* HPOUT1R_DLY */
1951#define WM8994_HPOUT1R_DLY_SHIFT 1 /* HPOUT1R_DLY */
1952#define WM8994_HPOUT1R_DLY_WIDTH 1 /* HPOUT1R_DLY */
1953
1954/*
1955 * R256 (0x100) - Chip Revision
1956 */
1957#define WM8994_CHIP_REV_MASK 0x000F /* CHIP_REV - [3:0] */
1958#define WM8994_CHIP_REV_SHIFT 0 /* CHIP_REV - [3:0] */
1959#define WM8994_CHIP_REV_WIDTH 4 /* CHIP_REV - [3:0] */
1960
1961/*
1962 * R257 (0x101) - Control Interface
1963 */
1964#define WM8994_SPI_CONTRD 0x0040 /* SPI_CONTRD */
1965#define WM8994_SPI_CONTRD_MASK 0x0040 /* SPI_CONTRD */
1966#define WM8994_SPI_CONTRD_SHIFT 6 /* SPI_CONTRD */
1967#define WM8994_SPI_CONTRD_WIDTH 1 /* SPI_CONTRD */
1968#define WM8994_SPI_4WIRE 0x0020 /* SPI_4WIRE */
1969#define WM8994_SPI_4WIRE_MASK 0x0020 /* SPI_4WIRE */
1970#define WM8994_SPI_4WIRE_SHIFT 5 /* SPI_4WIRE */
1971#define WM8994_SPI_4WIRE_WIDTH 1 /* SPI_4WIRE */
1972#define WM8994_SPI_CFG 0x0010 /* SPI_CFG */
1973#define WM8994_SPI_CFG_MASK 0x0010 /* SPI_CFG */
1974#define WM8994_SPI_CFG_SHIFT 4 /* SPI_CFG */
1975#define WM8994_SPI_CFG_WIDTH 1 /* SPI_CFG */
1976#define WM8994_AUTO_INC 0x0004 /* AUTO_INC */
1977#define WM8994_AUTO_INC_MASK 0x0004 /* AUTO_INC */
1978#define WM8994_AUTO_INC_SHIFT 2 /* AUTO_INC */
1979#define WM8994_AUTO_INC_WIDTH 1 /* AUTO_INC */
1980
1981/*
1982 * R272 (0x110) - Write Sequencer Ctrl (1)
1983 */
1984#define WM8994_WSEQ_ENA 0x8000 /* WSEQ_ENA */
1985#define WM8994_WSEQ_ENA_MASK 0x8000 /* WSEQ_ENA */
1986#define WM8994_WSEQ_ENA_SHIFT 15 /* WSEQ_ENA */
1987#define WM8994_WSEQ_ENA_WIDTH 1 /* WSEQ_ENA */
1988#define WM8994_WSEQ_ABORT 0x0200 /* WSEQ_ABORT */
1989#define WM8994_WSEQ_ABORT_MASK 0x0200 /* WSEQ_ABORT */
1990#define WM8994_WSEQ_ABORT_SHIFT 9 /* WSEQ_ABORT */
1991#define WM8994_WSEQ_ABORT_WIDTH 1 /* WSEQ_ABORT */
1992#define WM8994_WSEQ_START 0x0100 /* WSEQ_START */
1993#define WM8994_WSEQ_START_MASK 0x0100 /* WSEQ_START */
1994#define WM8994_WSEQ_START_SHIFT 8 /* WSEQ_START */
1995#define WM8994_WSEQ_START_WIDTH 1 /* WSEQ_START */
1996#define WM8994_WSEQ_START_INDEX_MASK 0x007F /* WSEQ_START_INDEX - [6:0] */
1997#define WM8994_WSEQ_START_INDEX_SHIFT 0 /* WSEQ_START_INDEX - [6:0] */
1998#define WM8994_WSEQ_START_INDEX_WIDTH 7 /* WSEQ_START_INDEX - [6:0] */
1999
2000/*
2001 * R273 (0x111) - Write Sequencer Ctrl (2)
2002 */
2003#define WM8994_WSEQ_BUSY 0x0100 /* WSEQ_BUSY */
2004#define WM8994_WSEQ_BUSY_MASK 0x0100 /* WSEQ_BUSY */
2005#define WM8994_WSEQ_BUSY_SHIFT 8 /* WSEQ_BUSY */
2006#define WM8994_WSEQ_BUSY_WIDTH 1 /* WSEQ_BUSY */
2007#define WM8994_WSEQ_CURRENT_INDEX_MASK 0x007F /* WSEQ_CURRENT_INDEX - [6:0] */
2008#define WM8994_WSEQ_CURRENT_INDEX_SHIFT 0 /* WSEQ_CURRENT_INDEX - [6:0] */
2009#define WM8994_WSEQ_CURRENT_INDEX_WIDTH 7 /* WSEQ_CURRENT_INDEX - [6:0] */
2010
2011/*
2012 * R512 (0x200) - AIF1 Clocking (1)
2013 */
2014#define WM8994_AIF1CLK_SRC_MASK 0x0018 /* AIF1CLK_SRC - [4:3] */
2015#define WM8994_AIF1CLK_SRC_SHIFT 3 /* AIF1CLK_SRC - [4:3] */
2016#define WM8994_AIF1CLK_SRC_WIDTH 2 /* AIF1CLK_SRC - [4:3] */
2017#define WM8994_AIF1CLK_INV 0x0004 /* AIF1CLK_INV */
2018#define WM8994_AIF1CLK_INV_MASK 0x0004 /* AIF1CLK_INV */
2019#define WM8994_AIF1CLK_INV_SHIFT 2 /* AIF1CLK_INV */
2020#define WM8994_AIF1CLK_INV_WIDTH 1 /* AIF1CLK_INV */
2021#define WM8994_AIF1CLK_DIV 0x0002 /* AIF1CLK_DIV */
2022#define WM8994_AIF1CLK_DIV_MASK 0x0002 /* AIF1CLK_DIV */
2023#define WM8994_AIF1CLK_DIV_SHIFT 1 /* AIF1CLK_DIV */
2024#define WM8994_AIF1CLK_DIV_WIDTH 1 /* AIF1CLK_DIV */
2025#define WM8994_AIF1CLK_ENA 0x0001 /* AIF1CLK_ENA */
2026#define WM8994_AIF1CLK_ENA_MASK 0x0001 /* AIF1CLK_ENA */
2027#define WM8994_AIF1CLK_ENA_SHIFT 0 /* AIF1CLK_ENA */
2028#define WM8994_AIF1CLK_ENA_WIDTH 1 /* AIF1CLK_ENA */
2029
2030/*
2031 * R513 (0x201) - AIF1 Clocking (2)
2032 */
2033#define WM8994_AIF1DAC_DIV_MASK 0x0038 /* AIF1DAC_DIV - [5:3] */
2034#define WM8994_AIF1DAC_DIV_SHIFT 3 /* AIF1DAC_DIV - [5:3] */
2035#define WM8994_AIF1DAC_DIV_WIDTH 3 /* AIF1DAC_DIV - [5:3] */
2036#define WM8994_AIF1ADC_DIV_MASK 0x0007 /* AIF1ADC_DIV - [2:0] */
2037#define WM8994_AIF1ADC_DIV_SHIFT 0 /* AIF1ADC_DIV - [2:0] */
2038#define WM8994_AIF1ADC_DIV_WIDTH 3 /* AIF1ADC_DIV - [2:0] */
2039
2040/*
2041 * R516 (0x204) - AIF2 Clocking (1)
2042 */
2043#define WM8994_AIF2CLK_SRC_MASK 0x0018 /* AIF2CLK_SRC - [4:3] */
2044#define WM8994_AIF2CLK_SRC_SHIFT 3 /* AIF2CLK_SRC - [4:3] */
2045#define WM8994_AIF2CLK_SRC_WIDTH 2 /* AIF2CLK_SRC - [4:3] */
2046#define WM8994_AIF2CLK_INV 0x0004 /* AIF2CLK_INV */
2047#define WM8994_AIF2CLK_INV_MASK 0x0004 /* AIF2CLK_INV */
2048#define WM8994_AIF2CLK_INV_SHIFT 2 /* AIF2CLK_INV */
2049#define WM8994_AIF2CLK_INV_WIDTH 1 /* AIF2CLK_INV */
2050#define WM8994_AIF2CLK_DIV 0x0002 /* AIF2CLK_DIV */
2051#define WM8994_AIF2CLK_DIV_MASK 0x0002 /* AIF2CLK_DIV */
2052#define WM8994_AIF2CLK_DIV_SHIFT 1 /* AIF2CLK_DIV */
2053#define WM8994_AIF2CLK_DIV_WIDTH 1 /* AIF2CLK_DIV */
2054#define WM8994_AIF2CLK_ENA 0x0001 /* AIF2CLK_ENA */
2055#define WM8994_AIF2CLK_ENA_MASK 0x0001 /* AIF2CLK_ENA */
2056#define WM8994_AIF2CLK_ENA_SHIFT 0 /* AIF2CLK_ENA */
2057#define WM8994_AIF2CLK_ENA_WIDTH 1 /* AIF2CLK_ENA */
2058
2059/*
2060 * R517 (0x205) - AIF2 Clocking (2)
2061 */
2062#define WM8994_AIF2DAC_DIV_MASK 0x0038 /* AIF2DAC_DIV - [5:3] */
2063#define WM8994_AIF2DAC_DIV_SHIFT 3 /* AIF2DAC_DIV - [5:3] */
2064#define WM8994_AIF2DAC_DIV_WIDTH 3 /* AIF2DAC_DIV - [5:3] */
2065#define WM8994_AIF2ADC_DIV_MASK 0x0007 /* AIF2ADC_DIV - [2:0] */
2066#define WM8994_AIF2ADC_DIV_SHIFT 0 /* AIF2ADC_DIV - [2:0] */
2067#define WM8994_AIF2ADC_DIV_WIDTH 3 /* AIF2ADC_DIV - [2:0] */
2068
2069/*
2070 * R520 (0x208) - Clocking (1)
2071 */
2072#define WM8994_TOCLK_ENA 0x0010 /* TOCLK_ENA */
2073#define WM8994_TOCLK_ENA_MASK 0x0010 /* TOCLK_ENA */
2074#define WM8994_TOCLK_ENA_SHIFT 4 /* TOCLK_ENA */
2075#define WM8994_TOCLK_ENA_WIDTH 1 /* TOCLK_ENA */
2076#define WM8994_AIF1DSPCLK_ENA 0x0008 /* AIF1DSPCLK_ENA */
2077#define WM8994_AIF1DSPCLK_ENA_MASK 0x0008 /* AIF1DSPCLK_ENA */
2078#define WM8994_AIF1DSPCLK_ENA_SHIFT 3 /* AIF1DSPCLK_ENA */
2079#define WM8994_AIF1DSPCLK_ENA_WIDTH 1 /* AIF1DSPCLK_ENA */
2080#define WM8994_AIF2DSPCLK_ENA 0x0004 /* AIF2DSPCLK_ENA */
2081#define WM8994_AIF2DSPCLK_ENA_MASK 0x0004 /* AIF2DSPCLK_ENA */
2082#define WM8994_AIF2DSPCLK_ENA_SHIFT 2 /* AIF2DSPCLK_ENA */
2083#define WM8994_AIF2DSPCLK_ENA_WIDTH 1 /* AIF2DSPCLK_ENA */
2084#define WM8994_SYSDSPCLK_ENA 0x0002 /* SYSDSPCLK_ENA */
2085#define WM8994_SYSDSPCLK_ENA_MASK 0x0002 /* SYSDSPCLK_ENA */
2086#define WM8994_SYSDSPCLK_ENA_SHIFT 1 /* SYSDSPCLK_ENA */
2087#define WM8994_SYSDSPCLK_ENA_WIDTH 1 /* SYSDSPCLK_ENA */
2088#define WM8994_SYSCLK_SRC 0x0001 /* SYSCLK_SRC */
2089#define WM8994_SYSCLK_SRC_MASK 0x0001 /* SYSCLK_SRC */
2090#define WM8994_SYSCLK_SRC_SHIFT 0 /* SYSCLK_SRC */
2091#define WM8994_SYSCLK_SRC_WIDTH 1 /* SYSCLK_SRC */
2092
2093/*
2094 * R521 (0x209) - Clocking (2)
2095 */
2096#define WM8994_TOCLK_DIV_MASK 0x0700 /* TOCLK_DIV - [10:8] */
2097#define WM8994_TOCLK_DIV_SHIFT 8 /* TOCLK_DIV - [10:8] */
2098#define WM8994_TOCLK_DIV_WIDTH 3 /* TOCLK_DIV - [10:8] */
2099#define WM8994_DBCLK_DIV_MASK 0x0070 /* DBCLK_DIV - [6:4] */
2100#define WM8994_DBCLK_DIV_SHIFT 4 /* DBCLK_DIV - [6:4] */
2101#define WM8994_DBCLK_DIV_WIDTH 3 /* DBCLK_DIV - [6:4] */
2102#define WM8994_OPCLK_DIV_MASK 0x0007 /* OPCLK_DIV - [2:0] */
2103#define WM8994_OPCLK_DIV_SHIFT 0 /* OPCLK_DIV - [2:0] */
2104#define WM8994_OPCLK_DIV_WIDTH 3 /* OPCLK_DIV - [2:0] */
2105
2106/*
2107 * R528 (0x210) - AIF1 Rate
2108 */
2109#define WM8994_AIF1_SR_MASK 0x00F0 /* AIF1_SR - [7:4] */
2110#define WM8994_AIF1_SR_SHIFT 4 /* AIF1_SR - [7:4] */
2111#define WM8994_AIF1_SR_WIDTH 4 /* AIF1_SR - [7:4] */
2112#define WM8994_AIF1CLK_RATE_MASK 0x000F /* AIF1CLK_RATE - [3:0] */
2113#define WM8994_AIF1CLK_RATE_SHIFT 0 /* AIF1CLK_RATE - [3:0] */
2114#define WM8994_AIF1CLK_RATE_WIDTH 4 /* AIF1CLK_RATE - [3:0] */
2115
2116/*
2117 * R529 (0x211) - AIF2 Rate
2118 */
2119#define WM8994_AIF2_SR_MASK 0x00F0 /* AIF2_SR - [7:4] */
2120#define WM8994_AIF2_SR_SHIFT 4 /* AIF2_SR - [7:4] */
2121#define WM8994_AIF2_SR_WIDTH 4 /* AIF2_SR - [7:4] */
2122#define WM8994_AIF2CLK_RATE_MASK 0x000F /* AIF2CLK_RATE - [3:0] */
2123#define WM8994_AIF2CLK_RATE_SHIFT 0 /* AIF2CLK_RATE - [3:0] */
2124#define WM8994_AIF2CLK_RATE_WIDTH 4 /* AIF2CLK_RATE - [3:0] */
2125
2126/*
2127 * R530 (0x212) - Rate Status
2128 */
2129#define WM8994_SR_ERROR_MASK 0x000F /* SR_ERROR - [3:0] */
2130#define WM8994_SR_ERROR_SHIFT 0 /* SR_ERROR - [3:0] */
2131#define WM8994_SR_ERROR_WIDTH 4 /* SR_ERROR - [3:0] */
2132
2133/*
2134 * R544 (0x220) - FLL1 Control (1)
2135 */
2136#define WM8994_FLL1_FRAC 0x0004 /* FLL1_FRAC */
2137#define WM8994_FLL1_FRAC_MASK 0x0004 /* FLL1_FRAC */
2138#define WM8994_FLL1_FRAC_SHIFT 2 /* FLL1_FRAC */
2139#define WM8994_FLL1_FRAC_WIDTH 1 /* FLL1_FRAC */
2140#define WM8994_FLL1_OSC_ENA 0x0002 /* FLL1_OSC_ENA */
2141#define WM8994_FLL1_OSC_ENA_MASK 0x0002 /* FLL1_OSC_ENA */
2142#define WM8994_FLL1_OSC_ENA_SHIFT 1 /* FLL1_OSC_ENA */
2143#define WM8994_FLL1_OSC_ENA_WIDTH 1 /* FLL1_OSC_ENA */
2144#define WM8994_FLL1_ENA 0x0001 /* FLL1_ENA */
2145#define WM8994_FLL1_ENA_MASK 0x0001 /* FLL1_ENA */
2146#define WM8994_FLL1_ENA_SHIFT 0 /* FLL1_ENA */
2147#define WM8994_FLL1_ENA_WIDTH 1 /* FLL1_ENA */
2148
2149/*
2150 * R545 (0x221) - FLL1 Control (2)
2151 */
2152#define WM8994_FLL1_OUTDIV_MASK 0x3F00 /* FLL1_OUTDIV - [13:8] */
2153#define WM8994_FLL1_OUTDIV_SHIFT 8 /* FLL1_OUTDIV - [13:8] */
2154#define WM8994_FLL1_OUTDIV_WIDTH 6 /* FLL1_OUTDIV - [13:8] */
2155#define WM8994_FLL1_CTRL_RATE_MASK 0x0070 /* FLL1_CTRL_RATE - [6:4] */
2156#define WM8994_FLL1_CTRL_RATE_SHIFT 4 /* FLL1_CTRL_RATE - [6:4] */
2157#define WM8994_FLL1_CTRL_RATE_WIDTH 3 /* FLL1_CTRL_RATE - [6:4] */
2158#define WM8994_FLL1_FRATIO_MASK 0x0007 /* FLL1_FRATIO - [2:0] */
2159#define WM8994_FLL1_FRATIO_SHIFT 0 /* FLL1_FRATIO - [2:0] */
2160#define WM8994_FLL1_FRATIO_WIDTH 3 /* FLL1_FRATIO - [2:0] */
2161
2162/*
2163 * R546 (0x222) - FLL1 Control (3)
2164 */
2165#define WM8994_FLL1_K_MASK 0xFFFF /* FLL1_K - [15:0] */
2166#define WM8994_FLL1_K_SHIFT 0 /* FLL1_K - [15:0] */
2167#define WM8994_FLL1_K_WIDTH 16 /* FLL1_K - [15:0] */
2168
2169/*
2170 * R547 (0x223) - FLL1 Control (4)
2171 */
2172#define WM8994_FLL1_N_MASK 0x7FE0 /* FLL1_N - [14:5] */
2173#define WM8994_FLL1_N_SHIFT 5 /* FLL1_N - [14:5] */
2174#define WM8994_FLL1_N_WIDTH 10 /* FLL1_N - [14:5] */
2175#define WM8994_FLL1_LOOP_GAIN_MASK 0x000F /* FLL1_LOOP_GAIN - [3:0] */
2176#define WM8994_FLL1_LOOP_GAIN_SHIFT 0 /* FLL1_LOOP_GAIN - [3:0] */
2177#define WM8994_FLL1_LOOP_GAIN_WIDTH 4 /* FLL1_LOOP_GAIN - [3:0] */
2178
2179/*
2180 * R548 (0x224) - FLL1 Control (5)
2181 */
2182#define WM8994_FLL1_FRC_NCO_VAL_MASK 0x1F80 /* FLL1_FRC_NCO_VAL - [12:7] */
2183#define WM8994_FLL1_FRC_NCO_VAL_SHIFT 7 /* FLL1_FRC_NCO_VAL - [12:7] */
2184#define WM8994_FLL1_FRC_NCO_VAL_WIDTH 6 /* FLL1_FRC_NCO_VAL - [12:7] */
2185#define WM8994_FLL1_FRC_NCO 0x0040 /* FLL1_FRC_NCO */
2186#define WM8994_FLL1_FRC_NCO_MASK 0x0040 /* FLL1_FRC_NCO */
2187#define WM8994_FLL1_FRC_NCO_SHIFT 6 /* FLL1_FRC_NCO */
2188#define WM8994_FLL1_FRC_NCO_WIDTH 1 /* FLL1_FRC_NCO */
2189#define WM8994_FLL1_REFCLK_DIV_MASK 0x0018 /* FLL1_REFCLK_DIV - [4:3] */
2190#define WM8994_FLL1_REFCLK_DIV_SHIFT 3 /* FLL1_REFCLK_DIV - [4:3] */
2191#define WM8994_FLL1_REFCLK_DIV_WIDTH 2 /* FLL1_REFCLK_DIV - [4:3] */
2192#define WM8994_FLL1_REFCLK_SRC_MASK 0x0003 /* FLL1_REFCLK_SRC - [1:0] */
2193#define WM8994_FLL1_REFCLK_SRC_SHIFT 0 /* FLL1_REFCLK_SRC - [1:0] */
2194#define WM8994_FLL1_REFCLK_SRC_WIDTH 2 /* FLL1_REFCLK_SRC - [1:0] */
2195
2196/*
2197 * R576 (0x240) - FLL2 Control (1)
2198 */
2199#define WM8994_FLL2_FRAC 0x0004 /* FLL2_FRAC */
2200#define WM8994_FLL2_FRAC_MASK 0x0004 /* FLL2_FRAC */
2201#define WM8994_FLL2_FRAC_SHIFT 2 /* FLL2_FRAC */
2202#define WM8994_FLL2_FRAC_WIDTH 1 /* FLL2_FRAC */
2203#define WM8994_FLL2_OSC_ENA 0x0002 /* FLL2_OSC_ENA */
2204#define WM8994_FLL2_OSC_ENA_MASK 0x0002 /* FLL2_OSC_ENA */
2205#define WM8994_FLL2_OSC_ENA_SHIFT 1 /* FLL2_OSC_ENA */
2206#define WM8994_FLL2_OSC_ENA_WIDTH 1 /* FLL2_OSC_ENA */
2207#define WM8994_FLL2_ENA 0x0001 /* FLL2_ENA */
2208#define WM8994_FLL2_ENA_MASK 0x0001 /* FLL2_ENA */
2209#define WM8994_FLL2_ENA_SHIFT 0 /* FLL2_ENA */
2210#define WM8994_FLL2_ENA_WIDTH 1 /* FLL2_ENA */
2211
2212/*
2213 * R577 (0x241) - FLL2 Control (2)
2214 */
2215#define WM8994_FLL2_OUTDIV_MASK 0x3F00 /* FLL2_OUTDIV - [13:8] */
2216#define WM8994_FLL2_OUTDIV_SHIFT 8 /* FLL2_OUTDIV - [13:8] */
2217#define WM8994_FLL2_OUTDIV_WIDTH 6 /* FLL2_OUTDIV - [13:8] */
2218#define WM8994_FLL2_CTRL_RATE_MASK 0x0070 /* FLL2_CTRL_RATE - [6:4] */
2219#define WM8994_FLL2_CTRL_RATE_SHIFT 4 /* FLL2_CTRL_RATE - [6:4] */
2220#define WM8994_FLL2_CTRL_RATE_WIDTH 3 /* FLL2_CTRL_RATE - [6:4] */
2221#define WM8994_FLL2_FRATIO_MASK 0x0007 /* FLL2_FRATIO - [2:0] */
2222#define WM8994_FLL2_FRATIO_SHIFT 0 /* FLL2_FRATIO - [2:0] */
2223#define WM8994_FLL2_FRATIO_WIDTH 3 /* FLL2_FRATIO - [2:0] */
2224
2225/*
2226 * R578 (0x242) - FLL2 Control (3)
2227 */
2228#define WM8994_FLL2_K_MASK 0xFFFF /* FLL2_K - [15:0] */
2229#define WM8994_FLL2_K_SHIFT 0 /* FLL2_K - [15:0] */
2230#define WM8994_FLL2_K_WIDTH 16 /* FLL2_K - [15:0] */
2231
2232/*
2233 * R579 (0x243) - FLL2 Control (4)
2234 */
2235#define WM8994_FLL2_N_MASK 0x7FE0 /* FLL2_N - [14:5] */
2236#define WM8994_FLL2_N_SHIFT 5 /* FLL2_N - [14:5] */
2237#define WM8994_FLL2_N_WIDTH 10 /* FLL2_N - [14:5] */
2238#define WM8994_FLL2_LOOP_GAIN_MASK 0x000F /* FLL2_LOOP_GAIN - [3:0] */
2239#define WM8994_FLL2_LOOP_GAIN_SHIFT 0 /* FLL2_LOOP_GAIN - [3:0] */
2240#define WM8994_FLL2_LOOP_GAIN_WIDTH 4 /* FLL2_LOOP_GAIN - [3:0] */
2241
2242/*
2243 * R580 (0x244) - FLL2 Control (5)
2244 */
2245#define WM8994_FLL2_FRC_NCO_VAL_MASK 0x1F80 /* FLL2_FRC_NCO_VAL - [12:7] */
2246#define WM8994_FLL2_FRC_NCO_VAL_SHIFT 7 /* FLL2_FRC_NCO_VAL - [12:7] */
2247#define WM8994_FLL2_FRC_NCO_VAL_WIDTH 6 /* FLL2_FRC_NCO_VAL - [12:7] */
2248#define WM8994_FLL2_FRC_NCO 0x0040 /* FLL2_FRC_NCO */
2249#define WM8994_FLL2_FRC_NCO_MASK 0x0040 /* FLL2_FRC_NCO */
2250#define WM8994_FLL2_FRC_NCO_SHIFT 6 /* FLL2_FRC_NCO */
2251#define WM8994_FLL2_FRC_NCO_WIDTH 1 /* FLL2_FRC_NCO */
2252#define WM8994_FLL2_REFCLK_DIV_MASK 0x0018 /* FLL2_REFCLK_DIV - [4:3] */
2253#define WM8994_FLL2_REFCLK_DIV_SHIFT 3 /* FLL2_REFCLK_DIV - [4:3] */
2254#define WM8994_FLL2_REFCLK_DIV_WIDTH 2 /* FLL2_REFCLK_DIV - [4:3] */
2255#define WM8994_FLL2_REFCLK_SRC_MASK 0x0003 /* FLL2_REFCLK_SRC - [1:0] */
2256#define WM8994_FLL2_REFCLK_SRC_SHIFT 0 /* FLL2_REFCLK_SRC - [1:0] */
2257#define WM8994_FLL2_REFCLK_SRC_WIDTH 2 /* FLL2_REFCLK_SRC - [1:0] */
2258
2259/*
2260 * R768 (0x300) - AIF1 Control (1)
2261 */
2262#define WM8994_AIF1ADCL_SRC 0x8000 /* AIF1ADCL_SRC */
2263#define WM8994_AIF1ADCL_SRC_MASK 0x8000 /* AIF1ADCL_SRC */
2264#define WM8994_AIF1ADCL_SRC_SHIFT 15 /* AIF1ADCL_SRC */
2265#define WM8994_AIF1ADCL_SRC_WIDTH 1 /* AIF1ADCL_SRC */
2266#define WM8994_AIF1ADCR_SRC 0x4000 /* AIF1ADCR_SRC */
2267#define WM8994_AIF1ADCR_SRC_MASK 0x4000 /* AIF1ADCR_SRC */
2268#define WM8994_AIF1ADCR_SRC_SHIFT 14 /* AIF1ADCR_SRC */
2269#define WM8994_AIF1ADCR_SRC_WIDTH 1 /* AIF1ADCR_SRC */
2270#define WM8994_AIF1ADC_TDM 0x2000 /* AIF1ADC_TDM */
2271#define WM8994_AIF1ADC_TDM_MASK 0x2000 /* AIF1ADC_TDM */
2272#define WM8994_AIF1ADC_TDM_SHIFT 13 /* AIF1ADC_TDM */
2273#define WM8994_AIF1ADC_TDM_WIDTH 1 /* AIF1ADC_TDM */
2274#define WM8994_AIF1_BCLK_INV 0x0100 /* AIF1_BCLK_INV */
2275#define WM8994_AIF1_BCLK_INV_MASK 0x0100 /* AIF1_BCLK_INV */
2276#define WM8994_AIF1_BCLK_INV_SHIFT 8 /* AIF1_BCLK_INV */
2277#define WM8994_AIF1_BCLK_INV_WIDTH 1 /* AIF1_BCLK_INV */
2278#define WM8994_AIF1_LRCLK_INV 0x0080 /* AIF1_LRCLK_INV */
2279#define WM8994_AIF1_LRCLK_INV_MASK 0x0080 /* AIF1_LRCLK_INV */
2280#define WM8994_AIF1_LRCLK_INV_SHIFT 7 /* AIF1_LRCLK_INV */
2281#define WM8994_AIF1_LRCLK_INV_WIDTH 1 /* AIF1_LRCLK_INV */
2282#define WM8994_AIF1_WL_MASK 0x0060 /* AIF1_WL - [6:5] */
2283#define WM8994_AIF1_WL_SHIFT 5 /* AIF1_WL - [6:5] */
2284#define WM8994_AIF1_WL_WIDTH 2 /* AIF1_WL - [6:5] */
2285#define WM8994_AIF1_FMT_MASK 0x0018 /* AIF1_FMT - [4:3] */
2286#define WM8994_AIF1_FMT_SHIFT 3 /* AIF1_FMT - [4:3] */
2287#define WM8994_AIF1_FMT_WIDTH 2 /* AIF1_FMT - [4:3] */
2288
2289/*
2290 * R769 (0x301) - AIF1 Control (2)
2291 */
2292#define WM8994_AIF1DACL_SRC 0x8000 /* AIF1DACL_SRC */
2293#define WM8994_AIF1DACL_SRC_MASK 0x8000 /* AIF1DACL_SRC */
2294#define WM8994_AIF1DACL_SRC_SHIFT 15 /* AIF1DACL_SRC */
2295#define WM8994_AIF1DACL_SRC_WIDTH 1 /* AIF1DACL_SRC */
2296#define WM8994_AIF1DACR_SRC 0x4000 /* AIF1DACR_SRC */
2297#define WM8994_AIF1DACR_SRC_MASK 0x4000 /* AIF1DACR_SRC */
2298#define WM8994_AIF1DACR_SRC_SHIFT 14 /* AIF1DACR_SRC */
2299#define WM8994_AIF1DACR_SRC_WIDTH 1 /* AIF1DACR_SRC */
2300#define WM8994_AIF1DAC_BOOST_MASK 0x0C00 /* AIF1DAC_BOOST - [11:10] */
2301#define WM8994_AIF1DAC_BOOST_SHIFT 10 /* AIF1DAC_BOOST - [11:10] */
2302#define WM8994_AIF1DAC_BOOST_WIDTH 2 /* AIF1DAC_BOOST - [11:10] */
2303#define WM8994_AIF1_MONO 0x0100 /* AIF1_MONO */
2304#define WM8994_AIF1_MONO_MASK 0x0100 /* AIF1_MONO */
2305#define WM8994_AIF1_MONO_SHIFT 8 /* AIF1_MONO */
2306#define WM8994_AIF1_MONO_WIDTH 1 /* AIF1_MONO */
2307#define WM8994_AIF1DAC_COMP 0x0010 /* AIF1DAC_COMP */
2308#define WM8994_AIF1DAC_COMP_MASK 0x0010 /* AIF1DAC_COMP */
2309#define WM8994_AIF1DAC_COMP_SHIFT 4 /* AIF1DAC_COMP */
2310#define WM8994_AIF1DAC_COMP_WIDTH 1 /* AIF1DAC_COMP */
2311#define WM8994_AIF1DAC_COMPMODE 0x0008 /* AIF1DAC_COMPMODE */
2312#define WM8994_AIF1DAC_COMPMODE_MASK 0x0008 /* AIF1DAC_COMPMODE */
2313#define WM8994_AIF1DAC_COMPMODE_SHIFT 3 /* AIF1DAC_COMPMODE */
2314#define WM8994_AIF1DAC_COMPMODE_WIDTH 1 /* AIF1DAC_COMPMODE */
2315#define WM8994_AIF1ADC_COMP 0x0004 /* AIF1ADC_COMP */
2316#define WM8994_AIF1ADC_COMP_MASK 0x0004 /* AIF1ADC_COMP */
2317#define WM8994_AIF1ADC_COMP_SHIFT 2 /* AIF1ADC_COMP */
2318#define WM8994_AIF1ADC_COMP_WIDTH 1 /* AIF1ADC_COMP */
2319#define WM8994_AIF1ADC_COMPMODE 0x0002 /* AIF1ADC_COMPMODE */
2320#define WM8994_AIF1ADC_COMPMODE_MASK 0x0002 /* AIF1ADC_COMPMODE */
2321#define WM8994_AIF1ADC_COMPMODE_SHIFT 1 /* AIF1ADC_COMPMODE */
2322#define WM8994_AIF1ADC_COMPMODE_WIDTH 1 /* AIF1ADC_COMPMODE */
2323#define WM8994_AIF1_LOOPBACK 0x0001 /* AIF1_LOOPBACK */
2324#define WM8994_AIF1_LOOPBACK_MASK 0x0001 /* AIF1_LOOPBACK */
2325#define WM8994_AIF1_LOOPBACK_SHIFT 0 /* AIF1_LOOPBACK */
2326#define WM8994_AIF1_LOOPBACK_WIDTH 1 /* AIF1_LOOPBACK */
2327
2328/*
2329 * R770 (0x302) - AIF1 Master/Slave
2330 */
2331#define WM8994_AIF1_TRI 0x8000 /* AIF1_TRI */
2332#define WM8994_AIF1_TRI_MASK 0x8000 /* AIF1_TRI */
2333#define WM8994_AIF1_TRI_SHIFT 15 /* AIF1_TRI */
2334#define WM8994_AIF1_TRI_WIDTH 1 /* AIF1_TRI */
2335#define WM8994_AIF1_MSTR 0x4000 /* AIF1_MSTR */
2336#define WM8994_AIF1_MSTR_MASK 0x4000 /* AIF1_MSTR */
2337#define WM8994_AIF1_MSTR_SHIFT 14 /* AIF1_MSTR */
2338#define WM8994_AIF1_MSTR_WIDTH 1 /* AIF1_MSTR */
2339#define WM8994_AIF1_CLK_FRC 0x2000 /* AIF1_CLK_FRC */
2340#define WM8994_AIF1_CLK_FRC_MASK 0x2000 /* AIF1_CLK_FRC */
2341#define WM8994_AIF1_CLK_FRC_SHIFT 13 /* AIF1_CLK_FRC */
2342#define WM8994_AIF1_CLK_FRC_WIDTH 1 /* AIF1_CLK_FRC */
2343#define WM8994_AIF1_LRCLK_FRC 0x1000 /* AIF1_LRCLK_FRC */
2344#define WM8994_AIF1_LRCLK_FRC_MASK 0x1000 /* AIF1_LRCLK_FRC */
2345#define WM8994_AIF1_LRCLK_FRC_SHIFT 12 /* AIF1_LRCLK_FRC */
2346#define WM8994_AIF1_LRCLK_FRC_WIDTH 1 /* AIF1_LRCLK_FRC */
2347
2348/*
2349 * R771 (0x303) - AIF1 BCLK
2350 */
2351#define WM8994_AIF1_BCLK_DIV_MASK 0x01F0 /* AIF1_BCLK_DIV - [8:4] */
2352#define WM8994_AIF1_BCLK_DIV_SHIFT 4 /* AIF1_BCLK_DIV - [8:4] */
2353#define WM8994_AIF1_BCLK_DIV_WIDTH 5 /* AIF1_BCLK_DIV - [8:4] */
2354
2355/*
2356 * R772 (0x304) - AIF1ADC LRCLK
2357 */
2358#define WM8994_AIF1ADC_LRCLK_DIR 0x0800 /* AIF1ADC_LRCLK_DIR */
2359#define WM8994_AIF1ADC_LRCLK_DIR_MASK 0x0800 /* AIF1ADC_LRCLK_DIR */
2360#define WM8994_AIF1ADC_LRCLK_DIR_SHIFT 11 /* AIF1ADC_LRCLK_DIR */
2361#define WM8994_AIF1ADC_LRCLK_DIR_WIDTH 1 /* AIF1ADC_LRCLK_DIR */
2362#define WM8994_AIF1ADC_RATE_MASK 0x07FF /* AIF1ADC_RATE - [10:0] */
2363#define WM8994_AIF1ADC_RATE_SHIFT 0 /* AIF1ADC_RATE - [10:0] */
2364#define WM8994_AIF1ADC_RATE_WIDTH 11 /* AIF1ADC_RATE - [10:0] */
2365
2366/*
2367 * R773 (0x305) - AIF1DAC LRCLK
2368 */
2369#define WM8994_AIF1DAC_LRCLK_DIR 0x0800 /* AIF1DAC_LRCLK_DIR */
2370#define WM8994_AIF1DAC_LRCLK_DIR_MASK 0x0800 /* AIF1DAC_LRCLK_DIR */
2371#define WM8994_AIF1DAC_LRCLK_DIR_SHIFT 11 /* AIF1DAC_LRCLK_DIR */
2372#define WM8994_AIF1DAC_LRCLK_DIR_WIDTH 1 /* AIF1DAC_LRCLK_DIR */
2373#define WM8994_AIF1DAC_RATE_MASK 0x07FF /* AIF1DAC_RATE - [10:0] */
2374#define WM8994_AIF1DAC_RATE_SHIFT 0 /* AIF1DAC_RATE - [10:0] */
2375#define WM8994_AIF1DAC_RATE_WIDTH 11 /* AIF1DAC_RATE - [10:0] */
2376
2377/*
2378 * R774 (0x306) - AIF1DAC Data
2379 */
2380#define WM8994_AIF1DACL_DAT_INV 0x0002 /* AIF1DACL_DAT_INV */
2381#define WM8994_AIF1DACL_DAT_INV_MASK 0x0002 /* AIF1DACL_DAT_INV */
2382#define WM8994_AIF1DACL_DAT_INV_SHIFT 1 /* AIF1DACL_DAT_INV */
2383#define WM8994_AIF1DACL_DAT_INV_WIDTH 1 /* AIF1DACL_DAT_INV */
2384#define WM8994_AIF1DACR_DAT_INV 0x0001 /* AIF1DACR_DAT_INV */
2385#define WM8994_AIF1DACR_DAT_INV_MASK 0x0001 /* AIF1DACR_DAT_INV */
2386#define WM8994_AIF1DACR_DAT_INV_SHIFT 0 /* AIF1DACR_DAT_INV */
2387#define WM8994_AIF1DACR_DAT_INV_WIDTH 1 /* AIF1DACR_DAT_INV */
2388
2389/*
2390 * R775 (0x307) - AIF1ADC Data
2391 */
2392#define WM8994_AIF1ADCL_DAT_INV 0x0002 /* AIF1ADCL_DAT_INV */
2393#define WM8994_AIF1ADCL_DAT_INV_MASK 0x0002 /* AIF1ADCL_DAT_INV */
2394#define WM8994_AIF1ADCL_DAT_INV_SHIFT 1 /* AIF1ADCL_DAT_INV */
2395#define WM8994_AIF1ADCL_DAT_INV_WIDTH 1 /* AIF1ADCL_DAT_INV */
2396#define WM8994_AIF1ADCR_DAT_INV 0x0001 /* AIF1ADCR_DAT_INV */
2397#define WM8994_AIF1ADCR_DAT_INV_MASK 0x0001 /* AIF1ADCR_DAT_INV */
2398#define WM8994_AIF1ADCR_DAT_INV_SHIFT 0 /* AIF1ADCR_DAT_INV */
2399#define WM8994_AIF1ADCR_DAT_INV_WIDTH 1 /* AIF1ADCR_DAT_INV */
2400
2401/*
2402 * R784 (0x310) - AIF2 Control (1)
2403 */
2404#define WM8994_AIF2ADCL_SRC 0x8000 /* AIF2ADCL_SRC */
2405#define WM8994_AIF2ADCL_SRC_MASK 0x8000 /* AIF2ADCL_SRC */
2406#define WM8994_AIF2ADCL_SRC_SHIFT 15 /* AIF2ADCL_SRC */
2407#define WM8994_AIF2ADCL_SRC_WIDTH 1 /* AIF2ADCL_SRC */
2408#define WM8994_AIF2ADCR_SRC 0x4000 /* AIF2ADCR_SRC */
2409#define WM8994_AIF2ADCR_SRC_MASK 0x4000 /* AIF2ADCR_SRC */
2410#define WM8994_AIF2ADCR_SRC_SHIFT 14 /* AIF2ADCR_SRC */
2411#define WM8994_AIF2ADCR_SRC_WIDTH 1 /* AIF2ADCR_SRC */
2412#define WM8994_AIF2ADC_TDM 0x2000 /* AIF2ADC_TDM */
2413#define WM8994_AIF2ADC_TDM_MASK 0x2000 /* AIF2ADC_TDM */
2414#define WM8994_AIF2ADC_TDM_SHIFT 13 /* AIF2ADC_TDM */
2415#define WM8994_AIF2ADC_TDM_WIDTH 1 /* AIF2ADC_TDM */
2416#define WM8994_AIF2ADC_TDM_CHAN 0x1000 /* AIF2ADC_TDM_CHAN */
2417#define WM8994_AIF2ADC_TDM_CHAN_MASK 0x1000 /* AIF2ADC_TDM_CHAN */
2418#define WM8994_AIF2ADC_TDM_CHAN_SHIFT 12 /* AIF2ADC_TDM_CHAN */
2419#define WM8994_AIF2ADC_TDM_CHAN_WIDTH 1 /* AIF2ADC_TDM_CHAN */
2420#define WM8994_AIF2_BCLK_INV 0x0100 /* AIF2_BCLK_INV */
2421#define WM8994_AIF2_BCLK_INV_MASK 0x0100 /* AIF2_BCLK_INV */
2422#define WM8994_AIF2_BCLK_INV_SHIFT 8 /* AIF2_BCLK_INV */
2423#define WM8994_AIF2_BCLK_INV_WIDTH 1 /* AIF2_BCLK_INV */
2424#define WM8994_AIF2_LRCLK_INV 0x0080 /* AIF2_LRCLK_INV */
2425#define WM8994_AIF2_LRCLK_INV_MASK 0x0080 /* AIF2_LRCLK_INV */
2426#define WM8994_AIF2_LRCLK_INV_SHIFT 7 /* AIF2_LRCLK_INV */
2427#define WM8994_AIF2_LRCLK_INV_WIDTH 1 /* AIF2_LRCLK_INV */
2428#define WM8994_AIF2_WL_MASK 0x0060 /* AIF2_WL - [6:5] */
2429#define WM8994_AIF2_WL_SHIFT 5 /* AIF2_WL - [6:5] */
2430#define WM8994_AIF2_WL_WIDTH 2 /* AIF2_WL - [6:5] */
2431#define WM8994_AIF2_FMT_MASK 0x0018 /* AIF2_FMT - [4:3] */
2432#define WM8994_AIF2_FMT_SHIFT 3 /* AIF2_FMT - [4:3] */
2433#define WM8994_AIF2_FMT_WIDTH 2 /* AIF2_FMT - [4:3] */
2434
2435/*
2436 * R785 (0x311) - AIF2 Control (2)
2437 */
2438#define WM8994_AIF2DACL_SRC 0x8000 /* AIF2DACL_SRC */
2439#define WM8994_AIF2DACL_SRC_MASK 0x8000 /* AIF2DACL_SRC */
2440#define WM8994_AIF2DACL_SRC_SHIFT 15 /* AIF2DACL_SRC */
2441#define WM8994_AIF2DACL_SRC_WIDTH 1 /* AIF2DACL_SRC */
2442#define WM8994_AIF2DACR_SRC 0x4000 /* AIF2DACR_SRC */
2443#define WM8994_AIF2DACR_SRC_MASK 0x4000 /* AIF2DACR_SRC */
2444#define WM8994_AIF2DACR_SRC_SHIFT 14 /* AIF2DACR_SRC */
2445#define WM8994_AIF2DACR_SRC_WIDTH 1 /* AIF2DACR_SRC */
2446#define WM8994_AIF2DAC_TDM 0x2000 /* AIF2DAC_TDM */
2447#define WM8994_AIF2DAC_TDM_MASK 0x2000 /* AIF2DAC_TDM */
2448#define WM8994_AIF2DAC_TDM_SHIFT 13 /* AIF2DAC_TDM */
2449#define WM8994_AIF2DAC_TDM_WIDTH 1 /* AIF2DAC_TDM */
2450#define WM8994_AIF2DAC_TDM_CHAN 0x1000 /* AIF2DAC_TDM_CHAN */
2451#define WM8994_AIF2DAC_TDM_CHAN_MASK 0x1000 /* AIF2DAC_TDM_CHAN */
2452#define WM8994_AIF2DAC_TDM_CHAN_SHIFT 12 /* AIF2DAC_TDM_CHAN */
2453#define WM8994_AIF2DAC_TDM_CHAN_WIDTH 1 /* AIF2DAC_TDM_CHAN */
2454#define WM8994_AIF2DAC_BOOST_MASK 0x0C00 /* AIF2DAC_BOOST - [11:10] */
2455#define WM8994_AIF2DAC_BOOST_SHIFT 10 /* AIF2DAC_BOOST - [11:10] */
2456#define WM8994_AIF2DAC_BOOST_WIDTH 2 /* AIF2DAC_BOOST - [11:10] */
2457#define WM8994_AIF2_MONO 0x0100 /* AIF2_MONO */
2458#define WM8994_AIF2_MONO_MASK 0x0100 /* AIF2_MONO */
2459#define WM8994_AIF2_MONO_SHIFT 8 /* AIF2_MONO */
2460#define WM8994_AIF2_MONO_WIDTH 1 /* AIF2_MONO */
2461#define WM8994_AIF2DAC_COMP 0x0010 /* AIF2DAC_COMP */
2462#define WM8994_AIF2DAC_COMP_MASK 0x0010 /* AIF2DAC_COMP */
2463#define WM8994_AIF2DAC_COMP_SHIFT 4 /* AIF2DAC_COMP */
2464#define WM8994_AIF2DAC_COMP_WIDTH 1 /* AIF2DAC_COMP */
2465#define WM8994_AIF2DAC_COMPMODE 0x0008 /* AIF2DAC_COMPMODE */
2466#define WM8994_AIF2DAC_COMPMODE_MASK 0x0008 /* AIF2DAC_COMPMODE */
2467#define WM8994_AIF2DAC_COMPMODE_SHIFT 3 /* AIF2DAC_COMPMODE */
2468#define WM8994_AIF2DAC_COMPMODE_WIDTH 1 /* AIF2DAC_COMPMODE */
2469#define WM8994_AIF2ADC_COMP 0x0004 /* AIF2ADC_COMP */
2470#define WM8994_AIF2ADC_COMP_MASK 0x0004 /* AIF2ADC_COMP */
2471#define WM8994_AIF2ADC_COMP_SHIFT 2 /* AIF2ADC_COMP */
2472#define WM8994_AIF2ADC_COMP_WIDTH 1 /* AIF2ADC_COMP */
2473#define WM8994_AIF2ADC_COMPMODE 0x0002 /* AIF2ADC_COMPMODE */
2474#define WM8994_AIF2ADC_COMPMODE_MASK 0x0002 /* AIF2ADC_COMPMODE */
2475#define WM8994_AIF2ADC_COMPMODE_SHIFT 1 /* AIF2ADC_COMPMODE */
2476#define WM8994_AIF2ADC_COMPMODE_WIDTH 1 /* AIF2ADC_COMPMODE */
2477#define WM8994_AIF2_LOOPBACK 0x0001 /* AIF2_LOOPBACK */
2478#define WM8994_AIF2_LOOPBACK_MASK 0x0001 /* AIF2_LOOPBACK */
2479#define WM8994_AIF2_LOOPBACK_SHIFT 0 /* AIF2_LOOPBACK */
2480#define WM8994_AIF2_LOOPBACK_WIDTH 1 /* AIF2_LOOPBACK */
2481
2482/*
2483 * R786 (0x312) - AIF2 Master/Slave
2484 */
2485#define WM8994_AIF2_TRI 0x8000 /* AIF2_TRI */
2486#define WM8994_AIF2_TRI_MASK 0x8000 /* AIF2_TRI */
2487#define WM8994_AIF2_TRI_SHIFT 15 /* AIF2_TRI */
2488#define WM8994_AIF2_TRI_WIDTH 1 /* AIF2_TRI */
2489#define WM8994_AIF2_MSTR 0x4000 /* AIF2_MSTR */
2490#define WM8994_AIF2_MSTR_MASK 0x4000 /* AIF2_MSTR */
2491#define WM8994_AIF2_MSTR_SHIFT 14 /* AIF2_MSTR */
2492#define WM8994_AIF2_MSTR_WIDTH 1 /* AIF2_MSTR */
2493#define WM8994_AIF2_CLK_FRC 0x2000 /* AIF2_CLK_FRC */
2494#define WM8994_AIF2_CLK_FRC_MASK 0x2000 /* AIF2_CLK_FRC */
2495#define WM8994_AIF2_CLK_FRC_SHIFT 13 /* AIF2_CLK_FRC */
2496#define WM8994_AIF2_CLK_FRC_WIDTH 1 /* AIF2_CLK_FRC */
2497#define WM8994_AIF2_LRCLK_FRC 0x1000 /* AIF2_LRCLK_FRC */
2498#define WM8994_AIF2_LRCLK_FRC_MASK 0x1000 /* AIF2_LRCLK_FRC */
2499#define WM8994_AIF2_LRCLK_FRC_SHIFT 12 /* AIF2_LRCLK_FRC */
2500#define WM8994_AIF2_LRCLK_FRC_WIDTH 1 /* AIF2_LRCLK_FRC */
2501
2502/*
2503 * R787 (0x313) - AIF2 BCLK
2504 */
2505#define WM8994_AIF2_BCLK_DIV_MASK 0x01F0 /* AIF2_BCLK_DIV - [8:4] */
2506#define WM8994_AIF2_BCLK_DIV_SHIFT 4 /* AIF2_BCLK_DIV - [8:4] */
2507#define WM8994_AIF2_BCLK_DIV_WIDTH 5 /* AIF2_BCLK_DIV - [8:4] */
2508
2509/*
2510 * R788 (0x314) - AIF2ADC LRCLK
2511 */
2512#define WM8994_AIF2ADC_LRCLK_DIR 0x0800 /* AIF2ADC_LRCLK_DIR */
2513#define WM8994_AIF2ADC_LRCLK_DIR_MASK 0x0800 /* AIF2ADC_LRCLK_DIR */
2514#define WM8994_AIF2ADC_LRCLK_DIR_SHIFT 11 /* AIF2ADC_LRCLK_DIR */
2515#define WM8994_AIF2ADC_LRCLK_DIR_WIDTH 1 /* AIF2ADC_LRCLK_DIR */
2516#define WM8994_AIF2ADC_RATE_MASK 0x07FF /* AIF2ADC_RATE - [10:0] */
2517#define WM8994_AIF2ADC_RATE_SHIFT 0 /* AIF2ADC_RATE - [10:0] */
2518#define WM8994_AIF2ADC_RATE_WIDTH 11 /* AIF2ADC_RATE - [10:0] */
2519
2520/*
2521 * R789 (0x315) - AIF2DAC LRCLK
2522 */
2523#define WM8994_AIF2DAC_LRCLK_DIR 0x0800 /* AIF2DAC_LRCLK_DIR */
2524#define WM8994_AIF2DAC_LRCLK_DIR_MASK 0x0800 /* AIF2DAC_LRCLK_DIR */
2525#define WM8994_AIF2DAC_LRCLK_DIR_SHIFT 11 /* AIF2DAC_LRCLK_DIR */
2526#define WM8994_AIF2DAC_LRCLK_DIR_WIDTH 1 /* AIF2DAC_LRCLK_DIR */
2527#define WM8994_AIF2DAC_RATE_MASK 0x07FF /* AIF2DAC_RATE - [10:0] */
2528#define WM8994_AIF2DAC_RATE_SHIFT 0 /* AIF2DAC_RATE - [10:0] */
2529#define WM8994_AIF2DAC_RATE_WIDTH 11 /* AIF2DAC_RATE - [10:0] */
2530
2531/*
2532 * R790 (0x316) - AIF2DAC Data
2533 */
2534#define WM8994_AIF2DACL_DAT_INV 0x0002 /* AIF2DACL_DAT_INV */
2535#define WM8994_AIF2DACL_DAT_INV_MASK 0x0002 /* AIF2DACL_DAT_INV */
2536#define WM8994_AIF2DACL_DAT_INV_SHIFT 1 /* AIF2DACL_DAT_INV */
2537#define WM8994_AIF2DACL_DAT_INV_WIDTH 1 /* AIF2DACL_DAT_INV */
2538#define WM8994_AIF2DACR_DAT_INV 0x0001 /* AIF2DACR_DAT_INV */
2539#define WM8994_AIF2DACR_DAT_INV_MASK 0x0001 /* AIF2DACR_DAT_INV */
2540#define WM8994_AIF2DACR_DAT_INV_SHIFT 0 /* AIF2DACR_DAT_INV */
2541#define WM8994_AIF2DACR_DAT_INV_WIDTH 1 /* AIF2DACR_DAT_INV */
2542
2543/*
2544 * R791 (0x317) - AIF2ADC Data
2545 */
2546#define WM8994_AIF2ADCL_DAT_INV 0x0002 /* AIF2ADCL_DAT_INV */
2547#define WM8994_AIF2ADCL_DAT_INV_MASK 0x0002 /* AIF2ADCL_DAT_INV */
2548#define WM8994_AIF2ADCL_DAT_INV_SHIFT 1 /* AIF2ADCL_DAT_INV */
2549#define WM8994_AIF2ADCL_DAT_INV_WIDTH 1 /* AIF2ADCL_DAT_INV */
2550#define WM8994_AIF2ADCR_DAT_INV 0x0001 /* AIF2ADCR_DAT_INV */
2551#define WM8994_AIF2ADCR_DAT_INV_MASK 0x0001 /* AIF2ADCR_DAT_INV */
2552#define WM8994_AIF2ADCR_DAT_INV_SHIFT 0 /* AIF2ADCR_DAT_INV */
2553#define WM8994_AIF2ADCR_DAT_INV_WIDTH 1 /* AIF2ADCR_DAT_INV */
2554
2555/*
2556 * R1024 (0x400) - AIF1 ADC1 Left Volume
2557 */
2558#define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */
2559#define WM8994_AIF1ADC1_VU_MASK 0x0100 /* AIF1ADC1_VU */
2560#define WM8994_AIF1ADC1_VU_SHIFT 8 /* AIF1ADC1_VU */
2561#define WM8994_AIF1ADC1_VU_WIDTH 1 /* AIF1ADC1_VU */
2562#define WM8994_AIF1ADC1L_VOL_MASK 0x00FF /* AIF1ADC1L_VOL - [7:0] */
2563#define WM8994_AIF1ADC1L_VOL_SHIFT 0 /* AIF1ADC1L_VOL - [7:0] */
2564#define WM8994_AIF1ADC1L_VOL_WIDTH 8 /* AIF1ADC1L_VOL - [7:0] */
2565
2566/*
2567 * R1025 (0x401) - AIF1 ADC1 Right Volume
2568 */
2569#define WM8994_AIF1ADC1_VU 0x0100 /* AIF1ADC1_VU */
2570#define WM8994_AIF1ADC1_VU_MASK 0x0100 /* AIF1ADC1_VU */
2571#define WM8994_AIF1ADC1_VU_SHIFT 8 /* AIF1ADC1_VU */
2572#define WM8994_AIF1ADC1_VU_WIDTH 1 /* AIF1ADC1_VU */
2573#define WM8994_AIF1ADC1R_VOL_MASK 0x00FF /* AIF1ADC1R_VOL - [7:0] */
2574#define WM8994_AIF1ADC1R_VOL_SHIFT 0 /* AIF1ADC1R_VOL - [7:0] */
2575#define WM8994_AIF1ADC1R_VOL_WIDTH 8 /* AIF1ADC1R_VOL - [7:0] */
2576
2577/*
2578 * R1026 (0x402) - AIF1 DAC1 Left Volume
2579 */
2580#define WM8994_AIF1DAC1_VU 0x0100 /* AIF1DAC1_VU */
2581#define WM8994_AIF1DAC1_VU_MASK 0x0100 /* AIF1DAC1_VU */
2582#define WM8994_AIF1DAC1_VU_SHIFT 8 /* AIF1DAC1_VU */
2583#define WM8994_AIF1DAC1_VU_WIDTH 1 /* AIF1DAC1_VU */
2584#define WM8994_AIF1DAC1L_VOL_MASK 0x00FF /* AIF1DAC1L_VOL - [7:0] */
2585#define WM8994_AIF1DAC1L_VOL_SHIFT 0 /* AIF1DAC1L_VOL - [7:0] */
2586#define WM8994_AIF1DAC1L_VOL_WIDTH 8 /* AIF1DAC1L_VOL - [7:0] */
2587
2588/*
2589 * R1027 (0x403) - AIF1 DAC1 Right Volume
2590 */
2591#define WM8994_AIF1DAC1_VU 0x0100 /* AIF1DAC1_VU */
2592#define WM8994_AIF1DAC1_VU_MASK 0x0100 /* AIF1DAC1_VU */
2593#define WM8994_AIF1DAC1_VU_SHIFT 8 /* AIF1DAC1_VU */
2594#define WM8994_AIF1DAC1_VU_WIDTH 1 /* AIF1DAC1_VU */
2595#define WM8994_AIF1DAC1R_VOL_MASK 0x00FF /* AIF1DAC1R_VOL - [7:0] */
2596#define WM8994_AIF1DAC1R_VOL_SHIFT 0 /* AIF1DAC1R_VOL - [7:0] */
2597#define WM8994_AIF1DAC1R_VOL_WIDTH 8 /* AIF1DAC1R_VOL - [7:0] */
2598
2599/*
2600 * R1028 (0x404) - AIF1 ADC2 Left Volume
2601 */
2602#define WM8994_AIF1ADC2_VU 0x0100 /* AIF1ADC2_VU */
2603#define WM8994_AIF1ADC2_VU_MASK 0x0100 /* AIF1ADC2_VU */
2604#define WM8994_AIF1ADC2_VU_SHIFT 8 /* AIF1ADC2_VU */
2605#define WM8994_AIF1ADC2_VU_WIDTH 1 /* AIF1ADC2_VU */
2606#define WM8994_AIF1ADC2L_VOL_MASK 0x00FF /* AIF1ADC2L_VOL - [7:0] */
2607#define WM8994_AIF1ADC2L_VOL_SHIFT 0 /* AIF1ADC2L_VOL - [7:0] */
2608#define WM8994_AIF1ADC2L_VOL_WIDTH 8 /* AIF1ADC2L_VOL - [7:0] */
2609
2610/*
2611 * R1029 (0x405) - AIF1 ADC2 Right Volume
2612 */
2613#define WM8994_AIF1ADC2_VU 0x0100 /* AIF1ADC2_VU */
2614#define WM8994_AIF1ADC2_VU_MASK 0x0100 /* AIF1ADC2_VU */
2615#define WM8994_AIF1ADC2_VU_SHIFT 8 /* AIF1ADC2_VU */
2616#define WM8994_AIF1ADC2_VU_WIDTH 1 /* AIF1ADC2_VU */
2617#define WM8994_AIF1ADC2R_VOL_MASK 0x00FF /* AIF1ADC2R_VOL - [7:0] */
2618#define WM8994_AIF1ADC2R_VOL_SHIFT 0 /* AIF1ADC2R_VOL - [7:0] */
2619#define WM8994_AIF1ADC2R_VOL_WIDTH 8 /* AIF1ADC2R_VOL - [7:0] */
2620
2621/*
2622 * R1030 (0x406) - AIF1 DAC2 Left Volume
2623 */
2624#define WM8994_AIF1DAC2_VU 0x0100 /* AIF1DAC2_VU */
2625#define WM8994_AIF1DAC2_VU_MASK 0x0100 /* AIF1DAC2_VU */
2626#define WM8994_AIF1DAC2_VU_SHIFT 8 /* AIF1DAC2_VU */
2627#define WM8994_AIF1DAC2_VU_WIDTH 1 /* AIF1DAC2_VU */
2628#define WM8994_AIF1DAC2L_VOL_MASK 0x00FF /* AIF1DAC2L_VOL - [7:0] */
2629#define WM8994_AIF1DAC2L_VOL_SHIFT 0 /* AIF1DAC2L_VOL - [7:0] */
2630#define WM8994_AIF1DAC2L_VOL_WIDTH 8 /* AIF1DAC2L_VOL - [7:0] */
2631
2632/*
2633 * R1031 (0x407) - AIF1 DAC2 Right Volume
2634 */
2635#define WM8994_AIF1DAC2_VU 0x0100 /* AIF1DAC2_VU */
2636#define WM8994_AIF1DAC2_VU_MASK 0x0100 /* AIF1DAC2_VU */
2637#define WM8994_AIF1DAC2_VU_SHIFT 8 /* AIF1DAC2_VU */
2638#define WM8994_AIF1DAC2_VU_WIDTH 1 /* AIF1DAC2_VU */
2639#define WM8994_AIF1DAC2R_VOL_MASK 0x00FF /* AIF1DAC2R_VOL - [7:0] */
2640#define WM8994_AIF1DAC2R_VOL_SHIFT 0 /* AIF1DAC2R_VOL - [7:0] */
2641#define WM8994_AIF1DAC2R_VOL_WIDTH 8 /* AIF1DAC2R_VOL - [7:0] */
2642
2643/*
2644 * R1040 (0x410) - AIF1 ADC1 Filters
2645 */
2646#define WM8994_AIF1ADC_4FS 0x8000 /* AIF1ADC_4FS */
2647#define WM8994_AIF1ADC_4FS_MASK 0x8000 /* AIF1ADC_4FS */
2648#define WM8994_AIF1ADC_4FS_SHIFT 15 /* AIF1ADC_4FS */
2649#define WM8994_AIF1ADC_4FS_WIDTH 1 /* AIF1ADC_4FS */
2650#define WM8994_AIF1ADC1_HPF_CUT_MASK 0x6000 /* AIF1ADC1_HPF_CUT - [14:13] */
2651#define WM8994_AIF1ADC1_HPF_CUT_SHIFT 13 /* AIF1ADC1_HPF_CUT - [14:13] */
2652#define WM8994_AIF1ADC1_HPF_CUT_WIDTH 2 /* AIF1ADC1_HPF_CUT - [14:13] */
2653#define WM8994_AIF1ADC1L_HPF 0x1000 /* AIF1ADC1L_HPF */
2654#define WM8994_AIF1ADC1L_HPF_MASK 0x1000 /* AIF1ADC1L_HPF */
2655#define WM8994_AIF1ADC1L_HPF_SHIFT 12 /* AIF1ADC1L_HPF */
2656#define WM8994_AIF1ADC1L_HPF_WIDTH 1 /* AIF1ADC1L_HPF */
2657#define WM8994_AIF1ADC1R_HPF 0x0800 /* AIF1ADC1R_HPF */
2658#define WM8994_AIF1ADC1R_HPF_MASK 0x0800 /* AIF1ADC1R_HPF */
2659#define WM8994_AIF1ADC1R_HPF_SHIFT 11 /* AIF1ADC1R_HPF */
2660#define WM8994_AIF1ADC1R_HPF_WIDTH 1 /* AIF1ADC1R_HPF */
2661
2662/*
2663 * R1041 (0x411) - AIF1 ADC2 Filters
2664 */
2665#define WM8994_AIF1ADC2_HPF_CUT_MASK 0x6000 /* AIF1ADC2_HPF_CUT - [14:13] */
2666#define WM8994_AIF1ADC2_HPF_CUT_SHIFT 13 /* AIF1ADC2_HPF_CUT - [14:13] */
2667#define WM8994_AIF1ADC2_HPF_CUT_WIDTH 2 /* AIF1ADC2_HPF_CUT - [14:13] */
2668#define WM8994_AIF1ADC2L_HPF 0x1000 /* AIF1ADC2L_HPF */
2669#define WM8994_AIF1ADC2L_HPF_MASK 0x1000 /* AIF1ADC2L_HPF */
2670#define WM8994_AIF1ADC2L_HPF_SHIFT 12 /* AIF1ADC2L_HPF */
2671#define WM8994_AIF1ADC2L_HPF_WIDTH 1 /* AIF1ADC2L_HPF */
2672#define WM8994_AIF1ADC2R_HPF 0x0800 /* AIF1ADC2R_HPF */
2673#define WM8994_AIF1ADC2R_HPF_MASK 0x0800 /* AIF1ADC2R_HPF */
2674#define WM8994_AIF1ADC2R_HPF_SHIFT 11 /* AIF1ADC2R_HPF */
2675#define WM8994_AIF1ADC2R_HPF_WIDTH 1 /* AIF1ADC2R_HPF */
2676
2677/*
2678 * R1056 (0x420) - AIF1 DAC1 Filters (1)
2679 */
2680#define WM8994_AIF1DAC1_MUTE 0x0200 /* AIF1DAC1_MUTE */
2681#define WM8994_AIF1DAC1_MUTE_MASK 0x0200 /* AIF1DAC1_MUTE */
2682#define WM8994_AIF1DAC1_MUTE_SHIFT 9 /* AIF1DAC1_MUTE */
2683#define WM8994_AIF1DAC1_MUTE_WIDTH 1 /* AIF1DAC1_MUTE */
2684#define WM8994_AIF1DAC1_MONO 0x0080 /* AIF1DAC1_MONO */
2685#define WM8994_AIF1DAC1_MONO_MASK 0x0080 /* AIF1DAC1_MONO */
2686#define WM8994_AIF1DAC1_MONO_SHIFT 7 /* AIF1DAC1_MONO */
2687#define WM8994_AIF1DAC1_MONO_WIDTH 1 /* AIF1DAC1_MONO */
2688#define WM8994_AIF1DAC1_MUTERATE 0x0020 /* AIF1DAC1_MUTERATE */
2689#define WM8994_AIF1DAC1_MUTERATE_MASK 0x0020 /* AIF1DAC1_MUTERATE */
2690#define WM8994_AIF1DAC1_MUTERATE_SHIFT 5 /* AIF1DAC1_MUTERATE */
2691#define WM8994_AIF1DAC1_MUTERATE_WIDTH 1 /* AIF1DAC1_MUTERATE */
2692#define WM8994_AIF1DAC1_UNMUTE_RAMP 0x0010 /* AIF1DAC1_UNMUTE_RAMP */
2693#define WM8994_AIF1DAC1_UNMUTE_RAMP_MASK 0x0010 /* AIF1DAC1_UNMUTE_RAMP */
2694#define WM8994_AIF1DAC1_UNMUTE_RAMP_SHIFT 4 /* AIF1DAC1_UNMUTE_RAMP */
2695#define WM8994_AIF1DAC1_UNMUTE_RAMP_WIDTH 1 /* AIF1DAC1_UNMUTE_RAMP */
2696#define WM8994_AIF1DAC1_DEEMP_MASK 0x0006 /* AIF1DAC1_DEEMP - [2:1] */
2697#define WM8994_AIF1DAC1_DEEMP_SHIFT 1 /* AIF1DAC1_DEEMP - [2:1] */
2698#define WM8994_AIF1DAC1_DEEMP_WIDTH 2 /* AIF1DAC1_DEEMP - [2:1] */
2699
2700/*
2701 * R1057 (0x421) - AIF1 DAC1 Filters (2)
2702 */
2703#define WM8994_AIF1DAC1_3D_GAIN_MASK 0x3E00 /* AIF1DAC1_3D_GAIN - [13:9] */
2704#define WM8994_AIF1DAC1_3D_GAIN_SHIFT 9 /* AIF1DAC1_3D_GAIN - [13:9] */
2705#define WM8994_AIF1DAC1_3D_GAIN_WIDTH 5 /* AIF1DAC1_3D_GAIN - [13:9] */
2706#define WM8994_AIF1DAC1_3D_ENA 0x0100 /* AIF1DAC1_3D_ENA */
2707#define WM8994_AIF1DAC1_3D_ENA_MASK 0x0100 /* AIF1DAC1_3D_ENA */
2708#define WM8994_AIF1DAC1_3D_ENA_SHIFT 8 /* AIF1DAC1_3D_ENA */
2709#define WM8994_AIF1DAC1_3D_ENA_WIDTH 1 /* AIF1DAC1_3D_ENA */
2710
2711/*
2712 * R1058 (0x422) - AIF1 DAC2 Filters (1)
2713 */
2714#define WM8994_AIF1DAC2_MUTE 0x0200 /* AIF1DAC2_MUTE */
2715#define WM8994_AIF1DAC2_MUTE_MASK 0x0200 /* AIF1DAC2_MUTE */
2716#define WM8994_AIF1DAC2_MUTE_SHIFT 9 /* AIF1DAC2_MUTE */
2717#define WM8994_AIF1DAC2_MUTE_WIDTH 1 /* AIF1DAC2_MUTE */
2718#define WM8994_AIF1DAC2_MONO 0x0080 /* AIF1DAC2_MONO */
2719#define WM8994_AIF1DAC2_MONO_MASK 0x0080 /* AIF1DAC2_MONO */
2720#define WM8994_AIF1DAC2_MONO_SHIFT 7 /* AIF1DAC2_MONO */
2721#define WM8994_AIF1DAC2_MONO_WIDTH 1 /* AIF1DAC2_MONO */
2722#define WM8994_AIF1DAC2_MUTERATE 0x0020 /* AIF1DAC2_MUTERATE */
2723#define WM8994_AIF1DAC2_MUTERATE_MASK 0x0020 /* AIF1DAC2_MUTERATE */
2724#define WM8994_AIF1DAC2_MUTERATE_SHIFT 5 /* AIF1DAC2_MUTERATE */
2725#define WM8994_AIF1DAC2_MUTERATE_WIDTH 1 /* AIF1DAC2_MUTERATE */
2726#define WM8994_AIF1DAC2_UNMUTE_RAMP 0x0010 /* AIF1DAC2_UNMUTE_RAMP */
2727#define WM8994_AIF1DAC2_UNMUTE_RAMP_MASK 0x0010 /* AIF1DAC2_UNMUTE_RAMP */
2728#define WM8994_AIF1DAC2_UNMUTE_RAMP_SHIFT 4 /* AIF1DAC2_UNMUTE_RAMP */
2729#define WM8994_AIF1DAC2_UNMUTE_RAMP_WIDTH 1 /* AIF1DAC2_UNMUTE_RAMP */
2730#define WM8994_AIF1DAC2_DEEMP_MASK 0x0006 /* AIF1DAC2_DEEMP - [2:1] */
2731#define WM8994_AIF1DAC2_DEEMP_SHIFT 1 /* AIF1DAC2_DEEMP - [2:1] */
2732#define WM8994_AIF1DAC2_DEEMP_WIDTH 2 /* AIF1DAC2_DEEMP - [2:1] */
2733
2734/*
2735 * R1059 (0x423) - AIF1 DAC2 Filters (2)
2736 */
2737#define WM8994_AIF1DAC2_3D_GAIN_MASK 0x3E00 /* AIF1DAC2_3D_GAIN - [13:9] */
2738#define WM8994_AIF1DAC2_3D_GAIN_SHIFT 9 /* AIF1DAC2_3D_GAIN - [13:9] */
2739#define WM8994_AIF1DAC2_3D_GAIN_WIDTH 5 /* AIF1DAC2_3D_GAIN - [13:9] */
2740#define WM8994_AIF1DAC2_3D_ENA 0x0100 /* AIF1DAC2_3D_ENA */
2741#define WM8994_AIF1DAC2_3D_ENA_MASK 0x0100 /* AIF1DAC2_3D_ENA */
2742#define WM8994_AIF1DAC2_3D_ENA_SHIFT 8 /* AIF1DAC2_3D_ENA */
2743#define WM8994_AIF1DAC2_3D_ENA_WIDTH 1 /* AIF1DAC2_3D_ENA */
2744
2745/*
2746 * R1088 (0x440) - AIF1 DRC1 (1)
2747 */
2748#define WM8994_AIF1DRC1_SIG_DET_RMS_MASK 0xF800 /* AIF1DRC1_SIG_DET_RMS - [15:11] */
2749#define WM8994_AIF1DRC1_SIG_DET_RMS_SHIFT 11 /* AIF1DRC1_SIG_DET_RMS - [15:11] */
2750#define WM8994_AIF1DRC1_SIG_DET_RMS_WIDTH 5 /* AIF1DRC1_SIG_DET_RMS - [15:11] */
2751#define WM8994_AIF1DRC1_SIG_DET_PK_MASK 0x0600 /* AIF1DRC1_SIG_DET_PK - [10:9] */
2752#define WM8994_AIF1DRC1_SIG_DET_PK_SHIFT 9 /* AIF1DRC1_SIG_DET_PK - [10:9] */
2753#define WM8994_AIF1DRC1_SIG_DET_PK_WIDTH 2 /* AIF1DRC1_SIG_DET_PK - [10:9] */
2754#define WM8994_AIF1DRC1_NG_ENA 0x0100 /* AIF1DRC1_NG_ENA */
2755#define WM8994_AIF1DRC1_NG_ENA_MASK 0x0100 /* AIF1DRC1_NG_ENA */
2756#define WM8994_AIF1DRC1_NG_ENA_SHIFT 8 /* AIF1DRC1_NG_ENA */
2757#define WM8994_AIF1DRC1_NG_ENA_WIDTH 1 /* AIF1DRC1_NG_ENA */
2758#define WM8994_AIF1DRC1_SIG_DET_MODE 0x0080 /* AIF1DRC1_SIG_DET_MODE */
2759#define WM8994_AIF1DRC1_SIG_DET_MODE_MASK 0x0080 /* AIF1DRC1_SIG_DET_MODE */
2760#define WM8994_AIF1DRC1_SIG_DET_MODE_SHIFT 7 /* AIF1DRC1_SIG_DET_MODE */
2761#define WM8994_AIF1DRC1_SIG_DET_MODE_WIDTH 1 /* AIF1DRC1_SIG_DET_MODE */
2762#define WM8994_AIF1DRC1_SIG_DET 0x0040 /* AIF1DRC1_SIG_DET */
2763#define WM8994_AIF1DRC1_SIG_DET_MASK 0x0040 /* AIF1DRC1_SIG_DET */
2764#define WM8994_AIF1DRC1_SIG_DET_SHIFT 6 /* AIF1DRC1_SIG_DET */
2765#define WM8994_AIF1DRC1_SIG_DET_WIDTH 1 /* AIF1DRC1_SIG_DET */
2766#define WM8994_AIF1DRC1_KNEE2_OP_ENA 0x0020 /* AIF1DRC1_KNEE2_OP_ENA */
2767#define WM8994_AIF1DRC1_KNEE2_OP_ENA_MASK 0x0020 /* AIF1DRC1_KNEE2_OP_ENA */
2768#define WM8994_AIF1DRC1_KNEE2_OP_ENA_SHIFT 5 /* AIF1DRC1_KNEE2_OP_ENA */
2769#define WM8994_AIF1DRC1_KNEE2_OP_ENA_WIDTH 1 /* AIF1DRC1_KNEE2_OP_ENA */
2770#define WM8994_AIF1DRC1_QR 0x0010 /* AIF1DRC1_QR */
2771#define WM8994_AIF1DRC1_QR_MASK 0x0010 /* AIF1DRC1_QR */
2772#define WM8994_AIF1DRC1_QR_SHIFT 4 /* AIF1DRC1_QR */
2773#define WM8994_AIF1DRC1_QR_WIDTH 1 /* AIF1DRC1_QR */
2774#define WM8994_AIF1DRC1_ANTICLIP 0x0008 /* AIF1DRC1_ANTICLIP */
2775#define WM8994_AIF1DRC1_ANTICLIP_MASK 0x0008 /* AIF1DRC1_ANTICLIP */
2776#define WM8994_AIF1DRC1_ANTICLIP_SHIFT 3 /* AIF1DRC1_ANTICLIP */
2777#define WM8994_AIF1DRC1_ANTICLIP_WIDTH 1 /* AIF1DRC1_ANTICLIP */
2778#define WM8994_AIF1DAC1_DRC_ENA 0x0004 /* AIF1DAC1_DRC_ENA */
2779#define WM8994_AIF1DAC1_DRC_ENA_MASK 0x0004 /* AIF1DAC1_DRC_ENA */
2780#define WM8994_AIF1DAC1_DRC_ENA_SHIFT 2 /* AIF1DAC1_DRC_ENA */
2781#define WM8994_AIF1DAC1_DRC_ENA_WIDTH 1 /* AIF1DAC1_DRC_ENA */
2782#define WM8994_AIF1ADC1L_DRC_ENA 0x0002 /* AIF1ADC1L_DRC_ENA */
2783#define WM8994_AIF1ADC1L_DRC_ENA_MASK 0x0002 /* AIF1ADC1L_DRC_ENA */
2784#define WM8994_AIF1ADC1L_DRC_ENA_SHIFT 1 /* AIF1ADC1L_DRC_ENA */
2785#define WM8994_AIF1ADC1L_DRC_ENA_WIDTH 1 /* AIF1ADC1L_DRC_ENA */
2786#define WM8994_AIF1ADC1R_DRC_ENA 0x0001 /* AIF1ADC1R_DRC_ENA */
2787#define WM8994_AIF1ADC1R_DRC_ENA_MASK 0x0001 /* AIF1ADC1R_DRC_ENA */
2788#define WM8994_AIF1ADC1R_DRC_ENA_SHIFT 0 /* AIF1ADC1R_DRC_ENA */
2789#define WM8994_AIF1ADC1R_DRC_ENA_WIDTH 1 /* AIF1ADC1R_DRC_ENA */
2790
2791/*
2792 * R1089 (0x441) - AIF1 DRC1 (2)
2793 */
2794#define WM8994_AIF1DRC1_ATK_MASK 0x1E00 /* AIF1DRC1_ATK - [12:9] */
2795#define WM8994_AIF1DRC1_ATK_SHIFT 9 /* AIF1DRC1_ATK - [12:9] */
2796#define WM8994_AIF1DRC1_ATK_WIDTH 4 /* AIF1DRC1_ATK - [12:9] */
2797#define WM8994_AIF1DRC1_DCY_MASK 0x01E0 /* AIF1DRC1_DCY - [8:5] */
2798#define WM8994_AIF1DRC1_DCY_SHIFT 5 /* AIF1DRC1_DCY - [8:5] */
2799#define WM8994_AIF1DRC1_DCY_WIDTH 4 /* AIF1DRC1_DCY - [8:5] */
2800#define WM8994_AIF1DRC1_MINGAIN_MASK 0x001C /* AIF1DRC1_MINGAIN - [4:2] */
2801#define WM8994_AIF1DRC1_MINGAIN_SHIFT 2 /* AIF1DRC1_MINGAIN - [4:2] */
2802#define WM8994_AIF1DRC1_MINGAIN_WIDTH 3 /* AIF1DRC1_MINGAIN - [4:2] */
2803#define WM8994_AIF1DRC1_MAXGAIN_MASK 0x0003 /* AIF1DRC1_MAXGAIN - [1:0] */
2804#define WM8994_AIF1DRC1_MAXGAIN_SHIFT 0 /* AIF1DRC1_MAXGAIN - [1:0] */
2805#define WM8994_AIF1DRC1_MAXGAIN_WIDTH 2 /* AIF1DRC1_MAXGAIN - [1:0] */
2806
2807/*
2808 * R1090 (0x442) - AIF1 DRC1 (3)
2809 */
2810#define WM8994_AIF1DRC1_NG_MINGAIN_MASK 0xF000 /* AIF1DRC1_NG_MINGAIN - [15:12] */
2811#define WM8994_AIF1DRC1_NG_MINGAIN_SHIFT 12 /* AIF1DRC1_NG_MINGAIN - [15:12] */
2812#define WM8994_AIF1DRC1_NG_MINGAIN_WIDTH 4 /* AIF1DRC1_NG_MINGAIN - [15:12] */
2813#define WM8994_AIF1DRC1_NG_EXP_MASK 0x0C00 /* AIF1DRC1_NG_EXP - [11:10] */
2814#define WM8994_AIF1DRC1_NG_EXP_SHIFT 10 /* AIF1DRC1_NG_EXP - [11:10] */
2815#define WM8994_AIF1DRC1_NG_EXP_WIDTH 2 /* AIF1DRC1_NG_EXP - [11:10] */
2816#define WM8994_AIF1DRC1_QR_THR_MASK 0x0300 /* AIF1DRC1_QR_THR - [9:8] */
2817#define WM8994_AIF1DRC1_QR_THR_SHIFT 8 /* AIF1DRC1_QR_THR - [9:8] */
2818#define WM8994_AIF1DRC1_QR_THR_WIDTH 2 /* AIF1DRC1_QR_THR - [9:8] */
2819#define WM8994_AIF1DRC1_QR_DCY_MASK 0x00C0 /* AIF1DRC1_QR_DCY - [7:6] */
2820#define WM8994_AIF1DRC1_QR_DCY_SHIFT 6 /* AIF1DRC1_QR_DCY - [7:6] */
2821#define WM8994_AIF1DRC1_QR_DCY_WIDTH 2 /* AIF1DRC1_QR_DCY - [7:6] */
2822#define WM8994_AIF1DRC1_HI_COMP_MASK 0x0038 /* AIF1DRC1_HI_COMP - [5:3] */
2823#define WM8994_AIF1DRC1_HI_COMP_SHIFT 3 /* AIF1DRC1_HI_COMP - [5:3] */
2824#define WM8994_AIF1DRC1_HI_COMP_WIDTH 3 /* AIF1DRC1_HI_COMP - [5:3] */
2825#define WM8994_AIF1DRC1_LO_COMP_MASK 0x0007 /* AIF1DRC1_LO_COMP - [2:0] */
2826#define WM8994_AIF1DRC1_LO_COMP_SHIFT 0 /* AIF1DRC1_LO_COMP - [2:0] */
2827#define WM8994_AIF1DRC1_LO_COMP_WIDTH 3 /* AIF1DRC1_LO_COMP - [2:0] */
2828
2829/*
2830 * R1091 (0x443) - AIF1 DRC1 (4)
2831 */
2832#define WM8994_AIF1DRC1_KNEE_IP_MASK 0x07E0 /* AIF1DRC1_KNEE_IP - [10:5] */
2833#define WM8994_AIF1DRC1_KNEE_IP_SHIFT 5 /* AIF1DRC1_KNEE_IP - [10:5] */
2834#define WM8994_AIF1DRC1_KNEE_IP_WIDTH 6 /* AIF1DRC1_KNEE_IP - [10:5] */
2835#define WM8994_AIF1DRC1_KNEE_OP_MASK 0x001F /* AIF1DRC1_KNEE_OP - [4:0] */
2836#define WM8994_AIF1DRC1_KNEE_OP_SHIFT 0 /* AIF1DRC1_KNEE_OP - [4:0] */
2837#define WM8994_AIF1DRC1_KNEE_OP_WIDTH 5 /* AIF1DRC1_KNEE_OP - [4:0] */
2838
2839/*
2840 * R1092 (0x444) - AIF1 DRC1 (5)
2841 */
2842#define WM8994_AIF1DRC1_KNEE2_IP_MASK 0x03E0 /* AIF1DRC1_KNEE2_IP - [9:5] */
2843#define WM8994_AIF1DRC1_KNEE2_IP_SHIFT 5 /* AIF1DRC1_KNEE2_IP - [9:5] */
2844#define WM8994_AIF1DRC1_KNEE2_IP_WIDTH 5 /* AIF1DRC1_KNEE2_IP - [9:5] */
2845#define WM8994_AIF1DRC1_KNEE2_OP_MASK 0x001F /* AIF1DRC1_KNEE2_OP - [4:0] */
2846#define WM8994_AIF1DRC1_KNEE2_OP_SHIFT 0 /* AIF1DRC1_KNEE2_OP - [4:0] */
2847#define WM8994_AIF1DRC1_KNEE2_OP_WIDTH 5 /* AIF1DRC1_KNEE2_OP - [4:0] */
2848
2849/*
2850 * R1104 (0x450) - AIF1 DRC2 (1)
2851 */
2852#define WM8994_AIF1DRC2_SIG_DET_RMS_MASK 0xF800 /* AIF1DRC2_SIG_DET_RMS - [15:11] */
2853#define WM8994_AIF1DRC2_SIG_DET_RMS_SHIFT 11 /* AIF1DRC2_SIG_DET_RMS - [15:11] */
2854#define WM8994_AIF1DRC2_SIG_DET_RMS_WIDTH 5 /* AIF1DRC2_SIG_DET_RMS - [15:11] */
2855#define WM8994_AIF1DRC2_SIG_DET_PK_MASK 0x0600 /* AIF1DRC2_SIG_DET_PK - [10:9] */
2856#define WM8994_AIF1DRC2_SIG_DET_PK_SHIFT 9 /* AIF1DRC2_SIG_DET_PK - [10:9] */
2857#define WM8994_AIF1DRC2_SIG_DET_PK_WIDTH 2 /* AIF1DRC2_SIG_DET_PK - [10:9] */
2858#define WM8994_AIF1DRC2_NG_ENA 0x0100 /* AIF1DRC2_NG_ENA */
2859#define WM8994_AIF1DRC2_NG_ENA_MASK 0x0100 /* AIF1DRC2_NG_ENA */
2860#define WM8994_AIF1DRC2_NG_ENA_SHIFT 8 /* AIF1DRC2_NG_ENA */
2861#define WM8994_AIF1DRC2_NG_ENA_WIDTH 1 /* AIF1DRC2_NG_ENA */
2862#define WM8994_AIF1DRC2_SIG_DET_MODE 0x0080 /* AIF1DRC2_SIG_DET_MODE */
2863#define WM8994_AIF1DRC2_SIG_DET_MODE_MASK 0x0080 /* AIF1DRC2_SIG_DET_MODE */
2864#define WM8994_AIF1DRC2_SIG_DET_MODE_SHIFT 7 /* AIF1DRC2_SIG_DET_MODE */
2865#define WM8994_AIF1DRC2_SIG_DET_MODE_WIDTH 1 /* AIF1DRC2_SIG_DET_MODE */
2866#define WM8994_AIF1DRC2_SIG_DET 0x0040 /* AIF1DRC2_SIG_DET */
2867#define WM8994_AIF1DRC2_SIG_DET_MASK 0x0040 /* AIF1DRC2_SIG_DET */
2868#define WM8994_AIF1DRC2_SIG_DET_SHIFT 6 /* AIF1DRC2_SIG_DET */
2869#define WM8994_AIF1DRC2_SIG_DET_WIDTH 1 /* AIF1DRC2_SIG_DET */
2870#define WM8994_AIF1DRC2_KNEE2_OP_ENA 0x0020 /* AIF1DRC2_KNEE2_OP_ENA */
2871#define WM8994_AIF1DRC2_KNEE2_OP_ENA_MASK 0x0020 /* AIF1DRC2_KNEE2_OP_ENA */
2872#define WM8994_AIF1DRC2_KNEE2_OP_ENA_SHIFT 5 /* AIF1DRC2_KNEE2_OP_ENA */
2873#define WM8994_AIF1DRC2_KNEE2_OP_ENA_WIDTH 1 /* AIF1DRC2_KNEE2_OP_ENA */
2874#define WM8994_AIF1DRC2_QR 0x0010 /* AIF1DRC2_QR */
2875#define WM8994_AIF1DRC2_QR_MASK 0x0010 /* AIF1DRC2_QR */
2876#define WM8994_AIF1DRC2_QR_SHIFT 4 /* AIF1DRC2_QR */
2877#define WM8994_AIF1DRC2_QR_WIDTH 1 /* AIF1DRC2_QR */
2878#define WM8994_AIF1DRC2_ANTICLIP 0x0008 /* AIF1DRC2_ANTICLIP */
2879#define WM8994_AIF1DRC2_ANTICLIP_MASK 0x0008 /* AIF1DRC2_ANTICLIP */
2880#define WM8994_AIF1DRC2_ANTICLIP_SHIFT 3 /* AIF1DRC2_ANTICLIP */
2881#define WM8994_AIF1DRC2_ANTICLIP_WIDTH 1 /* AIF1DRC2_ANTICLIP */
2882#define WM8994_AIF1DAC2_DRC_ENA 0x0004 /* AIF1DAC2_DRC_ENA */
2883#define WM8994_AIF1DAC2_DRC_ENA_MASK 0x0004 /* AIF1DAC2_DRC_ENA */
2884#define WM8994_AIF1DAC2_DRC_ENA_SHIFT 2 /* AIF1DAC2_DRC_ENA */
2885#define WM8994_AIF1DAC2_DRC_ENA_WIDTH 1 /* AIF1DAC2_DRC_ENA */
2886#define WM8994_AIF1ADC2L_DRC_ENA 0x0002 /* AIF1ADC2L_DRC_ENA */
2887#define WM8994_AIF1ADC2L_DRC_ENA_MASK 0x0002 /* AIF1ADC2L_DRC_ENA */
2888#define WM8994_AIF1ADC2L_DRC_ENA_SHIFT 1 /* AIF1ADC2L_DRC_ENA */
2889#define WM8994_AIF1ADC2L_DRC_ENA_WIDTH 1 /* AIF1ADC2L_DRC_ENA */
2890#define WM8994_AIF1ADC2R_DRC_ENA 0x0001 /* AIF1ADC2R_DRC_ENA */
2891#define WM8994_AIF1ADC2R_DRC_ENA_MASK 0x0001 /* AIF1ADC2R_DRC_ENA */
2892#define WM8994_AIF1ADC2R_DRC_ENA_SHIFT 0 /* AIF1ADC2R_DRC_ENA */
2893#define WM8994_AIF1ADC2R_DRC_ENA_WIDTH 1 /* AIF1ADC2R_DRC_ENA */
2894
2895/*
2896 * R1105 (0x451) - AIF1 DRC2 (2)
2897 */
2898#define WM8994_AIF1DRC2_ATK_MASK 0x1E00 /* AIF1DRC2_ATK - [12:9] */
2899#define WM8994_AIF1DRC2_ATK_SHIFT 9 /* AIF1DRC2_ATK - [12:9] */
2900#define WM8994_AIF1DRC2_ATK_WIDTH 4 /* AIF1DRC2_ATK - [12:9] */
2901#define WM8994_AIF1DRC2_DCY_MASK 0x01E0 /* AIF1DRC2_DCY - [8:5] */
2902#define WM8994_AIF1DRC2_DCY_SHIFT 5 /* AIF1DRC2_DCY - [8:5] */
2903#define WM8994_AIF1DRC2_DCY_WIDTH 4 /* AIF1DRC2_DCY - [8:5] */
2904#define WM8994_AIF1DRC2_MINGAIN_MASK 0x001C /* AIF1DRC2_MINGAIN - [4:2] */
2905#define WM8994_AIF1DRC2_MINGAIN_SHIFT 2 /* AIF1DRC2_MINGAIN - [4:2] */
2906#define WM8994_AIF1DRC2_MINGAIN_WIDTH 3 /* AIF1DRC2_MINGAIN - [4:2] */
2907#define WM8994_AIF1DRC2_MAXGAIN_MASK 0x0003 /* AIF1DRC2_MAXGAIN - [1:0] */
2908#define WM8994_AIF1DRC2_MAXGAIN_SHIFT 0 /* AIF1DRC2_MAXGAIN - [1:0] */
2909#define WM8994_AIF1DRC2_MAXGAIN_WIDTH 2 /* AIF1DRC2_MAXGAIN - [1:0] */
2910
2911/*
2912 * R1106 (0x452) - AIF1 DRC2 (3)
2913 */
2914#define WM8994_AIF1DRC2_NG_MINGAIN_MASK 0xF000 /* AIF1DRC2_NG_MINGAIN - [15:12] */
2915#define WM8994_AIF1DRC2_NG_MINGAIN_SHIFT 12 /* AIF1DRC2_NG_MINGAIN - [15:12] */
2916#define WM8994_AIF1DRC2_NG_MINGAIN_WIDTH 4 /* AIF1DRC2_NG_MINGAIN - [15:12] */
2917#define WM8994_AIF1DRC2_NG_EXP_MASK 0x0C00 /* AIF1DRC2_NG_EXP - [11:10] */
2918#define WM8994_AIF1DRC2_NG_EXP_SHIFT 10 /* AIF1DRC2_NG_EXP - [11:10] */
2919#define WM8994_AIF1DRC2_NG_EXP_WIDTH 2 /* AIF1DRC2_NG_EXP - [11:10] */
2920#define WM8994_AIF1DRC2_QR_THR_MASK 0x0300 /* AIF1DRC2_QR_THR - [9:8] */
2921#define WM8994_AIF1DRC2_QR_THR_SHIFT 8 /* AIF1DRC2_QR_THR - [9:8] */
2922#define WM8994_AIF1DRC2_QR_THR_WIDTH 2 /* AIF1DRC2_QR_THR - [9:8] */
2923#define WM8994_AIF1DRC2_QR_DCY_MASK 0x00C0 /* AIF1DRC2_QR_DCY - [7:6] */
2924#define WM8994_AIF1DRC2_QR_DCY_SHIFT 6 /* AIF1DRC2_QR_DCY - [7:6] */
2925#define WM8994_AIF1DRC2_QR_DCY_WIDTH 2 /* AIF1DRC2_QR_DCY - [7:6] */
2926#define WM8994_AIF1DRC2_HI_COMP_MASK 0x0038 /* AIF1DRC2_HI_COMP - [5:3] */
2927#define WM8994_AIF1DRC2_HI_COMP_SHIFT 3 /* AIF1DRC2_HI_COMP - [5:3] */
2928#define WM8994_AIF1DRC2_HI_COMP_WIDTH 3 /* AIF1DRC2_HI_COMP - [5:3] */
2929#define WM8994_AIF1DRC2_LO_COMP_MASK 0x0007 /* AIF1DRC2_LO_COMP - [2:0] */
2930#define WM8994_AIF1DRC2_LO_COMP_SHIFT 0 /* AIF1DRC2_LO_COMP - [2:0] */
2931#define WM8994_AIF1DRC2_LO_COMP_WIDTH 3 /* AIF1DRC2_LO_COMP - [2:0] */
2932
2933/*
2934 * R1107 (0x453) - AIF1 DRC2 (4)
2935 */
2936#define WM8994_AIF1DRC2_KNEE_IP_MASK 0x07E0 /* AIF1DRC2_KNEE_IP - [10:5] */
2937#define WM8994_AIF1DRC2_KNEE_IP_SHIFT 5 /* AIF1DRC2_KNEE_IP - [10:5] */
2938#define WM8994_AIF1DRC2_KNEE_IP_WIDTH 6 /* AIF1DRC2_KNEE_IP - [10:5] */
2939#define WM8994_AIF1DRC2_KNEE_OP_MASK 0x001F /* AIF1DRC2_KNEE_OP - [4:0] */
2940#define WM8994_AIF1DRC2_KNEE_OP_SHIFT 0 /* AIF1DRC2_KNEE_OP - [4:0] */
2941#define WM8994_AIF1DRC2_KNEE_OP_WIDTH 5 /* AIF1DRC2_KNEE_OP - [4:0] */
2942
2943/*
2944 * R1108 (0x454) - AIF1 DRC2 (5)
2945 */
2946#define WM8994_AIF1DRC2_KNEE2_IP_MASK 0x03E0 /* AIF1DRC2_KNEE2_IP - [9:5] */
2947#define WM8994_AIF1DRC2_KNEE2_IP_SHIFT 5 /* AIF1DRC2_KNEE2_IP - [9:5] */
2948#define WM8994_AIF1DRC2_KNEE2_IP_WIDTH 5 /* AIF1DRC2_KNEE2_IP - [9:5] */
2949#define WM8994_AIF1DRC2_KNEE2_OP_MASK 0x001F /* AIF1DRC2_KNEE2_OP - [4:0] */
2950#define WM8994_AIF1DRC2_KNEE2_OP_SHIFT 0 /* AIF1DRC2_KNEE2_OP - [4:0] */
2951#define WM8994_AIF1DRC2_KNEE2_OP_WIDTH 5 /* AIF1DRC2_KNEE2_OP - [4:0] */
2952
2953/*
2954 * R1152 (0x480) - AIF1 DAC1 EQ Gains (1)
2955 */
2956#define WM8994_AIF1DAC1_EQ_B1_GAIN_MASK 0xF800 /* AIF1DAC1_EQ_B1_GAIN - [15:11] */
2957#define WM8994_AIF1DAC1_EQ_B1_GAIN_SHIFT 11 /* AIF1DAC1_EQ_B1_GAIN - [15:11] */
2958#define WM8994_AIF1DAC1_EQ_B1_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B1_GAIN - [15:11] */
2959#define WM8994_AIF1DAC1_EQ_B2_GAIN_MASK 0x07C0 /* AIF1DAC1_EQ_B2_GAIN - [10:6] */
2960#define WM8994_AIF1DAC1_EQ_B2_GAIN_SHIFT 6 /* AIF1DAC1_EQ_B2_GAIN - [10:6] */
2961#define WM8994_AIF1DAC1_EQ_B2_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B2_GAIN - [10:6] */
2962#define WM8994_AIF1DAC1_EQ_B3_GAIN_MASK 0x003E /* AIF1DAC1_EQ_B3_GAIN - [5:1] */
2963#define WM8994_AIF1DAC1_EQ_B3_GAIN_SHIFT 1 /* AIF1DAC1_EQ_B3_GAIN - [5:1] */
2964#define WM8994_AIF1DAC1_EQ_B3_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B3_GAIN - [5:1] */
2965#define WM8994_AIF1DAC1_EQ_ENA 0x0001 /* AIF1DAC1_EQ_ENA */
2966#define WM8994_AIF1DAC1_EQ_ENA_MASK 0x0001 /* AIF1DAC1_EQ_ENA */
2967#define WM8994_AIF1DAC1_EQ_ENA_SHIFT 0 /* AIF1DAC1_EQ_ENA */
2968#define WM8994_AIF1DAC1_EQ_ENA_WIDTH 1 /* AIF1DAC1_EQ_ENA */
2969
2970/*
2971 * R1153 (0x481) - AIF1 DAC1 EQ Gains (2)
2972 */
2973#define WM8994_AIF1DAC1_EQ_B4_GAIN_MASK 0xF800 /* AIF1DAC1_EQ_B4_GAIN - [15:11] */
2974#define WM8994_AIF1DAC1_EQ_B4_GAIN_SHIFT 11 /* AIF1DAC1_EQ_B4_GAIN - [15:11] */
2975#define WM8994_AIF1DAC1_EQ_B4_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B4_GAIN - [15:11] */
2976#define WM8994_AIF1DAC1_EQ_B5_GAIN_MASK 0x07C0 /* AIF1DAC1_EQ_B5_GAIN - [10:6] */
2977#define WM8994_AIF1DAC1_EQ_B5_GAIN_SHIFT 6 /* AIF1DAC1_EQ_B5_GAIN - [10:6] */
2978#define WM8994_AIF1DAC1_EQ_B5_GAIN_WIDTH 5 /* AIF1DAC1_EQ_B5_GAIN - [10:6] */
2979
2980/*
2981 * R1154 (0x482) - AIF1 DAC1 EQ Band 1 A
2982 */
2983#define WM8994_AIF1DAC1_EQ_B1_A_MASK 0xFFFF /* AIF1DAC1_EQ_B1_A - [15:0] */
2984#define WM8994_AIF1DAC1_EQ_B1_A_SHIFT 0 /* AIF1DAC1_EQ_B1_A - [15:0] */
2985#define WM8994_AIF1DAC1_EQ_B1_A_WIDTH 16 /* AIF1DAC1_EQ_B1_A - [15:0] */
2986
2987/*
2988 * R1155 (0x483) - AIF1 DAC1 EQ Band 1 B
2989 */
2990#define WM8994_AIF1DAC1_EQ_B1_B_MASK 0xFFFF /* AIF1DAC1_EQ_B1_B - [15:0] */
2991#define WM8994_AIF1DAC1_EQ_B1_B_SHIFT 0 /* AIF1DAC1_EQ_B1_B - [15:0] */
2992#define WM8994_AIF1DAC1_EQ_B1_B_WIDTH 16 /* AIF1DAC1_EQ_B1_B - [15:0] */
2993
2994/*
2995 * R1156 (0x484) - AIF1 DAC1 EQ Band 1 PG
2996 */
2997#define WM8994_AIF1DAC1_EQ_B1_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B1_PG - [15:0] */
2998#define WM8994_AIF1DAC1_EQ_B1_PG_SHIFT 0 /* AIF1DAC1_EQ_B1_PG - [15:0] */
2999#define WM8994_AIF1DAC1_EQ_B1_PG_WIDTH 16 /* AIF1DAC1_EQ_B1_PG - [15:0] */
3000
3001/*
3002 * R1157 (0x485) - AIF1 DAC1 EQ Band 2 A
3003 */
3004#define WM8994_AIF1DAC1_EQ_B2_A_MASK 0xFFFF /* AIF1DAC1_EQ_B2_A - [15:0] */
3005#define WM8994_AIF1DAC1_EQ_B2_A_SHIFT 0 /* AIF1DAC1_EQ_B2_A - [15:0] */
3006#define WM8994_AIF1DAC1_EQ_B2_A_WIDTH 16 /* AIF1DAC1_EQ_B2_A - [15:0] */
3007
3008/*
3009 * R1158 (0x486) - AIF1 DAC1 EQ Band 2 B
3010 */
3011#define WM8994_AIF1DAC1_EQ_B2_B_MASK 0xFFFF /* AIF1DAC1_EQ_B2_B - [15:0] */
3012#define WM8994_AIF1DAC1_EQ_B2_B_SHIFT 0 /* AIF1DAC1_EQ_B2_B - [15:0] */
3013#define WM8994_AIF1DAC1_EQ_B2_B_WIDTH 16 /* AIF1DAC1_EQ_B2_B - [15:0] */
3014
3015/*
3016 * R1159 (0x487) - AIF1 DAC1 EQ Band 2 C
3017 */
3018#define WM8994_AIF1DAC1_EQ_B2_C_MASK 0xFFFF /* AIF1DAC1_EQ_B2_C - [15:0] */
3019#define WM8994_AIF1DAC1_EQ_B2_C_SHIFT 0 /* AIF1DAC1_EQ_B2_C - [15:0] */
3020#define WM8994_AIF1DAC1_EQ_B2_C_WIDTH 16 /* AIF1DAC1_EQ_B2_C - [15:0] */
3021
3022/*
3023 * R1160 (0x488) - AIF1 DAC1 EQ Band 2 PG
3024 */
3025#define WM8994_AIF1DAC1_EQ_B2_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B2_PG - [15:0] */
3026#define WM8994_AIF1DAC1_EQ_B2_PG_SHIFT 0 /* AIF1DAC1_EQ_B2_PG - [15:0] */
3027#define WM8994_AIF1DAC1_EQ_B2_PG_WIDTH 16 /* AIF1DAC1_EQ_B2_PG - [15:0] */
3028
3029/*
3030 * R1161 (0x489) - AIF1 DAC1 EQ Band 3 A
3031 */
3032#define WM8994_AIF1DAC1_EQ_B3_A_MASK 0xFFFF /* AIF1DAC1_EQ_B3_A - [15:0] */
3033#define WM8994_AIF1DAC1_EQ_B3_A_SHIFT 0 /* AIF1DAC1_EQ_B3_A - [15:0] */
3034#define WM8994_AIF1DAC1_EQ_B3_A_WIDTH 16 /* AIF1DAC1_EQ_B3_A - [15:0] */
3035
3036/*
3037 * R1162 (0x48A) - AIF1 DAC1 EQ Band 3 B
3038 */
3039#define WM8994_AIF1DAC1_EQ_B3_B_MASK 0xFFFF /* AIF1DAC1_EQ_B3_B - [15:0] */
3040#define WM8994_AIF1DAC1_EQ_B3_B_SHIFT 0 /* AIF1DAC1_EQ_B3_B - [15:0] */
3041#define WM8994_AIF1DAC1_EQ_B3_B_WIDTH 16 /* AIF1DAC1_EQ_B3_B - [15:0] */
3042
3043/*
3044 * R1163 (0x48B) - AIF1 DAC1 EQ Band 3 C
3045 */
3046#define WM8994_AIF1DAC1_EQ_B3_C_MASK 0xFFFF /* AIF1DAC1_EQ_B3_C - [15:0] */
3047#define WM8994_AIF1DAC1_EQ_B3_C_SHIFT 0 /* AIF1DAC1_EQ_B3_C - [15:0] */
3048#define WM8994_AIF1DAC1_EQ_B3_C_WIDTH 16 /* AIF1DAC1_EQ_B3_C - [15:0] */
3049
3050/*
3051 * R1164 (0x48C) - AIF1 DAC1 EQ Band 3 PG
3052 */
3053#define WM8994_AIF1DAC1_EQ_B3_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B3_PG - [15:0] */
3054#define WM8994_AIF1DAC1_EQ_B3_PG_SHIFT 0 /* AIF1DAC1_EQ_B3_PG - [15:0] */
3055#define WM8994_AIF1DAC1_EQ_B3_PG_WIDTH 16 /* AIF1DAC1_EQ_B3_PG - [15:0] */
3056
3057/*
3058 * R1165 (0x48D) - AIF1 DAC1 EQ Band 4 A
3059 */
3060#define WM8994_AIF1DAC1_EQ_B4_A_MASK 0xFFFF /* AIF1DAC1_EQ_B4_A - [15:0] */
3061#define WM8994_AIF1DAC1_EQ_B4_A_SHIFT 0 /* AIF1DAC1_EQ_B4_A - [15:0] */
3062#define WM8994_AIF1DAC1_EQ_B4_A_WIDTH 16 /* AIF1DAC1_EQ_B4_A - [15:0] */
3063
3064/*
3065 * R1166 (0x48E) - AIF1 DAC1 EQ Band 4 B
3066 */
3067#define WM8994_AIF1DAC1_EQ_B4_B_MASK 0xFFFF /* AIF1DAC1_EQ_B4_B - [15:0] */
3068#define WM8994_AIF1DAC1_EQ_B4_B_SHIFT 0 /* AIF1DAC1_EQ_B4_B - [15:0] */
3069#define WM8994_AIF1DAC1_EQ_B4_B_WIDTH 16 /* AIF1DAC1_EQ_B4_B - [15:0] */
3070
3071/*
3072 * R1167 (0x48F) - AIF1 DAC1 EQ Band 4 C
3073 */
3074#define WM8994_AIF1DAC1_EQ_B4_C_MASK 0xFFFF /* AIF1DAC1_EQ_B4_C - [15:0] */
3075#define WM8994_AIF1DAC1_EQ_B4_C_SHIFT 0 /* AIF1DAC1_EQ_B4_C - [15:0] */
3076#define WM8994_AIF1DAC1_EQ_B4_C_WIDTH 16 /* AIF1DAC1_EQ_B4_C - [15:0] */
3077
3078/*
3079 * R1168 (0x490) - AIF1 DAC1 EQ Band 4 PG
3080 */
3081#define WM8994_AIF1DAC1_EQ_B4_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B4_PG - [15:0] */
3082#define WM8994_AIF1DAC1_EQ_B4_PG_SHIFT 0 /* AIF1DAC1_EQ_B4_PG - [15:0] */
3083#define WM8994_AIF1DAC1_EQ_B4_PG_WIDTH 16 /* AIF1DAC1_EQ_B4_PG - [15:0] */
3084
3085/*
3086 * R1169 (0x491) - AIF1 DAC1 EQ Band 5 A
3087 */
3088#define WM8994_AIF1DAC1_EQ_B5_A_MASK 0xFFFF /* AIF1DAC1_EQ_B5_A - [15:0] */
3089#define WM8994_AIF1DAC1_EQ_B5_A_SHIFT 0 /* AIF1DAC1_EQ_B5_A - [15:0] */
3090#define WM8994_AIF1DAC1_EQ_B5_A_WIDTH 16 /* AIF1DAC1_EQ_B5_A - [15:0] */
3091
3092/*
3093 * R1170 (0x492) - AIF1 DAC1 EQ Band 5 B
3094 */
3095#define WM8994_AIF1DAC1_EQ_B5_B_MASK 0xFFFF /* AIF1DAC1_EQ_B5_B - [15:0] */
3096#define WM8994_AIF1DAC1_EQ_B5_B_SHIFT 0 /* AIF1DAC1_EQ_B5_B - [15:0] */
3097#define WM8994_AIF1DAC1_EQ_B5_B_WIDTH 16 /* AIF1DAC1_EQ_B5_B - [15:0] */
3098
3099/*
3100 * R1171 (0x493) - AIF1 DAC1 EQ Band 5 PG
3101 */
3102#define WM8994_AIF1DAC1_EQ_B5_PG_MASK 0xFFFF /* AIF1DAC1_EQ_B5_PG - [15:0] */
3103#define WM8994_AIF1DAC1_EQ_B5_PG_SHIFT 0 /* AIF1DAC1_EQ_B5_PG - [15:0] */
3104#define WM8994_AIF1DAC1_EQ_B5_PG_WIDTH 16 /* AIF1DAC1_EQ_B5_PG - [15:0] */
3105
3106/*
3107 * R1184 (0x4A0) - AIF1 DAC2 EQ Gains (1)
3108 */
3109#define WM8994_AIF1DAC2_EQ_B1_GAIN_MASK 0xF800 /* AIF1DAC2_EQ_B1_GAIN - [15:11] */
3110#define WM8994_AIF1DAC2_EQ_B1_GAIN_SHIFT 11 /* AIF1DAC2_EQ_B1_GAIN - [15:11] */
3111#define WM8994_AIF1DAC2_EQ_B1_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B1_GAIN - [15:11] */
3112#define WM8994_AIF1DAC2_EQ_B2_GAIN_MASK 0x07C0 /* AIF1DAC2_EQ_B2_GAIN - [10:6] */
3113#define WM8994_AIF1DAC2_EQ_B2_GAIN_SHIFT 6 /* AIF1DAC2_EQ_B2_GAIN - [10:6] */
3114#define WM8994_AIF1DAC2_EQ_B2_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B2_GAIN - [10:6] */
3115#define WM8994_AIF1DAC2_EQ_B3_GAIN_MASK 0x003E /* AIF1DAC2_EQ_B3_GAIN - [5:1] */
3116#define WM8994_AIF1DAC2_EQ_B3_GAIN_SHIFT 1 /* AIF1DAC2_EQ_B3_GAIN - [5:1] */
3117#define WM8994_AIF1DAC2_EQ_B3_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B3_GAIN - [5:1] */
3118#define WM8994_AIF1DAC2_EQ_ENA 0x0001 /* AIF1DAC2_EQ_ENA */
3119#define WM8994_AIF1DAC2_EQ_ENA_MASK 0x0001 /* AIF1DAC2_EQ_ENA */
3120#define WM8994_AIF1DAC2_EQ_ENA_SHIFT 0 /* AIF1DAC2_EQ_ENA */
3121#define WM8994_AIF1DAC2_EQ_ENA_WIDTH 1 /* AIF1DAC2_EQ_ENA */
3122
3123/*
3124 * R1185 (0x4A1) - AIF1 DAC2 EQ Gains (2)
3125 */
3126#define WM8994_AIF1DAC2_EQ_B4_GAIN_MASK 0xF800 /* AIF1DAC2_EQ_B4_GAIN - [15:11] */
3127#define WM8994_AIF1DAC2_EQ_B4_GAIN_SHIFT 11 /* AIF1DAC2_EQ_B4_GAIN - [15:11] */
3128#define WM8994_AIF1DAC2_EQ_B4_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B4_GAIN - [15:11] */
3129#define WM8994_AIF1DAC2_EQ_B5_GAIN_MASK 0x07C0 /* AIF1DAC2_EQ_B5_GAIN - [10:6] */
3130#define WM8994_AIF1DAC2_EQ_B5_GAIN_SHIFT 6 /* AIF1DAC2_EQ_B5_GAIN - [10:6] */
3131#define WM8994_AIF1DAC2_EQ_B5_GAIN_WIDTH 5 /* AIF1DAC2_EQ_B5_GAIN - [10:6] */
3132
3133/*
3134 * R1186 (0x4A2) - AIF1 DAC2 EQ Band 1 A
3135 */
3136#define WM8994_AIF1DAC2_EQ_B1_A_MASK 0xFFFF /* AIF1DAC2_EQ_B1_A - [15:0] */
3137#define WM8994_AIF1DAC2_EQ_B1_A_SHIFT 0 /* AIF1DAC2_EQ_B1_A - [15:0] */
3138#define WM8994_AIF1DAC2_EQ_B1_A_WIDTH 16 /* AIF1DAC2_EQ_B1_A - [15:0] */
3139
3140/*
3141 * R1187 (0x4A3) - AIF1 DAC2 EQ Band 1 B
3142 */
3143#define WM8994_AIF1DAC2_EQ_B1_B_MASK 0xFFFF /* AIF1DAC2_EQ_B1_B - [15:0] */
3144#define WM8994_AIF1DAC2_EQ_B1_B_SHIFT 0 /* AIF1DAC2_EQ_B1_B - [15:0] */
3145#define WM8994_AIF1DAC2_EQ_B1_B_WIDTH 16 /* AIF1DAC2_EQ_B1_B - [15:0] */
3146
3147/*
3148 * R1188 (0x4A4) - AIF1 DAC2 EQ Band 1 PG
3149 */
3150#define WM8994_AIF1DAC2_EQ_B1_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B1_PG - [15:0] */
3151#define WM8994_AIF1DAC2_EQ_B1_PG_SHIFT 0 /* AIF1DAC2_EQ_B1_PG - [15:0] */
3152#define WM8994_AIF1DAC2_EQ_B1_PG_WIDTH 16 /* AIF1DAC2_EQ_B1_PG - [15:0] */
3153
3154/*
3155 * R1189 (0x4A5) - AIF1 DAC2 EQ Band 2 A
3156 */
3157#define WM8994_AIF1DAC2_EQ_B2_A_MASK 0xFFFF /* AIF1DAC2_EQ_B2_A - [15:0] */
3158#define WM8994_AIF1DAC2_EQ_B2_A_SHIFT 0 /* AIF1DAC2_EQ_B2_A - [15:0] */
3159#define WM8994_AIF1DAC2_EQ_B2_A_WIDTH 16 /* AIF1DAC2_EQ_B2_A - [15:0] */
3160
3161/*
3162 * R1190 (0x4A6) - AIF1 DAC2 EQ Band 2 B
3163 */
3164#define WM8994_AIF1DAC2_EQ_B2_B_MASK 0xFFFF /* AIF1DAC2_EQ_B2_B - [15:0] */
3165#define WM8994_AIF1DAC2_EQ_B2_B_SHIFT 0 /* AIF1DAC2_EQ_B2_B - [15:0] */
3166#define WM8994_AIF1DAC2_EQ_B2_B_WIDTH 16 /* AIF1DAC2_EQ_B2_B - [15:0] */
3167
3168/*
3169 * R1191 (0x4A7) - AIF1 DAC2 EQ Band 2 C
3170 */
3171#define WM8994_AIF1DAC2_EQ_B2_C_MASK 0xFFFF /* AIF1DAC2_EQ_B2_C - [15:0] */
3172#define WM8994_AIF1DAC2_EQ_B2_C_SHIFT 0 /* AIF1DAC2_EQ_B2_C - [15:0] */
3173#define WM8994_AIF1DAC2_EQ_B2_C_WIDTH 16 /* AIF1DAC2_EQ_B2_C - [15:0] */
3174
3175/*
3176 * R1192 (0x4A8) - AIF1 DAC2 EQ Band 2 PG
3177 */
3178#define WM8994_AIF1DAC2_EQ_B2_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B2_PG - [15:0] */
3179#define WM8994_AIF1DAC2_EQ_B2_PG_SHIFT 0 /* AIF1DAC2_EQ_B2_PG - [15:0] */
3180#define WM8994_AIF1DAC2_EQ_B2_PG_WIDTH 16 /* AIF1DAC2_EQ_B2_PG - [15:0] */
3181
3182/*
3183 * R1193 (0x4A9) - AIF1 DAC2 EQ Band 3 A
3184 */
3185#define WM8994_AIF1DAC2_EQ_B3_A_MASK 0xFFFF /* AIF1DAC2_EQ_B3_A - [15:0] */
3186#define WM8994_AIF1DAC2_EQ_B3_A_SHIFT 0 /* AIF1DAC2_EQ_B3_A - [15:0] */
3187#define WM8994_AIF1DAC2_EQ_B3_A_WIDTH 16 /* AIF1DAC2_EQ_B3_A - [15:0] */
3188
3189/*
3190 * R1194 (0x4AA) - AIF1 DAC2 EQ Band 3 B
3191 */
3192#define WM8994_AIF1DAC2_EQ_B3_B_MASK 0xFFFF /* AIF1DAC2_EQ_B3_B - [15:0] */
3193#define WM8994_AIF1DAC2_EQ_B3_B_SHIFT 0 /* AIF1DAC2_EQ_B3_B - [15:0] */
3194#define WM8994_AIF1DAC2_EQ_B3_B_WIDTH 16 /* AIF1DAC2_EQ_B3_B - [15:0] */
3195
3196/*
3197 * R1195 (0x4AB) - AIF1 DAC2 EQ Band 3 C
3198 */
3199#define WM8994_AIF1DAC2_EQ_B3_C_MASK 0xFFFF /* AIF1DAC2_EQ_B3_C - [15:0] */
3200#define WM8994_AIF1DAC2_EQ_B3_C_SHIFT 0 /* AIF1DAC2_EQ_B3_C - [15:0] */
3201#define WM8994_AIF1DAC2_EQ_B3_C_WIDTH 16 /* AIF1DAC2_EQ_B3_C - [15:0] */
3202
3203/*
3204 * R1196 (0x4AC) - AIF1 DAC2 EQ Band 3 PG
3205 */
3206#define WM8994_AIF1DAC2_EQ_B3_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B3_PG - [15:0] */
3207#define WM8994_AIF1DAC2_EQ_B3_PG_SHIFT 0 /* AIF1DAC2_EQ_B3_PG - [15:0] */
3208#define WM8994_AIF1DAC2_EQ_B3_PG_WIDTH 16 /* AIF1DAC2_EQ_B3_PG - [15:0] */
3209
3210/*
3211 * R1197 (0x4AD) - AIF1 DAC2 EQ Band 4 A
3212 */
3213#define WM8994_AIF1DAC2_EQ_B4_A_MASK 0xFFFF /* AIF1DAC2_EQ_B4_A - [15:0] */
3214#define WM8994_AIF1DAC2_EQ_B4_A_SHIFT 0 /* AIF1DAC2_EQ_B4_A - [15:0] */
3215#define WM8994_AIF1DAC2_EQ_B4_A_WIDTH 16 /* AIF1DAC2_EQ_B4_A - [15:0] */
3216
3217/*
3218 * R1198 (0x4AE) - AIF1 DAC2 EQ Band 4 B
3219 */
3220#define WM8994_AIF1DAC2_EQ_B4_B_MASK 0xFFFF /* AIF1DAC2_EQ_B4_B - [15:0] */
3221#define WM8994_AIF1DAC2_EQ_B4_B_SHIFT 0 /* AIF1DAC2_EQ_B4_B - [15:0] */
3222#define WM8994_AIF1DAC2_EQ_B4_B_WIDTH 16 /* AIF1DAC2_EQ_B4_B - [15:0] */
3223
3224/*
3225 * R1199 (0x4AF) - AIF1 DAC2 EQ Band 4 C
3226 */
3227#define WM8994_AIF1DAC2_EQ_B4_C_MASK 0xFFFF /* AIF1DAC2_EQ_B4_C - [15:0] */
3228#define WM8994_AIF1DAC2_EQ_B4_C_SHIFT 0 /* AIF1DAC2_EQ_B4_C - [15:0] */
3229#define WM8994_AIF1DAC2_EQ_B4_C_WIDTH 16 /* AIF1DAC2_EQ_B4_C - [15:0] */
3230
3231/*
3232 * R1200 (0x4B0) - AIF1 DAC2 EQ Band 4 PG
3233 */
3234#define WM8994_AIF1DAC2_EQ_B4_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B4_PG - [15:0] */
3235#define WM8994_AIF1DAC2_EQ_B4_PG_SHIFT 0 /* AIF1DAC2_EQ_B4_PG - [15:0] */
3236#define WM8994_AIF1DAC2_EQ_B4_PG_WIDTH 16 /* AIF1DAC2_EQ_B4_PG - [15:0] */
3237
3238/*
3239 * R1201 (0x4B1) - AIF1 DAC2 EQ Band 5 A
3240 */
3241#define WM8994_AIF1DAC2_EQ_B5_A_MASK 0xFFFF /* AIF1DAC2_EQ_B5_A - [15:0] */
3242#define WM8994_AIF1DAC2_EQ_B5_A_SHIFT 0 /* AIF1DAC2_EQ_B5_A - [15:0] */
3243#define WM8994_AIF1DAC2_EQ_B5_A_WIDTH 16 /* AIF1DAC2_EQ_B5_A - [15:0] */
3244
3245/*
3246 * R1202 (0x4B2) - AIF1 DAC2 EQ Band 5 B
3247 */
3248#define WM8994_AIF1DAC2_EQ_B5_B_MASK 0xFFFF /* AIF1DAC2_EQ_B5_B - [15:0] */
3249#define WM8994_AIF1DAC2_EQ_B5_B_SHIFT 0 /* AIF1DAC2_EQ_B5_B - [15:0] */
3250#define WM8994_AIF1DAC2_EQ_B5_B_WIDTH 16 /* AIF1DAC2_EQ_B5_B - [15:0] */
3251
3252/*
3253 * R1203 (0x4B3) - AIF1 DAC2 EQ Band 5 PG
3254 */
3255#define WM8994_AIF1DAC2_EQ_B5_PG_MASK 0xFFFF /* AIF1DAC2_EQ_B5_PG - [15:0] */
3256#define WM8994_AIF1DAC2_EQ_B5_PG_SHIFT 0 /* AIF1DAC2_EQ_B5_PG - [15:0] */
3257#define WM8994_AIF1DAC2_EQ_B5_PG_WIDTH 16 /* AIF1DAC2_EQ_B5_PG - [15:0] */
3258
3259/*
3260 * R1280 (0x500) - AIF2 ADC Left Volume
3261 */
3262#define WM8994_AIF2ADC_VU 0x0100 /* AIF2ADC_VU */
3263#define WM8994_AIF2ADC_VU_MASK 0x0100 /* AIF2ADC_VU */
3264#define WM8994_AIF2ADC_VU_SHIFT 8 /* AIF2ADC_VU */
3265#define WM8994_AIF2ADC_VU_WIDTH 1 /* AIF2ADC_VU */
3266#define WM8994_AIF2ADCL_VOL_MASK 0x00FF /* AIF2ADCL_VOL - [7:0] */
3267#define WM8994_AIF2ADCL_VOL_SHIFT 0 /* AIF2ADCL_VOL - [7:0] */
3268#define WM8994_AIF2ADCL_VOL_WIDTH 8 /* AIF2ADCL_VOL - [7:0] */
3269
3270/*
3271 * R1281 (0x501) - AIF2 ADC Right Volume
3272 */
3273#define WM8994_AIF2ADC_VU 0x0100 /* AIF2ADC_VU */
3274#define WM8994_AIF2ADC_VU_MASK 0x0100 /* AIF2ADC_VU */
3275#define WM8994_AIF2ADC_VU_SHIFT 8 /* AIF2ADC_VU */
3276#define WM8994_AIF2ADC_VU_WIDTH 1 /* AIF2ADC_VU */
3277#define WM8994_AIF2ADCR_VOL_MASK 0x00FF /* AIF2ADCR_VOL - [7:0] */
3278#define WM8994_AIF2ADCR_VOL_SHIFT 0 /* AIF2ADCR_VOL - [7:0] */
3279#define WM8994_AIF2ADCR_VOL_WIDTH 8 /* AIF2ADCR_VOL - [7:0] */
3280
3281/*
3282 * R1282 (0x502) - AIF2 DAC Left Volume
3283 */
3284#define WM8994_AIF2DAC_VU 0x0100 /* AIF2DAC_VU */
3285#define WM8994_AIF2DAC_VU_MASK 0x0100 /* AIF2DAC_VU */
3286#define WM8994_AIF2DAC_VU_SHIFT 8 /* AIF2DAC_VU */
3287#define WM8994_AIF2DAC_VU_WIDTH 1 /* AIF2DAC_VU */
3288#define WM8994_AIF2DACL_VOL_MASK 0x00FF /* AIF2DACL_VOL - [7:0] */
3289#define WM8994_AIF2DACL_VOL_SHIFT 0 /* AIF2DACL_VOL - [7:0] */
3290#define WM8994_AIF2DACL_VOL_WIDTH 8 /* AIF2DACL_VOL - [7:0] */
3291
3292/*
3293 * R1283 (0x503) - AIF2 DAC Right Volume
3294 */
3295#define WM8994_AIF2DAC_VU 0x0100 /* AIF2DAC_VU */
3296#define WM8994_AIF2DAC_VU_MASK 0x0100 /* AIF2DAC_VU */
3297#define WM8994_AIF2DAC_VU_SHIFT 8 /* AIF2DAC_VU */
3298#define WM8994_AIF2DAC_VU_WIDTH 1 /* AIF2DAC_VU */
3299#define WM8994_AIF2DACR_VOL_MASK 0x00FF /* AIF2DACR_VOL - [7:0] */
3300#define WM8994_AIF2DACR_VOL_SHIFT 0 /* AIF2DACR_VOL - [7:0] */
3301#define WM8994_AIF2DACR_VOL_WIDTH 8 /* AIF2DACR_VOL - [7:0] */
3302
3303/*
3304 * R1296 (0x510) - AIF2 ADC Filters
3305 */
3306#define WM8994_AIF2ADC_4FS 0x8000 /* AIF2ADC_4FS */
3307#define WM8994_AIF2ADC_4FS_MASK 0x8000 /* AIF2ADC_4FS */
3308#define WM8994_AIF2ADC_4FS_SHIFT 15 /* AIF2ADC_4FS */
3309#define WM8994_AIF2ADC_4FS_WIDTH 1 /* AIF2ADC_4FS */
3310#define WM8994_AIF2ADC_HPF_CUT_MASK 0x6000 /* AIF2ADC_HPF_CUT - [14:13] */
3311#define WM8994_AIF2ADC_HPF_CUT_SHIFT 13 /* AIF2ADC_HPF_CUT - [14:13] */
3312#define WM8994_AIF2ADC_HPF_CUT_WIDTH 2 /* AIF2ADC_HPF_CUT - [14:13] */
3313#define WM8994_AIF2ADCL_HPF 0x1000 /* AIF2ADCL_HPF */
3314#define WM8994_AIF2ADCL_HPF_MASK 0x1000 /* AIF2ADCL_HPF */
3315#define WM8994_AIF2ADCL_HPF_SHIFT 12 /* AIF2ADCL_HPF */
3316#define WM8994_AIF2ADCL_HPF_WIDTH 1 /* AIF2ADCL_HPF */
3317#define WM8994_AIF2ADCR_HPF 0x0800 /* AIF2ADCR_HPF */
3318#define WM8994_AIF2ADCR_HPF_MASK 0x0800 /* AIF2ADCR_HPF */
3319#define WM8994_AIF2ADCR_HPF_SHIFT 11 /* AIF2ADCR_HPF */
3320#define WM8994_AIF2ADCR_HPF_WIDTH 1 /* AIF2ADCR_HPF */
3321
3322/*
3323 * R1312 (0x520) - AIF2 DAC Filters (1)
3324 */
3325#define WM8994_AIF2DAC_MUTE 0x0200 /* AIF2DAC_MUTE */
3326#define WM8994_AIF2DAC_MUTE_MASK 0x0200 /* AIF2DAC_MUTE */
3327#define WM8994_AIF2DAC_MUTE_SHIFT 9 /* AIF2DAC_MUTE */
3328#define WM8994_AIF2DAC_MUTE_WIDTH 1 /* AIF2DAC_MUTE */
3329#define WM8994_AIF2DAC_MONO 0x0080 /* AIF2DAC_MONO */
3330#define WM8994_AIF2DAC_MONO_MASK 0x0080 /* AIF2DAC_MONO */
3331#define WM8994_AIF2DAC_MONO_SHIFT 7 /* AIF2DAC_MONO */
3332#define WM8994_AIF2DAC_MONO_WIDTH 1 /* AIF2DAC_MONO */
3333#define WM8994_AIF2DAC_MUTERATE 0x0020 /* AIF2DAC_MUTERATE */
3334#define WM8994_AIF2DAC_MUTERATE_MASK 0x0020 /* AIF2DAC_MUTERATE */
3335#define WM8994_AIF2DAC_MUTERATE_SHIFT 5 /* AIF2DAC_MUTERATE */
3336#define WM8994_AIF2DAC_MUTERATE_WIDTH 1 /* AIF2DAC_MUTERATE */
3337#define WM8994_AIF2DAC_UNMUTE_RAMP 0x0010 /* AIF2DAC_UNMUTE_RAMP */
3338#define WM8994_AIF2DAC_UNMUTE_RAMP_MASK 0x0010 /* AIF2DAC_UNMUTE_RAMP */
3339#define WM8994_AIF2DAC_UNMUTE_RAMP_SHIFT 4 /* AIF2DAC_UNMUTE_RAMP */
3340#define WM8994_AIF2DAC_UNMUTE_RAMP_WIDTH 1 /* AIF2DAC_UNMUTE_RAMP */
3341#define WM8994_AIF2DAC_DEEMP_MASK 0x0006 /* AIF2DAC_DEEMP - [2:1] */
3342#define WM8994_AIF2DAC_DEEMP_SHIFT 1 /* AIF2DAC_DEEMP - [2:1] */
3343#define WM8994_AIF2DAC_DEEMP_WIDTH 2 /* AIF2DAC_DEEMP - [2:1] */
3344
3345/*
3346 * R1313 (0x521) - AIF2 DAC Filters (2)
3347 */
3348#define WM8994_AIF2DAC_3D_GAIN_MASK 0x3E00 /* AIF2DAC_3D_GAIN - [13:9] */
3349#define WM8994_AIF2DAC_3D_GAIN_SHIFT 9 /* AIF2DAC_3D_GAIN - [13:9] */
3350#define WM8994_AIF2DAC_3D_GAIN_WIDTH 5 /* AIF2DAC_3D_GAIN - [13:9] */
3351#define WM8994_AIF2DAC_3D_ENA 0x0100 /* AIF2DAC_3D_ENA */
3352#define WM8994_AIF2DAC_3D_ENA_MASK 0x0100 /* AIF2DAC_3D_ENA */
3353#define WM8994_AIF2DAC_3D_ENA_SHIFT 8 /* AIF2DAC_3D_ENA */
3354#define WM8994_AIF2DAC_3D_ENA_WIDTH 1 /* AIF2DAC_3D_ENA */
3355
3356/*
3357 * R1344 (0x540) - AIF2 DRC (1)
3358 */
3359#define WM8994_AIF2DRC_SIG_DET_RMS_MASK 0xF800 /* AIF2DRC_SIG_DET_RMS - [15:11] */
3360#define WM8994_AIF2DRC_SIG_DET_RMS_SHIFT 11 /* AIF2DRC_SIG_DET_RMS - [15:11] */
3361#define WM8994_AIF2DRC_SIG_DET_RMS_WIDTH 5 /* AIF2DRC_SIG_DET_RMS - [15:11] */
3362#define WM8994_AIF2DRC_SIG_DET_PK_MASK 0x0600 /* AIF2DRC_SIG_DET_PK - [10:9] */
3363#define WM8994_AIF2DRC_SIG_DET_PK_SHIFT 9 /* AIF2DRC_SIG_DET_PK - [10:9] */
3364#define WM8994_AIF2DRC_SIG_DET_PK_WIDTH 2 /* AIF2DRC_SIG_DET_PK - [10:9] */
3365#define WM8994_AIF2DRC_NG_ENA 0x0100 /* AIF2DRC_NG_ENA */
3366#define WM8994_AIF2DRC_NG_ENA_MASK 0x0100 /* AIF2DRC_NG_ENA */
3367#define WM8994_AIF2DRC_NG_ENA_SHIFT 8 /* AIF2DRC_NG_ENA */
3368#define WM8994_AIF2DRC_NG_ENA_WIDTH 1 /* AIF2DRC_NG_ENA */
3369#define WM8994_AIF2DRC_SIG_DET_MODE 0x0080 /* AIF2DRC_SIG_DET_MODE */
3370#define WM8994_AIF2DRC_SIG_DET_MODE_MASK 0x0080 /* AIF2DRC_SIG_DET_MODE */
3371#define WM8994_AIF2DRC_SIG_DET_MODE_SHIFT 7 /* AIF2DRC_SIG_DET_MODE */
3372#define WM8994_AIF2DRC_SIG_DET_MODE_WIDTH 1 /* AIF2DRC_SIG_DET_MODE */
3373#define WM8994_AIF2DRC_SIG_DET 0x0040 /* AIF2DRC_SIG_DET */
3374#define WM8994_AIF2DRC_SIG_DET_MASK 0x0040 /* AIF2DRC_SIG_DET */
3375#define WM8994_AIF2DRC_SIG_DET_SHIFT 6 /* AIF2DRC_SIG_DET */
3376#define WM8994_AIF2DRC_SIG_DET_WIDTH 1 /* AIF2DRC_SIG_DET */
3377#define WM8994_AIF2DRC_KNEE2_OP_ENA 0x0020 /* AIF2DRC_KNEE2_OP_ENA */
3378#define WM8994_AIF2DRC_KNEE2_OP_ENA_MASK 0x0020 /* AIF2DRC_KNEE2_OP_ENA */
3379#define WM8994_AIF2DRC_KNEE2_OP_ENA_SHIFT 5 /* AIF2DRC_KNEE2_OP_ENA */
3380#define WM8994_AIF2DRC_KNEE2_OP_ENA_WIDTH 1 /* AIF2DRC_KNEE2_OP_ENA */
3381#define WM8994_AIF2DRC_QR 0x0010 /* AIF2DRC_QR */
3382#define WM8994_AIF2DRC_QR_MASK 0x0010 /* AIF2DRC_QR */
3383#define WM8994_AIF2DRC_QR_SHIFT 4 /* AIF2DRC_QR */
3384#define WM8994_AIF2DRC_QR_WIDTH 1 /* AIF2DRC_QR */
3385#define WM8994_AIF2DRC_ANTICLIP 0x0008 /* AIF2DRC_ANTICLIP */
3386#define WM8994_AIF2DRC_ANTICLIP_MASK 0x0008 /* AIF2DRC_ANTICLIP */
3387#define WM8994_AIF2DRC_ANTICLIP_SHIFT 3 /* AIF2DRC_ANTICLIP */
3388#define WM8994_AIF2DRC_ANTICLIP_WIDTH 1 /* AIF2DRC_ANTICLIP */
3389#define WM8994_AIF2DAC_DRC_ENA 0x0004 /* AIF2DAC_DRC_ENA */
3390#define WM8994_AIF2DAC_DRC_ENA_MASK 0x0004 /* AIF2DAC_DRC_ENA */
3391#define WM8994_AIF2DAC_DRC_ENA_SHIFT 2 /* AIF2DAC_DRC_ENA */
3392#define WM8994_AIF2DAC_DRC_ENA_WIDTH 1 /* AIF2DAC_DRC_ENA */
3393#define WM8994_AIF2ADCL_DRC_ENA 0x0002 /* AIF2ADCL_DRC_ENA */
3394#define WM8994_AIF2ADCL_DRC_ENA_MASK 0x0002 /* AIF2ADCL_DRC_ENA */
3395#define WM8994_AIF2ADCL_DRC_ENA_SHIFT 1 /* AIF2ADCL_DRC_ENA */
3396#define WM8994_AIF2ADCL_DRC_ENA_WIDTH 1 /* AIF2ADCL_DRC_ENA */
3397#define WM8994_AIF2ADCR_DRC_ENA 0x0001 /* AIF2ADCR_DRC_ENA */
3398#define WM8994_AIF2ADCR_DRC_ENA_MASK 0x0001 /* AIF2ADCR_DRC_ENA */
3399#define WM8994_AIF2ADCR_DRC_ENA_SHIFT 0 /* AIF2ADCR_DRC_ENA */
3400#define WM8994_AIF2ADCR_DRC_ENA_WIDTH 1 /* AIF2ADCR_DRC_ENA */
3401
3402/*
3403 * R1345 (0x541) - AIF2 DRC (2)
3404 */
3405#define WM8994_AIF2DRC_ATK_MASK 0x1E00 /* AIF2DRC_ATK - [12:9] */
3406#define WM8994_AIF2DRC_ATK_SHIFT 9 /* AIF2DRC_ATK - [12:9] */
3407#define WM8994_AIF2DRC_ATK_WIDTH 4 /* AIF2DRC_ATK - [12:9] */
3408#define WM8994_AIF2DRC_DCY_MASK 0x01E0 /* AIF2DRC_DCY - [8:5] */
3409#define WM8994_AIF2DRC_DCY_SHIFT 5 /* AIF2DRC_DCY - [8:5] */
3410#define WM8994_AIF2DRC_DCY_WIDTH 4 /* AIF2DRC_DCY - [8:5] */
3411#define WM8994_AIF2DRC_MINGAIN_MASK 0x001C /* AIF2DRC_MINGAIN - [4:2] */
3412#define WM8994_AIF2DRC_MINGAIN_SHIFT 2 /* AIF2DRC_MINGAIN - [4:2] */
3413#define WM8994_AIF2DRC_MINGAIN_WIDTH 3 /* AIF2DRC_MINGAIN - [4:2] */
3414#define WM8994_AIF2DRC_MAXGAIN_MASK 0x0003 /* AIF2DRC_MAXGAIN - [1:0] */
3415#define WM8994_AIF2DRC_MAXGAIN_SHIFT 0 /* AIF2DRC_MAXGAIN - [1:0] */
3416#define WM8994_AIF2DRC_MAXGAIN_WIDTH 2 /* AIF2DRC_MAXGAIN - [1:0] */
3417
3418/*
3419 * R1346 (0x542) - AIF2 DRC (3)
3420 */
3421#define WM8994_AIF2DRC_NG_MINGAIN_MASK 0xF000 /* AIF2DRC_NG_MINGAIN - [15:12] */
3422#define WM8994_AIF2DRC_NG_MINGAIN_SHIFT 12 /* AIF2DRC_NG_MINGAIN - [15:12] */
3423#define WM8994_AIF2DRC_NG_MINGAIN_WIDTH 4 /* AIF2DRC_NG_MINGAIN - [15:12] */
3424#define WM8994_AIF2DRC_NG_EXP_MASK 0x0C00 /* AIF2DRC_NG_EXP - [11:10] */
3425#define WM8994_AIF2DRC_NG_EXP_SHIFT 10 /* AIF2DRC_NG_EXP - [11:10] */
3426#define WM8994_AIF2DRC_NG_EXP_WIDTH 2 /* AIF2DRC_NG_EXP - [11:10] */
3427#define WM8994_AIF2DRC_QR_THR_MASK 0x0300 /* AIF2DRC_QR_THR - [9:8] */
3428#define WM8994_AIF2DRC_QR_THR_SHIFT 8 /* AIF2DRC_QR_THR - [9:8] */
3429#define WM8994_AIF2DRC_QR_THR_WIDTH 2 /* AIF2DRC_QR_THR - [9:8] */
3430#define WM8994_AIF2DRC_QR_DCY_MASK 0x00C0 /* AIF2DRC_QR_DCY - [7:6] */
3431#define WM8994_AIF2DRC_QR_DCY_SHIFT 6 /* AIF2DRC_QR_DCY - [7:6] */
3432#define WM8994_AIF2DRC_QR_DCY_WIDTH 2 /* AIF2DRC_QR_DCY - [7:6] */
3433#define WM8994_AIF2DRC_HI_COMP_MASK 0x0038 /* AIF2DRC_HI_COMP - [5:3] */
3434#define WM8994_AIF2DRC_HI_COMP_SHIFT 3 /* AIF2DRC_HI_COMP - [5:3] */
3435#define WM8994_AIF2DRC_HI_COMP_WIDTH 3 /* AIF2DRC_HI_COMP - [5:3] */
3436#define WM8994_AIF2DRC_LO_COMP_MASK 0x0007 /* AIF2DRC_LO_COMP - [2:0] */
3437#define WM8994_AIF2DRC_LO_COMP_SHIFT 0 /* AIF2DRC_LO_COMP - [2:0] */
3438#define WM8994_AIF2DRC_LO_COMP_WIDTH 3 /* AIF2DRC_LO_COMP - [2:0] */
3439
3440/*
3441 * R1347 (0x543) - AIF2 DRC (4)
3442 */
3443#define WM8994_AIF2DRC_KNEE_IP_MASK 0x07E0 /* AIF2DRC_KNEE_IP - [10:5] */
3444#define WM8994_AIF2DRC_KNEE_IP_SHIFT 5 /* AIF2DRC_KNEE_IP - [10:5] */
3445#define WM8994_AIF2DRC_KNEE_IP_WIDTH 6 /* AIF2DRC_KNEE_IP - [10:5] */
3446#define WM8994_AIF2DRC_KNEE_OP_MASK 0x001F /* AIF2DRC_KNEE_OP - [4:0] */
3447#define WM8994_AIF2DRC_KNEE_OP_SHIFT 0 /* AIF2DRC_KNEE_OP - [4:0] */
3448#define WM8994_AIF2DRC_KNEE_OP_WIDTH 5 /* AIF2DRC_KNEE_OP - [4:0] */
3449
3450/*
3451 * R1348 (0x544) - AIF2 DRC (5)
3452 */
3453#define WM8994_AIF2DRC_KNEE2_IP_MASK 0x03E0 /* AIF2DRC_KNEE2_IP - [9:5] */
3454#define WM8994_AIF2DRC_KNEE2_IP_SHIFT 5 /* AIF2DRC_KNEE2_IP - [9:5] */
3455#define WM8994_AIF2DRC_KNEE2_IP_WIDTH 5 /* AIF2DRC_KNEE2_IP - [9:5] */
3456#define WM8994_AIF2DRC_KNEE2_OP_MASK 0x001F /* AIF2DRC_KNEE2_OP - [4:0] */
3457#define WM8994_AIF2DRC_KNEE2_OP_SHIFT 0 /* AIF2DRC_KNEE2_OP - [4:0] */
3458#define WM8994_AIF2DRC_KNEE2_OP_WIDTH 5 /* AIF2DRC_KNEE2_OP - [4:0] */
3459
3460/*
3461 * R1408 (0x580) - AIF2 EQ Gains (1)
3462 */
3463#define WM8994_AIF2DAC_EQ_B1_GAIN_MASK 0xF800 /* AIF2DAC_EQ_B1_GAIN - [15:11] */
3464#define WM8994_AIF2DAC_EQ_B1_GAIN_SHIFT 11 /* AIF2DAC_EQ_B1_GAIN - [15:11] */
3465#define WM8994_AIF2DAC_EQ_B1_GAIN_WIDTH 5 /* AIF2DAC_EQ_B1_GAIN - [15:11] */
3466#define WM8994_AIF2DAC_EQ_B2_GAIN_MASK 0x07C0 /* AIF2DAC_EQ_B2_GAIN - [10:6] */
3467#define WM8994_AIF2DAC_EQ_B2_GAIN_SHIFT 6 /* AIF2DAC_EQ_B2_GAIN - [10:6] */
3468#define WM8994_AIF2DAC_EQ_B2_GAIN_WIDTH 5 /* AIF2DAC_EQ_B2_GAIN - [10:6] */
3469#define WM8994_AIF2DAC_EQ_B3_GAIN_MASK 0x003E /* AIF2DAC_EQ_B3_GAIN - [5:1] */
3470#define WM8994_AIF2DAC_EQ_B3_GAIN_SHIFT 1 /* AIF2DAC_EQ_B3_GAIN - [5:1] */
3471#define WM8994_AIF2DAC_EQ_B3_GAIN_WIDTH 5 /* AIF2DAC_EQ_B3_GAIN - [5:1] */
3472#define WM8994_AIF2DAC_EQ_ENA 0x0001 /* AIF2DAC_EQ_ENA */
3473#define WM8994_AIF2DAC_EQ_ENA_MASK 0x0001 /* AIF2DAC_EQ_ENA */
3474#define WM8994_AIF2DAC_EQ_ENA_SHIFT 0 /* AIF2DAC_EQ_ENA */
3475#define WM8994_AIF2DAC_EQ_ENA_WIDTH 1 /* AIF2DAC_EQ_ENA */
3476
3477/*
3478 * R1409 (0x581) - AIF2 EQ Gains (2)
3479 */
3480#define WM8994_AIF2DAC_EQ_B4_GAIN_MASK 0xF800 /* AIF2DAC_EQ_B4_GAIN - [15:11] */
3481#define WM8994_AIF2DAC_EQ_B4_GAIN_SHIFT 11 /* AIF2DAC_EQ_B4_GAIN - [15:11] */
3482#define WM8994_AIF2DAC_EQ_B4_GAIN_WIDTH 5 /* AIF2DAC_EQ_B4_GAIN - [15:11] */
3483#define WM8994_AIF2DAC_EQ_B5_GAIN_MASK 0x07C0 /* AIF2DAC_EQ_B5_GAIN - [10:6] */
3484#define WM8994_AIF2DAC_EQ_B5_GAIN_SHIFT 6 /* AIF2DAC_EQ_B5_GAIN - [10:6] */
3485#define WM8994_AIF2DAC_EQ_B5_GAIN_WIDTH 5 /* AIF2DAC_EQ_B5_GAIN - [10:6] */
3486
3487/*
3488 * R1410 (0x582) - AIF2 EQ Band 1 A
3489 */
3490#define WM8994_AIF2DAC_EQ_B1_A_MASK 0xFFFF /* AIF2DAC_EQ_B1_A - [15:0] */
3491#define WM8994_AIF2DAC_EQ_B1_A_SHIFT 0 /* AIF2DAC_EQ_B1_A - [15:0] */
3492#define WM8994_AIF2DAC_EQ_B1_A_WIDTH 16 /* AIF2DAC_EQ_B1_A - [15:0] */
3493
3494/*
3495 * R1411 (0x583) - AIF2 EQ Band 1 B
3496 */
3497#define WM8994_AIF2DAC_EQ_B1_B_MASK 0xFFFF /* AIF2DAC_EQ_B1_B - [15:0] */
3498#define WM8994_AIF2DAC_EQ_B1_B_SHIFT 0 /* AIF2DAC_EQ_B1_B - [15:0] */
3499#define WM8994_AIF2DAC_EQ_B1_B_WIDTH 16 /* AIF2DAC_EQ_B1_B - [15:0] */
3500
3501/*
3502 * R1412 (0x584) - AIF2 EQ Band 1 PG
3503 */
3504#define WM8994_AIF2DAC_EQ_B1_PG_MASK 0xFFFF /* AIF2DAC_EQ_B1_PG - [15:0] */
3505#define WM8994_AIF2DAC_EQ_B1_PG_SHIFT 0 /* AIF2DAC_EQ_B1_PG - [15:0] */
3506#define WM8994_AIF2DAC_EQ_B1_PG_WIDTH 16 /* AIF2DAC_EQ_B1_PG - [15:0] */
3507
3508/*
3509 * R1413 (0x585) - AIF2 EQ Band 2 A
3510 */
3511#define WM8994_AIF2DAC_EQ_B2_A_MASK 0xFFFF /* AIF2DAC_EQ_B2_A - [15:0] */
3512#define WM8994_AIF2DAC_EQ_B2_A_SHIFT 0 /* AIF2DAC_EQ_B2_A - [15:0] */
3513#define WM8994_AIF2DAC_EQ_B2_A_WIDTH 16 /* AIF2DAC_EQ_B2_A - [15:0] */
3514
3515/*
3516 * R1414 (0x586) - AIF2 EQ Band 2 B
3517 */
3518#define WM8994_AIF2DAC_EQ_B2_B_MASK 0xFFFF /* AIF2DAC_EQ_B2_B - [15:0] */
3519#define WM8994_AIF2DAC_EQ_B2_B_SHIFT 0 /* AIF2DAC_EQ_B2_B - [15:0] */
3520#define WM8994_AIF2DAC_EQ_B2_B_WIDTH 16 /* AIF2DAC_EQ_B2_B - [15:0] */
3521
3522/*
3523 * R1415 (0x587) - AIF2 EQ Band 2 C
3524 */
3525#define WM8994_AIF2DAC_EQ_B2_C_MASK 0xFFFF /* AIF2DAC_EQ_B2_C - [15:0] */
3526#define WM8994_AIF2DAC_EQ_B2_C_SHIFT 0 /* AIF2DAC_EQ_B2_C - [15:0] */
3527#define WM8994_AIF2DAC_EQ_B2_C_WIDTH 16 /* AIF2DAC_EQ_B2_C - [15:0] */
3528
3529/*
3530 * R1416 (0x588) - AIF2 EQ Band 2 PG
3531 */
3532#define WM8994_AIF2DAC_EQ_B2_PG_MASK 0xFFFF /* AIF2DAC_EQ_B2_PG - [15:0] */
3533#define WM8994_AIF2DAC_EQ_B2_PG_SHIFT 0 /* AIF2DAC_EQ_B2_PG - [15:0] */
3534#define WM8994_AIF2DAC_EQ_B2_PG_WIDTH 16 /* AIF2DAC_EQ_B2_PG - [15:0] */
3535
3536/*
3537 * R1417 (0x589) - AIF2 EQ Band 3 A
3538 */
3539#define WM8994_AIF2DAC_EQ_B3_A_MASK 0xFFFF /* AIF2DAC_EQ_B3_A - [15:0] */
3540#define WM8994_AIF2DAC_EQ_B3_A_SHIFT 0 /* AIF2DAC_EQ_B3_A - [15:0] */
3541#define WM8994_AIF2DAC_EQ_B3_A_WIDTH 16 /* AIF2DAC_EQ_B3_A - [15:0] */
3542
3543/*
3544 * R1418 (0x58A) - AIF2 EQ Band 3 B
3545 */
3546#define WM8994_AIF2DAC_EQ_B3_B_MASK 0xFFFF /* AIF2DAC_EQ_B3_B - [15:0] */
3547#define WM8994_AIF2DAC_EQ_B3_B_SHIFT 0 /* AIF2DAC_EQ_B3_B - [15:0] */
3548#define WM8994_AIF2DAC_EQ_B3_B_WIDTH 16 /* AIF2DAC_EQ_B3_B - [15:0] */
3549
3550/*
3551 * R1419 (0x58B) - AIF2 EQ Band 3 C
3552 */
3553#define WM8994_AIF2DAC_EQ_B3_C_MASK 0xFFFF /* AIF2DAC_EQ_B3_C - [15:0] */
3554#define WM8994_AIF2DAC_EQ_B3_C_SHIFT 0 /* AIF2DAC_EQ_B3_C - [15:0] */
3555#define WM8994_AIF2DAC_EQ_B3_C_WIDTH 16 /* AIF2DAC_EQ_B3_C - [15:0] */
3556
3557/*
3558 * R1420 (0x58C) - AIF2 EQ Band 3 PG
3559 */
3560#define WM8994_AIF2DAC_EQ_B3_PG_MASK 0xFFFF /* AIF2DAC_EQ_B3_PG - [15:0] */
3561#define WM8994_AIF2DAC_EQ_B3_PG_SHIFT 0 /* AIF2DAC_EQ_B3_PG - [15:0] */
3562#define WM8994_AIF2DAC_EQ_B3_PG_WIDTH 16 /* AIF2DAC_EQ_B3_PG - [15:0] */
3563
3564/*
3565 * R1421 (0x58D) - AIF2 EQ Band 4 A
3566 */
3567#define WM8994_AIF2DAC_EQ_B4_A_MASK 0xFFFF /* AIF2DAC_EQ_B4_A - [15:0] */
3568#define WM8994_AIF2DAC_EQ_B4_A_SHIFT 0 /* AIF2DAC_EQ_B4_A - [15:0] */
3569#define WM8994_AIF2DAC_EQ_B4_A_WIDTH 16 /* AIF2DAC_EQ_B4_A - [15:0] */
3570
3571/*
3572 * R1422 (0x58E) - AIF2 EQ Band 4 B
3573 */
3574#define WM8994_AIF2DAC_EQ_B4_B_MASK 0xFFFF /* AIF2DAC_EQ_B4_B - [15:0] */
3575#define WM8994_AIF2DAC_EQ_B4_B_SHIFT 0 /* AIF2DAC_EQ_B4_B - [15:0] */
3576#define WM8994_AIF2DAC_EQ_B4_B_WIDTH 16 /* AIF2DAC_EQ_B4_B - [15:0] */
3577
3578/*
3579 * R1423 (0x58F) - AIF2 EQ Band 4 C
3580 */
3581#define WM8994_AIF2DAC_EQ_B4_C_MASK 0xFFFF /* AIF2DAC_EQ_B4_C - [15:0] */
3582#define WM8994_AIF2DAC_EQ_B4_C_SHIFT 0 /* AIF2DAC_EQ_B4_C - [15:0] */
3583#define WM8994_AIF2DAC_EQ_B4_C_WIDTH 16 /* AIF2DAC_EQ_B4_C - [15:0] */
3584
3585/*
3586 * R1424 (0x590) - AIF2 EQ Band 4 PG
3587 */
3588#define WM8994_AIF2DAC_EQ_B4_PG_MASK 0xFFFF /* AIF2DAC_EQ_B4_PG - [15:0] */
3589#define WM8994_AIF2DAC_EQ_B4_PG_SHIFT 0 /* AIF2DAC_EQ_B4_PG - [15:0] */
3590#define WM8994_AIF2DAC_EQ_B4_PG_WIDTH 16 /* AIF2DAC_EQ_B4_PG - [15:0] */
3591
3592/*
3593 * R1425 (0x591) - AIF2 EQ Band 5 A
3594 */
3595#define WM8994_AIF2DAC_EQ_B5_A_MASK 0xFFFF /* AIF2DAC_EQ_B5_A - [15:0] */
3596#define WM8994_AIF2DAC_EQ_B5_A_SHIFT 0 /* AIF2DAC_EQ_B5_A - [15:0] */
3597#define WM8994_AIF2DAC_EQ_B5_A_WIDTH 16 /* AIF2DAC_EQ_B5_A - [15:0] */
3598
3599/*
3600 * R1426 (0x592) - AIF2 EQ Band 5 B
3601 */
3602#define WM8994_AIF2DAC_EQ_B5_B_MASK 0xFFFF /* AIF2DAC_EQ_B5_B - [15:0] */
3603#define WM8994_AIF2DAC_EQ_B5_B_SHIFT 0 /* AIF2DAC_EQ_B5_B - [15:0] */
3604#define WM8994_AIF2DAC_EQ_B5_B_WIDTH 16 /* AIF2DAC_EQ_B5_B - [15:0] */
3605
3606/*
3607 * R1427 (0x593) - AIF2 EQ Band 5 PG
3608 */
3609#define WM8994_AIF2DAC_EQ_B5_PG_MASK 0xFFFF /* AIF2DAC_EQ_B5_PG - [15:0] */
3610#define WM8994_AIF2DAC_EQ_B5_PG_SHIFT 0 /* AIF2DAC_EQ_B5_PG - [15:0] */
3611#define WM8994_AIF2DAC_EQ_B5_PG_WIDTH 16 /* AIF2DAC_EQ_B5_PG - [15:0] */
3612
3613/*
3614 * R1536 (0x600) - DAC1 Mixer Volumes
3615 */
3616#define WM8994_ADCR_DAC1_VOL_MASK 0x01E0 /* ADCR_DAC1_VOL - [8:5] */
3617#define WM8994_ADCR_DAC1_VOL_SHIFT 5 /* ADCR_DAC1_VOL - [8:5] */
3618#define WM8994_ADCR_DAC1_VOL_WIDTH 4 /* ADCR_DAC1_VOL - [8:5] */
3619#define WM8994_ADCL_DAC1_VOL_MASK 0x000F /* ADCL_DAC1_VOL - [3:0] */
3620#define WM8994_ADCL_DAC1_VOL_SHIFT 0 /* ADCL_DAC1_VOL - [3:0] */
3621#define WM8994_ADCL_DAC1_VOL_WIDTH 4 /* ADCL_DAC1_VOL - [3:0] */
3622
3623/*
3624 * R1537 (0x601) - DAC1 Left Mixer Routing
3625 */
3626#define WM8994_ADCR_TO_DAC1L 0x0020 /* ADCR_TO_DAC1L */
3627#define WM8994_ADCR_TO_DAC1L_MASK 0x0020 /* ADCR_TO_DAC1L */
3628#define WM8994_ADCR_TO_DAC1L_SHIFT 5 /* ADCR_TO_DAC1L */
3629#define WM8994_ADCR_TO_DAC1L_WIDTH 1 /* ADCR_TO_DAC1L */
3630#define WM8994_ADCL_TO_DAC1L 0x0010 /* ADCL_TO_DAC1L */
3631#define WM8994_ADCL_TO_DAC1L_MASK 0x0010 /* ADCL_TO_DAC1L */
3632#define WM8994_ADCL_TO_DAC1L_SHIFT 4 /* ADCL_TO_DAC1L */
3633#define WM8994_ADCL_TO_DAC1L_WIDTH 1 /* ADCL_TO_DAC1L */
3634#define WM8994_AIF2DACL_TO_DAC1L 0x0004 /* AIF2DACL_TO_DAC1L */
3635#define WM8994_AIF2DACL_TO_DAC1L_MASK 0x0004 /* AIF2DACL_TO_DAC1L */
3636#define WM8994_AIF2DACL_TO_DAC1L_SHIFT 2 /* AIF2DACL_TO_DAC1L */
3637#define WM8994_AIF2DACL_TO_DAC1L_WIDTH 1 /* AIF2DACL_TO_DAC1L */
3638#define WM8994_AIF1DAC2L_TO_DAC1L 0x0002 /* AIF1DAC2L_TO_DAC1L */
3639#define WM8994_AIF1DAC2L_TO_DAC1L_MASK 0x0002 /* AIF1DAC2L_TO_DAC1L */
3640#define WM8994_AIF1DAC2L_TO_DAC1L_SHIFT 1 /* AIF1DAC2L_TO_DAC1L */
3641#define WM8994_AIF1DAC2L_TO_DAC1L_WIDTH 1 /* AIF1DAC2L_TO_DAC1L */
3642#define WM8994_AIF1DAC1L_TO_DAC1L 0x0001 /* AIF1DAC1L_TO_DAC1L */
3643#define WM8994_AIF1DAC1L_TO_DAC1L_MASK 0x0001 /* AIF1DAC1L_TO_DAC1L */
3644#define WM8994_AIF1DAC1L_TO_DAC1L_SHIFT 0 /* AIF1DAC1L_TO_DAC1L */
3645#define WM8994_AIF1DAC1L_TO_DAC1L_WIDTH 1 /* AIF1DAC1L_TO_DAC1L */
3646
3647/*
3648 * R1538 (0x602) - DAC1 Right Mixer Routing
3649 */
3650#define WM8994_ADCR_TO_DAC1R 0x0020 /* ADCR_TO_DAC1R */
3651#define WM8994_ADCR_TO_DAC1R_MASK 0x0020 /* ADCR_TO_DAC1R */
3652#define WM8994_ADCR_TO_DAC1R_SHIFT 5 /* ADCR_TO_DAC1R */
3653#define WM8994_ADCR_TO_DAC1R_WIDTH 1 /* ADCR_TO_DAC1R */
3654#define WM8994_ADCL_TO_DAC1R 0x0010 /* ADCL_TO_DAC1R */
3655#define WM8994_ADCL_TO_DAC1R_MASK 0x0010 /* ADCL_TO_DAC1R */
3656#define WM8994_ADCL_TO_DAC1R_SHIFT 4 /* ADCL_TO_DAC1R */
3657#define WM8994_ADCL_TO_DAC1R_WIDTH 1 /* ADCL_TO_DAC1R */
3658#define WM8994_AIF2DACR_TO_DAC1R 0x0004 /* AIF2DACR_TO_DAC1R */
3659#define WM8994_AIF2DACR_TO_DAC1R_MASK 0x0004 /* AIF2DACR_TO_DAC1R */
3660#define WM8994_AIF2DACR_TO_DAC1R_SHIFT 2 /* AIF2DACR_TO_DAC1R */
3661#define WM8994_AIF2DACR_TO_DAC1R_WIDTH 1 /* AIF2DACR_TO_DAC1R */
3662#define WM8994_AIF1DAC2R_TO_DAC1R 0x0002 /* AIF1DAC2R_TO_DAC1R */
3663#define WM8994_AIF1DAC2R_TO_DAC1R_MASK 0x0002 /* AIF1DAC2R_TO_DAC1R */
3664#define WM8994_AIF1DAC2R_TO_DAC1R_SHIFT 1 /* AIF1DAC2R_TO_DAC1R */
3665#define WM8994_AIF1DAC2R_TO_DAC1R_WIDTH 1 /* AIF1DAC2R_TO_DAC1R */
3666#define WM8994_AIF1DAC1R_TO_DAC1R 0x0001 /* AIF1DAC1R_TO_DAC1R */
3667#define WM8994_AIF1DAC1R_TO_DAC1R_MASK 0x0001 /* AIF1DAC1R_TO_DAC1R */
3668#define WM8994_AIF1DAC1R_TO_DAC1R_SHIFT 0 /* AIF1DAC1R_TO_DAC1R */
3669#define WM8994_AIF1DAC1R_TO_DAC1R_WIDTH 1 /* AIF1DAC1R_TO_DAC1R */
3670
3671/*
3672 * R1539 (0x603) - DAC2 Mixer Volumes
3673 */
3674#define WM8994_ADCR_DAC2_VOL_MASK 0x01E0 /* ADCR_DAC2_VOL - [8:5] */
3675#define WM8994_ADCR_DAC2_VOL_SHIFT 5 /* ADCR_DAC2_VOL - [8:5] */
3676#define WM8994_ADCR_DAC2_VOL_WIDTH 4 /* ADCR_DAC2_VOL - [8:5] */
3677#define WM8994_ADCL_DAC2_VOL_MASK 0x000F /* ADCL_DAC2_VOL - [3:0] */
3678#define WM8994_ADCL_DAC2_VOL_SHIFT 0 /* ADCL_DAC2_VOL - [3:0] */
3679#define WM8994_ADCL_DAC2_VOL_WIDTH 4 /* ADCL_DAC2_VOL - [3:0] */
3680
3681/*
3682 * R1540 (0x604) - DAC2 Left Mixer Routing
3683 */
3684#define WM8994_ADCR_TO_DAC2L 0x0020 /* ADCR_TO_DAC2L */
3685#define WM8994_ADCR_TO_DAC2L_MASK 0x0020 /* ADCR_TO_DAC2L */
3686#define WM8994_ADCR_TO_DAC2L_SHIFT 5 /* ADCR_TO_DAC2L */
3687#define WM8994_ADCR_TO_DAC2L_WIDTH 1 /* ADCR_TO_DAC2L */
3688#define WM8994_ADCL_TO_DAC2L 0x0010 /* ADCL_TO_DAC2L */
3689#define WM8994_ADCL_TO_DAC2L_MASK 0x0010 /* ADCL_TO_DAC2L */
3690#define WM8994_ADCL_TO_DAC2L_SHIFT 4 /* ADCL_TO_DAC2L */
3691#define WM8994_ADCL_TO_DAC2L_WIDTH 1 /* ADCL_TO_DAC2L */
3692#define WM8994_AIF2DACL_TO_DAC2L 0x0004 /* AIF2DACL_TO_DAC2L */
3693#define WM8994_AIF2DACL_TO_DAC2L_MASK 0x0004 /* AIF2DACL_TO_DAC2L */
3694#define WM8994_AIF2DACL_TO_DAC2L_SHIFT 2 /* AIF2DACL_TO_DAC2L */
3695#define WM8994_AIF2DACL_TO_DAC2L_WIDTH 1 /* AIF2DACL_TO_DAC2L */
3696#define WM8994_AIF1DAC2L_TO_DAC2L 0x0002 /* AIF1DAC2L_TO_DAC2L */
3697#define WM8994_AIF1DAC2L_TO_DAC2L_MASK 0x0002 /* AIF1DAC2L_TO_DAC2L */
3698#define WM8994_AIF1DAC2L_TO_DAC2L_SHIFT 1 /* AIF1DAC2L_TO_DAC2L */
3699#define WM8994_AIF1DAC2L_TO_DAC2L_WIDTH 1 /* AIF1DAC2L_TO_DAC2L */
3700#define WM8994_AIF1DAC1L_TO_DAC2L 0x0001 /* AIF1DAC1L_TO_DAC2L */
3701#define WM8994_AIF1DAC1L_TO_DAC2L_MASK 0x0001 /* AIF1DAC1L_TO_DAC2L */
3702#define WM8994_AIF1DAC1L_TO_DAC2L_SHIFT 0 /* AIF1DAC1L_TO_DAC2L */
3703#define WM8994_AIF1DAC1L_TO_DAC2L_WIDTH 1 /* AIF1DAC1L_TO_DAC2L */
3704
3705/*
3706 * R1541 (0x605) - DAC2 Right Mixer Routing
3707 */
3708#define WM8994_ADCR_TO_DAC2R 0x0020 /* ADCR_TO_DAC2R */
3709#define WM8994_ADCR_TO_DAC2R_MASK 0x0020 /* ADCR_TO_DAC2R */
3710#define WM8994_ADCR_TO_DAC2R_SHIFT 5 /* ADCR_TO_DAC2R */
3711#define WM8994_ADCR_TO_DAC2R_WIDTH 1 /* ADCR_TO_DAC2R */
3712#define WM8994_ADCL_TO_DAC2R 0x0010 /* ADCL_TO_DAC2R */
3713#define WM8994_ADCL_TO_DAC2R_MASK 0x0010 /* ADCL_TO_DAC2R */
3714#define WM8994_ADCL_TO_DAC2R_SHIFT 4 /* ADCL_TO_DAC2R */
3715#define WM8994_ADCL_TO_DAC2R_WIDTH 1 /* ADCL_TO_DAC2R */
3716#define WM8994_AIF2DACR_TO_DAC2R 0x0004 /* AIF2DACR_TO_DAC2R */
3717#define WM8994_AIF2DACR_TO_DAC2R_MASK 0x0004 /* AIF2DACR_TO_DAC2R */
3718#define WM8994_AIF2DACR_TO_DAC2R_SHIFT 2 /* AIF2DACR_TO_DAC2R */
3719#define WM8994_AIF2DACR_TO_DAC2R_WIDTH 1 /* AIF2DACR_TO_DAC2R */
3720#define WM8994_AIF1DAC2R_TO_DAC2R 0x0002 /* AIF1DAC2R_TO_DAC2R */
3721#define WM8994_AIF1DAC2R_TO_DAC2R_MASK 0x0002 /* AIF1DAC2R_TO_DAC2R */
3722#define WM8994_AIF1DAC2R_TO_DAC2R_SHIFT 1 /* AIF1DAC2R_TO_DAC2R */
3723#define WM8994_AIF1DAC2R_TO_DAC2R_WIDTH 1 /* AIF1DAC2R_TO_DAC2R */
3724#define WM8994_AIF1DAC1R_TO_DAC2R 0x0001 /* AIF1DAC1R_TO_DAC2R */
3725#define WM8994_AIF1DAC1R_TO_DAC2R_MASK 0x0001 /* AIF1DAC1R_TO_DAC2R */
3726#define WM8994_AIF1DAC1R_TO_DAC2R_SHIFT 0 /* AIF1DAC1R_TO_DAC2R */
3727#define WM8994_AIF1DAC1R_TO_DAC2R_WIDTH 1 /* AIF1DAC1R_TO_DAC2R */
3728
3729/*
3730 * R1542 (0x606) - AIF1 ADC1 Left Mixer Routing
3731 */
3732#define WM8994_ADC1L_TO_AIF1ADC1L 0x0002 /* ADC1L_TO_AIF1ADC1L */
3733#define WM8994_ADC1L_TO_AIF1ADC1L_MASK 0x0002 /* ADC1L_TO_AIF1ADC1L */
3734#define WM8994_ADC1L_TO_AIF1ADC1L_SHIFT 1 /* ADC1L_TO_AIF1ADC1L */
3735#define WM8994_ADC1L_TO_AIF1ADC1L_WIDTH 1 /* ADC1L_TO_AIF1ADC1L */
3736#define WM8994_AIF2DACL_TO_AIF1ADC1L 0x0001 /* AIF2DACL_TO_AIF1ADC1L */
3737#define WM8994_AIF2DACL_TO_AIF1ADC1L_MASK 0x0001 /* AIF2DACL_TO_AIF1ADC1L */
3738#define WM8994_AIF2DACL_TO_AIF1ADC1L_SHIFT 0 /* AIF2DACL_TO_AIF1ADC1L */
3739#define WM8994_AIF2DACL_TO_AIF1ADC1L_WIDTH 1 /* AIF2DACL_TO_AIF1ADC1L */
3740
3741/*
3742 * R1543 (0x607) - AIF1 ADC1 Right Mixer Routing
3743 */
3744#define WM8994_ADC1R_TO_AIF1ADC1R 0x0002 /* ADC1R_TO_AIF1ADC1R */
3745#define WM8994_ADC1R_TO_AIF1ADC1R_MASK 0x0002 /* ADC1R_TO_AIF1ADC1R */
3746#define WM8994_ADC1R_TO_AIF1ADC1R_SHIFT 1 /* ADC1R_TO_AIF1ADC1R */
3747#define WM8994_ADC1R_TO_AIF1ADC1R_WIDTH 1 /* ADC1R_TO_AIF1ADC1R */
3748#define WM8994_AIF2DACR_TO_AIF1ADC1R 0x0001 /* AIF2DACR_TO_AIF1ADC1R */
3749#define WM8994_AIF2DACR_TO_AIF1ADC1R_MASK 0x0001 /* AIF2DACR_TO_AIF1ADC1R */
3750#define WM8994_AIF2DACR_TO_AIF1ADC1R_SHIFT 0 /* AIF2DACR_TO_AIF1ADC1R */
3751#define WM8994_AIF2DACR_TO_AIF1ADC1R_WIDTH 1 /* AIF2DACR_TO_AIF1ADC1R */
3752
3753/*
3754 * R1544 (0x608) - AIF1 ADC2 Left Mixer Routing
3755 */
3756#define WM8994_ADC2L_TO_AIF1ADC2L 0x0002 /* ADC2L_TO_AIF1ADC2L */
3757#define WM8994_ADC2L_TO_AIF1ADC2L_MASK 0x0002 /* ADC2L_TO_AIF1ADC2L */
3758#define WM8994_ADC2L_TO_AIF1ADC2L_SHIFT 1 /* ADC2L_TO_AIF1ADC2L */
3759#define WM8994_ADC2L_TO_AIF1ADC2L_WIDTH 1 /* ADC2L_TO_AIF1ADC2L */
3760#define WM8994_AIF2DACL_TO_AIF1ADC2L 0x0001 /* AIF2DACL_TO_AIF1ADC2L */
3761#define WM8994_AIF2DACL_TO_AIF1ADC2L_MASK 0x0001 /* AIF2DACL_TO_AIF1ADC2L */
3762#define WM8994_AIF2DACL_TO_AIF1ADC2L_SHIFT 0 /* AIF2DACL_TO_AIF1ADC2L */
3763#define WM8994_AIF2DACL_TO_AIF1ADC2L_WIDTH 1 /* AIF2DACL_TO_AIF1ADC2L */
3764
3765/*
3766 * R1545 (0x609) - AIF1 ADC2 Right mixer Routing
3767 */
3768#define WM8994_ADC2R_TO_AIF1ADC2R 0x0002 /* ADC2R_TO_AIF1ADC2R */
3769#define WM8994_ADC2R_TO_AIF1ADC2R_MASK 0x0002 /* ADC2R_TO_AIF1ADC2R */
3770#define WM8994_ADC2R_TO_AIF1ADC2R_SHIFT 1 /* ADC2R_TO_AIF1ADC2R */
3771#define WM8994_ADC2R_TO_AIF1ADC2R_WIDTH 1 /* ADC2R_TO_AIF1ADC2R */
3772#define WM8994_AIF2DACR_TO_AIF1ADC2R 0x0001 /* AIF2DACR_TO_AIF1ADC2R */
3773#define WM8994_AIF2DACR_TO_AIF1ADC2R_MASK 0x0001 /* AIF2DACR_TO_AIF1ADC2R */
3774#define WM8994_AIF2DACR_TO_AIF1ADC2R_SHIFT 0 /* AIF2DACR_TO_AIF1ADC2R */
3775#define WM8994_AIF2DACR_TO_AIF1ADC2R_WIDTH 1 /* AIF2DACR_TO_AIF1ADC2R */
3776
3777/*
3778 * R1552 (0x610) - DAC1 Left Volume
3779 */
3780#define WM8994_DAC1L_MUTE 0x0200 /* DAC1L_MUTE */
3781#define WM8994_DAC1L_MUTE_MASK 0x0200 /* DAC1L_MUTE */
3782#define WM8994_DAC1L_MUTE_SHIFT 9 /* DAC1L_MUTE */
3783#define WM8994_DAC1L_MUTE_WIDTH 1 /* DAC1L_MUTE */
3784#define WM8994_DAC1_VU 0x0100 /* DAC1_VU */
3785#define WM8994_DAC1_VU_MASK 0x0100 /* DAC1_VU */
3786#define WM8994_DAC1_VU_SHIFT 8 /* DAC1_VU */
3787#define WM8994_DAC1_VU_WIDTH 1 /* DAC1_VU */
3788#define WM8994_DAC1L_VOL_MASK 0x00FF /* DAC1L_VOL - [7:0] */
3789#define WM8994_DAC1L_VOL_SHIFT 0 /* DAC1L_VOL - [7:0] */
3790#define WM8994_DAC1L_VOL_WIDTH 8 /* DAC1L_VOL - [7:0] */
3791
3792/*
3793 * R1553 (0x611) - DAC1 Right Volume
3794 */
3795#define WM8994_DAC1R_MUTE 0x0200 /* DAC1R_MUTE */
3796#define WM8994_DAC1R_MUTE_MASK 0x0200 /* DAC1R_MUTE */
3797#define WM8994_DAC1R_MUTE_SHIFT 9 /* DAC1R_MUTE */
3798#define WM8994_DAC1R_MUTE_WIDTH 1 /* DAC1R_MUTE */
3799#define WM8994_DAC1_VU 0x0100 /* DAC1_VU */
3800#define WM8994_DAC1_VU_MASK 0x0100 /* DAC1_VU */
3801#define WM8994_DAC1_VU_SHIFT 8 /* DAC1_VU */
3802#define WM8994_DAC1_VU_WIDTH 1 /* DAC1_VU */
3803#define WM8994_DAC1R_VOL_MASK 0x00FF /* DAC1R_VOL - [7:0] */
3804#define WM8994_DAC1R_VOL_SHIFT 0 /* DAC1R_VOL - [7:0] */
3805#define WM8994_DAC1R_VOL_WIDTH 8 /* DAC1R_VOL - [7:0] */
3806
3807/*
3808 * R1554 (0x612) - DAC2 Left Volume
3809 */
3810#define WM8994_DAC2L_MUTE 0x0200 /* DAC2L_MUTE */
3811#define WM8994_DAC2L_MUTE_MASK 0x0200 /* DAC2L_MUTE */
3812#define WM8994_DAC2L_MUTE_SHIFT 9 /* DAC2L_MUTE */
3813#define WM8994_DAC2L_MUTE_WIDTH 1 /* DAC2L_MUTE */
3814#define WM8994_DAC2_VU 0x0100 /* DAC2_VU */
3815#define WM8994_DAC2_VU_MASK 0x0100 /* DAC2_VU */
3816#define WM8994_DAC2_VU_SHIFT 8 /* DAC2_VU */
3817#define WM8994_DAC2_VU_WIDTH 1 /* DAC2_VU */
3818#define WM8994_DAC2L_VOL_MASK 0x00FF /* DAC2L_VOL - [7:0] */
3819#define WM8994_DAC2L_VOL_SHIFT 0 /* DAC2L_VOL - [7:0] */
3820#define WM8994_DAC2L_VOL_WIDTH 8 /* DAC2L_VOL - [7:0] */
3821
3822/*
3823 * R1555 (0x613) - DAC2 Right Volume
3824 */
3825#define WM8994_DAC2R_MUTE 0x0200 /* DAC2R_MUTE */
3826#define WM8994_DAC2R_MUTE_MASK 0x0200 /* DAC2R_MUTE */
3827#define WM8994_DAC2R_MUTE_SHIFT 9 /* DAC2R_MUTE */
3828#define WM8994_DAC2R_MUTE_WIDTH 1 /* DAC2R_MUTE */
3829#define WM8994_DAC2_VU 0x0100 /* DAC2_VU */
3830#define WM8994_DAC2_VU_MASK 0x0100 /* DAC2_VU */
3831#define WM8994_DAC2_VU_SHIFT 8 /* DAC2_VU */
3832#define WM8994_DAC2_VU_WIDTH 1 /* DAC2_VU */
3833#define WM8994_DAC2R_VOL_MASK 0x00FF /* DAC2R_VOL - [7:0] */
3834#define WM8994_DAC2R_VOL_SHIFT 0 /* DAC2R_VOL - [7:0] */
3835#define WM8994_DAC2R_VOL_WIDTH 8 /* DAC2R_VOL - [7:0] */
3836
3837/*
3838 * R1556 (0x614) - DAC Softmute
3839 */
3840#define WM8994_DAC_SOFTMUTEMODE 0x0002 /* DAC_SOFTMUTEMODE */
3841#define WM8994_DAC_SOFTMUTEMODE_MASK 0x0002 /* DAC_SOFTMUTEMODE */
3842#define WM8994_DAC_SOFTMUTEMODE_SHIFT 1 /* DAC_SOFTMUTEMODE */
3843#define WM8994_DAC_SOFTMUTEMODE_WIDTH 1 /* DAC_SOFTMUTEMODE */
3844#define WM8994_DAC_MUTERATE 0x0001 /* DAC_MUTERATE */
3845#define WM8994_DAC_MUTERATE_MASK 0x0001 /* DAC_MUTERATE */
3846#define WM8994_DAC_MUTERATE_SHIFT 0 /* DAC_MUTERATE */
3847#define WM8994_DAC_MUTERATE_WIDTH 1 /* DAC_MUTERATE */
3848
3849/*
3850 * R1568 (0x620) - Oversampling
3851 */
3852#define WM8994_ADC_OSR128 0x0002 /* ADC_OSR128 */
3853#define WM8994_ADC_OSR128_MASK 0x0002 /* ADC_OSR128 */
3854#define WM8994_ADC_OSR128_SHIFT 1 /* ADC_OSR128 */
3855#define WM8994_ADC_OSR128_WIDTH 1 /* ADC_OSR128 */
3856#define WM8994_DAC_OSR128 0x0001 /* DAC_OSR128 */
3857#define WM8994_DAC_OSR128_MASK 0x0001 /* DAC_OSR128 */
3858#define WM8994_DAC_OSR128_SHIFT 0 /* DAC_OSR128 */
3859#define WM8994_DAC_OSR128_WIDTH 1 /* DAC_OSR128 */
3860
3861/*
3862 * R1569 (0x621) - Sidetone
3863 */
3864#define WM8994_ST_HPF_CUT_MASK 0x0380 /* ST_HPF_CUT - [9:7] */
3865#define WM8994_ST_HPF_CUT_SHIFT 7 /* ST_HPF_CUT - [9:7] */
3866#define WM8994_ST_HPF_CUT_WIDTH 3 /* ST_HPF_CUT - [9:7] */
3867#define WM8994_ST_HPF 0x0040 /* ST_HPF */
3868#define WM8994_ST_HPF_MASK 0x0040 /* ST_HPF */
3869#define WM8994_ST_HPF_SHIFT 6 /* ST_HPF */
3870#define WM8994_ST_HPF_WIDTH 1 /* ST_HPF */
3871#define WM8994_STR_SEL 0x0002 /* STR_SEL */
3872#define WM8994_STR_SEL_MASK 0x0002 /* STR_SEL */
3873#define WM8994_STR_SEL_SHIFT 1 /* STR_SEL */
3874#define WM8994_STR_SEL_WIDTH 1 /* STR_SEL */
3875#define WM8994_STL_SEL 0x0001 /* STL_SEL */
3876#define WM8994_STL_SEL_MASK 0x0001 /* STL_SEL */
3877#define WM8994_STL_SEL_SHIFT 0 /* STL_SEL */
3878#define WM8994_STL_SEL_WIDTH 1 /* STL_SEL */
3879
3880/*
3881 * R1824 (0x720) - Pull Control (1)
3882 */
3883#define WM8994_DMICDAT2_PU 0x0800 /* DMICDAT2_PU */
3884#define WM8994_DMICDAT2_PU_MASK 0x0800 /* DMICDAT2_PU */
3885#define WM8994_DMICDAT2_PU_SHIFT 11 /* DMICDAT2_PU */
3886#define WM8994_DMICDAT2_PU_WIDTH 1 /* DMICDAT2_PU */
3887#define WM8994_DMICDAT2_PD 0x0400 /* DMICDAT2_PD */
3888#define WM8994_DMICDAT2_PD_MASK 0x0400 /* DMICDAT2_PD */
3889#define WM8994_DMICDAT2_PD_SHIFT 10 /* DMICDAT2_PD */
3890#define WM8994_DMICDAT2_PD_WIDTH 1 /* DMICDAT2_PD */
3891#define WM8994_DMICDAT1_PU 0x0200 /* DMICDAT1_PU */
3892#define WM8994_DMICDAT1_PU_MASK 0x0200 /* DMICDAT1_PU */
3893#define WM8994_DMICDAT1_PU_SHIFT 9 /* DMICDAT1_PU */
3894#define WM8994_DMICDAT1_PU_WIDTH 1 /* DMICDAT1_PU */
3895#define WM8994_DMICDAT1_PD 0x0100 /* DMICDAT1_PD */
3896#define WM8994_DMICDAT1_PD_MASK 0x0100 /* DMICDAT1_PD */
3897#define WM8994_DMICDAT1_PD_SHIFT 8 /* DMICDAT1_PD */
3898#define WM8994_DMICDAT1_PD_WIDTH 1 /* DMICDAT1_PD */
3899#define WM8994_MCLK1_PU 0x0080 /* MCLK1_PU */
3900#define WM8994_MCLK1_PU_MASK 0x0080 /* MCLK1_PU */
3901#define WM8994_MCLK1_PU_SHIFT 7 /* MCLK1_PU */
3902#define WM8994_MCLK1_PU_WIDTH 1 /* MCLK1_PU */
3903#define WM8994_MCLK1_PD 0x0040 /* MCLK1_PD */
3904#define WM8994_MCLK1_PD_MASK 0x0040 /* MCLK1_PD */
3905#define WM8994_MCLK1_PD_SHIFT 6 /* MCLK1_PD */
3906#define WM8994_MCLK1_PD_WIDTH 1 /* MCLK1_PD */
3907#define WM8994_DACDAT1_PU 0x0020 /* DACDAT1_PU */
3908#define WM8994_DACDAT1_PU_MASK 0x0020 /* DACDAT1_PU */
3909#define WM8994_DACDAT1_PU_SHIFT 5 /* DACDAT1_PU */
3910#define WM8994_DACDAT1_PU_WIDTH 1 /* DACDAT1_PU */
3911#define WM8994_DACDAT1_PD 0x0010 /* DACDAT1_PD */
3912#define WM8994_DACDAT1_PD_MASK 0x0010 /* DACDAT1_PD */
3913#define WM8994_DACDAT1_PD_SHIFT 4 /* DACDAT1_PD */
3914#define WM8994_DACDAT1_PD_WIDTH 1 /* DACDAT1_PD */
3915#define WM8994_DACLRCLK1_PU 0x0008 /* DACLRCLK1_PU */
3916#define WM8994_DACLRCLK1_PU_MASK 0x0008 /* DACLRCLK1_PU */
3917#define WM8994_DACLRCLK1_PU_SHIFT 3 /* DACLRCLK1_PU */
3918#define WM8994_DACLRCLK1_PU_WIDTH 1 /* DACLRCLK1_PU */
3919#define WM8994_DACLRCLK1_PD 0x0004 /* DACLRCLK1_PD */
3920#define WM8994_DACLRCLK1_PD_MASK 0x0004 /* DACLRCLK1_PD */
3921#define WM8994_DACLRCLK1_PD_SHIFT 2 /* DACLRCLK1_PD */
3922#define WM8994_DACLRCLK1_PD_WIDTH 1 /* DACLRCLK1_PD */
3923#define WM8994_BCLK1_PU 0x0002 /* BCLK1_PU */
3924#define WM8994_BCLK1_PU_MASK 0x0002 /* BCLK1_PU */
3925#define WM8994_BCLK1_PU_SHIFT 1 /* BCLK1_PU */
3926#define WM8994_BCLK1_PU_WIDTH 1 /* BCLK1_PU */
3927#define WM8994_BCLK1_PD 0x0001 /* BCLK1_PD */
3928#define WM8994_BCLK1_PD_MASK 0x0001 /* BCLK1_PD */
3929#define WM8994_BCLK1_PD_SHIFT 0 /* BCLK1_PD */
3930#define WM8994_BCLK1_PD_WIDTH 1 /* BCLK1_PD */
3931
3932/*
3933 * R1825 (0x721) - Pull Control (2)
3934 */
3935#define WM8994_CSNADDR_PD 0x0100 /* CSNADDR_PD */
3936#define WM8994_CSNADDR_PD_MASK 0x0100 /* CSNADDR_PD */
3937#define WM8994_CSNADDR_PD_SHIFT 8 /* CSNADDR_PD */
3938#define WM8994_CSNADDR_PD_WIDTH 1 /* CSNADDR_PD */
3939#define WM8994_LDO2ENA_PD 0x0040 /* LDO2ENA_PD */
3940#define WM8994_LDO2ENA_PD_MASK 0x0040 /* LDO2ENA_PD */
3941#define WM8994_LDO2ENA_PD_SHIFT 6 /* LDO2ENA_PD */
3942#define WM8994_LDO2ENA_PD_WIDTH 1 /* LDO2ENA_PD */
3943#define WM8994_LDO1ENA_PD 0x0010 /* LDO1ENA_PD */
3944#define WM8994_LDO1ENA_PD_MASK 0x0010 /* LDO1ENA_PD */
3945#define WM8994_LDO1ENA_PD_SHIFT 4 /* LDO1ENA_PD */
3946#define WM8994_LDO1ENA_PD_WIDTH 1 /* LDO1ENA_PD */
3947#define WM8994_CIFMODE_PD 0x0004 /* CIFMODE_PD */
3948#define WM8994_CIFMODE_PD_MASK 0x0004 /* CIFMODE_PD */
3949#define WM8994_CIFMODE_PD_SHIFT 2 /* CIFMODE_PD */
3950#define WM8994_CIFMODE_PD_WIDTH 1 /* CIFMODE_PD */
3951#define WM8994_SPKMODE_PU 0x0002 /* SPKMODE_PU */
3952#define WM8994_SPKMODE_PU_MASK 0x0002 /* SPKMODE_PU */
3953#define WM8994_SPKMODE_PU_SHIFT 1 /* SPKMODE_PU */
3954#define WM8994_SPKMODE_PU_WIDTH 1 /* SPKMODE_PU */
3955
3956/*
3957 * R1840 (0x730) - Interrupt Status 1
3958 */
3959#define WM8994_GP11_EINT 0x0400 /* GP11_EINT */
3960#define WM8994_GP11_EINT_MASK 0x0400 /* GP11_EINT */
3961#define WM8994_GP11_EINT_SHIFT 10 /* GP11_EINT */
3962#define WM8994_GP11_EINT_WIDTH 1 /* GP11_EINT */
3963#define WM8994_GP10_EINT 0x0200 /* GP10_EINT */
3964#define WM8994_GP10_EINT_MASK 0x0200 /* GP10_EINT */
3965#define WM8994_GP10_EINT_SHIFT 9 /* GP10_EINT */
3966#define WM8994_GP10_EINT_WIDTH 1 /* GP10_EINT */
3967#define WM8994_GP9_EINT 0x0100 /* GP9_EINT */
3968#define WM8994_GP9_EINT_MASK 0x0100 /* GP9_EINT */
3969#define WM8994_GP9_EINT_SHIFT 8 /* GP9_EINT */
3970#define WM8994_GP9_EINT_WIDTH 1 /* GP9_EINT */
3971#define WM8994_GP8_EINT 0x0080 /* GP8_EINT */
3972#define WM8994_GP8_EINT_MASK 0x0080 /* GP8_EINT */
3973#define WM8994_GP8_EINT_SHIFT 7 /* GP8_EINT */
3974#define WM8994_GP8_EINT_WIDTH 1 /* GP8_EINT */
3975#define WM8994_GP7_EINT 0x0040 /* GP7_EINT */
3976#define WM8994_GP7_EINT_MASK 0x0040 /* GP7_EINT */
3977#define WM8994_GP7_EINT_SHIFT 6 /* GP7_EINT */
3978#define WM8994_GP7_EINT_WIDTH 1 /* GP7_EINT */
3979#define WM8994_GP6_EINT 0x0020 /* GP6_EINT */
3980#define WM8994_GP6_EINT_MASK 0x0020 /* GP6_EINT */
3981#define WM8994_GP6_EINT_SHIFT 5 /* GP6_EINT */
3982#define WM8994_GP6_EINT_WIDTH 1 /* GP6_EINT */
3983#define WM8994_GP5_EINT 0x0010 /* GP5_EINT */
3984#define WM8994_GP5_EINT_MASK 0x0010 /* GP5_EINT */
3985#define WM8994_GP5_EINT_SHIFT 4 /* GP5_EINT */
3986#define WM8994_GP5_EINT_WIDTH 1 /* GP5_EINT */
3987#define WM8994_GP4_EINT 0x0008 /* GP4_EINT */
3988#define WM8994_GP4_EINT_MASK 0x0008 /* GP4_EINT */
3989#define WM8994_GP4_EINT_SHIFT 3 /* GP4_EINT */
3990#define WM8994_GP4_EINT_WIDTH 1 /* GP4_EINT */
3991#define WM8994_GP3_EINT 0x0004 /* GP3_EINT */
3992#define WM8994_GP3_EINT_MASK 0x0004 /* GP3_EINT */
3993#define WM8994_GP3_EINT_SHIFT 2 /* GP3_EINT */
3994#define WM8994_GP3_EINT_WIDTH 1 /* GP3_EINT */
3995#define WM8994_GP2_EINT 0x0002 /* GP2_EINT */
3996#define WM8994_GP2_EINT_MASK 0x0002 /* GP2_EINT */
3997#define WM8994_GP2_EINT_SHIFT 1 /* GP2_EINT */
3998#define WM8994_GP2_EINT_WIDTH 1 /* GP2_EINT */
3999#define WM8994_GP1_EINT 0x0001 /* GP1_EINT */
4000#define WM8994_GP1_EINT_MASK 0x0001 /* GP1_EINT */
4001#define WM8994_GP1_EINT_SHIFT 0 /* GP1_EINT */
4002#define WM8994_GP1_EINT_WIDTH 1 /* GP1_EINT */
4003
4004/*
4005 * R1841 (0x731) - Interrupt Status 2
4006 */
4007#define WM8994_TEMP_WARN_EINT 0x8000 /* TEMP_WARN_EINT */
4008#define WM8994_TEMP_WARN_EINT_MASK 0x8000 /* TEMP_WARN_EINT */
4009#define WM8994_TEMP_WARN_EINT_SHIFT 15 /* TEMP_WARN_EINT */
4010#define WM8994_TEMP_WARN_EINT_WIDTH 1 /* TEMP_WARN_EINT */
4011#define WM8994_DCS_DONE_EINT 0x4000 /* DCS_DONE_EINT */
4012#define WM8994_DCS_DONE_EINT_MASK 0x4000 /* DCS_DONE_EINT */
4013#define WM8994_DCS_DONE_EINT_SHIFT 14 /* DCS_DONE_EINT */
4014#define WM8994_DCS_DONE_EINT_WIDTH 1 /* DCS_DONE_EINT */
4015#define WM8994_WSEQ_DONE_EINT 0x2000 /* WSEQ_DONE_EINT */
4016#define WM8994_WSEQ_DONE_EINT_MASK 0x2000 /* WSEQ_DONE_EINT */
4017#define WM8994_WSEQ_DONE_EINT_SHIFT 13 /* WSEQ_DONE_EINT */
4018#define WM8994_WSEQ_DONE_EINT_WIDTH 1 /* WSEQ_DONE_EINT */
4019#define WM8994_FIFOS_ERR_EINT 0x1000 /* FIFOS_ERR_EINT */
4020#define WM8994_FIFOS_ERR_EINT_MASK 0x1000 /* FIFOS_ERR_EINT */
4021#define WM8994_FIFOS_ERR_EINT_SHIFT 12 /* FIFOS_ERR_EINT */
4022#define WM8994_FIFOS_ERR_EINT_WIDTH 1 /* FIFOS_ERR_EINT */
4023#define WM8994_AIF2DRC_SIG_DET_EINT 0x0800 /* AIF2DRC_SIG_DET_EINT */
4024#define WM8994_AIF2DRC_SIG_DET_EINT_MASK 0x0800 /* AIF2DRC_SIG_DET_EINT */
4025#define WM8994_AIF2DRC_SIG_DET_EINT_SHIFT 11 /* AIF2DRC_SIG_DET_EINT */
4026#define WM8994_AIF2DRC_SIG_DET_EINT_WIDTH 1 /* AIF2DRC_SIG_DET_EINT */
4027#define WM8994_AIF1DRC2_SIG_DET_EINT 0x0400 /* AIF1DRC2_SIG_DET_EINT */
4028#define WM8994_AIF1DRC2_SIG_DET_EINT_MASK 0x0400 /* AIF1DRC2_SIG_DET_EINT */
4029#define WM8994_AIF1DRC2_SIG_DET_EINT_SHIFT 10 /* AIF1DRC2_SIG_DET_EINT */
4030#define WM8994_AIF1DRC2_SIG_DET_EINT_WIDTH 1 /* AIF1DRC2_SIG_DET_EINT */
4031#define WM8994_AIF1DRC1_SIG_DET_EINT 0x0200 /* AIF1DRC1_SIG_DET_EINT */
4032#define WM8994_AIF1DRC1_SIG_DET_EINT_MASK 0x0200 /* AIF1DRC1_SIG_DET_EINT */
4033#define WM8994_AIF1DRC1_SIG_DET_EINT_SHIFT 9 /* AIF1DRC1_SIG_DET_EINT */
4034#define WM8994_AIF1DRC1_SIG_DET_EINT_WIDTH 1 /* AIF1DRC1_SIG_DET_EINT */
4035#define WM8994_SRC2_LOCK_EINT 0x0100 /* SRC2_LOCK_EINT */
4036#define WM8994_SRC2_LOCK_EINT_MASK 0x0100 /* SRC2_LOCK_EINT */
4037#define WM8994_SRC2_LOCK_EINT_SHIFT 8 /* SRC2_LOCK_EINT */
4038#define WM8994_SRC2_LOCK_EINT_WIDTH 1 /* SRC2_LOCK_EINT */
4039#define WM8994_SRC1_LOCK_EINT 0x0080 /* SRC1_LOCK_EINT */
4040#define WM8994_SRC1_LOCK_EINT_MASK 0x0080 /* SRC1_LOCK_EINT */
4041#define WM8994_SRC1_LOCK_EINT_SHIFT 7 /* SRC1_LOCK_EINT */
4042#define WM8994_SRC1_LOCK_EINT_WIDTH 1 /* SRC1_LOCK_EINT */
4043#define WM8994_FLL2_LOCK_EINT 0x0040 /* FLL2_LOCK_EINT */
4044#define WM8994_FLL2_LOCK_EINT_MASK 0x0040 /* FLL2_LOCK_EINT */
4045#define WM8994_FLL2_LOCK_EINT_SHIFT 6 /* FLL2_LOCK_EINT */
4046#define WM8994_FLL2_LOCK_EINT_WIDTH 1 /* FLL2_LOCK_EINT */
4047#define WM8994_FLL1_LOCK_EINT 0x0020 /* FLL1_LOCK_EINT */
4048#define WM8994_FLL1_LOCK_EINT_MASK 0x0020 /* FLL1_LOCK_EINT */
4049#define WM8994_FLL1_LOCK_EINT_SHIFT 5 /* FLL1_LOCK_EINT */
4050#define WM8994_FLL1_LOCK_EINT_WIDTH 1 /* FLL1_LOCK_EINT */
4051#define WM8994_MIC2_SHRT_EINT 0x0010 /* MIC2_SHRT_EINT */
4052#define WM8994_MIC2_SHRT_EINT_MASK 0x0010 /* MIC2_SHRT_EINT */
4053#define WM8994_MIC2_SHRT_EINT_SHIFT 4 /* MIC2_SHRT_EINT */
4054#define WM8994_MIC2_SHRT_EINT_WIDTH 1 /* MIC2_SHRT_EINT */
4055#define WM8994_MIC2_DET_EINT 0x0008 /* MIC2_DET_EINT */
4056#define WM8994_MIC2_DET_EINT_MASK 0x0008 /* MIC2_DET_EINT */
4057#define WM8994_MIC2_DET_EINT_SHIFT 3 /* MIC2_DET_EINT */
4058#define WM8994_MIC2_DET_EINT_WIDTH 1 /* MIC2_DET_EINT */
4059#define WM8994_MIC1_SHRT_EINT 0x0004 /* MIC1_SHRT_EINT */
4060#define WM8994_MIC1_SHRT_EINT_MASK 0x0004 /* MIC1_SHRT_EINT */
4061#define WM8994_MIC1_SHRT_EINT_SHIFT 2 /* MIC1_SHRT_EINT */
4062#define WM8994_MIC1_SHRT_EINT_WIDTH 1 /* MIC1_SHRT_EINT */
4063#define WM8994_MIC1_DET_EINT 0x0002 /* MIC1_DET_EINT */
4064#define WM8994_MIC1_DET_EINT_MASK 0x0002 /* MIC1_DET_EINT */
4065#define WM8994_MIC1_DET_EINT_SHIFT 1 /* MIC1_DET_EINT */
4066#define WM8994_MIC1_DET_EINT_WIDTH 1 /* MIC1_DET_EINT */
4067#define WM8994_TEMP_SHUT_EINT 0x0001 /* TEMP_SHUT_EINT */
4068#define WM8994_TEMP_SHUT_EINT_MASK 0x0001 /* TEMP_SHUT_EINT */
4069#define WM8994_TEMP_SHUT_EINT_SHIFT 0 /* TEMP_SHUT_EINT */
4070#define WM8994_TEMP_SHUT_EINT_WIDTH 1 /* TEMP_SHUT_EINT */
4071
4072/*
4073 * R1842 (0x732) - Interrupt Raw Status 2
4074 */
4075#define WM8994_TEMP_WARN_STS 0x8000 /* TEMP_WARN_STS */
4076#define WM8994_TEMP_WARN_STS_MASK 0x8000 /* TEMP_WARN_STS */
4077#define WM8994_TEMP_WARN_STS_SHIFT 15 /* TEMP_WARN_STS */
4078#define WM8994_TEMP_WARN_STS_WIDTH 1 /* TEMP_WARN_STS */
4079#define WM8994_DCS_DONE_STS 0x4000 /* DCS_DONE_STS */
4080#define WM8994_DCS_DONE_STS_MASK 0x4000 /* DCS_DONE_STS */
4081#define WM8994_DCS_DONE_STS_SHIFT 14 /* DCS_DONE_STS */
4082#define WM8994_DCS_DONE_STS_WIDTH 1 /* DCS_DONE_STS */
4083#define WM8994_WSEQ_DONE_STS 0x2000 /* WSEQ_DONE_STS */
4084#define WM8994_WSEQ_DONE_STS_MASK 0x2000 /* WSEQ_DONE_STS */
4085#define WM8994_WSEQ_DONE_STS_SHIFT 13 /* WSEQ_DONE_STS */
4086#define WM8994_WSEQ_DONE_STS_WIDTH 1 /* WSEQ_DONE_STS */
4087#define WM8994_FIFOS_ERR_STS 0x1000 /* FIFOS_ERR_STS */
4088#define WM8994_FIFOS_ERR_STS_MASK 0x1000 /* FIFOS_ERR_STS */
4089#define WM8994_FIFOS_ERR_STS_SHIFT 12 /* FIFOS_ERR_STS */
4090#define WM8994_FIFOS_ERR_STS_WIDTH 1 /* FIFOS_ERR_STS */
4091#define WM8994_AIF2DRC_SIG_DET_STS 0x0800 /* AIF2DRC_SIG_DET_STS */
4092#define WM8994_AIF2DRC_SIG_DET_STS_MASK 0x0800 /* AIF2DRC_SIG_DET_STS */
4093#define WM8994_AIF2DRC_SIG_DET_STS_SHIFT 11 /* AIF2DRC_SIG_DET_STS */
4094#define WM8994_AIF2DRC_SIG_DET_STS_WIDTH 1 /* AIF2DRC_SIG_DET_STS */
4095#define WM8994_AIF1DRC2_SIG_DET_STS 0x0400 /* AIF1DRC2_SIG_DET_STS */
4096#define WM8994_AIF1DRC2_SIG_DET_STS_MASK 0x0400 /* AIF1DRC2_SIG_DET_STS */
4097#define WM8994_AIF1DRC2_SIG_DET_STS_SHIFT 10 /* AIF1DRC2_SIG_DET_STS */
4098#define WM8994_AIF1DRC2_SIG_DET_STS_WIDTH 1 /* AIF1DRC2_SIG_DET_STS */
4099#define WM8994_AIF1DRC1_SIG_DET_STS 0x0200 /* AIF1DRC1_SIG_DET_STS */
4100#define WM8994_AIF1DRC1_SIG_DET_STS_MASK 0x0200 /* AIF1DRC1_SIG_DET_STS */
4101#define WM8994_AIF1DRC1_SIG_DET_STS_SHIFT 9 /* AIF1DRC1_SIG_DET_STS */
4102#define WM8994_AIF1DRC1_SIG_DET_STS_WIDTH 1 /* AIF1DRC1_SIG_DET_STS */
4103#define WM8994_SRC2_LOCK_STS 0x0100 /* SRC2_LOCK_STS */
4104#define WM8994_SRC2_LOCK_STS_MASK 0x0100 /* SRC2_LOCK_STS */
4105#define WM8994_SRC2_LOCK_STS_SHIFT 8 /* SRC2_LOCK_STS */
4106#define WM8994_SRC2_LOCK_STS_WIDTH 1 /* SRC2_LOCK_STS */
4107#define WM8994_SRC1_LOCK_STS 0x0080 /* SRC1_LOCK_STS */
4108#define WM8994_SRC1_LOCK_STS_MASK 0x0080 /* SRC1_LOCK_STS */
4109#define WM8994_SRC1_LOCK_STS_SHIFT 7 /* SRC1_LOCK_STS */
4110#define WM8994_SRC1_LOCK_STS_WIDTH 1 /* SRC1_LOCK_STS */
4111#define WM8994_FLL2_LOCK_STS 0x0040 /* FLL2_LOCK_STS */
4112#define WM8994_FLL2_LOCK_STS_MASK 0x0040 /* FLL2_LOCK_STS */
4113#define WM8994_FLL2_LOCK_STS_SHIFT 6 /* FLL2_LOCK_STS */
4114#define WM8994_FLL2_LOCK_STS_WIDTH 1 /* FLL2_LOCK_STS */
4115#define WM8994_FLL1_LOCK_STS 0x0020 /* FLL1_LOCK_STS */
4116#define WM8994_FLL1_LOCK_STS_MASK 0x0020 /* FLL1_LOCK_STS */
4117#define WM8994_FLL1_LOCK_STS_SHIFT 5 /* FLL1_LOCK_STS */
4118#define WM8994_FLL1_LOCK_STS_WIDTH 1 /* FLL1_LOCK_STS */
4119#define WM8994_MIC2_SHRT_STS 0x0010 /* MIC2_SHRT_STS */
4120#define WM8994_MIC2_SHRT_STS_MASK 0x0010 /* MIC2_SHRT_STS */
4121#define WM8994_MIC2_SHRT_STS_SHIFT 4 /* MIC2_SHRT_STS */
4122#define WM8994_MIC2_SHRT_STS_WIDTH 1 /* MIC2_SHRT_STS */
4123#define WM8994_MIC2_DET_STS 0x0008 /* MIC2_DET_STS */
4124#define WM8994_MIC2_DET_STS_MASK 0x0008 /* MIC2_DET_STS */
4125#define WM8994_MIC2_DET_STS_SHIFT 3 /* MIC2_DET_STS */
4126#define WM8994_MIC2_DET_STS_WIDTH 1 /* MIC2_DET_STS */
4127#define WM8994_MIC1_SHRT_STS 0x0004 /* MIC1_SHRT_STS */
4128#define WM8994_MIC1_SHRT_STS_MASK 0x0004 /* MIC1_SHRT_STS */
4129#define WM8994_MIC1_SHRT_STS_SHIFT 2 /* MIC1_SHRT_STS */
4130#define WM8994_MIC1_SHRT_STS_WIDTH 1 /* MIC1_SHRT_STS */
4131#define WM8994_MIC1_DET_STS 0x0002 /* MIC1_DET_STS */
4132#define WM8994_MIC1_DET_STS_MASK 0x0002 /* MIC1_DET_STS */
4133#define WM8994_MIC1_DET_STS_SHIFT 1 /* MIC1_DET_STS */
4134#define WM8994_MIC1_DET_STS_WIDTH 1 /* MIC1_DET_STS */
4135#define WM8994_TEMP_SHUT_STS 0x0001 /* TEMP_SHUT_STS */
4136#define WM8994_TEMP_SHUT_STS_MASK 0x0001 /* TEMP_SHUT_STS */
4137#define WM8994_TEMP_SHUT_STS_SHIFT 0 /* TEMP_SHUT_STS */
4138#define WM8994_TEMP_SHUT_STS_WIDTH 1 /* TEMP_SHUT_STS */
4139
4140/*
4141 * R1848 (0x738) - Interrupt Status 1 Mask
4142 */
4143#define WM8994_IM_GP11_EINT 0x0400 /* IM_GP11_EINT */
4144#define WM8994_IM_GP11_EINT_MASK 0x0400 /* IM_GP11_EINT */
4145#define WM8994_IM_GP11_EINT_SHIFT 10 /* IM_GP11_EINT */
4146#define WM8994_IM_GP11_EINT_WIDTH 1 /* IM_GP11_EINT */
4147#define WM8994_IM_GP10_EINT 0x0200 /* IM_GP10_EINT */
4148#define WM8994_IM_GP10_EINT_MASK 0x0200 /* IM_GP10_EINT */
4149#define WM8994_IM_GP10_EINT_SHIFT 9 /* IM_GP10_EINT */
4150#define WM8994_IM_GP10_EINT_WIDTH 1 /* IM_GP10_EINT */
4151#define WM8994_IM_GP9_EINT 0x0100 /* IM_GP9_EINT */
4152#define WM8994_IM_GP9_EINT_MASK 0x0100 /* IM_GP9_EINT */
4153#define WM8994_IM_GP9_EINT_SHIFT 8 /* IM_GP9_EINT */
4154#define WM8994_IM_GP9_EINT_WIDTH 1 /* IM_GP9_EINT */
4155#define WM8994_IM_GP8_EINT 0x0080 /* IM_GP8_EINT */
4156#define WM8994_IM_GP8_EINT_MASK 0x0080 /* IM_GP8_EINT */
4157#define WM8994_IM_GP8_EINT_SHIFT 7 /* IM_GP8_EINT */
4158#define WM8994_IM_GP8_EINT_WIDTH 1 /* IM_GP8_EINT */
4159#define WM8994_IM_GP7_EINT 0x0040 /* IM_GP7_EINT */
4160#define WM8994_IM_GP7_EINT_MASK 0x0040 /* IM_GP7_EINT */
4161#define WM8994_IM_GP7_EINT_SHIFT 6 /* IM_GP7_EINT */
4162#define WM8994_IM_GP7_EINT_WIDTH 1 /* IM_GP7_EINT */
4163#define WM8994_IM_GP6_EINT 0x0020 /* IM_GP6_EINT */
4164#define WM8994_IM_GP6_EINT_MASK 0x0020 /* IM_GP6_EINT */
4165#define WM8994_IM_GP6_EINT_SHIFT 5 /* IM_GP6_EINT */
4166#define WM8994_IM_GP6_EINT_WIDTH 1 /* IM_GP6_EINT */
4167#define WM8994_IM_GP5_EINT 0x0010 /* IM_GP5_EINT */
4168#define WM8994_IM_GP5_EINT_MASK 0x0010 /* IM_GP5_EINT */
4169#define WM8994_IM_GP5_EINT_SHIFT 4 /* IM_GP5_EINT */
4170#define WM8994_IM_GP5_EINT_WIDTH 1 /* IM_GP5_EINT */
4171#define WM8994_IM_GP4_EINT 0x0008 /* IM_GP4_EINT */
4172#define WM8994_IM_GP4_EINT_MASK 0x0008 /* IM_GP4_EINT */
4173#define WM8994_IM_GP4_EINT_SHIFT 3 /* IM_GP4_EINT */
4174#define WM8994_IM_GP4_EINT_WIDTH 1 /* IM_GP4_EINT */
4175#define WM8994_IM_GP3_EINT 0x0004 /* IM_GP3_EINT */
4176#define WM8994_IM_GP3_EINT_MASK 0x0004 /* IM_GP3_EINT */
4177#define WM8994_IM_GP3_EINT_SHIFT 2 /* IM_GP3_EINT */
4178#define WM8994_IM_GP3_EINT_WIDTH 1 /* IM_GP3_EINT */
4179#define WM8994_IM_GP2_EINT 0x0002 /* IM_GP2_EINT */
4180#define WM8994_IM_GP2_EINT_MASK 0x0002 /* IM_GP2_EINT */
4181#define WM8994_IM_GP2_EINT_SHIFT 1 /* IM_GP2_EINT */
4182#define WM8994_IM_GP2_EINT_WIDTH 1 /* IM_GP2_EINT */
4183#define WM8994_IM_GP1_EINT 0x0001 /* IM_GP1_EINT */
4184#define WM8994_IM_GP1_EINT_MASK 0x0001 /* IM_GP1_EINT */
4185#define WM8994_IM_GP1_EINT_SHIFT 0 /* IM_GP1_EINT */
4186#define WM8994_IM_GP1_EINT_WIDTH 1 /* IM_GP1_EINT */
4187
4188/*
4189 * R1849 (0x739) - Interrupt Status 2 Mask
4190 */
4191#define WM8994_IM_TEMP_WARN_EINT 0x8000 /* IM_TEMP_WARN_EINT */
4192#define WM8994_IM_TEMP_WARN_EINT_MASK 0x8000 /* IM_TEMP_WARN_EINT */
4193#define WM8994_IM_TEMP_WARN_EINT_SHIFT 15 /* IM_TEMP_WARN_EINT */
4194#define WM8994_IM_TEMP_WARN_EINT_WIDTH 1 /* IM_TEMP_WARN_EINT */
4195#define WM8994_IM_DCS_DONE_EINT 0x4000 /* IM_DCS_DONE_EINT */
4196#define WM8994_IM_DCS_DONE_EINT_MASK 0x4000 /* IM_DCS_DONE_EINT */
4197#define WM8994_IM_DCS_DONE_EINT_SHIFT 14 /* IM_DCS_DONE_EINT */
4198#define WM8994_IM_DCS_DONE_EINT_WIDTH 1 /* IM_DCS_DONE_EINT */
4199#define WM8994_IM_WSEQ_DONE_EINT 0x2000 /* IM_WSEQ_DONE_EINT */
4200#define WM8994_IM_WSEQ_DONE_EINT_MASK 0x2000 /* IM_WSEQ_DONE_EINT */
4201#define WM8994_IM_WSEQ_DONE_EINT_SHIFT 13 /* IM_WSEQ_DONE_EINT */
4202#define WM8994_IM_WSEQ_DONE_EINT_WIDTH 1 /* IM_WSEQ_DONE_EINT */
4203#define WM8994_IM_FIFOS_ERR_EINT 0x1000 /* IM_FIFOS_ERR_EINT */
4204#define WM8994_IM_FIFOS_ERR_EINT_MASK 0x1000 /* IM_FIFOS_ERR_EINT */
4205#define WM8994_IM_FIFOS_ERR_EINT_SHIFT 12 /* IM_FIFOS_ERR_EINT */
4206#define WM8994_IM_FIFOS_ERR_EINT_WIDTH 1 /* IM_FIFOS_ERR_EINT */
4207#define WM8994_IM_AIF2DRC_SIG_DET_EINT 0x0800 /* IM_AIF2DRC_SIG_DET_EINT */
4208#define WM8994_IM_AIF2DRC_SIG_DET_EINT_MASK 0x0800 /* IM_AIF2DRC_SIG_DET_EINT */
4209#define WM8994_IM_AIF2DRC_SIG_DET_EINT_SHIFT 11 /* IM_AIF2DRC_SIG_DET_EINT */
4210#define WM8994_IM_AIF2DRC_SIG_DET_EINT_WIDTH 1 /* IM_AIF2DRC_SIG_DET_EINT */
4211#define WM8994_IM_AIF1DRC2_SIG_DET_EINT 0x0400 /* IM_AIF1DRC2_SIG_DET_EINT */
4212#define WM8994_IM_AIF1DRC2_SIG_DET_EINT_MASK 0x0400 /* IM_AIF1DRC2_SIG_DET_EINT */
4213#define WM8994_IM_AIF1DRC2_SIG_DET_EINT_SHIFT 10 /* IM_AIF1DRC2_SIG_DET_EINT */
4214#define WM8994_IM_AIF1DRC2_SIG_DET_EINT_WIDTH 1 /* IM_AIF1DRC2_SIG_DET_EINT */
4215#define WM8994_IM_AIF1DRC1_SIG_DET_EINT 0x0200 /* IM_AIF1DRC1_SIG_DET_EINT */
4216#define WM8994_IM_AIF1DRC1_SIG_DET_EINT_MASK 0x0200 /* IM_AIF1DRC1_SIG_DET_EINT */
4217#define WM8994_IM_AIF1DRC1_SIG_DET_EINT_SHIFT 9 /* IM_AIF1DRC1_SIG_DET_EINT */
4218#define WM8994_IM_AIF1DRC1_SIG_DET_EINT_WIDTH 1 /* IM_AIF1DRC1_SIG_DET_EINT */
4219#define WM8994_IM_SRC2_LOCK_EINT 0x0100 /* IM_SRC2_LOCK_EINT */
4220#define WM8994_IM_SRC2_LOCK_EINT_MASK 0x0100 /* IM_SRC2_LOCK_EINT */
4221#define WM8994_IM_SRC2_LOCK_EINT_SHIFT 8 /* IM_SRC2_LOCK_EINT */
4222#define WM8994_IM_SRC2_LOCK_EINT_WIDTH 1 /* IM_SRC2_LOCK_EINT */
4223#define WM8994_IM_SRC1_LOCK_EINT 0x0080 /* IM_SRC1_LOCK_EINT */
4224#define WM8994_IM_SRC1_LOCK_EINT_MASK 0x0080 /* IM_SRC1_LOCK_EINT */
4225#define WM8994_IM_SRC1_LOCK_EINT_SHIFT 7 /* IM_SRC1_LOCK_EINT */
4226#define WM8994_IM_SRC1_LOCK_EINT_WIDTH 1 /* IM_SRC1_LOCK_EINT */
4227#define WM8994_IM_FLL2_LOCK_EINT 0x0040 /* IM_FLL2_LOCK_EINT */
4228#define WM8994_IM_FLL2_LOCK_EINT_MASK 0x0040 /* IM_FLL2_LOCK_EINT */
4229#define WM8994_IM_FLL2_LOCK_EINT_SHIFT 6 /* IM_FLL2_LOCK_EINT */
4230#define WM8994_IM_FLL2_LOCK_EINT_WIDTH 1 /* IM_FLL2_LOCK_EINT */
4231#define WM8994_IM_FLL1_LOCK_EINT 0x0020 /* IM_FLL1_LOCK_EINT */
4232#define WM8994_IM_FLL1_LOCK_EINT_MASK 0x0020 /* IM_FLL1_LOCK_EINT */
4233#define WM8994_IM_FLL1_LOCK_EINT_SHIFT 5 /* IM_FLL1_LOCK_EINT */
4234#define WM8994_IM_FLL1_LOCK_EINT_WIDTH 1 /* IM_FLL1_LOCK_EINT */
4235#define WM8994_IM_MIC2_SHRT_EINT 0x0010 /* IM_MIC2_SHRT_EINT */
4236#define WM8994_IM_MIC2_SHRT_EINT_MASK 0x0010 /* IM_MIC2_SHRT_EINT */
4237#define WM8994_IM_MIC2_SHRT_EINT_SHIFT 4 /* IM_MIC2_SHRT_EINT */
4238#define WM8994_IM_MIC2_SHRT_EINT_WIDTH 1 /* IM_MIC2_SHRT_EINT */
4239#define WM8994_IM_MIC2_DET_EINT 0x0008 /* IM_MIC2_DET_EINT */
4240#define WM8994_IM_MIC2_DET_EINT_MASK 0x0008 /* IM_MIC2_DET_EINT */
4241#define WM8994_IM_MIC2_DET_EINT_SHIFT 3 /* IM_MIC2_DET_EINT */
4242#define WM8994_IM_MIC2_DET_EINT_WIDTH 1 /* IM_MIC2_DET_EINT */
4243#define WM8994_IM_MIC1_SHRT_EINT 0x0004 /* IM_MIC1_SHRT_EINT */
4244#define WM8994_IM_MIC1_SHRT_EINT_MASK 0x0004 /* IM_MIC1_SHRT_EINT */
4245#define WM8994_IM_MIC1_SHRT_EINT_SHIFT 2 /* IM_MIC1_SHRT_EINT */
4246#define WM8994_IM_MIC1_SHRT_EINT_WIDTH 1 /* IM_MIC1_SHRT_EINT */
4247#define WM8994_IM_MIC1_DET_EINT 0x0002 /* IM_MIC1_DET_EINT */
4248#define WM8994_IM_MIC1_DET_EINT_MASK 0x0002 /* IM_MIC1_DET_EINT */
4249#define WM8994_IM_MIC1_DET_EINT_SHIFT 1 /* IM_MIC1_DET_EINT */
4250#define WM8994_IM_MIC1_DET_EINT_WIDTH 1 /* IM_MIC1_DET_EINT */
4251#define WM8994_IM_TEMP_SHUT_EINT 0x0001 /* IM_TEMP_SHUT_EINT */
4252#define WM8994_IM_TEMP_SHUT_EINT_MASK 0x0001 /* IM_TEMP_SHUT_EINT */
4253#define WM8994_IM_TEMP_SHUT_EINT_SHIFT 0 /* IM_TEMP_SHUT_EINT */
4254#define WM8994_IM_TEMP_SHUT_EINT_WIDTH 1 /* IM_TEMP_SHUT_EINT */
4255
4256/*
4257 * R1856 (0x740) - Interrupt Control
4258 */
4259#define WM8994_IM_IRQ 0x0001 /* IM_IRQ */
4260#define WM8994_IM_IRQ_MASK 0x0001 /* IM_IRQ */
4261#define WM8994_IM_IRQ_SHIFT 0 /* IM_IRQ */
4262#define WM8994_IM_IRQ_WIDTH 1 /* IM_IRQ */
4263
4264/*
4265 * R1864 (0x748) - IRQ Debounce
4266 */
4267#define WM8994_TEMP_WARN_DB 0x0020 /* TEMP_WARN_DB */
4268#define WM8994_TEMP_WARN_DB_MASK 0x0020 /* TEMP_WARN_DB */
4269#define WM8994_TEMP_WARN_DB_SHIFT 5 /* TEMP_WARN_DB */
4270#define WM8994_TEMP_WARN_DB_WIDTH 1 /* TEMP_WARN_DB */
4271#define WM8994_MIC2_SHRT_DB 0x0010 /* MIC2_SHRT_DB */
4272#define WM8994_MIC2_SHRT_DB_MASK 0x0010 /* MIC2_SHRT_DB */
4273#define WM8994_MIC2_SHRT_DB_SHIFT 4 /* MIC2_SHRT_DB */
4274#define WM8994_MIC2_SHRT_DB_WIDTH 1 /* MIC2_SHRT_DB */
4275#define WM8994_MIC2_DET_DB 0x0008 /* MIC2_DET_DB */
4276#define WM8994_MIC2_DET_DB_MASK 0x0008 /* MIC2_DET_DB */
4277#define WM8994_MIC2_DET_DB_SHIFT 3 /* MIC2_DET_DB */
4278#define WM8994_MIC2_DET_DB_WIDTH 1 /* MIC2_DET_DB */
4279#define WM8994_MIC1_SHRT_DB 0x0004 /* MIC1_SHRT_DB */
4280#define WM8994_MIC1_SHRT_DB_MASK 0x0004 /* MIC1_SHRT_DB */
4281#define WM8994_MIC1_SHRT_DB_SHIFT 2 /* MIC1_SHRT_DB */
4282#define WM8994_MIC1_SHRT_DB_WIDTH 1 /* MIC1_SHRT_DB */
4283#define WM8994_MIC1_DET_DB 0x0002 /* MIC1_DET_DB */
4284#define WM8994_MIC1_DET_DB_MASK 0x0002 /* MIC1_DET_DB */
4285#define WM8994_MIC1_DET_DB_SHIFT 1 /* MIC1_DET_DB */
4286#define WM8994_MIC1_DET_DB_WIDTH 1 /* MIC1_DET_DB */
4287#define WM8994_TEMP_SHUT_DB 0x0001 /* TEMP_SHUT_DB */
4288#define WM8994_TEMP_SHUT_DB_MASK 0x0001 /* TEMP_SHUT_DB */
4289#define WM8994_TEMP_SHUT_DB_SHIFT 0 /* TEMP_SHUT_DB */
4290#define WM8994_TEMP_SHUT_DB_WIDTH 1 /* TEMP_SHUT_DB */
4291
4292#endif
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index adaf3c15e449..8b5f7cc0fba6 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -30,6 +30,7 @@
30#define HPET_MINOR 228 30#define HPET_MINOR 228
31#define FUSE_MINOR 229 31#define FUSE_MINOR 229
32#define KVM_MINOR 232 32#define KVM_MINOR 232
33#define VHOST_NET_MINOR 233
33#define MISC_DYNAMIC_MINOR 255 34#define MISC_DYNAMIC_MINOR 255
34 35
35struct device; 36struct device;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index ce7cc6c7bcbb..e92d1bfdb330 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -61,6 +61,7 @@ enum {
61 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, 61 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8,
62 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, 62 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9,
63 MLX4_DEV_CAP_FLAG_DPDP = 1 << 12, 63 MLX4_DEV_CAP_FLAG_DPDP = 1 << 12,
64 MLX4_DEV_CAP_FLAG_BLH = 1 << 15,
64 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, 65 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16,
65 MLX4_DEV_CAP_FLAG_APM = 1 << 17, 66 MLX4_DEV_CAP_FLAG_APM = 1 << 17,
66 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, 67 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18,
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 9d65ae4ba0e0..e70f21beb4b4 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -12,6 +12,7 @@
12#include <linux/prio_tree.h> 12#include <linux/prio_tree.h>
13#include <linux/debug_locks.h> 13#include <linux/debug_locks.h>
14#include <linux/mm_types.h> 14#include <linux/mm_types.h>
15#include <linux/range.h>
15 16
16struct mempolicy; 17struct mempolicy;
17struct anon_vma; 18struct anon_vma;
@@ -265,6 +266,8 @@ static inline int get_page_unless_zero(struct page *page)
265 return atomic_inc_not_zero(&page->_count); 266 return atomic_inc_not_zero(&page->_count);
266} 267}
267 268
269extern int page_is_ram(unsigned long pfn);
270
268/* Support for virtually mapped pages */ 271/* Support for virtually mapped pages */
269struct page *vmalloc_to_page(const void *addr); 272struct page *vmalloc_to_page(const void *addr);
270unsigned long vmalloc_to_pfn(const void *addr); 273unsigned long vmalloc_to_pfn(const void *addr);
@@ -867,6 +870,114 @@ extern int mprotect_fixup(struct vm_area_struct *vma,
867 */ 870 */
868int __get_user_pages_fast(unsigned long start, int nr_pages, int write, 871int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
869 struct page **pages); 872 struct page **pages);
873/*
874 * per-process(per-mm_struct) statistics.
875 */
876#if defined(SPLIT_RSS_COUNTING)
877/*
878 * The mm counters are not protected by its page_table_lock,
879 * so must be incremented atomically.
880 */
881static inline void set_mm_counter(struct mm_struct *mm, int member, long value)
882{
883 atomic_long_set(&mm->rss_stat.count[member], value);
884}
885
886unsigned long get_mm_counter(struct mm_struct *mm, int member);
887
888static inline void add_mm_counter(struct mm_struct *mm, int member, long value)
889{
890 atomic_long_add(value, &mm->rss_stat.count[member]);
891}
892
893static inline void inc_mm_counter(struct mm_struct *mm, int member)
894{
895 atomic_long_inc(&mm->rss_stat.count[member]);
896}
897
898static inline void dec_mm_counter(struct mm_struct *mm, int member)
899{
900 atomic_long_dec(&mm->rss_stat.count[member]);
901}
902
903#else /* !USE_SPLIT_PTLOCKS */
904/*
905 * The mm counters are protected by its page_table_lock,
906 * so can be incremented directly.
907 */
908static inline void set_mm_counter(struct mm_struct *mm, int member, long value)
909{
910 mm->rss_stat.count[member] = value;
911}
912
913static inline unsigned long get_mm_counter(struct mm_struct *mm, int member)
914{
915 return mm->rss_stat.count[member];
916}
917
918static inline void add_mm_counter(struct mm_struct *mm, int member, long value)
919{
920 mm->rss_stat.count[member] += value;
921}
922
923static inline void inc_mm_counter(struct mm_struct *mm, int member)
924{
925 mm->rss_stat.count[member]++;
926}
927
928static inline void dec_mm_counter(struct mm_struct *mm, int member)
929{
930 mm->rss_stat.count[member]--;
931}
932
933#endif /* !USE_SPLIT_PTLOCKS */
934
935static inline unsigned long get_mm_rss(struct mm_struct *mm)
936{
937 return get_mm_counter(mm, MM_FILEPAGES) +
938 get_mm_counter(mm, MM_ANONPAGES);
939}
940
941static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
942{
943 return max(mm->hiwater_rss, get_mm_rss(mm));
944}
945
946static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
947{
948 return max(mm->hiwater_vm, mm->total_vm);
949}
950
951static inline void update_hiwater_rss(struct mm_struct *mm)
952{
953 unsigned long _rss = get_mm_rss(mm);
954
955 if ((mm)->hiwater_rss < _rss)
956 (mm)->hiwater_rss = _rss;
957}
958
959static inline void update_hiwater_vm(struct mm_struct *mm)
960{
961 if (mm->hiwater_vm < mm->total_vm)
962 mm->hiwater_vm = mm->total_vm;
963}
964
965static inline void setmax_mm_hiwater_rss(unsigned long *maxrss,
966 struct mm_struct *mm)
967{
968 unsigned long hiwater_rss = get_mm_hiwater_rss(mm);
969
970 if (*maxrss < hiwater_rss)
971 *maxrss = hiwater_rss;
972}
973
974#if defined(SPLIT_RSS_COUNTING)
975void sync_mm_rss(struct task_struct *task, struct mm_struct *mm);
976#else
977static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm)
978{
979}
980#endif
870 981
871/* 982/*
872 * A callback you can register to apply pressure to ageable caches. 983 * A callback you can register to apply pressure to ageable caches.
@@ -1037,6 +1148,9 @@ extern void add_active_range(unsigned int nid, unsigned long start_pfn,
1037extern void remove_active_range(unsigned int nid, unsigned long start_pfn, 1148extern void remove_active_range(unsigned int nid, unsigned long start_pfn,
1038 unsigned long end_pfn); 1149 unsigned long end_pfn);
1039extern void remove_all_active_ranges(void); 1150extern void remove_all_active_ranges(void);
1151void sort_node_map(void);
1152unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn,
1153 unsigned long end_pfn);
1040extern unsigned long absent_pages_in_range(unsigned long start_pfn, 1154extern unsigned long absent_pages_in_range(unsigned long start_pfn,
1041 unsigned long end_pfn); 1155 unsigned long end_pfn);
1042extern void get_pfn_range_for_nid(unsigned int nid, 1156extern void get_pfn_range_for_nid(unsigned int nid,
@@ -1044,6 +1158,10 @@ extern void get_pfn_range_for_nid(unsigned int nid,
1044extern unsigned long find_min_pfn_with_active_regions(void); 1158extern unsigned long find_min_pfn_with_active_regions(void);
1045extern void free_bootmem_with_active_regions(int nid, 1159extern void free_bootmem_with_active_regions(int nid,
1046 unsigned long max_low_pfn); 1160 unsigned long max_low_pfn);
1161int add_from_early_node_map(struct range *range, int az,
1162 int nr_range, int nid);
1163void *__alloc_memory_core_early(int nodeid, u64 size, u64 align,
1164 u64 goal, u64 limit);
1047typedef int (*work_fn_t)(unsigned long, unsigned long, void *); 1165typedef int (*work_fn_t)(unsigned long, unsigned long, void *);
1048extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data); 1166extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data);
1049extern void sparse_memory_present_with_active_regions(int nid); 1167extern void sparse_memory_present_with_active_regions(int nid);
@@ -1076,16 +1194,13 @@ extern void si_meminfo(struct sysinfo * val);
1076extern void si_meminfo_node(struct sysinfo *val, int nid); 1194extern void si_meminfo_node(struct sysinfo *val, int nid);
1077extern int after_bootmem; 1195extern int after_bootmem;
1078 1196
1079#ifdef CONFIG_NUMA
1080extern void setup_per_cpu_pageset(void); 1197extern void setup_per_cpu_pageset(void);
1081#else
1082static inline void setup_per_cpu_pageset(void) {}
1083#endif
1084 1198
1085extern void zone_pcp_update(struct zone *zone); 1199extern void zone_pcp_update(struct zone *zone);
1086 1200
1087/* nommu.c */ 1201/* nommu.c */
1088extern atomic_long_t mmap_pages_allocated; 1202extern atomic_long_t mmap_pages_allocated;
1203extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t);
1089 1204
1090/* prio_tree.c */ 1205/* prio_tree.c */
1091void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); 1206void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old);
@@ -1107,7 +1222,7 @@ static inline void vma_nonlinear_insert(struct vm_area_struct *vma,
1107 1222
1108/* mmap.c */ 1223/* mmap.c */
1109extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin); 1224extern int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin);
1110extern void vma_adjust(struct vm_area_struct *vma, unsigned long start, 1225extern int vma_adjust(struct vm_area_struct *vma, unsigned long start,
1111 unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert); 1226 unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert);
1112extern struct vm_area_struct *vma_merge(struct mm_struct *, 1227extern struct vm_area_struct *vma_merge(struct mm_struct *,
1113 struct vm_area_struct *prev, unsigned long addr, unsigned long end, 1228 struct vm_area_struct *prev, unsigned long addr, unsigned long end,
@@ -1315,12 +1430,19 @@ extern int randomize_va_space;
1315const char * arch_vma_name(struct vm_area_struct *vma); 1430const char * arch_vma_name(struct vm_area_struct *vma);
1316void print_vma_addr(char *prefix, unsigned long rip); 1431void print_vma_addr(char *prefix, unsigned long rip);
1317 1432
1433void sparse_mem_maps_populate_node(struct page **map_map,
1434 unsigned long pnum_begin,
1435 unsigned long pnum_end,
1436 unsigned long map_count,
1437 int nodeid);
1438
1318struct page *sparse_mem_map_populate(unsigned long pnum, int nid); 1439struct page *sparse_mem_map_populate(unsigned long pnum, int nid);
1319pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); 1440pgd_t *vmemmap_pgd_populate(unsigned long addr, int node);
1320pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node); 1441pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node);
1321pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node); 1442pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node);
1322pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); 1443pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node);
1323void *vmemmap_alloc_block(unsigned long size, int node); 1444void *vmemmap_alloc_block(unsigned long size, int node);
1445void *vmemmap_alloc_block_buf(unsigned long size, int node);
1324void vmemmap_verify(pte_t *, int, unsigned long, unsigned long); 1446void vmemmap_verify(pte_t *, int, unsigned long, unsigned long);
1325int vmemmap_populate_basepages(struct page *start_page, 1447int vmemmap_populate_basepages(struct page *start_page,
1326 unsigned long pages, int node); 1448 unsigned long pages, int node);
@@ -1331,11 +1453,19 @@ extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim,
1331 size_t size); 1453 size_t size);
1332extern void refund_locked_memory(struct mm_struct *mm, size_t size); 1454extern void refund_locked_memory(struct mm_struct *mm, size_t size);
1333 1455
1456enum mf_flags {
1457 MF_COUNT_INCREASED = 1 << 0,
1458};
1334extern void memory_failure(unsigned long pfn, int trapno); 1459extern void memory_failure(unsigned long pfn, int trapno);
1335extern int __memory_failure(unsigned long pfn, int trapno, int ref); 1460extern int __memory_failure(unsigned long pfn, int trapno, int flags);
1461extern int unpoison_memory(unsigned long pfn);
1336extern int sysctl_memory_failure_early_kill; 1462extern int sysctl_memory_failure_early_kill;
1337extern int sysctl_memory_failure_recovery; 1463extern int sysctl_memory_failure_recovery;
1464extern void shake_page(struct page *p, int access);
1338extern atomic_long_t mce_bad_pages; 1465extern atomic_long_t mce_bad_pages;
1466extern int soft_offline_page(struct page *page, int flags);
1467
1468extern void dump_page(struct page *page);
1339 1469
1340#endif /* __KERNEL__ */ 1470#endif /* __KERNEL__ */
1341#endif /* _LINUX_MM_H */ 1471#endif /* _LINUX_MM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 84a524afb3dc..b8bb9a6a1f37 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -24,12 +24,6 @@ struct address_space;
24 24
25#define USE_SPLIT_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS) 25#define USE_SPLIT_PTLOCKS (NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
26 26
27#if USE_SPLIT_PTLOCKS
28typedef atomic_long_t mm_counter_t;
29#else /* !USE_SPLIT_PTLOCKS */
30typedef unsigned long mm_counter_t;
31#endif /* !USE_SPLIT_PTLOCKS */
32
33/* 27/*
34 * Each physical page in the system has a struct page associated with 28 * Each physical page in the system has a struct page associated with
35 * it to keep track of whatever it is we are using the page for at the 29 * it to keep track of whatever it is we are using the page for at the
@@ -122,7 +116,9 @@ struct vm_region {
122 unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ 116 unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */
123 struct file *vm_file; /* the backing file or NULL */ 117 struct file *vm_file; /* the backing file or NULL */
124 118
125 atomic_t vm_usage; /* region usage count */ 119 int vm_usage; /* region usage count (access under nommu_region_sem) */
120 bool vm_icache_flushed : 1; /* true if the icache has been flushed for
121 * this region */
126}; 122};
127 123
128/* 124/*
@@ -167,7 +163,8 @@ struct vm_area_struct {
167 * can only be in the i_mmap tree. An anonymous MAP_PRIVATE, stack 163 * can only be in the i_mmap tree. An anonymous MAP_PRIVATE, stack
168 * or brk vma (with NULL file) can only be in an anon_vma list. 164 * or brk vma (with NULL file) can only be in an anon_vma list.
169 */ 165 */
170 struct list_head anon_vma_node; /* Serialized by anon_vma->lock */ 166 struct list_head anon_vma_chain; /* Serialized by mmap_sem &
167 * page_table_lock */
171 struct anon_vma *anon_vma; /* Serialized by page_table_lock */ 168 struct anon_vma *anon_vma; /* Serialized by page_table_lock */
172 169
173 /* Function pointers to deal with this struct. */ 170 /* Function pointers to deal with this struct. */
@@ -199,14 +196,39 @@ struct core_state {
199 struct completion startup; 196 struct completion startup;
200}; 197};
201 198
199enum {
200 MM_FILEPAGES,
201 MM_ANONPAGES,
202 MM_SWAPENTS,
203 NR_MM_COUNTERS
204};
205
206#if USE_SPLIT_PTLOCKS && defined(CONFIG_MMU)
207#define SPLIT_RSS_COUNTING
208struct mm_rss_stat {
209 atomic_long_t count[NR_MM_COUNTERS];
210};
211/* per-thread cached information, */
212struct task_rss_stat {
213 int events; /* for synchronization threshold */
214 int count[NR_MM_COUNTERS];
215};
216#else /* !USE_SPLIT_PTLOCKS */
217struct mm_rss_stat {
218 unsigned long count[NR_MM_COUNTERS];
219};
220#endif /* !USE_SPLIT_PTLOCKS */
221
202struct mm_struct { 222struct mm_struct {
203 struct vm_area_struct * mmap; /* list of VMAs */ 223 struct vm_area_struct * mmap; /* list of VMAs */
204 struct rb_root mm_rb; 224 struct rb_root mm_rb;
205 struct vm_area_struct * mmap_cache; /* last find_vma result */ 225 struct vm_area_struct * mmap_cache; /* last find_vma result */
226#ifdef CONFIG_MMU
206 unsigned long (*get_unmapped_area) (struct file *filp, 227 unsigned long (*get_unmapped_area) (struct file *filp,
207 unsigned long addr, unsigned long len, 228 unsigned long addr, unsigned long len,
208 unsigned long pgoff, unsigned long flags); 229 unsigned long pgoff, unsigned long flags);
209 void (*unmap_area) (struct mm_struct *mm, unsigned long addr); 230 void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
231#endif
210 unsigned long mmap_base; /* base of mmap area */ 232 unsigned long mmap_base; /* base of mmap area */
211 unsigned long task_size; /* size of task vm space */ 233 unsigned long task_size; /* size of task vm space */
212 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ 234 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
@@ -223,11 +245,6 @@ struct mm_struct {
223 * by mmlist_lock 245 * by mmlist_lock
224 */ 246 */
225 247
226 /* Special counters, in some configurations protected by the
227 * page_table_lock, in other configurations by being atomic.
228 */
229 mm_counter_t _file_rss;
230 mm_counter_t _anon_rss;
231 248
232 unsigned long hiwater_rss; /* High-watermark of RSS usage */ 249 unsigned long hiwater_rss; /* High-watermark of RSS usage */
233 unsigned long hiwater_vm; /* High-water virtual memory usage */ 250 unsigned long hiwater_vm; /* High-water virtual memory usage */
@@ -240,6 +257,12 @@ struct mm_struct {
240 257
241 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ 258 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
242 259
260 /*
261 * Special counters, in some configurations protected by the
262 * page_table_lock, in other configurations by being atomic.
263 */
264 struct mm_rss_stat rss_stat;
265
243 struct linux_binfmt *binfmt; 266 struct linux_binfmt *binfmt;
244 267
245 cpumask_t cpu_vm_mask; 268 cpumask_t cpu_vm_mask;
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 2ee22e8af110..d02d2c6e0cfe 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -99,6 +99,8 @@ struct mmc_card {
99#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ 99#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */
100 unsigned int quirks; /* card quirks */ 100 unsigned int quirks; /* card quirks */
101#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ 101#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */
102#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */
103 /* for byte mode */
102 104
103 u32 raw_cid[4]; /* raw card CID */ 105 u32 raw_cid[4]; /* raw card CID */
104 u32 raw_csd[4]; /* raw card CSD */ 106 u32 raw_csd[4]; /* raw card CSD */
@@ -139,6 +141,11 @@ static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
139 return c->quirks & MMC_QUIRK_LENIENT_FN0; 141 return c->quirks & MMC_QUIRK_LENIENT_FN0;
140} 142}
141 143
144static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
145{
146 return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
147}
148
142#define mmc_card_name(c) ((c)->cid.prod_name) 149#define mmc_card_name(c) ((c)->cid.prod_name)
143#define mmc_card_id(c) (dev_name(&(c)->dev)) 150#define mmc_card_id(c) (dev_name(&(c)->dev))
144 151
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index eaf36364b7d4..43eaf5ca5848 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -14,6 +14,7 @@
14#include <linux/sched.h> 14#include <linux/sched.h>
15 15
16#include <linux/mmc/core.h> 16#include <linux/mmc/core.h>
17#include <linux/mmc/pm.h>
17 18
18struct mmc_ios { 19struct mmc_ios {
19 unsigned int clock; /* clock rate */ 20 unsigned int clock; /* clock rate */
@@ -152,6 +153,8 @@ struct mmc_host {
152#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ 153#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */
153#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ 154#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */
154 155
156 mmc_pm_flag_t pm_caps; /* supported pm features */
157
155 /* host specific block data */ 158 /* host specific block data */
156 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 159 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
157 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ 160 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */
@@ -197,6 +200,8 @@ struct mmc_host {
197 struct task_struct *sdio_irq_thread; 200 struct task_struct *sdio_irq_thread;
198 atomic_t sdio_irq_thread_abort; 201 atomic_t sdio_irq_thread_abort;
199 202
203 mmc_pm_flag_t pm_flags; /* requested pm features */
204
200#ifdef CONFIG_LEDS_TRIGGERS 205#ifdef CONFIG_LEDS_TRIGGERS
201 struct led_trigger *led; /* activity led */ 206 struct led_trigger *led; /* activity led */
202#endif 207#endif
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index c02c8db73701..8a49cbf0376d 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -268,6 +268,7 @@ struct _mmc_csd {
268 268
269#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ 269#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */
270#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ 270#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */
271#define EXT_CSD_CARD_TYPE_MASK 0x3 /* Mask out reserved and DDR bits */
271 272
272#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ 273#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */
273#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ 274#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h
new file mode 100644
index 000000000000..d37aac49cf9a
--- /dev/null
+++ b/include/linux/mmc/pm.h
@@ -0,0 +1,30 @@
1/*
2 * linux/include/linux/mmc/pm.h
3 *
4 * Author: Nicolas Pitre
5 * Copyright: (C) 2009 Marvell Technology Group Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef LINUX_MMC_PM_H
13#define LINUX_MMC_PM_H
14
15/*
16 * These flags are used to describe power management features that
17 * some cards (typically SDIO cards) might wish to benefit from when
18 * the host system is being suspended. There are several layers of
19 * abstractions involved, from the host controller driver, to the MMC core
20 * code, to the SDIO core code, to finally get to the actual SDIO function
21 * driver. This file is therefore used for common definitions shared across
22 * all those layers.
23 */
24
25typedef unsigned int mmc_pm_flag_t;
26
27#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */
28#define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */
29
30#endif
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
index 47ba464f5170..0ebaef577ff5 100644
--- a/include/linux/mmc/sdio.h
+++ b/include/linux/mmc/sdio.h
@@ -95,6 +95,8 @@
95#define SDIO_BUS_WIDTH_1BIT 0x00 95#define SDIO_BUS_WIDTH_1BIT 0x00
96#define SDIO_BUS_WIDTH_4BIT 0x02 96#define SDIO_BUS_WIDTH_4BIT 0x02
97 97
98#define SDIO_BUS_ASYNC_INT 0x20
99
98#define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */ 100#define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */
99 101
100#define SDIO_CCCR_CAPS 0x08 102#define SDIO_CCCR_CAPS 0x08
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index ac3ab683fec6..c6c0cceba5fe 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -15,6 +15,8 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/mod_devicetable.h> 16#include <linux/mod_devicetable.h>
17 17
18#include <linux/mmc/pm.h>
19
18struct mmc_card; 20struct mmc_card;
19struct sdio_func; 21struct sdio_func;
20 22
@@ -153,5 +155,8 @@ extern unsigned char sdio_f0_readb(struct sdio_func *func,
153extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b, 155extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b,
154 unsigned int addr, int *err_ret); 156 unsigned int addr, int *err_ret);
155 157
158extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
159extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
160
156#endif 161#endif
157 162
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index 8a5509877192..ee24ef8ab616 100644
--- a/include/linux/mmdebug.h
+++ b/include/linux/mmdebug.h
@@ -1,8 +1,6 @@
1#ifndef LINUX_MM_DEBUG_H 1#ifndef LINUX_MM_DEBUG_H
2#define LINUX_MM_DEBUG_H 1 2#define LINUX_MM_DEBUG_H 1
3 3
4#include <linux/autoconf.h>
5
6#ifdef CONFIG_DEBUG_VM 4#ifdef CONFIG_DEBUG_VM
7#define VM_BUG_ON(cond) BUG_ON(cond) 5#define VM_BUG_ON(cond) BUG_ON(cond)
8#else 6#else
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 6f7561730d88..cf9e458e96b0 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -15,7 +15,7 @@
15#include <linux/seqlock.h> 15#include <linux/seqlock.h>
16#include <linux/nodemask.h> 16#include <linux/nodemask.h>
17#include <linux/pageblock-flags.h> 17#include <linux/pageblock-flags.h>
18#include <linux/bounds.h> 18#include <generated/bounds.h>
19#include <asm/atomic.h> 19#include <asm/atomic.h>
20#include <asm/page.h> 20#include <asm/page.h>
21 21
@@ -184,13 +184,7 @@ struct per_cpu_pageset {
184 s8 stat_threshold; 184 s8 stat_threshold;
185 s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS]; 185 s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS];
186#endif 186#endif
187} ____cacheline_aligned_in_smp; 187};
188
189#ifdef CONFIG_NUMA
190#define zone_pcp(__z, __cpu) ((__z)->pageset[(__cpu)])
191#else
192#define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)])
193#endif
194 188
195#endif /* !__GENERATING_BOUNDS.H */ 189#endif /* !__GENERATING_BOUNDS.H */
196 190
@@ -306,14 +300,13 @@ struct zone {
306 */ 300 */
307 unsigned long min_unmapped_pages; 301 unsigned long min_unmapped_pages;
308 unsigned long min_slab_pages; 302 unsigned long min_slab_pages;
309 struct per_cpu_pageset *pageset[NR_CPUS];
310#else
311 struct per_cpu_pageset pageset[NR_CPUS];
312#endif 303#endif
304 struct per_cpu_pageset __percpu *pageset;
313 /* 305 /*
314 * free areas of different sizes 306 * free areas of different sizes
315 */ 307 */
316 spinlock_t lock; 308 spinlock_t lock;
309 int all_unreclaimable; /* All pages pinned */
317#ifdef CONFIG_MEMORY_HOTPLUG 310#ifdef CONFIG_MEMORY_HOTPLUG
318 /* see spanned/present_pages for more description */ 311 /* see spanned/present_pages for more description */
319 seqlock_t span_seqlock; 312 seqlock_t span_seqlock;
@@ -349,7 +342,7 @@ struct zone {
349 * prev_priority holds the scanning priority for this zone. It is 342 * prev_priority holds the scanning priority for this zone. It is
350 * defined as the scanning priority at which we achieved our reclaim 343 * defined as the scanning priority at which we achieved our reclaim
351 * target at the previous try_to_free_pages() or balance_pgdat() 344 * target at the previous try_to_free_pages() or balance_pgdat()
352 * invokation. 345 * invocation.
353 * 346 *
354 * We use prev_priority as a measure of how much stress page reclaim is 347 * We use prev_priority as a measure of how much stress page reclaim is
355 * under - it drives the swappiness decision: whether to unmap mapped 348 * under - it drives the swappiness decision: whether to unmap mapped
@@ -425,7 +418,6 @@ struct zone {
425} ____cacheline_internodealigned_in_smp; 418} ____cacheline_internodealigned_in_smp;
426 419
427typedef enum { 420typedef enum {
428 ZONE_ALL_UNRECLAIMABLE, /* all pages pinned */
429 ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */ 421 ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */
430 ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */ 422 ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */
431} zone_flags_t; 423} zone_flags_t;
@@ -445,11 +437,6 @@ static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag)
445 clear_bit(flag, &zone->flags); 437 clear_bit(flag, &zone->flags);
446} 438}
447 439
448static inline int zone_is_all_unreclaimable(const struct zone *zone)
449{
450 return test_bit(ZONE_ALL_UNRECLAIMABLE, &zone->flags);
451}
452
453static inline int zone_is_reclaim_locked(const struct zone *zone) 440static inline int zone_is_reclaim_locked(const struct zone *zone)
454{ 441{
455 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); 442 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags);
@@ -620,7 +607,9 @@ typedef struct pglist_data {
620 struct page_cgroup *node_page_cgroup; 607 struct page_cgroup *node_page_cgroup;
621#endif 608#endif
622#endif 609#endif
610#ifndef CONFIG_NO_BOOTMEM
623 struct bootmem_data *bdata; 611 struct bootmem_data *bdata;
612#endif
624#ifdef CONFIG_MEMORY_HOTPLUG 613#ifdef CONFIG_MEMORY_HOTPLUG
625 /* 614 /*
626 * Must be held any time you expect node_start_pfn, node_present_pages 615 * Must be held any time you expect node_start_pfn, node_present_pages
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index d74785c2393a..0b89efc6f215 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -35,6 +35,7 @@ static inline void get_mnt_ns(struct mnt_namespace *ns)
35extern const struct seq_operations mounts_op; 35extern const struct seq_operations mounts_op;
36extern const struct seq_operations mountinfo_op; 36extern const struct seq_operations mountinfo_op;
37extern const struct seq_operations mountstats_op; 37extern const struct seq_operations mountstats_op;
38extern int mnt_had_events(struct proc_mounts *);
38 39
39#endif 40#endif
40#endif 41#endif
diff --git a/include/linux/module.h b/include/linux/module.h
index 482efc865acf..5e869ffd34aa 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -17,7 +17,7 @@
17#include <linux/moduleparam.h> 17#include <linux/moduleparam.h>
18#include <linux/tracepoint.h> 18#include <linux/tracepoint.h>
19 19
20#include <asm/local.h> 20#include <linux/percpu.h>
21#include <asm/module.h> 21#include <asm/module.h>
22 22
23#include <trace/events/module.h> 23#include <trace/events/module.h>
@@ -25,8 +25,10 @@
25/* Not Yet Implemented */ 25/* Not Yet Implemented */
26#define MODULE_SUPPORTED_DEVICE(name) 26#define MODULE_SUPPORTED_DEVICE(name)
27 27
28/* some toolchains uses a `_' prefix for all user symbols */ 28/* Some toolchains use a `_' prefix for all user symbols. */
29#ifndef MODULE_SYMBOL_PREFIX 29#ifdef CONFIG_SYMBOL_PREFIX
30#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
31#else
30#define MODULE_SYMBOL_PREFIX "" 32#define MODULE_SYMBOL_PREFIX ""
31#endif 33#endif
32 34
@@ -173,6 +175,7 @@ struct notifier_block;
173 175
174#ifdef CONFIG_MODULES 176#ifdef CONFIG_MODULES
175 177
178extern int modules_disabled; /* for sysctl */
176/* Get/put a kernel symbol (calls must be symmetric) */ 179/* Get/put a kernel symbol (calls must be symmetric) */
177void *__symbol_get(const char *symbol); 180void *__symbol_get(const char *symbol);
178void *__symbol_get_gpl(const char *symbol); 181void *__symbol_get_gpl(const char *symbol);
@@ -361,11 +364,9 @@ struct module
361 /* Destruction function. */ 364 /* Destruction function. */
362 void (*exit)(void); 365 void (*exit)(void);
363 366
364#ifdef CONFIG_SMP 367 struct module_ref {
365 char *refptr; 368 int count;
366#else 369 } __percpu *refptr;
367 local_t ref;
368#endif
369#endif 370#endif
370 371
371#ifdef CONFIG_CONSTRUCTORS 372#ifdef CONFIG_CONSTRUCTORS
@@ -452,25 +453,16 @@ void __symbol_put(const char *symbol);
452#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) 453#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x)
453void symbol_put_addr(void *addr); 454void symbol_put_addr(void *addr);
454 455
455static inline local_t *__module_ref_addr(struct module *mod, int cpu)
456{
457#ifdef CONFIG_SMP
458 return (local_t *) (mod->refptr + per_cpu_offset(cpu));
459#else
460 return &mod->ref;
461#endif
462}
463
464/* Sometimes we know we already have a refcount, and it's easier not 456/* Sometimes we know we already have a refcount, and it's easier not
465 to handle the error case (which only happens with rmmod --wait). */ 457 to handle the error case (which only happens with rmmod --wait). */
466static inline void __module_get(struct module *module) 458static inline void __module_get(struct module *module)
467{ 459{
468 if (module) { 460 if (module) {
469 unsigned int cpu = get_cpu(); 461 preempt_disable();
470 local_inc(__module_ref_addr(module, cpu)); 462 __this_cpu_inc(module->refptr->count);
471 trace_module_get(module, _THIS_IP_, 463 trace_module_get(module, _THIS_IP_,
472 local_read(__module_ref_addr(module, cpu))); 464 __this_cpu_read(module->refptr->count));
473 put_cpu(); 465 preempt_enable();
474 } 466 }
475} 467}
476 468
@@ -479,15 +471,17 @@ static inline int try_module_get(struct module *module)
479 int ret = 1; 471 int ret = 1;
480 472
481 if (module) { 473 if (module) {
482 unsigned int cpu = get_cpu(); 474 preempt_disable();
475
483 if (likely(module_is_live(module))) { 476 if (likely(module_is_live(module))) {
484 local_inc(__module_ref_addr(module, cpu)); 477 __this_cpu_inc(module->refptr->count);
485 trace_module_get(module, _THIS_IP_, 478 trace_module_get(module, _THIS_IP_,
486 local_read(__module_ref_addr(module, cpu))); 479 __this_cpu_read(module->refptr->count));
487 } 480 }
488 else 481 else
489 ret = 0; 482 ret = 0;
490 put_cpu(); 483
484 preempt_enable();
491 } 485 }
492 return ret; 486 return ret;
493} 487}
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 5d5275364867..4bd05474d11d 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -34,7 +34,18 @@ struct mnt_namespace;
34 34
35#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ 35#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */
36#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ 36#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */
37#define MNT_PNODE_MASK 0x3000 /* propagation flag mask */ 37/*
38 * MNT_SHARED_MASK is the set of flags that should be cleared when a
39 * mount becomes shared. Currently, this is only the flag that says a
40 * mount cannot be bind mounted, since this is how we create a mount
41 * that shares events with another mount. If you add a new MNT_*
42 * flag, consider how it interacts with shared mounts.
43 */
44#define MNT_SHARED_MASK (MNT_UNBINDABLE)
45#define MNT_PROPAGATION_MASK (MNT_SHARED | MNT_UNBINDABLE)
46
47
48#define MNT_INTERNAL 0x4000
38 49
39struct vfsmount { 50struct vfsmount {
40 struct list_head mnt_hash; 51 struct list_head mnt_hash;
@@ -66,7 +77,7 @@ struct vfsmount {
66 int mnt_pinned; 77 int mnt_pinned;
67 int mnt_ghosts; 78 int mnt_ghosts;
68#ifdef CONFIG_SMP 79#ifdef CONFIG_SMP
69 int *mnt_writers; 80 int __percpu *mnt_writers;
70#else 81#else
71 int mnt_writers; 82 int mnt_writers;
72#endif 83#endif
@@ -123,7 +134,6 @@ extern int do_add_mount(struct vfsmount *newmnt, struct path *path,
123 134
124extern void mark_mounts_for_expiry(struct list_head *mounts); 135extern void mark_mounts_for_expiry(struct list_head *mounts);
125 136
126extern spinlock_t vfsmount_lock;
127extern dev_t name_to_dev_t(char *name); 137extern dev_t name_to_dev_t(char *name);
128 138
129#endif /* _LINUX_MOUNT_H */ 139#endif /* _LINUX_MOUNT_H */
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index ce38f1caa5e1..34066e65fdeb 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -15,6 +15,7 @@
15#define MSDOS_DPB_BITS 4 /* log2(MSDOS_DPB) */ 15#define MSDOS_DPB_BITS 4 /* log2(MSDOS_DPB) */
16#define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry)) 16#define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
17#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */ 17#define MSDOS_DPS_BITS 4 /* log2(MSDOS_DPS) */
18#define MSDOS_LONGNAME 256 /* maximum name length */
18#define CF_LE_W(v) le16_to_cpu(v) 19#define CF_LE_W(v) le16_to_cpu(v)
19#define CF_LE_L(v) le32_to_cpu(v) 20#define CF_LE_L(v) le32_to_cpu(v)
20#define CT_LE_W(v) cpu_to_le16(v) 21#define CT_LE_W(v) cpu_to_le16(v)
@@ -47,8 +48,8 @@
47#define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */ 48#define DELETED_FLAG 0xe5 /* marks file as deleted when in name[0] */
48#define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG) 49#define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG)
49 50
51#define FAT_LFN_LEN 255 /* maximum long name length */
50#define MSDOS_NAME 11 /* maximum name length */ 52#define MSDOS_NAME 11 /* maximum name length */
51#define MSDOS_LONGNAME 256 /* maximum name length */
52#define MSDOS_SLOTS 21 /* max # of slots for short and long names */ 53#define MSDOS_SLOTS 21 /* max # of slots for short and long names */
53#define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */ 54#define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */
54#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */ 55#define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index fff8c53e5434..9c3757c5759d 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -19,22 +19,21 @@
19 19
20/** 20/**
21 * struct nand_bbt_descr - bad block table descriptor 21 * struct nand_bbt_descr - bad block table descriptor
22 * @options: options for this descriptor 22 * @options: options for this descriptor
23 * @pages: the page(s) where we find the bbt, used with 23 * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE
24 * option BBT_ABSPAGE when bbt is searched, 24 * when bbt is searched, then we store the found bbts pages here.
25 * then we store the found bbts pages here. 25 * Its an array and supports up to 8 chips now
26 * Its an array and supports up to 8 chips now 26 * @offs: offset of the pattern in the oob area of the page
27 * @offs: offset of the pattern in the oob area of the page 27 * @veroffs: offset of the bbt version counter in the oob are of the page
28 * @veroffs: offset of the bbt version counter in the oob area of the page 28 * @version: version read from the bbt page during scan
29 * @version: version read from the bbt page during scan 29 * @len: length of the pattern, if 0 no pattern check is performed
30 * @len: length of the pattern, if 0 no pattern check is performed 30 * @maxblocks: maximum number of blocks to search for a bbt. This number of
31 * @maxblocks: maximum number of blocks to search for a bbt. This 31 * blocks is reserved at the end of the device where the tables are
32 * number of blocks is reserved at the end of the device 32 * written.
33 * where the tables are written. 33 * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than
34 * @reserved_block_code: if non-0, this pattern denotes a reserved 34 * bad) block in the stored bbt
35 * (rather than bad) block in the stored bbt 35 * @pattern: pattern to identify bad block table or factory marked good /
36 * @pattern: pattern to identify bad block table or factory marked 36 * bad blocks, can be NULL, if len = 0
37 * good / bad blocks, can be NULL, if len = 0
38 * 37 *
39 * Descriptor for the bad block table marker and the descriptor for the 38 * Descriptor for the bad block table marker and the descriptor for the
40 * pattern which identifies good and bad blocks. The assumption is made 39 * pattern which identifies good and bad blocks. The assumption is made
@@ -90,7 +89,9 @@ struct nand_bbt_descr {
90/* 89/*
91 * Constants for oob configuration 90 * Constants for oob configuration
92 */ 91 */
93#define ONENAND_BADBLOCK_POS 0 92#define NAND_SMALL_BADBLOCK_POS 5
93#define NAND_LARGE_BADBLOCK_POS 0
94#define ONENAND_BADBLOCK_POS 0
94 95
95/* 96/*
96 * Bad block scanning errors 97 * Bad block scanning errors
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 88d3d8fbf9f2..df89f4275232 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -518,10 +518,11 @@ struct cfi_fixup {
518#define CFI_MFR_ANY 0xffff 518#define CFI_MFR_ANY 0xffff
519#define CFI_ID_ANY 0xffff 519#define CFI_ID_ANY 0xffff
520 520
521#define CFI_MFR_AMD 0x0001 521#define CFI_MFR_AMD 0x0001
522#define CFI_MFR_ATMEL 0x001F 522#define CFI_MFR_INTEL 0x0089
523#define CFI_MFR_SAMSUNG 0x00EC 523#define CFI_MFR_ATMEL 0x001F
524#define CFI_MFR_ST 0x0020 /* STMicroelectronics */ 524#define CFI_MFR_SAMSUNG 0x00EC
525#define CFI_MFR_ST 0x0020 /* STMicroelectronics */
525 526
526void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); 527void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups);
527 528
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h
index d4f38c5fd44e..d0bf422ae374 100644
--- a/include/linux/mtd/flashchip.h
+++ b/include/linux/mtd/flashchip.h
@@ -38,6 +38,15 @@ typedef enum {
38 FL_XIP_WHILE_ERASING, 38 FL_XIP_WHILE_ERASING,
39 FL_XIP_WHILE_WRITING, 39 FL_XIP_WHILE_WRITING,
40 FL_SHUTDOWN, 40 FL_SHUTDOWN,
41 /* These 2 come from nand_state_t, which has been unified here */
42 FL_READING,
43 FL_CACHEDPRG,
44 /* These 4 come from onenand_state_t, which has been unified here */
45 FL_RESETING,
46 FL_OTPING,
47 FL_PREPARING_ERASE,
48 FL_VERIFYING_ERASE,
49
41 FL_UNKNOWN 50 FL_UNKNOWN
42} flstate_t; 51} flstate_t;
43 52
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 7a232a9bdd62..ccab9dfc5217 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -21,6 +21,8 @@
21#include <linux/wait.h> 21#include <linux/wait.h>
22#include <linux/spinlock.h> 22#include <linux/spinlock.h>
23#include <linux/mtd/mtd.h> 23#include <linux/mtd/mtd.h>
24#include <linux/mtd/flashchip.h>
25#include <linux/mtd/bbm.h>
24 26
25struct mtd_info; 27struct mtd_info;
26/* Scan and identify a NAND device */ 28/* Scan and identify a NAND device */
@@ -168,7 +170,6 @@ typedef enum {
168/* Chip does not allow subpage writes */ 170/* Chip does not allow subpage writes */
169#define NAND_NO_SUBPAGE_WRITE 0x00000200 171#define NAND_NO_SUBPAGE_WRITE 0x00000200
170 172
171
172/* Options valid for Samsung large page devices */ 173/* Options valid for Samsung large page devices */
173#define NAND_SAMSUNG_LP_OPTIONS \ 174#define NAND_SAMSUNG_LP_OPTIONS \
174 (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) 175 (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK)
@@ -194,6 +195,9 @@ typedef enum {
194/* This option is defined if the board driver allocates its own buffers 195/* This option is defined if the board driver allocates its own buffers
195 (e.g. because it needs them DMA-coherent */ 196 (e.g. because it needs them DMA-coherent */
196#define NAND_OWN_BUFFERS 0x00040000 197#define NAND_OWN_BUFFERS 0x00040000
198/* Chip may not exist, so silence any errors in scan */
199#define NAND_SCAN_SILENT_NODEV 0x00080000
200
197/* Options set by nand scan */ 201/* Options set by nand scan */
198/* Nand scan has allocated controller struct */ 202/* Nand scan has allocated controller struct */
199#define NAND_CONTROLLER_ALLOC 0x80000000 203#define NAND_CONTROLLER_ALLOC 0x80000000
@@ -202,20 +206,6 @@ typedef enum {
202#define NAND_CI_CHIPNR_MSK 0x03 206#define NAND_CI_CHIPNR_MSK 0x03
203#define NAND_CI_CELLTYPE_MSK 0x0C 207#define NAND_CI_CELLTYPE_MSK 0x0C
204 208
205/*
206 * nand_state_t - chip states
207 * Enumeration for NAND flash chip state
208 */
209typedef enum {
210 FL_READY,
211 FL_READING,
212 FL_WRITING,
213 FL_ERASING,
214 FL_SYNCING,
215 FL_CACHEDPRG,
216 FL_PM_SUSPENDED,
217} nand_state_t;
218
219/* Keep gcc happy */ 209/* Keep gcc happy */
220struct nand_chip; 210struct nand_chip;
221 211
@@ -402,7 +392,7 @@ struct nand_chip {
402 uint8_t cellinfo; 392 uint8_t cellinfo;
403 int badblockpos; 393 int badblockpos;
404 394
405 nand_state_t state; 395 flstate_t state;
406 396
407 uint8_t *oob_poi; 397 uint8_t *oob_poi;
408 struct nand_hw_control *controller; 398 struct nand_hw_control *controller;
@@ -470,75 +460,6 @@ struct nand_manufacturers {
470extern struct nand_flash_dev nand_flash_ids[]; 460extern struct nand_flash_dev nand_flash_ids[];
471extern struct nand_manufacturers nand_manuf_ids[]; 461extern struct nand_manufacturers nand_manuf_ids[];
472 462
473/**
474 * struct nand_bbt_descr - bad block table descriptor
475 * @options: options for this descriptor
476 * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE
477 * when bbt is searched, then we store the found bbts pages here.
478 * Its an array and supports up to 8 chips now
479 * @offs: offset of the pattern in the oob area of the page
480 * @veroffs: offset of the bbt version counter in the oob are of the page
481 * @version: version read from the bbt page during scan
482 * @len: length of the pattern, if 0 no pattern check is performed
483 * @maxblocks: maximum number of blocks to search for a bbt. This number of
484 * blocks is reserved at the end of the device where the tables are
485 * written.
486 * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than
487 * bad) block in the stored bbt
488 * @pattern: pattern to identify bad block table or factory marked good /
489 * bad blocks, can be NULL, if len = 0
490 *
491 * Descriptor for the bad block table marker and the descriptor for the
492 * pattern which identifies good and bad blocks. The assumption is made
493 * that the pattern and the version count are always located in the oob area
494 * of the first block.
495 */
496struct nand_bbt_descr {
497 int options;
498 int pages[NAND_MAX_CHIPS];
499 int offs;
500 int veroffs;
501 uint8_t version[NAND_MAX_CHIPS];
502 int len;
503 int maxblocks;
504 int reserved_block_code;
505 uint8_t *pattern;
506};
507
508/* Options for the bad block table descriptors */
509
510/* The number of bits used per block in the bbt on the device */
511#define NAND_BBT_NRBITS_MSK 0x0000000F
512#define NAND_BBT_1BIT 0x00000001
513#define NAND_BBT_2BIT 0x00000002
514#define NAND_BBT_4BIT 0x00000004
515#define NAND_BBT_8BIT 0x00000008
516/* The bad block table is in the last good block of the device */
517#define NAND_BBT_LASTBLOCK 0x00000010
518/* The bbt is at the given page, else we must scan for the bbt */
519#define NAND_BBT_ABSPAGE 0x00000020
520/* The bbt is at the given page, else we must scan for the bbt */
521#define NAND_BBT_SEARCH 0x00000040
522/* bbt is stored per chip on multichip devices */
523#define NAND_BBT_PERCHIP 0x00000080
524/* bbt has a version counter at offset veroffs */
525#define NAND_BBT_VERSION 0x00000100
526/* Create a bbt if none axists */
527#define NAND_BBT_CREATE 0x00000200
528/* Search good / bad pattern through all pages of a block */
529#define NAND_BBT_SCANALLPAGES 0x00000400
530/* Scan block empty during good / bad block scan */
531#define NAND_BBT_SCANEMPTY 0x00000800
532/* Write bbt if neccecary */
533#define NAND_BBT_WRITE 0x00001000
534/* Read and write back block contents when writing bbt */
535#define NAND_BBT_SAVECONTENT 0x00002000
536/* Search good / bad pattern on the first and the second page */
537#define NAND_BBT_SCAN2NDPAGE 0x00004000
538
539/* The maximum number of blocks to scan for a bbt */
540#define NAND_BBT_SCAN_MAXBLOCKS 4
541
542extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd); 463extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
543extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs); 464extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs);
544extern int nand_default_bbt(struct mtd_info *mtd); 465extern int nand_default_bbt(struct mtd_info *mtd);
@@ -548,12 +469,6 @@ extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
548extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, 469extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
549 size_t * retlen, uint8_t * buf); 470 size_t * retlen, uint8_t * buf);
550 471
551/*
552* Constants for oob configuration
553*/
554#define NAND_SMALL_BADBLOCK_POS 5
555#define NAND_LARGE_BADBLOCK_POS 0
556
557/** 472/**
558 * struct platform_nand_chip - chip level device structure 473 * struct platform_nand_chip - chip level device structure
559 * @nr_chips: max. number of chips to scan for 474 * @nr_chips: max. number of chips to scan for
diff --git a/include/linux/mtd/nand_ecc.h b/include/linux/mtd/nand_ecc.h
index 052ea8ca2434..41bc013571d0 100644
--- a/include/linux/mtd/nand_ecc.h
+++ b/include/linux/mtd/nand_ecc.h
@@ -16,7 +16,13 @@
16struct mtd_info; 16struct mtd_info;
17 17
18/* 18/*
19 * Calculate 3 byte ECC code for 256 byte block 19 * Calculate 3 byte ECC code for eccsize byte block
20 */
21void __nand_calculate_ecc(const u_char *dat, unsigned int eccsize,
22 u_char *ecc_code);
23
24/*
25 * Calculate 3 byte ECC code for 256/512 byte block
20 */ 26 */
21int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); 27int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code);
22 28
@@ -27,7 +33,7 @@ int __nand_correct_data(u_char *dat, u_char *read_ecc, u_char *calc_ecc,
27 unsigned int eccsize); 33 unsigned int eccsize);
28 34
29/* 35/*
30 * Detect and correct a 1 bit error for 256 byte block 36 * Detect and correct a 1 bit error for 256/512 byte block
31 */ 37 */
32int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); 38int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc);
33 39
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 4e49f3350678..5509eb06b326 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/include/linux/mtd/onenand.h 2 * linux/include/linux/mtd/onenand.h
3 * 3 *
4 * Copyright (C) 2005-2007 Samsung Electronics 4 * Copyright © 2005-2009 Samsung Electronics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -14,6 +14,7 @@
14 14
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/completion.h> 16#include <linux/completion.h>
17#include <linux/mtd/flashchip.h>
17#include <linux/mtd/onenand_regs.h> 18#include <linux/mtd/onenand_regs.h>
18#include <linux/mtd/bbm.h> 19#include <linux/mtd/bbm.h>
19 20
@@ -25,22 +26,6 @@ extern int onenand_scan(struct mtd_info *mtd, int max_chips);
25/* Free resources held by the OneNAND device */ 26/* Free resources held by the OneNAND device */
26extern void onenand_release(struct mtd_info *mtd); 27extern void onenand_release(struct mtd_info *mtd);
27 28
28/*
29 * onenand_state_t - chip states
30 * Enumeration for OneNAND flash chip state
31 */
32typedef enum {
33 FL_READY,
34 FL_READING,
35 FL_WRITING,
36 FL_ERASING,
37 FL_SYNCING,
38 FL_LOCKING,
39 FL_RESETING,
40 FL_OTPING,
41 FL_PM_SUSPENDED,
42} onenand_state_t;
43
44/** 29/**
45 * struct onenand_bufferram - OneNAND BufferRAM Data 30 * struct onenand_bufferram - OneNAND BufferRAM Data
46 * @blockpage: block & page address in BufferRAM 31 * @blockpage: block & page address in BufferRAM
@@ -137,7 +122,7 @@ struct onenand_chip {
137 122
138 spinlock_t chip_lock; 123 spinlock_t chip_lock;
139 wait_queue_head_t wq; 124 wait_queue_head_t wq;
140 onenand_state_t state; 125 flstate_t state;
141 unsigned char *page_buf; 126 unsigned char *page_buf;
142 unsigned char *oob_buf; 127 unsigned char *oob_buf;
143 128
@@ -152,6 +137,8 @@ struct onenand_chip {
152/* 137/*
153 * Helper macros 138 * Helper macros
154 */ 139 */
140#define ONENAND_PAGES_PER_BLOCK (1<<6)
141
155#define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index) 142#define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index)
156#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1) 143#define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1)
157#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1) 144#define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1)
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index acadbf53a69f..cd6f3b431195 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -131,6 +131,8 @@
131#define ONENAND_CMD_LOCK_TIGHT (0x2C) 131#define ONENAND_CMD_LOCK_TIGHT (0x2C)
132#define ONENAND_CMD_UNLOCK_ALL (0x27) 132#define ONENAND_CMD_UNLOCK_ALL (0x27)
133#define ONENAND_CMD_ERASE (0x94) 133#define ONENAND_CMD_ERASE (0x94)
134#define ONENAND_CMD_MULTIBLOCK_ERASE (0x95)
135#define ONENAND_CMD_ERASE_VERIFY (0x71)
134#define ONENAND_CMD_RESET (0xF0) 136#define ONENAND_CMD_RESET (0xF0)
135#define ONENAND_CMD_OTP_ACCESS (0x65) 137#define ONENAND_CMD_OTP_ACCESS (0x65)
136#define ONENAND_CMD_READID (0x90) 138#define ONENAND_CMD_READID (0x90)
diff --git a/include/linux/mtd/pismo.h b/include/linux/mtd/pismo.h
new file mode 100644
index 000000000000..8dfb7e1421c5
--- /dev/null
+++ b/include/linux/mtd/pismo.h
@@ -0,0 +1,17 @@
1/*
2 * PISMO memory driver - http://www.pismoworld.org/
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License.
7 */
8#ifndef __LINUX_MTD_PISMO_H
9#define __LINUX_MTD_PISMO_H
10
11struct pismo_pdata {
12 void (*set_vpp)(void *, int);
13 void *vpp_data;
14 phys_addr_t cs_addrs[5];
15};
16
17#endif
diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h
index e77c1cea404d..ab77609ec337 100644
--- a/include/linux/mtd/sh_flctl.h
+++ b/include/linux/mtd/sh_flctl.h
@@ -51,6 +51,8 @@
51#define _4ECCCNTEN (0x1 << 24) 51#define _4ECCCNTEN (0x1 << 24)
52#define _4ECCEN (0x1 << 23) 52#define _4ECCEN (0x1 << 23)
53#define _4ECCCORRECT (0x1 << 22) 53#define _4ECCCORRECT (0x1 << 22)
54#define SHBUSSEL (0x1 << 20)
55#define SEL_16BIT (0x1 << 19)
54#define SNAND_E (0x1 << 18) /* SNAND (0=512 1=2048)*/ 56#define SNAND_E (0x1 << 18) /* SNAND (0=512 1=2048)*/
55#define QTSEL_E (0x1 << 17) 57#define QTSEL_E (0x1 << 17)
56#define ENDIAN (0x1 << 16) /* 1 = little endian */ 58#define ENDIAN (0x1 << 16) /* 1 = little endian */
@@ -96,6 +98,7 @@
96struct sh_flctl { 98struct sh_flctl {
97 struct mtd_info mtd; 99 struct mtd_info mtd;
98 struct nand_chip chip; 100 struct nand_chip chip;
101 struct platform_device *pdev;
99 void __iomem *reg; 102 void __iomem *reg;
100 103
101 uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */ 104 uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 028946750289..05b441d93642 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -72,8 +72,6 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
72 72
73extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, 73extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
74 int (*open)(struct inode *, struct file *)); 74 int (*open)(struct inode *, struct file *));
75extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
76extern void release_open_intent(struct nameidata *);
77 75
78extern struct dentry *lookup_one_len(const char *, struct dentry *, int); 76extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
79 77
diff --git a/include/linux/net.h b/include/linux/net.h
index 5e8083cacc8b..4157b5d42bd6 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -174,18 +174,22 @@ struct proto_ops {
174 struct poll_table_struct *wait); 174 struct poll_table_struct *wait);
175 int (*ioctl) (struct socket *sock, unsigned int cmd, 175 int (*ioctl) (struct socket *sock, unsigned int cmd,
176 unsigned long arg); 176 unsigned long arg);
177#ifdef CONFIG_COMPAT
177 int (*compat_ioctl) (struct socket *sock, unsigned int cmd, 178 int (*compat_ioctl) (struct socket *sock, unsigned int cmd,
178 unsigned long arg); 179 unsigned long arg);
180#endif
179 int (*listen) (struct socket *sock, int len); 181 int (*listen) (struct socket *sock, int len);
180 int (*shutdown) (struct socket *sock, int flags); 182 int (*shutdown) (struct socket *sock, int flags);
181 int (*setsockopt)(struct socket *sock, int level, 183 int (*setsockopt)(struct socket *sock, int level,
182 int optname, char __user *optval, unsigned int optlen); 184 int optname, char __user *optval, unsigned int optlen);
183 int (*getsockopt)(struct socket *sock, int level, 185 int (*getsockopt)(struct socket *sock, int level,
184 int optname, char __user *optval, int __user *optlen); 186 int optname, char __user *optval, int __user *optlen);
187#ifdef CONFIG_COMPAT
185 int (*compat_setsockopt)(struct socket *sock, int level, 188 int (*compat_setsockopt)(struct socket *sock, int level,
186 int optname, char __user *optval, unsigned int optlen); 189 int optname, char __user *optval, unsigned int optlen);
187 int (*compat_getsockopt)(struct socket *sock, int level, 190 int (*compat_getsockopt)(struct socket *sock, int level,
188 int optname, char __user *optval, int __user *optlen); 191 int optname, char __user *optval, int __user *optlen);
192#endif
189 int (*sendmsg) (struct kiocb *iocb, struct socket *sock, 193 int (*sendmsg) (struct kiocb *iocb, struct socket *sock,
190 struct msghdr *m, size_t total_len); 194 struct msghdr *m, size_t total_len);
191 int (*recvmsg) (struct kiocb *iocb, struct socket *sock, 195 int (*recvmsg) (struct kiocb *iocb, struct socket *sock,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a3fccc85b1a0..fa8b47637997 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -28,6 +28,7 @@
28#include <linux/if.h> 28#include <linux/if.h>
29#include <linux/if_ether.h> 29#include <linux/if_ether.h>
30#include <linux/if_packet.h> 30#include <linux/if_packet.h>
31#include <linux/if_link.h>
31 32
32#ifdef __KERNEL__ 33#ifdef __KERNEL__
33#include <linux/timer.h> 34#include <linux/timer.h>
@@ -136,7 +137,7 @@ static inline bool dev_xmit_complete(int rc)
136 * used. 137 * used.
137 */ 138 */
138 139
139#if defined(CONFIG_WLAN_80211) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) 140#if defined(CONFIG_WLAN) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
140# if defined(CONFIG_MAC80211_MESH) 141# if defined(CONFIG_MAC80211_MESH)
141# define LL_MAX_HEADER 128 142# define LL_MAX_HEADER 128
142# else 143# else
@@ -263,6 +264,17 @@ struct netdev_hw_addr_list {
263 int count; 264 int count;
264}; 265};
265 266
267#define netdev_uc_count(dev) ((dev)->uc.count)
268#define netdev_uc_empty(dev) ((dev)->uc.count == 0)
269#define netdev_for_each_uc_addr(ha, dev) \
270 list_for_each_entry(ha, &dev->uc.list, list)
271
272#define netdev_mc_count(dev) ((dev)->mc_count)
273#define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0)
274
275#define netdev_for_each_mc_addr(mclist, dev) \
276 for (mclist = dev->mc_list; mclist; mclist = mclist->next)
277
266struct hh_cache { 278struct hh_cache {
267 struct hh_cache *hh_next; /* Next entry */ 279 struct hh_cache *hh_next; /* Next entry */
268 atomic_t hh_refcnt; /* number of users */ 280 atomic_t hh_refcnt; /* number of users */
@@ -610,6 +622,13 @@ struct netdev_queue {
610 * this function is called when a VLAN id is unregistered. 622 * this function is called when a VLAN id is unregistered.
611 * 623 *
612 * void (*ndo_poll_controller)(struct net_device *dev); 624 * void (*ndo_poll_controller)(struct net_device *dev);
625 *
626 * SR-IOV management functions.
627 * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac);
628 * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos);
629 * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate);
630 * int (*ndo_get_vf_config)(struct net_device *dev,
631 * int vf, struct ifla_vf_info *ivf);
613 */ 632 */
614#define HAVE_NET_DEVICE_OPS 633#define HAVE_NET_DEVICE_OPS
615struct net_device_ops { 634struct net_device_ops {
@@ -621,30 +640,21 @@ struct net_device_ops {
621 struct net_device *dev); 640 struct net_device *dev);
622 u16 (*ndo_select_queue)(struct net_device *dev, 641 u16 (*ndo_select_queue)(struct net_device *dev,
623 struct sk_buff *skb); 642 struct sk_buff *skb);
624#define HAVE_CHANGE_RX_FLAGS
625 void (*ndo_change_rx_flags)(struct net_device *dev, 643 void (*ndo_change_rx_flags)(struct net_device *dev,
626 int flags); 644 int flags);
627#define HAVE_SET_RX_MODE
628 void (*ndo_set_rx_mode)(struct net_device *dev); 645 void (*ndo_set_rx_mode)(struct net_device *dev);
629#define HAVE_MULTICAST
630 void (*ndo_set_multicast_list)(struct net_device *dev); 646 void (*ndo_set_multicast_list)(struct net_device *dev);
631#define HAVE_SET_MAC_ADDR
632 int (*ndo_set_mac_address)(struct net_device *dev, 647 int (*ndo_set_mac_address)(struct net_device *dev,
633 void *addr); 648 void *addr);
634#define HAVE_VALIDATE_ADDR
635 int (*ndo_validate_addr)(struct net_device *dev); 649 int (*ndo_validate_addr)(struct net_device *dev);
636#define HAVE_PRIVATE_IOCTL
637 int (*ndo_do_ioctl)(struct net_device *dev, 650 int (*ndo_do_ioctl)(struct net_device *dev,
638 struct ifreq *ifr, int cmd); 651 struct ifreq *ifr, int cmd);
639#define HAVE_SET_CONFIG
640 int (*ndo_set_config)(struct net_device *dev, 652 int (*ndo_set_config)(struct net_device *dev,
641 struct ifmap *map); 653 struct ifmap *map);
642#define HAVE_CHANGE_MTU
643 int (*ndo_change_mtu)(struct net_device *dev, 654 int (*ndo_change_mtu)(struct net_device *dev,
644 int new_mtu); 655 int new_mtu);
645 int (*ndo_neigh_setup)(struct net_device *dev, 656 int (*ndo_neigh_setup)(struct net_device *dev,
646 struct neigh_parms *); 657 struct neigh_parms *);
647#define HAVE_TX_TIMEOUT
648 void (*ndo_tx_timeout) (struct net_device *dev); 658 void (*ndo_tx_timeout) (struct net_device *dev);
649 659
650 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); 660 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
@@ -656,9 +666,17 @@ struct net_device_ops {
656 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, 666 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
657 unsigned short vid); 667 unsigned short vid);
658#ifdef CONFIG_NET_POLL_CONTROLLER 668#ifdef CONFIG_NET_POLL_CONTROLLER
659#define HAVE_NETDEV_POLL
660 void (*ndo_poll_controller)(struct net_device *dev); 669 void (*ndo_poll_controller)(struct net_device *dev);
661#endif 670#endif
671 int (*ndo_set_vf_mac)(struct net_device *dev,
672 int queue, u8 *mac);
673 int (*ndo_set_vf_vlan)(struct net_device *dev,
674 int queue, u16 vlan, u8 qos);
675 int (*ndo_set_vf_tx_rate)(struct net_device *dev,
676 int vf, int rate);
677 int (*ndo_get_vf_config)(struct net_device *dev,
678 int vf,
679 struct ifla_vf_info *ivf);
662#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) 680#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
663 int (*ndo_fcoe_enable)(struct net_device *dev); 681 int (*ndo_fcoe_enable)(struct net_device *dev);
664 int (*ndo_fcoe_disable)(struct net_device *dev); 682 int (*ndo_fcoe_disable)(struct net_device *dev);
@@ -745,6 +763,7 @@ struct net_device {
745#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ 763#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */
746#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ 764#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */
747#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ 765#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
766#define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */
748 767
749 /* Segmentation offload features */ 768 /* Segmentation offload features */
750#define NETIF_F_GSO_SHIFT 16 769#define NETIF_F_GSO_SHIFT 16
@@ -905,7 +924,12 @@ struct net_device {
905 NETREG_UNREGISTERED, /* completed unregister todo */ 924 NETREG_UNREGISTERED, /* completed unregister todo */
906 NETREG_RELEASED, /* called free_netdev */ 925 NETREG_RELEASED, /* called free_netdev */
907 NETREG_DUMMY, /* dummy device for NAPI poll */ 926 NETREG_DUMMY, /* dummy device for NAPI poll */
908 } reg_state; 927 } reg_state:16;
928
929 enum {
930 RTNL_LINK_INITIALIZED,
931 RTNL_LINK_INITIALIZING,
932 } rtnl_link_state:16;
909 933
910 /* Called from unregister, can be used to call free_netdev */ 934 /* Called from unregister, can be used to call free_netdev */
911 void (*destructor)(struct net_device *dev); 935 void (*destructor)(struct net_device *dev);
@@ -953,6 +977,8 @@ struct net_device {
953 /* max exchange id for FCoE LRO by ddp */ 977 /* max exchange id for FCoE LRO by ddp */
954 unsigned int fcoe_ddp_xid; 978 unsigned int fcoe_ddp_xid;
955#endif 979#endif
980 /* n-tuple filter list attached to this device */
981 struct ethtool_rx_ntuple_list ethtool_ntuple_list;
956}; 982};
957#define to_net_dev(d) container_of(d, struct net_device, dev) 983#define to_net_dev(d) container_of(d, struct net_device, dev)
958 984
@@ -1009,6 +1035,15 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev)
1009 return 0; 1035 return 0;
1010} 1036}
1011 1037
1038#ifndef CONFIG_NET_NS
1039static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev)
1040{
1041 skb->dev = dev;
1042}
1043#else /* CONFIG_NET_NS */
1044void skb_set_dev(struct sk_buff *skb, struct net_device *dev);
1045#endif
1046
1012static inline bool netdev_uses_trailer_tags(struct net_device *dev) 1047static inline bool netdev_uses_trailer_tags(struct net_device *dev)
1013{ 1048{
1014#ifdef CONFIG_NET_DSA_TAG_TRAILER 1049#ifdef CONFIG_NET_DSA_TAG_TRAILER
@@ -1527,7 +1562,6 @@ extern int netif_rx(struct sk_buff *skb);
1527extern int netif_rx_ni(struct sk_buff *skb); 1562extern int netif_rx_ni(struct sk_buff *skb);
1528#define HAVE_NETIF_RECEIVE_SKB 1 1563#define HAVE_NETIF_RECEIVE_SKB 1
1529extern int netif_receive_skb(struct sk_buff *skb); 1564extern int netif_receive_skb(struct sk_buff *skb);
1530extern void napi_gro_flush(struct napi_struct *napi);
1531extern gro_result_t dev_gro_receive(struct napi_struct *napi, 1565extern gro_result_t dev_gro_receive(struct napi_struct *napi,
1532 struct sk_buff *skb); 1566 struct sk_buff *skb);
1533extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); 1567extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
@@ -1553,7 +1587,9 @@ extern int dev_valid_name(const char *name);
1553extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 1587extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
1554extern int dev_ethtool(struct net *net, struct ifreq *); 1588extern int dev_ethtool(struct net *net, struct ifreq *);
1555extern unsigned dev_get_flags(const struct net_device *); 1589extern unsigned dev_get_flags(const struct net_device *);
1590extern int __dev_change_flags(struct net_device *, unsigned int flags);
1556extern int dev_change_flags(struct net_device *, unsigned); 1591extern int dev_change_flags(struct net_device *, unsigned);
1592extern void __dev_notify_flags(struct net_device *, unsigned int old_flags);
1557extern int dev_change_name(struct net_device *, const char *); 1593extern int dev_change_name(struct net_device *, const char *);
1558extern int dev_set_alias(struct net_device *, const char *, size_t); 1594extern int dev_set_alias(struct net_device *, const char *, size_t);
1559extern int dev_change_net_namespace(struct net_device *, 1595extern int dev_change_net_namespace(struct net_device *,
@@ -2023,12 +2059,12 @@ static inline void skb_bond_set_mac_by_master(struct sk_buff *skb,
2023 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and 2059 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and
2024 * ARP on active-backup slaves with arp_validate enabled. 2060 * ARP on active-backup slaves with arp_validate enabled.
2025 */ 2061 */
2026static inline int skb_bond_should_drop(struct sk_buff *skb) 2062static inline int skb_bond_should_drop(struct sk_buff *skb,
2063 struct net_device *master)
2027{ 2064{
2028 struct net_device *dev = skb->dev;
2029 struct net_device *master = dev->master;
2030
2031 if (master) { 2065 if (master) {
2066 struct net_device *dev = skb->dev;
2067
2032 if (master->priv_flags & IFF_MASTER_ARPMON) 2068 if (master->priv_flags & IFF_MASTER_ARPMON)
2033 dev->last_rx = jiffies; 2069 dev->last_rx = jiffies;
2034 2070
@@ -2083,6 +2119,130 @@ static inline u32 dev_ethtool_get_flags(struct net_device *dev)
2083 return 0; 2119 return 0;
2084 return dev->ethtool_ops->get_flags(dev); 2120 return dev->ethtool_ops->get_flags(dev);
2085} 2121}
2122
2123/* Logging, debugging and troubleshooting/diagnostic helpers. */
2124
2125/* netdev_printk helpers, similar to dev_printk */
2126
2127static inline const char *netdev_name(const struct net_device *dev)
2128{
2129 if (dev->reg_state != NETREG_REGISTERED)
2130 return "(unregistered net_device)";
2131 return dev->name;
2132}
2133
2134#define netdev_printk(level, netdev, format, args...) \
2135 dev_printk(level, (netdev)->dev.parent, \
2136 "%s: " format, \
2137 netdev_name(netdev), ##args)
2138
2139#define netdev_emerg(dev, format, args...) \
2140 netdev_printk(KERN_EMERG, dev, format, ##args)
2141#define netdev_alert(dev, format, args...) \
2142 netdev_printk(KERN_ALERT, dev, format, ##args)
2143#define netdev_crit(dev, format, args...) \
2144 netdev_printk(KERN_CRIT, dev, format, ##args)
2145#define netdev_err(dev, format, args...) \
2146 netdev_printk(KERN_ERR, dev, format, ##args)
2147#define netdev_warn(dev, format, args...) \
2148 netdev_printk(KERN_WARNING, dev, format, ##args)
2149#define netdev_notice(dev, format, args...) \
2150 netdev_printk(KERN_NOTICE, dev, format, ##args)
2151#define netdev_info(dev, format, args...) \
2152 netdev_printk(KERN_INFO, dev, format, ##args)
2153
2154#if defined(DEBUG)
2155#define netdev_dbg(__dev, format, args...) \
2156 netdev_printk(KERN_DEBUG, __dev, format, ##args)
2157#elif defined(CONFIG_DYNAMIC_DEBUG)
2158#define netdev_dbg(__dev, format, args...) \
2159do { \
2160 dynamic_dev_dbg((__dev)->dev.parent, "%s: " format, \
2161 netdev_name(__dev), ##args); \
2162} while (0)
2163#else
2164#define netdev_dbg(__dev, format, args...) \
2165({ \
2166 if (0) \
2167 netdev_printk(KERN_DEBUG, __dev, format, ##args); \
2168 0; \
2169})
2170#endif
2171
2172#if defined(VERBOSE_DEBUG)
2173#define netdev_vdbg netdev_dbg
2174#else
2175
2176#define netdev_vdbg(dev, format, args...) \
2177({ \
2178 if (0) \
2179 netdev_printk(KERN_DEBUG, dev, format, ##args); \
2180 0; \
2181})
2182#endif
2183
2184/*
2185 * netdev_WARN() acts like dev_printk(), but with the key difference
2186 * of using a WARN/WARN_ON to get the message out, including the
2187 * file/line information and a backtrace.
2188 */
2189#define netdev_WARN(dev, format, args...) \
2190 WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args);
2191
2192/* netif printk helpers, similar to netdev_printk */
2193
2194#define netif_printk(priv, type, level, dev, fmt, args...) \
2195do { \
2196 if (netif_msg_##type(priv)) \
2197 netdev_printk(level, (dev), fmt, ##args); \
2198} while (0)
2199
2200#define netif_emerg(priv, type, dev, fmt, args...) \
2201 netif_printk(priv, type, KERN_EMERG, dev, fmt, ##args)
2202#define netif_alert(priv, type, dev, fmt, args...) \
2203 netif_printk(priv, type, KERN_ALERT, dev, fmt, ##args)
2204#define netif_crit(priv, type, dev, fmt, args...) \
2205 netif_printk(priv, type, KERN_CRIT, dev, fmt, ##args)
2206#define netif_err(priv, type, dev, fmt, args...) \
2207 netif_printk(priv, type, KERN_ERR, dev, fmt, ##args)
2208#define netif_warn(priv, type, dev, fmt, args...) \
2209 netif_printk(priv, type, KERN_WARNING, dev, fmt, ##args)
2210#define netif_notice(priv, type, dev, fmt, args...) \
2211 netif_printk(priv, type, KERN_NOTICE, dev, fmt, ##args)
2212#define netif_info(priv, type, dev, fmt, args...) \
2213 netif_printk(priv, type, KERN_INFO, (dev), fmt, ##args)
2214
2215#if defined(DEBUG)
2216#define netif_dbg(priv, type, dev, format, args...) \
2217 netif_printk(priv, type, KERN_DEBUG, dev, format, ##args)
2218#elif defined(CONFIG_DYNAMIC_DEBUG)
2219#define netif_dbg(priv, type, netdev, format, args...) \
2220do { \
2221 if (netif_msg_##type(priv)) \
2222 dynamic_dev_dbg((netdev)->dev.parent, \
2223 "%s: " format, \
2224 netdev_name(netdev), ##args); \
2225} while (0)
2226#else
2227#define netif_dbg(priv, type, dev, format, args...) \
2228({ \
2229 if (0) \
2230 netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
2231 0; \
2232})
2233#endif
2234
2235#if defined(VERBOSE_DEBUG)
2236#define netif_vdbg netdev_dbg
2237#else
2238#define netif_vdbg(priv, type, dev, format, args...) \
2239({ \
2240 if (0) \
2241 netif_printk(KERN_DEBUG, dev, format, ##args); \
2242 0; \
2243})
2244#endif
2245
2086#endif /* __KERNEL__ */ 2246#endif /* __KERNEL__ */
2087 2247
2088#endif /* _LINUX_NETDEVICE_H */ 2248#endif /* _LINUX_NETDEVICE_H */
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 48c54960773c..89341c32631a 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -114,15 +114,17 @@ struct nf_sockopt_ops {
114 int set_optmin; 114 int set_optmin;
115 int set_optmax; 115 int set_optmax;
116 int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); 116 int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len);
117#ifdef CONFIG_COMPAT
117 int (*compat_set)(struct sock *sk, int optval, 118 int (*compat_set)(struct sock *sk, int optval,
118 void __user *user, unsigned int len); 119 void __user *user, unsigned int len);
119 120#endif
120 int get_optmin; 121 int get_optmin;
121 int get_optmax; 122 int get_optmax;
122 int (*get)(struct sock *sk, int optval, void __user *user, int *len); 123 int (*get)(struct sock *sk, int optval, void __user *user, int *len);
124#ifdef CONFIG_COMPAT
123 int (*compat_get)(struct sock *sk, int optval, 125 int (*compat_get)(struct sock *sk, int optval,
124 void __user *user, int *len); 126 void __user *user, int *len);
125 127#endif
126 /* Use the module struct to lock set/get code in place */ 128 /* Use the module struct to lock set/get code in place */
127 struct module *owner; 129 struct module *owner;
128}; 130};
@@ -161,11 +163,8 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
161 struct sk_buff *skb, 163 struct sk_buff *skb,
162 struct net_device *indev, 164 struct net_device *indev,
163 struct net_device *outdev, 165 struct net_device *outdev,
164 int (*okfn)(struct sk_buff *), int thresh, 166 int (*okfn)(struct sk_buff *), int thresh)
165 int cond)
166{ 167{
167 if (!cond)
168 return 1;
169#ifndef CONFIG_NETFILTER_DEBUG 168#ifndef CONFIG_NETFILTER_DEBUG
170 if (list_empty(&nf_hooks[pf][hook])) 169 if (list_empty(&nf_hooks[pf][hook]))
171 return 1; 170 return 1;
@@ -177,7 +176,7 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
177 struct net_device *indev, struct net_device *outdev, 176 struct net_device *indev, struct net_device *outdev,
178 int (*okfn)(struct sk_buff *)) 177 int (*okfn)(struct sk_buff *))
179{ 178{
180 return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1); 179 return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN);
181} 180}
182 181
183/* Activate hook; either okfn or kfree_skb called, unless a hook 182/* Activate hook; either okfn or kfree_skb called, unless a hook
@@ -197,36 +196,49 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
197 coders :) 196 coders :)
198*/ 197*/
199 198
200/* This is gross, but inline doesn't cut it for avoiding the function 199static inline int
201 call in fast path: gcc doesn't inline (needs value tracking?). --RR */ 200NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct sk_buff *skb,
202 201 struct net_device *in, struct net_device *out,
203/* HX: It's slightly less gross now. */ 202 int (*okfn)(struct sk_buff *), int thresh)
203{
204 int ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, thresh);
205 if (ret == 1)
206 ret = okfn(skb);
207 return ret;
208}
204 209
205#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ 210static inline int
206({int __ret; \ 211NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb,
207if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh, 1)) == 1)\ 212 struct net_device *in, struct net_device *out,
208 __ret = (okfn)(skb); \ 213 int (*okfn)(struct sk_buff *), bool cond)
209__ret;}) 214{
215 int ret;
210 216
211#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \ 217 if (!cond ||
212({int __ret; \ 218 (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1))
213if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\ 219 ret = okfn(skb);
214 __ret = (okfn)(skb); \ 220 return ret;
215__ret;}) 221}
216 222
217#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ 223static inline int
218 NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) 224NF_HOOK(uint8_t pf, unsigned int hook, struct sk_buff *skb,
225 struct net_device *in, struct net_device *out,
226 int (*okfn)(struct sk_buff *))
227{
228 return NF_HOOK_THRESH(pf, hook, skb, in, out, okfn, INT_MIN);
229}
219 230
220/* Call setsockopt() */ 231/* Call setsockopt() */
221int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, 232int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
222 unsigned int len); 233 unsigned int len);
223int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, 234int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt,
224 int *len); 235 int *len);
225 236#ifdef CONFIG_COMPAT
226int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, 237int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval,
227 char __user *opt, unsigned int len); 238 char __user *opt, unsigned int len);
228int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, 239int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval,
229 char __user *opt, int *len); 240 char __user *opt, int *len);
241#endif
230 242
231/* Call this before modifying an existing packet: ensures it is 243/* Call this before modifying an existing packet: ensures it is
232 modifiable and linear to the point you care about (writable_len). 244 modifiable and linear to the point you care about (writable_len).
@@ -325,8 +337,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
325 struct sk_buff *skb, 337 struct sk_buff *skb,
326 struct net_device *indev, 338 struct net_device *indev,
327 struct net_device *outdev, 339 struct net_device *outdev,
328 int (*okfn)(struct sk_buff *), int thresh, 340 int (*okfn)(struct sk_buff *), int thresh)
329 int cond)
330{ 341{
331 return okfn(skb); 342 return okfn(skb);
332} 343}
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 2aea50399c0b..a5a63e41b8af 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -6,6 +6,7 @@ header-y += nfnetlink_queue.h
6header-y += xt_CLASSIFY.h 6header-y += xt_CLASSIFY.h
7header-y += xt_CONNMARK.h 7header-y += xt_CONNMARK.h
8header-y += xt_CONNSECMARK.h 8header-y += xt_CONNSECMARK.h
9header-y += xt_CT.h
9header-y += xt_DSCP.h 10header-y += xt_DSCP.h
10header-y += xt_LED.h 11header-y += xt_LED.h
11header-y += xt_MARK.h 12header-y += xt_MARK.h
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index a374787ed9b0..c608677dda60 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -72,6 +72,28 @@ enum ip_conntrack_status {
72 /* Connection has fixed timeout. */ 72 /* Connection has fixed timeout. */
73 IPS_FIXED_TIMEOUT_BIT = 10, 73 IPS_FIXED_TIMEOUT_BIT = 10,
74 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), 74 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
75
76 /* Conntrack is a template */
77 IPS_TEMPLATE_BIT = 11,
78 IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT),
79};
80
81/* Connection tracking event types */
82enum ip_conntrack_events {
83 IPCT_NEW, /* new conntrack */
84 IPCT_RELATED, /* related conntrack */
85 IPCT_DESTROY, /* destroyed conntrack */
86 IPCT_REPLY, /* connection has seen two-way traffic */
87 IPCT_ASSURED, /* connection status has changed to assured */
88 IPCT_PROTOINFO, /* protocol information has changed */
89 IPCT_HELPER, /* new helper has been set */
90 IPCT_MARK, /* new mark has been set */
91 IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */
92 IPCT_SECMARK, /* new security mark has been set */
93};
94
95enum ip_conntrack_expect_events {
96 IPEXP_NEW, /* new expectation */
75}; 97};
76 98
77#ifdef __KERNEL__ 99#ifdef __KERNEL__
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
index 23aa2ec6b7b7..ff8cfbcf3b81 100644
--- a/include/linux/netfilter/nf_conntrack_sip.h
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -14,6 +14,7 @@ enum sip_expectation_classes {
14 SIP_EXPECT_SIGNALLING, 14 SIP_EXPECT_SIGNALLING,
15 SIP_EXPECT_AUDIO, 15 SIP_EXPECT_AUDIO,
16 SIP_EXPECT_VIDEO, 16 SIP_EXPECT_VIDEO,
17 SIP_EXPECT_IMAGE,
17 __SIP_EXPECT_MAX 18 __SIP_EXPECT_MAX
18}; 19};
19#define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1) 20#define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1)
@@ -34,10 +35,10 @@ struct sdp_media_type {
34struct sip_handler { 35struct sip_handler {
35 const char *method; 36 const char *method;
36 unsigned int len; 37 unsigned int len;
37 int (*request)(struct sk_buff *skb, 38 int (*request)(struct sk_buff *skb, unsigned int dataoff,
38 const char **dptr, unsigned int *datalen, 39 const char **dptr, unsigned int *datalen,
39 unsigned int cseq); 40 unsigned int cseq);
40 int (*response)(struct sk_buff *skb, 41 int (*response)(struct sk_buff *skb, unsigned int dataoff,
41 const char **dptr, unsigned int *datalen, 42 const char **dptr, unsigned int *datalen,
42 unsigned int cseq, unsigned int code); 43 unsigned int cseq, unsigned int code);
43}; 44};
@@ -84,7 +85,8 @@ enum sip_header_types {
84 SIP_HDR_FROM, 85 SIP_HDR_FROM,
85 SIP_HDR_TO, 86 SIP_HDR_TO,
86 SIP_HDR_CONTACT, 87 SIP_HDR_CONTACT,
87 SIP_HDR_VIA, 88 SIP_HDR_VIA_UDP,
89 SIP_HDR_VIA_TCP,
88 SIP_HDR_EXPIRES, 90 SIP_HDR_EXPIRES,
89 SIP_HDR_CONTENT_LENGTH, 91 SIP_HDR_CONTENT_LENGTH,
90}; 92};
@@ -100,33 +102,40 @@ enum sdp_header_types {
100}; 102};
101 103
102extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, 104extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb,
105 unsigned int dataoff,
103 const char **dptr, 106 const char **dptr,
104 unsigned int *datalen); 107 unsigned int *datalen);
108extern void (*nf_nat_sip_seq_adjust_hook)(struct sk_buff *skb, s16 off);
105extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, 109extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb,
110 unsigned int dataoff,
106 const char **dptr, 111 const char **dptr,
107 unsigned int *datalen, 112 unsigned int *datalen,
108 struct nf_conntrack_expect *exp, 113 struct nf_conntrack_expect *exp,
109 unsigned int matchoff, 114 unsigned int matchoff,
110 unsigned int matchlen); 115 unsigned int matchlen);
111extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, 116extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb,
112 const char **dptr,
113 unsigned int dataoff, 117 unsigned int dataoff,
118 const char **dptr,
114 unsigned int *datalen, 119 unsigned int *datalen,
120 unsigned int sdpoff,
115 enum sdp_header_types type, 121 enum sdp_header_types type,
116 enum sdp_header_types term, 122 enum sdp_header_types term,
117 const union nf_inet_addr *addr); 123 const union nf_inet_addr *addr);
118extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, 124extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb,
125 unsigned int dataoff,
119 const char **dptr, 126 const char **dptr,
120 unsigned int *datalen, 127 unsigned int *datalen,
121 unsigned int matchoff, 128 unsigned int matchoff,
122 unsigned int matchlen, 129 unsigned int matchlen,
123 u_int16_t port); 130 u_int16_t port);
124extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, 131extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb,
125 const char **dptr,
126 unsigned int dataoff, 132 unsigned int dataoff,
133 const char **dptr,
127 unsigned int *datalen, 134 unsigned int *datalen,
135 unsigned int sdpoff,
128 const union nf_inet_addr *addr); 136 const union nf_inet_addr *addr);
129extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, 137extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb,
138 unsigned int dataoff,
130 const char **dptr, 139 const char **dptr,
131 unsigned int *datalen, 140 unsigned int *datalen,
132 struct nf_conntrack_expect *rtp_exp, 141 struct nf_conntrack_expect *rtp_exp,
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 49d321f3ccd2..361d6b5630ee 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -73,11 +73,11 @@ struct nfnetlink_subsystem {
73extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); 73extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
74extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); 74extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
75 75
76extern int nfnetlink_has_listeners(unsigned int group); 76extern int nfnetlink_has_listeners(struct net *net, unsigned int group);
77extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, 77extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group,
78 int echo, gfp_t flags); 78 int echo, gfp_t flags);
79extern void nfnetlink_set_err(u32 pid, u32 group, int error); 79extern int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error);
80extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); 80extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags);
81 81
82extern void nfnl_lock(void); 82extern void nfnl_lock(void);
83extern void nfnl_unlock(void); 83extern void nfnl_unlock(void);
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index ed4ef8d0b11b..9ed534c991b9 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -40,6 +40,7 @@ enum ctattr_type {
40 CTA_NAT_SEQ_ADJ_ORIG, 40 CTA_NAT_SEQ_ADJ_ORIG,
41 CTA_NAT_SEQ_ADJ_REPLY, 41 CTA_NAT_SEQ_ADJ_REPLY,
42 CTA_SECMARK, 42 CTA_SECMARK,
43 CTA_ZONE,
43 __CTA_MAX 44 __CTA_MAX
44}; 45};
45#define CTA_MAX (__CTA_MAX - 1) 46#define CTA_MAX (__CTA_MAX - 1)
@@ -159,6 +160,7 @@ enum ctattr_expect {
159 CTA_EXPECT_TIMEOUT, 160 CTA_EXPECT_TIMEOUT,
160 CTA_EXPECT_ID, 161 CTA_EXPECT_ID,
161 CTA_EXPECT_HELP_NAME, 162 CTA_EXPECT_HELP_NAME,
163 CTA_EXPECT_ZONE,
162 __CTA_EXPECT_MAX 164 __CTA_EXPECT_MAX
163}; 165};
164#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) 166#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1)
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 378f27ae7772..84c7c928e9eb 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -93,8 +93,7 @@ struct _xt_align {
93 __u64 u64; 93 __u64 u64;
94}; 94};
95 95
96#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \ 96#define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align))
97 & ~(__alignof__(struct _xt_align)-1))
98 97
99/* Standard return verdict, or do jump. */ 98/* Standard return verdict, or do jump. */
100#define XT_STANDARD_TARGET "" 99#define XT_STANDARD_TARGET ""
@@ -121,6 +120,7 @@ struct xt_counters_info {
121 120
122#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */ 121#define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */
123 122
123#ifndef __KERNEL__
124/* fn returns 0 to continue iteration */ 124/* fn returns 0 to continue iteration */
125#define XT_MATCH_ITERATE(type, e, fn, args...) \ 125#define XT_MATCH_ITERATE(type, e, fn, args...) \
126({ \ 126({ \
@@ -164,6 +164,22 @@ struct xt_counters_info {
164#define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \ 164#define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \
165 XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args) 165 XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
166 166
167#endif /* !__KERNEL__ */
168
169/* pos is normally a struct ipt_entry/ip6t_entry/etc. */
170#define xt_entry_foreach(pos, ehead, esize) \
171 for ((pos) = (typeof(pos))(ehead); \
172 (pos) < (typeof(pos))((char *)(ehead) + (esize)); \
173 (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset))
174
175/* can only be xt_entry_match, so no use of typeof here */
176#define xt_ematch_foreach(pos, entry) \
177 for ((pos) = (struct xt_entry_match *)entry->elems; \
178 (pos) < (struct xt_entry_match *)((char *)(entry) + \
179 (entry)->target_offset); \
180 (pos) = (struct xt_entry_match *)((char *)(pos) + \
181 (pos)->u.match_size))
182
167#ifdef __KERNEL__ 183#ifdef __KERNEL__
168 184
169#include <linux/netdevice.h> 185#include <linux/netdevice.h>
@@ -205,6 +221,7 @@ struct xt_match_param {
205 * @hook_mask: via which hooks the new rule is reachable 221 * @hook_mask: via which hooks the new rule is reachable
206 */ 222 */
207struct xt_mtchk_param { 223struct xt_mtchk_param {
224 struct net *net;
208 const char *table; 225 const char *table;
209 const void *entryinfo; 226 const void *entryinfo;
210 const struct xt_match *match; 227 const struct xt_match *match;
@@ -215,6 +232,7 @@ struct xt_mtchk_param {
215 232
216/* Match destructor parameters */ 233/* Match destructor parameters */
217struct xt_mtdtor_param { 234struct xt_mtdtor_param {
235 struct net *net;
218 const struct xt_match *match; 236 const struct xt_match *match;
219 void *matchinfo; 237 void *matchinfo;
220 u_int8_t family; 238 u_int8_t family;
@@ -247,6 +265,7 @@ struct xt_target_param {
247 * Other fields see above. 265 * Other fields see above.
248 */ 266 */
249struct xt_tgchk_param { 267struct xt_tgchk_param {
268 struct net *net;
250 const char *table; 269 const char *table;
251 const void *entryinfo; 270 const void *entryinfo;
252 const struct xt_target *target; 271 const struct xt_target *target;
@@ -257,6 +276,7 @@ struct xt_tgchk_param {
257 276
258/* Target destructor parameters */ 277/* Target destructor parameters */
259struct xt_tgdtor_param { 278struct xt_tgdtor_param {
279 struct net *net;
260 const struct xt_target *target; 280 const struct xt_target *target;
261 void *targinfo; 281 void *targinfo;
262 u_int8_t family; 282 u_int8_t family;
@@ -281,11 +301,11 @@ struct xt_match {
281 301
282 /* Called when entry of this type deleted. */ 302 /* Called when entry of this type deleted. */
283 void (*destroy)(const struct xt_mtdtor_param *); 303 void (*destroy)(const struct xt_mtdtor_param *);
284 304#ifdef CONFIG_COMPAT
285 /* Called when userspace align differs from kernel space one */ 305 /* Called when userspace align differs from kernel space one */
286 void (*compat_from_user)(void *dst, void *src); 306 void (*compat_from_user)(void *dst, const void *src);
287 int (*compat_to_user)(void __user *dst, void *src); 307 int (*compat_to_user)(void __user *dst, const void *src);
288 308#endif
289 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 309 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
290 struct module *me; 310 struct module *me;
291 311
@@ -294,7 +314,9 @@ struct xt_match {
294 314
295 const char *table; 315 const char *table;
296 unsigned int matchsize; 316 unsigned int matchsize;
317#ifdef CONFIG_COMPAT
297 unsigned int compatsize; 318 unsigned int compatsize;
319#endif
298 unsigned int hooks; 320 unsigned int hooks;
299 unsigned short proto; 321 unsigned short proto;
300 322
@@ -321,17 +343,19 @@ struct xt_target {
321 343
322 /* Called when entry of this type deleted. */ 344 /* Called when entry of this type deleted. */
323 void (*destroy)(const struct xt_tgdtor_param *); 345 void (*destroy)(const struct xt_tgdtor_param *);
324 346#ifdef CONFIG_COMPAT
325 /* Called when userspace align differs from kernel space one */ 347 /* Called when userspace align differs from kernel space one */
326 void (*compat_from_user)(void *dst, void *src); 348 void (*compat_from_user)(void *dst, const void *src);
327 int (*compat_to_user)(void __user *dst, void *src); 349 int (*compat_to_user)(void __user *dst, const void *src);
328 350#endif
329 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 351 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
330 struct module *me; 352 struct module *me;
331 353
332 const char *table; 354 const char *table;
333 unsigned int targetsize; 355 unsigned int targetsize;
356#ifdef CONFIG_COMPAT
334 unsigned int compatsize; 357 unsigned int compatsize;
358#endif
335 unsigned int hooks; 359 unsigned int hooks;
336 unsigned short proto; 360 unsigned short proto;
337 361
@@ -353,6 +377,7 @@ struct xt_table {
353 struct module *me; 377 struct module *me;
354 378
355 u_int8_t af; /* address/protocol family */ 379 u_int8_t af; /* address/protocol family */
380 int priority; /* hook order */
356 381
357 /* A unique name... */ 382 /* A unique name... */
358 const char name[XT_TABLE_MAXNAMELEN]; 383 const char name[XT_TABLE_MAXNAMELEN];
@@ -514,6 +539,9 @@ static inline unsigned long ifname_compare_aligned(const char *_a,
514 return ret; 539 return ret;
515} 540}
516 541
542extern struct nf_hook_ops *xt_hook_link(const struct xt_table *, nf_hookfn *);
543extern void xt_hook_unlink(const struct xt_table *, struct nf_hook_ops *);
544
517#ifdef CONFIG_COMPAT 545#ifdef CONFIG_COMPAT
518#include <net/compat.h> 546#include <net/compat.h>
519 547
@@ -554,11 +582,7 @@ struct compat_xt_entry_target {
554 * current task alignment */ 582 * current task alignment */
555 583
556struct compat_xt_counters { 584struct compat_xt_counters {
557#if defined(CONFIG_X86_64) || defined(CONFIG_IA64) 585 compat_u64 pcnt, bcnt; /* Packet and byte counters */
558 u_int32_t cnt[4];
559#else
560 u_int64_t cnt[2];
561#endif
562}; 586};
563 587
564struct compat_xt_counters_info { 588struct compat_xt_counters_info {
@@ -567,26 +591,32 @@ struct compat_xt_counters_info {
567 struct compat_xt_counters counters[0]; 591 struct compat_xt_counters counters[0];
568}; 592};
569 593
570#define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ 594struct _compat_xt_align {
571 & ~(__alignof__(struct compat_xt_counters)-1)) 595 __u8 u8;
596 __u16 u16;
597 __u32 u32;
598 compat_u64 u64;
599};
600
601#define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align))
572 602
573extern void xt_compat_lock(u_int8_t af); 603extern void xt_compat_lock(u_int8_t af);
574extern void xt_compat_unlock(u_int8_t af); 604extern void xt_compat_unlock(u_int8_t af);
575 605
576extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta); 606extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta);
577extern void xt_compat_flush_offsets(u_int8_t af); 607extern void xt_compat_flush_offsets(u_int8_t af);
578extern short xt_compat_calc_jump(u_int8_t af, unsigned int offset); 608extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset);
579 609
580extern int xt_compat_match_offset(const struct xt_match *match); 610extern int xt_compat_match_offset(const struct xt_match *match);
581extern int xt_compat_match_from_user(struct xt_entry_match *m, 611extern int xt_compat_match_from_user(struct xt_entry_match *m,
582 void **dstptr, unsigned int *size); 612 void **dstptr, unsigned int *size);
583extern int xt_compat_match_to_user(struct xt_entry_match *m, 613extern int xt_compat_match_to_user(const struct xt_entry_match *m,
584 void __user **dstptr, unsigned int *size); 614 void __user **dstptr, unsigned int *size);
585 615
586extern int xt_compat_target_offset(const struct xt_target *target); 616extern int xt_compat_target_offset(const struct xt_target *target);
587extern void xt_compat_target_from_user(struct xt_entry_target *t, 617extern void xt_compat_target_from_user(struct xt_entry_target *t,
588 void **dstptr, unsigned int *size); 618 void **dstptr, unsigned int *size);
589extern int xt_compat_target_to_user(struct xt_entry_target *t, 619extern int xt_compat_target_to_user(const struct xt_entry_target *t,
590 void __user **dstptr, unsigned int *size); 620 void __user **dstptr, unsigned int *size);
591 621
592#endif /* CONFIG_COMPAT */ 622#endif /* CONFIG_COMPAT */
diff --git a/include/linux/netfilter/xt_CT.h b/include/linux/netfilter/xt_CT.h
new file mode 100644
index 000000000000..1b564106891d
--- /dev/null
+++ b/include/linux/netfilter/xt_CT.h
@@ -0,0 +1,17 @@
1#ifndef _XT_CT_H
2#define _XT_CT_H
3
4#define XT_CT_NOTRACK 0x1
5
6struct xt_ct_target_info {
7 u_int16_t flags;
8 u_int16_t zone;
9 u_int32_t ct_events;
10 u_int32_t exp_events;
11 char helper[16];
12
13 /* Used internally by the kernel */
14 struct nf_conn *ct __attribute__((aligned(8)));
15};
16
17#endif /* _XT_CT_H */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index f2336523a9df..e9948c0560f6 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -211,9 +211,11 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e
211 return (void *)e + e->target_offset; 211 return (void *)e + e->target_offset;
212} 212}
213 213
214#ifndef __KERNEL__
214/* fn returns 0 to continue iteration */ 215/* fn returns 0 to continue iteration */
215#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ 216#define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
216 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args) 217 XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args)
218#endif
217 219
218/* 220/*
219 * Main firewall chains definitions and global var's definitions. 221 * Main firewall chains definitions and global var's definitions.
@@ -258,6 +260,7 @@ struct arpt_error {
258 .target.errorname = "ERROR", \ 260 .target.errorname = "ERROR", \
259} 261}
260 262
263extern void *arpt_alloc_initial_table(const struct xt_table *);
261extern struct xt_table *arpt_register_table(struct net *net, 264extern struct xt_table *arpt_register_table(struct net *net,
262 const struct xt_table *table, 265 const struct xt_table *table,
263 const struct arpt_replace *repl); 266 const struct arpt_replace *repl);
@@ -290,14 +293,6 @@ compat_arpt_get_target(struct compat_arpt_entry *e)
290 293
291#define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) 294#define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s)
292 295
293/* fn returns 0 to continue iteration */
294#define COMPAT_ARPT_ENTRY_ITERATE(entries, size, fn, args...) \
295 XT_ENTRY_ITERATE(struct compat_arpt_entry, entries, size, fn, ## args)
296
297#define COMPAT_ARPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
298 XT_ENTRY_ITERATE_CONTINUE(struct compat_arpt_entry, entries, size, n, \
299 fn, ## args)
300
301#endif /* CONFIG_COMPAT */ 296#endif /* CONFIG_COMPAT */
302#endif /*__KERNEL__*/ 297#endif /*__KERNEL__*/
303#endif /* _ARPTABLES_H */ 298#endif /* _ARPTABLES_H */
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index 3cc40c131cc3..1c6f0c5f530e 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -289,7 +289,7 @@ struct ebt_table {
289 ~(__alignof__(struct ebt_replace)-1)) 289 ~(__alignof__(struct ebt_replace)-1))
290extern struct ebt_table *ebt_register_table(struct net *net, 290extern struct ebt_table *ebt_register_table(struct net *net,
291 const struct ebt_table *table); 291 const struct ebt_table *table);
292extern void ebt_unregister_table(struct ebt_table *table); 292extern void ebt_unregister_table(struct net *net, struct ebt_table *table);
293extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, 293extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb,
294 const struct net_device *in, const struct net_device *out, 294 const struct net_device *in, const struct net_device *out,
295 struct ebt_table *table); 295 struct ebt_table *table);
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 27b3f5807305..704a7b6e8169 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -223,6 +223,7 @@ ipt_get_target(struct ipt_entry *e)
223 return (void *)e + e->target_offset; 223 return (void *)e + e->target_offset;
224} 224}
225 225
226#ifndef __KERNEL__
226/* fn returns 0 to continue iteration */ 227/* fn returns 0 to continue iteration */
227#define IPT_MATCH_ITERATE(e, fn, args...) \ 228#define IPT_MATCH_ITERATE(e, fn, args...) \
228 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) 229 XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args)
@@ -230,6 +231,7 @@ ipt_get_target(struct ipt_entry *e)
230/* fn returns 0 to continue iteration */ 231/* fn returns 0 to continue iteration */
231#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ 232#define IPT_ENTRY_ITERATE(entries, size, fn, args...) \
232 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) 233 XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args)
234#endif
233 235
234/* 236/*
235 * Main firewall chains definitions and global var's definitions. 237 * Main firewall chains definitions and global var's definitions.
@@ -242,7 +244,7 @@ extern void ipt_init(void) __init;
242extern struct xt_table *ipt_register_table(struct net *net, 244extern struct xt_table *ipt_register_table(struct net *net,
243 const struct xt_table *table, 245 const struct xt_table *table,
244 const struct ipt_replace *repl); 246 const struct ipt_replace *repl);
245extern void ipt_unregister_table(struct xt_table *table); 247extern void ipt_unregister_table(struct net *net, struct xt_table *table);
246 248
247/* Standard entry. */ 249/* Standard entry. */
248struct ipt_standard { 250struct ipt_standard {
@@ -282,6 +284,7 @@ struct ipt_error {
282 .target.errorname = "ERROR", \ 284 .target.errorname = "ERROR", \
283} 285}
284 286
287extern void *ipt_alloc_initial_table(const struct xt_table *);
285extern unsigned int ipt_do_table(struct sk_buff *skb, 288extern unsigned int ipt_do_table(struct sk_buff *skb,
286 unsigned int hook, 289 unsigned int hook,
287 const struct net_device *in, 290 const struct net_device *in,
@@ -312,19 +315,6 @@ compat_ipt_get_target(struct compat_ipt_entry *e)
312 315
313#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) 316#define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s)
314 317
315/* fn returns 0 to continue iteration */
316#define COMPAT_IPT_MATCH_ITERATE(e, fn, args...) \
317 XT_MATCH_ITERATE(struct compat_ipt_entry, e, fn, ## args)
318
319/* fn returns 0 to continue iteration */
320#define COMPAT_IPT_ENTRY_ITERATE(entries, size, fn, args...) \
321 XT_ENTRY_ITERATE(struct compat_ipt_entry, entries, size, fn, ## args)
322
323/* fn returns 0 to continue iteration */
324#define COMPAT_IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
325 XT_ENTRY_ITERATE_CONTINUE(struct compat_ipt_entry, entries, size, n, \
326 fn, ## args)
327
328#endif /* CONFIG_COMPAT */ 318#endif /* CONFIG_COMPAT */
329#endif /*__KERNEL__*/ 319#endif /*__KERNEL__*/
330#endif /* _IPTABLES_H */ 320#endif /* _IPTABLES_H */
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index d654873aa25a..1f7e300094cd 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -59,6 +59,7 @@
59enum nf_ip6_hook_priorities { 59enum nf_ip6_hook_priorities {
60 NF_IP6_PRI_FIRST = INT_MIN, 60 NF_IP6_PRI_FIRST = INT_MIN,
61 NF_IP6_PRI_CONNTRACK_DEFRAG = -400, 61 NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
62 NF_IP6_PRI_RAW = -300,
62 NF_IP6_PRI_SELINUX_FIRST = -225, 63 NF_IP6_PRI_SELINUX_FIRST = -225,
63 NF_IP6_PRI_CONNTRACK = -200, 64 NF_IP6_PRI_CONNTRACK = -200,
64 NF_IP6_PRI_MANGLE = -150, 65 NF_IP6_PRI_MANGLE = -150,
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index b31050d20ae4..e5ba03d783c6 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -280,6 +280,7 @@ ip6t_get_target(struct ip6t_entry *e)
280 return (void *)e + e->target_offset; 280 return (void *)e + e->target_offset;
281} 281}
282 282
283#ifndef __KERNEL__
283/* fn returns 0 to continue iteration */ 284/* fn returns 0 to continue iteration */
284#define IP6T_MATCH_ITERATE(e, fn, args...) \ 285#define IP6T_MATCH_ITERATE(e, fn, args...) \
285 XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args) 286 XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args)
@@ -287,6 +288,7 @@ ip6t_get_target(struct ip6t_entry *e)
287/* fn returns 0 to continue iteration */ 288/* fn returns 0 to continue iteration */
288#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ 289#define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
289 XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args) 290 XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args)
291#endif
290 292
291/* 293/*
292 * Main firewall chains definitions and global var's definitions. 294 * Main firewall chains definitions and global var's definitions.
@@ -297,10 +299,11 @@ ip6t_get_target(struct ip6t_entry *e)
297#include <linux/init.h> 299#include <linux/init.h>
298extern void ip6t_init(void) __init; 300extern void ip6t_init(void) __init;
299 301
302extern void *ip6t_alloc_initial_table(const struct xt_table *);
300extern struct xt_table *ip6t_register_table(struct net *net, 303extern struct xt_table *ip6t_register_table(struct net *net,
301 const struct xt_table *table, 304 const struct xt_table *table,
302 const struct ip6t_replace *repl); 305 const struct ip6t_replace *repl);
303extern void ip6t_unregister_table(struct xt_table *table); 306extern void ip6t_unregister_table(struct net *net, struct xt_table *table);
304extern unsigned int ip6t_do_table(struct sk_buff *skb, 307extern unsigned int ip6t_do_table(struct sk_buff *skb,
305 unsigned int hook, 308 unsigned int hook,
306 const struct net_device *in, 309 const struct net_device *in,
@@ -340,18 +343,6 @@ compat_ip6t_get_target(struct compat_ip6t_entry *e)
340 343
341#define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s) 344#define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s)
342 345
343/* fn returns 0 to continue iteration */
344#define COMPAT_IP6T_MATCH_ITERATE(e, fn, args...) \
345 XT_MATCH_ITERATE(struct compat_ip6t_entry, e, fn, ## args)
346
347/* fn returns 0 to continue iteration */
348#define COMPAT_IP6T_ENTRY_ITERATE(entries, size, fn, args...) \
349 XT_ENTRY_ITERATE(struct compat_ip6t_entry, entries, size, fn, ## args)
350
351#define COMPAT_IP6T_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \
352 XT_ENTRY_ITERATE_CONTINUE(struct compat_ip6t_entry, entries, size, n, \
353 fn, ## args)
354
355#endif /* CONFIG_COMPAT */ 346#endif /* CONFIG_COMPAT */
356#endif /*__KERNEL__*/ 347#endif /*__KERNEL__*/
357#endif /* _IP6_TABLES_H */ 348#endif /* _IP6_TABLES_H */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index fde27c017326..6eaca5e1e8ca 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -188,7 +188,7 @@ extern int netlink_has_listeners(struct sock *sk, unsigned int group);
188extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); 188extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
189extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, 189extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid,
190 __u32 group, gfp_t allocation); 190 __u32 group, gfp_t allocation);
191extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); 191extern int netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code);
192extern int netlink_register_notifier(struct notifier_block *nb); 192extern int netlink_register_notifier(struct notifier_block *nb);
193extern int netlink_unregister_notifier(struct notifier_block *nb); 193extern int netlink_unregister_notifier(struct notifier_block *nb);
194 194
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 2524267210d3..a765ea898549 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -21,15 +21,20 @@ struct netpoll {
21 __be32 local_ip, remote_ip; 21 __be32 local_ip, remote_ip;
22 u16 local_port, remote_port; 22 u16 local_port, remote_port;
23 u8 remote_mac[ETH_ALEN]; 23 u8 remote_mac[ETH_ALEN];
24
25 struct list_head rx; /* rx_np list element */
24}; 26};
25 27
26struct netpoll_info { 28struct netpoll_info {
27 atomic_t refcnt; 29 atomic_t refcnt;
30
28 int rx_flags; 31 int rx_flags;
29 spinlock_t rx_lock; 32 spinlock_t rx_lock;
30 struct netpoll *rx_np; /* netpoll that registered an rx_hook */ 33 struct list_head rx_np; /* netpolls that registered an rx_hook */
34
31 struct sk_buff_head arp_tx; /* list of arp requests to reply to */ 35 struct sk_buff_head arp_tx; /* list of arp requests to reply to */
32 struct sk_buff_head txq; 36 struct sk_buff_head txq;
37
33 struct delayed_work tx_work; 38 struct delayed_work tx_work;
34}; 39};
35 40
@@ -51,7 +56,7 @@ static inline int netpoll_rx(struct sk_buff *skb)
51 unsigned long flags; 56 unsigned long flags;
52 int ret = 0; 57 int ret = 0;
53 58
54 if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags)) 59 if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags))
55 return 0; 60 return 0;
56 61
57 spin_lock_irqsave(&npinfo->rx_lock, flags); 62 spin_lock_irqsave(&npinfo->rx_lock, flags);
@@ -67,7 +72,7 @@ static inline int netpoll_rx_on(struct sk_buff *skb)
67{ 72{
68 struct netpoll_info *npinfo = skb->dev->npinfo; 73 struct netpoll_info *npinfo = skb->dev->npinfo;
69 74
70 return npinfo && (npinfo->rx_np || npinfo->rx_flags); 75 return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags);
71} 76}
72 77
73static inline int netpoll_receive_skb(struct sk_buff *skb) 78static inline int netpoll_receive_skb(struct sk_buff *skb)
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index d09db1bc9083..1a0b85aa151e 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -33,9 +33,6 @@
33#define FLUSH_STABLE 4 /* commit to stable storage */ 33#define FLUSH_STABLE 4 /* commit to stable storage */
34#define FLUSH_LOWPRI 8 /* low priority background flush */ 34#define FLUSH_LOWPRI 8 /* low priority background flush */
35#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ 35#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
36#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */
37#define FLUSH_INVALIDATE 64 /* Invalidate the page cache */
38#define FLUSH_NOWRITEPAGE 128 /* Don't call writepage() */
39 36
40#ifdef __KERNEL__ 37#ifdef __KERNEL__
41 38
@@ -166,6 +163,7 @@ struct nfs_inode {
166 struct radix_tree_root nfs_page_tree; 163 struct radix_tree_root nfs_page_tree;
167 164
168 unsigned long npages; 165 unsigned long npages;
166 unsigned long ncommit;
169 167
170 /* Open contexts for shared mmap writes */ 168 /* Open contexts for shared mmap writes */
171 struct list_head open_files; 169 struct list_head open_files;
@@ -349,7 +347,6 @@ extern int nfs_attribute_timeout(struct inode *inode);
349extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); 347extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode);
350extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); 348extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *);
351extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); 349extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping);
352extern int nfs_revalidate_mapping_nolock(struct inode *inode, struct address_space *mapping);
353extern int nfs_setattr(struct dentry *, struct iattr *); 350extern int nfs_setattr(struct dentry *, struct iattr *);
354extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); 351extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
355extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 352extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
@@ -477,21 +474,12 @@ extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
477 * Try to write back everything synchronously (but check the 474 * Try to write back everything synchronously (but check the
478 * return value!) 475 * return value!)
479 */ 476 */
480extern long nfs_sync_mapping_wait(struct address_space *, struct writeback_control *, int);
481extern int nfs_wb_all(struct inode *inode); 477extern int nfs_wb_all(struct inode *inode);
482extern int nfs_wb_nocommit(struct inode *inode);
483extern int nfs_wb_page(struct inode *inode, struct page* page); 478extern int nfs_wb_page(struct inode *inode, struct page* page);
484extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); 479extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
485#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 480#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
486extern int nfs_commit_inode(struct inode *, int);
487extern struct nfs_write_data *nfs_commitdata_alloc(void); 481extern struct nfs_write_data *nfs_commitdata_alloc(void);
488extern void nfs_commit_free(struct nfs_write_data *wdata); 482extern void nfs_commit_free(struct nfs_write_data *wdata);
489#else
490static inline int
491nfs_commit_inode(struct inode *inode, int how)
492{
493 return 0;
494}
495#endif 483#endif
496 484
497static inline int 485static inline int
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 34fc6be5bfcf..717a5e54eb1d 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -105,7 +105,7 @@ struct nfs_server {
105 struct rpc_clnt * client; /* RPC client handle */ 105 struct rpc_clnt * client; /* RPC client handle */
106 struct rpc_clnt * client_acl; /* ACL RPC client handle */ 106 struct rpc_clnt * client_acl; /* ACL RPC client handle */
107 struct nlm_host *nlm_host; /* NLM client handle */ 107 struct nlm_host *nlm_host; /* NLM client handle */
108 struct nfs_iostats * io_stats; /* I/O statistics */ 108 struct nfs_iostats __percpu *io_stats; /* I/O statistics */
109 struct backing_dev_info backing_dev_info; 109 struct backing_dev_info backing_dev_info;
110 atomic_long_t writeback; /* number of writeback pages */ 110 atomic_long_t writeback; /* number of writeback pages */
111 int flags; /* various flags */ 111 int flags; /* various flags */
@@ -193,6 +193,8 @@ struct nfs4_slot_table {
193 int max_slots; /* # slots in table */ 193 int max_slots; /* # slots in table */
194 int highest_used_slotid; /* sent to server on each SEQ. 194 int highest_used_slotid; /* sent to server on each SEQ.
195 * op for dynamic resizing */ 195 * op for dynamic resizing */
196 int target_max_slots; /* Set by CB_RECALL_SLOT as
197 * the new max_slots */
196}; 198};
197 199
198static inline int slot_idx(struct nfs4_slot_table *tbl, struct nfs4_slot *sp) 200static inline int slot_idx(struct nfs4_slot_table *tbl, struct nfs4_slot *sp)
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 51071b335751..89b28812ec24 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -2,6 +2,7 @@
2#define _LINUX_NFS_XDR_H 2#define _LINUX_NFS_XDR_H
3 3
4#include <linux/nfsacl.h> 4#include <linux/nfsacl.h>
5#include <linux/nfs3.h>
5 6
6/* 7/*
7 * To change the maximum rsize and wsize supported by the NFS client, adjust 8 * To change the maximum rsize and wsize supported by the NFS client, adjust
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h
index 43011b69297c..f321b578edeb 100644
--- a/include/linux/nfsacl.h
+++ b/include/linux/nfsacl.h
@@ -29,6 +29,7 @@
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <linux/posix_acl.h> 31#include <linux/posix_acl.h>
32#include <linux/sunrpc/xdr.h>
32 33
33/* Maximum number of ACL entries over NFS */ 34/* Maximum number of ACL entries over NFS */
34#define NFS_ACL_MAX_ENTRIES 1024 35#define NFS_ACL_MAX_ENTRIES 1024
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
deleted file mode 100644
index 3a3f58934f5e..000000000000
--- a/include/linux/nfsd/cache.h
+++ /dev/null
@@ -1,86 +0,0 @@
1/*
2 * include/linux/nfsd/cache.h
3 *
4 * Request reply cache. This was heavily inspired by the
5 * implementation in 4.3BSD/4.4BSD.
6 *
7 * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
8 */
9
10#ifndef NFSCACHE_H
11#define NFSCACHE_H
12
13#include <linux/in.h>
14#include <linux/uio.h>
15
16/*
17 * Representation of a reply cache entry.
18 */
19struct svc_cacherep {
20 struct hlist_node c_hash;
21 struct list_head c_lru;
22
23 unsigned char c_state, /* unused, inprog, done */
24 c_type, /* status, buffer */
25 c_secure : 1; /* req came from port < 1024 */
26 struct sockaddr_in c_addr;
27 __be32 c_xid;
28 u32 c_prot;
29 u32 c_proc;
30 u32 c_vers;
31 unsigned long c_timestamp;
32 union {
33 struct kvec u_vec;
34 __be32 u_status;
35 } c_u;
36};
37
38#define c_replvec c_u.u_vec
39#define c_replstat c_u.u_status
40
41/* cache entry states */
42enum {
43 RC_UNUSED,
44 RC_INPROG,
45 RC_DONE
46};
47
48/* return values */
49enum {
50 RC_DROPIT,
51 RC_REPLY,
52 RC_DOIT,
53 RC_INTR
54};
55
56/*
57 * Cache types.
58 * We may want to add more types one day, e.g. for diropres and
59 * attrstat replies. Using cache entries with fixed length instead
60 * of buffer pointers may be more efficient.
61 */
62enum {
63 RC_NOCACHE,
64 RC_REPLSTAT,
65 RC_REPLBUFF,
66};
67
68/*
69 * If requests are retransmitted within this interval, they're dropped.
70 */
71#define RC_DELAY (HZ/5)
72
73int nfsd_reply_cache_init(void);
74void nfsd_reply_cache_shutdown(void);
75int nfsd_cache_lookup(struct svc_rqst *, int);
76void nfsd_cache_update(struct svc_rqst *, int, __be32 *);
77
78#ifdef CONFIG_NFSD_V4
79void nfsd4_set_statp(struct svc_rqst *rqstp, __be32 *statp);
80#else /* CONFIG_NFSD_V4 */
81static inline void nfsd4_set_statp(struct svc_rqst *rqstp, __be32 *statp)
82{
83}
84#endif /* CONFIG_NFSD_V4 */
85
86#endif /* NFSCACHE_H */
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index a6d9ef2bb34a..8ae78a61eea4 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -12,7 +12,7 @@
12 12
13# include <linux/types.h> 13# include <linux/types.h>
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15# include <linux/in.h> 15# include <linux/nfsd/nfsfh.h>
16#endif 16#endif
17 17
18/* 18/*
@@ -39,11 +39,23 @@
39#define NFSEXP_FSID 0x2000 39#define NFSEXP_FSID 0x2000
40#define NFSEXP_CROSSMOUNT 0x4000 40#define NFSEXP_CROSSMOUNT 0x4000
41#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ 41#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */
42#define NFSEXP_ALLFLAGS 0xFE3F 42/*
43 * The NFSEXP_V4ROOT flag causes the kernel to give access only to NFSv4
44 * clients, and only to the single directory that is the root of the
45 * export; further lookup and readdir operations are treated as if every
46 * subdirectory was a mountpoint, and ignored if they are not themselves
47 * exported. This is used by nfsd and mountd to construct the NFSv4
48 * pseudofilesystem, which provides access only to paths leading to each
49 * exported filesystem.
50 */
51#define NFSEXP_V4ROOT 0x10000
52/* All flags that we claim to support. (Note we don't support NOACL.) */
53#define NFSEXP_ALLFLAGS 0x17E3F
43 54
44/* The flags that may vary depending on security flavor: */ 55/* The flags that may vary depending on security flavor: */
45#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ 56#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
46 | NFSEXP_ALLSQUASH) 57 | NFSEXP_ALLSQUASH \
58 | NFSEXP_INSECURE_PORT)
47 59
48#ifdef __KERNEL__ 60#ifdef __KERNEL__
49 61
@@ -108,7 +120,6 @@ struct svc_expkey {
108 struct path ek_path; 120 struct path ek_path;
109}; 121};
110 122
111#define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT))
112#define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) 123#define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC))
113#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) 124#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE)
114#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) 125#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
deleted file mode 100644
index 510ffdd5020e..000000000000
--- a/include/linux/nfsd/nfsd.h
+++ /dev/null
@@ -1,424 +0,0 @@
1/*
2 * linux/include/linux/nfsd/nfsd.h
3 *
4 * Hodge-podge collection of knfsd-related stuff.
5 * I will sort this out later.
6 *
7 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
8 */
9
10#ifndef LINUX_NFSD_NFSD_H
11#define LINUX_NFSD_NFSD_H
12
13#include <linux/types.h>
14#include <linux/unistd.h>
15#include <linux/fs.h>
16#include <linux/posix_acl.h>
17#include <linux/mount.h>
18
19#include <linux/nfsd/debug.h>
20#include <linux/nfsd/nfsfh.h>
21#include <linux/nfsd/export.h>
22#include <linux/nfsd/stats.h>
23/*
24 * nfsd version
25 */
26#define NFSD_SUPPORTED_MINOR_VERSION 1
27
28/*
29 * Flags for nfsd_permission
30 */
31#define NFSD_MAY_NOP 0
32#define NFSD_MAY_EXEC 1 /* == MAY_EXEC */
33#define NFSD_MAY_WRITE 2 /* == MAY_WRITE */
34#define NFSD_MAY_READ 4 /* == MAY_READ */
35#define NFSD_MAY_SATTR 8
36#define NFSD_MAY_TRUNC 16
37#define NFSD_MAY_LOCK 32
38#define NFSD_MAY_OWNER_OVERRIDE 64
39#define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/
40#define NFSD_MAY_BYPASS_GSS_ON_ROOT 256
41
42#define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE)
43#define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC)
44
45/*
46 * Callback function for readdir
47 */
48struct readdir_cd {
49 __be32 err; /* 0, nfserr, or nfserr_eof */
50};
51typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);
52
53extern struct svc_program nfsd_program;
54extern struct svc_version nfsd_version2, nfsd_version3,
55 nfsd_version4;
56extern u32 nfsd_supported_minorversion;
57extern struct mutex nfsd_mutex;
58extern struct svc_serv *nfsd_serv;
59extern spinlock_t nfsd_drc_lock;
60extern unsigned int nfsd_drc_max_mem;
61extern unsigned int nfsd_drc_mem_used;
62
63extern const struct seq_operations nfs_exports_op;
64
65/*
66 * Function prototypes.
67 */
68int nfsd_svc(unsigned short port, int nrservs);
69int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp);
70
71int nfsd_nrthreads(void);
72int nfsd_nrpools(void);
73int nfsd_get_nrthreads(int n, int *);
74int nfsd_set_nrthreads(int n, int *);
75
76/* nfsd/vfs.c */
77int fh_lock_parent(struct svc_fh *, struct dentry *);
78int nfsd_racache_init(int);
79void nfsd_racache_shutdown(void);
80int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
81 struct svc_export **expp);
82__be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *,
83 const char *, unsigned int, struct svc_fh *);
84__be32 nfsd_lookup_dentry(struct svc_rqst *, struct svc_fh *,
85 const char *, unsigned int,
86 struct svc_export **, struct dentry **);
87__be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *,
88 struct iattr *, int, time_t);
89#ifdef CONFIG_NFSD_V4
90__be32 nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *,
91 struct nfs4_acl *);
92int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **);
93#endif /* CONFIG_NFSD_V4 */
94__be32 nfsd_create(struct svc_rqst *, struct svc_fh *,
95 char *name, int len, struct iattr *attrs,
96 int type, dev_t rdev, struct svc_fh *res);
97#ifdef CONFIG_NFSD_V3
98__be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
99__be32 nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
100 char *name, int len, struct iattr *attrs,
101 struct svc_fh *res, int createmode,
102 u32 *verifier, int *truncp, int *created);
103__be32 nfsd_commit(struct svc_rqst *, struct svc_fh *,
104 loff_t, unsigned long);
105#endif /* CONFIG_NFSD_V3 */
106__be32 nfsd_open(struct svc_rqst *, struct svc_fh *, int,
107 int, struct file **);
108void nfsd_close(struct file *);
109__be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
110 loff_t, struct kvec *, int, unsigned long *);
111__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
112 loff_t, struct kvec *,int, unsigned long *, int *);
113__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
114 char *, int *);
115__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
116 char *name, int len, char *path, int plen,
117 struct svc_fh *res, struct iattr *);
118__be32 nfsd_link(struct svc_rqst *, struct svc_fh *,
119 char *, int, struct svc_fh *);
120__be32 nfsd_rename(struct svc_rqst *,
121 struct svc_fh *, char *, int,
122 struct svc_fh *, char *, int);
123__be32 nfsd_remove(struct svc_rqst *,
124 struct svc_fh *, char *, int);
125__be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type,
126 char *name, int len);
127int nfsd_truncate(struct svc_rqst *, struct svc_fh *,
128 unsigned long size);
129__be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *,
130 loff_t *, struct readdir_cd *, filldir_t);
131__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
132 struct kstatfs *, int access);
133
134int nfsd_notify_change(struct inode *, struct iattr *);
135__be32 nfsd_permission(struct svc_rqst *, struct svc_export *,
136 struct dentry *, int);
137int nfsd_sync_dir(struct dentry *dp);
138
139#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
140#ifdef CONFIG_NFSD_V2_ACL
141extern struct svc_version nfsd_acl_version2;
142#else
143#define nfsd_acl_version2 NULL
144#endif
145#ifdef CONFIG_NFSD_V3_ACL
146extern struct svc_version nfsd_acl_version3;
147#else
148#define nfsd_acl_version3 NULL
149#endif
150struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int);
151int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *);
152#endif
153
154enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL };
155int nfsd_vers(int vers, enum vers_op change);
156int nfsd_minorversion(u32 minorversion, enum vers_op change);
157void nfsd_reset_versions(void);
158int nfsd_create_serv(void);
159
160extern int nfsd_max_blksize;
161
162/*
163 * NFSv4 State
164 */
165#ifdef CONFIG_NFSD_V4
166extern unsigned int max_delegations;
167int nfs4_state_init(void);
168void nfsd4_free_slabs(void);
169int nfs4_state_start(void);
170void nfs4_state_shutdown(void);
171time_t nfs4_lease_time(void);
172void nfs4_reset_lease(time_t leasetime);
173int nfs4_reset_recoverydir(char *recdir);
174#else
175static inline int nfs4_state_init(void) { return 0; }
176static inline void nfsd4_free_slabs(void) { }
177static inline int nfs4_state_start(void) { return 0; }
178static inline void nfs4_state_shutdown(void) { }
179static inline time_t nfs4_lease_time(void) { return 0; }
180static inline void nfs4_reset_lease(time_t leasetime) { }
181static inline int nfs4_reset_recoverydir(char *recdir) { return 0; }
182#endif
183
184/*
185 * lockd binding
186 */
187void nfsd_lockd_init(void);
188void nfsd_lockd_shutdown(void);
189
190
191/*
192 * These macros provide pre-xdr'ed values for faster operation.
193 */
194#define nfs_ok cpu_to_be32(NFS_OK)
195#define nfserr_perm cpu_to_be32(NFSERR_PERM)
196#define nfserr_noent cpu_to_be32(NFSERR_NOENT)
197#define nfserr_io cpu_to_be32(NFSERR_IO)
198#define nfserr_nxio cpu_to_be32(NFSERR_NXIO)
199#define nfserr_eagain cpu_to_be32(NFSERR_EAGAIN)
200#define nfserr_acces cpu_to_be32(NFSERR_ACCES)
201#define nfserr_exist cpu_to_be32(NFSERR_EXIST)
202#define nfserr_xdev cpu_to_be32(NFSERR_XDEV)
203#define nfserr_nodev cpu_to_be32(NFSERR_NODEV)
204#define nfserr_notdir cpu_to_be32(NFSERR_NOTDIR)
205#define nfserr_isdir cpu_to_be32(NFSERR_ISDIR)
206#define nfserr_inval cpu_to_be32(NFSERR_INVAL)
207#define nfserr_fbig cpu_to_be32(NFSERR_FBIG)
208#define nfserr_nospc cpu_to_be32(NFSERR_NOSPC)
209#define nfserr_rofs cpu_to_be32(NFSERR_ROFS)
210#define nfserr_mlink cpu_to_be32(NFSERR_MLINK)
211#define nfserr_opnotsupp cpu_to_be32(NFSERR_OPNOTSUPP)
212#define nfserr_nametoolong cpu_to_be32(NFSERR_NAMETOOLONG)
213#define nfserr_notempty cpu_to_be32(NFSERR_NOTEMPTY)
214#define nfserr_dquot cpu_to_be32(NFSERR_DQUOT)
215#define nfserr_stale cpu_to_be32(NFSERR_STALE)
216#define nfserr_remote cpu_to_be32(NFSERR_REMOTE)
217#define nfserr_wflush cpu_to_be32(NFSERR_WFLUSH)
218#define nfserr_badhandle cpu_to_be32(NFSERR_BADHANDLE)
219#define nfserr_notsync cpu_to_be32(NFSERR_NOT_SYNC)
220#define nfserr_badcookie cpu_to_be32(NFSERR_BAD_COOKIE)
221#define nfserr_notsupp cpu_to_be32(NFSERR_NOTSUPP)
222#define nfserr_toosmall cpu_to_be32(NFSERR_TOOSMALL)
223#define nfserr_serverfault cpu_to_be32(NFSERR_SERVERFAULT)
224#define nfserr_badtype cpu_to_be32(NFSERR_BADTYPE)
225#define nfserr_jukebox cpu_to_be32(NFSERR_JUKEBOX)
226#define nfserr_denied cpu_to_be32(NFSERR_DENIED)
227#define nfserr_deadlock cpu_to_be32(NFSERR_DEADLOCK)
228#define nfserr_expired cpu_to_be32(NFSERR_EXPIRED)
229#define nfserr_bad_cookie cpu_to_be32(NFSERR_BAD_COOKIE)
230#define nfserr_same cpu_to_be32(NFSERR_SAME)
231#define nfserr_clid_inuse cpu_to_be32(NFSERR_CLID_INUSE)
232#define nfserr_stale_clientid cpu_to_be32(NFSERR_STALE_CLIENTID)
233#define nfserr_resource cpu_to_be32(NFSERR_RESOURCE)
234#define nfserr_moved cpu_to_be32(NFSERR_MOVED)
235#define nfserr_nofilehandle cpu_to_be32(NFSERR_NOFILEHANDLE)
236#define nfserr_minor_vers_mismatch cpu_to_be32(NFSERR_MINOR_VERS_MISMATCH)
237#define nfserr_share_denied cpu_to_be32(NFSERR_SHARE_DENIED)
238#define nfserr_stale_stateid cpu_to_be32(NFSERR_STALE_STATEID)
239#define nfserr_old_stateid cpu_to_be32(NFSERR_OLD_STATEID)
240#define nfserr_bad_stateid cpu_to_be32(NFSERR_BAD_STATEID)
241#define nfserr_bad_seqid cpu_to_be32(NFSERR_BAD_SEQID)
242#define nfserr_symlink cpu_to_be32(NFSERR_SYMLINK)
243#define nfserr_not_same cpu_to_be32(NFSERR_NOT_SAME)
244#define nfserr_restorefh cpu_to_be32(NFSERR_RESTOREFH)
245#define nfserr_attrnotsupp cpu_to_be32(NFSERR_ATTRNOTSUPP)
246#define nfserr_bad_xdr cpu_to_be32(NFSERR_BAD_XDR)
247#define nfserr_openmode cpu_to_be32(NFSERR_OPENMODE)
248#define nfserr_locks_held cpu_to_be32(NFSERR_LOCKS_HELD)
249#define nfserr_op_illegal cpu_to_be32(NFSERR_OP_ILLEGAL)
250#define nfserr_grace cpu_to_be32(NFSERR_GRACE)
251#define nfserr_no_grace cpu_to_be32(NFSERR_NO_GRACE)
252#define nfserr_reclaim_bad cpu_to_be32(NFSERR_RECLAIM_BAD)
253#define nfserr_badname cpu_to_be32(NFSERR_BADNAME)
254#define nfserr_cb_path_down cpu_to_be32(NFSERR_CB_PATH_DOWN)
255#define nfserr_locked cpu_to_be32(NFSERR_LOCKED)
256#define nfserr_wrongsec cpu_to_be32(NFSERR_WRONGSEC)
257#define nfserr_badiomode cpu_to_be32(NFS4ERR_BADIOMODE)
258#define nfserr_badlayout cpu_to_be32(NFS4ERR_BADLAYOUT)
259#define nfserr_bad_session_digest cpu_to_be32(NFS4ERR_BAD_SESSION_DIGEST)
260#define nfserr_badsession cpu_to_be32(NFS4ERR_BADSESSION)
261#define nfserr_badslot cpu_to_be32(NFS4ERR_BADSLOT)
262#define nfserr_complete_already cpu_to_be32(NFS4ERR_COMPLETE_ALREADY)
263#define nfserr_conn_not_bound_to_session cpu_to_be32(NFS4ERR_CONN_NOT_BOUND_TO_SESSION)
264#define nfserr_deleg_already_wanted cpu_to_be32(NFS4ERR_DELEG_ALREADY_WANTED)
265#define nfserr_back_chan_busy cpu_to_be32(NFS4ERR_BACK_CHAN_BUSY)
266#define nfserr_layouttrylater cpu_to_be32(NFS4ERR_LAYOUTTRYLATER)
267#define nfserr_layoutunavailable cpu_to_be32(NFS4ERR_LAYOUTUNAVAILABLE)
268#define nfserr_nomatching_layout cpu_to_be32(NFS4ERR_NOMATCHING_LAYOUT)
269#define nfserr_recallconflict cpu_to_be32(NFS4ERR_RECALLCONFLICT)
270#define nfserr_unknown_layouttype cpu_to_be32(NFS4ERR_UNKNOWN_LAYOUTTYPE)
271#define nfserr_seq_misordered cpu_to_be32(NFS4ERR_SEQ_MISORDERED)
272#define nfserr_sequence_pos cpu_to_be32(NFS4ERR_SEQUENCE_POS)
273#define nfserr_req_too_big cpu_to_be32(NFS4ERR_REQ_TOO_BIG)
274#define nfserr_rep_too_big cpu_to_be32(NFS4ERR_REP_TOO_BIG)
275#define nfserr_rep_too_big_to_cache cpu_to_be32(NFS4ERR_REP_TOO_BIG_TO_CACHE)
276#define nfserr_retry_uncached_rep cpu_to_be32(NFS4ERR_RETRY_UNCACHED_REP)
277#define nfserr_unsafe_compound cpu_to_be32(NFS4ERR_UNSAFE_COMPOUND)
278#define nfserr_too_many_ops cpu_to_be32(NFS4ERR_TOO_MANY_OPS)
279#define nfserr_op_not_in_session cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION)
280#define nfserr_hash_alg_unsupp cpu_to_be32(NFS4ERR_HASH_ALG_UNSUPP)
281#define nfserr_clientid_busy cpu_to_be32(NFS4ERR_CLIENTID_BUSY)
282#define nfserr_pnfs_io_hole cpu_to_be32(NFS4ERR_PNFS_IO_HOLE)
283#define nfserr_seq_false_retry cpu_to_be32(NFS4ERR_SEQ_FALSE_RETRY)
284#define nfserr_bad_high_slot cpu_to_be32(NFS4ERR_BAD_HIGH_SLOT)
285#define nfserr_deadsession cpu_to_be32(NFS4ERR_DEADSESSION)
286#define nfserr_encr_alg_unsupp cpu_to_be32(NFS4ERR_ENCR_ALG_UNSUPP)
287#define nfserr_pnfs_no_layout cpu_to_be32(NFS4ERR_PNFS_NO_LAYOUT)
288#define nfserr_not_only_op cpu_to_be32(NFS4ERR_NOT_ONLY_OP)
289#define nfserr_wrong_cred cpu_to_be32(NFS4ERR_WRONG_CRED)
290#define nfserr_wrong_type cpu_to_be32(NFS4ERR_WRONG_TYPE)
291#define nfserr_dirdeleg_unavail cpu_to_be32(NFS4ERR_DIRDELEG_UNAVAIL)
292#define nfserr_reject_deleg cpu_to_be32(NFS4ERR_REJECT_DELEG)
293#define nfserr_returnconflict cpu_to_be32(NFS4ERR_RETURNCONFLICT)
294#define nfserr_deleg_revoked cpu_to_be32(NFS4ERR_DELEG_REVOKED)
295
296/* error codes for internal use */
297/* if a request fails due to kmalloc failure, it gets dropped.
298 * Client should resend eventually
299 */
300#define nfserr_dropit cpu_to_be32(30000)
301/* end-of-file indicator in readdir */
302#define nfserr_eof cpu_to_be32(30001)
303/* replay detected */
304#define nfserr_replay_me cpu_to_be32(11001)
305/* nfs41 replay detected */
306#define nfserr_replay_cache cpu_to_be32(11002)
307
308/* Check for dir entries '.' and '..' */
309#define isdotent(n, l) (l < 3 && n[0] == '.' && (l == 1 || n[1] == '.'))
310
311/*
312 * Time of server startup
313 */
314extern struct timeval nfssvc_boot;
315
316#ifdef CONFIG_NFSD_V4
317
318/* before processing a COMPOUND operation, we have to check that there
319 * is enough space in the buffer for XDR encode to succeed. otherwise,
320 * we might process an operation with side effects, and be unable to
321 * tell the client that the operation succeeded.
322 *
323 * COMPOUND_SLACK_SPACE - this is the minimum bytes of buffer space
324 * needed to encode an "ordinary" _successful_ operation. (GETATTR,
325 * READ, READDIR, and READLINK have their own buffer checks.) if we
326 * fall below this level, we fail the next operation with NFS4ERR_RESOURCE.
327 *
328 * COMPOUND_ERR_SLACK_SPACE - this is the minimum bytes of buffer space
329 * needed to encode an operation which has failed with NFS4ERR_RESOURCE.
330 * care is taken to ensure that we never fall below this level for any
331 * reason.
332 */
333#define COMPOUND_SLACK_SPACE 140 /* OP_GETFH */
334#define COMPOUND_ERR_SLACK_SPACE 12 /* OP_SETATTR */
335
336#define NFSD_LEASE_TIME (nfs4_lease_time())
337#define NFSD_LAUNDROMAT_MINTIMEOUT 10 /* seconds */
338
339/*
340 * The following attributes are currently not supported by the NFSv4 server:
341 * ARCHIVE (deprecated anyway)
342 * HIDDEN (unlikely to be supported any time soon)
343 * MIMETYPE (unlikely to be supported any time soon)
344 * QUOTA_* (will be supported in a forthcoming patch)
345 * SYSTEM (unlikely to be supported any time soon)
346 * TIME_BACKUP (unlikely to be supported any time soon)
347 * TIME_CREATE (unlikely to be supported any time soon)
348 */
349#define NFSD4_SUPPORTED_ATTRS_WORD0 \
350(FATTR4_WORD0_SUPPORTED_ATTRS | FATTR4_WORD0_TYPE | FATTR4_WORD0_FH_EXPIRE_TYPE \
351 | FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE | FATTR4_WORD0_LINK_SUPPORT \
352 | FATTR4_WORD0_SYMLINK_SUPPORT | FATTR4_WORD0_NAMED_ATTR | FATTR4_WORD0_FSID \
353 | FATTR4_WORD0_UNIQUE_HANDLES | FATTR4_WORD0_LEASE_TIME | FATTR4_WORD0_RDATTR_ERROR \
354 | FATTR4_WORD0_ACLSUPPORT | FATTR4_WORD0_CANSETTIME | FATTR4_WORD0_CASE_INSENSITIVE \
355 | FATTR4_WORD0_CASE_PRESERVING | FATTR4_WORD0_CHOWN_RESTRICTED \
356 | FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FILEID | FATTR4_WORD0_FILES_AVAIL \
357 | FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | FATTR4_WORD0_FS_LOCATIONS | FATTR4_WORD0_HOMOGENEOUS \
358 | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \
359 | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL)
360
361#define NFSD4_SUPPORTED_ATTRS_WORD1 \
362(FATTR4_WORD1_MODE | FATTR4_WORD1_NO_TRUNC | FATTR4_WORD1_NUMLINKS \
363 | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP | FATTR4_WORD1_RAWDEV \
364 | FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL \
365 | FATTR4_WORD1_SPACE_USED | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_ACCESS_SET \
366 | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA \
367 | FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID)
368
369#define NFSD4_SUPPORTED_ATTRS_WORD2 0
370
371#define NFSD4_1_SUPPORTED_ATTRS_WORD0 \
372 NFSD4_SUPPORTED_ATTRS_WORD0
373
374#define NFSD4_1_SUPPORTED_ATTRS_WORD1 \
375 NFSD4_SUPPORTED_ATTRS_WORD1
376
377#define NFSD4_1_SUPPORTED_ATTRS_WORD2 \
378 (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT)
379
380static inline u32 nfsd_suppattrs0(u32 minorversion)
381{
382 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0
383 : NFSD4_SUPPORTED_ATTRS_WORD0;
384}
385
386static inline u32 nfsd_suppattrs1(u32 minorversion)
387{
388 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD1
389 : NFSD4_SUPPORTED_ATTRS_WORD1;
390}
391
392static inline u32 nfsd_suppattrs2(u32 minorversion)
393{
394 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD2
395 : NFSD4_SUPPORTED_ATTRS_WORD2;
396}
397
398/* These will return ERR_INVAL if specified in GETATTR or READDIR. */
399#define NFSD_WRITEONLY_ATTRS_WORD1 \
400(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)
401
402/* These are the only attrs allowed in CREATE/OPEN/SETATTR. */
403#define NFSD_WRITEABLE_ATTRS_WORD0 \
404(FATTR4_WORD0_SIZE | FATTR4_WORD0_ACL )
405#define NFSD_WRITEABLE_ATTRS_WORD1 \
406(FATTR4_WORD1_MODE | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP \
407 | FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)
408#define NFSD_WRITEABLE_ATTRS_WORD2 0
409
410#define NFSD_SUPPATTR_EXCLCREAT_WORD0 \
411 NFSD_WRITEABLE_ATTRS_WORD0
412/*
413 * we currently store the exclusive create verifier in the v_{a,m}time
414 * attributes so the client can't set these at create time using EXCLUSIVE4_1
415 */
416#define NFSD_SUPPATTR_EXCLCREAT_WORD1 \
417 (NFSD_WRITEABLE_ATTRS_WORD1 & \
418 ~(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET))
419#define NFSD_SUPPATTR_EXCLCREAT_WORD2 \
420 NFSD_WRITEABLE_ATTRS_WORD2
421
422#endif /* CONFIG_NFSD_V4 */
423
424#endif /* LINUX_NFSD_NFSD_H */
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 8f641c908450..65e333afaee4 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -16,11 +16,9 @@
16 16
17# include <linux/types.h> 17# include <linux/types.h>
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
19# include <linux/string.h> 19# include <linux/sunrpc/svc.h>
20# include <linux/fs.h>
21#endif 20#endif
22#include <linux/nfsd/const.h> 21#include <linux/nfsd/const.h>
23#include <linux/nfsd/debug.h>
24 22
25/* 23/*
26 * This is the old "dentry style" Linux NFSv2 file handle. 24 * This is the old "dentry style" Linux NFSv2 file handle.
@@ -164,208 +162,6 @@ typedef struct svc_fh {
164 162
165} svc_fh; 163} svc_fh;
166 164
167enum nfsd_fsid {
168 FSID_DEV = 0,
169 FSID_NUM,
170 FSID_MAJOR_MINOR,
171 FSID_ENCODE_DEV,
172 FSID_UUID4_INUM,
173 FSID_UUID8,
174 FSID_UUID16,
175 FSID_UUID16_INUM,
176};
177
178enum fsid_source {
179 FSIDSOURCE_DEV,
180 FSIDSOURCE_FSID,
181 FSIDSOURCE_UUID,
182};
183extern enum fsid_source fsid_source(struct svc_fh *fhp);
184
185
186/* This might look a little large to "inline" but in all calls except
187 * one, 'vers' is constant so moste of the function disappears.
188 */
189static inline void mk_fsid(int vers, u32 *fsidv, dev_t dev, ino_t ino,
190 u32 fsid, unsigned char *uuid)
191{
192 u32 *up;
193 switch(vers) {
194 case FSID_DEV:
195 fsidv[0] = htonl((MAJOR(dev)<<16) |
196 MINOR(dev));
197 fsidv[1] = ino_t_to_u32(ino);
198 break;
199 case FSID_NUM:
200 fsidv[0] = fsid;
201 break;
202 case FSID_MAJOR_MINOR:
203 fsidv[0] = htonl(MAJOR(dev));
204 fsidv[1] = htonl(MINOR(dev));
205 fsidv[2] = ino_t_to_u32(ino);
206 break;
207
208 case FSID_ENCODE_DEV:
209 fsidv[0] = new_encode_dev(dev);
210 fsidv[1] = ino_t_to_u32(ino);
211 break;
212
213 case FSID_UUID4_INUM:
214 /* 4 byte fsid and inode number */
215 up = (u32*)uuid;
216 fsidv[0] = ino_t_to_u32(ino);
217 fsidv[1] = up[0] ^ up[1] ^ up[2] ^ up[3];
218 break;
219
220 case FSID_UUID8:
221 /* 8 byte fsid */
222 up = (u32*)uuid;
223 fsidv[0] = up[0] ^ up[2];
224 fsidv[1] = up[1] ^ up[3];
225 break;
226
227 case FSID_UUID16:
228 /* 16 byte fsid - NFSv3+ only */
229 memcpy(fsidv, uuid, 16);
230 break;
231
232 case FSID_UUID16_INUM:
233 /* 8 byte inode and 16 byte fsid */
234 *(u64*)fsidv = (u64)ino;
235 memcpy(fsidv+2, uuid, 16);
236 break;
237 default: BUG();
238 }
239}
240
241static inline int key_len(int type)
242{
243 switch(type) {
244 case FSID_DEV: return 8;
245 case FSID_NUM: return 4;
246 case FSID_MAJOR_MINOR: return 12;
247 case FSID_ENCODE_DEV: return 8;
248 case FSID_UUID4_INUM: return 8;
249 case FSID_UUID8: return 8;
250 case FSID_UUID16: return 16;
251 case FSID_UUID16_INUM: return 24;
252 default: return 0;
253 }
254}
255
256/*
257 * Shorthand for dprintk()'s
258 */
259extern char * SVCFH_fmt(struct svc_fh *fhp);
260
261/*
262 * Function prototypes
263 */
264__be32 fh_verify(struct svc_rqst *, struct svc_fh *, int, int);
265__be32 fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *);
266__be32 fh_update(struct svc_fh *);
267void fh_put(struct svc_fh *);
268
269static __inline__ struct svc_fh *
270fh_copy(struct svc_fh *dst, struct svc_fh *src)
271{
272 WARN_ON(src->fh_dentry || src->fh_locked);
273
274 *dst = *src;
275 return dst;
276}
277
278static inline void
279fh_copy_shallow(struct knfsd_fh *dst, struct knfsd_fh *src)
280{
281 dst->fh_size = src->fh_size;
282 memcpy(&dst->fh_base, &src->fh_base, src->fh_size);
283}
284
285static __inline__ struct svc_fh *
286fh_init(struct svc_fh *fhp, int maxsize)
287{
288 memset(fhp, 0, sizeof(*fhp));
289 fhp->fh_maxsize = maxsize;
290 return fhp;
291}
292
293#ifdef CONFIG_NFSD_V3
294/*
295 * Fill in the pre_op attr for the wcc data
296 */
297static inline void
298fill_pre_wcc(struct svc_fh *fhp)
299{
300 struct inode *inode;
301
302 inode = fhp->fh_dentry->d_inode;
303 if (!fhp->fh_pre_saved) {
304 fhp->fh_pre_mtime = inode->i_mtime;
305 fhp->fh_pre_ctime = inode->i_ctime;
306 fhp->fh_pre_size = inode->i_size;
307 fhp->fh_pre_change = inode->i_version;
308 fhp->fh_pre_saved = 1;
309 }
310}
311
312extern void fill_post_wcc(struct svc_fh *);
313#else
314#define fill_pre_wcc(ignored)
315#define fill_post_wcc(notused)
316#endif /* CONFIG_NFSD_V3 */
317
318
319/*
320 * Lock a file handle/inode
321 * NOTE: both fh_lock and fh_unlock are done "by hand" in
322 * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once
323 * so, any changes here should be reflected there.
324 */
325
326static inline void
327fh_lock_nested(struct svc_fh *fhp, unsigned int subclass)
328{
329 struct dentry *dentry = fhp->fh_dentry;
330 struct inode *inode;
331
332 dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
333 SVCFH_fmt(fhp), fhp->fh_locked);
334
335 BUG_ON(!dentry);
336
337 if (fhp->fh_locked) {
338 printk(KERN_WARNING "fh_lock: %s/%s already locked!\n",
339 dentry->d_parent->d_name.name, dentry->d_name.name);
340 return;
341 }
342
343 inode = dentry->d_inode;
344 mutex_lock_nested(&inode->i_mutex, subclass);
345 fill_pre_wcc(fhp);
346 fhp->fh_locked = 1;
347}
348
349static inline void
350fh_lock(struct svc_fh *fhp)
351{
352 fh_lock_nested(fhp, I_MUTEX_NORMAL);
353}
354
355/*
356 * Unlock a file handle/inode
357 */
358static inline void
359fh_unlock(struct svc_fh *fhp)
360{
361 BUG_ON(!fhp->fh_dentry);
362
363 if (fhp->fh_locked) {
364 fill_post_wcc(fhp);
365 mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex);
366 fhp->fh_locked = 0;
367 }
368}
369#endif /* __KERNEL__ */ 165#endif /* __KERNEL__ */
370 166
371 167
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
deleted file mode 100644
index b38d11324189..000000000000
--- a/include/linux/nfsd/state.h
+++ /dev/null
@@ -1,404 +0,0 @@
1/*
2 * linux/include/nfsd/state.h
3 *
4 * Copyright (c) 2001 The Regents of the University of Michigan.
5 * All rights reserved.
6 *
7 * Kendrick Smith <kmsmith@umich.edu>
8 * Andy Adamson <andros@umich.edu>
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the University nor the names of its
20 * contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
24 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *
35 */
36
37#ifndef _NFSD4_STATE_H
38#define _NFSD4_STATE_H
39
40#include <linux/list.h>
41#include <linux/kref.h>
42#include <linux/sunrpc/clnt.h>
43
44typedef struct {
45 u32 cl_boot;
46 u32 cl_id;
47} clientid_t;
48
49typedef struct {
50 u32 so_boot;
51 u32 so_stateownerid;
52 u32 so_fileid;
53} stateid_opaque_t;
54
55typedef struct {
56 u32 si_generation;
57 stateid_opaque_t si_opaque;
58} stateid_t;
59#define si_boot si_opaque.so_boot
60#define si_stateownerid si_opaque.so_stateownerid
61#define si_fileid si_opaque.so_fileid
62
63struct nfsd4_cb_sequence {
64 /* args/res */
65 u32 cbs_minorversion;
66 struct nfs4_client *cbs_clp;
67};
68
69struct nfs4_delegation {
70 struct list_head dl_perfile;
71 struct list_head dl_perclnt;
72 struct list_head dl_recall_lru; /* delegation recalled */
73 atomic_t dl_count; /* ref count */
74 struct nfs4_client *dl_client;
75 struct nfs4_file *dl_file;
76 struct file_lock *dl_flock;
77 struct file *dl_vfs_file;
78 u32 dl_type;
79 time_t dl_time;
80/* For recall: */
81 u32 dl_ident;
82 stateid_t dl_stateid;
83 struct knfsd_fh dl_fh;
84 int dl_retries;
85};
86
87/* client delegation callback info */
88struct nfs4_cb_conn {
89 /* SETCLIENTID info */
90 struct sockaddr_storage cb_addr;
91 size_t cb_addrlen;
92 u32 cb_prog;
93 u32 cb_minorversion;
94 u32 cb_ident; /* minorversion 0 only */
95 /* RPC client info */
96 atomic_t cb_set; /* successful CB_NULL call */
97 struct rpc_clnt * cb_client;
98};
99
100/* Maximum number of slots per session. 160 is useful for long haul TCP */
101#define NFSD_MAX_SLOTS_PER_SESSION 160
102/* Maximum number of operations per session compound */
103#define NFSD_MAX_OPS_PER_COMPOUND 16
104/* Maximum session per slot cache size */
105#define NFSD_SLOT_CACHE_SIZE 1024
106/* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */
107#define NFSD_CACHE_SIZE_SLOTS_PER_SESSION 32
108#define NFSD_MAX_MEM_PER_SESSION \
109 (NFSD_CACHE_SIZE_SLOTS_PER_SESSION * NFSD_SLOT_CACHE_SIZE)
110
111struct nfsd4_slot {
112 bool sl_inuse;
113 bool sl_cachethis;
114 u16 sl_opcnt;
115 u32 sl_seqid;
116 __be32 sl_status;
117 u32 sl_datalen;
118 char sl_data[];
119};
120
121struct nfsd4_channel_attrs {
122 u32 headerpadsz;
123 u32 maxreq_sz;
124 u32 maxresp_sz;
125 u32 maxresp_cached;
126 u32 maxops;
127 u32 maxreqs;
128 u32 nr_rdma_attrs;
129 u32 rdma_attrs;
130};
131
132struct nfsd4_create_session {
133 clientid_t clientid;
134 struct nfs4_sessionid sessionid;
135 u32 seqid;
136 u32 flags;
137 struct nfsd4_channel_attrs fore_channel;
138 struct nfsd4_channel_attrs back_channel;
139 u32 callback_prog;
140 u32 uid;
141 u32 gid;
142};
143
144/* The single slot clientid cache structure */
145struct nfsd4_clid_slot {
146 u32 sl_seqid;
147 __be32 sl_status;
148 struct nfsd4_create_session sl_cr_ses;
149};
150
151struct nfsd4_session {
152 struct kref se_ref;
153 struct list_head se_hash; /* hash by sessionid */
154 struct list_head se_perclnt;
155 u32 se_flags;
156 struct nfs4_client *se_client; /* for expire_client */
157 struct nfs4_sessionid se_sessionid;
158 struct nfsd4_channel_attrs se_fchannel;
159 struct nfsd4_channel_attrs se_bchannel;
160 struct nfsd4_slot *se_slots[]; /* forward channel slots */
161};
162
163static inline void
164nfsd4_put_session(struct nfsd4_session *ses)
165{
166 extern void free_session(struct kref *kref);
167 kref_put(&ses->se_ref, free_session);
168}
169
170static inline void
171nfsd4_get_session(struct nfsd4_session *ses)
172{
173 kref_get(&ses->se_ref);
174}
175
176/* formatted contents of nfs4_sessionid */
177struct nfsd4_sessionid {
178 clientid_t clientid;
179 u32 sequence;
180 u32 reserved;
181};
182
183#define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */
184
185/*
186 * struct nfs4_client - one per client. Clientids live here.
187 * o Each nfs4_client is hashed by clientid.
188 *
189 * o Each nfs4_clients is also hashed by name
190 * (the opaque quantity initially sent by the client to identify itself).
191 *
192 * o cl_perclient list is used to ensure no dangling stateowner references
193 * when we expire the nfs4_client
194 */
195struct nfs4_client {
196 struct list_head cl_idhash; /* hash by cl_clientid.id */
197 struct list_head cl_strhash; /* hash by cl_name */
198 struct list_head cl_openowners;
199 struct list_head cl_delegations;
200 struct list_head cl_lru; /* tail queue */
201 struct xdr_netobj cl_name; /* id generated by client */
202 char cl_recdir[HEXDIR_LEN]; /* recovery dir */
203 nfs4_verifier cl_verifier; /* generated by client */
204 time_t cl_time; /* time of last lease renewal */
205 struct sockaddr_storage cl_addr; /* client ipaddress */
206 u32 cl_flavor; /* setclientid pseudoflavor */
207 char *cl_principal; /* setclientid principal name */
208 struct svc_cred cl_cred; /* setclientid principal */
209 clientid_t cl_clientid; /* generated by server */
210 nfs4_verifier cl_confirm; /* generated by server */
211 struct nfs4_cb_conn cl_cb_conn; /* callback info */
212 atomic_t cl_count; /* ref count */
213 u32 cl_firststate; /* recovery dir creation */
214
215 /* for nfs41 */
216 struct list_head cl_sessions;
217 struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */
218 u32 cl_exchange_flags;
219 struct nfs4_sessionid cl_sessionid;
220
221 /* for nfs41 callbacks */
222 /* We currently support a single back channel with a single slot */
223 unsigned long cl_cb_slot_busy;
224 u32 cl_cb_seq_nr;
225 struct svc_xprt *cl_cb_xprt; /* 4.1 callback transport */
226 struct rpc_wait_queue cl_cb_waitq; /* backchannel callers may */
227 /* wait here for slots */
228};
229
230/* struct nfs4_client_reset
231 * one per old client. Populates reset_str_hashtbl. Filled from conf_id_hashtbl
232 * upon lease reset, or from upcall to state_daemon (to read in state
233 * from non-volitile storage) upon reboot.
234 */
235struct nfs4_client_reclaim {
236 struct list_head cr_strhash; /* hash by cr_name */
237 char cr_recdir[HEXDIR_LEN]; /* recover dir */
238};
239
240static inline void
241update_stateid(stateid_t *stateid)
242{
243 stateid->si_generation++;
244}
245
246/* A reasonable value for REPLAY_ISIZE was estimated as follows:
247 * The OPEN response, typically the largest, requires
248 * 4(status) + 8(stateid) + 20(changeinfo) + 4(rflags) + 8(verifier) +
249 * 4(deleg. type) + 8(deleg. stateid) + 4(deleg. recall flag) +
250 * 20(deleg. space limit) + ~32(deleg. ace) = 112 bytes
251 */
252
253#define NFSD4_REPLAY_ISIZE 112
254
255/*
256 * Replay buffer, where the result of the last seqid-mutating operation
257 * is cached.
258 */
259struct nfs4_replay {
260 __be32 rp_status;
261 unsigned int rp_buflen;
262 char *rp_buf;
263 unsigned intrp_allocated;
264 struct knfsd_fh rp_openfh;
265 char rp_ibuf[NFSD4_REPLAY_ISIZE];
266};
267
268/*
269* nfs4_stateowner can either be an open_owner, or a lock_owner
270*
271* so_idhash: stateid_hashtbl[] for open owner, lockstateid_hashtbl[]
272* for lock_owner
273* so_strhash: ownerstr_hashtbl[] for open_owner, lock_ownerstr_hashtbl[]
274* for lock_owner
275* so_perclient: nfs4_client->cl_perclient entry - used when nfs4_client
276* struct is reaped.
277* so_perfilestate: heads the list of nfs4_stateid (either open or lock)
278* and is used to ensure no dangling nfs4_stateid references when we
279* release a stateowner.
280* so_perlockowner: (open) nfs4_stateid->st_perlockowner entry - used when
281* close is called to reap associated byte-range locks
282* so_close_lru: (open) stateowner is placed on this list instead of being
283* reaped (when so_perfilestate is empty) to hold the last close replay.
284* reaped by laundramat thread after lease period.
285*/
286struct nfs4_stateowner {
287 struct kref so_ref;
288 struct list_head so_idhash; /* hash by so_id */
289 struct list_head so_strhash; /* hash by op_name */
290 struct list_head so_perclient;
291 struct list_head so_stateids;
292 struct list_head so_perstateid; /* for lockowners only */
293 struct list_head so_close_lru; /* tail queue */
294 time_t so_time; /* time of placement on so_close_lru */
295 int so_is_open_owner; /* 1=openowner,0=lockowner */
296 u32 so_id;
297 struct nfs4_client * so_client;
298 /* after increment in ENCODE_SEQID_OP_TAIL, represents the next
299 * sequence id expected from the client: */
300 u32 so_seqid;
301 struct xdr_netobj so_owner; /* open owner name */
302 int so_confirmed; /* successful OPEN_CONFIRM? */
303 struct nfs4_replay so_replay;
304};
305
306/*
307* nfs4_file: a file opened by some number of (open) nfs4_stateowners.
308* o fi_perfile list is used to search for conflicting
309* share_acces, share_deny on the file.
310*/
311struct nfs4_file {
312 atomic_t fi_ref;
313 struct list_head fi_hash; /* hash by "struct inode *" */
314 struct list_head fi_stateids;
315 struct list_head fi_delegations;
316 struct inode *fi_inode;
317 u32 fi_id; /* used with stateowner->so_id
318 * for stateid_hashtbl hash */
319 bool fi_had_conflict;
320};
321
322/*
323* nfs4_stateid can either be an open stateid or (eventually) a lock stateid
324*
325* (open)nfs4_stateid: one per (open)nfs4_stateowner, nfs4_file
326*
327* st_hash: stateid_hashtbl[] entry or lockstateid_hashtbl entry
328* st_perfile: file_hashtbl[] entry.
329* st_perfile_state: nfs4_stateowner->so_perfilestate
330* st_perlockowner: (open stateid) list of lock nfs4_stateowners
331* st_access_bmap: used only for open stateid
332* st_deny_bmap: used only for open stateid
333* st_openstp: open stateid lock stateid was derived from
334*
335* XXX: open stateids and lock stateids have diverged sufficiently that
336* we should consider defining separate structs for the two cases.
337*/
338
339struct nfs4_stateid {
340 struct list_head st_hash;
341 struct list_head st_perfile;
342 struct list_head st_perstateowner;
343 struct list_head st_lockowners;
344 struct nfs4_stateowner * st_stateowner;
345 struct nfs4_file * st_file;
346 stateid_t st_stateid;
347 struct file * st_vfs_file;
348 unsigned long st_access_bmap;
349 unsigned long st_deny_bmap;
350 struct nfs4_stateid * st_openstp;
351};
352
353/* flags for preprocess_seqid_op() */
354#define HAS_SESSION 0x00000001
355#define CONFIRM 0x00000002
356#define OPEN_STATE 0x00000004
357#define LOCK_STATE 0x00000008
358#define RD_STATE 0x00000010
359#define WR_STATE 0x00000020
360#define CLOSE_STATE 0x00000040
361
362#define seqid_mutating_err(err) \
363 (((err) != nfserr_stale_clientid) && \
364 ((err) != nfserr_bad_seqid) && \
365 ((err) != nfserr_stale_stateid) && \
366 ((err) != nfserr_bad_stateid))
367
368struct nfsd4_compound_state;
369
370extern __be32 nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
371 stateid_t *stateid, int flags, struct file **filp);
372extern void nfs4_lock_state(void);
373extern void nfs4_unlock_state(void);
374extern int nfs4_in_grace(void);
375extern __be32 nfs4_check_open_reclaim(clientid_t *clid);
376extern void put_nfs4_client(struct nfs4_client *clp);
377extern void nfs4_free_stateowner(struct kref *kref);
378extern int set_callback_cred(void);
379extern void nfsd4_probe_callback(struct nfs4_client *clp);
380extern void nfsd4_cb_recall(struct nfs4_delegation *dp);
381extern void nfs4_put_delegation(struct nfs4_delegation *dp);
382extern __be32 nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname);
383extern void nfsd4_init_recdir(char *recdir_name);
384extern int nfsd4_recdir_load(void);
385extern void nfsd4_shutdown_recdir(void);
386extern int nfs4_client_to_reclaim(const char *name);
387extern int nfs4_has_reclaimed_state(const char *name, bool use_exchange_id);
388extern void nfsd4_recdir_purge_old(void);
389extern int nfsd4_create_clid_dir(struct nfs4_client *clp);
390extern void nfsd4_remove_clid_dir(struct nfs4_client *clp);
391
392static inline void
393nfs4_put_stateowner(struct nfs4_stateowner *so)
394{
395 kref_put(&so->so_ref, nfs4_free_stateowner);
396}
397
398static inline void
399nfs4_get_stateowner(struct nfs4_stateowner *so)
400{
401 kref_get(&so->so_ref);
402}
403
404#endif /* NFSD4_STATE_H */
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index 7a3b565b898f..812bc1e160dc 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -9,14 +9,8 @@
9#ifndef NFSD_SYSCALL_H 9#ifndef NFSD_SYSCALL_H
10#define NFSD_SYSCALL_H 10#define NFSD_SYSCALL_H
11 11
12# include <linux/types.h> 12#include <linux/types.h>
13#ifdef __KERNEL__
14# include <linux/in.h>
15#endif
16#include <linux/posix_types.h>
17#include <linux/nfsd/const.h>
18#include <linux/nfsd/export.h> 13#include <linux/nfsd/export.h>
19#include <linux/nfsd/nfsfh.h>
20 14
21/* 15/*
22 * Version of the syscall interface 16 * Version of the syscall interface
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
deleted file mode 100644
index a0132ef58f21..000000000000
--- a/include/linux/nfsd/xdr.h
+++ /dev/null
@@ -1,177 +0,0 @@
1/*
2 * linux/include/linux/nfsd/xdr.h
3 *
4 * XDR types for nfsd. This is mainly a typing exercise.
5 */
6
7#ifndef LINUX_NFSD_H
8#define LINUX_NFSD_H
9
10#include <linux/fs.h>
11#include <linux/vfs.h>
12#include <linux/nfs.h>
13
14struct nfsd_fhandle {
15 struct svc_fh fh;
16};
17
18struct nfsd_sattrargs {
19 struct svc_fh fh;
20 struct iattr attrs;
21};
22
23struct nfsd_diropargs {
24 struct svc_fh fh;
25 char * name;
26 unsigned int len;
27};
28
29struct nfsd_readargs {
30 struct svc_fh fh;
31 __u32 offset;
32 __u32 count;
33 int vlen;
34};
35
36struct nfsd_writeargs {
37 svc_fh fh;
38 __u32 offset;
39 int len;
40 int vlen;
41};
42
43struct nfsd_createargs {
44 struct svc_fh fh;
45 char * name;
46 unsigned int len;
47 struct iattr attrs;
48};
49
50struct nfsd_renameargs {
51 struct svc_fh ffh;
52 char * fname;
53 unsigned int flen;
54 struct svc_fh tfh;
55 char * tname;
56 unsigned int tlen;
57};
58
59struct nfsd_readlinkargs {
60 struct svc_fh fh;
61 char * buffer;
62};
63
64struct nfsd_linkargs {
65 struct svc_fh ffh;
66 struct svc_fh tfh;
67 char * tname;
68 unsigned int tlen;
69};
70
71struct nfsd_symlinkargs {
72 struct svc_fh ffh;
73 char * fname;
74 unsigned int flen;
75 char * tname;
76 unsigned int tlen;
77 struct iattr attrs;
78};
79
80struct nfsd_readdirargs {
81 struct svc_fh fh;
82 __u32 cookie;
83 __u32 count;
84 __be32 * buffer;
85};
86
87struct nfsd_attrstat {
88 struct svc_fh fh;
89 struct kstat stat;
90};
91
92struct nfsd_diropres {
93 struct svc_fh fh;
94 struct kstat stat;
95};
96
97struct nfsd_readlinkres {
98 int len;
99};
100
101struct nfsd_readres {
102 struct svc_fh fh;
103 unsigned long count;
104 struct kstat stat;
105};
106
107struct nfsd_readdirres {
108 int count;
109
110 struct readdir_cd common;
111 __be32 * buffer;
112 int buflen;
113 __be32 * offset;
114};
115
116struct nfsd_statfsres {
117 struct kstatfs stats;
118};
119
120/*
121 * Storage requirements for XDR arguments and results.
122 */
123union nfsd_xdrstore {
124 struct nfsd_sattrargs sattr;
125 struct nfsd_diropargs dirop;
126 struct nfsd_readargs read;
127 struct nfsd_writeargs write;
128 struct nfsd_createargs create;
129 struct nfsd_renameargs rename;
130 struct nfsd_linkargs link;
131 struct nfsd_symlinkargs symlink;
132 struct nfsd_readdirargs readdir;
133};
134
135#define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore)
136
137
138int nfssvc_decode_void(struct svc_rqst *, __be32 *, void *);
139int nfssvc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
140int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *,
141 struct nfsd_sattrargs *);
142int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *,
143 struct nfsd_diropargs *);
144int nfssvc_decode_readargs(struct svc_rqst *, __be32 *,
145 struct nfsd_readargs *);
146int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *,
147 struct nfsd_writeargs *);
148int nfssvc_decode_createargs(struct svc_rqst *, __be32 *,
149 struct nfsd_createargs *);
150int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *,
151 struct nfsd_renameargs *);
152int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *,
153 struct nfsd_readlinkargs *);
154int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *,
155 struct nfsd_linkargs *);
156int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *,
157 struct nfsd_symlinkargs *);
158int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *,
159 struct nfsd_readdirargs *);
160int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *);
161int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *);
162int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *);
163int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *);
164int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *);
165int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *);
166int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *);
167
168int nfssvc_encode_entry(void *, const char *name,
169 int namlen, loff_t offset, u64 ino, unsigned int);
170
171int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
172
173/* Helper functions for NFSv2 ACL code */
174__be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp);
175__be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp);
176
177#endif /* LINUX_NFSD_H */
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
deleted file mode 100644
index 421eddd65a25..000000000000
--- a/include/linux/nfsd/xdr3.h
+++ /dev/null
@@ -1,346 +0,0 @@
1/*
2 * linux/include/linux/nfsd/xdr3.h
3 *
4 * XDR types for NFSv3 in nfsd.
5 *
6 * Copyright (C) 1996-1998, Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef _LINUX_NFSD_XDR3_H
10#define _LINUX_NFSD_XDR3_H
11
12#include <linux/nfsd/xdr.h>
13
14struct nfsd3_sattrargs {
15 struct svc_fh fh;
16 struct iattr attrs;
17 int check_guard;
18 time_t guardtime;
19};
20
21struct nfsd3_diropargs {
22 struct svc_fh fh;
23 char * name;
24 unsigned int len;
25};
26
27struct nfsd3_accessargs {
28 struct svc_fh fh;
29 unsigned int access;
30};
31
32struct nfsd3_readargs {
33 struct svc_fh fh;
34 __u64 offset;
35 __u32 count;
36 int vlen;
37};
38
39struct nfsd3_writeargs {
40 svc_fh fh;
41 __u64 offset;
42 __u32 count;
43 int stable;
44 __u32 len;
45 int vlen;
46};
47
48struct nfsd3_createargs {
49 struct svc_fh fh;
50 char * name;
51 unsigned int len;
52 int createmode;
53 struct iattr attrs;
54 __be32 * verf;
55};
56
57struct nfsd3_mknodargs {
58 struct svc_fh fh;
59 char * name;
60 unsigned int len;
61 __u32 ftype;
62 __u32 major, minor;
63 struct iattr attrs;
64};
65
66struct nfsd3_renameargs {
67 struct svc_fh ffh;
68 char * fname;
69 unsigned int flen;
70 struct svc_fh tfh;
71 char * tname;
72 unsigned int tlen;
73};
74
75struct nfsd3_readlinkargs {
76 struct svc_fh fh;
77 char * buffer;
78};
79
80struct nfsd3_linkargs {
81 struct svc_fh ffh;
82 struct svc_fh tfh;
83 char * tname;
84 unsigned int tlen;
85};
86
87struct nfsd3_symlinkargs {
88 struct svc_fh ffh;
89 char * fname;
90 unsigned int flen;
91 char * tname;
92 unsigned int tlen;
93 struct iattr attrs;
94};
95
96struct nfsd3_readdirargs {
97 struct svc_fh fh;
98 __u64 cookie;
99 __u32 dircount;
100 __u32 count;
101 __be32 * verf;
102 __be32 * buffer;
103};
104
105struct nfsd3_commitargs {
106 struct svc_fh fh;
107 __u64 offset;
108 __u32 count;
109};
110
111struct nfsd3_getaclargs {
112 struct svc_fh fh;
113 int mask;
114};
115
116struct posix_acl;
117struct nfsd3_setaclargs {
118 struct svc_fh fh;
119 int mask;
120 struct posix_acl *acl_access;
121 struct posix_acl *acl_default;
122};
123
124struct nfsd3_attrstat {
125 __be32 status;
126 struct svc_fh fh;
127 struct kstat stat;
128};
129
130/* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */
131struct nfsd3_diropres {
132 __be32 status;
133 struct svc_fh dirfh;
134 struct svc_fh fh;
135};
136
137struct nfsd3_accessres {
138 __be32 status;
139 struct svc_fh fh;
140 __u32 access;
141};
142
143struct nfsd3_readlinkres {
144 __be32 status;
145 struct svc_fh fh;
146 __u32 len;
147};
148
149struct nfsd3_readres {
150 __be32 status;
151 struct svc_fh fh;
152 unsigned long count;
153 int eof;
154};
155
156struct nfsd3_writeres {
157 __be32 status;
158 struct svc_fh fh;
159 unsigned long count;
160 int committed;
161};
162
163struct nfsd3_renameres {
164 __be32 status;
165 struct svc_fh ffh;
166 struct svc_fh tfh;
167};
168
169struct nfsd3_linkres {
170 __be32 status;
171 struct svc_fh tfh;
172 struct svc_fh fh;
173};
174
175struct nfsd3_readdirres {
176 __be32 status;
177 struct svc_fh fh;
178 int count;
179 __be32 verf[2];
180
181 struct readdir_cd common;
182 __be32 * buffer;
183 int buflen;
184 __be32 * offset;
185 __be32 * offset1;
186 struct svc_rqst * rqstp;
187
188};
189
190struct nfsd3_fsstatres {
191 __be32 status;
192 struct kstatfs stats;
193 __u32 invarsec;
194};
195
196struct nfsd3_fsinfores {
197 __be32 status;
198 __u32 f_rtmax;
199 __u32 f_rtpref;
200 __u32 f_rtmult;
201 __u32 f_wtmax;
202 __u32 f_wtpref;
203 __u32 f_wtmult;
204 __u32 f_dtpref;
205 __u64 f_maxfilesize;
206 __u32 f_properties;
207};
208
209struct nfsd3_pathconfres {
210 __be32 status;
211 __u32 p_link_max;
212 __u32 p_name_max;
213 __u32 p_no_trunc;
214 __u32 p_chown_restricted;
215 __u32 p_case_insensitive;
216 __u32 p_case_preserving;
217};
218
219struct nfsd3_commitres {
220 __be32 status;
221 struct svc_fh fh;
222};
223
224struct nfsd3_getaclres {
225 __be32 status;
226 struct svc_fh fh;
227 int mask;
228 struct posix_acl *acl_access;
229 struct posix_acl *acl_default;
230};
231
232/* dummy type for release */
233struct nfsd3_fhandle_pair {
234 __u32 dummy;
235 struct svc_fh fh1;
236 struct svc_fh fh2;
237};
238
239/*
240 * Storage requirements for XDR arguments and results.
241 */
242union nfsd3_xdrstore {
243 struct nfsd3_sattrargs sattrargs;
244 struct nfsd3_diropargs diropargs;
245 struct nfsd3_readargs readargs;
246 struct nfsd3_writeargs writeargs;
247 struct nfsd3_createargs createargs;
248 struct nfsd3_renameargs renameargs;
249 struct nfsd3_linkargs linkargs;
250 struct nfsd3_symlinkargs symlinkargs;
251 struct nfsd3_readdirargs readdirargs;
252 struct nfsd3_diropres diropres;
253 struct nfsd3_accessres accessres;
254 struct nfsd3_readlinkres readlinkres;
255 struct nfsd3_readres readres;
256 struct nfsd3_writeres writeres;
257 struct nfsd3_renameres renameres;
258 struct nfsd3_linkres linkres;
259 struct nfsd3_readdirres readdirres;
260 struct nfsd3_fsstatres fsstatres;
261 struct nfsd3_fsinfores fsinfores;
262 struct nfsd3_pathconfres pathconfres;
263 struct nfsd3_commitres commitres;
264 struct nfsd3_getaclres getaclres;
265};
266
267#define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore)
268
269int nfs3svc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
270int nfs3svc_decode_sattrargs(struct svc_rqst *, __be32 *,
271 struct nfsd3_sattrargs *);
272int nfs3svc_decode_diropargs(struct svc_rqst *, __be32 *,
273 struct nfsd3_diropargs *);
274int nfs3svc_decode_accessargs(struct svc_rqst *, __be32 *,
275 struct nfsd3_accessargs *);
276int nfs3svc_decode_readargs(struct svc_rqst *, __be32 *,
277 struct nfsd3_readargs *);
278int nfs3svc_decode_writeargs(struct svc_rqst *, __be32 *,
279 struct nfsd3_writeargs *);
280int nfs3svc_decode_createargs(struct svc_rqst *, __be32 *,
281 struct nfsd3_createargs *);
282int nfs3svc_decode_mkdirargs(struct svc_rqst *, __be32 *,
283 struct nfsd3_createargs *);
284int nfs3svc_decode_mknodargs(struct svc_rqst *, __be32 *,
285 struct nfsd3_mknodargs *);
286int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *,
287 struct nfsd3_renameargs *);
288int nfs3svc_decode_readlinkargs(struct svc_rqst *, __be32 *,
289 struct nfsd3_readlinkargs *);
290int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *,
291 struct nfsd3_linkargs *);
292int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *,
293 struct nfsd3_symlinkargs *);
294int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *,
295 struct nfsd3_readdirargs *);
296int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *,
297 struct nfsd3_readdirargs *);
298int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *,
299 struct nfsd3_commitargs *);
300int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
301int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *,
302 struct nfsd3_attrstat *);
303int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *,
304 struct nfsd3_attrstat *);
305int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *,
306 struct nfsd3_diropres *);
307int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *,
308 struct nfsd3_accessres *);
309int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *,
310 struct nfsd3_readlinkres *);
311int nfs3svc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd3_readres *);
312int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *, struct nfsd3_writeres *);
313int nfs3svc_encode_createres(struct svc_rqst *, __be32 *,
314 struct nfsd3_diropres *);
315int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *,
316 struct nfsd3_renameres *);
317int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *,
318 struct nfsd3_linkres *);
319int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *,
320 struct nfsd3_readdirres *);
321int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *,
322 struct nfsd3_fsstatres *);
323int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *,
324 struct nfsd3_fsinfores *);
325int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *,
326 struct nfsd3_pathconfres *);
327int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *,
328 struct nfsd3_commitres *);
329
330int nfs3svc_release_fhandle(struct svc_rqst *, __be32 *,
331 struct nfsd3_attrstat *);
332int nfs3svc_release_fhandle2(struct svc_rqst *, __be32 *,
333 struct nfsd3_fhandle_pair *);
334int nfs3svc_encode_entry(void *, const char *name,
335 int namlen, loff_t offset, u64 ino,
336 unsigned int);
337int nfs3svc_encode_entry_plus(void *, const char *name,
338 int namlen, loff_t offset, u64 ino,
339 unsigned int);
340/* Helper functions for NFSv3 ACL code */
341__be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p,
342 struct svc_fh *fhp);
343__be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp);
344
345
346#endif /* _LINUX_NFSD_XDR3_H */
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
deleted file mode 100644
index 73164c2b3d29..000000000000
--- a/include/linux/nfsd/xdr4.h
+++ /dev/null
@@ -1,563 +0,0 @@
1/*
2 * include/linux/nfsd/xdr4.h
3 *
4 * Server-side types for NFSv4.
5 *
6 * Copyright (c) 2002 The Regents of the University of Michigan.
7 * All rights reserved.
8 *
9 * Kendrick Smith <kmsmith@umich.edu>
10 * Andy Adamson <andros@umich.edu>
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 *
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. Neither the name of the University nor the names of its
22 * contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
26 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
32 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 */
38
39#ifndef _LINUX_NFSD_XDR4_H
40#define _LINUX_NFSD_XDR4_H
41
42#include <linux/nfs4.h>
43
44#define NFSD4_MAX_TAGLEN 128
45#define XDR_LEN(n) (((n) + 3) & ~3)
46
47struct nfsd4_compound_state {
48 struct svc_fh current_fh;
49 struct svc_fh save_fh;
50 struct nfs4_stateowner *replay_owner;
51 /* For sessions DRC */
52 struct nfsd4_session *session;
53 struct nfsd4_slot *slot;
54 __be32 *datap;
55 size_t iovlen;
56 u32 minorversion;
57 u32 status;
58};
59
60static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs)
61{
62 return cs->slot != NULL;
63}
64
65struct nfsd4_change_info {
66 u32 atomic;
67 bool change_supported;
68 u32 before_ctime_sec;
69 u32 before_ctime_nsec;
70 u64 before_change;
71 u32 after_ctime_sec;
72 u32 after_ctime_nsec;
73 u64 after_change;
74};
75
76struct nfsd4_access {
77 u32 ac_req_access; /* request */
78 u32 ac_supported; /* response */
79 u32 ac_resp_access; /* response */
80};
81
82struct nfsd4_close {
83 u32 cl_seqid; /* request */
84 stateid_t cl_stateid; /* request+response */
85 struct nfs4_stateowner * cl_stateowner; /* response */
86};
87
88struct nfsd4_commit {
89 u64 co_offset; /* request */
90 u32 co_count; /* request */
91 nfs4_verifier co_verf; /* response */
92};
93
94struct nfsd4_create {
95 u32 cr_namelen; /* request */
96 char * cr_name; /* request */
97 u32 cr_type; /* request */
98 union { /* request */
99 struct {
100 u32 namelen;
101 char *name;
102 } link; /* NF4LNK */
103 struct {
104 u32 specdata1;
105 u32 specdata2;
106 } dev; /* NF4BLK, NF4CHR */
107 } u;
108 u32 cr_bmval[3]; /* request */
109 struct iattr cr_iattr; /* request */
110 struct nfsd4_change_info cr_cinfo; /* response */
111 struct nfs4_acl *cr_acl;
112};
113#define cr_linklen u.link.namelen
114#define cr_linkname u.link.name
115#define cr_specdata1 u.dev.specdata1
116#define cr_specdata2 u.dev.specdata2
117
118struct nfsd4_delegreturn {
119 stateid_t dr_stateid;
120};
121
122struct nfsd4_getattr {
123 u32 ga_bmval[3]; /* request */
124 struct svc_fh *ga_fhp; /* response */
125};
126
127struct nfsd4_link {
128 u32 li_namelen; /* request */
129 char * li_name; /* request */
130 struct nfsd4_change_info li_cinfo; /* response */
131};
132
133struct nfsd4_lock_denied {
134 clientid_t ld_clientid;
135 struct nfs4_stateowner *ld_sop;
136 u64 ld_start;
137 u64 ld_length;
138 u32 ld_type;
139};
140
141struct nfsd4_lock {
142 /* request */
143 u32 lk_type;
144 u32 lk_reclaim; /* boolean */
145 u64 lk_offset;
146 u64 lk_length;
147 u32 lk_is_new;
148 union {
149 struct {
150 u32 open_seqid;
151 stateid_t open_stateid;
152 u32 lock_seqid;
153 clientid_t clientid;
154 struct xdr_netobj owner;
155 } new;
156 struct {
157 stateid_t lock_stateid;
158 u32 lock_seqid;
159 } old;
160 } v;
161
162 /* response */
163 union {
164 struct {
165 stateid_t stateid;
166 } ok;
167 struct nfsd4_lock_denied denied;
168 } u;
169 /* The lk_replay_owner is the open owner in the open_to_lock_owner
170 * case and the lock owner otherwise: */
171 struct nfs4_stateowner *lk_replay_owner;
172};
173#define lk_new_open_seqid v.new.open_seqid
174#define lk_new_open_stateid v.new.open_stateid
175#define lk_new_lock_seqid v.new.lock_seqid
176#define lk_new_clientid v.new.clientid
177#define lk_new_owner v.new.owner
178#define lk_old_lock_stateid v.old.lock_stateid
179#define lk_old_lock_seqid v.old.lock_seqid
180
181#define lk_rflags u.ok.rflags
182#define lk_resp_stateid u.ok.stateid
183#define lk_denied u.denied
184
185
186struct nfsd4_lockt {
187 u32 lt_type;
188 clientid_t lt_clientid;
189 struct xdr_netobj lt_owner;
190 u64 lt_offset;
191 u64 lt_length;
192 struct nfs4_stateowner * lt_stateowner;
193 struct nfsd4_lock_denied lt_denied;
194};
195
196
197struct nfsd4_locku {
198 u32 lu_type;
199 u32 lu_seqid;
200 stateid_t lu_stateid;
201 u64 lu_offset;
202 u64 lu_length;
203 struct nfs4_stateowner *lu_stateowner;
204};
205
206
207struct nfsd4_lookup {
208 u32 lo_len; /* request */
209 char * lo_name; /* request */
210};
211
212struct nfsd4_putfh {
213 u32 pf_fhlen; /* request */
214 char *pf_fhval; /* request */
215};
216
217struct nfsd4_open {
218 u32 op_claim_type; /* request */
219 struct xdr_netobj op_fname; /* request - everything but CLAIM_PREV */
220 u32 op_delegate_type; /* request - CLAIM_PREV only */
221 stateid_t op_delegate_stateid; /* request - response */
222 u32 op_create; /* request */
223 u32 op_createmode; /* request */
224 u32 op_bmval[3]; /* request */
225 struct iattr iattr; /* UNCHECKED4, GUARDED4, EXCLUSIVE4_1 */
226 nfs4_verifier verf; /* EXCLUSIVE4 */
227 clientid_t op_clientid; /* request */
228 struct xdr_netobj op_owner; /* request */
229 u32 op_seqid; /* request */
230 u32 op_share_access; /* request */
231 u32 op_share_deny; /* request */
232 stateid_t op_stateid; /* response */
233 u32 op_recall; /* recall */
234 struct nfsd4_change_info op_cinfo; /* response */
235 u32 op_rflags; /* response */
236 int op_truncate; /* used during processing */
237 struct nfs4_stateowner *op_stateowner; /* used during processing */
238 struct nfs4_acl *op_acl;
239};
240#define op_iattr iattr
241#define op_verf verf
242
243struct nfsd4_open_confirm {
244 stateid_t oc_req_stateid /* request */;
245 u32 oc_seqid /* request */;
246 stateid_t oc_resp_stateid /* response */;
247 struct nfs4_stateowner * oc_stateowner; /* response */
248};
249
250struct nfsd4_open_downgrade {
251 stateid_t od_stateid;
252 u32 od_seqid;
253 u32 od_share_access;
254 u32 od_share_deny;
255 struct nfs4_stateowner *od_stateowner;
256};
257
258
259struct nfsd4_read {
260 stateid_t rd_stateid; /* request */
261 u64 rd_offset; /* request */
262 u32 rd_length; /* request */
263 int rd_vlen;
264 struct file *rd_filp;
265
266 struct svc_rqst *rd_rqstp; /* response */
267 struct svc_fh * rd_fhp; /* response */
268};
269
270struct nfsd4_readdir {
271 u64 rd_cookie; /* request */
272 nfs4_verifier rd_verf; /* request */
273 u32 rd_dircount; /* request */
274 u32 rd_maxcount; /* request */
275 u32 rd_bmval[3]; /* request */
276 struct svc_rqst *rd_rqstp; /* response */
277 struct svc_fh * rd_fhp; /* response */
278
279 struct readdir_cd common;
280 __be32 * buffer;
281 int buflen;
282 __be32 * offset;
283};
284
285struct nfsd4_release_lockowner {
286 clientid_t rl_clientid;
287 struct xdr_netobj rl_owner;
288};
289struct nfsd4_readlink {
290 struct svc_rqst *rl_rqstp; /* request */
291 struct svc_fh * rl_fhp; /* request */
292};
293
294struct nfsd4_remove {
295 u32 rm_namelen; /* request */
296 char * rm_name; /* request */
297 struct nfsd4_change_info rm_cinfo; /* response */
298};
299
300struct nfsd4_rename {
301 u32 rn_snamelen; /* request */
302 char * rn_sname; /* request */
303 u32 rn_tnamelen; /* request */
304 char * rn_tname; /* request */
305 struct nfsd4_change_info rn_sinfo; /* response */
306 struct nfsd4_change_info rn_tinfo; /* response */
307};
308
309struct nfsd4_secinfo {
310 u32 si_namelen; /* request */
311 char *si_name; /* request */
312 struct svc_export *si_exp; /* response */
313};
314
315struct nfsd4_setattr {
316 stateid_t sa_stateid; /* request */
317 u32 sa_bmval[3]; /* request */
318 struct iattr sa_iattr; /* request */
319 struct nfs4_acl *sa_acl;
320};
321
322struct nfsd4_setclientid {
323 nfs4_verifier se_verf; /* request */
324 u32 se_namelen; /* request */
325 char * se_name; /* request */
326 u32 se_callback_prog; /* request */
327 u32 se_callback_netid_len; /* request */
328 char * se_callback_netid_val; /* request */
329 u32 se_callback_addr_len; /* request */
330 char * se_callback_addr_val; /* request */
331 u32 se_callback_ident; /* request */
332 clientid_t se_clientid; /* response */
333 nfs4_verifier se_confirm; /* response */
334};
335
336struct nfsd4_setclientid_confirm {
337 clientid_t sc_clientid;
338 nfs4_verifier sc_confirm;
339};
340
341/* also used for NVERIFY */
342struct nfsd4_verify {
343 u32 ve_bmval[3]; /* request */
344 u32 ve_attrlen; /* request */
345 char * ve_attrval; /* request */
346};
347
348struct nfsd4_write {
349 stateid_t wr_stateid; /* request */
350 u64 wr_offset; /* request */
351 u32 wr_stable_how; /* request */
352 u32 wr_buflen; /* request */
353 int wr_vlen;
354
355 u32 wr_bytes_written; /* response */
356 u32 wr_how_written; /* response */
357 nfs4_verifier wr_verifier; /* response */
358};
359
360struct nfsd4_exchange_id {
361 nfs4_verifier verifier;
362 struct xdr_netobj clname;
363 u32 flags;
364 clientid_t clientid;
365 u32 seqid;
366 int spa_how;
367};
368
369struct nfsd4_sequence {
370 struct nfs4_sessionid sessionid; /* request/response */
371 u32 seqid; /* request/response */
372 u32 slotid; /* request/response */
373 u32 maxslots; /* request/response */
374 u32 cachethis; /* request */
375#if 0
376 u32 target_maxslots; /* response */
377 u32 status_flags; /* response */
378#endif /* not yet */
379};
380
381struct nfsd4_destroy_session {
382 struct nfs4_sessionid sessionid;
383};
384
385struct nfsd4_op {
386 int opnum;
387 __be32 status;
388 union {
389 struct nfsd4_access access;
390 struct nfsd4_close close;
391 struct nfsd4_commit commit;
392 struct nfsd4_create create;
393 struct nfsd4_delegreturn delegreturn;
394 struct nfsd4_getattr getattr;
395 struct svc_fh * getfh;
396 struct nfsd4_link link;
397 struct nfsd4_lock lock;
398 struct nfsd4_lockt lockt;
399 struct nfsd4_locku locku;
400 struct nfsd4_lookup lookup;
401 struct nfsd4_verify nverify;
402 struct nfsd4_open open;
403 struct nfsd4_open_confirm open_confirm;
404 struct nfsd4_open_downgrade open_downgrade;
405 struct nfsd4_putfh putfh;
406 struct nfsd4_read read;
407 struct nfsd4_readdir readdir;
408 struct nfsd4_readlink readlink;
409 struct nfsd4_remove remove;
410 struct nfsd4_rename rename;
411 clientid_t renew;
412 struct nfsd4_secinfo secinfo;
413 struct nfsd4_setattr setattr;
414 struct nfsd4_setclientid setclientid;
415 struct nfsd4_setclientid_confirm setclientid_confirm;
416 struct nfsd4_verify verify;
417 struct nfsd4_write write;
418 struct nfsd4_release_lockowner release_lockowner;
419
420 /* NFSv4.1 */
421 struct nfsd4_exchange_id exchange_id;
422 struct nfsd4_create_session create_session;
423 struct nfsd4_destroy_session destroy_session;
424 struct nfsd4_sequence sequence;
425 } u;
426 struct nfs4_replay * replay;
427};
428
429struct nfsd4_compoundargs {
430 /* scratch variables for XDR decode */
431 __be32 * p;
432 __be32 * end;
433 struct page ** pagelist;
434 int pagelen;
435 __be32 tmp[8];
436 __be32 * tmpp;
437 struct tmpbuf {
438 struct tmpbuf *next;
439 void (*release)(const void *);
440 void *buf;
441 } *to_free;
442
443 struct svc_rqst *rqstp;
444
445 u32 taglen;
446 char * tag;
447 u32 minorversion;
448 u32 opcnt;
449 struct nfsd4_op *ops;
450 struct nfsd4_op iops[8];
451};
452
453struct nfsd4_compoundres {
454 /* scratch variables for XDR encode */
455 __be32 * p;
456 __be32 * end;
457 struct xdr_buf * xbuf;
458 struct svc_rqst * rqstp;
459
460 u32 taglen;
461 char * tag;
462 u32 opcnt;
463 __be32 * tagp; /* tag, opcount encode location */
464 struct nfsd4_compound_state cstate;
465};
466
467static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp)
468{
469 struct nfsd4_compoundargs *args = resp->rqstp->rq_argp;
470 return resp->opcnt == 1 && args->ops[0].opnum == OP_SEQUENCE;
471}
472
473static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp)
474{
475 return !resp->cstate.slot->sl_cachethis || nfsd4_is_solo_sequence(resp);
476}
477
478#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)
479
480static inline void
481set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
482{
483 BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved);
484 cinfo->atomic = 1;
485 cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode);
486 if (cinfo->change_supported) {
487 cinfo->before_change = fhp->fh_pre_change;
488 cinfo->after_change = fhp->fh_post_change;
489 } else {
490 cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
491 cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
492 cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
493 cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
494 }
495}
496
497int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
498int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
499 struct nfsd4_compoundargs *);
500int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
501 struct nfsd4_compoundres *);
502void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
503void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op);
504__be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
505 struct dentry *dentry, __be32 *buffer, int *countp,
506 u32 *bmval, struct svc_rqst *, int ignore_crossmnt);
507extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
508 struct nfsd4_compound_state *,
509 struct nfsd4_setclientid *setclid);
510extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
511 struct nfsd4_compound_state *,
512 struct nfsd4_setclientid_confirm *setclientid_confirm);
513extern void nfsd4_store_cache_entry(struct nfsd4_compoundres *resp);
514extern __be32 nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp,
515 struct nfsd4_sequence *seq);
516extern __be32 nfsd4_exchange_id(struct svc_rqst *rqstp,
517 struct nfsd4_compound_state *,
518struct nfsd4_exchange_id *);
519 extern __be32 nfsd4_create_session(struct svc_rqst *,
520 struct nfsd4_compound_state *,
521 struct nfsd4_create_session *);
522extern __be32 nfsd4_sequence(struct svc_rqst *,
523 struct nfsd4_compound_state *,
524 struct nfsd4_sequence *);
525extern __be32 nfsd4_destroy_session(struct svc_rqst *,
526 struct nfsd4_compound_state *,
527 struct nfsd4_destroy_session *);
528extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *,
529 struct nfsd4_open *open);
530extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
531 struct svc_fh *current_fh, struct nfsd4_open *open);
532extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
533 struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc);
534extern __be32 nfsd4_close(struct svc_rqst *rqstp,
535 struct nfsd4_compound_state *,
536 struct nfsd4_close *close);
537extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
538 struct nfsd4_compound_state *,
539 struct nfsd4_open_downgrade *od);
540extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
541 struct nfsd4_lock *lock);
542extern __be32 nfsd4_lockt(struct svc_rqst *rqstp,
543 struct nfsd4_compound_state *,
544 struct nfsd4_lockt *lockt);
545extern __be32 nfsd4_locku(struct svc_rqst *rqstp,
546 struct nfsd4_compound_state *,
547 struct nfsd4_locku *locku);
548extern __be32
549nfsd4_release_lockowner(struct svc_rqst *rqstp,
550 struct nfsd4_compound_state *,
551 struct nfsd4_release_lockowner *rlockowner);
552extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *);
553extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
554 struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr);
555extern __be32 nfsd4_renew(struct svc_rqst *rqstp,
556 struct nfsd4_compound_state *, clientid_t *clid);
557#endif
558
559/*
560 * Local variables:
561 * c-basic-offset: 8
562 * End:
563 */
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h
index 3fe02cf8b65a..640702e97457 100644
--- a/include/linux/nilfs2_fs.h
+++ b/include/linux/nilfs2_fs.h
@@ -153,6 +153,7 @@ struct nilfs_super_root {
153 semantics also for data */ 153 semantics also for data */
154#define NILFS_MOUNT_NORECOVERY 0x4000 /* Disable write access during 154#define NILFS_MOUNT_NORECOVERY 0x4000 /* Disable write access during
155 mount-time recovery */ 155 mount-time recovery */
156#define NILFS_MOUNT_DISCARD 0x8000 /* Issue DISCARD requests */
156 157
157 158
158/** 159/**
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index da8ea2e19273..28ba20fda3e2 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -3,7 +3,7 @@
3/* 3/*
4 * 802.11 netlink interface public header 4 * 802.11 netlink interface public header
5 * 5 *
6 * Copyright 2006, 2007, 2008 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
7 * Copyright 2008 Michael Wu <flamingice@sourmilk.net> 7 * Copyright 2008 Michael Wu <flamingice@sourmilk.net>
8 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> 8 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
9 * Copyright 2008 Michael Buesch <mb@bu3sch.de> 9 * Copyright 2008 Michael Buesch <mb@bu3sch.de>
@@ -270,6 +270,60 @@
270 * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices 270 * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
271 * associated with this wiphy must be down and will follow. 271 * associated with this wiphy must be down and will follow.
272 * 272 *
273 * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified
274 * channel for the specified amount of time. This can be used to do
275 * off-channel operations like transmit a Public Action frame and wait for
276 * a response while being associated to an AP on another channel.
277 * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which
278 * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
279 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
280 * optionally used to specify additional channel parameters.
281 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
282 * to remain on the channel. This command is also used as an event to
283 * notify when the requested duration starts (it may take a while for the
284 * driver to schedule this time due to other concurrent needs for the
285 * radio).
286 * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
287 * that will be included with any events pertaining to this request;
288 * the cookie is also used to cancel the request.
289 * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a
290 * pending remain-on-channel duration if the desired operation has been
291 * completed prior to expiration of the originally requested duration.
292 * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the
293 * radio. The %NL80211_ATTR_COOKIE attribute must be given as well to
294 * uniquely identify the request.
295 * This command is also used as an event to notify when a requested
296 * remain-on-channel duration has expired.
297 *
298 * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX
299 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
300 * and @NL80211_ATTR_TX_RATES the set of allowed rates.
301 *
302 * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames
303 * (via @NL80211_CMD_ACTION) for processing in userspace. This command
304 * requires an interface index and a match attribute containing the first
305 * few bytes of the frame that should match, e.g. a single byte for only
306 * a category match or four bytes for vendor frames including the OUI.
307 * The registration cannot be dropped, but is removed automatically
308 * when the netlink socket is closed. Multiple registrations can be made.
309 * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This
310 * command is used both as a request to transmit an Action frame and as an
311 * event indicating reception of an Action frame that was not processed in
312 * kernel code, but is for us (i.e., which may need to be processed in a
313 * user space application). %NL80211_ATTR_FRAME is used to specify the
314 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
315 * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on
316 * which channel the frame is to be transmitted or was received. This
317 * channel has to be the current channel (remain-on-channel or the
318 * operational channel). When called, this operation returns a cookie
319 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event
320 * pertaining to the TX request.
321 * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame
322 * transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies
323 * the TX command and %NL80211_ATTR_FRAME includes the contents of the
324 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
325 * the frame.
326 *
273 * @NL80211_CMD_MAX: highest used command number 327 * @NL80211_CMD_MAX: highest used command number
274 * @__NL80211_CMD_AFTER_LAST: internal use 328 * @__NL80211_CMD_AFTER_LAST: internal use
275 */ 329 */
@@ -353,6 +407,18 @@ enum nl80211_commands {
353 NL80211_CMD_DEL_PMKSA, 407 NL80211_CMD_DEL_PMKSA,
354 NL80211_CMD_FLUSH_PMKSA, 408 NL80211_CMD_FLUSH_PMKSA,
355 409
410 NL80211_CMD_REMAIN_ON_CHANNEL,
411 NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
412
413 NL80211_CMD_SET_TX_BITRATE_MASK,
414
415 NL80211_CMD_REGISTER_ACTION,
416 NL80211_CMD_ACTION,
417 NL80211_CMD_ACTION_TX_STATUS,
418
419 NL80211_CMD_SET_POWER_SAVE,
420 NL80211_CMD_GET_POWER_SAVE,
421
356 /* add new commands above here */ 422 /* add new commands above here */
357 423
358 /* used to define NL80211_CMD_MAX below */ 424 /* used to define NL80211_CMD_MAX below */
@@ -402,6 +468,8 @@ enum nl80211_commands {
402 * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length 468 * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length
403 * larger than or equal to this use RTS/CTS handshake); allowed range: 469 * larger than or equal to this use RTS/CTS handshake); allowed range:
404 * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32 470 * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32
471 * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11
472 * section 7.3.2.9; dot11CoverageClass; u8
405 * 473 *
406 * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on 474 * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
407 * @NL80211_ATTR_IFNAME: network interface name 475 * @NL80211_ATTR_IFNAME: network interface name
@@ -606,6 +674,23 @@ enum nl80211_commands {
606 * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can 674 * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
607 * cache, a wiphy attribute. 675 * cache, a wiphy attribute.
608 * 676 *
677 * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
678 *
679 * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
680 *
681 * @NL80211_ATTR_TX_RATES: Nested set of attributes
682 * (enum nl80211_tx_rate_attributes) describing TX rates per band. The
683 * enum nl80211_band value is used as the index (nla_type() of the nested
684 * data. If a band is not included, it will be configured to allow all
685 * rates based on negotiated supported rates information. This attribute
686 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
687 *
688 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
689 * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION.
690 *
691 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
692 * acknowledged by the recipient.
693 *
609 * @NL80211_ATTR_MAX: highest attribute number currently defined 694 * @NL80211_ATTR_MAX: highest attribute number currently defined
610 * @__NL80211_ATTR_AFTER_LAST: internal use 695 * @__NL80211_ATTR_AFTER_LAST: internal use
611 */ 696 */
@@ -743,6 +828,20 @@ enum nl80211_attrs {
743 NL80211_ATTR_PMKID, 828 NL80211_ATTR_PMKID,
744 NL80211_ATTR_MAX_NUM_PMKIDS, 829 NL80211_ATTR_MAX_NUM_PMKIDS,
745 830
831 NL80211_ATTR_DURATION,
832
833 NL80211_ATTR_COOKIE,
834
835 NL80211_ATTR_WIPHY_COVERAGE_CLASS,
836
837 NL80211_ATTR_TX_RATES,
838
839 NL80211_ATTR_FRAME_MATCH,
840
841 NL80211_ATTR_ACK,
842
843 NL80211_ATTR_PS_STATE,
844
746 /* add attributes here, update the policy in nl80211.c */ 845 /* add attributes here, update the policy in nl80211.c */
747 846
748 __NL80211_ATTR_AFTER_LAST, 847 __NL80211_ATTR_AFTER_LAST,
@@ -1323,13 +1422,20 @@ enum nl80211_channel_type {
1323 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) 1422 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
1324 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16) 1423 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
1325 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the 1424 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
1326 * raw information elements from the probe response/beacon (bin) 1425 * raw information elements from the probe response/beacon (bin);
1426 * if the %NL80211_BSS_BEACON_IES attribute is present, the IEs here are
1427 * from a Probe Response frame; otherwise they are from a Beacon frame.
1428 * However, if the driver does not indicate the source of the IEs, these
1429 * IEs may be from either frame subtype.
1327 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon 1430 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
1328 * in mBm (100 * dBm) (s32) 1431 * in mBm (100 * dBm) (s32)
1329 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon 1432 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
1330 * in unspecified units, scaled to 0..100 (u8) 1433 * in unspecified units, scaled to 0..100 (u8)
1331 * @NL80211_BSS_STATUS: status, if this BSS is "used" 1434 * @NL80211_BSS_STATUS: status, if this BSS is "used"
1332 * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms 1435 * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
1436 * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
1437 * elements from a Beacon frame (bin); not present if no Beacon frame has
1438 * yet been received
1333 * @__NL80211_BSS_AFTER_LAST: internal 1439 * @__NL80211_BSS_AFTER_LAST: internal
1334 * @NL80211_BSS_MAX: highest BSS attribute 1440 * @NL80211_BSS_MAX: highest BSS attribute
1335 */ 1441 */
@@ -1345,6 +1451,7 @@ enum nl80211_bss {
1345 NL80211_BSS_SIGNAL_UNSPEC, 1451 NL80211_BSS_SIGNAL_UNSPEC,
1346 NL80211_BSS_STATUS, 1452 NL80211_BSS_STATUS,
1347 NL80211_BSS_SEEN_MS_AGO, 1453 NL80211_BSS_SEEN_MS_AGO,
1454 NL80211_BSS_BEACON_IES,
1348 1455
1349 /* keep last */ 1456 /* keep last */
1350 __NL80211_BSS_AFTER_LAST, 1457 __NL80211_BSS_AFTER_LAST,
@@ -1442,4 +1549,38 @@ enum nl80211_key_attributes {
1442 NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 1549 NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1
1443}; 1550};
1444 1551
1552/**
1553 * enum nl80211_tx_rate_attributes - TX rate set attributes
1554 * @__NL80211_TXRATE_INVALID: invalid
1555 * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection
1556 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
1557 * 1 = 500 kbps) but without the IE length restriction (at most
1558 * %NL80211_MAX_SUPP_RATES in a single array).
1559 * @__NL80211_TXRATE_AFTER_LAST: internal
1560 * @NL80211_TXRATE_MAX: highest TX rate attribute
1561 */
1562enum nl80211_tx_rate_attributes {
1563 __NL80211_TXRATE_INVALID,
1564 NL80211_TXRATE_LEGACY,
1565
1566 /* keep last */
1567 __NL80211_TXRATE_AFTER_LAST,
1568 NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
1569};
1570
1571/**
1572 * enum nl80211_band - Frequency band
1573 * @NL80211_BAND_2GHZ - 2.4 GHz ISM band
1574 * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz)
1575 */
1576enum nl80211_band {
1577 NL80211_BAND_2GHZ,
1578 NL80211_BAND_5GHZ,
1579};
1580
1581enum nl80211_ps_state {
1582 NL80211_PS_DISABLED,
1583 NL80211_PS_ENABLED,
1584};
1585
1445#endif /* __LINUX_NL80211_H */ 1586#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 454997cccbd8..dba35e413371 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -69,8 +69,6 @@
69 * int node_online(node) Is some node online? 69 * int node_online(node) Is some node online?
70 * int node_possible(node) Is some node possible? 70 * int node_possible(node) Is some node possible?
71 * 71 *
72 * int any_online_node(mask) First online node in mask
73 *
74 * node_set_online(node) set bit 'node' in node_online_map 72 * node_set_online(node) set bit 'node' in node_online_map
75 * node_set_offline(node) clear bit 'node' in node_online_map 73 * node_set_offline(node) clear bit 'node' in node_online_map
76 * 74 *
@@ -467,15 +465,6 @@ static inline int num_node_state(enum node_states state)
467#define node_online_map node_states[N_ONLINE] 465#define node_online_map node_states[N_ONLINE]
468#define node_possible_map node_states[N_POSSIBLE] 466#define node_possible_map node_states[N_POSSIBLE]
469 467
470#define any_online_node(mask) \
471({ \
472 int node; \
473 for_each_node_mask(node, (mask)) \
474 if (node_online(node)) \
475 break; \
476 node; \
477})
478
479#define num_online_nodes() num_node_state(N_ONLINE) 468#define num_online_nodes() num_node_state(N_ONLINE)
480#define num_possible_nodes() num_node_state(N_POSSIBLE) 469#define num_possible_nodes() num_node_state(N_POSSIBLE)
481#define node_online(node) node_state((node), N_ONLINE) 470#define node_online(node) node_state((node), N_ONLINE)
@@ -494,7 +483,7 @@ static inline int num_node_state(enum node_states state)
494 type *name = kmalloc(sizeof(*name), gfp_flags) 483 type *name = kmalloc(sizeof(*name), gfp_flags)
495#define NODEMASK_FREE(m) kfree(m) 484#define NODEMASK_FREE(m) kfree(m)
496#else 485#else
497#define NODEMASK_ALLOC(type, name, gfp_flags) type _name, *name = &_name 486#define NODEMASK_ALLOC(type, name, gfp_flags) type _##name, *name = &_##name
498#define NODEMASK_FREE(m) do {} while (0) 487#define NODEMASK_FREE(m) do {} while (0)
499#endif 488#endif
500 489
diff --git a/include/linux/of.h b/include/linux/of.h
index e7facd8fbce8..a367e19bb3af 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -19,6 +19,11 @@
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/kref.h> 20#include <linux/kref.h>
21#include <linux/mod_devicetable.h> 21#include <linux/mod_devicetable.h>
22#include <linux/spinlock.h>
23
24#include <asm/byteorder.h>
25
26#ifdef CONFIG_OF
22 27
23typedef u32 phandle; 28typedef u32 phandle;
24typedef u32 ihandle; 29typedef u32 ihandle;
@@ -39,10 +44,7 @@ struct of_irq_controller;
39struct device_node { 44struct device_node {
40 const char *name; 45 const char *name;
41 const char *type; 46 const char *type;
42 phandle node; 47 phandle phandle;
43#if !defined(CONFIG_SPARC)
44 phandle linux_phandle;
45#endif
46 char *full_name; 48 char *full_name;
47 49
48 struct property *properties; 50 struct property *properties;
@@ -63,6 +65,11 @@ struct device_node {
63#endif 65#endif
64}; 66};
65 67
68/* Pointer for first entry in chain of all nodes. */
69extern struct device_node *allnodes;
70extern struct device_node *of_chosen;
71extern rwlock_t devtree_lock;
72
66static inline int of_node_check_flag(struct device_node *n, unsigned long flag) 73static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
67{ 74{
68 return test_bit(flag, &n->_flags); 75 return test_bit(flag, &n->_flags);
@@ -73,12 +80,6 @@ static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
73 set_bit(flag, &n->_flags); 80 set_bit(flag, &n->_flags);
74} 81}
75 82
76static inline void
77set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
78{
79 dn->pde = de;
80}
81
82extern struct device_node *of_find_all_nodes(struct device_node *prev); 83extern struct device_node *of_find_all_nodes(struct device_node *prev);
83 84
84#if defined(CONFIG_SPARC) 85#if defined(CONFIG_SPARC)
@@ -101,26 +102,36 @@ extern void of_node_put(struct device_node *node);
101 */ 102 */
102 103
103/* Helper to read a big number; size is in cells (not bytes) */ 104/* Helper to read a big number; size is in cells (not bytes) */
104static inline u64 of_read_number(const u32 *cell, int size) 105static inline u64 of_read_number(const __be32 *cell, int size)
105{ 106{
106 u64 r = 0; 107 u64 r = 0;
107 while (size--) 108 while (size--)
108 r = (r << 32) | *(cell++); 109 r = (r << 32) | be32_to_cpu(*(cell++));
109 return r; 110 return r;
110} 111}
111 112
112/* Like of_read_number, but we want an unsigned long result */ 113/* Like of_read_number, but we want an unsigned long result */
113#ifdef CONFIG_PPC32 114static inline unsigned long of_read_ulong(const __be32 *cell, int size)
114static inline unsigned long of_read_ulong(const u32 *cell, int size)
115{ 115{
116 return cell[size-1]; 116 /* toss away upper bits if unsigned long is smaller than u64 */
117 return of_read_number(cell, size);
117} 118}
118#else
119#define of_read_ulong(cell, size) of_read_number(cell, size)
120#endif
121 119
122#include <asm/prom.h> 120#include <asm/prom.h>
123 121
122/* Default #address and #size cells. Allow arch asm/prom.h to override */
123#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT)
124#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
125#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
126#endif
127
128/* Default string compare functions, Allow arch asm/prom.h to override */
129#if !defined(of_compat_cmp)
130#define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2))
131#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
132#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
133#endif
134
124/* flag descriptions */ 135/* flag descriptions */
125#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ 136#define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */
126#define OF_DETACHED 2 /* node has been detached from the device tree */ 137#define OF_DETACHED 2 /* node has been detached from the device tree */
@@ -187,4 +198,19 @@ extern int of_parse_phandles_with_args(struct device_node *np,
187 const char *list_name, const char *cells_name, int index, 198 const char *list_name, const char *cells_name, int index,
188 struct device_node **out_node, const void **out_args); 199 struct device_node **out_node, const void **out_args);
189 200
201extern int of_machine_is_compatible(const char *compat);
202
203extern int prom_add_property(struct device_node* np, struct property* prop);
204extern int prom_remove_property(struct device_node *np, struct property *prop);
205extern int prom_update_property(struct device_node *np,
206 struct property *newprop,
207 struct property *oldprop);
208
209#if defined(CONFIG_OF_DYNAMIC)
210/* For updating the device tree at runtime */
211extern void of_attach_node(struct device_node *);
212extern void of_detach_node(struct device_node *);
213#endif
214
215#endif /* CONFIG_OF */
190#endif /* _LINUX_OF_H */ 216#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 41d432b13553..a1ca92ccb0ff 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -42,45 +42,62 @@
42 * ends when size is 0 42 * ends when size is 0
43 */ 43 */
44struct boot_param_header { 44struct boot_param_header {
45 u32 magic; /* magic word OF_DT_HEADER */ 45 __be32 magic; /* magic word OF_DT_HEADER */
46 u32 totalsize; /* total size of DT block */ 46 __be32 totalsize; /* total size of DT block */
47 u32 off_dt_struct; /* offset to structure */ 47 __be32 off_dt_struct; /* offset to structure */
48 u32 off_dt_strings; /* offset to strings */ 48 __be32 off_dt_strings; /* offset to strings */
49 u32 off_mem_rsvmap; /* offset to memory reserve map */ 49 __be32 off_mem_rsvmap; /* offset to memory reserve map */
50 u32 version; /* format version */ 50 __be32 version; /* format version */
51 u32 last_comp_version; /* last compatible version */ 51 __be32 last_comp_version; /* last compatible version */
52 /* version 2 fields below */ 52 /* version 2 fields below */
53 u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ 53 __be32 boot_cpuid_phys; /* Physical CPU id we're booting on */
54 /* version 3 fields below */ 54 /* version 3 fields below */
55 u32 dt_strings_size; /* size of the DT strings block */ 55 __be32 dt_strings_size; /* size of the DT strings block */
56 /* version 17 fields below */ 56 /* version 17 fields below */
57 u32 dt_struct_size; /* size of the DT structure block */ 57 __be32 dt_struct_size; /* size of the DT structure block */
58}; 58};
59 59
60/* TBD: Temporary export of fdt globals - remove when code fully merged */
61extern int __initdata dt_root_addr_cells;
62extern int __initdata dt_root_size_cells;
63extern struct boot_param_header *initial_boot_params;
64
60/* For scanning the flat device-tree at boot time */ 65/* For scanning the flat device-tree at boot time */
61extern int __init of_scan_flat_dt(int (*it)(unsigned long node, 66extern char *find_flat_dt_string(u32 offset);
62 const char *uname, int depth, 67extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname,
63 void *data), 68 int depth, void *data),
64 void *data); 69 void *data);
65extern void __init *of_get_flat_dt_prop(unsigned long node, const char *name, 70extern void *of_get_flat_dt_prop(unsigned long node, const char *name,
66 unsigned long *size); 71 unsigned long *size);
67extern int __init of_flat_dt_is_compatible(unsigned long node, 72extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
68 const char *name); 73extern unsigned long of_get_flat_dt_root(void);
69extern unsigned long __init of_get_flat_dt_root(void); 74extern void early_init_dt_scan_chosen_arch(unsigned long node);
75extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
76 int depth, void *data);
77extern void early_init_dt_check_for_initrd(unsigned long node);
78extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
79 int depth, void *data);
80extern void early_init_dt_add_memory_arch(u64 base, u64 size);
81extern u64 early_init_dt_alloc_memory_arch(u64 size, u64 align);
82extern u64 dt_mem_next_cell(int s, __be32 **cellp);
83
84/*
85 * If BLK_DEV_INITRD, the fdt early init code will call this function,
86 * to be provided by the arch code. start and end are specified as
87 * physical addresses.
88 */
89#ifdef CONFIG_BLK_DEV_INITRD
90extern void early_init_dt_setup_initrd_arch(unsigned long start,
91 unsigned long end);
92#endif
93
94/* Early flat tree scan hooks */
95extern int early_init_dt_scan_root(unsigned long node, const char *uname,
96 int depth, void *data);
70 97
71/* Other Prototypes */ 98/* Other Prototypes */
72extern void finish_device_tree(void);
73extern void unflatten_device_tree(void); 99extern void unflatten_device_tree(void);
74extern void early_init_devtree(void *); 100extern void early_init_devtree(void *);
75extern int machine_is_compatible(const char *compat);
76extern void print_properties(struct device_node *node);
77extern int prom_n_intr_cells(struct device_node* np);
78extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
79extern int prom_add_property(struct device_node* np, struct property* prop);
80extern int prom_remove_property(struct device_node *np, struct property *prop);
81extern int prom_update_property(struct device_node *np,
82 struct property *newprop,
83 struct property *oldprop);
84 101
85#endif /* __ASSEMBLY__ */ 102#endif /* __ASSEMBLY__ */
86#endif /* _LINUX_OF_FDT_H */ 103#endif /* _LINUX_OF_FDT_H */
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h
index f46c40ac6d45..9bdd91486b49 100644
--- a/include/linux/omapfb.h
+++ b/include/linux/omapfb.h
@@ -57,6 +57,7 @@
57#define OMAPFB_WAITFORGO OMAP_IO(60) 57#define OMAPFB_WAITFORGO OMAP_IO(60)
58#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) 58#define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info)
59#define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) 59#define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info)
60#define OMAPFB_GET_DISPLAY_INFO OMAP_IOR(63, struct omapfb_display_info)
60 61
61#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff 62#define OMAPFB_CAPS_GENERIC_MASK 0x00000fff
62#define OMAPFB_CAPS_LCDC_MASK 0x00fff000 63#define OMAPFB_CAPS_LCDC_MASK 0x00fff000
@@ -206,6 +207,14 @@ struct omapfb_tearsync_info {
206 __u16 reserved2; 207 __u16 reserved2;
207}; 208};
208 209
210struct omapfb_display_info {
211 __u16 xres;
212 __u16 yres;
213 __u32 width; /* phys width of the display in micrometers */
214 __u32 height; /* phys height of the display in micrometers */
215 __u32 reserved[5];
216};
217
209#ifdef __KERNEL__ 218#ifdef __KERNEL__
210 219
211#include <plat/board.h> 220#include <plat/board.h>
diff --git a/include/linux/padata.h b/include/linux/padata.h
new file mode 100644
index 000000000000..51611da9c498
--- /dev/null
+++ b/include/linux/padata.h
@@ -0,0 +1,88 @@
1/*
2 * padata.h - header for the padata parallelization interface
3 *
4 * Copyright (C) 2008, 2009 secunet Security Networks AG
5 * Copyright (C) 2008, 2009 Steffen Klassert <steffen.klassert@secunet.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef PADATA_H
22#define PADATA_H
23
24#include <linux/workqueue.h>
25#include <linux/spinlock.h>
26#include <linux/list.h>
27
28struct padata_priv {
29 struct list_head list;
30 struct parallel_data *pd;
31 int cb_cpu;
32 int seq_nr;
33 int info;
34 void (*parallel)(struct padata_priv *padata);
35 void (*serial)(struct padata_priv *padata);
36};
37
38struct padata_list {
39 struct list_head list;
40 spinlock_t lock;
41};
42
43struct padata_queue {
44 struct padata_list parallel;
45 struct padata_list reorder;
46 struct padata_list serial;
47 struct work_struct pwork;
48 struct work_struct swork;
49 struct parallel_data *pd;
50 atomic_t num_obj;
51 int cpu_index;
52};
53
54struct parallel_data {
55 struct padata_instance *pinst;
56 struct padata_queue *queue;
57 atomic_t seq_nr;
58 atomic_t reorder_objects;
59 atomic_t refcnt;
60 unsigned int max_seq_nr;
61 cpumask_var_t cpumask;
62 spinlock_t lock;
63};
64
65struct padata_instance {
66 struct notifier_block cpu_notifier;
67 struct workqueue_struct *wq;
68 struct parallel_data *pd;
69 cpumask_var_t cpumask;
70 struct mutex lock;
71 u8 flags;
72#define PADATA_INIT 1
73#define PADATA_RESET 2
74};
75
76extern struct padata_instance *padata_alloc(const struct cpumask *cpumask,
77 struct workqueue_struct *wq);
78extern void padata_free(struct padata_instance *pinst);
79extern int padata_do_parallel(struct padata_instance *pinst,
80 struct padata_priv *padata, int cb_cpu);
81extern void padata_do_serial(struct padata_priv *padata);
82extern int padata_set_cpumask(struct padata_instance *pinst,
83 cpumask_var_t cpumask);
84extern int padata_add_cpu(struct padata_instance *pinst, int cpu);
85extern int padata_remove_cpu(struct padata_instance *pinst, int cpu);
86extern void padata_start(struct padata_instance *pinst);
87extern void padata_stop(struct padata_instance *pinst);
88#endif
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 49e907bd067f..5b59f35dcb8f 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -8,7 +8,7 @@
8#include <linux/types.h> 8#include <linux/types.h>
9#ifndef __GENERATING_BOUNDS_H 9#ifndef __GENERATING_BOUNDS_H
10#include <linux/mm_types.h> 10#include <linux/mm_types.h>
11#include <linux/bounds.h> 11#include <generated/bounds.h>
12#endif /* !__GENERATING_BOUNDS_H */ 12#endif /* !__GENERATING_BOUNDS_H */
13 13
14/* 14/*
@@ -275,13 +275,15 @@ PAGEFLAG_FALSE(Uncached)
275 275
276#ifdef CONFIG_MEMORY_FAILURE 276#ifdef CONFIG_MEMORY_FAILURE
277PAGEFLAG(HWPoison, hwpoison) 277PAGEFLAG(HWPoison, hwpoison)
278TESTSETFLAG(HWPoison, hwpoison) 278TESTSCFLAG(HWPoison, hwpoison)
279#define __PG_HWPOISON (1UL << PG_hwpoison) 279#define __PG_HWPOISON (1UL << PG_hwpoison)
280#else 280#else
281PAGEFLAG_FALSE(HWPoison) 281PAGEFLAG_FALSE(HWPoison)
282#define __PG_HWPOISON 0 282#define __PG_HWPOISON 0
283#endif 283#endif
284 284
285u64 stable_page_flags(struct page *page);
286
285static inline int PageUptodate(struct page *page) 287static inline int PageUptodate(struct page *page)
286{ 288{
287 int ret = test_bit(PG_uptodate, &(page)->flags); 289 int ret = test_bit(PG_uptodate, &(page)->flags);
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index b0e4eb126236..30b08136fdf3 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -118,6 +118,8 @@ static inline void __init page_cgroup_init_flatmem(void)
118#include <linux/swap.h> 118#include <linux/swap.h>
119 119
120#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 120#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
121extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
122 unsigned short old, unsigned short new);
121extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); 123extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id);
122extern unsigned short lookup_swap_cgroup(swp_entry_t ent); 124extern unsigned short lookup_swap_cgroup(swp_entry_t ent);
123extern int swap_cgroup_swapon(int type, unsigned long max_pages); 125extern int swap_cgroup_swapon(int type, unsigned long max_pages);
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index ed5d7501e181..3c62ed408492 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -253,6 +253,8 @@ extern struct page * read_cache_page_async(struct address_space *mapping,
253extern struct page * read_cache_page(struct address_space *mapping, 253extern struct page * read_cache_page(struct address_space *mapping,
254 pgoff_t index, filler_t *filler, 254 pgoff_t index, filler_t *filler,
255 void *data); 255 void *data);
256extern struct page * read_cache_page_gfp(struct address_space *mapping,
257 pgoff_t index, gfp_t gfp_mask);
256extern int read_cache_pages(struct address_space *mapping, 258extern int read_cache_pages(struct address_space *mapping,
257 struct list_head *pages, filler_t *filler, void *data); 259 struct list_head *pages, filler_t *filler, void *data);
258 260
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 93a7c08f869d..c8b6473c5f42 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -11,6 +11,13 @@
11#include <linux/acpi.h> 11#include <linux/acpi.h>
12 12
13#ifdef CONFIG_ACPI 13#ifdef CONFIG_ACPI
14extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev,
15 struct pci_bus *pci_bus);
16extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev);
17extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev,
18 struct pci_dev *pci_dev);
19extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev);
20
14static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) 21static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
15{ 22{
16 struct pci_bus *pbus = pdev->bus; 23 struct pci_bus *pbus = pdev->bus;
diff --git a/include/linux/pci-dma.h b/include/linux/pci-dma.h
new file mode 100644
index 000000000000..549a041f9c08
--- /dev/null
+++ b/include/linux/pci-dma.h
@@ -0,0 +1,11 @@
1#ifndef _LINUX_PCI_DMA_H
2#define _LINUX_PCI_DMA_H
3
4#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) DEFINE_DMA_UNMAP_ADDR(ADDR_NAME);
5#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) DEFINE_DMA_UNMAP_LEN(LEN_NAME);
6#define pci_unmap_addr dma_unmap_addr
7#define pci_unmap_addr_set dma_unmap_addr_set
8#define pci_unmap_len dma_unmap_len
9#define pci_unmap_len_set dma_unmap_len_set
10
11#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index bf1e67080849..a788fa12ff31 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -187,6 +187,33 @@ enum pci_bus_flags {
187 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, 187 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2,
188}; 188};
189 189
190/* Based on the PCI Hotplug Spec, but some values are made up by us */
191enum pci_bus_speed {
192 PCI_SPEED_33MHz = 0x00,
193 PCI_SPEED_66MHz = 0x01,
194 PCI_SPEED_66MHz_PCIX = 0x02,
195 PCI_SPEED_100MHz_PCIX = 0x03,
196 PCI_SPEED_133MHz_PCIX = 0x04,
197 PCI_SPEED_66MHz_PCIX_ECC = 0x05,
198 PCI_SPEED_100MHz_PCIX_ECC = 0x06,
199 PCI_SPEED_133MHz_PCIX_ECC = 0x07,
200 PCI_SPEED_66MHz_PCIX_266 = 0x09,
201 PCI_SPEED_100MHz_PCIX_266 = 0x0a,
202 PCI_SPEED_133MHz_PCIX_266 = 0x0b,
203 AGP_UNKNOWN = 0x0c,
204 AGP_1X = 0x0d,
205 AGP_2X = 0x0e,
206 AGP_4X = 0x0f,
207 AGP_8X = 0x10,
208 PCI_SPEED_66MHz_PCIX_533 = 0x11,
209 PCI_SPEED_100MHz_PCIX_533 = 0x12,
210 PCI_SPEED_133MHz_PCIX_533 = 0x13,
211 PCIE_SPEED_2_5GT = 0x14,
212 PCIE_SPEED_5_0GT = 0x15,
213 PCIE_SPEED_8_0GT = 0x16,
214 PCI_SPEED_UNKNOWN = 0xff,
215};
216
190struct pci_cap_saved_state { 217struct pci_cap_saved_state {
191 struct hlist_node next; 218 struct hlist_node next;
192 char cap_nr; 219 char cap_nr;
@@ -239,10 +266,12 @@ struct pci_dev {
239 configuration space */ 266 configuration space */
240 unsigned int pme_support:5; /* Bitmask of states from which PME# 267 unsigned int pme_support:5; /* Bitmask of states from which PME#
241 can be generated */ 268 can be generated */
269 unsigned int pme_interrupt:1;
242 unsigned int d1_support:1; /* Low power state D1 is supported */ 270 unsigned int d1_support:1; /* Low power state D1 is supported */
243 unsigned int d2_support:1; /* Low power state D2 is supported */ 271 unsigned int d2_support:1; /* Low power state D2 is supported */
244 unsigned int no_d1d2:1; /* Only allow D0 and D3 */ 272 unsigned int no_d1d2:1; /* Only allow D0 and D3 */
245 unsigned int wakeup_prepared:1; 273 unsigned int wakeup_prepared:1;
274 unsigned int d3_delay; /* D3->D0 transition time in ms */
246 275
247#ifdef CONFIG_PCIEASPM 276#ifdef CONFIG_PCIEASPM
248 struct pcie_link_state *link_state; /* ASPM link state. */ 277 struct pcie_link_state *link_state; /* ASPM link state. */
@@ -274,7 +303,8 @@ struct pci_dev {
274 unsigned int msix_enabled:1; 303 unsigned int msix_enabled:1;
275 unsigned int ari_enabled:1; /* ARI forwarding */ 304 unsigned int ari_enabled:1; /* ARI forwarding */
276 unsigned int is_managed:1; 305 unsigned int is_managed:1;
277 unsigned int is_pcie:1; 306 unsigned int is_pcie:1; /* Obsolete. Will be removed.
307 Use pci_is_pcie() instead */
278 unsigned int needs_freset:1; /* Dev requires fundamental reset */ 308 unsigned int needs_freset:1; /* Dev requires fundamental reset */
279 unsigned int state_saved:1; 309 unsigned int state_saved:1;
280 unsigned int is_physfn:1; 310 unsigned int is_physfn:1;
@@ -334,9 +364,26 @@ static inline void pci_add_saved_cap(struct pci_dev *pci_dev,
334 hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); 364 hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space);
335} 365}
336 366
337#ifndef PCI_BUS_NUM_RESOURCES 367/*
338#define PCI_BUS_NUM_RESOURCES 16 368 * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond
339#endif 369 * to P2P or CardBus bridge windows) go in a table. Additional ones (for
370 * buses below host bridges or subtractive decode bridges) go in the list.
371 * Use pci_bus_for_each_resource() to iterate through all the resources.
372 */
373
374/*
375 * PCI_SUBTRACTIVE_DECODE means the bridge forwards the window implicitly
376 * and there's no way to program the bridge with the details of the window.
377 * This does not apply to ACPI _CRS windows, even with the _DEC subtractive-
378 * decode bit set, because they are explicit and can be programmed with _SRS.
379 */
380#define PCI_SUBTRACTIVE_DECODE 0x1
381
382struct pci_bus_resource {
383 struct list_head list;
384 struct resource *res;
385 unsigned int flags;
386};
340 387
341#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ 388#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */
342 389
@@ -347,8 +394,8 @@ struct pci_bus {
347 struct list_head devices; /* list of devices on this bus */ 394 struct list_head devices; /* list of devices on this bus */
348 struct pci_dev *self; /* bridge device as seen by parent */ 395 struct pci_dev *self; /* bridge device as seen by parent */
349 struct list_head slots; /* list of slots on this bus */ 396 struct list_head slots; /* list of slots on this bus */
350 struct resource *resource[PCI_BUS_NUM_RESOURCES]; 397 struct resource *resource[PCI_BRIDGE_RESOURCE_NUM];
351 /* address space routed to this bus */ 398 struct list_head resources; /* address space routed to this bus */
352 399
353 struct pci_ops *ops; /* configuration access functions */ 400 struct pci_ops *ops; /* configuration access functions */
354 void *sysdata; /* hook for sys-specific extension */ 401 void *sysdata; /* hook for sys-specific extension */
@@ -358,6 +405,8 @@ struct pci_bus {
358 unsigned char primary; /* number of primary bridge */ 405 unsigned char primary; /* number of primary bridge */
359 unsigned char secondary; /* number of secondary bridge */ 406 unsigned char secondary; /* number of secondary bridge */
360 unsigned char subordinate; /* max number of subordinate buses */ 407 unsigned char subordinate; /* max number of subordinate buses */
408 unsigned char max_bus_speed; /* enum pci_bus_speed */
409 unsigned char cur_bus_speed; /* enum pci_bus_speed */
361 410
362 char name[48]; 411 char name[48];
363 412
@@ -562,10 +611,14 @@ int __must_check pcibios_enable_device(struct pci_dev *, int mask);
562char *pcibios_setup(char *str); 611char *pcibios_setup(char *str);
563 612
564/* Used only when drivers/pci/setup.c is used */ 613/* Used only when drivers/pci/setup.c is used */
565void pcibios_align_resource(void *, struct resource *, resource_size_t, 614resource_size_t pcibios_align_resource(void *, const struct resource *,
615 resource_size_t,
566 resource_size_t); 616 resource_size_t);
567void pcibios_update_irq(struct pci_dev *, int irq); 617void pcibios_update_irq(struct pci_dev *, int irq);
568 618
619/* Weak but can be overriden by arch */
620void pci_fixup_cardbus(struct pci_bus *);
621
569/* Generic PCI functions used internally */ 622/* Generic PCI functions used internally */
570 623
571extern struct pci_bus *pci_find_bus(int domain, int busnr); 624extern struct pci_bus *pci_find_bus(int domain, int busnr);
@@ -585,6 +638,7 @@ struct pci_bus *pci_create_bus(struct device *parent, int bus,
585 struct pci_ops *ops, void *sysdata); 638 struct pci_ops *ops, void *sysdata);
586struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, 639struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
587 int busnr); 640 int busnr);
641void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
588struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, 642struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
589 const char *name, 643 const char *name,
590 struct hotplug_slot *hotplug); 644 struct hotplug_slot *hotplug);
@@ -608,15 +662,12 @@ extern void pci_remove_bus_device(struct pci_dev *dev);
608extern void pci_stop_bus_device(struct pci_dev *dev); 662extern void pci_stop_bus_device(struct pci_dev *dev);
609void pci_setup_cardbus(struct pci_bus *bus); 663void pci_setup_cardbus(struct pci_bus *bus);
610extern void pci_sort_breadthfirst(void); 664extern void pci_sort_breadthfirst(void);
665#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
666#define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false))
667#define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0))
611 668
612/* Generic PCI functions exported to card drivers */ 669/* Generic PCI functions exported to card drivers */
613 670
614#ifdef CONFIG_PCI_LEGACY
615struct pci_dev __deprecated *pci_find_device(unsigned int vendor,
616 unsigned int device,
617 struct pci_dev *from);
618#endif /* CONFIG_PCI_LEGACY */
619
620enum pci_lost_interrupt_reason { 671enum pci_lost_interrupt_reason {
621 PCI_LOST_IRQ_NO_INFORMATION = 0, 672 PCI_LOST_IRQ_NO_INFORMATION = 0,
622 PCI_LOST_IRQ_DISABLE_MSI, 673 PCI_LOST_IRQ_DISABLE_MSI,
@@ -627,6 +678,8 @@ enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev);
627int pci_find_capability(struct pci_dev *dev, int cap); 678int pci_find_capability(struct pci_dev *dev, int cap);
628int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); 679int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap);
629int pci_find_ext_capability(struct pci_dev *dev, int cap); 680int pci_find_ext_capability(struct pci_dev *dev, int cap);
681int pci_bus_find_ext_capability(struct pci_bus *bus, unsigned int devfn,
682 int cap);
630int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); 683int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);
631int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); 684int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap);
632struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 685struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
@@ -716,8 +769,6 @@ int pci_try_set_mwi(struct pci_dev *dev);
716void pci_clear_mwi(struct pci_dev *dev); 769void pci_clear_mwi(struct pci_dev *dev);
717void pci_intx(struct pci_dev *dev, int enable); 770void pci_intx(struct pci_dev *dev, int enable);
718void pci_msi_off(struct pci_dev *dev); 771void pci_msi_off(struct pci_dev *dev);
719int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
720int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
721int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); 772int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size);
722int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); 773int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask);
723int pcix_get_max_mmrbc(struct pci_dev *dev); 774int pcix_get_max_mmrbc(struct pci_dev *dev);
@@ -746,11 +797,23 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
746pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 797pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
747bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); 798bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
748void pci_pme_active(struct pci_dev *dev, bool enable); 799void pci_pme_active(struct pci_dev *dev, bool enable);
749int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable); 800int __pci_enable_wake(struct pci_dev *dev, pci_power_t state,
801 bool runtime, bool enable);
750int pci_wake_from_d3(struct pci_dev *dev, bool enable); 802int pci_wake_from_d3(struct pci_dev *dev, bool enable);
751pci_power_t pci_target_state(struct pci_dev *dev); 803pci_power_t pci_target_state(struct pci_dev *dev);
752int pci_prepare_to_sleep(struct pci_dev *dev); 804int pci_prepare_to_sleep(struct pci_dev *dev);
753int pci_back_from_sleep(struct pci_dev *dev); 805int pci_back_from_sleep(struct pci_dev *dev);
806bool pci_dev_run_wake(struct pci_dev *dev);
807
808static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
809 bool enable)
810{
811 return __pci_enable_wake(dev, state, false, enable);
812}
813
814/* For use by arch with custom probe code */
815void set_pcie_port_type(struct pci_dev *pdev);
816void set_pcie_hotplug_bridge(struct pci_dev *pdev);
754 817
755/* Functions for PCI Hotplug drivers to use */ 818/* Functions for PCI Hotplug drivers to use */
756int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 819int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
@@ -768,6 +831,7 @@ void pci_bus_assign_resources(const struct pci_bus *bus);
768void pci_bus_size_bridges(struct pci_bus *bus); 831void pci_bus_size_bridges(struct pci_bus *bus);
769int pci_claim_resource(struct pci_dev *, int); 832int pci_claim_resource(struct pci_dev *, int);
770void pci_assign_unassigned_resources(void); 833void pci_assign_unassigned_resources(void);
834void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge);
771void pdev_enable_device(struct pci_dev *); 835void pdev_enable_device(struct pci_dev *);
772void pdev_sort_resources(struct pci_dev *, struct resource_list *); 836void pdev_sort_resources(struct pci_dev *, struct resource_list *);
773int pci_enable_resources(struct pci_dev *, int mask); 837int pci_enable_resources(struct pci_dev *, int mask);
@@ -785,12 +849,23 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *);
785void pci_release_selected_regions(struct pci_dev *, int); 849void pci_release_selected_regions(struct pci_dev *, int);
786 850
787/* drivers/pci/bus.c */ 851/* drivers/pci/bus.c */
852void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags);
853struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n);
854void pci_bus_remove_resources(struct pci_bus *bus);
855
856#define pci_bus_for_each_resource(bus, res, i) \
857 for (i = 0; \
858 (res = pci_bus_resource_n(bus, i)) || i < PCI_BRIDGE_RESOURCE_NUM; \
859 i++)
860
788int __must_check pci_bus_alloc_resource(struct pci_bus *bus, 861int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
789 struct resource *res, resource_size_t size, 862 struct resource *res, resource_size_t size,
790 resource_size_t align, resource_size_t min, 863 resource_size_t align, resource_size_t min,
791 unsigned int type_mask, 864 unsigned int type_mask,
792 void (*alignf)(void *, struct resource *, 865 resource_size_t (*alignf)(void *,
793 resource_size_t, resource_size_t), 866 const struct resource *,
867 resource_size_t,
868 resource_size_t),
794 void *alignf_data); 869 void *alignf_data);
795void pci_enable_bridges(struct pci_bus *bus); 870void pci_enable_bridges(struct pci_bus *bus);
796 871
@@ -827,6 +902,7 @@ int pci_set_vga_state(struct pci_dev *pdev, bool decode,
827 unsigned int command_bits, bool change_bridge); 902 unsigned int command_bits, bool change_bridge);
828/* kmem_cache style wrapper around pci_alloc_consistent() */ 903/* kmem_cache style wrapper around pci_alloc_consistent() */
829 904
905#include <linux/pci-dma.h>
830#include <linux/dmapool.h> 906#include <linux/dmapool.h>
831 907
832#define pci_pool dma_pool 908#define pci_pool dma_pool
@@ -951,6 +1027,11 @@ static inline int pci_proc_domain(struct pci_bus *bus)
951} 1027}
952#endif /* CONFIG_PCI_DOMAINS */ 1028#endif /* CONFIG_PCI_DOMAINS */
953 1029
1030/* some architectures require additional setup to direct VGA traffic */
1031typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode,
1032 unsigned int command_bits, bool change_bridge);
1033extern void pci_register_set_vga_state(arch_set_vga_state_t func);
1034
954#else /* CONFIG_PCI is not enabled */ 1035#else /* CONFIG_PCI is not enabled */
955 1036
956/* 1037/*
@@ -969,13 +1050,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
969_PCI_NOP_ALL(read, *) 1050_PCI_NOP_ALL(read, *)
970_PCI_NOP_ALL(write,) 1051_PCI_NOP_ALL(write,)
971 1052
972static inline struct pci_dev *pci_find_device(unsigned int vendor,
973 unsigned int device,
974 struct pci_dev *from)
975{
976 return NULL;
977}
978
979static inline struct pci_dev *pci_get_device(unsigned int vendor, 1053static inline struct pci_dev *pci_get_device(unsigned int vendor,
980 unsigned int device, 1054 unsigned int device,
981 struct pci_dev *from) 1055 struct pci_dev *from)
@@ -1125,6 +1199,9 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1125 unsigned int devfn) 1199 unsigned int devfn)
1126{ return NULL; } 1200{ return NULL; }
1127 1201
1202#define dev_is_pci(d) (false)
1203#define dev_is_pf(d) (false)
1204#define dev_num_vf(d) (0)
1128#endif /* CONFIG_PCI */ 1205#endif /* CONFIG_PCI */
1129 1206
1130/* Include architecture-dependent settings and functions */ 1207/* Include architecture-dependent settings and functions */
@@ -1233,8 +1310,12 @@ enum pci_fixup_pass {
1233 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ 1310 DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \
1234 suspend##vendor##device##hook, vendor, device, hook) 1311 suspend##vendor##device##hook, vendor, device, hook)
1235 1312
1236 1313#ifdef CONFIG_PCI_QUIRKS
1237void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 1314void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
1315#else
1316static inline void pci_fixup_device(enum pci_fixup_pass pass,
1317 struct pci_dev *dev) {}
1318#endif
1238 1319
1239void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); 1320void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
1240void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); 1321void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
@@ -1282,6 +1363,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
1282extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); 1363extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1283extern void pci_disable_sriov(struct pci_dev *dev); 1364extern void pci_disable_sriov(struct pci_dev *dev);
1284extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); 1365extern irqreturn_t pci_sriov_migration(struct pci_dev *dev);
1366extern int pci_num_vf(struct pci_dev *dev);
1285#else 1367#else
1286static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1368static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1287{ 1369{
@@ -1294,6 +1376,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
1294{ 1376{
1295 return IRQ_NONE; 1377 return IRQ_NONE;
1296} 1378}
1379static inline int pci_num_vf(struct pci_dev *dev)
1380{
1381 return 0;
1382}
1297#endif 1383#endif
1298 1384
1299#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1385#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
@@ -1330,5 +1416,93 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
1330 1416
1331void pci_request_acs(void); 1417void pci_request_acs(void);
1332 1418
1419
1420#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */
1421#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT)
1422
1423/* Large Resource Data Type Tag Item Names */
1424#define PCI_VPD_LTIN_ID_STRING 0x02 /* Identifier String */
1425#define PCI_VPD_LTIN_RO_DATA 0x10 /* Read-Only Data */
1426#define PCI_VPD_LTIN_RW_DATA 0x11 /* Read-Write Data */
1427
1428#define PCI_VPD_LRDT_ID_STRING PCI_VPD_LRDT_ID(PCI_VPD_LTIN_ID_STRING)
1429#define PCI_VPD_LRDT_RO_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RO_DATA)
1430#define PCI_VPD_LRDT_RW_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RW_DATA)
1431
1432/* Small Resource Data Type Tag Item Names */
1433#define PCI_VPD_STIN_END 0x78 /* End */
1434
1435#define PCI_VPD_SRDT_END PCI_VPD_STIN_END
1436
1437#define PCI_VPD_SRDT_TIN_MASK 0x78
1438#define PCI_VPD_SRDT_LEN_MASK 0x07
1439
1440#define PCI_VPD_LRDT_TAG_SIZE 3
1441#define PCI_VPD_SRDT_TAG_SIZE 1
1442
1443#define PCI_VPD_INFO_FLD_HDR_SIZE 3
1444
1445#define PCI_VPD_RO_KEYWORD_PARTNO "PN"
1446#define PCI_VPD_RO_KEYWORD_MFR_ID "MN"
1447#define PCI_VPD_RO_KEYWORD_VENDOR0 "V0"
1448
1449/**
1450 * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length
1451 * @lrdt: Pointer to the beginning of the Large Resource Data Type tag
1452 *
1453 * Returns the extracted Large Resource Data Type length.
1454 */
1455static inline u16 pci_vpd_lrdt_size(const u8 *lrdt)
1456{
1457 return (u16)lrdt[1] + ((u16)lrdt[2] << 8);
1458}
1459
1460/**
1461 * pci_vpd_srdt_size - Extracts the Small Resource Data Type length
1462 * @lrdt: Pointer to the beginning of the Small Resource Data Type tag
1463 *
1464 * Returns the extracted Small Resource Data Type length.
1465 */
1466static inline u8 pci_vpd_srdt_size(const u8 *srdt)
1467{
1468 return (*srdt) & PCI_VPD_SRDT_LEN_MASK;
1469}
1470
1471/**
1472 * pci_vpd_info_field_size - Extracts the information field length
1473 * @lrdt: Pointer to the beginning of an information field header
1474 *
1475 * Returns the extracted information field length.
1476 */
1477static inline u8 pci_vpd_info_field_size(const u8 *info_field)
1478{
1479 return info_field[2];
1480}
1481
1482/**
1483 * pci_vpd_find_tag - Locates the Resource Data Type tag provided
1484 * @buf: Pointer to buffered vpd data
1485 * @off: The offset into the buffer at which to begin the search
1486 * @len: The length of the vpd buffer
1487 * @rdt: The Resource Data Type to search for
1488 *
1489 * Returns the index where the Resource Data Type was found or
1490 * -ENOENT otherwise.
1491 */
1492int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
1493
1494/**
1495 * pci_vpd_find_info_keyword - Locates an information field keyword in the VPD
1496 * @buf: Pointer to buffered vpd data
1497 * @off: The offset into the buffer at which to begin the search
1498 * @len: The length of the buffer area, relative to off, in which to search
1499 * @kw: The keyword to search for
1500 *
1501 * Returns the index where the information field keyword was found or
1502 * -ENOENT otherwise.
1503 */
1504int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1505 unsigned int len, const char *kw);
1506
1333#endif /* __KERNEL__ */ 1507#endif /* __KERNEL__ */
1334#endif /* LINUX_PCI_H */ 1508#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 652ba797696d..5d09cbafa7db 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -28,26 +28,6 @@
28#ifndef _PCI_HOTPLUG_H 28#ifndef _PCI_HOTPLUG_H
29#define _PCI_HOTPLUG_H 29#define _PCI_HOTPLUG_H
30 30
31
32/* These values come from the PCI Hotplug Spec */
33enum pci_bus_speed {
34 PCI_SPEED_33MHz = 0x00,
35 PCI_SPEED_66MHz = 0x01,
36 PCI_SPEED_66MHz_PCIX = 0x02,
37 PCI_SPEED_100MHz_PCIX = 0x03,
38 PCI_SPEED_133MHz_PCIX = 0x04,
39 PCI_SPEED_66MHz_PCIX_ECC = 0x05,
40 PCI_SPEED_100MHz_PCIX_ECC = 0x06,
41 PCI_SPEED_133MHz_PCIX_ECC = 0x07,
42 PCI_SPEED_66MHz_PCIX_266 = 0x09,
43 PCI_SPEED_100MHz_PCIX_266 = 0x0a,
44 PCI_SPEED_133MHz_PCIX_266 = 0x0b,
45 PCI_SPEED_66MHz_PCIX_533 = 0x11,
46 PCI_SPEED_100MHz_PCIX_533 = 0x12,
47 PCI_SPEED_133MHz_PCIX_533 = 0x13,
48 PCI_SPEED_UNKNOWN = 0xff,
49};
50
51/* These values come from the PCI Express Spec */ 31/* These values come from the PCI Express Spec */
52enum pcie_link_width { 32enum pcie_link_width {
53 PCIE_LNK_WIDTH_RESRV = 0x00, 33 PCIE_LNK_WIDTH_RESRV = 0x00,
@@ -61,12 +41,6 @@ enum pcie_link_width {
61 PCIE_LNK_WIDTH_UNKNOWN = 0xFF, 41 PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
62}; 42};
63 43
64enum pcie_link_speed {
65 PCIE_2_5GB = 0x14,
66 PCIE_5_0GB = 0x15,
67 PCIE_LNK_SPEED_UNKNOWN = 0xFF,
68};
69
70/** 44/**
71 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use 45 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use
72 * @owner: The module owner of this structure 46 * @owner: The module owner of this structure
@@ -89,12 +63,6 @@ enum pcie_link_speed {
89 * @get_adapter_status: Called to get see if an adapter is present in the slot or not. 63 * @get_adapter_status: Called to get see if an adapter is present in the slot or not.
90 * If this field is NULL, the value passed in the struct hotplug_slot_info 64 * If this field is NULL, the value passed in the struct hotplug_slot_info
91 * will be used when this value is requested by a user. 65 * will be used when this value is requested by a user.
92 * @get_max_bus_speed: Called to get the max bus speed for a slot.
93 * If this field is NULL, the value passed in the struct hotplug_slot_info
94 * will be used when this value is requested by a user.
95 * @get_cur_bus_speed: Called to get the current bus speed for a slot.
96 * If this field is NULL, the value passed in the struct hotplug_slot_info
97 * will be used when this value is requested by a user.
98 * 66 *
99 * The table of function pointers that is passed to the hotplug pci core by a 67 * The table of function pointers that is passed to the hotplug pci core by a
100 * hotplug pci driver. These functions are called by the hotplug pci core when 68 * hotplug pci driver. These functions are called by the hotplug pci core when
@@ -112,17 +80,14 @@ struct hotplug_slot_ops {
112 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); 80 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value);
113 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); 81 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value);
114 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); 82 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value);
115 int (*get_max_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value);
116 int (*get_cur_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value);
117}; 83};
118 84
119/** 85/**
120 * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot 86 * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot
121 * @power: if power is enabled or not (1/0) 87 * @power_status: if power is enabled or not (1/0)
122 * @attention_status: if the attention light is enabled or not (1/0) 88 * @attention_status: if the attention light is enabled or not (1/0)
123 * @latch_status: if the latch (if any) is open or closed (1/0) 89 * @latch_status: if the latch (if any) is open or closed (1/0)
124 * @adapter_present: if there is a pci board present in the slot or not (1/0) 90 * @adapter_status: if there is a pci board present in the slot or not (1/0)
125 * @address: (domain << 16 | bus << 8 | dev)
126 * 91 *
127 * Used to notify the hotplug pci core of the status of a specific slot. 92 * Used to notify the hotplug pci core of the status of a specific slot.
128 */ 93 */
@@ -131,8 +96,6 @@ struct hotplug_slot_info {
131 u8 attention_status; 96 u8 attention_status;
132 u8 latch_status; 97 u8 latch_status;
133 u8 adapter_status; 98 u8 adapter_status;
134 enum pci_bus_speed max_bus_speed;
135 enum pci_bus_speed cur_bus_speed;
136}; 99};
137 100
138/** 101/**
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index cca8a044e2b6..9f688d243b86 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -770,7 +770,6 @@
770#define PCI_VENDOR_ID_TI 0x104c 770#define PCI_VENDOR_ID_TI 0x104c
771#define PCI_DEVICE_ID_TI_TVP4020 0x3d07 771#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
772#define PCI_DEVICE_ID_TI_4450 0x8011 772#define PCI_DEVICE_ID_TI_4450 0x8011
773#define PCI_DEVICE_ID_TI_TSB43AB22 0x8023
774#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 773#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031
775#define PCI_DEVICE_ID_TI_XX21_XX11_FM 0x8033 774#define PCI_DEVICE_ID_TI_XX21_XX11_FM 0x8033
776#define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034 775#define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034
@@ -2333,6 +2332,8 @@
2333#define PCI_VENDOR_ID_KORENIX 0x1982 2332#define PCI_VENDOR_ID_KORENIX 0x1982
2334#define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600 2333#define PCI_DEVICE_ID_KORENIX_JETCARDF0 0x1600
2335#define PCI_DEVICE_ID_KORENIX_JETCARDF1 0x16ff 2334#define PCI_DEVICE_ID_KORENIX_JETCARDF1 0x16ff
2335#define PCI_DEVICE_ID_KORENIX_JETCARDF2 0x1700
2336#define PCI_DEVICE_ID_KORENIX_JETCARDF3 0x17ff
2336 2337
2337#define PCI_VENDOR_ID_QMI 0x1a32 2338#define PCI_VENDOR_ID_QMI 0x1a32
2338 2339
@@ -2417,6 +2418,9 @@
2417#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 2418#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21
2418#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 2419#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2419#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 2420#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
2421#define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22
2422#define PCI_DEVICE_ID_INTEL_CPT_LPC1 0x1c42
2423#define PCI_DEVICE_ID_INTEL_CPT_LPC2 0x1c43
2420#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 2424#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2421#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 2425#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2422#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 2426#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
@@ -2694,6 +2698,7 @@
2694#define PCI_DEVICE_ID_NETMOS_9835 0x9835 2698#define PCI_DEVICE_ID_NETMOS_9835 0x9835
2695#define PCI_DEVICE_ID_NETMOS_9845 0x9845 2699#define PCI_DEVICE_ID_NETMOS_9845 0x9845
2696#define PCI_DEVICE_ID_NETMOS_9855 0x9855 2700#define PCI_DEVICE_ID_NETMOS_9855 0x9855
2701#define PCI_DEVICE_ID_NETMOS_9865 0x9865
2697#define PCI_DEVICE_ID_NETMOS_9901 0x9901 2702#define PCI_DEVICE_ID_NETMOS_9901 0x9901
2698 2703
2699#define PCI_VENDOR_ID_3COM_2 0xa727 2704#define PCI_VENDOR_ID_3COM_2 0xa727
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 9f2ad0aa3c39..c8f302991b66 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -507,6 +507,7 @@
507#define PCI_EXT_CAP_ID_VC 2 507#define PCI_EXT_CAP_ID_VC 2
508#define PCI_EXT_CAP_ID_DSN 3 508#define PCI_EXT_CAP_ID_DSN 3
509#define PCI_EXT_CAP_ID_PWR 4 509#define PCI_EXT_CAP_ID_PWR 4
510#define PCI_EXT_CAP_ID_VNDR 11
510#define PCI_EXT_CAP_ID_ACS 13 511#define PCI_EXT_CAP_ID_ACS 13
511#define PCI_EXT_CAP_ID_ARI 14 512#define PCI_EXT_CAP_ID_ARI 14
512#define PCI_EXT_CAP_ID_ATS 15 513#define PCI_EXT_CAP_ID_ATS 15
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 5a5d6ce4bd55..68567c0b3a5d 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -2,12 +2,6 @@
2#define _LINUX_PERCPU_DEFS_H 2#define _LINUX_PERCPU_DEFS_H
3 3
4/* 4/*
5 * Determine the real variable name from the name visible in the
6 * kernel sources.
7 */
8#define per_cpu_var(var) per_cpu__##var
9
10/*
11 * Base implementations of per-CPU variable declarations and definitions, where 5 * Base implementations of per-CPU variable declarations and definitions, where
12 * the section in which the variable is to be placed is provided by the 6 * the section in which the variable is to be placed is provided by the
13 * 'sec' argument. This may be used to affect the parameters governing the 7 * 'sec' argument. This may be used to affect the parameters governing the
@@ -18,13 +12,23 @@
18 * that section. 12 * that section.
19 */ 13 */
20#define __PCPU_ATTRS(sec) \ 14#define __PCPU_ATTRS(sec) \
21 __attribute__((section(PER_CPU_BASE_SECTION sec))) \ 15 __percpu __attribute__((section(PER_CPU_BASE_SECTION sec))) \
22 PER_CPU_ATTRIBUTES 16 PER_CPU_ATTRIBUTES
23 17
24#define __PCPU_DUMMY_ATTRS \ 18#define __PCPU_DUMMY_ATTRS \
25 __attribute__((section(".discard"), unused)) 19 __attribute__((section(".discard"), unused))
26 20
27/* 21/*
22 * Macro which verifies @ptr is a percpu pointer without evaluating
23 * @ptr. This is to be used in percpu accessors to verify that the
24 * input parameter is a percpu pointer.
25 */
26#define __verify_pcpu_ptr(ptr) do { \
27 const void __percpu *__vpp_verify = (typeof(ptr))NULL; \
28 (void)__vpp_verify; \
29} while (0)
30
31/*
28 * s390 and alpha modules require percpu variables to be defined as 32 * s390 and alpha modules require percpu variables to be defined as
29 * weak to force the compiler to generate GOT based external 33 * weak to force the compiler to generate GOT based external
30 * references for them. This is necessary because percpu sections 34 * references for them. This is necessary because percpu sections
@@ -56,24 +60,24 @@
56 */ 60 */
57#define DECLARE_PER_CPU_SECTION(type, name, sec) \ 61#define DECLARE_PER_CPU_SECTION(type, name, sec) \
58 extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ 62 extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
59 extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name 63 extern __PCPU_ATTRS(sec) __typeof__(type) name
60 64
61#define DEFINE_PER_CPU_SECTION(type, name, sec) \ 65#define DEFINE_PER_CPU_SECTION(type, name, sec) \
62 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \ 66 __PCPU_DUMMY_ATTRS char __pcpu_scope_##name; \
63 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ 67 extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
64 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \ 68 __PCPU_DUMMY_ATTRS char __pcpu_unique_##name; \
65 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \ 69 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak \
66 __typeof__(type) per_cpu__##name 70 __typeof__(type) name
67#else 71#else
68/* 72/*
69 * Normal declaration and definition macros. 73 * Normal declaration and definition macros.
70 */ 74 */
71#define DECLARE_PER_CPU_SECTION(type, name, sec) \ 75#define DECLARE_PER_CPU_SECTION(type, name, sec) \
72 extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name 76 extern __PCPU_ATTRS(sec) __typeof__(type) name
73 77
74#define DEFINE_PER_CPU_SECTION(type, name, sec) \ 78#define DEFINE_PER_CPU_SECTION(type, name, sec) \
75 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \ 79 __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \
76 __typeof__(type) per_cpu__##name 80 __typeof__(type) name
77#endif 81#endif
78 82
79/* 83/*
@@ -135,10 +139,16 @@
135 __aligned(PAGE_SIZE) 139 __aligned(PAGE_SIZE)
136 140
137/* 141/*
138 * Intermodule exports for per-CPU variables. 142 * Intermodule exports for per-CPU variables. sparse forgets about
143 * address space across EXPORT_SYMBOL(), change EXPORT_SYMBOL() to
144 * noop if __CHECKER__.
139 */ 145 */
140#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) 146#ifndef __CHECKER__
141#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) 147#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var)
142 148#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var)
149#else
150#define EXPORT_PER_CPU_SYMBOL(var)
151#define EXPORT_PER_CPU_SYMBOL_GPL(var)
152#endif
143 153
144#endif /* _LINUX_PERCPU_DEFS_H */ 154#endif /* _LINUX_PERCPU_DEFS_H */
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index cf5efbcf716c..a93e5bfdccb8 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -27,10 +27,17 @@
27 * we force a syntax error here if it isn't. 27 * we force a syntax error here if it isn't.
28 */ 28 */
29#define get_cpu_var(var) (*({ \ 29#define get_cpu_var(var) (*({ \
30 extern int simple_identifier_##var(void); \
31 preempt_disable(); \ 30 preempt_disable(); \
32 &__get_cpu_var(var); })) 31 &__get_cpu_var(var); }))
33#define put_cpu_var(var) preempt_enable() 32
33/*
34 * The weird & is necessary because sparse considers (void)(var) to be
35 * a direct dereference of percpu variable (var).
36 */
37#define put_cpu_var(var) do { \
38 (void)&(var); \
39 preempt_enable(); \
40} while (0)
34 41
35#ifdef CONFIG_SMP 42#ifdef CONFIG_SMP
36 43
@@ -127,9 +134,9 @@ extern int __init pcpu_page_first_chunk(size_t reserved_size,
127 */ 134 */
128#define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu))) 135#define per_cpu_ptr(ptr, cpu) SHIFT_PERCPU_PTR((ptr), per_cpu_offset((cpu)))
129 136
130extern void *__alloc_reserved_percpu(size_t size, size_t align); 137extern void __percpu *__alloc_reserved_percpu(size_t size, size_t align);
131extern void *__alloc_percpu(size_t size, size_t align); 138extern void __percpu *__alloc_percpu(size_t size, size_t align);
132extern void free_percpu(void *__pdata); 139extern void free_percpu(void __percpu *__pdata);
133extern phys_addr_t per_cpu_ptr_to_phys(void *addr); 140extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
134 141
135#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA 142#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
@@ -140,7 +147,7 @@ extern void __init setup_per_cpu_areas(void);
140 147
141#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); }) 148#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
142 149
143static inline void *__alloc_percpu(size_t size, size_t align) 150static inline void __percpu *__alloc_percpu(size_t size, size_t align)
144{ 151{
145 /* 152 /*
146 * Can't easily make larger alignment work with kmalloc. WARN 153 * Can't easily make larger alignment work with kmalloc. WARN
@@ -151,7 +158,7 @@ static inline void *__alloc_percpu(size_t size, size_t align)
151 return kzalloc(size, GFP_KERNEL); 158 return kzalloc(size, GFP_KERNEL);
152} 159}
153 160
154static inline void free_percpu(void *p) 161static inline void free_percpu(void __percpu *p)
155{ 162{
156 kfree(p); 163 kfree(p);
157} 164}
@@ -171,7 +178,7 @@ static inline void *pcpu_lpage_remapped(void *kaddr)
171#endif /* CONFIG_SMP */ 178#endif /* CONFIG_SMP */
172 179
173#define alloc_percpu(type) \ 180#define alloc_percpu(type) \
174 (typeof(type) *)__alloc_percpu(sizeof(type), __alignof__(type)) 181 (typeof(type) __percpu *)__alloc_percpu(sizeof(type), __alignof__(type))
175 182
176/* 183/*
177 * Optional methods for optimized non-lvalue per-cpu variable access. 184 * Optional methods for optimized non-lvalue per-cpu variable access.
@@ -188,17 +195,19 @@ static inline void *pcpu_lpage_remapped(void *kaddr)
188#ifndef percpu_read 195#ifndef percpu_read
189# define percpu_read(var) \ 196# define percpu_read(var) \
190 ({ \ 197 ({ \
191 typeof(per_cpu_var(var)) __tmp_var__; \ 198 typeof(var) *pr_ptr__ = &(var); \
192 __tmp_var__ = get_cpu_var(var); \ 199 typeof(var) pr_ret__; \
193 put_cpu_var(var); \ 200 pr_ret__ = get_cpu_var(*pr_ptr__); \
194 __tmp_var__; \ 201 put_cpu_var(*pr_ptr__); \
202 pr_ret__; \
195 }) 203 })
196#endif 204#endif
197 205
198#define __percpu_generic_to_op(var, val, op) \ 206#define __percpu_generic_to_op(var, val, op) \
199do { \ 207do { \
200 get_cpu_var(var) op val; \ 208 typeof(var) *pgto_ptr__ = &(var); \
201 put_cpu_var(var); \ 209 get_cpu_var(*pgto_ptr__) op val; \
210 put_cpu_var(*pgto_ptr__); \
202} while (0) 211} while (0)
203 212
204#ifndef percpu_write 213#ifndef percpu_write
@@ -234,6 +243,7 @@ extern void __bad_size_call_parameter(void);
234 243
235#define __pcpu_size_call_return(stem, variable) \ 244#define __pcpu_size_call_return(stem, variable) \
236({ typeof(variable) pscr_ret__; \ 245({ typeof(variable) pscr_ret__; \
246 __verify_pcpu_ptr(&(variable)); \
237 switch(sizeof(variable)) { \ 247 switch(sizeof(variable)) { \
238 case 1: pscr_ret__ = stem##1(variable);break; \ 248 case 1: pscr_ret__ = stem##1(variable);break; \
239 case 2: pscr_ret__ = stem##2(variable);break; \ 249 case 2: pscr_ret__ = stem##2(variable);break; \
@@ -247,6 +257,7 @@ extern void __bad_size_call_parameter(void);
247 257
248#define __pcpu_size_call(stem, variable, ...) \ 258#define __pcpu_size_call(stem, variable, ...) \
249do { \ 259do { \
260 __verify_pcpu_ptr(&(variable)); \
250 switch(sizeof(variable)) { \ 261 switch(sizeof(variable)) { \
251 case 1: stem##1(variable, __VA_ARGS__);break; \ 262 case 1: stem##1(variable, __VA_ARGS__);break; \
252 case 2: stem##2(variable, __VA_ARGS__);break; \ 263 case 2: stem##2(variable, __VA_ARGS__);break; \
@@ -259,8 +270,7 @@ do { \
259 270
260/* 271/*
261 * Optimized manipulation for memory allocated through the per cpu 272 * Optimized manipulation for memory allocated through the per cpu
262 * allocator or for addresses of per cpu variables (can be determined 273 * allocator or for addresses of per cpu variables.
263 * using per_cpu_var(xx).
264 * 274 *
265 * These operation guarantee exclusivity of access for other operations 275 * These operation guarantee exclusivity of access for other operations
266 * on the *same* processor. The assumption is that per cpu data is only 276 * on the *same* processor. The assumption is that per cpu data is only
@@ -311,7 +321,7 @@ do { \
311#define _this_cpu_generic_to_op(pcp, val, op) \ 321#define _this_cpu_generic_to_op(pcp, val, op) \
312do { \ 322do { \
313 preempt_disable(); \ 323 preempt_disable(); \
314 *__this_cpu_ptr(&pcp) op val; \ 324 *__this_cpu_ptr(&(pcp)) op val; \
315 preempt_enable(); \ 325 preempt_enable(); \
316} while (0) 326} while (0)
317 327
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index a7684a513994..c88d67b59394 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -21,7 +21,7 @@ struct percpu_counter {
21#ifdef CONFIG_HOTPLUG_CPU 21#ifdef CONFIG_HOTPLUG_CPU
22 struct list_head list; /* All percpu_counters are on a list */ 22 struct list_head list; /* All percpu_counters are on a list */
23#endif 23#endif
24 s32 *counters; 24 s32 __percpu *counters;
25}; 25};
26 26
27extern int percpu_counter_batch; 27extern int percpu_counter_batch;
@@ -98,9 +98,6 @@ static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount)
98 fbc->count = amount; 98 fbc->count = amount;
99} 99}
100 100
101#define __percpu_counter_add(fbc, amount, batch) \
102 percpu_counter_add(fbc, amount)
103
104static inline void 101static inline void
105percpu_counter_add(struct percpu_counter *fbc, s64 amount) 102percpu_counter_add(struct percpu_counter *fbc, s64 amount)
106{ 103{
@@ -109,6 +106,12 @@ percpu_counter_add(struct percpu_counter *fbc, s64 amount)
109 preempt_enable(); 106 preempt_enable();
110} 107}
111 108
109static inline void
110__percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
111{
112 percpu_counter_add(fbc, amount);
113}
114
112static inline s64 percpu_counter_read(struct percpu_counter *fbc) 115static inline s64 percpu_counter_read(struct percpu_counter *fbc)
113{ 116{
114 return fbc->count; 117 return fbc->count;
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
deleted file mode 100644
index e3fb25606706..000000000000
--- a/include/linux/perf_counter.h
+++ /dev/null
@@ -1,444 +0,0 @@
1/*
2 * NOTE: this file will be removed in a future kernel release, it is
3 * provided as a courtesy copy of user-space code that relies on the
4 * old (pre-rename) symbols and constants.
5 *
6 * Performance events:
7 *
8 * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de>
9 * Copyright (C) 2008-2009, Red Hat, Inc., Ingo Molnar
10 * Copyright (C) 2008-2009, Red Hat, Inc., Peter Zijlstra
11 *
12 * Data type definitions, declarations, prototypes.
13 *
14 * Started by: Thomas Gleixner and Ingo Molnar
15 *
16 * For licencing details see kernel-base/COPYING
17 */
18#ifndef _LINUX_PERF_COUNTER_H
19#define _LINUX_PERF_COUNTER_H
20
21#include <linux/types.h>
22#include <linux/ioctl.h>
23#include <asm/byteorder.h>
24
25/*
26 * User-space ABI bits:
27 */
28
29/*
30 * attr.type
31 */
32enum perf_type_id {
33 PERF_TYPE_HARDWARE = 0,
34 PERF_TYPE_SOFTWARE = 1,
35 PERF_TYPE_TRACEPOINT = 2,
36 PERF_TYPE_HW_CACHE = 3,
37 PERF_TYPE_RAW = 4,
38
39 PERF_TYPE_MAX, /* non-ABI */
40};
41
42/*
43 * Generalized performance counter event types, used by the
44 * attr.event_id parameter of the sys_perf_counter_open()
45 * syscall:
46 */
47enum perf_hw_id {
48 /*
49 * Common hardware events, generalized by the kernel:
50 */
51 PERF_COUNT_HW_CPU_CYCLES = 0,
52 PERF_COUNT_HW_INSTRUCTIONS = 1,
53 PERF_COUNT_HW_CACHE_REFERENCES = 2,
54 PERF_COUNT_HW_CACHE_MISSES = 3,
55 PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4,
56 PERF_COUNT_HW_BRANCH_MISSES = 5,
57 PERF_COUNT_HW_BUS_CYCLES = 6,
58
59 PERF_COUNT_HW_MAX, /* non-ABI */
60};
61
62/*
63 * Generalized hardware cache counters:
64 *
65 * { L1-D, L1-I, LLC, ITLB, DTLB, BPU } x
66 * { read, write, prefetch } x
67 * { accesses, misses }
68 */
69enum perf_hw_cache_id {
70 PERF_COUNT_HW_CACHE_L1D = 0,
71 PERF_COUNT_HW_CACHE_L1I = 1,
72 PERF_COUNT_HW_CACHE_LL = 2,
73 PERF_COUNT_HW_CACHE_DTLB = 3,
74 PERF_COUNT_HW_CACHE_ITLB = 4,
75 PERF_COUNT_HW_CACHE_BPU = 5,
76
77 PERF_COUNT_HW_CACHE_MAX, /* non-ABI */
78};
79
80enum perf_hw_cache_op_id {
81 PERF_COUNT_HW_CACHE_OP_READ = 0,
82 PERF_COUNT_HW_CACHE_OP_WRITE = 1,
83 PERF_COUNT_HW_CACHE_OP_PREFETCH = 2,
84
85 PERF_COUNT_HW_CACHE_OP_MAX, /* non-ABI */
86};
87
88enum perf_hw_cache_op_result_id {
89 PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0,
90 PERF_COUNT_HW_CACHE_RESULT_MISS = 1,
91
92 PERF_COUNT_HW_CACHE_RESULT_MAX, /* non-ABI */
93};
94
95/*
96 * Special "software" counters provided by the kernel, even if the hardware
97 * does not support performance counters. These counters measure various
98 * physical and sw events of the kernel (and allow the profiling of them as
99 * well):
100 */
101enum perf_sw_ids {
102 PERF_COUNT_SW_CPU_CLOCK = 0,
103 PERF_COUNT_SW_TASK_CLOCK = 1,
104 PERF_COUNT_SW_PAGE_FAULTS = 2,
105 PERF_COUNT_SW_CONTEXT_SWITCHES = 3,
106 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
107 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
108 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
109 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
110 PERF_COUNT_SW_EMULATION_FAULTS = 8,
111
112 PERF_COUNT_SW_MAX, /* non-ABI */
113};
114
115/*
116 * Bits that can be set in attr.sample_type to request information
117 * in the overflow packets.
118 */
119enum perf_counter_sample_format {
120 PERF_SAMPLE_IP = 1U << 0,
121 PERF_SAMPLE_TID = 1U << 1,
122 PERF_SAMPLE_TIME = 1U << 2,
123 PERF_SAMPLE_ADDR = 1U << 3,
124 PERF_SAMPLE_READ = 1U << 4,
125 PERF_SAMPLE_CALLCHAIN = 1U << 5,
126 PERF_SAMPLE_ID = 1U << 6,
127 PERF_SAMPLE_CPU = 1U << 7,
128 PERF_SAMPLE_PERIOD = 1U << 8,
129 PERF_SAMPLE_STREAM_ID = 1U << 9,
130 PERF_SAMPLE_RAW = 1U << 10,
131
132 PERF_SAMPLE_MAX = 1U << 11, /* non-ABI */
133};
134
135/*
136 * The format of the data returned by read() on a perf counter fd,
137 * as specified by attr.read_format:
138 *
139 * struct read_format {
140 * { u64 value;
141 * { u64 time_enabled; } && PERF_FORMAT_ENABLED
142 * { u64 time_running; } && PERF_FORMAT_RUNNING
143 * { u64 id; } && PERF_FORMAT_ID
144 * } && !PERF_FORMAT_GROUP
145 *
146 * { u64 nr;
147 * { u64 time_enabled; } && PERF_FORMAT_ENABLED
148 * { u64 time_running; } && PERF_FORMAT_RUNNING
149 * { u64 value;
150 * { u64 id; } && PERF_FORMAT_ID
151 * } cntr[nr];
152 * } && PERF_FORMAT_GROUP
153 * };
154 */
155enum perf_counter_read_format {
156 PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
157 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
158 PERF_FORMAT_ID = 1U << 2,
159 PERF_FORMAT_GROUP = 1U << 3,
160
161 PERF_FORMAT_MAX = 1U << 4, /* non-ABI */
162};
163
164#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */
165
166/*
167 * Hardware event to monitor via a performance monitoring counter:
168 */
169struct perf_counter_attr {
170
171 /*
172 * Major type: hardware/software/tracepoint/etc.
173 */
174 __u32 type;
175
176 /*
177 * Size of the attr structure, for fwd/bwd compat.
178 */
179 __u32 size;
180
181 /*
182 * Type specific configuration information.
183 */
184 __u64 config;
185
186 union {
187 __u64 sample_period;
188 __u64 sample_freq;
189 };
190
191 __u64 sample_type;
192 __u64 read_format;
193
194 __u64 disabled : 1, /* off by default */
195 inherit : 1, /* children inherit it */
196 pinned : 1, /* must always be on PMU */
197 exclusive : 1, /* only group on PMU */
198 exclude_user : 1, /* don't count user */
199 exclude_kernel : 1, /* ditto kernel */
200 exclude_hv : 1, /* ditto hypervisor */
201 exclude_idle : 1, /* don't count when idle */
202 mmap : 1, /* include mmap data */
203 comm : 1, /* include comm data */
204 freq : 1, /* use freq, not period */
205 inherit_stat : 1, /* per task counts */
206 enable_on_exec : 1, /* next exec enables */
207 task : 1, /* trace fork/exit */
208 watermark : 1, /* wakeup_watermark */
209
210 __reserved_1 : 49;
211
212 union {
213 __u32 wakeup_events; /* wakeup every n events */
214 __u32 wakeup_watermark; /* bytes before wakeup */
215 };
216 __u32 __reserved_2;
217
218 __u64 __reserved_3;
219};
220
221/*
222 * Ioctls that can be done on a perf counter fd:
223 */
224#define PERF_COUNTER_IOC_ENABLE _IO ('$', 0)
225#define PERF_COUNTER_IOC_DISABLE _IO ('$', 1)
226#define PERF_COUNTER_IOC_REFRESH _IO ('$', 2)
227#define PERF_COUNTER_IOC_RESET _IO ('$', 3)
228#define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64)
229#define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5)
230#define PERF_COUNTER_IOC_SET_FILTER _IOW('$', 6, char *)
231
232enum perf_counter_ioc_flags {
233 PERF_IOC_FLAG_GROUP = 1U << 0,
234};
235
236/*
237 * Structure of the page that can be mapped via mmap
238 */
239struct perf_counter_mmap_page {
240 __u32 version; /* version number of this structure */
241 __u32 compat_version; /* lowest version this is compat with */
242
243 /*
244 * Bits needed to read the hw counters in user-space.
245 *
246 * u32 seq;
247 * s64 count;
248 *
249 * do {
250 * seq = pc->lock;
251 *
252 * barrier()
253 * if (pc->index) {
254 * count = pmc_read(pc->index - 1);
255 * count += pc->offset;
256 * } else
257 * goto regular_read;
258 *
259 * barrier();
260 * } while (pc->lock != seq);
261 *
262 * NOTE: for obvious reason this only works on self-monitoring
263 * processes.
264 */
265 __u32 lock; /* seqlock for synchronization */
266 __u32 index; /* hardware counter identifier */
267 __s64 offset; /* add to hardware counter value */
268 __u64 time_enabled; /* time counter active */
269 __u64 time_running; /* time counter on cpu */
270
271 /*
272 * Hole for extension of the self monitor capabilities
273 */
274
275 __u64 __reserved[123]; /* align to 1k */
276
277 /*
278 * Control data for the mmap() data buffer.
279 *
280 * User-space reading the @data_head value should issue an rmb(), on
281 * SMP capable platforms, after reading this value -- see
282 * perf_counter_wakeup().
283 *
284 * When the mapping is PROT_WRITE the @data_tail value should be
285 * written by userspace to reflect the last read data. In this case
286 * the kernel will not over-write unread data.
287 */
288 __u64 data_head; /* head in the data section */
289 __u64 data_tail; /* user-space written tail */
290};
291
292#define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0)
293#define PERF_EVENT_MISC_CPUMODE_UNKNOWN (0 << 0)
294#define PERF_EVENT_MISC_KERNEL (1 << 0)
295#define PERF_EVENT_MISC_USER (2 << 0)
296#define PERF_EVENT_MISC_HYPERVISOR (3 << 0)
297
298struct perf_event_header {
299 __u32 type;
300 __u16 misc;
301 __u16 size;
302};
303
304enum perf_event_type {
305
306 /*
307 * The MMAP events record the PROT_EXEC mappings so that we can
308 * correlate userspace IPs to code. They have the following structure:
309 *
310 * struct {
311 * struct perf_event_header header;
312 *
313 * u32 pid, tid;
314 * u64 addr;
315 * u64 len;
316 * u64 pgoff;
317 * char filename[];
318 * };
319 */
320 PERF_EVENT_MMAP = 1,
321
322 /*
323 * struct {
324 * struct perf_event_header header;
325 * u64 id;
326 * u64 lost;
327 * };
328 */
329 PERF_EVENT_LOST = 2,
330
331 /*
332 * struct {
333 * struct perf_event_header header;
334 *
335 * u32 pid, tid;
336 * char comm[];
337 * };
338 */
339 PERF_EVENT_COMM = 3,
340
341 /*
342 * struct {
343 * struct perf_event_header header;
344 * u32 pid, ppid;
345 * u32 tid, ptid;
346 * u64 time;
347 * };
348 */
349 PERF_EVENT_EXIT = 4,
350
351 /*
352 * struct {
353 * struct perf_event_header header;
354 * u64 time;
355 * u64 id;
356 * u64 stream_id;
357 * };
358 */
359 PERF_EVENT_THROTTLE = 5,
360 PERF_EVENT_UNTHROTTLE = 6,
361
362 /*
363 * struct {
364 * struct perf_event_header header;
365 * u32 pid, ppid;
366 * u32 tid, ptid;
367 * u64 time;
368 * };
369 */
370 PERF_EVENT_FORK = 7,
371
372 /*
373 * struct {
374 * struct perf_event_header header;
375 * u32 pid, tid;
376 *
377 * struct read_format values;
378 * };
379 */
380 PERF_EVENT_READ = 8,
381
382 /*
383 * struct {
384 * struct perf_event_header header;
385 *
386 * { u64 ip; } && PERF_SAMPLE_IP
387 * { u32 pid, tid; } && PERF_SAMPLE_TID
388 * { u64 time; } && PERF_SAMPLE_TIME
389 * { u64 addr; } && PERF_SAMPLE_ADDR
390 * { u64 id; } && PERF_SAMPLE_ID
391 * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID
392 * { u32 cpu, res; } && PERF_SAMPLE_CPU
393 * { u64 period; } && PERF_SAMPLE_PERIOD
394 *
395 * { struct read_format values; } && PERF_SAMPLE_READ
396 *
397 * { u64 nr,
398 * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN
399 *
400 * #
401 * # The RAW record below is opaque data wrt the ABI
402 * #
403 * # That is, the ABI doesn't make any promises wrt to
404 * # the stability of its content, it may vary depending
405 * # on event, hardware, kernel version and phase of
406 * # the moon.
407 * #
408 * # In other words, PERF_SAMPLE_RAW contents are not an ABI.
409 * #
410 *
411 * { u32 size;
412 * char data[size];}&& PERF_SAMPLE_RAW
413 * };
414 */
415 PERF_EVENT_SAMPLE = 9,
416
417 PERF_EVENT_MAX, /* non-ABI */
418};
419
420enum perf_callchain_context {
421 PERF_CONTEXT_HV = (__u64)-32,
422 PERF_CONTEXT_KERNEL = (__u64)-128,
423 PERF_CONTEXT_USER = (__u64)-512,
424
425 PERF_CONTEXT_GUEST = (__u64)-2048,
426 PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
427 PERF_CONTEXT_GUEST_USER = (__u64)-2560,
428
429 PERF_CONTEXT_MAX = (__u64)-4095,
430};
431
432#define PERF_FLAG_FD_NO_GROUP (1U << 0)
433#define PERF_FLAG_FD_OUTPUT (1U << 1)
434
435/*
436 * In case some app still references the old symbols:
437 */
438
439#define __NR_perf_counter_open __NR_perf_event_open
440
441#define PR_TASK_PERF_COUNTERS_DISABLE PR_TASK_PERF_EVENTS_DISABLE
442#define PR_TASK_PERF_COUNTERS_ENABLE PR_TASK_PERF_EVENTS_ENABLE
443
444#endif /* _LINUX_PERF_COUNTER_H */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index da7bdc23f279..95477038a72a 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -211,17 +211,9 @@ struct perf_event_attr {
211 __u32 wakeup_watermark; /* bytes before wakeup */ 211 __u32 wakeup_watermark; /* bytes before wakeup */
212 }; 212 };
213 213
214 struct { /* Hardware breakpoint info */ 214 __u32 bp_type;
215 __u64 bp_addr; 215 __u64 bp_addr;
216 __u32 bp_type; 216 __u64 bp_len;
217 __u32 bp_len;
218 __u64 __bp_reserved_1;
219 __u64 __bp_reserved_2;
220 };
221
222 __u32 __reserved_2;
223
224 __u64 __reserved_3;
225}; 217};
226 218
227/* 219/*
@@ -296,7 +288,7 @@ struct perf_event_mmap_page {
296}; 288};
297 289
298#define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) 290#define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0)
299#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) 291#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
300#define PERF_RECORD_MISC_KERNEL (1 << 0) 292#define PERF_RECORD_MISC_KERNEL (1 << 0)
301#define PERF_RECORD_MISC_USER (2 << 0) 293#define PERF_RECORD_MISC_USER (2 << 0)
302#define PERF_RECORD_MISC_HYPERVISOR (3 << 0) 294#define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
@@ -362,8 +354,8 @@ enum perf_event_type {
362 * u64 stream_id; 354 * u64 stream_id;
363 * }; 355 * };
364 */ 356 */
365 PERF_RECORD_THROTTLE = 5, 357 PERF_RECORD_THROTTLE = 5,
366 PERF_RECORD_UNTHROTTLE = 6, 358 PERF_RECORD_UNTHROTTLE = 6,
367 359
368 /* 360 /*
369 * struct { 361 * struct {
@@ -377,10 +369,10 @@ enum perf_event_type {
377 369
378 /* 370 /*
379 * struct { 371 * struct {
380 * struct perf_event_header header; 372 * struct perf_event_header header;
381 * u32 pid, tid; 373 * u32 pid, tid;
382 * 374 *
383 * struct read_format values; 375 * struct read_format values;
384 * }; 376 * };
385 */ 377 */
386 PERF_RECORD_READ = 8, 378 PERF_RECORD_READ = 8,
@@ -418,7 +410,7 @@ enum perf_event_type {
418 * char data[size];}&& PERF_SAMPLE_RAW 410 * char data[size];}&& PERF_SAMPLE_RAW
419 * }; 411 * };
420 */ 412 */
421 PERF_RECORD_SAMPLE = 9, 413 PERF_RECORD_SAMPLE = 9,
422 414
423 PERF_RECORD_MAX, /* non-ABI */ 415 PERF_RECORD_MAX, /* non-ABI */
424}; 416};
@@ -460,6 +452,8 @@ enum perf_callchain_context {
460#include <linux/fs.h> 452#include <linux/fs.h>
461#include <linux/pid_namespace.h> 453#include <linux/pid_namespace.h>
462#include <linux/workqueue.h> 454#include <linux/workqueue.h>
455#include <linux/ftrace.h>
456#include <linux/cpu.h>
463#include <asm/atomic.h> 457#include <asm/atomic.h>
464 458
465#define PERF_MAX_STACK_DEPTH 255 459#define PERF_MAX_STACK_DEPTH 255
@@ -484,18 +478,19 @@ struct hw_perf_event {
484 union { 478 union {
485 struct { /* hardware */ 479 struct { /* hardware */
486 u64 config; 480 u64 config;
481 u64 last_tag;
487 unsigned long config_base; 482 unsigned long config_base;
488 unsigned long event_base; 483 unsigned long event_base;
489 int idx; 484 int idx;
485 int last_cpu;
490 }; 486 };
491 struct { /* software */ 487 struct { /* software */
492 s64 remaining; 488 s64 remaining;
493 struct hrtimer hrtimer; 489 struct hrtimer hrtimer;
494 }; 490 };
495#ifdef CONFIG_HAVE_HW_BREAKPOINT 491#ifdef CONFIG_HAVE_HW_BREAKPOINT
496 union { /* breakpoint */ 492 /* breakpoint */
497 struct arch_hw_breakpoint info; 493 struct arch_hw_breakpoint info;
498 };
499#endif 494#endif
500 }; 495 };
501 atomic64_t prev_count; 496 atomic64_t prev_count;
@@ -504,9 +499,8 @@ struct hw_perf_event {
504 atomic64_t period_left; 499 atomic64_t period_left;
505 u64 interrupts; 500 u64 interrupts;
506 501
507 u64 freq_count; 502 u64 freq_time_stamp;
508 u64 freq_interrupts; 503 u64 freq_count_stamp;
509 u64 freq_stamp;
510#endif 504#endif
511}; 505};
512 506
@@ -518,6 +512,8 @@ struct perf_event;
518struct pmu { 512struct pmu {
519 int (*enable) (struct perf_event *event); 513 int (*enable) (struct perf_event *event);
520 void (*disable) (struct perf_event *event); 514 void (*disable) (struct perf_event *event);
515 int (*start) (struct perf_event *event);
516 void (*stop) (struct perf_event *event);
521 void (*read) (struct perf_event *event); 517 void (*read) (struct perf_event *event);
522 void (*unthrottle) (struct perf_event *event); 518 void (*unthrottle) (struct perf_event *event);
523}; 519};
@@ -571,6 +567,10 @@ typedef void (*perf_overflow_handler_t)(struct perf_event *, int,
571 struct perf_sample_data *, 567 struct perf_sample_data *,
572 struct pt_regs *regs); 568 struct pt_regs *regs);
573 569
570enum perf_group_flag {
571 PERF_GROUP_SOFTWARE = 0x1,
572};
573
574/** 574/**
575 * struct perf_event - performance event kernel representation: 575 * struct perf_event - performance event kernel representation:
576 */ 576 */
@@ -580,6 +580,7 @@ struct perf_event {
580 struct list_head event_entry; 580 struct list_head event_entry;
581 struct list_head sibling_list; 581 struct list_head sibling_list;
582 int nr_siblings; 582 int nr_siblings;
583 int group_flags;
583 struct perf_event *group_leader; 584 struct perf_event *group_leader;
584 struct perf_event *output; 585 struct perf_event *output;
585 const struct pmu *pmu; 586 const struct pmu *pmu;
@@ -664,7 +665,7 @@ struct perf_event {
664 665
665 perf_overflow_handler_t overflow_handler; 666 perf_overflow_handler_t overflow_handler;
666 667
667#ifdef CONFIG_EVENT_PROFILE 668#ifdef CONFIG_EVENT_TRACING
668 struct event_filter *filter; 669 struct event_filter *filter;
669#endif 670#endif
670 671
@@ -689,7 +690,8 @@ struct perf_event_context {
689 */ 690 */
690 struct mutex mutex; 691 struct mutex mutex;
691 692
692 struct list_head group_list; 693 struct list_head pinned_groups;
694 struct list_head flexible_groups;
693 struct list_head event_list; 695 struct list_head event_list;
694 int nr_events; 696 int nr_events;
695 int nr_active; 697 int nr_active;
@@ -752,10 +754,9 @@ extern int perf_max_events;
752 754
753extern const struct pmu *hw_perf_event_init(struct perf_event *event); 755extern const struct pmu *hw_perf_event_init(struct perf_event *event);
754 756
755extern void perf_event_task_sched_in(struct task_struct *task, int cpu); 757extern void perf_event_task_sched_in(struct task_struct *task);
756extern void perf_event_task_sched_out(struct task_struct *task, 758extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next);
757 struct task_struct *next, int cpu); 759extern void perf_event_task_tick(struct task_struct *task);
758extern void perf_event_task_tick(struct task_struct *task, int cpu);
759extern int perf_event_init_task(struct task_struct *child); 760extern int perf_event_init_task(struct task_struct *child);
760extern void perf_event_exit_task(struct task_struct *child); 761extern void perf_event_exit_task(struct task_struct *child);
761extern void perf_event_free_task(struct task_struct *task); 762extern void perf_event_free_task(struct task_struct *task);
@@ -770,7 +771,7 @@ extern int perf_event_task_disable(void);
770extern int perf_event_task_enable(void); 771extern int perf_event_task_enable(void);
771extern int hw_perf_group_sched_in(struct perf_event *group_leader, 772extern int hw_perf_group_sched_in(struct perf_event *group_leader,
772 struct perf_cpu_context *cpuctx, 773 struct perf_cpu_context *cpuctx,
773 struct perf_event_context *ctx, int cpu); 774 struct perf_event_context *ctx);
774extern void perf_event_update_userpage(struct perf_event *event); 775extern void perf_event_update_userpage(struct perf_event *event);
775extern int perf_event_release_kernel(struct perf_event *event); 776extern int perf_event_release_kernel(struct perf_event *event);
776extern struct perf_event * 777extern struct perf_event *
@@ -802,6 +803,13 @@ struct perf_sample_data {
802 struct perf_raw_record *raw; 803 struct perf_raw_record *raw;
803}; 804};
804 805
806static inline
807void perf_sample_data_init(struct perf_sample_data *data, u64 addr)
808{
809 data->addr = addr;
810 data->raw = NULL;
811}
812
805extern void perf_output_sample(struct perf_output_handle *handle, 813extern void perf_output_sample(struct perf_output_handle *handle,
806 struct perf_event_header *header, 814 struct perf_event_header *header,
807 struct perf_sample_data *data, 815 struct perf_sample_data *data,
@@ -820,9 +828,14 @@ extern int perf_event_overflow(struct perf_event *event, int nmi,
820 */ 828 */
821static inline int is_software_event(struct perf_event *event) 829static inline int is_software_event(struct perf_event *event)
822{ 830{
823 return (event->attr.type != PERF_TYPE_RAW) && 831 switch (event->attr.type) {
824 (event->attr.type != PERF_TYPE_HARDWARE) && 832 case PERF_TYPE_SOFTWARE:
825 (event->attr.type != PERF_TYPE_HW_CACHE); 833 case PERF_TYPE_TRACEPOINT:
834 /* for now the breakpoint stuff also works as software event */
835 case PERF_TYPE_BREAKPOINT:
836 return 1;
837 }
838 return 0;
826} 839}
827 840
828extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; 841extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX];
@@ -836,6 +849,44 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
836 __perf_sw_event(event_id, nr, nmi, regs, addr); 849 __perf_sw_event(event_id, nr, nmi, regs, addr);
837} 850}
838 851
852extern void
853perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int skip);
854
855/*
856 * Take a snapshot of the regs. Skip ip and frame pointer to
857 * the nth caller. We only need a few of the regs:
858 * - ip for PERF_SAMPLE_IP
859 * - cs for user_mode() tests
860 * - bp for callchains
861 * - eflags, for future purposes, just in case
862 */
863static inline void perf_fetch_caller_regs(struct pt_regs *regs, int skip)
864{
865 unsigned long ip;
866
867 memset(regs, 0, sizeof(*regs));
868
869 switch (skip) {
870 case 1 :
871 ip = CALLER_ADDR0;
872 break;
873 case 2 :
874 ip = CALLER_ADDR1;
875 break;
876 case 3 :
877 ip = CALLER_ADDR2;
878 break;
879 case 4:
880 ip = CALLER_ADDR3;
881 break;
882 /* No need to support further for now */
883 default:
884 ip = 0;
885 }
886
887 return perf_arch_fetch_caller_regs(regs, ip, skip);
888}
889
839extern void __perf_event_mmap(struct vm_area_struct *vma); 890extern void __perf_event_mmap(struct vm_area_struct *vma);
840 891
841static inline void perf_event_mmap(struct vm_area_struct *vma) 892static inline void perf_event_mmap(struct vm_area_struct *vma)
@@ -853,9 +904,24 @@ extern int sysctl_perf_event_paranoid;
853extern int sysctl_perf_event_mlock; 904extern int sysctl_perf_event_mlock;
854extern int sysctl_perf_event_sample_rate; 905extern int sysctl_perf_event_sample_rate;
855 906
907static inline bool perf_paranoid_tracepoint_raw(void)
908{
909 return sysctl_perf_event_paranoid > -1;
910}
911
912static inline bool perf_paranoid_cpu(void)
913{
914 return sysctl_perf_event_paranoid > 0;
915}
916
917static inline bool perf_paranoid_kernel(void)
918{
919 return sysctl_perf_event_paranoid > 1;
920}
921
856extern void perf_event_init(void); 922extern void perf_event_init(void);
857extern void perf_tp_event(int event_id, u64 addr, u64 count, 923extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
858 void *record, int entry_size); 924 int entry_size, struct pt_regs *regs);
859extern void perf_bp_event(struct perf_event *event, void *data); 925extern void perf_bp_event(struct perf_event *event, void *data);
860 926
861#ifndef perf_misc_flags 927#ifndef perf_misc_flags
@@ -876,12 +942,12 @@ extern void perf_event_enable(struct perf_event *event);
876extern void perf_event_disable(struct perf_event *event); 942extern void perf_event_disable(struct perf_event *event);
877#else 943#else
878static inline void 944static inline void
879perf_event_task_sched_in(struct task_struct *task, int cpu) { } 945perf_event_task_sched_in(struct task_struct *task) { }
880static inline void 946static inline void
881perf_event_task_sched_out(struct task_struct *task, 947perf_event_task_sched_out(struct task_struct *task,
882 struct task_struct *next, int cpu) { } 948 struct task_struct *next) { }
883static inline void 949static inline void
884perf_event_task_tick(struct task_struct *task, int cpu) { } 950perf_event_task_tick(struct task_struct *task) { }
885static inline int perf_event_init_task(struct task_struct *child) { return 0; } 951static inline int perf_event_init_task(struct task_struct *child) { return 0; }
886static inline void perf_event_exit_task(struct task_struct *child) { } 952static inline void perf_event_exit_task(struct task_struct *child) { }
887static inline void perf_event_free_task(struct task_struct *task) { } 953static inline void perf_event_free_task(struct task_struct *task) { }
@@ -896,13 +962,13 @@ static inline void
896perf_sw_event(u32 event_id, u64 nr, int nmi, 962perf_sw_event(u32 event_id, u64 nr, int nmi,
897 struct pt_regs *regs, u64 addr) { } 963 struct pt_regs *regs, u64 addr) { }
898static inline void 964static inline void
899perf_bp_event(struct perf_event *event, void *data) { } 965perf_bp_event(struct perf_event *event, void *data) { }
900 966
901static inline void perf_event_mmap(struct vm_area_struct *vma) { } 967static inline void perf_event_mmap(struct vm_area_struct *vma) { }
902static inline void perf_event_comm(struct task_struct *tsk) { } 968static inline void perf_event_comm(struct task_struct *tsk) { }
903static inline void perf_event_fork(struct task_struct *tsk) { } 969static inline void perf_event_fork(struct task_struct *tsk) { }
904static inline void perf_event_init(void) { } 970static inline void perf_event_init(void) { }
905static inline int perf_swevent_get_recursion_context(void) { return -1; } 971static inline int perf_swevent_get_recursion_context(void) { return -1; }
906static inline void perf_swevent_put_recursion_context(int rctx) { } 972static inline void perf_swevent_put_recursion_context(int rctx) { }
907static inline void perf_event_enable(struct perf_event *event) { } 973static inline void perf_event_enable(struct perf_event *event) { }
908static inline void perf_event_disable(struct perf_event *event) { } 974static inline void perf_event_disable(struct perf_event *event) { }
@@ -911,5 +977,21 @@ static inline void perf_event_disable(struct perf_event *event) { }
911#define perf_output_put(handle, x) \ 977#define perf_output_put(handle, x) \
912 perf_output_copy((handle), &(x), sizeof(x)) 978 perf_output_copy((handle), &(x), sizeof(x))
913 979
980/*
981 * This has to have a higher priority than migration_notifier in sched.c.
982 */
983#define perf_cpu_notifier(fn) \
984do { \
985 static struct notifier_block fn##_nb __cpuinitdata = \
986 { .notifier_call = fn, .priority = 20 }; \
987 fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \
988 (void *)(unsigned long)smp_processor_id()); \
989 fn(&fn##_nb, (unsigned long)CPU_STARTING, \
990 (void *)(unsigned long)smp_processor_id()); \
991 fn(&fn##_nb, (unsigned long)CPU_ONLINE, \
992 (void *)(unsigned long)smp_processor_id()); \
993 register_cpu_notifier(&fn##_nb); \
994} while (0)
995
914#endif /* __KERNEL__ */ 996#endif /* __KERNEL__ */
915#endif /* _LINUX_PERF_EVENT_H */ 997#endif /* _LINUX_PERF_EVENT_H */
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index 228b0b6306b0..0b80c806631f 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -315,6 +315,7 @@ struct sadb_x_kmaddress {
315#define SADB_X_EALG_AES_GCM_ICV12 19 315#define SADB_X_EALG_AES_GCM_ICV12 19
316#define SADB_X_EALG_AES_GCM_ICV16 20 316#define SADB_X_EALG_AES_GCM_ICV16 20
317#define SADB_X_EALG_CAMELLIACBC 22 317#define SADB_X_EALG_CAMELLIACBC 22
318#define SADB_X_EALG_NULL_AES_GMAC 23
318#define SADB_EALG_MAX 253 /* last EALG */ 319#define SADB_EALG_MAX 253 /* last EALG */
319/* private allocations should use 249-255 (RFC2407) */ 320/* private allocations should use 249-255 (RFC2407) */
320#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ 321#define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index b1368b8f6572..14d7fdf6a90a 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -447,10 +447,12 @@ struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
447int phy_device_register(struct phy_device *phy); 447int phy_device_register(struct phy_device *phy);
448int phy_clear_interrupt(struct phy_device *phydev); 448int phy_clear_interrupt(struct phy_device *phydev);
449int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); 449int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
450int phy_init_hw(struct phy_device *phydev);
450int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, 451int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
451 u32 flags, phy_interface_t interface); 452 u32 flags, phy_interface_t interface);
452struct phy_device * phy_attach(struct net_device *dev, 453struct phy_device * phy_attach(struct net_device *dev,
453 const char *bus_id, u32 flags, phy_interface_t interface); 454 const char *bus_id, u32 flags, phy_interface_t interface);
455struct phy_device *phy_find_first(struct mii_bus *bus);
454int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, 456int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
455 void (*handler)(struct net_device *), u32 flags, 457 void (*handler)(struct net_device *), u32 flags,
456 phy_interface_t interface); 458 phy_interface_t interface);
@@ -484,6 +486,7 @@ void phy_driver_unregister(struct phy_driver *drv);
484int phy_driver_register(struct phy_driver *new_driver); 486int phy_driver_register(struct phy_driver *new_driver);
485void phy_prepare_link(struct phy_device *phydev, 487void phy_prepare_link(struct phy_device *phydev,
486 void (*adjust_link)(struct net_device *)); 488 void (*adjust_link)(struct net_device *));
489void phy_state_machine(struct work_struct *work);
487void phy_start_machine(struct phy_device *phydev, 490void phy_start_machine(struct phy_device *phydev,
488 void (*handler)(struct net_device *)); 491 void (*handler)(struct net_device *));
489void phy_stop_machine(struct phy_device *phydev); 492void phy_stop_machine(struct phy_device *phydev);
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index 76e5053e1fac..721301b0a908 100644
--- a/include/linux/pktcdvd.h
+++ b/include/linux/pktcdvd.h
@@ -163,10 +163,8 @@ struct packet_iosched
163 atomic_t attention; /* Set to non-zero when queue processing is needed */ 163 atomic_t attention; /* Set to non-zero when queue processing is needed */
164 int writing; /* Non-zero when writing, zero when reading */ 164 int writing; /* Non-zero when writing, zero when reading */
165 spinlock_t lock; /* Protecting read/write queue manipulations */ 165 spinlock_t lock; /* Protecting read/write queue manipulations */
166 struct bio *read_queue; 166 struct bio_list read_queue;
167 struct bio *read_queue_tail; 167 struct bio_list write_queue;
168 struct bio *write_queue;
169 struct bio *write_queue_tail;
170 sector_t last_write; /* The sector where the last write ended */ 168 sector_t last_write; /* The sector where the last write ended */
171 int successive_reads; 169 int successive_reads;
172}; 170};
@@ -206,8 +204,8 @@ struct packet_data
206 spinlock_t lock; /* Lock protecting state transitions and */ 204 spinlock_t lock; /* Lock protecting state transitions and */
207 /* orig_bios list */ 205 /* orig_bios list */
208 206
209 struct bio *orig_bios; /* Original bios passed to pkt_make_request */ 207 struct bio_list orig_bios; /* Original bios passed to pkt_make_request */
210 struct bio *orig_bios_tail;/* that will be handled by this packet */ 208 /* that will be handled by this packet */
211 int write_size; /* Total size of all bios in the orig_bios */ 209 int write_size; /* Total size of all bios in the orig_bios */
212 /* list, measured in number of frames */ 210 /* list, measured in number of frames */
213 211
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 71ff887ca44e..212da17d06af 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -21,7 +21,7 @@ struct platform_device {
21 u32 num_resources; 21 u32 num_resources;
22 struct resource * resource; 22 struct resource * resource;
23 23
24 struct platform_device_id *id_entry; 24 const struct platform_device_id *id_entry;
25 25
26 /* arch specific additions */ 26 /* arch specific additions */
27 struct pdev_archdata archdata; 27 struct pdev_archdata archdata;
@@ -62,7 +62,7 @@ struct platform_driver {
62 int (*suspend)(struct platform_device *, pm_message_t state); 62 int (*suspend)(struct platform_device *, pm_message_t state);
63 int (*resume)(struct platform_device *); 63 int (*resume)(struct platform_device *);
64 struct device_driver driver; 64 struct device_driver driver;
65 struct platform_device_id *id_table; 65 const struct platform_device_id *id_table;
66}; 66};
67 67
68extern int platform_driver_register(struct platform_driver *); 68extern int platform_driver_register(struct platform_driver *);
@@ -77,6 +77,11 @@ extern int platform_driver_probe(struct platform_driver *driver,
77#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) 77#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
78#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) 78#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
79 79
80extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
81 int (*probe)(struct platform_device *),
82 struct resource *res, unsigned int n_res,
83 const void *data, size_t size);
84
80/* early platform driver interface */ 85/* early platform driver interface */
81struct early_platform_driver { 86struct early_platform_driver {
82 const char *class_str; 87 const char *class_str;
diff --git a/include/linux/plist.h b/include/linux/plist.h
index 8227f717c70f..6898985e7b38 100644
--- a/include/linux/plist.h
+++ b/include/linux/plist.h
@@ -45,7 +45,7 @@
45 * the insertion of new nodes. There are no nodes with duplicate 45 * the insertion of new nodes. There are no nodes with duplicate
46 * priorites on the list. 46 * priorites on the list.
47 * 47 *
48 * The nodes on the node_list is ordered by priority and can contain 48 * The nodes on the node_list are ordered by priority and can contain
49 * entries which have the same priority. Those entries are ordered 49 * entries which have the same priority. Those entries are ordered
50 * FIFO 50 * FIFO
51 * 51 *
@@ -265,7 +265,7 @@ static inline int plist_node_empty(const struct plist_node *node)
265 * 265 *
266 * Assumes the plist is _not_ empty. 266 * Assumes the plist is _not_ empty.
267 */ 267 */
268static inline struct plist_node* plist_first(const struct plist_head *head) 268static inline struct plist_node *plist_first(const struct plist_head *head)
269{ 269{
270 return list_entry(head->node_list.next, 270 return list_entry(head->node_list.next,
271 struct plist_node, plist.node_list); 271 struct plist_node, plist.node_list);
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 198b8f9fe05e..8e258c727971 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -26,6 +26,7 @@
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <linux/wait.h> 27#include <linux/wait.h>
28#include <linux/timer.h> 28#include <linux/timer.h>
29#include <linux/completion.h>
29 30
30/* 31/*
31 * Callbacks for platform drivers to implement. 32 * Callbacks for platform drivers to implement.
@@ -214,20 +215,59 @@ struct dev_pm_ops {
214 int (*runtime_idle)(struct device *dev); 215 int (*runtime_idle)(struct device *dev);
215}; 216};
216 217
218#ifdef CONFIG_PM_SLEEP
219#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
220 .suspend = suspend_fn, \
221 .resume = resume_fn, \
222 .freeze = suspend_fn, \
223 .thaw = resume_fn, \
224 .poweroff = suspend_fn, \
225 .restore = resume_fn,
226#else
227#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
228#endif
229
230#ifdef CONFIG_PM_RUNTIME
231#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
232 .runtime_suspend = suspend_fn, \
233 .runtime_resume = resume_fn, \
234 .runtime_idle = idle_fn,
235#else
236#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
237#endif
238
217/* 239/*
218 * Use this if you want to use the same suspend and resume callbacks for suspend 240 * Use this if you want to use the same suspend and resume callbacks for suspend
219 * to RAM and hibernation. 241 * to RAM and hibernation.
220 */ 242 */
221#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ 243#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
222const struct dev_pm_ops name = { \ 244const struct dev_pm_ops name = { \
223 .suspend = suspend_fn, \ 245 SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
224 .resume = resume_fn, \ 246}
225 .freeze = suspend_fn, \ 247
226 .thaw = resume_fn, \ 248/*
227 .poweroff = suspend_fn, \ 249 * Use this for defining a set of PM operations to be used in all situations
228 .restore = resume_fn, \ 250 * (sustem suspend, hibernation or runtime PM).
251 */
252#define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
253const struct dev_pm_ops name = { \
254 SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
255 SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
229} 256}
230 257
258/*
259 * Use this for subsystems (bus types, device types, device classes) that don't
260 * need any special suspend/resume handling in addition to invoking the PM
261 * callbacks provided by device drivers supporting both the system sleep PM and
262 * runtime PM, make the pm member point to generic_subsys_pm_ops.
263 */
264#ifdef CONFIG_PM_OPS
265extern struct dev_pm_ops generic_subsys_pm_ops;
266#define GENERIC_SUBSYS_PM_OPS (&generic_subsys_pm_ops)
267#else
268#define GENERIC_SUBSYS_PM_OPS NULL
269#endif
270
231/** 271/**
232 * PM_EVENT_ messages 272 * PM_EVENT_ messages
233 * 273 *
@@ -412,9 +452,11 @@ struct dev_pm_info {
412 pm_message_t power_state; 452 pm_message_t power_state;
413 unsigned int can_wakeup:1; 453 unsigned int can_wakeup:1;
414 unsigned int should_wakeup:1; 454 unsigned int should_wakeup:1;
455 unsigned async_suspend:1;
415 enum dpm_state status; /* Owned by the PM core */ 456 enum dpm_state status; /* Owned by the PM core */
416#ifdef CONFIG_PM_SLEEP 457#ifdef CONFIG_PM_SLEEP
417 struct list_head entry; 458 struct list_head entry;
459 struct completion completion;
418#endif 460#endif
419#ifdef CONFIG_PM_RUNTIME 461#ifdef CONFIG_PM_RUNTIME
420 struct timer_list suspend_timer; 462 struct timer_list suspend_timer;
@@ -430,6 +472,7 @@ struct dev_pm_info {
430 unsigned int request_pending:1; 472 unsigned int request_pending:1;
431 unsigned int deferred_resume:1; 473 unsigned int deferred_resume:1;
432 unsigned int run_wake:1; 474 unsigned int run_wake:1;
475 unsigned int runtime_auto:1;
433 enum rpm_request request; 476 enum rpm_request request;
434 enum rpm_status runtime_status; 477 enum rpm_status runtime_status;
435 int runtime_error; 478 int runtime_error;
@@ -508,6 +551,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
508 __suspend_report_result(__func__, fn, ret); \ 551 __suspend_report_result(__func__, fn, ret); \
509 } while (0) 552 } while (0)
510 553
554extern void device_pm_wait_for_dev(struct device *sub, struct device *dev);
511#else /* !CONFIG_PM_SLEEP */ 555#else /* !CONFIG_PM_SLEEP */
512 556
513#define device_pm_lock() do {} while (0) 557#define device_pm_lock() do {} while (0)
@@ -520,6 +564,7 @@ static inline int dpm_suspend_start(pm_message_t state)
520 564
521#define suspend_report_result(fn, ret) do {} while (0) 565#define suspend_report_result(fn, ret) do {} while (0)
522 566
567static inline void device_pm_wait_for_dev(struct device *a, struct device *b) {}
523#endif /* !CONFIG_PM_SLEEP */ 568#endif /* !CONFIG_PM_SLEEP */
524 569
525/* How to reorder dpm_list after device_move() */ 570/* How to reorder dpm_list after device_move() */
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 370ce0a6fe4a..b776db737244 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -28,6 +28,8 @@ extern int __pm_runtime_set_status(struct device *dev, unsigned int status);
28extern int pm_runtime_barrier(struct device *dev); 28extern int pm_runtime_barrier(struct device *dev);
29extern void pm_runtime_enable(struct device *dev); 29extern void pm_runtime_enable(struct device *dev);
30extern void __pm_runtime_disable(struct device *dev, bool check_resume); 30extern void __pm_runtime_disable(struct device *dev, bool check_resume);
31extern void pm_runtime_allow(struct device *dev);
32extern void pm_runtime_forbid(struct device *dev);
31 33
32static inline bool pm_children_suspended(struct device *dev) 34static inline bool pm_children_suspended(struct device *dev)
33{ 35{
@@ -60,6 +62,11 @@ static inline void device_set_run_wake(struct device *dev, bool enable)
60 dev->power.run_wake = enable; 62 dev->power.run_wake = enable;
61} 63}
62 64
65static inline bool pm_runtime_suspended(struct device *dev)
66{
67 return dev->power.runtime_status == RPM_SUSPENDED;
68}
69
63#else /* !CONFIG_PM_RUNTIME */ 70#else /* !CONFIG_PM_RUNTIME */
64 71
65static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } 72static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; }
@@ -78,6 +85,8 @@ static inline int __pm_runtime_set_status(struct device *dev,
78static inline int pm_runtime_barrier(struct device *dev) { return 0; } 85static inline int pm_runtime_barrier(struct device *dev) { return 0; }
79static inline void pm_runtime_enable(struct device *dev) {} 86static inline void pm_runtime_enable(struct device *dev) {}
80static inline void __pm_runtime_disable(struct device *dev, bool c) {} 87static inline void __pm_runtime_disable(struct device *dev, bool c) {}
88static inline void pm_runtime_allow(struct device *dev) {}
89static inline void pm_runtime_forbid(struct device *dev) {}
81 90
82static inline bool pm_children_suspended(struct device *dev) { return false; } 91static inline bool pm_children_suspended(struct device *dev) { return false; }
83static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} 92static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
@@ -85,6 +94,7 @@ static inline void pm_runtime_get_noresume(struct device *dev) {}
85static inline void pm_runtime_put_noidle(struct device *dev) {} 94static inline void pm_runtime_put_noidle(struct device *dev) {}
86static inline bool device_run_wake(struct device *dev) { return false; } 95static inline bool device_run_wake(struct device *dev) { return false; }
87static inline void device_set_run_wake(struct device *dev, bool enable) {} 96static inline void device_set_run_wake(struct device *dev, bool enable) {}
97static inline bool pm_runtime_suspended(struct device *dev) { return false; }
88 98
89#endif /* !CONFIG_PM_RUNTIME */ 99#endif /* !CONFIG_PM_RUNTIME */
90 100
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index fddfafaed024..7c4193eb0072 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -334,6 +334,19 @@ extern struct pnp_protocol pnpbios_protocol;
334#define pnp_device_is_pnpbios(dev) 0 334#define pnp_device_is_pnpbios(dev) 0
335#endif 335#endif
336 336
337#ifdef CONFIG_PNPACPI
338extern struct pnp_protocol pnpacpi_protocol;
339
340static inline struct acpi_device *pnp_acpi_device(struct pnp_dev *dev)
341{
342 if (dev->protocol == &pnpacpi_protocol)
343 return dev->data;
344 return NULL;
345}
346#else
347#define pnp_acpi_device(dev) 0
348#endif
349
337/* status */ 350/* status */
338#define PNP_READY 0x0000 351#define PNP_READY 0x0000
339#define PNP_ATTACHED 0x0001 352#define PNP_ATTACHED 0x0001
diff --git a/include/linux/poison.h b/include/linux/poison.h
index 7fc194aef8c2..2110a81c5e2a 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -2,13 +2,25 @@
2#define _LINUX_POISON_H 2#define _LINUX_POISON_H
3 3
4/********** include/linux/list.h **********/ 4/********** include/linux/list.h **********/
5
6/*
7 * Architectures might want to move the poison pointer offset
8 * into some well-recognized area such as 0xdead000000000000,
9 * that is also not mappable by user-space exploits:
10 */
11#ifdef CONFIG_ILLEGAL_POINTER_VALUE
12# define POISON_POINTER_DELTA _AC(CONFIG_ILLEGAL_POINTER_VALUE, UL)
13#else
14# define POISON_POINTER_DELTA 0
15#endif
16
5/* 17/*
6 * These are non-NULL pointers that will result in page faults 18 * These are non-NULL pointers that will result in page faults
7 * under normal circumstances, used to verify that nobody uses 19 * under normal circumstances, used to verify that nobody uses
8 * non-initialized list entries. 20 * non-initialized list entries.
9 */ 21 */
10#define LIST_POISON1 ((void *) 0x00100100) 22#define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA)
11#define LIST_POISON2 ((void *) 0x00200200) 23#define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA)
12 24
13/********** include/linux/timer.h **********/ 25/********** include/linux/timer.h **********/
14/* 26/*
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 6673743946f7..600cc1fde64d 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -10,8 +10,10 @@
10#include <linux/wait.h> 10#include <linux/wait.h>
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/fs.h> 12#include <linux/fs.h>
13#include <linux/sysctl.h>
13#include <asm/uaccess.h> 14#include <asm/uaccess.h>
14 15
16extern struct ctl_table epoll_table[]; /* for sysctl */
15/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating 17/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating
16 additional memory. */ 18 additional memory. */
17#define MAX_STACK_ALLOC 832 19#define MAX_STACK_ALLOC 832
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index b5d096d3a9be..ebd2b8fb00d0 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -82,6 +82,7 @@ enum power_supply_property {
82 POWER_SUPPLY_PROP_PRESENT, 82 POWER_SUPPLY_PROP_PRESENT,
83 POWER_SUPPLY_PROP_ONLINE, 83 POWER_SUPPLY_PROP_ONLINE,
84 POWER_SUPPLY_PROP_TECHNOLOGY, 84 POWER_SUPPLY_PROP_TECHNOLOGY,
85 POWER_SUPPLY_PROP_CYCLE_COUNT,
85 POWER_SUPPLY_PROP_VOLTAGE_MAX, 86 POWER_SUPPLY_PROP_VOLTAGE_MAX,
86 POWER_SUPPLY_PROP_VOLTAGE_MIN, 87 POWER_SUPPLY_PROP_VOLTAGE_MIN,
87 POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, 88 POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 56f2d63a5cbb..e1fb60729979 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -27,6 +27,26 @@
27#define PTRACE_GETSIGINFO 0x4202 27#define PTRACE_GETSIGINFO 0x4202
28#define PTRACE_SETSIGINFO 0x4203 28#define PTRACE_SETSIGINFO 0x4203
29 29
30/*
31 * Generic ptrace interface that exports the architecture specific regsets
32 * using the corresponding NT_* types (which are also used in the core dump).
33 * Please note that the NT_PRSTATUS note type in a core dump contains a full
34 * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the
35 * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the
36 * other user_regset flavors, the user_regset layout and the ELF core dump note
37 * payload are exactly the same layout.
38 *
39 * This interface usage is as follows:
40 * struct iovec iov = { buf, len};
41 *
42 * ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov);
43 *
44 * On the successful completion, iov.len will be updated by the kernel,
45 * specifying how much the kernel has written/read to/from the user's iov.buf.
46 */
47#define PTRACE_GETREGSET 0x4204
48#define PTRACE_SETREGSET 0x4205
49
30/* options set using PTRACE_SETOPTIONS */ 50/* options set using PTRACE_SETOPTIONS */
31#define PTRACE_O_TRACESYSGOOD 0x00000001 51#define PTRACE_O_TRACESYSGOOD 0x00000001
32#define PTRACE_O_TRACEFORK 0x00000002 52#define PTRACE_O_TRACEFORK 0x00000002
@@ -244,6 +264,9 @@ static inline void user_enable_single_step(struct task_struct *task)
244static inline void user_disable_single_step(struct task_struct *task) 264static inline void user_disable_single_step(struct task_struct *task)
245{ 265{
246} 266}
267#else
268extern void user_enable_single_step(struct task_struct *);
269extern void user_disable_single_step(struct task_struct *);
247#endif /* arch_has_single_step */ 270#endif /* arch_has_single_step */
248 271
249#ifndef arch_has_block_step 272#ifndef arch_has_block_step
@@ -271,6 +294,8 @@ static inline void user_enable_block_step(struct task_struct *task)
271{ 294{
272 BUG(); /* This can never be called. */ 295 BUG(); /* This can never be called. */
273} 296}
297#else
298extern void user_enable_block_step(struct task_struct *);
274#endif /* arch_has_block_step */ 299#endif /* arch_has_block_step */
275 300
276#ifdef ARCH_HAS_USER_SINGLE_STEP_INFO 301#ifdef ARCH_HAS_USER_SINGLE_STEP_INFO
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 7a9754c96775..01b3d759f1fc 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -10,7 +10,7 @@ struct platform_pwm_backlight_data {
10 unsigned int dft_brightness; 10 unsigned int dft_brightness;
11 unsigned int pwm_period_ns; 11 unsigned int pwm_period_ns;
12 int (*init)(struct device *dev); 12 int (*init)(struct device *dev);
13 int (*notify)(int brightness); 13 int (*notify)(struct device *dev, int brightness);
14 void (*exit)(struct device *dev); 14 void (*exit)(struct device *dev);
15}; 15};
16 16
diff --git a/include/linux/quota.h b/include/linux/quota.h
index e70e62194243..b462916b2a0a 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -279,9 +279,6 @@ struct dquot {
279 struct mem_dqblk dq_dqb; /* Diskquota usage */ 279 struct mem_dqblk dq_dqb; /* Diskquota usage */
280}; 280};
281 281
282#define QUOTA_OK 0
283#define NO_QUOTA 1
284
285/* Operations which must be implemented by each quota format */ 282/* Operations which must be implemented by each quota format */
286struct quota_format_ops { 283struct quota_format_ops {
287 int (*check_quota_file)(struct super_block *sb, int type); /* Detect whether file is in our format */ 284 int (*check_quota_file)(struct super_block *sb, int type); /* Detect whether file is in our format */
@@ -295,13 +292,6 @@ struct quota_format_ops {
295 292
296/* Operations working with dquots */ 293/* Operations working with dquots */
297struct dquot_operations { 294struct dquot_operations {
298 int (*initialize) (struct inode *, int);
299 int (*drop) (struct inode *);
300 int (*alloc_space) (struct inode *, qsize_t, int);
301 int (*alloc_inode) (const struct inode *, qsize_t);
302 int (*free_space) (struct inode *, qsize_t);
303 int (*free_inode) (const struct inode *, qsize_t);
304 int (*transfer) (struct inode *, struct iattr *);
305 int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ 295 int (*write_dquot) (struct dquot *); /* Ordinary dquot write */
306 struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */ 296 struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */
307 void (*destroy_dquot)(struct dquot *); /* Free memory for dquot */ 297 void (*destroy_dquot)(struct dquot *); /* Free memory for dquot */
@@ -309,21 +299,16 @@ struct dquot_operations {
309 int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ 299 int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */
310 int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ 300 int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */
311 int (*write_info) (struct super_block *, int); /* Write of quota "superblock" */ 301 int (*write_info) (struct super_block *, int); /* Write of quota "superblock" */
312 /* reserve quota for delayed block allocation */ 302 /* get reserved quota for delayed alloc, value returned is managed by
313 int (*reserve_space) (struct inode *, qsize_t, int); 303 * quota code only */
314 /* claim reserved quota for delayed alloc */ 304 qsize_t *(*get_reserved_space) (struct inode *);
315 int (*claim_space) (struct inode *, qsize_t);
316 /* release rsved quota for delayed alloc */
317 void (*release_rsv) (struct inode *, qsize_t);
318 /* get reserved quota for delayed alloc */
319 qsize_t (*get_reserved_space) (struct inode *);
320}; 305};
321 306
322/* Operations handling requests from userspace */ 307/* Operations handling requests from userspace */
323struct quotactl_ops { 308struct quotactl_ops {
324 int (*quota_on)(struct super_block *, int, int, char *, int); 309 int (*quota_on)(struct super_block *, int, int, char *, int);
325 int (*quota_off)(struct super_block *, int, int); 310 int (*quota_off)(struct super_block *, int, int);
326 int (*quota_sync)(struct super_block *, int); 311 int (*quota_sync)(struct super_block *, int, int);
327 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 312 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
328 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 313 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
329 int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); 314 int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *);
@@ -356,26 +341,25 @@ enum {
356#define DQUOT_STATE_FLAGS (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED | \ 341#define DQUOT_STATE_FLAGS (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED | \
357 DQUOT_SUSPENDED) 342 DQUOT_SUSPENDED)
358/* Other quota flags */ 343/* Other quota flags */
359#define DQUOT_QUOTA_SYS_FILE (1 << 6) /* Quota file is a special 344#define DQUOT_STATE_LAST (_DQUOT_STATE_FLAGS * MAXQUOTAS)
345#define DQUOT_QUOTA_SYS_FILE (1 << DQUOT_STATE_LAST)
346 /* Quota file is a special
360 * system file and user cannot 347 * system file and user cannot
361 * touch it. Filesystem is 348 * touch it. Filesystem is
362 * responsible for setting 349 * responsible for setting
363 * S_NOQUOTA, S_NOATIME flags 350 * S_NOQUOTA, S_NOATIME flags
364 */ 351 */
365#define DQUOT_NEGATIVE_USAGE (1 << 7) /* Allow negative quota usage */ 352#define DQUOT_NEGATIVE_USAGE (1 << (DQUOT_STATE_LAST + 1))
353 /* Allow negative quota usage */
366 354
367static inline unsigned int dquot_state_flag(unsigned int flags, int type) 355static inline unsigned int dquot_state_flag(unsigned int flags, int type)
368{ 356{
369 if (type == USRQUOTA) 357 return flags << _DQUOT_STATE_FLAGS * type;
370 return flags;
371 return flags << _DQUOT_STATE_FLAGS;
372} 358}
373 359
374static inline unsigned int dquot_generic_flag(unsigned int flags, int type) 360static inline unsigned int dquot_generic_flag(unsigned int flags, int type)
375{ 361{
376 if (type == USRQUOTA) 362 return (flags >> _DQUOT_STATE_FLAGS * type) & DQUOT_STATE_FLAGS;
377 return flags;
378 return flags >> _DQUOT_STATE_FLAGS;
379} 363}
380 364
381#ifdef CONFIG_QUOTA_NETLINK_INTERFACE 365#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 3ebb23153640..e6fa7acce290 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -19,15 +19,12 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb)
19/* 19/*
20 * declaration of quota_function calls in kernel. 20 * declaration of quota_function calls in kernel.
21 */ 21 */
22void sync_quota_sb(struct super_block *sb, int type); 22void inode_add_rsv_space(struct inode *inode, qsize_t number);
23static inline void writeout_quota_sb(struct super_block *sb, int type) 23void inode_claim_rsv_space(struct inode *inode, qsize_t number);
24{ 24void inode_sub_rsv_space(struct inode *inode, qsize_t number);
25 if (sb->s_qcop->quota_sync)
26 sb->s_qcop->quota_sync(sb, type);
27}
28 25
29int dquot_initialize(struct inode *inode, int type); 26void dquot_initialize(struct inode *inode);
30int dquot_drop(struct inode *inode); 27void dquot_drop(struct inode *inode);
31struct dquot *dqget(struct super_block *sb, unsigned int id, int type); 28struct dquot *dqget(struct super_block *sb, unsigned int id, int type);
32void dqput(struct dquot *dquot); 29void dqput(struct dquot *dquot);
33int dquot_scan_active(struct super_block *sb, 30int dquot_scan_active(struct super_block *sb,
@@ -36,24 +33,23 @@ int dquot_scan_active(struct super_block *sb,
36struct dquot *dquot_alloc(struct super_block *sb, int type); 33struct dquot *dquot_alloc(struct super_block *sb, int type);
37void dquot_destroy(struct dquot *dquot); 34void dquot_destroy(struct dquot *dquot);
38 35
39int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); 36int __dquot_alloc_space(struct inode *inode, qsize_t number,
40int dquot_alloc_inode(const struct inode *inode, qsize_t number); 37 int warn, int reserve);
38void __dquot_free_space(struct inode *inode, qsize_t number, int reserve);
41 39
42int dquot_reserve_space(struct inode *inode, qsize_t number, int prealloc); 40int dquot_alloc_inode(const struct inode *inode);
43int dquot_claim_space(struct inode *inode, qsize_t number);
44void dquot_release_reserved_space(struct inode *inode, qsize_t number);
45qsize_t dquot_get_reserved_space(struct inode *inode);
46 41
47int dquot_free_space(struct inode *inode, qsize_t number); 42int dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
48int dquot_free_inode(const struct inode *inode, qsize_t number); 43void dquot_free_inode(const struct inode *inode);
49 44
50int dquot_transfer(struct inode *inode, struct iattr *iattr);
51int dquot_commit(struct dquot *dquot); 45int dquot_commit(struct dquot *dquot);
52int dquot_acquire(struct dquot *dquot); 46int dquot_acquire(struct dquot *dquot);
53int dquot_release(struct dquot *dquot); 47int dquot_release(struct dquot *dquot);
54int dquot_commit_info(struct super_block *sb, int type); 48int dquot_commit_info(struct super_block *sb, int type);
55int dquot_mark_dquot_dirty(struct dquot *dquot); 49int dquot_mark_dquot_dirty(struct dquot *dquot);
56 50
51int dquot_file_open(struct inode *inode, struct file *file);
52
57int vfs_quota_on(struct super_block *sb, int type, int format_id, 53int vfs_quota_on(struct super_block *sb, int type, int format_id,
58 char *path, int remount); 54 char *path, int remount);
59int vfs_quota_enable(struct inode *inode, int type, int format_id, 55int vfs_quota_enable(struct inode *inode, int type, int format_id,
@@ -64,14 +60,13 @@ int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
64 int format_id, int type); 60 int format_id, int type);
65int vfs_quota_off(struct super_block *sb, int type, int remount); 61int vfs_quota_off(struct super_block *sb, int type, int remount);
66int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags); 62int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags);
67int vfs_quota_sync(struct super_block *sb, int type); 63int vfs_quota_sync(struct super_block *sb, int type, int wait);
68int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 64int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
69int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 65int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
70int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); 66int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di);
71int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); 67int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di);
72 68
73void vfs_dq_drop(struct inode *inode); 69int dquot_transfer(struct inode *inode, struct iattr *iattr);
74int vfs_dq_transfer(struct inode *inode, struct iattr *iattr);
75int vfs_dq_quota_on_remount(struct super_block *sb); 70int vfs_dq_quota_on_remount(struct super_block *sb);
76 71
77static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) 72static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
@@ -83,53 +78,56 @@ static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
83 * Functions for checking status of quota 78 * Functions for checking status of quota
84 */ 79 */
85 80
86static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type) 81static inline bool sb_has_quota_usage_enabled(struct super_block *sb, int type)
87{ 82{
88 return sb_dqopt(sb)->flags & 83 return sb_dqopt(sb)->flags &
89 dquot_state_flag(DQUOT_USAGE_ENABLED, type); 84 dquot_state_flag(DQUOT_USAGE_ENABLED, type);
90} 85}
91 86
92static inline int sb_has_quota_limits_enabled(struct super_block *sb, int type) 87static inline bool sb_has_quota_limits_enabled(struct super_block *sb, int type)
93{ 88{
94 return sb_dqopt(sb)->flags & 89 return sb_dqopt(sb)->flags &
95 dquot_state_flag(DQUOT_LIMITS_ENABLED, type); 90 dquot_state_flag(DQUOT_LIMITS_ENABLED, type);
96} 91}
97 92
98static inline int sb_has_quota_suspended(struct super_block *sb, int type) 93static inline bool sb_has_quota_suspended(struct super_block *sb, int type)
99{ 94{
100 return sb_dqopt(sb)->flags & 95 return sb_dqopt(sb)->flags &
101 dquot_state_flag(DQUOT_SUSPENDED, type); 96 dquot_state_flag(DQUOT_SUSPENDED, type);
102} 97}
103 98
104static inline int sb_any_quota_suspended(struct super_block *sb) 99static inline unsigned sb_any_quota_suspended(struct super_block *sb)
105{ 100{
106 return sb_has_quota_suspended(sb, USRQUOTA) || 101 unsigned type, tmsk = 0;
107 sb_has_quota_suspended(sb, GRPQUOTA); 102 for (type = 0; type < MAXQUOTAS; type++)
103 tmsk |= sb_has_quota_suspended(sb, type) << type;
104 return tmsk;
108} 105}
109 106
110/* Does kernel know about any quota information for given sb + type? */ 107/* Does kernel know about any quota information for given sb + type? */
111static inline int sb_has_quota_loaded(struct super_block *sb, int type) 108static inline bool sb_has_quota_loaded(struct super_block *sb, int type)
112{ 109{
113 /* Currently if anything is on, then quota usage is on as well */ 110 /* Currently if anything is on, then quota usage is on as well */
114 return sb_has_quota_usage_enabled(sb, type); 111 return sb_has_quota_usage_enabled(sb, type);
115} 112}
116 113
117static inline int sb_any_quota_loaded(struct super_block *sb) 114static inline unsigned sb_any_quota_loaded(struct super_block *sb)
118{ 115{
119 return sb_has_quota_loaded(sb, USRQUOTA) || 116 unsigned type, tmsk = 0;
120 sb_has_quota_loaded(sb, GRPQUOTA); 117 for (type = 0; type < MAXQUOTAS; type++)
118 tmsk |= sb_has_quota_loaded(sb, type) << type;
119 return tmsk;
121} 120}
122 121
123static inline int sb_has_quota_active(struct super_block *sb, int type) 122static inline bool sb_has_quota_active(struct super_block *sb, int type)
124{ 123{
125 return sb_has_quota_loaded(sb, type) && 124 return sb_has_quota_loaded(sb, type) &&
126 !sb_has_quota_suspended(sb, type); 125 !sb_has_quota_suspended(sb, type);
127} 126}
128 127
129static inline int sb_any_quota_active(struct super_block *sb) 128static inline unsigned sb_any_quota_active(struct super_block *sb)
130{ 129{
131 return sb_has_quota_active(sb, USRQUOTA) || 130 return sb_any_quota_loaded(sb) & ~sb_any_quota_suspended(sb);
132 sb_has_quota_active(sb, GRPQUOTA);
133} 131}
134 132
135/* 133/*
@@ -141,122 +139,6 @@ extern const struct quotactl_ops vfs_quotactl_ops;
141#define sb_dquot_ops (&dquot_operations) 139#define sb_dquot_ops (&dquot_operations)
142#define sb_quotactl_ops (&vfs_quotactl_ops) 140#define sb_quotactl_ops (&vfs_quotactl_ops)
143 141
144/* It is better to call this function outside of any transaction as it might
145 * need a lot of space in journal for dquot structure allocation. */
146static inline void vfs_dq_init(struct inode *inode)
147{
148 BUG_ON(!inode->i_sb);
149 if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode))
150 inode->i_sb->dq_op->initialize(inode, -1);
151}
152
153/* The following allocation/freeing/transfer functions *must* be called inside
154 * a transaction (deadlocks possible otherwise) */
155static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr)
156{
157 if (sb_any_quota_active(inode->i_sb)) {
158 /* Used space is updated in alloc_space() */
159 if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA)
160 return 1;
161 }
162 else
163 inode_add_bytes(inode, nr);
164 return 0;
165}
166
167static inline int vfs_dq_prealloc_space(struct inode *inode, qsize_t nr)
168{
169 int ret;
170 if (!(ret = vfs_dq_prealloc_space_nodirty(inode, nr)))
171 mark_inode_dirty(inode);
172 return ret;
173}
174
175static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr)
176{
177 if (sb_any_quota_active(inode->i_sb)) {
178 /* Used space is updated in alloc_space() */
179 if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA)
180 return 1;
181 }
182 else
183 inode_add_bytes(inode, nr);
184 return 0;
185}
186
187static inline int vfs_dq_alloc_space(struct inode *inode, qsize_t nr)
188{
189 int ret;
190 if (!(ret = vfs_dq_alloc_space_nodirty(inode, nr)))
191 mark_inode_dirty(inode);
192 return ret;
193}
194
195static inline int vfs_dq_reserve_space(struct inode *inode, qsize_t nr)
196{
197 if (sb_any_quota_active(inode->i_sb)) {
198 /* Used space is updated in alloc_space() */
199 if (inode->i_sb->dq_op->reserve_space(inode, nr, 0) == NO_QUOTA)
200 return 1;
201 }
202 return 0;
203}
204
205static inline int vfs_dq_alloc_inode(struct inode *inode)
206{
207 if (sb_any_quota_active(inode->i_sb)) {
208 vfs_dq_init(inode);
209 if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA)
210 return 1;
211 }
212 return 0;
213}
214
215/*
216 * Convert in-memory reserved quotas to real consumed quotas
217 */
218static inline int vfs_dq_claim_space(struct inode *inode, qsize_t nr)
219{
220 if (sb_any_quota_active(inode->i_sb)) {
221 if (inode->i_sb->dq_op->claim_space(inode, nr) == NO_QUOTA)
222 return 1;
223 } else
224 inode_add_bytes(inode, nr);
225
226 mark_inode_dirty(inode);
227 return 0;
228}
229
230/*
231 * Release reserved (in-memory) quotas
232 */
233static inline
234void vfs_dq_release_reservation_space(struct inode *inode, qsize_t nr)
235{
236 if (sb_any_quota_active(inode->i_sb))
237 inode->i_sb->dq_op->release_rsv(inode, nr);
238}
239
240static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr)
241{
242 if (sb_any_quota_active(inode->i_sb))
243 inode->i_sb->dq_op->free_space(inode, nr);
244 else
245 inode_sub_bytes(inode, nr);
246}
247
248static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr)
249{
250 vfs_dq_free_space_nodirty(inode, nr);
251 mark_inode_dirty(inode);
252}
253
254static inline void vfs_dq_free_inode(struct inode *inode)
255{
256 if (sb_any_quota_active(inode->i_sb))
257 inode->i_sb->dq_op->free_inode(inode, 1);
258}
259
260/* Cannot be called inside a transaction */ 142/* Cannot be called inside a transaction */
261static inline int vfs_dq_off(struct super_block *sb, int remount) 143static inline int vfs_dq_off(struct super_block *sb, int remount)
262{ 144{
@@ -316,28 +198,20 @@ static inline int sb_any_quota_active(struct super_block *sb)
316#define sb_dquot_ops (NULL) 198#define sb_dquot_ops (NULL)
317#define sb_quotactl_ops (NULL) 199#define sb_quotactl_ops (NULL)
318 200
319static inline void vfs_dq_init(struct inode *inode) 201static inline void dquot_initialize(struct inode *inode)
320{ 202{
321} 203}
322 204
323static inline void vfs_dq_drop(struct inode *inode) 205static inline void dquot_drop(struct inode *inode)
324{ 206{
325} 207}
326 208
327static inline int vfs_dq_alloc_inode(struct inode *inode) 209static inline int dquot_alloc_inode(const struct inode *inode)
328{ 210{
329 return 0; 211 return 0;
330} 212}
331 213
332static inline void vfs_dq_free_inode(struct inode *inode) 214static inline void dquot_free_inode(const struct inode *inode)
333{
334}
335
336static inline void sync_quota_sb(struct super_block *sb, int type)
337{
338}
339
340static inline void writeout_quota_sb(struct super_block *sb, int type)
341{ 215{
342} 216}
343 217
@@ -351,110 +225,116 @@ static inline int vfs_dq_quota_on_remount(struct super_block *sb)
351 return 0; 225 return 0;
352} 226}
353 227
354static inline int vfs_dq_transfer(struct inode *inode, struct iattr *iattr) 228static inline int dquot_transfer(struct inode *inode, struct iattr *iattr)
355{ 229{
356 return 0; 230 return 0;
357} 231}
358 232
359static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) 233static inline int __dquot_alloc_space(struct inode *inode, qsize_t number,
234 int warn, int reserve)
360{ 235{
361 inode_add_bytes(inode, nr); 236 if (!reserve)
237 inode_add_bytes(inode, number);
362 return 0; 238 return 0;
363} 239}
364 240
365static inline int vfs_dq_prealloc_space(struct inode *inode, qsize_t nr) 241static inline void __dquot_free_space(struct inode *inode, qsize_t number,
242 int reserve)
366{ 243{
367 vfs_dq_prealloc_space_nodirty(inode, nr); 244 if (!reserve)
368 mark_inode_dirty(inode); 245 inode_sub_bytes(inode, number);
369 return 0;
370} 246}
371 247
372static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) 248static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
373{ 249{
374 inode_add_bytes(inode, nr); 250 inode_add_bytes(inode, number);
375 return 0; 251 return 0;
376} 252}
377 253
378static inline int vfs_dq_alloc_space(struct inode *inode, qsize_t nr) 254#define dquot_file_open generic_file_open
255
256#endif /* CONFIG_QUOTA */
257
258static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr)
379{ 259{
380 vfs_dq_alloc_space_nodirty(inode, nr); 260 return __dquot_alloc_space(inode, nr, 1, 0);
381 mark_inode_dirty(inode);
382 return 0;
383} 261}
384 262
385static inline int vfs_dq_reserve_space(struct inode *inode, qsize_t nr) 263static inline int dquot_alloc_space(struct inode *inode, qsize_t nr)
386{ 264{
387 return 0; 265 int ret;
266
267 ret = dquot_alloc_space_nodirty(inode, nr);
268 if (!ret)
269 mark_inode_dirty(inode);
270 return ret;
388} 271}
389 272
390static inline int vfs_dq_claim_space(struct inode *inode, qsize_t nr) 273static inline int dquot_alloc_block_nodirty(struct inode *inode, qsize_t nr)
391{ 274{
392 return vfs_dq_alloc_space(inode, nr); 275 return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits);
393} 276}
394 277
395static inline 278static inline int dquot_alloc_block(struct inode *inode, qsize_t nr)
396int vfs_dq_release_reservation_space(struct inode *inode, qsize_t nr)
397{ 279{
398 return 0; 280 return dquot_alloc_space(inode, nr << inode->i_blkbits);
399} 281}
400 282
401static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) 283static inline int dquot_prealloc_block_nodirty(struct inode *inode, qsize_t nr)
402{ 284{
403 inode_sub_bytes(inode, nr); 285 return __dquot_alloc_space(inode, nr << inode->i_blkbits, 0, 0);
404} 286}
405 287
406static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr) 288static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr)
407{ 289{
408 vfs_dq_free_space_nodirty(inode, nr); 290 int ret;
409 mark_inode_dirty(inode);
410}
411
412#endif /* CONFIG_QUOTA */
413 291
414static inline int vfs_dq_prealloc_block_nodirty(struct inode *inode, qsize_t nr) 292 ret = dquot_prealloc_block_nodirty(inode, nr);
415{ 293 if (!ret)
416 return vfs_dq_prealloc_space_nodirty(inode, nr << inode->i_blkbits); 294 mark_inode_dirty(inode);
295 return ret;
417} 296}
418 297
419static inline int vfs_dq_prealloc_block(struct inode *inode, qsize_t nr) 298static inline int dquot_reserve_block(struct inode *inode, qsize_t nr)
420{ 299{
421 return vfs_dq_prealloc_space(inode, nr << inode->i_blkbits); 300 return __dquot_alloc_space(inode, nr << inode->i_blkbits, 1, 1);
422} 301}
423 302
424static inline int vfs_dq_alloc_block_nodirty(struct inode *inode, qsize_t nr) 303static inline int dquot_claim_block(struct inode *inode, qsize_t nr)
425{ 304{
426 return vfs_dq_alloc_space_nodirty(inode, nr << inode->i_blkbits); 305 int ret;
427}
428 306
429static inline int vfs_dq_alloc_block(struct inode *inode, qsize_t nr) 307 ret = dquot_claim_space_nodirty(inode, nr << inode->i_blkbits);
430{ 308 if (!ret)
431 return vfs_dq_alloc_space(inode, nr << inode->i_blkbits); 309 mark_inode_dirty(inode);
310 return ret;
432} 311}
433 312
434static inline int vfs_dq_reserve_block(struct inode *inode, qsize_t nr) 313static inline void dquot_free_space_nodirty(struct inode *inode, qsize_t nr)
435{ 314{
436 return vfs_dq_reserve_space(inode, nr << inode->i_blkbits); 315 __dquot_free_space(inode, nr, 0);
437} 316}
438 317
439static inline int vfs_dq_claim_block(struct inode *inode, qsize_t nr) 318static inline void dquot_free_space(struct inode *inode, qsize_t nr)
440{ 319{
441 return vfs_dq_claim_space(inode, nr << inode->i_blkbits); 320 dquot_free_space_nodirty(inode, nr);
321 mark_inode_dirty(inode);
442} 322}
443 323
444static inline 324static inline void dquot_free_block_nodirty(struct inode *inode, qsize_t nr)
445void vfs_dq_release_reservation_block(struct inode *inode, qsize_t nr)
446{ 325{
447 vfs_dq_release_reservation_space(inode, nr << inode->i_blkbits); 326 dquot_free_space_nodirty(inode, nr << inode->i_blkbits);
448} 327}
449 328
450static inline void vfs_dq_free_block_nodirty(struct inode *inode, qsize_t nr) 329static inline void dquot_free_block(struct inode *inode, qsize_t nr)
451{ 330{
452 vfs_dq_free_space_nodirty(inode, nr << inode->i_blkbits); 331 dquot_free_space(inode, nr << inode->i_blkbits);
453} 332}
454 333
455static inline void vfs_dq_free_block(struct inode *inode, qsize_t nr) 334static inline void dquot_release_reservation_block(struct inode *inode,
335 qsize_t nr)
456{ 336{
457 vfs_dq_free_space(inode, nr << inode->i_blkbits); 337 __dquot_free_space(inode, nr << inode->i_blkbits, 1);
458} 338}
459 339
460#endif /* _LINUX_QUOTAOPS_ */ 340#endif /* _LINUX_QUOTAOPS_ */
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
index 6b537f1ac96c..31e1ff69efc8 100644
--- a/include/linux/raid_class.h
+++ b/include/linux/raid_class.h
@@ -32,6 +32,7 @@ enum raid_level {
32 RAID_LEVEL_0, 32 RAID_LEVEL_0,
33 RAID_LEVEL_1, 33 RAID_LEVEL_1,
34 RAID_LEVEL_10, 34 RAID_LEVEL_10,
35 RAID_LEVEL_1E,
35 RAID_LEVEL_3, 36 RAID_LEVEL_3,
36 RAID_LEVEL_4, 37 RAID_LEVEL_4,
37 RAID_LEVEL_5, 38 RAID_LEVEL_5,
diff --git a/include/linux/range.h b/include/linux/range.h
new file mode 100644
index 000000000000..bd184a5db791
--- /dev/null
+++ b/include/linux/range.h
@@ -0,0 +1,30 @@
1#ifndef _LINUX_RANGE_H
2#define _LINUX_RANGE_H
3
4struct range {
5 u64 start;
6 u64 end;
7};
8
9int add_range(struct range *range, int az, int nr_range,
10 u64 start, u64 end);
11
12
13int add_range_with_merge(struct range *range, int az, int nr_range,
14 u64 start, u64 end);
15
16void subtract_range(struct range *range, int az, u64 start, u64 end);
17
18int clean_sort_range(struct range *range, int az);
19
20void sort_range(struct range *range, int nr_range);
21
22#define MAX_RESOURCE ((resource_size_t)~0)
23static inline resource_size_t cap_resource(u64 val)
24{
25 if (val > MAX_RESOURCE)
26 return MAX_RESOURCE;
27
28 return val;
29}
30#endif
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 9c295411d01f..5210a5c60877 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -25,10 +25,10 @@
25 25
26 Some example of insert and search follows here. The search is a plain 26 Some example of insert and search follows here. The search is a plain
27 normal search over an ordered tree. The insert instead must be implemented 27 normal search over an ordered tree. The insert instead must be implemented
28 int two steps: as first thing the code must insert the element in 28 in two steps: First, the code must insert the element in order as a red leaf
29 order as a red leaf in the tree, then the support library function 29 in the tree, and then the support library function rb_insert_color() must
30 rb_insert_color() must be called. Such function will do the 30 be called. Such function will do the not trivial work to rebalance the
31 not trivial work to rebalance the rbtree if necessary. 31 rbtree, if necessary.
32 32
33----------------------------------------------------------------------- 33-----------------------------------------------------------------------
34static inline struct page * rb_search_page_cache(struct inode * inode, 34static inline struct page * rb_search_page_cache(struct inode * inode,
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 1bf0f708c4fc..2c9b46cff3d7 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -208,7 +208,7 @@ static inline void list_splice_init_rcu(struct list_head *list,
208 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). 208 * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock().
209 */ 209 */
210#define list_entry_rcu(ptr, type, member) \ 210#define list_entry_rcu(ptr, type, member) \
211 container_of(rcu_dereference(ptr), type, member) 211 container_of(rcu_dereference_raw(ptr), type, member)
212 212
213/** 213/**
214 * list_first_entry_rcu - get the first element from a list 214 * list_first_entry_rcu - get the first element from a list
@@ -225,9 +225,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
225 list_entry_rcu((ptr)->next, type, member) 225 list_entry_rcu((ptr)->next, type, member)
226 226
227#define __list_for_each_rcu(pos, head) \ 227#define __list_for_each_rcu(pos, head) \
228 for (pos = rcu_dereference((head)->next); \ 228 for (pos = rcu_dereference_raw((head)->next); \
229 pos != (head); \ 229 pos != (head); \
230 pos = rcu_dereference(pos->next)) 230 pos = rcu_dereference_raw(pos->next))
231 231
232/** 232/**
233 * list_for_each_entry_rcu - iterate over rcu list of given type 233 * list_for_each_entry_rcu - iterate over rcu list of given type
@@ -257,9 +257,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
257 * as long as the traversal is guarded by rcu_read_lock(). 257 * as long as the traversal is guarded by rcu_read_lock().
258 */ 258 */
259#define list_for_each_continue_rcu(pos, head) \ 259#define list_for_each_continue_rcu(pos, head) \
260 for ((pos) = rcu_dereference((pos)->next); \ 260 for ((pos) = rcu_dereference_raw((pos)->next); \
261 prefetch((pos)->next), (pos) != (head); \ 261 prefetch((pos)->next), (pos) != (head); \
262 (pos) = rcu_dereference((pos)->next)) 262 (pos) = rcu_dereference_raw((pos)->next))
263 263
264/** 264/**
265 * list_for_each_entry_continue_rcu - continue iteration over list of given type 265 * list_for_each_entry_continue_rcu - continue iteration over list of given type
@@ -406,6 +406,11 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
406 n->next->pprev = &n->next; 406 n->next->pprev = &n->next;
407} 407}
408 408
409#define __hlist_for_each_rcu(pos, head) \
410 for (pos = rcu_dereference((head)->first); \
411 pos && ({ prefetch(pos->next); 1; }); \
412 pos = rcu_dereference(pos->next))
413
409/** 414/**
410 * hlist_for_each_entry_rcu - iterate over rcu list of given type 415 * hlist_for_each_entry_rcu - iterate over rcu list of given type
411 * @tpos: the type * to use as a loop cursor. 416 * @tpos: the type * to use as a loop cursor.
@@ -418,10 +423,10 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
418 * as long as the traversal is guarded by rcu_read_lock(). 423 * as long as the traversal is guarded by rcu_read_lock().
419 */ 424 */
420#define hlist_for_each_entry_rcu(tpos, pos, head, member) \ 425#define hlist_for_each_entry_rcu(tpos, pos, head, member) \
421 for (pos = rcu_dereference((head)->first); \ 426 for (pos = rcu_dereference_raw((head)->first); \
422 pos && ({ prefetch(pos->next); 1; }) && \ 427 pos && ({ prefetch(pos->next); 1; }) && \
423 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ 428 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
424 pos = rcu_dereference(pos->next)) 429 pos = rcu_dereference_raw(pos->next))
425 430
426#endif /* __KERNEL__ */ 431#endif /* __KERNEL__ */
427#endif 432#endif
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h
index 589a40919f01..b70ffe53cb9f 100644
--- a/include/linux/rculist_nulls.h
+++ b/include/linux/rculist_nulls.h
@@ -101,10 +101,10 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n,
101 * 101 *
102 */ 102 */
103#define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ 103#define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \
104 for (pos = rcu_dereference((head)->first); \ 104 for (pos = rcu_dereference_raw((head)->first); \
105 (!is_a_nulls(pos)) && \ 105 (!is_a_nulls(pos)) && \
106 ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ 106 ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \
107 pos = rcu_dereference(pos->next)) 107 pos = rcu_dereference_raw(pos->next))
108 108
109#endif 109#endif
110#endif 110#endif
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 24440f4bf476..872a98e13d6a 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -41,6 +41,10 @@
41#include <linux/lockdep.h> 41#include <linux/lockdep.h>
42#include <linux/completion.h> 42#include <linux/completion.h>
43 43
44#ifdef CONFIG_RCU_TORTURE_TEST
45extern int rcutorture_runnable; /* for sysctl */
46#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
47
44/** 48/**
45 * struct rcu_head - callback structure for use with RCU 49 * struct rcu_head - callback structure for use with RCU
46 * @next: next update requests in a list 50 * @next: next update requests in a list
@@ -62,6 +66,8 @@ extern int sched_expedited_torture_stats(char *page);
62 66
63/* Internal to kernel */ 67/* Internal to kernel */
64extern void rcu_init(void); 68extern void rcu_init(void);
69extern int rcu_scheduler_active;
70extern void rcu_scheduler_starting(void);
65 71
66#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 72#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
67#include <linux/rcutree.h> 73#include <linux/rcutree.h>
@@ -78,14 +84,136 @@ extern void rcu_init(void);
78} while (0) 84} while (0)
79 85
80#ifdef CONFIG_DEBUG_LOCK_ALLOC 86#ifdef CONFIG_DEBUG_LOCK_ALLOC
87
81extern struct lockdep_map rcu_lock_map; 88extern struct lockdep_map rcu_lock_map;
82# define rcu_read_acquire() \ 89# define rcu_read_acquire() \
83 lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) 90 lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_)
84# define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) 91# define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_)
85#else 92
86# define rcu_read_acquire() do { } while (0) 93extern struct lockdep_map rcu_bh_lock_map;
87# define rcu_read_release() do { } while (0) 94# define rcu_read_acquire_bh() \
88#endif 95 lock_acquire(&rcu_bh_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_)
96# define rcu_read_release_bh() lock_release(&rcu_bh_lock_map, 1, _THIS_IP_)
97
98extern struct lockdep_map rcu_sched_lock_map;
99# define rcu_read_acquire_sched() \
100 lock_acquire(&rcu_sched_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_)
101# define rcu_read_release_sched() \
102 lock_release(&rcu_sched_lock_map, 1, _THIS_IP_)
103
104static inline int debug_lockdep_rcu_enabled(void)
105{
106 return likely(rcu_scheduler_active && debug_locks);
107}
108
109/**
110 * rcu_read_lock_held - might we be in RCU read-side critical section?
111 *
112 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in
113 * an RCU read-side critical section. In absence of CONFIG_PROVE_LOCKING,
114 * this assumes we are in an RCU read-side critical section unless it can
115 * prove otherwise.
116 *
117 * Check rcu_scheduler_active to prevent false positives during boot.
118 */
119static inline int rcu_read_lock_held(void)
120{
121 if (!debug_lockdep_rcu_enabled())
122 return 1;
123 return lock_is_held(&rcu_lock_map);
124}
125
126/*
127 * rcu_read_lock_bh_held() is defined out of line to avoid #include-file
128 * hell.
129 */
130extern int rcu_read_lock_bh_held(void);
131
132/**
133 * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section?
134 *
135 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in an
136 * RCU-sched read-side critical section. In absence of CONFIG_PROVE_LOCKING,
137 * this assumes we are in an RCU-sched read-side critical section unless it
138 * can prove otherwise. Note that disabling of preemption (including
139 * disabling irqs) counts as an RCU-sched read-side critical section.
140 *
141 * Check rcu_scheduler_active to prevent false positives during boot.
142 */
143#ifdef CONFIG_PREEMPT
144static inline int rcu_read_lock_sched_held(void)
145{
146 int lockdep_opinion = 0;
147
148 if (!debug_lockdep_rcu_enabled())
149 return 1;
150 if (debug_locks)
151 lockdep_opinion = lock_is_held(&rcu_sched_lock_map);
152 return lockdep_opinion || preempt_count() != 0 || irqs_disabled();
153}
154#else /* #ifdef CONFIG_PREEMPT */
155static inline int rcu_read_lock_sched_held(void)
156{
157 return 1;
158}
159#endif /* #else #ifdef CONFIG_PREEMPT */
160
161#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
162
163# define rcu_read_acquire() do { } while (0)
164# define rcu_read_release() do { } while (0)
165# define rcu_read_acquire_bh() do { } while (0)
166# define rcu_read_release_bh() do { } while (0)
167# define rcu_read_acquire_sched() do { } while (0)
168# define rcu_read_release_sched() do { } while (0)
169
170static inline int rcu_read_lock_held(void)
171{
172 return 1;
173}
174
175static inline int rcu_read_lock_bh_held(void)
176{
177 return 1;
178}
179
180#ifdef CONFIG_PREEMPT
181static inline int rcu_read_lock_sched_held(void)
182{
183 return !rcu_scheduler_active || preempt_count() != 0 || irqs_disabled();
184}
185#else /* #ifdef CONFIG_PREEMPT */
186static inline int rcu_read_lock_sched_held(void)
187{
188 return 1;
189}
190#endif /* #else #ifdef CONFIG_PREEMPT */
191
192#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
193
194#ifdef CONFIG_PROVE_RCU
195
196/**
197 * rcu_dereference_check - rcu_dereference with debug checking
198 *
199 * Do an rcu_dereference(), but check that the context is correct.
200 * For example, rcu_dereference_check(gp, rcu_read_lock_held()) to
201 * ensure that the rcu_dereference_check() executes within an RCU
202 * read-side critical section. It is also possible to check for
203 * locks being held, for example, by using lockdep_is_held().
204 */
205#define rcu_dereference_check(p, c) \
206 ({ \
207 if (debug_lockdep_rcu_enabled() && !(c)) \
208 lockdep_rcu_dereference(__FILE__, __LINE__); \
209 rcu_dereference_raw(p); \
210 })
211
212#else /* #ifdef CONFIG_PROVE_RCU */
213
214#define rcu_dereference_check(p, c) rcu_dereference_raw(p)
215
216#endif /* #else #ifdef CONFIG_PROVE_RCU */
89 217
90/** 218/**
91 * rcu_read_lock - mark the beginning of an RCU read-side critical section. 219 * rcu_read_lock - mark the beginning of an RCU read-side critical section.
@@ -160,7 +288,7 @@ static inline void rcu_read_lock_bh(void)
160{ 288{
161 __rcu_read_lock_bh(); 289 __rcu_read_lock_bh();
162 __acquire(RCU_BH); 290 __acquire(RCU_BH);
163 rcu_read_acquire(); 291 rcu_read_acquire_bh();
164} 292}
165 293
166/* 294/*
@@ -170,7 +298,7 @@ static inline void rcu_read_lock_bh(void)
170 */ 298 */
171static inline void rcu_read_unlock_bh(void) 299static inline void rcu_read_unlock_bh(void)
172{ 300{
173 rcu_read_release(); 301 rcu_read_release_bh();
174 __release(RCU_BH); 302 __release(RCU_BH);
175 __rcu_read_unlock_bh(); 303 __rcu_read_unlock_bh();
176} 304}
@@ -188,7 +316,7 @@ static inline void rcu_read_lock_sched(void)
188{ 316{
189 preempt_disable(); 317 preempt_disable();
190 __acquire(RCU_SCHED); 318 __acquire(RCU_SCHED);
191 rcu_read_acquire(); 319 rcu_read_acquire_sched();
192} 320}
193 321
194/* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ 322/* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */
@@ -205,7 +333,7 @@ static inline notrace void rcu_read_lock_sched_notrace(void)
205 */ 333 */
206static inline void rcu_read_unlock_sched(void) 334static inline void rcu_read_unlock_sched(void)
207{ 335{
208 rcu_read_release(); 336 rcu_read_release_sched();
209 __release(RCU_SCHED); 337 __release(RCU_SCHED);
210 preempt_enable(); 338 preempt_enable();
211} 339}
@@ -219,22 +347,49 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
219 347
220 348
221/** 349/**
222 * rcu_dereference - fetch an RCU-protected pointer in an 350 * rcu_dereference_raw - fetch an RCU-protected pointer
223 * RCU read-side critical section. This pointer may later 351 *
224 * be safely dereferenced. 352 * The caller must be within some flavor of RCU read-side critical
353 * section, or must be otherwise preventing the pointer from changing,
354 * for example, by holding an appropriate lock. This pointer may later
355 * be safely dereferenced. It is the caller's responsibility to have
356 * done the right thing, as this primitive does no checking of any kind.
225 * 357 *
226 * Inserts memory barriers on architectures that require them 358 * Inserts memory barriers on architectures that require them
227 * (currently only the Alpha), and, more importantly, documents 359 * (currently only the Alpha), and, more importantly, documents
228 * exactly which pointers are protected by RCU. 360 * exactly which pointers are protected by RCU.
229 */ 361 */
230 362#define rcu_dereference_raw(p) ({ \
231#define rcu_dereference(p) ({ \
232 typeof(p) _________p1 = ACCESS_ONCE(p); \ 363 typeof(p) _________p1 = ACCESS_ONCE(p); \
233 smp_read_barrier_depends(); \ 364 smp_read_barrier_depends(); \
234 (_________p1); \ 365 (_________p1); \
235 }) 366 })
236 367
237/** 368/**
369 * rcu_dereference - fetch an RCU-protected pointer, checking for RCU
370 *
371 * Makes rcu_dereference_check() do the dirty work.
372 */
373#define rcu_dereference(p) \
374 rcu_dereference_check(p, rcu_read_lock_held())
375
376/**
377 * rcu_dereference_bh - fetch an RCU-protected pointer, checking for RCU-bh
378 *
379 * Makes rcu_dereference_check() do the dirty work.
380 */
381#define rcu_dereference_bh(p) \
382 rcu_dereference_check(p, rcu_read_lock_bh_held())
383
384/**
385 * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched
386 *
387 * Makes rcu_dereference_check() do the dirty work.
388 */
389#define rcu_dereference_sched(p) \
390 rcu_dereference_check(p, rcu_read_lock_sched_held())
391
392/**
238 * rcu_assign_pointer - assign (publicize) a pointer to a newly 393 * rcu_assign_pointer - assign (publicize) a pointer to a newly
239 * initialized structure that will be dereferenced by RCU read-side 394 * initialized structure that will be dereferenced by RCU read-side
240 * critical sections. Returns the value assigned. 395 * critical sections. Returns the value assigned.
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index c4ba9a78721e..a5195875480a 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -62,6 +62,18 @@ static inline long rcu_batches_completed_bh(void)
62 62
63extern int rcu_expedited_torture_stats(char *page); 63extern int rcu_expedited_torture_stats(char *page);
64 64
65static inline void rcu_force_quiescent_state(void)
66{
67}
68
69static inline void rcu_bh_force_quiescent_state(void)
70{
71}
72
73static inline void rcu_sched_force_quiescent_state(void)
74{
75}
76
65#define synchronize_rcu synchronize_sched 77#define synchronize_rcu synchronize_sched
66 78
67static inline void synchronize_rcu_expedited(void) 79static inline void synchronize_rcu_expedited(void)
@@ -93,12 +105,13 @@ static inline void rcu_exit_nohz(void)
93 105
94#endif /* #else #ifdef CONFIG_NO_HZ */ 106#endif /* #else #ifdef CONFIG_NO_HZ */
95 107
96static inline void rcu_scheduler_starting(void) 108static inline void exit_rcu(void)
97{ 109{
98} 110}
99 111
100static inline void exit_rcu(void) 112static inline int rcu_preempt_depth(void)
101{ 113{
114 return 0;
102} 115}
103 116
104#endif /* __LINUX_RCUTINY_H */ 117#endif /* __LINUX_RCUTINY_H */
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index c93eee5911b0..42cc3a04779e 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -35,7 +35,6 @@ struct notifier_block;
35extern void rcu_sched_qs(int cpu); 35extern void rcu_sched_qs(int cpu);
36extern void rcu_bh_qs(int cpu); 36extern void rcu_bh_qs(int cpu);
37extern int rcu_needs_cpu(int cpu); 37extern int rcu_needs_cpu(int cpu);
38extern void rcu_scheduler_starting(void);
39extern int rcu_expedited_torture_stats(char *page); 38extern int rcu_expedited_torture_stats(char *page);
40 39
41#ifdef CONFIG_TREE_PREEMPT_RCU 40#ifdef CONFIG_TREE_PREEMPT_RCU
@@ -45,6 +44,12 @@ extern void __rcu_read_unlock(void);
45extern void synchronize_rcu(void); 44extern void synchronize_rcu(void);
46extern void exit_rcu(void); 45extern void exit_rcu(void);
47 46
47/*
48 * Defined as macro as it is a very low level header
49 * included from areas that don't even know about current
50 */
51#define rcu_preempt_depth() (current->rcu_read_lock_nesting)
52
48#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 53#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
49 54
50static inline void __rcu_read_lock(void) 55static inline void __rcu_read_lock(void)
@@ -63,6 +68,11 @@ static inline void exit_rcu(void)
63{ 68{
64} 69}
65 70
71static inline int rcu_preempt_depth(void)
72{
73 return 0;
74}
75
66#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ 76#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */
67 77
68static inline void __rcu_read_lock_bh(void) 78static inline void __rcu_read_lock_bh(void)
@@ -88,6 +98,9 @@ extern void rcu_check_callbacks(int cpu, int user);
88extern long rcu_batches_completed(void); 98extern long rcu_batches_completed(void);
89extern long rcu_batches_completed_bh(void); 99extern long rcu_batches_completed_bh(void);
90extern long rcu_batches_completed_sched(void); 100extern long rcu_batches_completed_sched(void);
101extern void rcu_force_quiescent_state(void);
102extern void rcu_bh_force_quiescent_state(void);
103extern void rcu_sched_force_quiescent_state(void);
91 104
92#ifdef CONFIG_NO_HZ 105#ifdef CONFIG_NO_HZ
93void rcu_enter_nohz(void); 106void rcu_enter_nohz(void);
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 988e55fe649b..3005d5a7fce5 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -64,6 +64,7 @@ extern void kernel_restart(char *cmd);
64extern void kernel_halt(void); 64extern void kernel_halt(void);
65extern void kernel_power_off(void); 65extern void kernel_power_off(void);
66 66
67extern int C_A_D; /* for sysctl */
67void ctrl_alt_del(void); 68void ctrl_alt_del(void);
68 69
69#define POWEROFF_CMD_PATH_LEN 256 70#define POWEROFF_CMD_PATH_LEN 256
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 490c5b37b6d7..28c9fd020d39 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -35,6 +35,8 @@
35#ifndef __LINUX_REGULATOR_CONSUMER_H_ 35#ifndef __LINUX_REGULATOR_CONSUMER_H_
36#define __LINUX_REGULATOR_CONSUMER_H_ 36#define __LINUX_REGULATOR_CONSUMER_H_
37 37
38#include <linux/device.h>
39
38/* 40/*
39 * Regulator operating modes. 41 * Regulator operating modes.
40 * 42 *
@@ -87,8 +89,9 @@
87 * REGULATION_OUT Regulator output is out of regulation. 89 * REGULATION_OUT Regulator output is out of regulation.
88 * FAIL Regulator output has failed. 90 * FAIL Regulator output has failed.
89 * OVER_TEMP Regulator over temp. 91 * OVER_TEMP Regulator over temp.
90 * FORCE_DISABLE Regulator shut down by software. 92 * FORCE_DISABLE Regulator forcibly shut down by software.
91 * VOLTAGE_CHANGE Regulator voltage changed. 93 * VOLTAGE_CHANGE Regulator voltage changed.
94 * DISABLE Regulator was disabled.
92 * 95 *
93 * NOTE: These events can be OR'ed together when passed into handler. 96 * NOTE: These events can be OR'ed together when passed into handler.
94 */ 97 */
@@ -100,6 +103,7 @@
100#define REGULATOR_EVENT_OVER_TEMP 0x10 103#define REGULATOR_EVENT_OVER_TEMP 0x10
101#define REGULATOR_EVENT_FORCE_DISABLE 0x20 104#define REGULATOR_EVENT_FORCE_DISABLE 0x20
102#define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40 105#define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40
106#define REGULATOR_EVENT_DISABLE 0x80
103 107
104struct regulator; 108struct regulator;
105 109
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 31f2055eae28..592cd7c642c2 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -58,6 +58,9 @@ enum regulator_status {
58 * @get_optimum_mode: Get the most efficient operating mode for the regulator 58 * @get_optimum_mode: Get the most efficient operating mode for the regulator
59 * when running with the specified parameters. 59 * when running with the specified parameters.
60 * 60 *
61 * @enable_time: Time taken for the regulator voltage output voltage to
62 * stabalise after being enabled, in microseconds.
63 *
61 * @set_suspend_voltage: Set the voltage for the regulator when the system 64 * @set_suspend_voltage: Set the voltage for the regulator when the system
62 * is suspended. 65 * is suspended.
63 * @set_suspend_enable: Mark the regulator as enabled when the system is 66 * @set_suspend_enable: Mark the regulator as enabled when the system is
@@ -93,6 +96,9 @@ struct regulator_ops {
93 int (*set_mode) (struct regulator_dev *, unsigned int mode); 96 int (*set_mode) (struct regulator_dev *, unsigned int mode);
94 unsigned int (*get_mode) (struct regulator_dev *); 97 unsigned int (*get_mode) (struct regulator_dev *);
95 98
99 /* Time taken to enable the regulator */
100 int (*enable_time) (struct regulator_dev *);
101
96 /* report regulator status ... most other accessors report 102 /* report regulator status ... most other accessors report
97 * control inputs, this reports results of combining inputs 103 * control inputs, this reports results of combining inputs
98 * from Linux (and other sources) with the actual load. 104 * from Linux (and other sources) with the actual load.
diff --git a/include/linux/regulator/fixed.h b/include/linux/regulator/fixed.h
index e94a4a1c7c8a..ffd7d508e726 100644
--- a/include/linux/regulator/fixed.h
+++ b/include/linux/regulator/fixed.h
@@ -25,6 +25,7 @@ struct regulator_init_data;
25 * @microvolts: Output voltage of regulator 25 * @microvolts: Output voltage of regulator
26 * @gpio: GPIO to use for enable control 26 * @gpio: GPIO to use for enable control
27 * set to -EINVAL if not used 27 * set to -EINVAL if not used
28 * @startup_delay: Start-up time in microseconds
28 * @enable_high: Polarity of enable GPIO 29 * @enable_high: Polarity of enable GPIO
29 * 1 = Active high, 0 = Active low 30 * 1 = Active high, 0 = Active low
30 * @enabled_at_boot: Whether regulator has been enabled at 31 * @enabled_at_boot: Whether regulator has been enabled at
@@ -41,6 +42,7 @@ struct fixed_voltage_config {
41 const char *supply_name; 42 const char *supply_name;
42 int microvolts; 43 int microvolts;
43 int gpio; 44 int gpio;
45 unsigned startup_delay;
44 unsigned enable_high:1; 46 unsigned enable_high:1;
45 unsigned enabled_at_boot:1; 47 unsigned enabled_at_boot:1;
46 struct regulator_init_data *init_data; 48 struct regulator_init_data *init_data;
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 87f5f176d4ef..234a8476cba8 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -43,16 +43,20 @@ struct regulator;
43/** 43/**
44 * struct regulator_state - regulator state during low power system states 44 * struct regulator_state - regulator state during low power system states
45 * 45 *
46 * This describes a regulators state during a system wide low power state. 46 * This describes a regulators state during a system wide low power
47 * state. One of enabled or disabled must be set for the
48 * configuration to be applied.
47 * 49 *
48 * @uV: Operating voltage during suspend. 50 * @uV: Operating voltage during suspend.
49 * @mode: Operating mode during suspend. 51 * @mode: Operating mode during suspend.
50 * @enabled: Enabled during suspend. 52 * @enabled: Enabled during suspend.
53 * @disabled: Disabled during suspend.
51 */ 54 */
52struct regulator_state { 55struct regulator_state {
53 int uV; /* suspend voltage */ 56 int uV; /* suspend voltage */
54 unsigned int mode; /* suspend regulator operating mode */ 57 unsigned int mode; /* suspend regulator operating mode */
55 int enabled; /* is regulator enabled in this suspend state */ 58 int enabled; /* is regulator enabled in this suspend state */
59 int disabled; /* is the regulator disbled in this suspend state */
56}; 60};
57 61
58/** 62/**
diff --git a/include/linux/regulator/max8649.h b/include/linux/regulator/max8649.h
new file mode 100644
index 000000000000..417d14ecd5cb
--- /dev/null
+++ b/include/linux/regulator/max8649.h
@@ -0,0 +1,44 @@
1/*
2 * Interface of Maxim max8649
3 *
4 * Copyright (C) 2009-2010 Marvell International Ltd.
5 * Haojian Zhuang <haojian.zhuang@marvell.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_REGULATOR_MAX8649_H
13#define __LINUX_REGULATOR_MAX8649_H
14
15#include <linux/regulator/machine.h>
16
17enum {
18 MAX8649_EXTCLK_26MHZ = 0,
19 MAX8649_EXTCLK_13MHZ,
20 MAX8649_EXTCLK_19MHZ, /* 19.2MHz */
21};
22
23enum {
24 MAX8649_RAMP_32MV = 0,
25 MAX8649_RAMP_16MV,
26 MAX8649_RAMP_8MV,
27 MAX8649_RAMP_4MV,
28 MAX8649_RAMP_2MV,
29 MAX8649_RAMP_1MV,
30 MAX8649_RAMP_0_5MV,
31 MAX8649_RAMP_0_25MV,
32};
33
34struct max8649_platform_data {
35 struct regulator_init_data *regulator;
36
37 unsigned mode:2; /* bit[1:0] = VID1,VID0 */
38 unsigned extclk_freq:2;
39 unsigned extclk:1;
40 unsigned ramp_timing:3;
41 unsigned ramp_down:1;
42};
43
44#endif /* __LINUX_REGULATOR_MAX8649_H */
diff --git a/include/linux/regulator/max8660.h b/include/linux/regulator/max8660.h
new file mode 100644
index 000000000000..9936763621c7
--- /dev/null
+++ b/include/linux/regulator/max8660.h
@@ -0,0 +1,57 @@
1/*
2 * max8660.h -- Voltage regulation for the Maxim 8660/8661
3 *
4 * Copyright (C) 2009 Wolfram Sang, Pengutronix e.K.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef __LINUX_REGULATOR_MAX8660_H
21#define __LINUX_REGULATOR_MAX8660_H
22
23#include <linux/regulator/machine.h>
24
25enum {
26 MAX8660_V3,
27 MAX8660_V4,
28 MAX8660_V5,
29 MAX8660_V6,
30 MAX8660_V7,
31 MAX8660_V_END,
32};
33
34/**
35 * max8660_subdev_data - regulator subdev data
36 * @id: regulator id
37 * @name: regulator name
38 * @platform_data: regulator init data
39 */
40struct max8660_subdev_data {
41 int id;
42 char *name;
43 struct regulator_init_data *platform_data;
44};
45
46/**
47 * max8660_platform_data - platform data for max8660
48 * @num_subdevs: number of regulators used
49 * @subdevs: pointer to regulators used
50 * @en34_is_high: if EN34 is driven high, regulators cannot be en-/disabled.
51 */
52struct max8660_platform_data {
53 int num_subdevs;
54 struct max8660_subdev_data *subdevs;
55 unsigned en34_is_high:1;
56};
57#endif
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index c96c1858fe2c..3b603f474186 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -62,6 +62,12 @@ void reiserfs_write_unlock(struct super_block *s);
62int reiserfs_write_lock_once(struct super_block *s); 62int reiserfs_write_lock_once(struct super_block *s);
63void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); 63void reiserfs_write_unlock_once(struct super_block *s, int lock_depth);
64 64
65#ifdef CONFIG_REISERFS_CHECK
66void reiserfs_lock_check_recursive(struct super_block *s);
67#else
68static inline void reiserfs_lock_check_recursive(struct super_block *s) { }
69#endif
70
65/* 71/*
66 * Several mutexes depend on the write lock. 72 * Several mutexes depend on the write lock.
67 * However sometimes we want to relax the write lock while we hold 73 * However sometimes we want to relax the write lock while we hold
@@ -92,11 +98,31 @@ void reiserfs_write_unlock_once(struct super_block *s, int lock_depth);
92static inline void reiserfs_mutex_lock_safe(struct mutex *m, 98static inline void reiserfs_mutex_lock_safe(struct mutex *m,
93 struct super_block *s) 99 struct super_block *s)
94{ 100{
101 reiserfs_lock_check_recursive(s);
95 reiserfs_write_unlock(s); 102 reiserfs_write_unlock(s);
96 mutex_lock(m); 103 mutex_lock(m);
97 reiserfs_write_lock(s); 104 reiserfs_write_lock(s);
98} 105}
99 106
107static inline void
108reiserfs_mutex_lock_nested_safe(struct mutex *m, unsigned int subclass,
109 struct super_block *s)
110{
111 reiserfs_lock_check_recursive(s);
112 reiserfs_write_unlock(s);
113 mutex_lock_nested(m, subclass);
114 reiserfs_write_lock(s);
115}
116
117static inline void
118reiserfs_down_read_safe(struct rw_semaphore *sem, struct super_block *s)
119{
120 reiserfs_lock_check_recursive(s);
121 reiserfs_write_unlock(s);
122 down_read(sem);
123 reiserfs_write_lock(s);
124}
125
100/* 126/*
101 * When we schedule, we usually want to also release the write lock, 127 * When we schedule, we usually want to also release the write lock,
102 * according to the previous bkl based locking scheme of reiserfs. 128 * according to the previous bkl based locking scheme of reiserfs.
@@ -2008,7 +2034,7 @@ void reiserfs_read_locked_inode(struct inode *inode,
2008int reiserfs_find_actor(struct inode *inode, void *p); 2034int reiserfs_find_actor(struct inode *inode, void *p);
2009int reiserfs_init_locked_inode(struct inode *inode, void *p); 2035int reiserfs_init_locked_inode(struct inode *inode, void *p);
2010void reiserfs_delete_inode(struct inode *inode); 2036void reiserfs_delete_inode(struct inode *inode);
2011int reiserfs_write_inode(struct inode *inode, int); 2037int reiserfs_write_inode(struct inode *inode, struct writeback_control *wbc);
2012int reiserfs_get_block(struct inode *inode, sector_t block, 2038int reiserfs_get_block(struct inode *inode, sector_t block,
2013 struct buffer_head *bh_result, int create); 2039 struct buffer_head *bh_result, int create);
2014struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid, 2040struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 99928dce37ea..7fa02b4af838 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -70,6 +70,11 @@ int reiserfs_security_write(struct reiserfs_transaction_handle *th,
70void reiserfs_security_free(struct reiserfs_security_handle *sec); 70void reiserfs_security_free(struct reiserfs_security_handle *sec);
71#endif 71#endif
72 72
73static inline int reiserfs_xattrs_initialized(struct super_block *sb)
74{
75 return REISERFS_SB(sb)->priv_root != NULL;
76}
77
73#define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header)) 78#define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header))
74static inline loff_t reiserfs_xattr_nblocks(struct inode *inode, loff_t size) 79static inline loff_t reiserfs_xattr_nblocks(struct inode *inode, loff_t size)
75{ 80{
diff --git a/include/linux/resource.h b/include/linux/resource.h
index 40fc7e626082..f1e914eefeab 100644
--- a/include/linux/resource.h
+++ b/include/linux/resource.h
@@ -3,8 +3,6 @@
3 3
4#include <linux/time.h> 4#include <linux/time.h>
5 5
6struct task_struct;
7
8/* 6/*
9 * Resource control/accounting header file for linux 7 * Resource control/accounting header file for linux
10 */ 8 */
@@ -70,6 +68,12 @@ struct rlimit {
70 */ 68 */
71#include <asm/resource.h> 69#include <asm/resource.h>
72 70
71#ifdef __KERNEL__
72
73struct task_struct;
74
73int getrusage(struct task_struct *p, int who, struct rusage __user *ru); 75int getrusage(struct task_struct *p, int who, struct rusage __user *ru);
74 76
77#endif /* __KERNEL__ */
78
75#endif 79#endif
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h
index c9ba2fdf807d..bc8c3881c729 100644
--- a/include/linux/resume-trace.h
+++ b/include/linux/resume-trace.h
@@ -6,6 +6,11 @@
6 6
7extern int pm_trace_enabled; 7extern int pm_trace_enabled;
8 8
9static inline int pm_trace_is_enabled(void)
10{
11 return pm_trace_enabled;
12}
13
9struct device; 14struct device;
10extern void set_trace_device(struct device *); 15extern void set_trace_device(struct device *);
11extern void generate_resume_trace(const void *tracedata, unsigned int user); 16extern void generate_resume_trace(const void *tracedata, unsigned int user);
@@ -17,6 +22,8 @@ extern void generate_resume_trace(const void *tracedata, unsigned int user);
17 22
18#else 23#else
19 24
25static inline int pm_trace_is_enabled(void) { return 0; }
26
20#define TRACE_DEVICE(dev) do { } while (0) 27#define TRACE_DEVICE(dev) do { } while (0)
21#define TRACE_RESUME(dev) do { } while (0) 28#define TRACE_RESUME(dev) do { } while (0)
22 29
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 97059d08a626..4f82326eb294 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -29,7 +29,7 @@
29/** 29/**
30 * enum rfkill_type - type of rfkill switch. 30 * enum rfkill_type - type of rfkill switch.
31 * 31 *
32 * @RFKILL_TYPE_ALL: toggles all switches (userspace only) 32 * @RFKILL_TYPE_ALL: toggles all switches (requests only - not a switch type)
33 * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device. 33 * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
34 * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. 34 * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
35 * @RFKILL_TYPE_UWB: switch is on a ultra wideband device. 35 * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index b019ae64e2ab..d25bd224d370 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -37,7 +37,27 @@ struct anon_vma {
37 * is serialized by a system wide lock only visible to 37 * is serialized by a system wide lock only visible to
38 * mm_take_all_locks() (mm_all_locks_mutex). 38 * mm_take_all_locks() (mm_all_locks_mutex).
39 */ 39 */
40 struct list_head head; /* List of private "related" vmas */ 40 struct list_head head; /* Chain of private "related" vmas */
41};
42
43/*
44 * The copy-on-write semantics of fork mean that an anon_vma
45 * can become associated with multiple processes. Furthermore,
46 * each child process will have its own anon_vma, where new
47 * pages for that process are instantiated.
48 *
49 * This structure allows us to find the anon_vmas associated
50 * with a VMA, or the VMAs associated with an anon_vma.
51 * The "same_vma" list contains the anon_vma_chains linking
52 * all the anon_vmas associated with this VMA.
53 * The "same_anon_vma" list contains the anon_vma_chains
54 * which link all the VMAs associated with this anon_vma.
55 */
56struct anon_vma_chain {
57 struct vm_area_struct *vma;
58 struct anon_vma *anon_vma;
59 struct list_head same_vma; /* locked by mmap_sem & page_table_lock */
60 struct list_head same_anon_vma; /* locked by anon_vma->lock */
41}; 61};
42 62
43#ifdef CONFIG_MMU 63#ifdef CONFIG_MMU
@@ -89,15 +109,23 @@ static inline void anon_vma_unlock(struct vm_area_struct *vma)
89 */ 109 */
90void anon_vma_init(void); /* create anon_vma_cachep */ 110void anon_vma_init(void); /* create anon_vma_cachep */
91int anon_vma_prepare(struct vm_area_struct *); 111int anon_vma_prepare(struct vm_area_struct *);
92void __anon_vma_merge(struct vm_area_struct *, struct vm_area_struct *); 112void unlink_anon_vmas(struct vm_area_struct *);
93void anon_vma_unlink(struct vm_area_struct *); 113int anon_vma_clone(struct vm_area_struct *, struct vm_area_struct *);
94void anon_vma_link(struct vm_area_struct *); 114int anon_vma_fork(struct vm_area_struct *, struct vm_area_struct *);
95void __anon_vma_link(struct vm_area_struct *); 115void __anon_vma_link(struct vm_area_struct *);
96void anon_vma_free(struct anon_vma *); 116void anon_vma_free(struct anon_vma *);
97 117
118static inline void anon_vma_merge(struct vm_area_struct *vma,
119 struct vm_area_struct *next)
120{
121 VM_BUG_ON(vma->anon_vma != next->anon_vma);
122 unlink_anon_vmas(next);
123}
124
98/* 125/*
99 * rmap interfaces called when adding or removing pte of page 126 * rmap interfaces called when adding or removing pte of page
100 */ 127 */
128void page_move_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
101void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); 129void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
102void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); 130void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
103void page_add_file_rmap(struct page *); 131void page_add_file_rmap(struct page *);
@@ -181,7 +209,7 @@ static inline int page_referenced(struct page *page, int is_locked,
181 unsigned long *vm_flags) 209 unsigned long *vm_flags)
182{ 210{
183 *vm_flags = 0; 211 *vm_flags = 0;
184 return TestClearPageReferenced(page); 212 return 0;
185} 213}
186 214
187#define try_to_unmap(page, refs) SWAP_FAIL 215#define try_to_unmap(page, refs) SWAP_FAIL
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 60f88a7fb13d..14dbc83ded20 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -238,6 +238,12 @@ static inline bool is_leap_year(unsigned int year)
238 return (!(year % 4) && (year % 100)) || !(year % 400); 238 return (!(year % 4) && (year % 100)) || !(year % 400);
239} 239}
240 240
241#ifdef CONFIG_RTC_HCTOSYS
242extern int rtc_hctosys_ret;
243#else
244#define rtc_hctosys_ret -ENODEV
245#endif
246
241#endif /* __KERNEL__ */ 247#endif /* __KERNEL__ */
242 248
243#endif /* _LINUX_RTC_H_ */ 249#endif /* _LINUX_RTC_H_ */
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index 281d8fd775e8..8d522ffeda33 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -16,6 +16,8 @@
16#include <linux/plist.h> 16#include <linux/plist.h>
17#include <linux/spinlock_types.h> 17#include <linux/spinlock_types.h>
18 18
19extern int max_lock_depth; /* for sysctl */
20
19/** 21/**
20 * The rt_mutex structure 22 * The rt_mutex structure
21 * 23 *
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 14fc906ed602..d1c7c90e9cd4 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -362,17 +362,17 @@ enum {
362#define RTAX_FEATURES RTAX_FEATURES 362#define RTAX_FEATURES RTAX_FEATURES
363 RTAX_RTO_MIN, 363 RTAX_RTO_MIN,
364#define RTAX_RTO_MIN RTAX_RTO_MIN 364#define RTAX_RTO_MIN RTAX_RTO_MIN
365 RTAX_INITRWND,
366#define RTAX_INITRWND RTAX_INITRWND
365 __RTAX_MAX 367 __RTAX_MAX
366}; 368};
367 369
368#define RTAX_MAX (__RTAX_MAX - 1) 370#define RTAX_MAX (__RTAX_MAX - 1)
369 371
370#define RTAX_FEATURE_ECN 0x00000001 372#define RTAX_FEATURE_ECN 0x00000001
371#define RTAX_FEATURE_NO_SACK 0x00000002 373#define RTAX_FEATURE_SACK 0x00000002
372#define RTAX_FEATURE_NO_TSTAMP 0x00000004 374#define RTAX_FEATURE_TIMESTAMP 0x00000004
373#define RTAX_FEATURE_ALLFRAG 0x00000008 375#define RTAX_FEATURE_ALLFRAG 0x00000008
374#define RTAX_FEATURE_NO_WSCALE 0x00000010
375#define RTAX_FEATURE_NO_DSACK 0x00000020
376 376
377struct rta_session { 377struct rta_session {
378 __u8 proto; 378 __u8 proto;
@@ -737,6 +737,9 @@ extern void rtnl_lock(void);
737extern void rtnl_unlock(void); 737extern void rtnl_unlock(void);
738extern int rtnl_trylock(void); 738extern int rtnl_trylock(void);
739extern int rtnl_is_locked(void); 739extern int rtnl_is_locked(void);
740#ifdef CONFIG_PROVE_LOCKING
741extern int lockdep_rtnl_is_held(void);
742#endif /* #ifdef CONFIG_PROVE_LOCKING */
740 743
741extern void rtnetlink_init(void); 744extern void rtnetlink_init(void);
742extern void __rtnl_unlock(void); 745extern void __rtnl_unlock(void);
diff --git a/include/linux/rwlock.h b/include/linux/rwlock.h
index 71e0b00b6f2c..bc2994ed66e1 100644
--- a/include/linux/rwlock.h
+++ b/include/linux/rwlock.h
@@ -29,25 +29,25 @@ do { \
29#endif 29#endif
30 30
31#ifdef CONFIG_DEBUG_SPINLOCK 31#ifdef CONFIG_DEBUG_SPINLOCK
32 extern void do_raw_read_lock(rwlock_t *lock); 32 extern void do_raw_read_lock(rwlock_t *lock) __acquires(lock);
33#define do_raw_read_lock_flags(lock, flags) do_raw_read_lock(lock) 33#define do_raw_read_lock_flags(lock, flags) do_raw_read_lock(lock)
34 extern int do_raw_read_trylock(rwlock_t *lock); 34 extern int do_raw_read_trylock(rwlock_t *lock);
35 extern void do_raw_read_unlock(rwlock_t *lock); 35 extern void do_raw_read_unlock(rwlock_t *lock) __releases(lock);
36 extern void do_raw_write_lock(rwlock_t *lock); 36 extern void do_raw_write_lock(rwlock_t *lock) __acquires(lock);
37#define do_raw_write_lock_flags(lock, flags) do_raw_write_lock(lock) 37#define do_raw_write_lock_flags(lock, flags) do_raw_write_lock(lock)
38 extern int do_raw_write_trylock(rwlock_t *lock); 38 extern int do_raw_write_trylock(rwlock_t *lock);
39 extern void do_raw_write_unlock(rwlock_t *lock); 39 extern void do_raw_write_unlock(rwlock_t *lock) __releases(lock);
40#else 40#else
41# define do_raw_read_lock(rwlock) arch_read_lock(&(rwlock)->raw_lock) 41# define do_raw_read_lock(rwlock) do {__acquire(lock); arch_read_lock(&(rwlock)->raw_lock); } while (0)
42# define do_raw_read_lock_flags(lock, flags) \ 42# define do_raw_read_lock_flags(lock, flags) \
43 arch_read_lock_flags(&(lock)->raw_lock, *(flags)) 43 do {__acquire(lock); arch_read_lock_flags(&(lock)->raw_lock, *(flags)); } while (0)
44# define do_raw_read_trylock(rwlock) arch_read_trylock(&(rwlock)->raw_lock) 44# define do_raw_read_trylock(rwlock) arch_read_trylock(&(rwlock)->raw_lock)
45# define do_raw_read_unlock(rwlock) arch_read_unlock(&(rwlock)->raw_lock) 45# define do_raw_read_unlock(rwlock) do {arch_read_unlock(&(rwlock)->raw_lock); __release(lock); } while (0)
46# define do_raw_write_lock(rwlock) arch_write_lock(&(rwlock)->raw_lock) 46# define do_raw_write_lock(rwlock) do {__acquire(lock); arch_write_lock(&(rwlock)->raw_lock); } while (0)
47# define do_raw_write_lock_flags(lock, flags) \ 47# define do_raw_write_lock_flags(lock, flags) \
48 arch_write_lock_flags(&(lock)->raw_lock, *(flags)) 48 do {__acquire(lock); arch_write_lock_flags(&(lock)->raw_lock, *(flags)); } while (0)
49# define do_raw_write_trylock(rwlock) arch_write_trylock(&(rwlock)->raw_lock) 49# define do_raw_write_trylock(rwlock) arch_write_trylock(&(rwlock)->raw_lock)
50# define do_raw_write_unlock(rwlock) arch_write_unlock(&(rwlock)->raw_lock) 50# define do_raw_write_unlock(rwlock) do {arch_write_unlock(&(rwlock)->raw_lock); __release(lock); } while (0)
51#endif 51#endif
52 52
53#define read_can_lock(rwlock) arch_read_can_lock(&(rwlock)->raw_lock) 53#define read_can_lock(rwlock) arch_read_can_lock(&(rwlock)->raw_lock)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 244c287a5ac1..dad7f668ebf7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -97,7 +97,7 @@ struct sched_param {
97struct exec_domain; 97struct exec_domain;
98struct futex_pi_state; 98struct futex_pi_state;
99struct robust_list_head; 99struct robust_list_head;
100struct bio; 100struct bio_list;
101struct fs_struct; 101struct fs_struct;
102struct bts_context; 102struct bts_context;
103struct perf_event_context; 103struct perf_event_context;
@@ -192,6 +192,12 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
192#define TASK_DEAD 64 192#define TASK_DEAD 64
193#define TASK_WAKEKILL 128 193#define TASK_WAKEKILL 128
194#define TASK_WAKING 256 194#define TASK_WAKING 256
195#define TASK_STATE_MAX 512
196
197#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW"
198
199extern char ___assert_task_state[1 - 2*!!(
200 sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)];
195 201
196/* Convenience macros for the sake of set_task_state */ 202/* Convenience macros for the sake of set_task_state */
197#define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) 203#define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)
@@ -252,6 +258,10 @@ extern spinlock_t mmlist_lock;
252 258
253struct task_struct; 259struct task_struct;
254 260
261#ifdef CONFIG_PROVE_RCU
262extern int lockdep_tasklist_lock_is_held(void);
263#endif /* #ifdef CONFIG_PROVE_RCU */
264
255extern void sched_init(void); 265extern void sched_init(void);
256extern void sched_init_smp(void); 266extern void sched_init_smp(void);
257extern asmlinkage void schedule_tail(struct task_struct *prev); 267extern asmlinkage void schedule_tail(struct task_struct *prev);
@@ -304,6 +314,7 @@ extern void sched_show_task(struct task_struct *p);
304#ifdef CONFIG_DETECT_SOFTLOCKUP 314#ifdef CONFIG_DETECT_SOFTLOCKUP
305extern void softlockup_tick(void); 315extern void softlockup_tick(void);
306extern void touch_softlockup_watchdog(void); 316extern void touch_softlockup_watchdog(void);
317extern void touch_softlockup_watchdog_sync(void);
307extern void touch_all_softlockup_watchdogs(void); 318extern void touch_all_softlockup_watchdogs(void);
308extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, 319extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write,
309 void __user *buffer, 320 void __user *buffer,
@@ -317,6 +328,9 @@ static inline void softlockup_tick(void)
317static inline void touch_softlockup_watchdog(void) 328static inline void touch_softlockup_watchdog(void)
318{ 329{
319} 330}
331static inline void touch_softlockup_watchdog_sync(void)
332{
333}
320static inline void touch_all_softlockup_watchdogs(void) 334static inline void touch_all_softlockup_watchdogs(void)
321{ 335{
322} 336}
@@ -371,6 +385,8 @@ extern int sysctl_max_map_count;
371 385
372#include <linux/aio.h> 386#include <linux/aio.h>
373 387
388#ifdef CONFIG_MMU
389extern void arch_pick_mmap_layout(struct mm_struct *mm);
374extern unsigned long 390extern unsigned long
375arch_get_unmapped_area(struct file *, unsigned long, unsigned long, 391arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
376 unsigned long, unsigned long); 392 unsigned long, unsigned long);
@@ -380,61 +396,10 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
380 unsigned long flags); 396 unsigned long flags);
381extern void arch_unmap_area(struct mm_struct *, unsigned long); 397extern void arch_unmap_area(struct mm_struct *, unsigned long);
382extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); 398extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
399#else
400static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
401#endif
383 402
384#if USE_SPLIT_PTLOCKS
385/*
386 * The mm counters are not protected by its page_table_lock,
387 * so must be incremented atomically.
388 */
389#define set_mm_counter(mm, member, value) atomic_long_set(&(mm)->_##member, value)
390#define get_mm_counter(mm, member) ((unsigned long)atomic_long_read(&(mm)->_##member))
391#define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member)
392#define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member)
393#define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member)
394
395#else /* !USE_SPLIT_PTLOCKS */
396/*
397 * The mm counters are protected by its page_table_lock,
398 * so can be incremented directly.
399 */
400#define set_mm_counter(mm, member, value) (mm)->_##member = (value)
401#define get_mm_counter(mm, member) ((mm)->_##member)
402#define add_mm_counter(mm, member, value) (mm)->_##member += (value)
403#define inc_mm_counter(mm, member) (mm)->_##member++
404#define dec_mm_counter(mm, member) (mm)->_##member--
405
406#endif /* !USE_SPLIT_PTLOCKS */
407
408#define get_mm_rss(mm) \
409 (get_mm_counter(mm, file_rss) + get_mm_counter(mm, anon_rss))
410#define update_hiwater_rss(mm) do { \
411 unsigned long _rss = get_mm_rss(mm); \
412 if ((mm)->hiwater_rss < _rss) \
413 (mm)->hiwater_rss = _rss; \
414} while (0)
415#define update_hiwater_vm(mm) do { \
416 if ((mm)->hiwater_vm < (mm)->total_vm) \
417 (mm)->hiwater_vm = (mm)->total_vm; \
418} while (0)
419
420static inline unsigned long get_mm_hiwater_rss(struct mm_struct *mm)
421{
422 return max(mm->hiwater_rss, get_mm_rss(mm));
423}
424
425static inline void setmax_mm_hiwater_rss(unsigned long *maxrss,
426 struct mm_struct *mm)
427{
428 unsigned long hiwater_rss = get_mm_hiwater_rss(mm);
429
430 if (*maxrss < hiwater_rss)
431 *maxrss = hiwater_rss;
432}
433
434static inline unsigned long get_mm_hiwater_vm(struct mm_struct *mm)
435{
436 return max(mm->hiwater_vm, mm->total_vm);
437}
438 403
439extern void set_dumpable(struct mm_struct *mm, int value); 404extern void set_dumpable(struct mm_struct *mm, int value);
440extern int get_dumpable(struct mm_struct *mm); 405extern int get_dumpable(struct mm_struct *mm);
@@ -725,14 +690,6 @@ struct user_struct {
725 uid_t uid; 690 uid_t uid;
726 struct user_namespace *user_ns; 691 struct user_namespace *user_ns;
727 692
728#ifdef CONFIG_USER_SCHED
729 struct task_group *tg;
730#ifdef CONFIG_SYSFS
731 struct kobject kobj;
732 struct delayed_work work;
733#endif
734#endif
735
736#ifdef CONFIG_PERF_EVENTS 693#ifdef CONFIG_PERF_EVENTS
737 atomic_long_t locked_vm; 694 atomic_long_t locked_vm;
738#endif 695#endif
@@ -863,7 +820,10 @@ static inline int sd_balance_for_mc_power(void)
863 if (sched_smt_power_savings) 820 if (sched_smt_power_savings)
864 return SD_POWERSAVINGS_BALANCE; 821 return SD_POWERSAVINGS_BALANCE;
865 822
866 return SD_PREFER_SIBLING; 823 if (!sched_mc_power_savings)
824 return SD_PREFER_SIBLING;
825
826 return 0;
867} 827}
868 828
869static inline int sd_balance_for_package_power(void) 829static inline int sd_balance_for_package_power(void)
@@ -1069,7 +1029,8 @@ struct sched_domain;
1069struct sched_class { 1029struct sched_class {
1070 const struct sched_class *next; 1030 const struct sched_class *next;
1071 1031
1072 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup); 1032 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup,
1033 bool head);
1073 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); 1034 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
1074 void (*yield_task) (struct rq *rq); 1035 void (*yield_task) (struct rq *rq);
1075 1036
@@ -1081,17 +1042,10 @@ struct sched_class {
1081#ifdef CONFIG_SMP 1042#ifdef CONFIG_SMP
1082 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); 1043 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags);
1083 1044
1084 unsigned long (*load_balance) (struct rq *this_rq, int this_cpu,
1085 struct rq *busiest, unsigned long max_load_move,
1086 struct sched_domain *sd, enum cpu_idle_type idle,
1087 int *all_pinned, int *this_best_prio);
1088
1089 int (*move_one_task) (struct rq *this_rq, int this_cpu,
1090 struct rq *busiest, struct sched_domain *sd,
1091 enum cpu_idle_type idle);
1092 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); 1045 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
1093 void (*post_schedule) (struct rq *this_rq); 1046 void (*post_schedule) (struct rq *this_rq);
1094 void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); 1047 void (*task_waking) (struct rq *this_rq, struct task_struct *task);
1048 void (*task_woken) (struct rq *this_rq, struct task_struct *task);
1095 1049
1096 void (*set_cpus_allowed)(struct task_struct *p, 1050 void (*set_cpus_allowed)(struct task_struct *p,
1097 const struct cpumask *newmask); 1051 const struct cpumask *newmask);
@@ -1115,7 +1069,7 @@ struct sched_class {
1115 struct task_struct *task); 1069 struct task_struct *task);
1116 1070
1117#ifdef CONFIG_FAIR_GROUP_SCHED 1071#ifdef CONFIG_FAIR_GROUP_SCHED
1118 void (*moved_group) (struct task_struct *p); 1072 void (*moved_group) (struct task_struct *p, int on_rq);
1119#endif 1073#endif
1120}; 1074};
1121 1075
@@ -1270,7 +1224,9 @@ struct task_struct {
1270 struct plist_node pushable_tasks; 1224 struct plist_node pushable_tasks;
1271 1225
1272 struct mm_struct *mm, *active_mm; 1226 struct mm_struct *mm, *active_mm;
1273 1227#if defined(SPLIT_RSS_COUNTING)
1228 struct task_rss_stat rss_stat;
1229#endif
1274/* task state */ 1230/* task state */
1275 int exit_state; 1231 int exit_state;
1276 int exit_code, exit_signal; 1232 int exit_code, exit_signal;
@@ -1357,7 +1313,7 @@ struct task_struct {
1357 char comm[TASK_COMM_LEN]; /* executable name excluding path 1313 char comm[TASK_COMM_LEN]; /* executable name excluding path
1358 - access with [gs]et_task_comm (which lock 1314 - access with [gs]et_task_comm (which lock
1359 it with task_lock()) 1315 it with task_lock())
1360 - initialized normally by flush_old_exec */ 1316 - initialized normally by setup_new_exec */
1361/* file system info */ 1317/* file system info */
1362 int link_count, total_link_count; 1318 int link_count, total_link_count;
1363#ifdef CONFIG_SYSVIPC 1319#ifdef CONFIG_SYSVIPC
@@ -1446,13 +1402,11 @@ struct task_struct {
1446 gfp_t lockdep_reclaim_gfp; 1402 gfp_t lockdep_reclaim_gfp;
1447#endif 1403#endif
1448 1404
1449#ifdef CONFIG_FS_JOURNAL_INFO
1450/* journalling filesystem info */ 1405/* journalling filesystem info */
1451 void *journal_info; 1406 void *journal_info;
1452#endif
1453 1407
1454/* stacked block device info */ 1408/* stacked block device info */
1455 struct bio *bio_list, **bio_tail; 1409 struct bio_list *bio_list;
1456 1410
1457/* VM state */ 1411/* VM state */
1458 struct reclaim_state *reclaim_state; 1412 struct reclaim_state *reclaim_state;
@@ -1523,7 +1477,7 @@ struct task_struct {
1523 1477
1524 struct list_head *scm_work_list; 1478 struct list_head *scm_work_list;
1525#ifdef CONFIG_FUNCTION_GRAPH_TRACER 1479#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1526 /* Index of current stored adress in ret_stack */ 1480 /* Index of current stored address in ret_stack */
1527 int curr_ret_stack; 1481 int curr_ret_stack;
1528 /* Stack of return addresses for return function tracing */ 1482 /* Stack of return addresses for return function tracing */
1529 struct ftrace_ret_stack *ret_stack; 1483 struct ftrace_ret_stack *ret_stack;
@@ -1555,7 +1509,7 @@ struct task_struct {
1555}; 1509};
1556 1510
1557/* Future-safe accessor for struct task_struct's cpus_allowed. */ 1511/* Future-safe accessor for struct task_struct's cpus_allowed. */
1558#define tsk_cpumask(tsk) (&(tsk)->cpus_allowed) 1512#define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
1559 1513
1560/* 1514/*
1561 * Priority of a process goes from 0..MAX_PRIO-1, valid RT 1515 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
@@ -2441,9 +2395,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
2441 2395
2442static inline void thread_group_cputime_init(struct signal_struct *sig) 2396static inline void thread_group_cputime_init(struct signal_struct *sig)
2443{ 2397{
2444 sig->cputimer.cputime = INIT_CPUTIME;
2445 spin_lock_init(&sig->cputimer.lock); 2398 spin_lock_init(&sig->cputimer.lock);
2446 sig->cputimer.running = 0;
2447} 2399}
2448 2400
2449static inline void thread_group_cputime_free(struct signal_struct *sig) 2401static inline void thread_group_cputime_free(struct signal_struct *sig)
@@ -2486,8 +2438,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
2486 2438
2487#endif /* CONFIG_SMP */ 2439#endif /* CONFIG_SMP */
2488 2440
2489extern void arch_pick_mmap_layout(struct mm_struct *mm);
2490
2491#ifdef CONFIG_TRACING 2441#ifdef CONFIG_TRACING
2492extern void 2442extern void
2493__trace_special(void *__tr, void *__data, 2443__trace_special(void *__tr, void *__data,
@@ -2505,13 +2455,9 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
2505 2455
2506extern void normalize_rt_tasks(void); 2456extern void normalize_rt_tasks(void);
2507 2457
2508#ifdef CONFIG_GROUP_SCHED 2458#ifdef CONFIG_CGROUP_SCHED
2509 2459
2510extern struct task_group init_task_group; 2460extern struct task_group init_task_group;
2511#ifdef CONFIG_USER_SCHED
2512extern struct task_group root_task_group;
2513extern void set_tg_uid(struct user_struct *user);
2514#endif
2515 2461
2516extern struct task_group *sched_create_group(struct task_group *parent); 2462extern struct task_group *sched_create_group(struct task_group *parent);
2517extern void sched_destroy_group(struct task_group *tg); 2463extern void sched_destroy_group(struct task_group *tg);
@@ -2596,7 +2542,27 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p)
2596} 2542}
2597#endif /* CONFIG_MM_OWNER */ 2543#endif /* CONFIG_MM_OWNER */
2598 2544
2599#define TASK_STATE_TO_CHAR_STR "RSDTtZX" 2545static inline unsigned long task_rlimit(const struct task_struct *tsk,
2546 unsigned int limit)
2547{
2548 return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur);
2549}
2550
2551static inline unsigned long task_rlimit_max(const struct task_struct *tsk,
2552 unsigned int limit)
2553{
2554 return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max);
2555}
2556
2557static inline unsigned long rlimit(unsigned int limit)
2558{
2559 return task_rlimit(current, limit);
2560}
2561
2562static inline unsigned long rlimit_max(unsigned int limit)
2563{
2564 return task_rlimit_max(current, limit);
2565}
2600 2566
2601#endif /* __KERNEL__ */ 2567#endif /* __KERNEL__ */
2602 2568
diff --git a/include/linux/security.h b/include/linux/security.h
index 466cbadbd1ef..233d20b52c1b 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -76,7 +76,7 @@ extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
76extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp); 76extern int cap_task_setscheduler(struct task_struct *p, int policy, struct sched_param *lp);
77extern int cap_task_setioprio(struct task_struct *p, int ioprio); 77extern int cap_task_setioprio(struct task_struct *p, int ioprio);
78extern int cap_task_setnice(struct task_struct *p, int nice); 78extern int cap_task_setnice(struct task_struct *p, int nice);
79extern int cap_syslog(int type); 79extern int cap_syslog(int type, bool from_file);
80extern int cap_vm_enough_memory(struct mm_struct *mm, long pages); 80extern int cap_vm_enough_memory(struct mm_struct *mm, long pages);
81 81
82struct msghdr; 82struct msghdr;
@@ -95,8 +95,15 @@ struct seq_file;
95extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 95extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
96extern int cap_netlink_recv(struct sk_buff *skb, int cap); 96extern int cap_netlink_recv(struct sk_buff *skb, int cap);
97 97
98void reset_security_ops(void);
99
100#ifdef CONFIG_MMU
98extern unsigned long mmap_min_addr; 101extern unsigned long mmap_min_addr;
99extern unsigned long dac_mmap_min_addr; 102extern unsigned long dac_mmap_min_addr;
103#else
104#define dac_mmap_min_addr 0UL
105#endif
106
100/* 107/*
101 * Values used in the task_security_ops calls 108 * Values used in the task_security_ops calls
102 */ 109 */
@@ -121,6 +128,7 @@ struct request_sock;
121#define LSM_UNSAFE_PTRACE 2 128#define LSM_UNSAFE_PTRACE 2
122#define LSM_UNSAFE_PTRACE_CAP 4 129#define LSM_UNSAFE_PTRACE_CAP 4
123 130
131#ifdef CONFIG_MMU
124/* 132/*
125 * If a hint addr is less than mmap_min_addr change hint to be as 133 * If a hint addr is less than mmap_min_addr change hint to be as
126 * low as possible but still greater than mmap_min_addr 134 * low as possible but still greater than mmap_min_addr
@@ -135,6 +143,7 @@ static inline unsigned long round_hint_to_min(unsigned long hint)
135} 143}
136extern int mmap_min_addr_handler(struct ctl_table *table, int write, 144extern int mmap_min_addr_handler(struct ctl_table *table, int write,
137 void __user *buffer, size_t *lenp, loff_t *ppos); 145 void __user *buffer, size_t *lenp, loff_t *ppos);
146#endif
138 147
139#ifdef CONFIG_SECURITY 148#ifdef CONFIG_SECURITY
140 149
@@ -978,6 +987,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
978 * Check permissions on incoming network packets. This hook is distinct 987 * Check permissions on incoming network packets. This hook is distinct
979 * from Netfilter's IP input hooks since it is the first time that the 988 * from Netfilter's IP input hooks since it is the first time that the
980 * incoming sk_buff @skb has been associated with a particular socket, @sk. 989 * incoming sk_buff @skb has been associated with a particular socket, @sk.
990 * Must not sleep inside this hook because some callers hold spinlocks.
981 * @sk contains the sock (not socket) associated with the incoming sk_buff. 991 * @sk contains the sock (not socket) associated with the incoming sk_buff.
982 * @skb contains the incoming network data. 992 * @skb contains the incoming network data.
983 * @socket_getpeersec_stream: 993 * @socket_getpeersec_stream:
@@ -1341,6 +1351,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1341 * logging to the console. 1351 * logging to the console.
1342 * See the syslog(2) manual page for an explanation of the @type values. 1352 * See the syslog(2) manual page for an explanation of the @type values.
1343 * @type contains the type of action. 1353 * @type contains the type of action.
1354 * @from_file indicates the context of action (if it came from /proc).
1344 * Return 0 if permission is granted. 1355 * Return 0 if permission is granted.
1345 * @settime: 1356 * @settime:
1346 * Check permission to change the system time. 1357 * Check permission to change the system time.
@@ -1455,7 +1466,7 @@ struct security_operations {
1455 int (*sysctl) (struct ctl_table *table, int op); 1466 int (*sysctl) (struct ctl_table *table, int op);
1456 int (*quotactl) (int cmds, int type, int id, struct super_block *sb); 1467 int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
1457 int (*quota_on) (struct dentry *dentry); 1468 int (*quota_on) (struct dentry *dentry);
1458 int (*syslog) (int type); 1469 int (*syslog) (int type, bool from_file);
1459 int (*settime) (struct timespec *ts, struct timezone *tz); 1470 int (*settime) (struct timespec *ts, struct timezone *tz);
1460 int (*vm_enough_memory) (struct mm_struct *mm, long pages); 1471 int (*vm_enough_memory) (struct mm_struct *mm, long pages);
1461 1472
@@ -1754,7 +1765,7 @@ int security_acct(struct file *file);
1754int security_sysctl(struct ctl_table *table, int op); 1765int security_sysctl(struct ctl_table *table, int op);
1755int security_quotactl(int cmds, int type, int id, struct super_block *sb); 1766int security_quotactl(int cmds, int type, int id, struct super_block *sb);
1756int security_quota_on(struct dentry *dentry); 1767int security_quota_on(struct dentry *dentry);
1757int security_syslog(int type); 1768int security_syslog(int type, bool from_file);
1758int security_settime(struct timespec *ts, struct timezone *tz); 1769int security_settime(struct timespec *ts, struct timezone *tz);
1759int security_vm_enough_memory(long pages); 1770int security_vm_enough_memory(long pages);
1760int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); 1771int security_vm_enough_memory_mm(struct mm_struct *mm, long pages);
@@ -2000,9 +2011,9 @@ static inline int security_quota_on(struct dentry *dentry)
2000 return 0; 2011 return 0;
2001} 2012}
2002 2013
2003static inline int security_syslog(int type) 2014static inline int security_syslog(int type, bool from_file)
2004{ 2015{
2005 return cap_syslog(type); 2016 return cap_syslog(type, from_file);
2006} 2017}
2007 2018
2008static inline int security_settime(struct timespec *ts, struct timezone *tz) 2019static inline int security_settime(struct timespec *ts, struct timezone *tz)
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 8366d8f12e53..03c0232b4169 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -135,4 +135,22 @@ extern struct list_head *seq_list_start_head(struct list_head *head,
135extern struct list_head *seq_list_next(void *v, struct list_head *head, 135extern struct list_head *seq_list_next(void *v, struct list_head *head,
136 loff_t *ppos); 136 loff_t *ppos);
137 137
138/*
139 * Helpers for iteration over hlist_head-s in seq_files
140 */
141
142extern struct hlist_node *seq_hlist_start(struct hlist_head *head,
143 loff_t pos);
144extern struct hlist_node *seq_hlist_start_head(struct hlist_head *head,
145 loff_t pos);
146extern struct hlist_node *seq_hlist_next(void *v, struct hlist_head *head,
147 loff_t *ppos);
148
149extern struct hlist_node *seq_hlist_start_rcu(struct hlist_head *head,
150 loff_t pos);
151extern struct hlist_node *seq_hlist_start_head_rcu(struct hlist_head *head,
152 loff_t pos);
153extern struct hlist_node *seq_hlist_next_rcu(void *v,
154 struct hlist_head *head,
155 loff_t *ppos);
138#endif 156#endif
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 8c3dd36fe91a..78dd1e7120a9 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -491,9 +491,13 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
491{ 491{
492 struct uart_state *state = uport->state; 492 struct uart_state *state = uport->state;
493 struct tty_port *port = &state->port; 493 struct tty_port *port = &state->port;
494 struct tty_ldisc *ld = tty_ldisc_ref(port->tty);
495 struct timespec ts;
494 496
495 uport->icount.dcd++; 497 if (ld && ld->ops->dcd_change)
498 getnstimeofday(&ts);
496 499
500 uport->icount.dcd++;
497#ifdef CONFIG_HARD_PPS 501#ifdef CONFIG_HARD_PPS
498 if ((uport->flags & UPF_HARDPPS_CD) && status) 502 if ((uport->flags & UPF_HARDPPS_CD) && status)
499 hardpps(); 503 hardpps();
@@ -505,6 +509,11 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
505 else if (port->tty) 509 else if (port->tty)
506 tty_hangup(port->tty); 510 tty_hangup(port->tty);
507 } 511 }
512
513 if (ld && ld->ops->dcd_change)
514 ld->ops->dcd_change(port->tty, status, &ts);
515 if (ld)
516 tty_ldisc_deref(ld);
508} 517}
509 518
510/** 519/**
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 1c297ddc9d5a..193d4bfe42ff 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -2,6 +2,9 @@
2#define __LINUX_SERIAL_SCI_H 2#define __LINUX_SERIAL_SCI_H
3 3
4#include <linux/serial_core.h> 4#include <linux/serial_core.h>
5#ifdef CONFIG_SERIAL_SH_SCI_DMA
6#include <asm/dmaengine.h>
7#endif
5 8
6/* 9/*
7 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) 10 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
@@ -16,6 +19,8 @@ enum {
16 SCIx_NR_IRQS, 19 SCIx_NR_IRQS,
17}; 20};
18 21
22struct device;
23
19/* 24/*
20 * Platform device specific platform_data struct 25 * Platform device specific platform_data struct
21 */ 26 */
@@ -26,6 +31,11 @@ struct plat_sci_port {
26 unsigned int type; /* SCI / SCIF / IRDA */ 31 unsigned int type; /* SCI / SCIF / IRDA */
27 upf_t flags; /* UPF_* flags */ 32 upf_t flags; /* UPF_* flags */
28 char *clk; /* clock string */ 33 char *clk; /* clock string */
34 struct device *dma_dev;
35#ifdef CONFIG_SERIAL_SH_SCI_DMA
36 enum sh_dmae_slave_chan_id dma_slave_tx;
37 enum sh_dmae_slave_chan_id dma_slave_rx;
38#endif
29}; 39};
30 40
31#endif /* __LINUX_SERIAL_SCI_H */ 41#endif /* __LINUX_SERIAL_SCI_H */
diff --git a/include/linux/serio.h b/include/linux/serio.h
index e2f3044d4a4a..64b473066b9a 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -30,7 +30,6 @@ struct serio {
30 char phys[32]; 30 char phys[32];
31 31
32 bool manual_bind; 32 bool manual_bind;
33 bool registered; /* port has been fully registered with driver core */
34 33
35 struct serio_device_id id; 34 struct serio_device_id id;
36 35
@@ -136,25 +135,6 @@ static inline void serio_continue_rx(struct serio *serio)
136 spin_unlock_irq(&serio->lock); 135 spin_unlock_irq(&serio->lock);
137} 136}
138 137
139/*
140 * Use the following functions to pin serio's driver in process context
141 */
142static inline int serio_pin_driver(struct serio *serio)
143{
144 return mutex_lock_interruptible(&serio->drv_mutex);
145}
146
147static inline void serio_pin_driver_uninterruptible(struct serio *serio)
148{
149 mutex_lock(&serio->drv_mutex);
150}
151
152static inline void serio_unpin_driver(struct serio *serio)
153{
154 mutex_unlock(&serio->drv_mutex);
155}
156
157
158#endif 138#endif
159 139
160/* 140/*
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
index 4ef246f14654..51d288d8ac88 100644
--- a/include/linux/sh_intc.h
+++ b/include/linux/sh_intc.h
@@ -45,7 +45,7 @@ struct intc_sense_reg {
45#define INTC_SMP(stride, nr) 45#define INTC_SMP(stride, nr)
46#endif 46#endif
47 47
48struct intc_desc { 48struct intc_hw_desc {
49 struct intc_vect *vectors; 49 struct intc_vect *vectors;
50 unsigned int nr_vectors; 50 unsigned int nr_vectors;
51 struct intc_group *groups; 51 struct intc_group *groups;
@@ -56,29 +56,40 @@ struct intc_desc {
56 unsigned int nr_prio_regs; 56 unsigned int nr_prio_regs;
57 struct intc_sense_reg *sense_regs; 57 struct intc_sense_reg *sense_regs;
58 unsigned int nr_sense_regs; 58 unsigned int nr_sense_regs;
59 char *name;
60 struct intc_mask_reg *ack_regs; 59 struct intc_mask_reg *ack_regs;
61 unsigned int nr_ack_regs; 60 unsigned int nr_ack_regs;
62}; 61};
63 62
64#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) 63#define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a)
64#define INTC_HW_DESC(vectors, groups, mask_regs, \
65 prio_regs, sense_regs, ack_regs) \
66{ \
67 _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \
68 _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \
69 _INTC_ARRAY(sense_regs), _INTC_ARRAY(ack_regs), \
70}
71
72struct intc_desc {
73 char *name;
74 intc_enum force_enable;
75 intc_enum force_disable;
76 struct intc_hw_desc hw;
77};
78
65#define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \ 79#define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \
66 mask_regs, prio_regs, sense_regs) \ 80 mask_regs, prio_regs, sense_regs) \
67struct intc_desc symbol __initdata = { \ 81struct intc_desc symbol __initdata = { \
68 _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ 82 .name = chipname, \
69 _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ 83 .hw = INTC_HW_DESC(vectors, groups, mask_regs, \
70 _INTC_ARRAY(sense_regs), \ 84 prio_regs, sense_regs, NULL), \
71 chipname, \
72} 85}
73 86
74#define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \ 87#define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \
75 mask_regs, prio_regs, sense_regs, ack_regs) \ 88 mask_regs, prio_regs, sense_regs, ack_regs) \
76struct intc_desc symbol __initdata = { \ 89struct intc_desc symbol __initdata = { \
77 _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ 90 .name = chipname, \
78 _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ 91 .hw = INTC_HW_DESC(vectors, groups, mask_regs, \
79 _INTC_ARRAY(sense_regs), \ 92 prio_regs, sense_regs, ack_regs), \
80 chipname, \
81 _INTC_ARRAY(ack_regs), \
82} 93}
83 94
84void __init register_intc_controller(struct intc_desc *desc); 95void __init register_intc_controller(struct intc_desc *desc);
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index deee7afd8d66..e164291fb3e7 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -41,20 +41,4 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
41extern int init_tmpfs(void); 41extern int init_tmpfs(void);
42extern int shmem_fill_super(struct super_block *sb, void *data, int silent); 42extern int shmem_fill_super(struct super_block *sb, void *data, int silent);
43 43
44#ifdef CONFIG_TMPFS_POSIX_ACL
45int shmem_check_acl(struct inode *, int);
46int shmem_acl_init(struct inode *, struct inode *);
47
48extern struct xattr_handler shmem_xattr_acl_access_handler;
49extern struct xattr_handler shmem_xattr_acl_default_handler;
50
51extern struct generic_acl_operations shmem_acl_ops;
52
53#else
54static inline int shmem_acl_init(struct inode *inode, struct inode *dir)
55{
56 return 0;
57}
58#endif /* CONFIG_TMPFS_POSIX_ACL */
59
60#endif 44#endif
diff --git a/include/linux/signal.h b/include/linux/signal.h
index ab9272cc270c..fcd2b14b1932 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -7,6 +7,8 @@
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <linux/list.h> 8#include <linux/list.h>
9 9
10/* for sysctl */
11extern int print_fatal_signals;
10/* 12/*
11 * Real Time signals may be queued. 13 * Real Time signals may be queued.
12 */ 14 */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ae836fded530..124f90cd5a38 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -190,9 +190,6 @@ struct skb_shared_info {
190 atomic_t dataref; 190 atomic_t dataref;
191 unsigned short nr_frags; 191 unsigned short nr_frags;
192 unsigned short gso_size; 192 unsigned short gso_size;
193#ifdef CONFIG_HAS_DMA
194 dma_addr_t dma_head;
195#endif
196 /* Warning: this field is not always filled in (UFO)! */ 193 /* Warning: this field is not always filled in (UFO)! */
197 unsigned short gso_segs; 194 unsigned short gso_segs;
198 unsigned short gso_type; 195 unsigned short gso_type;
@@ -201,9 +198,6 @@ struct skb_shared_info {
201 struct sk_buff *frag_list; 198 struct sk_buff *frag_list;
202 struct skb_shared_hwtstamps hwtstamps; 199 struct skb_shared_hwtstamps hwtstamps;
203 skb_frag_t frags[MAX_SKB_FRAGS]; 200 skb_frag_t frags[MAX_SKB_FRAGS];
204#ifdef CONFIG_HAS_DMA
205 dma_addr_t dma_maps[MAX_SKB_FRAGS];
206#endif
207 /* Intermediate layers must ensure that destructor_arg 201 /* Intermediate layers must ensure that destructor_arg
208 * remains valid until skb destructor */ 202 * remains valid until skb destructor */
209 void * destructor_arg; 203 void * destructor_arg;
@@ -315,22 +309,23 @@ struct sk_buff {
315 struct sk_buff *next; 309 struct sk_buff *next;
316 struct sk_buff *prev; 310 struct sk_buff *prev;
317 311
318 struct sock *sk;
319 ktime_t tstamp; 312 ktime_t tstamp;
313
314 struct sock *sk;
320 struct net_device *dev; 315 struct net_device *dev;
321 316
322 unsigned long _skb_dst;
323#ifdef CONFIG_XFRM
324 struct sec_path *sp;
325#endif
326 /* 317 /*
327 * This is the control buffer. It is free to use for every 318 * This is the control buffer. It is free to use for every
328 * layer. Please put your private variables there. If you 319 * layer. Please put your private variables there. If you
329 * want to keep them across layers you have to do a skb_clone() 320 * want to keep them across layers you have to do a skb_clone()
330 * first. This is owned by whoever has the skb queued ATM. 321 * first. This is owned by whoever has the skb queued ATM.
331 */ 322 */
332 char cb[48]; 323 char cb[48] __aligned(8);
333 324
325 unsigned long _skb_dst;
326#ifdef CONFIG_XFRM
327 struct sec_path *sp;
328#endif
334 unsigned int len, 329 unsigned int len,
335 data_len; 330 data_len;
336 __u16 mac_len, 331 __u16 mac_len,
@@ -354,8 +349,8 @@ struct sk_buff {
354 ipvs_property:1, 349 ipvs_property:1,
355 peeked:1, 350 peeked:1,
356 nf_trace:1; 351 nf_trace:1;
357 __be16 protocol:16;
358 kmemcheck_bitfield_end(flags1); 352 kmemcheck_bitfield_end(flags1);
353 __be16 protocol;
359 354
360 void (*destructor)(struct sk_buff *skb); 355 void (*destructor)(struct sk_buff *skb);
361#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 356#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
@@ -738,7 +733,7 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
738} 733}
739 734
740/** 735/**
741 * skb_peek 736 * skb_peek - peek at the head of an &sk_buff_head
742 * @list_: list to peek at 737 * @list_: list to peek at
743 * 738 *
744 * Peek an &sk_buff. Unlike most other operations you _MUST_ 739 * Peek an &sk_buff. Unlike most other operations you _MUST_
@@ -759,7 +754,7 @@ static inline struct sk_buff *skb_peek(struct sk_buff_head *list_)
759} 754}
760 755
761/** 756/**
762 * skb_peek_tail 757 * skb_peek_tail - peek at the tail of an &sk_buff_head
763 * @list_: list to peek at 758 * @list_: list to peek at
764 * 759 *
765 * Peek an &sk_buff. Unlike most other operations you _MUST_ 760 * Peek an &sk_buff. Unlike most other operations you _MUST_
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 2da8372519f5..488446289cab 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -70,6 +70,11 @@
70#else 70#else
71# define SLAB_NOTRACK 0x00000000UL 71# define SLAB_NOTRACK 0x00000000UL
72#endif 72#endif
73#ifdef CONFIG_FAILSLAB
74# define SLAB_FAILSLAB 0x02000000UL /* Fault injection mark */
75#else
76# define SLAB_FAILSLAB 0x00000000UL
77#endif
73 78
74/* The following flags affect the page allocator grouping pages by mobility */ 79/* The following flags affect the page allocator grouping pages by mobility */
75#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ 80#define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 1e14beb23f9b..0249d4175bac 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -38,8 +38,6 @@ struct kmem_cache_cpu {
38 void **freelist; /* Pointer to first free per cpu object */ 38 void **freelist; /* Pointer to first free per cpu object */
39 struct page *page; /* The slab from which we are allocating */ 39 struct page *page; /* The slab from which we are allocating */
40 int node; /* The node of the page (or -1 for debug) */ 40 int node; /* The node of the page (or -1 for debug) */
41 unsigned int offset; /* Freepointer offset (in word units) */
42 unsigned int objsize; /* Size of an object (from kmem_cache) */
43#ifdef CONFIG_SLUB_STATS 41#ifdef CONFIG_SLUB_STATS
44 unsigned stat[NR_SLUB_STAT_ITEMS]; 42 unsigned stat[NR_SLUB_STAT_ITEMS];
45#endif 43#endif
@@ -69,6 +67,7 @@ struct kmem_cache_order_objects {
69 * Slab cache management. 67 * Slab cache management.
70 */ 68 */
71struct kmem_cache { 69struct kmem_cache {
70 struct kmem_cache_cpu *cpu_slab;
72 /* Used for retriving partial slabs etc */ 71 /* Used for retriving partial slabs etc */
73 unsigned long flags; 72 unsigned long flags;
74 int size; /* The size of an object including meta data */ 73 int size; /* The size of an object including meta data */
@@ -104,11 +103,6 @@ struct kmem_cache {
104 int remote_node_defrag_ratio; 103 int remote_node_defrag_ratio;
105 struct kmem_cache_node *node[MAX_NUMNODES]; 104 struct kmem_cache_node *node[MAX_NUMNODES];
106#endif 105#endif
107#ifdef CONFIG_SMP
108 struct kmem_cache_cpu *cpu_slab[NR_CPUS];
109#else
110 struct kmem_cache_cpu cpu_slab;
111#endif
112}; 106};
113 107
114/* 108/*
@@ -135,11 +129,21 @@ struct kmem_cache {
135 129
136#define SLUB_PAGE_SHIFT (PAGE_SHIFT + 2) 130#define SLUB_PAGE_SHIFT (PAGE_SHIFT + 2)
137 131
132#ifdef CONFIG_ZONE_DMA
133#define SLUB_DMA __GFP_DMA
134/* Reserve extra caches for potential DMA use */
135#define KMALLOC_CACHES (2 * SLUB_PAGE_SHIFT - 6)
136#else
137/* Disable DMA functionality */
138#define SLUB_DMA (__force gfp_t)0
139#define KMALLOC_CACHES SLUB_PAGE_SHIFT
140#endif
141
138/* 142/*
139 * We keep the general caches in an array of slab caches that are used for 143 * We keep the general caches in an array of slab caches that are used for
140 * 2^x bytes of allocations. 144 * 2^x bytes of allocations.
141 */ 145 */
142extern struct kmem_cache kmalloc_caches[SLUB_PAGE_SHIFT]; 146extern struct kmem_cache kmalloc_caches[KMALLOC_CACHES];
143 147
144/* 148/*
145 * Sorry that the following has to be that ugly but some versions of GCC 149 * Sorry that the following has to be that ugly but some versions of GCC
@@ -207,13 +211,6 @@ static __always_inline struct kmem_cache *kmalloc_slab(size_t size)
207 return &kmalloc_caches[index]; 211 return &kmalloc_caches[index];
208} 212}
209 213
210#ifdef CONFIG_ZONE_DMA
211#define SLUB_DMA __GFP_DMA
212#else
213/* Disable DMA functionality */
214#define SLUB_DMA (__force gfp_t)0
215#endif
216
217void *kmem_cache_alloc(struct kmem_cache *, gfp_t); 214void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
218void *__kmalloc(size_t size, gfp_t flags); 215void *__kmalloc(size_t size, gfp_t flags);
219 216
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 7a0570e6a596..cfa2d20e35f1 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -154,7 +154,7 @@ smp_call_function_any(const struct cpumask *mask, void (*func)(void *info),
154/* 154/*
155 * smp_processor_id(): get the current CPU ID. 155 * smp_processor_id(): get the current CPU ID.
156 * 156 *
157 * if DEBUG_PREEMPT is enabled the we check whether it is 157 * if DEBUG_PREEMPT is enabled then we check whether it is
158 * used in a preemption-safe way. (smp_processor_id() is safe 158 * used in a preemption-safe way. (smp_processor_id() is safe
159 * if it's used in a preemption-off critical section, or in 159 * if it's used in a preemption-off critical section, or in
160 * a thread that is bound to the current CPU.) 160 * a thread that is bound to the current CPU.)
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 0f953fe40413..4435d1084755 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -225,6 +225,8 @@ enum
225 LINUX_MIB_SACKSHIFTED, 225 LINUX_MIB_SACKSHIFTED,
226 LINUX_MIB_SACKMERGED, 226 LINUX_MIB_SACKMERGED,
227 LINUX_MIB_SACKSHIFTFALLBACK, 227 LINUX_MIB_SACKSHIFTFALLBACK,
228 LINUX_MIB_TCPBACKLOGDROP,
229 LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */
228 __LINUX_MIB_MAX 230 __LINUX_MIB_MAX
229}; 231};
230 232
@@ -257,6 +259,7 @@ enum
257 LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */ 259 LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */
258 LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ 260 LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */
259 LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ 261 LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */
262 LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/
260 __LINUX_MIB_XFRMMAX 263 __LINUX_MIB_XFRMMAX
261}; 264};
262 265
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 7b3aae2052a6..354cc5617f8b 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -255,6 +255,7 @@ struct ucred {
255#define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */ 255#define MSG_ERRQUEUE 0x2000 /* Fetch message from error queue */
256#define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */ 256#define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
257#define MSG_MORE 0x8000 /* Sender will send more */ 257#define MSG_MORE 0x8000 /* Sender will send more */
258#define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */
258 259
259#define MSG_EOF MSG_FIN 260#define MSG_EOF MSG_FIN
260 261
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index 34c4475ac4a2..4f95c1aac2fd 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -111,6 +111,7 @@
111#define SONYPI_EVENT_VOLUME_INC_PRESSED 69 111#define SONYPI_EVENT_VOLUME_INC_PRESSED 69
112#define SONYPI_EVENT_VOLUME_DEC_PRESSED 70 112#define SONYPI_EVENT_VOLUME_DEC_PRESSED 70
113#define SONYPI_EVENT_BRIGHTNESS_PRESSED 71 113#define SONYPI_EVENT_BRIGHTNESS_PRESSED 71
114#define SONYPI_EVENT_MEDIA_PRESSED 72
114 115
115/* get/set brightness */ 116/* get/set brightness */
116#define SONYPI_IOCGBRT _IOR('v', 0, __u8) 117#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
diff --git a/include/linux/spi/ad7879.h b/include/linux/spi/ad7879.h
index 4231104c9afa..6334cee1a3be 100644
--- a/include/linux/spi/ad7879.h
+++ b/include/linux/spi/ad7879.h
@@ -28,8 +28,12 @@ struct ad7879_platform_data {
28 * 1 = 4, 2 = 8, 3 = 16 (median > averaging) 28 * 1 = 4, 2 = 8, 3 = 16 (median > averaging)
29 */ 29 */
30 u8 median; 30 u8 median;
31 /* 1 = AUX/VBAT/GPIO set to GPIO Output */ 31 /* 1 = AUX/VBAT/GPIO export GPIO to gpiolib
32 u8 gpio_output; 32 * requires CONFIG_GPIOLIB
33 /* Initial GPIO pin state (valid if gpio_output = 1) */ 33 */
34 u8 gpio_default; 34 bool gpio_export;
35 /* identifies the first GPIO number handled by this chip;
36 * or, if negative, requests dynamic ID allocation.
37 */
38 s32 gpio_base;
35}; 39};
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index 51948eb6927a..b4ae570d3c98 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -12,7 +12,7 @@ enum ads7846_filter {
12}; 12};
13 13
14struct ads7846_platform_data { 14struct ads7846_platform_data {
15 u16 model; /* 7843, 7845, 7846. */ 15 u16 model; /* 7843, 7845, 7846, 7873. */
16 u16 vref_delay_usecs; /* 0 for external vref; etc */ 16 u16 vref_delay_usecs; /* 0 for external vref; etc */
17 u16 vref_mv; /* external vref value, milliVolts */ 17 u16 vref_mv; /* external vref value, milliVolts */
18 bool keep_vref_on; /* set to keep vref on for differential 18 bool keep_vref_on; /* set to keep vref on for differential
@@ -53,5 +53,6 @@ struct ads7846_platform_data {
53 int (*filter) (void *filter_data, int data_idx, int *val); 53 int (*filter) (void *filter_data, int data_idx, int *val);
54 void (*filter_cleanup)(void *filter_data); 54 void (*filter_cleanup)(void *filter_data);
55 void (*wait_for_sync)(void); 55 void (*wait_for_sync)(void);
56 bool wakeup;
56}; 57};
57 58
diff --git a/include/linux/spi/dw_spi.h b/include/linux/spi/dw_spi.h
new file mode 100644
index 000000000000..cc813f95a2f2
--- /dev/null
+++ b/include/linux/spi/dw_spi.h
@@ -0,0 +1,217 @@
1#ifndef DW_SPI_HEADER_H
2#define DW_SPI_HEADER_H
3#include <linux/io.h>
4
5/* Bit fields in CTRLR0 */
6#define SPI_DFS_OFFSET 0
7
8#define SPI_FRF_OFFSET 4
9#define SPI_FRF_SPI 0x0
10#define SPI_FRF_SSP 0x1
11#define SPI_FRF_MICROWIRE 0x2
12#define SPI_FRF_RESV 0x3
13
14#define SPI_MODE_OFFSET 6
15#define SPI_SCPH_OFFSET 6
16#define SPI_SCOL_OFFSET 7
17#define SPI_TMOD_OFFSET 8
18#define SPI_TMOD_TR 0x0 /* xmit & recv */
19#define SPI_TMOD_TO 0x1 /* xmit only */
20#define SPI_TMOD_RO 0x2 /* recv only */
21#define SPI_TMOD_EPROMREAD 0x3 /* eeprom read mode */
22
23#define SPI_SLVOE_OFFSET 10
24#define SPI_SRL_OFFSET 11
25#define SPI_CFS_OFFSET 12
26
27/* Bit fields in SR, 7 bits */
28#define SR_MASK 0x7f /* cover 7 bits */
29#define SR_BUSY (1 << 0)
30#define SR_TF_NOT_FULL (1 << 1)
31#define SR_TF_EMPT (1 << 2)
32#define SR_RF_NOT_EMPT (1 << 3)
33#define SR_RF_FULL (1 << 4)
34#define SR_TX_ERR (1 << 5)
35#define SR_DCOL (1 << 6)
36
37/* Bit fields in ISR, IMR, RISR, 7 bits */
38#define SPI_INT_TXEI (1 << 0)
39#define SPI_INT_TXOI (1 << 1)
40#define SPI_INT_RXUI (1 << 2)
41#define SPI_INT_RXOI (1 << 3)
42#define SPI_INT_RXFI (1 << 4)
43#define SPI_INT_MSTI (1 << 5)
44
45/* TX RX interrupt level threshhold, max can be 256 */
46#define SPI_INT_THRESHOLD 32
47
48enum dw_ssi_type {
49 SSI_MOTO_SPI = 0,
50 SSI_TI_SSP,
51 SSI_NS_MICROWIRE,
52};
53
54struct dw_spi_reg {
55 u32 ctrl0;
56 u32 ctrl1;
57 u32 ssienr;
58 u32 mwcr;
59 u32 ser;
60 u32 baudr;
61 u32 txfltr;
62 u32 rxfltr;
63 u32 txflr;
64 u32 rxflr;
65 u32 sr;
66 u32 imr;
67 u32 isr;
68 u32 risr;
69 u32 txoicr;
70 u32 rxoicr;
71 u32 rxuicr;
72 u32 msticr;
73 u32 icr;
74 u32 dmacr;
75 u32 dmatdlr;
76 u32 dmardlr;
77 u32 idr;
78 u32 version;
79 u32 dr; /* Currently oper as 32 bits,
80 though only low 16 bits matters */
81} __packed;
82
83struct dw_spi {
84 struct spi_master *master;
85 struct spi_device *cur_dev;
86 struct device *parent_dev;
87 enum dw_ssi_type type;
88
89 void __iomem *regs;
90 unsigned long paddr;
91 u32 iolen;
92 int irq;
93 u32 fifo_len; /* depth of the FIFO buffer */
94 u32 max_freq; /* max bus freq supported */
95
96 u16 bus_num;
97 u16 num_cs; /* supported slave numbers */
98
99 /* Driver message queue */
100 struct workqueue_struct *workqueue;
101 struct work_struct pump_messages;
102 spinlock_t lock;
103 struct list_head queue;
104 int busy;
105 int run;
106
107 /* Message Transfer pump */
108 struct tasklet_struct pump_transfers;
109
110 /* Current message transfer state info */
111 struct spi_message *cur_msg;
112 struct spi_transfer *cur_transfer;
113 struct chip_data *cur_chip;
114 struct chip_data *prev_chip;
115 size_t len;
116 void *tx;
117 void *tx_end;
118 void *rx;
119 void *rx_end;
120 int dma_mapped;
121 dma_addr_t rx_dma;
122 dma_addr_t tx_dma;
123 size_t rx_map_len;
124 size_t tx_map_len;
125 u8 n_bytes; /* current is a 1/2 bytes op */
126 u8 max_bits_per_word; /* maxim is 16b */
127 u32 dma_width;
128 int cs_change;
129 int (*write)(struct dw_spi *dws);
130 int (*read)(struct dw_spi *dws);
131 irqreturn_t (*transfer_handler)(struct dw_spi *dws);
132 void (*cs_control)(u32 command);
133
134 /* Dma info */
135 int dma_inited;
136 struct dma_chan *txchan;
137 struct dma_chan *rxchan;
138 int txdma_done;
139 int rxdma_done;
140 u64 tx_param;
141 u64 rx_param;
142 struct device *dma_dev;
143 dma_addr_t dma_addr;
144
145 /* Bus interface info */
146 void *priv;
147#ifdef CONFIG_DEBUG_FS
148 struct dentry *debugfs;
149#endif
150};
151
152#define dw_readl(dw, name) \
153 __raw_readl(&(((struct dw_spi_reg *)dw->regs)->name))
154#define dw_writel(dw, name, val) \
155 __raw_writel((val), &(((struct dw_spi_reg *)dw->regs)->name))
156#define dw_readw(dw, name) \
157 __raw_readw(&(((struct dw_spi_reg *)dw->regs)->name))
158#define dw_writew(dw, name, val) \
159 __raw_writew((val), &(((struct dw_spi_reg *)dw->regs)->name))
160
161static inline void spi_enable_chip(struct dw_spi *dws, int enable)
162{
163 dw_writel(dws, ssienr, (enable ? 1 : 0));
164}
165
166static inline void spi_set_clk(struct dw_spi *dws, u16 div)
167{
168 dw_writel(dws, baudr, div);
169}
170
171static inline void spi_chip_sel(struct dw_spi *dws, u16 cs)
172{
173 if (cs > dws->num_cs)
174 return;
175
176 if (dws->cs_control)
177 dws->cs_control(1);
178
179 dw_writel(dws, ser, 1 << cs);
180}
181
182/* Disable IRQ bits */
183static inline void spi_mask_intr(struct dw_spi *dws, u32 mask)
184{
185 u32 new_mask;
186
187 new_mask = dw_readl(dws, imr) & ~mask;
188 dw_writel(dws, imr, new_mask);
189}
190
191/* Enable IRQ bits */
192static inline void spi_umask_intr(struct dw_spi *dws, u32 mask)
193{
194 u32 new_mask;
195
196 new_mask = dw_readl(dws, imr) | mask;
197 dw_writel(dws, imr, new_mask);
198}
199
200/*
201 * Each SPI slave device to work with dw_api controller should
202 * has such a structure claiming its working mode (PIO/DMA etc),
203 * which can be save in the "controller_data" member of the
204 * struct spi_device
205 */
206struct dw_spi_chip {
207 u8 poll_mode; /* 0 for contoller polling mode */
208 u8 type; /* SPI/SSP/Micrwire */
209 u8 enable_dma;
210 void (*cs_control)(u32 command);
211};
212
213extern int dw_spi_add_host(struct dw_spi *dws);
214extern void dw_spi_remove_host(struct dw_spi *dws);
215extern int dw_spi_suspend_host(struct dw_spi *dws);
216extern int dw_spi_resume_host(struct dw_spi *dws);
217#endif /* DW_SPI_HEADER_H */
diff --git a/include/linux/spi/l4f00242t03.h b/include/linux/spi/l4f00242t03.h
new file mode 100644
index 000000000000..aee1dbda4edc
--- /dev/null
+++ b/include/linux/spi/l4f00242t03.h
@@ -0,0 +1,31 @@
1/*
2 * l4f00242t03.h -- Platform glue for Epson L4F00242T03 LCD
3 *
4 * Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
5 * Based on Marek Vasut work in lms283gf05.h
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19*/
20
21#ifndef _INCLUDE_LINUX_SPI_L4F00242T03_H_
22#define _INCLUDE_LINUX_SPI_L4F00242T03_H_
23
24struct l4f00242t03_pdata {
25 unsigned int reset_gpio;
26 unsigned int data_enable_gpio;
27 const char *io_supply; /* will be set to 1.8 V */
28 const char *core_supply; /* will be set to 2.8 V */
29};
30
31#endif /* _INCLUDE_LINUX_SPI_L4F00242T03_H_ */
diff --git a/include/linux/spi/max7301.h b/include/linux/spi/max7301.h
index 6dfd83f19b4b..34af0a3477bf 100644
--- a/include/linux/spi/max7301.h
+++ b/include/linux/spi/max7301.h
@@ -1,9 +1,27 @@
1#ifndef LINUX_SPI_MAX7301_H 1#ifndef LINUX_SPI_MAX7301_H
2#define LINUX_SPI_MAX7301_H 2#define LINUX_SPI_MAX7301_H
3 3
4#include <linux/gpio.h>
5
6/*
7 * Some registers must be read back to modify.
8 * To save time we cache them here in memory
9 */
10struct max7301 {
11 struct mutex lock;
12 u8 port_config[8]; /* field 0 is unused */
13 u32 out_level; /* cached output levels */
14 struct gpio_chip chip;
15 struct device *dev;
16 int (*write)(struct device *dev, unsigned int reg, unsigned int val);
17 int (*read)(struct device *dev, unsigned int reg);
18};
19
4struct max7301_platform_data { 20struct max7301_platform_data {
5 /* number assigned to the first GPIO */ 21 /* number assigned to the first GPIO */
6 unsigned base; 22 unsigned base;
7}; 23};
8 24
25extern int __max730x_remove(struct device *dev);
26extern int __max730x_probe(struct max7301 *ts);
9#endif 27#endif
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 86088213334a..89fac6a3f78b 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -128,19 +128,21 @@ static inline void smp_mb__after_lock(void) { smp_mb(); }
128#define raw_spin_unlock_wait(lock) arch_spin_unlock_wait(&(lock)->raw_lock) 128#define raw_spin_unlock_wait(lock) arch_spin_unlock_wait(&(lock)->raw_lock)
129 129
130#ifdef CONFIG_DEBUG_SPINLOCK 130#ifdef CONFIG_DEBUG_SPINLOCK
131 extern void do_raw_spin_lock(raw_spinlock_t *lock); 131 extern void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock);
132#define do_raw_spin_lock_flags(lock, flags) do_raw_spin_lock(lock) 132#define do_raw_spin_lock_flags(lock, flags) do_raw_spin_lock(lock)
133 extern int do_raw_spin_trylock(raw_spinlock_t *lock); 133 extern int do_raw_spin_trylock(raw_spinlock_t *lock);
134 extern void do_raw_spin_unlock(raw_spinlock_t *lock); 134 extern void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock);
135#else 135#else
136static inline void do_raw_spin_lock(raw_spinlock_t *lock) 136static inline void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock)
137{ 137{
138 __acquire(lock);
138 arch_spin_lock(&lock->raw_lock); 139 arch_spin_lock(&lock->raw_lock);
139} 140}
140 141
141static inline void 142static inline void
142do_raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long *flags) 143do_raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long *flags) __acquires(lock)
143{ 144{
145 __acquire(lock);
144 arch_spin_lock_flags(&lock->raw_lock, *flags); 146 arch_spin_lock_flags(&lock->raw_lock, *flags);
145} 147}
146 148
@@ -149,9 +151,10 @@ static inline int do_raw_spin_trylock(raw_spinlock_t *lock)
149 return arch_spin_trylock(&(lock)->raw_lock); 151 return arch_spin_trylock(&(lock)->raw_lock);
150} 152}
151 153
152static inline void do_raw_spin_unlock(raw_spinlock_t *lock) 154static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
153{ 155{
154 arch_spin_unlock(&lock->raw_lock); 156 arch_spin_unlock(&lock->raw_lock);
157 __release(lock);
155} 158}
156#endif 159#endif
157 160
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 4765d97dcafb..4d5ecb222af9 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -33,8 +33,11 @@ struct srcu_struct_array {
33 33
34struct srcu_struct { 34struct srcu_struct {
35 int completed; 35 int completed;
36 struct srcu_struct_array *per_cpu_ref; 36 struct srcu_struct_array __percpu *per_cpu_ref;
37 struct mutex mutex; 37 struct mutex mutex;
38#ifdef CONFIG_DEBUG_LOCK_ALLOC
39 struct lockdep_map dep_map;
40#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
38}; 41};
39 42
40#ifndef CONFIG_PREEMPT 43#ifndef CONFIG_PREEMPT
@@ -43,12 +46,100 @@ struct srcu_struct {
43#define srcu_barrier() 46#define srcu_barrier()
44#endif /* #else #ifndef CONFIG_PREEMPT */ 47#endif /* #else #ifndef CONFIG_PREEMPT */
45 48
49#ifdef CONFIG_DEBUG_LOCK_ALLOC
50
51int __init_srcu_struct(struct srcu_struct *sp, const char *name,
52 struct lock_class_key *key);
53
54#define init_srcu_struct(sp) \
55({ \
56 static struct lock_class_key __srcu_key; \
57 \
58 __init_srcu_struct((sp), #sp, &__srcu_key); \
59})
60
61# define srcu_read_acquire(sp) \
62 lock_acquire(&(sp)->dep_map, 0, 0, 2, 1, NULL, _THIS_IP_)
63# define srcu_read_release(sp) \
64 lock_release(&(sp)->dep_map, 1, _THIS_IP_)
65
66#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
67
46int init_srcu_struct(struct srcu_struct *sp); 68int init_srcu_struct(struct srcu_struct *sp);
69
70# define srcu_read_acquire(sp) do { } while (0)
71# define srcu_read_release(sp) do { } while (0)
72
73#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
74
47void cleanup_srcu_struct(struct srcu_struct *sp); 75void cleanup_srcu_struct(struct srcu_struct *sp);
48int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); 76int __srcu_read_lock(struct srcu_struct *sp) __acquires(sp);
49void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); 77void __srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp);
50void synchronize_srcu(struct srcu_struct *sp); 78void synchronize_srcu(struct srcu_struct *sp);
51void synchronize_srcu_expedited(struct srcu_struct *sp); 79void synchronize_srcu_expedited(struct srcu_struct *sp);
52long srcu_batches_completed(struct srcu_struct *sp); 80long srcu_batches_completed(struct srcu_struct *sp);
53 81
82#ifdef CONFIG_DEBUG_LOCK_ALLOC
83
84/**
85 * srcu_read_lock_held - might we be in SRCU read-side critical section?
86 *
87 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in
88 * an SRCU read-side critical section. In absence of CONFIG_PROVE_LOCKING,
89 * this assumes we are in an SRCU read-side critical section unless it can
90 * prove otherwise.
91 */
92static inline int srcu_read_lock_held(struct srcu_struct *sp)
93{
94 if (debug_locks)
95 return lock_is_held(&sp->dep_map);
96 return 1;
97}
98
99#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
100
101static inline int srcu_read_lock_held(struct srcu_struct *sp)
102{
103 return 1;
104}
105
106#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
107
108/**
109 * srcu_dereference - fetch SRCU-protected pointer with checking
110 *
111 * Makes rcu_dereference_check() do the dirty work.
112 */
113#define srcu_dereference(p, sp) \
114 rcu_dereference_check(p, srcu_read_lock_held(sp))
115
116/**
117 * srcu_read_lock - register a new reader for an SRCU-protected structure.
118 * @sp: srcu_struct in which to register the new reader.
119 *
120 * Enter an SRCU read-side critical section. Note that SRCU read-side
121 * critical sections may be nested.
122 */
123static inline int srcu_read_lock(struct srcu_struct *sp) __acquires(sp)
124{
125 int retval = __srcu_read_lock(sp);
126
127 srcu_read_acquire(sp);
128 return retval;
129}
130
131/**
132 * srcu_read_unlock - unregister a old reader from an SRCU-protected structure.
133 * @sp: srcu_struct in which to unregister the old reader.
134 * @idx: return value from corresponding srcu_read_lock().
135 *
136 * Exit an SRCU read-side critical section.
137 */
138static inline void srcu_read_unlock(struct srcu_struct *sp, int idx)
139 __releases(sp)
140{
141 srcu_read_release(sp);
142 __srcu_read_unlock(sp, idx);
143}
144
54#endif 145#endif
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
new file mode 100644
index 000000000000..32bfd1a8a48d
--- /dev/null
+++ b/include/linux/stmmac.h
@@ -0,0 +1,53 @@
1/*******************************************************************************
2
3 Header file for stmmac platform data
4
5 Copyright (C) 2009 STMicroelectronics Ltd
6
7 This program is free software; you can redistribute it and/or modify it
8 under the terms and conditions of the GNU General Public License,
9 version 2, as published by the Free Software Foundation.
10
11 This program is distributed in the hope it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 more details.
15
16 You should have received a copy of the GNU General Public License along with
17 this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19
20 The full GNU General Public License is included in this distribution in
21 the file called "COPYING".
22
23 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
24*******************************************************************************/
25
26#ifndef __STMMAC_PLATFORM_DATA
27#define __STMMAC_PLATFORM_DATA
28
29/* platfrom data for platfrom device structure's platfrom_data field */
30
31/* Private data for the STM on-board ethernet driver */
32struct plat_stmmacenet_data {
33 int bus_id;
34 int pbl;
35 int has_gmac;
36 void (*fix_mac_speed)(void *priv, unsigned int speed);
37 void (*bus_setup)(unsigned long ioaddr);
38#ifdef CONFIG_STM_DRIVERS
39 struct stm_pad_config *pad_config;
40#endif
41 void *bsp_priv;
42};
43
44struct plat_stmmacphy_data {
45 int bus_id;
46 int phy_addr;
47 unsigned int phy_mask;
48 int interface;
49 int (*phy_reset)(void *priv);
50 void *priv;
51};
52#endif
53
diff --git a/include/linux/string.h b/include/linux/string.h
index 651839a2a755..a716ee2a8adb 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -72,7 +72,10 @@ static inline __must_check char *strstrip(char *str)
72} 72}
73 73
74#ifndef __HAVE_ARCH_STRSTR 74#ifndef __HAVE_ARCH_STRSTR
75extern char * strstr(const char *,const char *); 75extern char * strstr(const char *, const char *);
76#endif
77#ifndef __HAVE_ARCH_STRNSTR
78extern char * strnstr(const char *, const char *, size_t);
76#endif 79#endif
77#ifndef __HAVE_ARCH_STRLEN 80#ifndef __HAVE_ARCH_STRLEN
78extern __kernel_size_t strlen(const char *); 81extern __kernel_size_t strlen(const char *);
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
index 6508f0dc0eff..7c91260c44a9 100644
--- a/include/linux/sunrpc/bc_xprt.h
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -36,14 +36,32 @@ struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt);
36void xprt_free_bc_request(struct rpc_rqst *req); 36void xprt_free_bc_request(struct rpc_rqst *req);
37int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); 37int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
38void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); 38void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs);
39void bc_release_request(struct rpc_task *);
40int bc_send(struct rpc_rqst *req); 39int bc_send(struct rpc_rqst *req);
40
41/*
42 * Determine if a shared backchannel is in use
43 */
44static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
45{
46 if (rqstp->rq_server->bc_xprt)
47 return 1;
48 return 0;
49}
41#else /* CONFIG_NFS_V4_1 */ 50#else /* CONFIG_NFS_V4_1 */
42static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, 51static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
43 unsigned int min_reqs) 52 unsigned int min_reqs)
44{ 53{
45 return 0; 54 return 0;
46} 55}
56
57static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
58{
59 return 0;
60}
61
62static inline void xprt_free_bc_request(struct rpc_rqst *req)
63{
64}
47#endif /* CONFIG_NFS_V4_1 */ 65#endif /* CONFIG_NFS_V4_1 */
48#endif /* _LINUX_SUNRPC_BC_XPRT_H */ 66#endif /* _LINUX_SUNRPC_BC_XPRT_H */
49 67
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 10709cbe96fd..c2786f20016f 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -28,9 +28,6 @@
28 28
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <linux/timer.h>
32#include <linux/workqueue.h>
33
34/* 31/*
35 * Enable RPC debugging/profiling. 32 * Enable RPC debugging/profiling.
36 */ 33 */
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h
index 87b895d5c786..b78f16b1dea3 100644
--- a/include/linux/sunrpc/rpc_rdma.h
+++ b/include/linux/sunrpc/rpc_rdma.h
@@ -40,6 +40,8 @@
40#ifndef _LINUX_SUNRPC_RPC_RDMA_H 40#ifndef _LINUX_SUNRPC_RPC_RDMA_H
41#define _LINUX_SUNRPC_RPC_RDMA_H 41#define _LINUX_SUNRPC_RPC_RDMA_H
42 42
43#include <linux/types.h>
44
43struct rpcrdma_segment { 45struct rpcrdma_segment {
44 __be32 rs_handle; /* Registered memory handle */ 46 __be32 rs_handle; /* Registered memory handle */
45 __be32 rs_length; /* Length of the chunk in bytes */ 47 __be32 rs_length; /* Length of the chunk in bytes */
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 1906782ec86b..7bc7fd5291ce 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -173,7 +173,8 @@ struct rpc_task_setup {
173#define RPC_PRIORITY_LOW (-1) 173#define RPC_PRIORITY_LOW (-1)
174#define RPC_PRIORITY_NORMAL (0) 174#define RPC_PRIORITY_NORMAL (0)
175#define RPC_PRIORITY_HIGH (1) 175#define RPC_PRIORITY_HIGH (1)
176#define RPC_NR_PRIORITY (1 + RPC_PRIORITY_HIGH - RPC_PRIORITY_LOW) 176#define RPC_PRIORITY_PRIVILEGED (2)
177#define RPC_NR_PRIORITY (1 + RPC_PRIORITY_PRIVILEGED - RPC_PRIORITY_LOW)
177 178
178struct rpc_timer { 179struct rpc_timer {
179 struct timer_list timer; 180 struct timer_list timer;
@@ -229,6 +230,7 @@ void rpc_wake_up_queued_task(struct rpc_wait_queue *,
229void rpc_wake_up(struct rpc_wait_queue *); 230void rpc_wake_up(struct rpc_wait_queue *);
230struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); 231struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *);
231void rpc_wake_up_status(struct rpc_wait_queue *, int); 232void rpc_wake_up_status(struct rpc_wait_queue *, int);
233int rpc_queue_empty(struct rpc_wait_queue *);
232void rpc_delay(struct rpc_task *, unsigned long); 234void rpc_delay(struct rpc_task *, unsigned long);
233void * rpc_malloc(struct rpc_task *, size_t); 235void * rpc_malloc(struct rpc_task *, size_t);
234void rpc_free(void *); 236void rpc_free(void *);
@@ -254,6 +256,16 @@ static inline int rpc_wait_for_completion_task(struct rpc_task *task)
254 return __rpc_wait_for_completion_task(task, NULL); 256 return __rpc_wait_for_completion_task(task, NULL);
255} 257}
256 258
259static inline void rpc_task_set_priority(struct rpc_task *task, unsigned char prio)
260{
261 task->tk_priority = prio - RPC_PRIORITY_LOW;
262}
263
264static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char prio)
265{
266 return (task->tk_priority + RPC_PRIORITY_LOW == prio);
267}
268
257#ifdef RPC_DEBUG 269#ifdef RPC_DEBUG
258static inline const char * rpc_qname(struct rpc_wait_queue *q) 270static inline const char * rpc_qname(struct rpc_wait_queue *q)
259{ 271{
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 52e8cb0a7569..5a3085b9b394 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -29,7 +29,6 @@ struct svc_pool_stats {
29 unsigned long packets; 29 unsigned long packets;
30 unsigned long sockets_queued; 30 unsigned long sockets_queued;
31 unsigned long threads_woken; 31 unsigned long threads_woken;
32 unsigned long overloads_avoided;
33 unsigned long threads_timedout; 32 unsigned long threads_timedout;
34}; 33};
35 34
@@ -50,7 +49,6 @@ struct svc_pool {
50 struct list_head sp_sockets; /* pending sockets */ 49 struct list_head sp_sockets; /* pending sockets */
51 unsigned int sp_nrthreads; /* # of threads in pool */ 50 unsigned int sp_nrthreads; /* # of threads in pool */
52 struct list_head sp_all_threads; /* all server threads */ 51 struct list_head sp_all_threads; /* all server threads */
53 int sp_nwaking; /* number of threads woken but not yet active */
54 struct svc_pool_stats sp_stats; /* statistics on pool operation */ 52 struct svc_pool_stats sp_stats; /* statistics on pool operation */
55} ____cacheline_aligned_in_smp; 53} ____cacheline_aligned_in_smp;
56 54
@@ -275,16 +273,11 @@ struct svc_rqst {
275 struct auth_domain * rq_client; /* RPC peer info */ 273 struct auth_domain * rq_client; /* RPC peer info */
276 struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ 274 struct auth_domain * rq_gssclient; /* "gss/"-style peer info */
277 struct svc_cacherep * rq_cacherep; /* cache info */ 275 struct svc_cacherep * rq_cacherep; /* cache info */
278 struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to
279 * determine what device number
280 * to report (real or virtual)
281 */
282 int rq_splice_ok; /* turned off in gss privacy 276 int rq_splice_ok; /* turned off in gss privacy
283 * to prevent encrypting page 277 * to prevent encrypting page
284 * cache pages */ 278 * cache pages */
285 wait_queue_head_t rq_wait; /* synchronization */ 279 wait_queue_head_t rq_wait; /* synchronization */
286 struct task_struct *rq_task; /* service thread */ 280 struct task_struct *rq_task; /* service thread */
287 int rq_waking; /* 1 if thread is being woken */
288}; 281};
289 282
290/* 283/*
diff --git a/include/linux/swap.h b/include/linux/swap.h
index a2602a8207a6..1f59d9340c4d 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -355,6 +355,7 @@ static inline void disable_swap_token(void)
355#ifdef CONFIG_CGROUP_MEM_RES_CTLR 355#ifdef CONFIG_CGROUP_MEM_RES_CTLR
356extern void 356extern void
357mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); 357mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout);
358extern int mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep);
358#else 359#else
359static inline void 360static inline void
360mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) 361mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout)
@@ -485,6 +486,14 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
485{ 486{
486} 487}
487 488
489#ifdef CONFIG_CGROUP_MEM_RES_CTLR
490static inline int
491mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep)
492{
493 return 0;
494}
495#endif
496
488#endif /* CONFIG_SWAP */ 497#endif /* CONFIG_SWAP */
489#endif /* __KERNEL__*/ 498#endif /* __KERNEL__*/
490#endif /* _LINUX_SWAP_H */ 499#endif /* _LINUX_SWAP_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 939a61507ac5..057929b0a651 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -23,6 +23,7 @@ struct kexec_segment;
23struct linux_dirent; 23struct linux_dirent;
24struct linux_dirent64; 24struct linux_dirent64;
25struct list_head; 25struct list_head;
26struct mmap_arg_struct;
26struct msgbuf; 27struct msgbuf;
27struct msghdr; 28struct msghdr;
28struct mmsghdr; 29struct mmsghdr;
@@ -30,10 +31,13 @@ struct msqid_ds;
30struct new_utsname; 31struct new_utsname;
31struct nfsctl_arg; 32struct nfsctl_arg;
32struct __old_kernel_stat; 33struct __old_kernel_stat;
34struct oldold_utsname;
35struct old_utsname;
33struct pollfd; 36struct pollfd;
34struct rlimit; 37struct rlimit;
35struct rusage; 38struct rusage;
36struct sched_param; 39struct sched_param;
40struct sel_arg_struct;
37struct semaphore; 41struct semaphore;
38struct sembuf; 42struct sembuf;
39struct shmid_ds; 43struct shmid_ds;
@@ -99,23 +103,21 @@ struct perf_event_attr;
99#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) 103#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
100#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) 104#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
101 105
102#ifdef CONFIG_EVENT_PROFILE 106#ifdef CONFIG_PERF_EVENTS
103 107
104#define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ 108#define TRACE_SYS_ENTER_PERF_INIT(sname) \
105 .profile_count = ATOMIC_INIT(-1), \ 109 .perf_event_enable = perf_sysenter_enable, \
106 .profile_enable = prof_sysenter_enable, \ 110 .perf_event_disable = perf_sysenter_disable,
107 .profile_disable = prof_sysenter_disable,
108 111
109#define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ 112#define TRACE_SYS_EXIT_PERF_INIT(sname) \
110 .profile_count = ATOMIC_INIT(-1), \ 113 .perf_event_enable = perf_sysexit_enable, \
111 .profile_enable = prof_sysexit_enable, \ 114 .perf_event_disable = perf_sysexit_disable,
112 .profile_disable = prof_sysexit_disable,
113#else 115#else
114#define TRACE_SYS_ENTER_PROFILE(sname) 116#define TRACE_SYS_ENTER_PERF(sname)
115#define TRACE_SYS_ENTER_PROFILE_INIT(sname) 117#define TRACE_SYS_ENTER_PERF_INIT(sname)
116#define TRACE_SYS_EXIT_PROFILE(sname) 118#define TRACE_SYS_EXIT_PERF(sname)
117#define TRACE_SYS_EXIT_PROFILE_INIT(sname) 119#define TRACE_SYS_EXIT_PERF_INIT(sname)
118#endif 120#endif /* CONFIG_PERF_EVENTS */
119 121
120#ifdef CONFIG_FTRACE_SYSCALLS 122#ifdef CONFIG_FTRACE_SYSCALLS
121#define __SC_STR_ADECL1(t, a) #a 123#define __SC_STR_ADECL1(t, a) #a
@@ -134,7 +136,8 @@ struct perf_event_attr;
134 136
135#define SYSCALL_TRACE_ENTER_EVENT(sname) \ 137#define SYSCALL_TRACE_ENTER_EVENT(sname) \
136 static const struct syscall_metadata __syscall_meta_##sname; \ 138 static const struct syscall_metadata __syscall_meta_##sname; \
137 static struct ftrace_event_call event_enter_##sname; \ 139 static struct ftrace_event_call \
140 __attribute__((__aligned__(4))) event_enter_##sname; \
138 static struct trace_event enter_syscall_print_##sname = { \ 141 static struct trace_event enter_syscall_print_##sname = { \
139 .trace = print_syscall_enter, \ 142 .trace = print_syscall_enter, \
140 }; \ 143 }; \
@@ -146,17 +149,17 @@ struct perf_event_attr;
146 .system = "syscalls", \ 149 .system = "syscalls", \
147 .event = &enter_syscall_print_##sname, \ 150 .event = &enter_syscall_print_##sname, \
148 .raw_init = init_syscall_trace, \ 151 .raw_init = init_syscall_trace, \
149 .show_format = syscall_enter_format, \
150 .define_fields = syscall_enter_define_fields, \ 152 .define_fields = syscall_enter_define_fields, \
151 .regfunc = reg_event_syscall_enter, \ 153 .regfunc = reg_event_syscall_enter, \
152 .unregfunc = unreg_event_syscall_enter, \ 154 .unregfunc = unreg_event_syscall_enter, \
153 .data = (void *)&__syscall_meta_##sname,\ 155 .data = (void *)&__syscall_meta_##sname,\
154 TRACE_SYS_ENTER_PROFILE_INIT(sname) \ 156 TRACE_SYS_ENTER_PERF_INIT(sname) \
155 } 157 }
156 158
157#define SYSCALL_TRACE_EXIT_EVENT(sname) \ 159#define SYSCALL_TRACE_EXIT_EVENT(sname) \
158 static const struct syscall_metadata __syscall_meta_##sname; \ 160 static const struct syscall_metadata __syscall_meta_##sname; \
159 static struct ftrace_event_call event_exit_##sname; \ 161 static struct ftrace_event_call \
162 __attribute__((__aligned__(4))) event_exit_##sname; \
160 static struct trace_event exit_syscall_print_##sname = { \ 163 static struct trace_event exit_syscall_print_##sname = { \
161 .trace = print_syscall_exit, \ 164 .trace = print_syscall_exit, \
162 }; \ 165 }; \
@@ -168,12 +171,11 @@ struct perf_event_attr;
168 .system = "syscalls", \ 171 .system = "syscalls", \
169 .event = &exit_syscall_print_##sname, \ 172 .event = &exit_syscall_print_##sname, \
170 .raw_init = init_syscall_trace, \ 173 .raw_init = init_syscall_trace, \
171 .show_format = syscall_exit_format, \
172 .define_fields = syscall_exit_define_fields, \ 174 .define_fields = syscall_exit_define_fields, \
173 .regfunc = reg_event_syscall_exit, \ 175 .regfunc = reg_event_syscall_exit, \
174 .unregfunc = unreg_event_syscall_exit, \ 176 .unregfunc = unreg_event_syscall_exit, \
175 .data = (void *)&__syscall_meta_##sname,\ 177 .data = (void *)&__syscall_meta_##sname,\
176 TRACE_SYS_EXIT_PROFILE_INIT(sname) \ 178 TRACE_SYS_EXIT_PERF_INIT(sname) \
177 } 179 }
178 180
179#define SYSCALL_METADATA(sname, nb) \ 181#define SYSCALL_METADATA(sname, nb) \
@@ -197,7 +199,7 @@ struct perf_event_attr;
197 static const struct syscall_metadata __used \ 199 static const struct syscall_metadata __used \
198 __attribute__((__aligned__(4))) \ 200 __attribute__((__aligned__(4))) \
199 __attribute__((section("__syscalls_metadata"))) \ 201 __attribute__((section("__syscalls_metadata"))) \
200 __syscall_meta_##sname = { \ 202 __syscall_meta__##sname = { \
201 .name = "sys_"#sname, \ 203 .name = "sys_"#sname, \
202 .nb_args = 0, \ 204 .nb_args = 0, \
203 .enter_event = &event_enter__##sname, \ 205 .enter_event = &event_enter__##sname, \
@@ -640,6 +642,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
640 long timeout); 642 long timeout);
641asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, 643asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
642 fd_set __user *exp, struct timeval __user *tvp); 644 fd_set __user *exp, struct timeval __user *tvp);
645asmlinkage long sys_old_select(struct sel_arg_struct __user *arg);
643asmlinkage long sys_epoll_create(int size); 646asmlinkage long sys_epoll_create(int size);
644asmlinkage long sys_epoll_create1(int flags); 647asmlinkage long sys_epoll_create1(int flags);
645asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, 648asmlinkage long sys_epoll_ctl(int epfd, int op, int fd,
@@ -654,6 +657,8 @@ asmlinkage long sys_gethostname(char __user *name, int len);
654asmlinkage long sys_sethostname(char __user *name, int len); 657asmlinkage long sys_sethostname(char __user *name, int len);
655asmlinkage long sys_setdomainname(char __user *name, int len); 658asmlinkage long sys_setdomainname(char __user *name, int len);
656asmlinkage long sys_newuname(struct new_utsname __user *name); 659asmlinkage long sys_newuname(struct new_utsname __user *name);
660asmlinkage long sys_uname(struct old_utsname __user *);
661asmlinkage long sys_olduname(struct oldold_utsname __user *);
657 662
658asmlinkage long sys_getrlimit(unsigned int resource, 663asmlinkage long sys_getrlimit(unsigned int resource,
659 struct rlimit __user *rlim); 664 struct rlimit __user *rlim);
@@ -683,6 +688,8 @@ asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg);
683asmlinkage long sys_shmget(key_t key, size_t size, int flag); 688asmlinkage long sys_shmget(key_t key, size_t size, int flag);
684asmlinkage long sys_shmdt(char __user *shmaddr); 689asmlinkage long sys_shmdt(char __user *shmaddr);
685asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); 690asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
691asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,
692 unsigned long third, void __user *ptr, long fifth);
686 693
687asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); 694asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr);
688asmlinkage long sys_mq_unlink(const char __user *name); 695asmlinkage long sys_mq_unlink(const char __user *name);
@@ -838,4 +845,6 @@ asmlinkage long sys_perf_event_open(
838asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len, 845asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len,
839 unsigned long prot, unsigned long flags, 846 unsigned long prot, unsigned long flags,
840 unsigned long fd, unsigned long pgoff); 847 unsigned long fd, unsigned long pgoff);
848asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg);
849
841#endif 850#endif
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 877ba039e6a4..f66014c90c9f 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -481,8 +481,6 @@ enum
481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20, 481 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
482 NET_IPV4_CONF_ARP_ACCEPT=21, 482 NET_IPV4_CONF_ARP_ACCEPT=21,
483 NET_IPV4_CONF_ARP_NOTIFY=22, 483 NET_IPV4_CONF_ARP_NOTIFY=22,
484 NET_IPV4_CONF_ACCEPT_LOCAL=23,
485 __NET_IPV4_CONF_MAX
486}; 484};
487 485
488/* /proc/sys/net/ipv4/netfilter */ 486/* /proc/sys/net/ipv4/netfilter */
@@ -598,7 +596,6 @@ enum {
598 NET_NEIGH_GC_THRESH3=16, 596 NET_NEIGH_GC_THRESH3=16,
599 NET_NEIGH_RETRANS_TIME_MS=17, 597 NET_NEIGH_RETRANS_TIME_MS=17,
600 NET_NEIGH_REACHABLE_TIME_MS=18, 598 NET_NEIGH_REACHABLE_TIME_MS=18,
601 __NET_NEIGH_MAX
602}; 599};
603 600
604/* /proc/sys/net/dccp */ 601/* /proc/sys/net/dccp */
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index f395bb3fa2f2..1154c29f4101 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -27,10 +27,12 @@
27 27
28 28
29struct sys_device; 29struct sys_device;
30struct sysdev_class_attribute;
30 31
31struct sysdev_class { 32struct sysdev_class {
32 const char *name; 33 const char *name;
33 struct list_head drivers; 34 struct list_head drivers;
35 struct sysdev_class_attribute **attrs;
34 36
35 /* Default operations for these types of devices */ 37 /* Default operations for these types of devices */
36 int (*shutdown)(struct sys_device *); 38 int (*shutdown)(struct sys_device *);
@@ -41,8 +43,10 @@ struct sysdev_class {
41 43
42struct sysdev_class_attribute { 44struct sysdev_class_attribute {
43 struct attribute attr; 45 struct attribute attr;
44 ssize_t (*show)(struct sysdev_class *, char *); 46 ssize_t (*show)(struct sysdev_class *, struct sysdev_class_attribute *,
45 ssize_t (*store)(struct sysdev_class *, const char *, size_t); 47 char *);
48 ssize_t (*store)(struct sysdev_class *, struct sysdev_class_attribute *,
49 const char *, size_t);
46}; 50};
47 51
48#define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ 52#define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \
@@ -119,6 +123,19 @@ struct sysdev_attribute {
119extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); 123extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
120extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); 124extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);
121 125
126/* Create/remove NULL terminated attribute list */
127static inline int
128sysdev_create_files(struct sys_device *d, struct sysdev_attribute **a)
129{
130 return sysfs_create_files(&d->kobj, (const struct attribute **)a);
131}
132
133static inline void
134sysdev_remove_files(struct sys_device *d, struct sysdev_attribute **a)
135{
136 return sysfs_remove_files(&d->kobj, (const struct attribute **)a);
137}
138
122struct sysdev_ext_attribute { 139struct sysdev_ext_attribute {
123 struct sysdev_attribute attr; 140 struct sysdev_attribute attr;
124 void *var; 141 void *var;
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 9d68fed50f11..f0496b3d1811 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -15,6 +15,7 @@
15#include <linux/compiler.h> 15#include <linux/compiler.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/lockdep.h>
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19 20
20struct kobject; 21struct kobject;
@@ -29,8 +30,33 @@ struct attribute {
29 const char *name; 30 const char *name;
30 struct module *owner; 31 struct module *owner;
31 mode_t mode; 32 mode_t mode;
33#ifdef CONFIG_DEBUG_LOCK_ALLOC
34 struct lock_class_key *key;
35 struct lock_class_key skey;
36#endif
32}; 37};
33 38
39/**
40 * sysfs_attr_init - initialize a dynamically allocated sysfs attribute
41 * @attr: struct attribute to initialize
42 *
43 * Initialize a dynamically allocated struct attribute so we can
44 * make lockdep happy. This is a new requirement for attributes
45 * and initially this is only needed when lockdep is enabled.
46 * Lockdep gives a nice error when your attribute is added to
47 * sysfs if you don't have this.
48 */
49#ifdef CONFIG_DEBUG_LOCK_ALLOC
50#define sysfs_attr_init(attr) \
51do { \
52 static struct lock_class_key __key; \
53 \
54 (attr)->key = &__key; \
55} while(0)
56#else
57#define sysfs_attr_init(attr) do {} while(0)
58#endif
59
34struct attribute_group { 60struct attribute_group {
35 const char *name; 61 const char *name;
36 mode_t (*is_visible)(struct kobject *, 62 mode_t (*is_visible)(struct kobject *,
@@ -74,6 +100,18 @@ struct bin_attribute {
74 struct vm_area_struct *vma); 100 struct vm_area_struct *vma);
75}; 101};
76 102
103/**
104 * sysfs_bin_attr_init - initialize a dynamically allocated bin_attribute
105 * @attr: struct bin_attribute to initialize
106 *
107 * Initialize a dynamically allocated struct bin_attribute so we
108 * can make lockdep happy. This is a new requirement for
109 * attributes and initially this is only needed when lockdep is
110 * enabled. Lockdep gives a nice error when your attribute is
111 * added to sysfs if you don't have this.
112 */
113#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr)
114
77struct sysfs_ops { 115struct sysfs_ops {
78 ssize_t (*show)(struct kobject *, struct attribute *,char *); 116 ssize_t (*show)(struct kobject *, struct attribute *,char *);
79 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 117 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
@@ -94,13 +132,17 @@ int __must_check sysfs_move_dir(struct kobject *kobj,
94 132
95int __must_check sysfs_create_file(struct kobject *kobj, 133int __must_check sysfs_create_file(struct kobject *kobj,
96 const struct attribute *attr); 134 const struct attribute *attr);
135int __must_check sysfs_create_files(struct kobject *kobj,
136 const struct attribute **attr);
97int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, 137int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr,
98 mode_t mode); 138 mode_t mode);
99void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); 139void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr);
140void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr);
100 141
101int __must_check sysfs_create_bin_file(struct kobject *kobj, 142int __must_check sysfs_create_bin_file(struct kobject *kobj,
102 struct bin_attribute *attr); 143 const struct bin_attribute *attr);
103void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); 144void sysfs_remove_bin_file(struct kobject *kobj,
145 const struct bin_attribute *attr);
104 146
105int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target, 147int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target,
106 const char *name); 148 const char *name);
@@ -109,6 +151,9 @@ int __must_check sysfs_create_link_nowarn(struct kobject *kobj,
109 const char *name); 151 const char *name);
110void sysfs_remove_link(struct kobject *kobj, const char *name); 152void sysfs_remove_link(struct kobject *kobj, const char *name);
111 153
154int sysfs_rename_link(struct kobject *kobj, struct kobject *target,
155 const char *old_name, const char *new_name);
156
112int __must_check sysfs_create_group(struct kobject *kobj, 157int __must_check sysfs_create_group(struct kobject *kobj,
113 const struct attribute_group *grp); 158 const struct attribute_group *grp);
114int sysfs_update_group(struct kobject *kobj, 159int sysfs_update_group(struct kobject *kobj,
@@ -163,6 +208,12 @@ static inline int sysfs_create_file(struct kobject *kobj,
163 return 0; 208 return 0;
164} 209}
165 210
211static inline int sysfs_create_files(struct kobject *kobj,
212 const struct attribute **attr)
213{
214 return 0;
215}
216
166static inline int sysfs_chmod_file(struct kobject *kobj, 217static inline int sysfs_chmod_file(struct kobject *kobj,
167 struct attribute *attr, mode_t mode) 218 struct attribute *attr, mode_t mode)
168{ 219{
@@ -174,14 +225,19 @@ static inline void sysfs_remove_file(struct kobject *kobj,
174{ 225{
175} 226}
176 227
228static inline void sysfs_remove_files(struct kobject *kobj,
229 const struct attribute **attr)
230{
231}
232
177static inline int sysfs_create_bin_file(struct kobject *kobj, 233static inline int sysfs_create_bin_file(struct kobject *kobj,
178 struct bin_attribute *attr) 234 const struct bin_attribute *attr)
179{ 235{
180 return 0; 236 return 0;
181} 237}
182 238
183static inline void sysfs_remove_bin_file(struct kobject *kobj, 239static inline void sysfs_remove_bin_file(struct kobject *kobj,
184 struct bin_attribute *attr) 240 const struct bin_attribute *attr)
185{ 241{
186} 242}
187 243
@@ -202,6 +258,12 @@ static inline void sysfs_remove_link(struct kobject *kobj, const char *name)
202{ 258{
203} 259}
204 260
261static inline int sysfs_rename_link(struct kobject *k, struct kobject *t,
262 const char *old_name, const char *new_name)
263{
264 return 0;
265}
266
205static inline int sysfs_create_group(struct kobject *kobj, 267static inline int sysfs_create_group(struct kobject *kobj,
206 const struct attribute_group *grp) 268 const struct attribute_group *grp)
207{ 269{
diff --git a/include/linux/syslog.h b/include/linux/syslog.h
new file mode 100644
index 000000000000..38911391a139
--- /dev/null
+++ b/include/linux/syslog.h
@@ -0,0 +1,52 @@
1/* Syslog internals
2 *
3 * Copyright 2010 Canonical, Ltd.
4 * Author: Kees Cook <kees.cook@canonical.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21#ifndef _LINUX_SYSLOG_H
22#define _LINUX_SYSLOG_H
23
24/* Close the log. Currently a NOP. */
25#define SYSLOG_ACTION_CLOSE 0
26/* Open the log. Currently a NOP. */
27#define SYSLOG_ACTION_OPEN 1
28/* Read from the log. */
29#define SYSLOG_ACTION_READ 2
30/* Read all messages remaining in the ring buffer. */
31#define SYSLOG_ACTION_READ_ALL 3
32/* Read and clear all messages remaining in the ring buffer */
33#define SYSLOG_ACTION_READ_CLEAR 4
34/* Clear ring buffer. */
35#define SYSLOG_ACTION_CLEAR 5
36/* Disable printk's to console */
37#define SYSLOG_ACTION_CONSOLE_OFF 6
38/* Enable printk's to console */
39#define SYSLOG_ACTION_CONSOLE_ON 7
40/* Set level of messages printed to console */
41#define SYSLOG_ACTION_CONSOLE_LEVEL 8
42/* Return number of unread characters in the log buffer */
43#define SYSLOG_ACTION_SIZE_UNREAD 9
44/* Return size of the log buffer */
45#define SYSLOG_ACTION_SIZE_BUFFER 10
46
47#define SYSLOG_FROM_CALL 0
48#define SYSLOG_FROM_FILE 1
49
50int do_syslog(int type, char __user *buf, int count, bool from_file);
51
52#endif /* _LINUX_SYSLOG_H */
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h
index 3398f4553269..b6523c1427ce 100644
--- a/include/linux/taskstats_kern.h
+++ b/include/linux/taskstats_kern.h
@@ -14,11 +14,6 @@
14extern struct kmem_cache *taskstats_cache; 14extern struct kmem_cache *taskstats_cache;
15extern struct mutex taskstats_exit_mutex; 15extern struct mutex taskstats_exit_mutex;
16 16
17static inline void taskstats_tgid_init(struct signal_struct *sig)
18{
19 sig->stats = NULL;
20}
21
22static inline void taskstats_tgid_free(struct signal_struct *sig) 17static inline void taskstats_tgid_free(struct signal_struct *sig)
23{ 18{
24 if (sig->stats) 19 if (sig->stats)
@@ -30,8 +25,6 @@ extern void taskstats_init_early(void);
30#else 25#else
31static inline void taskstats_exit(struct task_struct *tsk, int group_dead) 26static inline void taskstats_exit(struct task_struct *tsk, int group_dead)
32{} 27{}
33static inline void taskstats_tgid_init(struct signal_struct *sig)
34{}
35static inline void taskstats_tgid_free(struct signal_struct *sig) 28static inline void taskstats_tgid_free(struct signal_struct *sig)
36{} 29{}
37static inline void taskstats_init_early(void) 30static inline void taskstats_init_early(void)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 7fee8a4df931..a778ee024590 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -103,6 +103,8 @@ enum {
103#define TCP_CONGESTION 13 /* Congestion control algorithm */ 103#define TCP_CONGESTION 13 /* Congestion control algorithm */
104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ 104#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ 105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
106 108
107/* for TCP_INFO socket option */ 109/* for TCP_INFO socket option */
108#define TCPI_OPT_TIMESTAMPS 1 110#define TCPI_OPT_TIMESTAMPS 1
@@ -340,7 +342,10 @@ struct tcp_sock {
340 u32 frto_highmark; /* snd_nxt when RTO occurred */ 342 u32 frto_highmark; /* snd_nxt when RTO occurred */
341 u16 advmss; /* Advertised MSS */ 343 u16 advmss; /* Advertised MSS */
342 u8 frto_counter; /* Number of new acks after RTO */ 344 u8 frto_counter; /* Number of new acks after RTO */
343 u8 nonagle; /* Disable Nagle algorithm? */ 345 u8 nonagle : 4,/* Disable Nagle algorithm? */
346 thin_lto : 1,/* Use linear timeouts for thin streams */
347 thin_dupack : 1,/* Fast retransmit on first dupack */
348 unused : 2;
344 349
345/* RTT measurement */ 350/* RTT measurement */
346 u32 srtt; /* smoothed round trip time << 3 */ 351 u32 srtt; /* smoothed round trip time << 3 */
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 94f8faecdcbc..7a082b32d8e1 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -238,9 +238,6 @@ extern int tickadj; /* amount of adjustment per tick */
238 * phase-lock loop variables 238 * phase-lock loop variables
239 */ 239 */
240extern int time_status; /* clock synchronization status bits */ 240extern int time_status; /* clock synchronization status bits */
241extern long time_maxerror; /* maximum error */
242extern long time_esterror; /* estimated error */
243
244extern long time_adjust; /* The amount of adjtime left */ 241extern long time_adjust; /* The amount of adjtime left */
245 242
246extern void ntp_init(void); 243extern void ntp_init(void);
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 57e63579bfdd..5b81156780b1 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -99,7 +99,7 @@ int arch_update_cpu_topology(void);
99 | 1*SD_WAKE_AFFINE \ 99 | 1*SD_WAKE_AFFINE \
100 | 1*SD_SHARE_CPUPOWER \ 100 | 1*SD_SHARE_CPUPOWER \
101 | 0*SD_POWERSAVINGS_BALANCE \ 101 | 0*SD_POWERSAVINGS_BALANCE \
102 | 0*SD_SHARE_PKG_RESOURCES \ 102 | 1*SD_SHARE_PKG_RESOURCES \
103 | 0*SD_SERIALIZE \ 103 | 0*SD_SERIALIZE \
104 | 0*SD_PREFER_SIBLING \ 104 | 0*SD_PREFER_SIBLING \
105 , \ 105 , \
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index f59604ed0ec6..78b4bd3be496 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -49,7 +49,7 @@ struct tracepoint {
49 void **it_func; \ 49 void **it_func; \
50 \ 50 \
51 rcu_read_lock_sched_notrace(); \ 51 rcu_read_lock_sched_notrace(); \
52 it_func = rcu_dereference((tp)->funcs); \ 52 it_func = rcu_dereference_sched((tp)->funcs); \
53 if (it_func) { \ 53 if (it_func) { \
54 do { \ 54 do { \
55 ((void(*)(proto))(*it_func))(args); \ 55 ((void(*)(proto))(*it_func))(args); \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index ef3a2947b102..4409967db0c4 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -68,6 +68,17 @@ struct tty_buffer {
68 unsigned long data[0]; 68 unsigned long data[0];
69}; 69};
70 70
71/*
72 * We default to dicing tty buffer allocations to this many characters
73 * in order to avoid multiple page allocations. We know the size of
74 * tty_buffer itself but it must also be taken into account that the
75 * the buffer is 256 byte aligned. See tty_buffer_find for the allocation
76 * logic this must match
77 */
78
79#define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF)
80
81
71struct tty_bufhead { 82struct tty_bufhead {
72 struct delayed_work work; 83 struct delayed_work work;
73 spinlock_t lock; 84 spinlock_t lock;
@@ -213,6 +224,7 @@ struct tty_port {
213 wait_queue_head_t close_wait; /* Close waiters */ 224 wait_queue_head_t close_wait; /* Close waiters */
214 wait_queue_head_t delta_msr_wait; /* Modem status change */ 225 wait_queue_head_t delta_msr_wait; /* Modem status change */
215 unsigned long flags; /* TTY flags ASY_*/ 226 unsigned long flags; /* TTY flags ASY_*/
227 unsigned char console:1; /* port is a console */
216 struct mutex mutex; /* Locking */ 228 struct mutex mutex; /* Locking */
217 struct mutex buf_mutex; /* Buffer alloc lock */ 229 struct mutex buf_mutex; /* Buffer alloc lock */
218 unsigned char *xmit_buf; /* Optional buffer */ 230 unsigned char *xmit_buf; /* Optional buffer */
@@ -464,7 +476,7 @@ extern int tty_port_alloc_xmit_buf(struct tty_port *port);
464extern void tty_port_free_xmit_buf(struct tty_port *port); 476extern void tty_port_free_xmit_buf(struct tty_port *port);
465extern void tty_port_put(struct tty_port *port); 477extern void tty_port_put(struct tty_port *port);
466 478
467extern inline struct tty_port *tty_port_get(struct tty_port *port) 479static inline struct tty_port *tty_port_get(struct tty_port *port)
468{ 480{
469 if (port) 481 if (port)
470 kref_get(&port->kref); 482 kref_get(&port->kref);
@@ -486,7 +498,7 @@ extern void tty_port_close(struct tty_port *port,
486 struct tty_struct *tty, struct file *filp); 498 struct tty_struct *tty, struct file *filp);
487extern int tty_port_open(struct tty_port *port, 499extern int tty_port_open(struct tty_port *port,
488 struct tty_struct *tty, struct file *filp); 500 struct tty_struct *tty, struct file *filp);
489extern inline int tty_port_users(struct tty_port *port) 501static inline int tty_port_users(struct tty_port *port)
490{ 502{
491 return port->count + port->blocked_open; 503 return port->count + port->blocked_open;
492} 504}
@@ -504,6 +516,7 @@ extern void tty_ldisc_enable(struct tty_struct *tty);
504 516
505/* n_tty.c */ 517/* n_tty.c */
506extern struct tty_ldisc_ops tty_ldisc_N_TTY; 518extern struct tty_ldisc_ops tty_ldisc_N_TTY;
519extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
507 520
508/* tty_audit.c */ 521/* tty_audit.c */
509#ifdef CONFIG_AUDIT 522#ifdef CONFIG_AUDIT
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index eb677cf56106..9239d033a0a3 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -2,8 +2,8 @@
2#define _LINUX_TTY_FLIP_H 2#define _LINUX_TTY_FLIP_H
3 3
4extern int tty_buffer_request_room(struct tty_struct *tty, size_t size); 4extern int tty_buffer_request_room(struct tty_struct *tty, size_t size);
5extern int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size);
6extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); 5extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size);
6extern int tty_insert_flip_string_fixed_flag(struct tty_struct *tty, const unsigned char *chars, char flag, size_t size);
7extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); 7extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size);
8extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); 8extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size);
9void tty_schedule_flip(struct tty_struct *tty); 9void tty_schedule_flip(struct tty_struct *tty);
@@ -20,4 +20,9 @@ static inline int tty_insert_flip_char(struct tty_struct *tty,
20 return tty_insert_flip_string_flags(tty, &ch, &flag, 1); 20 return tty_insert_flip_string_flags(tty, &ch, &flag, 1);
21} 21}
22 22
23static inline int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size)
24{
25 return tty_insert_flip_string_fixed_flag(tty, chars, TTY_NORMAL, size);
26}
27
23#endif /* _LINUX_TTY_FLIP_H */ 28#endif /* _LINUX_TTY_FLIP_H */
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 0c4ee9b88f85..526d66f066a3 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -99,6 +99,12 @@
99 * cease I/O to the tty driver. Can sleep. The driver should 99 * cease I/O to the tty driver. Can sleep. The driver should
100 * seek to perform this action quickly but should wait until 100 * seek to perform this action quickly but should wait until
101 * any pending driver I/O is completed. 101 * any pending driver I/O is completed.
102 *
103 * void (*dcd_change)(struct tty_struct *tty, unsigned int status,
104 * struct timespec *ts)
105 *
106 * Tells the discipline that the DCD pin has changed its status and
107 * the relative timestamp. Pointer ts can be NULL.
102 */ 108 */
103 109
104#include <linux/fs.h> 110#include <linux/fs.h>
@@ -136,6 +142,8 @@ struct tty_ldisc_ops {
136 void (*receive_buf)(struct tty_struct *, const unsigned char *cp, 142 void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
137 char *fp, int count); 143 char *fp, int count);
138 void (*write_wakeup)(struct tty_struct *); 144 void (*write_wakeup)(struct tty_struct *);
145 void (*dcd_change)(struct tty_struct *, unsigned int,
146 struct timespec *);
139 147
140 struct module *owner; 148 struct module *owner;
141 149
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index 6b58367d145e..d512d98dfb7d 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -94,6 +94,7 @@ static inline unsigned long __copy_from_user_nocache(void *to,
94 * happens, handle that and return -EFAULT. 94 * happens, handle that and return -EFAULT.
95 */ 95 */
96extern long probe_kernel_read(void *dst, void *src, size_t size); 96extern long probe_kernel_read(void *dst, void *src, size_t size);
97extern long __probe_kernel_read(void *dst, void *src, size_t size);
97 98
98/* 99/*
99 * probe_kernel_write(): safely attempt to write to a location 100 * probe_kernel_write(): safely attempt to write to a location
@@ -104,6 +105,7 @@ extern long probe_kernel_read(void *dst, void *src, size_t size);
104 * Safely write to address @dst from the buffer at @src. If a kernel fault 105 * Safely write to address @dst from the buffer at @src. If a kernel fault
105 * happens, handle that and return -EFAULT. 106 * happens, handle that and return -EFAULT.
106 */ 107 */
107extern long probe_kernel_write(void *dst, void *src, size_t size); 108extern long notrace probe_kernel_write(void *dst, void *src, size_t size);
109extern long notrace __probe_kernel_write(void *dst, void *src, size_t size);
108 110
109#endif /* __LINUX_UACCESS_H__ */ 111#endif /* __LINUX_UACCESS_H__ */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index e101a2d04d75..ce1323c4e47c 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -122,7 +122,6 @@ enum usb_interface_condition {
122 * number from the USB core by calling usb_register_dev(). 122 * number from the USB core by calling usb_register_dev().
123 * @condition: binding state of the interface: not bound, binding 123 * @condition: binding state of the interface: not bound, binding
124 * (in probe()), bound to a driver, or unbinding (in disconnect()) 124 * (in probe()), bound to a driver, or unbinding (in disconnect())
125 * @is_active: flag set when the interface is bound and not suspended.
126 * @sysfs_files_created: sysfs attributes exist 125 * @sysfs_files_created: sysfs attributes exist
127 * @ep_devs_created: endpoint child pseudo-devices exist 126 * @ep_devs_created: endpoint child pseudo-devices exist
128 * @unregistering: flag set when the interface is being unregistered 127 * @unregistering: flag set when the interface is being unregistered
@@ -135,8 +134,7 @@ enum usb_interface_condition {
135 * @dev: driver model's view of this device 134 * @dev: driver model's view of this device
136 * @usb_dev: if an interface is bound to the USB major, this will point 135 * @usb_dev: if an interface is bound to the USB major, this will point
137 * to the sysfs representation for that device. 136 * to the sysfs representation for that device.
138 * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not 137 * @pm_usage_cnt: PM usage counter for this interface
139 * allowed unless the counter is 0.
140 * @reset_ws: Used for scheduling resets from atomic context. 138 * @reset_ws: Used for scheduling resets from atomic context.
141 * @reset_running: set to 1 if the interface is currently running a 139 * @reset_running: set to 1 if the interface is currently running a
142 * queued reset so that usb_cancel_queued_reset() doesn't try to 140 * queued reset so that usb_cancel_queued_reset() doesn't try to
@@ -184,7 +182,6 @@ struct usb_interface {
184 int minor; /* minor number this interface is 182 int minor; /* minor number this interface is
185 * bound to */ 183 * bound to */
186 enum usb_interface_condition condition; /* state of binding */ 184 enum usb_interface_condition condition; /* state of binding */
187 unsigned is_active:1; /* the interface is not suspended */
188 unsigned sysfs_files_created:1; /* the sysfs attributes exist */ 185 unsigned sysfs_files_created:1; /* the sysfs attributes exist */
189 unsigned ep_devs_created:1; /* endpoint "devices" exist */ 186 unsigned ep_devs_created:1; /* endpoint "devices" exist */
190 unsigned unregistering:1; /* unregistration is in progress */ 187 unsigned unregistering:1; /* unregistration is in progress */
@@ -192,6 +189,7 @@ struct usb_interface {
192 unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ 189 unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */
193 unsigned needs_binding:1; /* needs delayed unbind/rebind */ 190 unsigned needs_binding:1; /* needs delayed unbind/rebind */
194 unsigned reset_running:1; 191 unsigned reset_running:1;
192 unsigned resetting_device:1; /* true: bandwidth alloc after reset */
195 193
196 struct device dev; /* interface specific device info */ 194 struct device dev; /* interface specific device info */
197 struct device *usb_dev; 195 struct device *usb_dev;
@@ -338,6 +336,7 @@ struct usb_bus {
338 336
339 struct usb_devmap devmap; /* device address allocation map */ 337 struct usb_devmap devmap; /* device address allocation map */
340 struct usb_device *root_hub; /* Root hub */ 338 struct usb_device *root_hub; /* Root hub */
339 struct usb_bus *hs_companion; /* Companion EHCI bus, if any */
341 struct list_head bus_list; /* list of busses */ 340 struct list_head bus_list; /* list of busses */
342 341
343 int bandwidth_allocated; /* on this bus: how much of the time 342 int bandwidth_allocated; /* on this bus: how much of the time
@@ -399,7 +398,6 @@ struct usb_tt;
399 * @portnum: parent port number (origin 1) 398 * @portnum: parent port number (origin 1)
400 * @level: number of USB hub ancestors 399 * @level: number of USB hub ancestors
401 * @can_submit: URBs may be submitted 400 * @can_submit: URBs may be submitted
402 * @discon_suspended: disconnected while suspended
403 * @persist_enabled: USB_PERSIST enabled for this device 401 * @persist_enabled: USB_PERSIST enabled for this device
404 * @have_langid: whether string_langid is valid 402 * @have_langid: whether string_langid is valid
405 * @authorized: policy has said we can use it; 403 * @authorized: policy has said we can use it;
@@ -419,20 +417,15 @@ struct usb_tt;
419 * @usbfs_dentry: usbfs dentry entry for the device 417 * @usbfs_dentry: usbfs dentry entry for the device
420 * @maxchild: number of ports if hub 418 * @maxchild: number of ports if hub
421 * @children: child devices - USB devices that are attached to this hub 419 * @children: child devices - USB devices that are attached to this hub
422 * @pm_usage_cnt: usage counter for autosuspend
423 * @quirks: quirks of the whole device 420 * @quirks: quirks of the whole device
424 * @urbnum: number of URBs submitted for the whole device 421 * @urbnum: number of URBs submitted for the whole device
425 * @active_duration: total time device is not suspended 422 * @active_duration: total time device is not suspended
426 * @autosuspend: for delayed autosuspends
427 * @autoresume: for autoresumes requested while in_interrupt
428 * @pm_mutex: protects PM operations
429 * @last_busy: time of last use 423 * @last_busy: time of last use
430 * @autosuspend_delay: in jiffies 424 * @autosuspend_delay: in jiffies
431 * @connect_time: time device was first connected 425 * @connect_time: time device was first connected
432 * @do_remote_wakeup: remote wakeup should be enabled 426 * @do_remote_wakeup: remote wakeup should be enabled
433 * @reset_resume: needs reset instead of resume 427 * @reset_resume: needs reset instead of resume
434 * @autosuspend_disabled: autosuspend disabled by the user 428 * @autosuspend_disabled: autosuspend disabled by the user
435 * @skip_sys_resume: skip the next system resume
436 * @wusb_dev: if this is a Wireless USB device, link to the WUSB 429 * @wusb_dev: if this is a Wireless USB device, link to the WUSB
437 * specific data for the device. 430 * specific data for the device.
438 * @slot_id: Slot ID assigned by xHCI 431 * @slot_id: Slot ID assigned by xHCI
@@ -473,7 +466,6 @@ struct usb_device {
473 u8 level; 466 u8 level;
474 467
475 unsigned can_submit:1; 468 unsigned can_submit:1;
476 unsigned discon_suspended:1;
477 unsigned persist_enabled:1; 469 unsigned persist_enabled:1;
478 unsigned have_langid:1; 470 unsigned have_langid:1;
479 unsigned authorized:1; 471 unsigned authorized:1;
@@ -497,17 +489,12 @@ struct usb_device {
497 int maxchild; 489 int maxchild;
498 struct usb_device *children[USB_MAXCHILDREN]; 490 struct usb_device *children[USB_MAXCHILDREN];
499 491
500 int pm_usage_cnt;
501 u32 quirks; 492 u32 quirks;
502 atomic_t urbnum; 493 atomic_t urbnum;
503 494
504 unsigned long active_duration; 495 unsigned long active_duration;
505 496
506#ifdef CONFIG_PM 497#ifdef CONFIG_PM
507 struct delayed_work autosuspend;
508 struct work_struct autoresume;
509 struct mutex pm_mutex;
510
511 unsigned long last_busy; 498 unsigned long last_busy;
512 int autosuspend_delay; 499 int autosuspend_delay;
513 unsigned long connect_time; 500 unsigned long connect_time;
@@ -515,7 +502,6 @@ struct usb_device {
515 unsigned do_remote_wakeup:1; 502 unsigned do_remote_wakeup:1;
516 unsigned reset_resume:1; 503 unsigned reset_resume:1;
517 unsigned autosuspend_disabled:1; 504 unsigned autosuspend_disabled:1;
518 unsigned skip_sys_resume:1;
519#endif 505#endif
520 struct wusb_dev *wusb_dev; 506 struct wusb_dev *wusb_dev;
521 int slot_id; 507 int slot_id;
@@ -526,9 +512,9 @@ extern struct usb_device *usb_get_dev(struct usb_device *dev);
526extern void usb_put_dev(struct usb_device *dev); 512extern void usb_put_dev(struct usb_device *dev);
527 513
528/* USB device locking */ 514/* USB device locking */
529#define usb_lock_device(udev) down(&(udev)->dev.sem) 515#define usb_lock_device(udev) device_lock(&(udev)->dev)
530#define usb_unlock_device(udev) up(&(udev)->dev.sem) 516#define usb_unlock_device(udev) device_unlock(&(udev)->dev)
531#define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem) 517#define usb_trylock_device(udev) device_trylock(&(udev)->dev)
532extern int usb_lock_device_for_reset(struct usb_device *udev, 518extern int usb_lock_device_for_reset(struct usb_device *udev,
533 const struct usb_interface *iface); 519 const struct usb_interface *iface);
534 520
@@ -540,21 +526,15 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
540 526
541/* USB autosuspend and autoresume */ 527/* USB autosuspend and autoresume */
542#ifdef CONFIG_USB_SUSPEND 528#ifdef CONFIG_USB_SUSPEND
529extern int usb_enable_autosuspend(struct usb_device *udev);
530extern int usb_disable_autosuspend(struct usb_device *udev);
531
543extern int usb_autopm_get_interface(struct usb_interface *intf); 532extern int usb_autopm_get_interface(struct usb_interface *intf);
544extern void usb_autopm_put_interface(struct usb_interface *intf); 533extern void usb_autopm_put_interface(struct usb_interface *intf);
545extern int usb_autopm_get_interface_async(struct usb_interface *intf); 534extern int usb_autopm_get_interface_async(struct usb_interface *intf);
546extern void usb_autopm_put_interface_async(struct usb_interface *intf); 535extern void usb_autopm_put_interface_async(struct usb_interface *intf);
547 536extern void usb_autopm_get_interface_no_resume(struct usb_interface *intf);
548static inline void usb_autopm_get_interface_no_resume( 537extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf);
549 struct usb_interface *intf)
550{
551 atomic_inc(&intf->pm_usage_cnt);
552}
553static inline void usb_autopm_put_interface_no_suspend(
554 struct usb_interface *intf)
555{
556 atomic_dec(&intf->pm_usage_cnt);
557}
558 538
559static inline void usb_mark_last_busy(struct usb_device *udev) 539static inline void usb_mark_last_busy(struct usb_device *udev)
560{ 540{
@@ -563,6 +543,11 @@ static inline void usb_mark_last_busy(struct usb_device *udev)
563 543
564#else 544#else
565 545
546static inline int usb_enable_autosuspend(struct usb_device *udev)
547{ return 0; }
548static inline int usb_disable_autosuspend(struct usb_device *udev)
549{ return 0; }
550
566static inline int usb_autopm_get_interface(struct usb_interface *intf) 551static inline int usb_autopm_get_interface(struct usb_interface *intf)
567{ return 0; } 552{ return 0; }
568static inline int usb_autopm_get_interface_async(struct usb_interface *intf) 553static inline int usb_autopm_get_interface_async(struct usb_interface *intf)
@@ -1070,7 +1055,8 @@ typedef void (*usb_complete_t)(struct urb *);
1070 * @number_of_packets: Lists the number of ISO transfer buffers. 1055 * @number_of_packets: Lists the number of ISO transfer buffers.
1071 * @interval: Specifies the polling interval for interrupt or isochronous 1056 * @interval: Specifies the polling interval for interrupt or isochronous
1072 * transfers. The units are frames (milliseconds) for full and low 1057 * transfers. The units are frames (milliseconds) for full and low
1073 * speed devices, and microframes (1/8 millisecond) for highspeed ones. 1058 * speed devices, and microframes (1/8 millisecond) for highspeed
1059 * and SuperSpeed devices.
1074 * @error_count: Returns the number of ISO transfers that reported errors. 1060 * @error_count: Returns the number of ISO transfers that reported errors.
1075 * @context: For use in completion functions. This normally points to 1061 * @context: For use in completion functions. This normally points to
1076 * request-specific driver context. 1062 * request-specific driver context.
@@ -1301,9 +1287,16 @@ static inline void usb_fill_bulk_urb(struct urb *urb,
1301 * 1287 *
1302 * Initializes a interrupt urb with the proper information needed to submit 1288 * Initializes a interrupt urb with the proper information needed to submit
1303 * it to a device. 1289 * it to a device.
1304 * Note that high speed interrupt endpoints use a logarithmic encoding of 1290 *
1305 * the endpoint interval, and express polling intervals in microframes 1291 * Note that High Speed and SuperSpeed interrupt endpoints use a logarithmic
1306 * (eight per millisecond) rather than in frames (one per millisecond). 1292 * encoding of the endpoint interval, and express polling intervals in
1293 * microframes (eight per millisecond) rather than in frames (one per
1294 * millisecond).
1295 *
1296 * Wireless USB also uses the logarithmic encoding, but specifies it in units of
1297 * 128us instead of 125us. For Wireless USB devices, the interval is passed
1298 * through to the host controller, rather than being translated into microframe
1299 * units.
1307 */ 1300 */
1308static inline void usb_fill_int_urb(struct urb *urb, 1301static inline void usb_fill_int_urb(struct urb *urb,
1309 struct usb_device *dev, 1302 struct usb_device *dev,
@@ -1320,7 +1313,7 @@ static inline void usb_fill_int_urb(struct urb *urb,
1320 urb->transfer_buffer_length = buffer_length; 1313 urb->transfer_buffer_length = buffer_length;
1321 urb->complete = complete_fn; 1314 urb->complete = complete_fn;
1322 urb->context = context; 1315 urb->context = context;
1323 if (dev->speed == USB_SPEED_HIGH) 1316 if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER)
1324 urb->interval = 1 << (interval - 1); 1317 urb->interval = 1 << (interval - 1);
1325 else 1318 else
1326 urb->interval = interval; 1319 urb->interval = interval;
@@ -1581,14 +1574,18 @@ extern void usb_register_notify(struct notifier_block *nb);
1581extern void usb_unregister_notify(struct notifier_block *nb); 1574extern void usb_unregister_notify(struct notifier_block *nb);
1582 1575
1583#ifdef DEBUG 1576#ifdef DEBUG
1584#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ 1577#define dbg(format, arg...) \
1585 __FILE__ , ## arg) 1578 printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg)
1586#else 1579#else
1587#define dbg(format, arg...) do {} while (0) 1580#define dbg(format, arg...) \
1581do { \
1582 if (0) \
1583 printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \
1584} while (0)
1588#endif 1585#endif
1589 1586
1590#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ 1587#define err(format, arg...) \
1591 format "\n" , ## arg) 1588 printk(KERN_ERR KBUILD_MODNAME ": " format "\n", ##arg)
1592 1589
1593/* debugfs stuff */ 1590/* debugfs stuff */
1594extern struct dentry *usb_debug_root; 1591extern struct dentry *usb_debug_root;
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild
index 54c446309a2a..29fd73b0bffc 100644
--- a/include/linux/usb/Kbuild
+++ b/include/linux/usb/Kbuild
@@ -5,4 +5,3 @@ header-y += gadgetfs.h
5header-y += midi.h 5header-y += midi.h
6header-y += g_printer.h 6header-y += g_printer.h
7header-y += tmc.h 7header-y += tmc.h
8header-y += vstusb.h
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
index 6311fa2d9f82..baf41c8616e9 100644
--- a/include/linux/usb/atmel_usba_udc.h
+++ b/include/linux/usb/atmel_usba_udc.h
@@ -15,6 +15,7 @@ struct usba_ep_data {
15 15
16struct usba_platform_data { 16struct usba_platform_data {
17 int vbus_pin; 17 int vbus_pin;
18 int vbus_pin_inverted;
18 int num_ep; 19 int num_ep;
19 struct usba_ep_data ep[0]; 20 struct usba_ep_data ep[0];
20}; 21};
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
index eaf9dffe0a01..4d3e450e2b03 100644
--- a/include/linux/usb/audio.h
+++ b/include/linux/usb/audio.h
@@ -25,6 +25,9 @@
25#define USB_SUBCLASS_AUDIOSTREAMING 0x02 25#define USB_SUBCLASS_AUDIOSTREAMING 0x02
26#define USB_SUBCLASS_MIDISTREAMING 0x03 26#define USB_SUBCLASS_MIDISTREAMING 0x03
27 27
28#define UAC_VERSION_1 0x00
29#define UAC_VERSION_2 0x20
30
28/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ 31/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
29#define UAC_HEADER 0x01 32#define UAC_HEADER 0x01
30#define UAC_INPUT_TERMINAL 0x02 33#define UAC_INPUT_TERMINAL 0x02
@@ -32,8 +35,17 @@
32#define UAC_MIXER_UNIT 0x04 35#define UAC_MIXER_UNIT 0x04
33#define UAC_SELECTOR_UNIT 0x05 36#define UAC_SELECTOR_UNIT 0x05
34#define UAC_FEATURE_UNIT 0x06 37#define UAC_FEATURE_UNIT 0x06
35#define UAC_PROCESSING_UNIT 0x07 38#define UAC_PROCESSING_UNIT_V1 0x07
36#define UAC_EXTENSION_UNIT 0x08 39#define UAC_EXTENSION_UNIT_V1 0x08
40
41/* UAC v2.0 types */
42#define UAC_EFFECT_UNIT 0x07
43#define UAC_PROCESSING_UNIT_V2 0x08
44#define UAC_EXTENSION_UNIT_V2 0x09
45#define UAC_CLOCK_SOURCE 0x0a
46#define UAC_CLOCK_SELECTOR 0x0b
47#define UAC_CLOCK_MULTIPLIER 0x0c
48#define UAC_SAMPLE_RATE_CONVERTER 0x0d
37 49
38/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ 50/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
39#define UAC_AS_GENERAL 0x01 51#define UAC_AS_GENERAL 0x01
@@ -66,6 +78,10 @@
66 78
67#define UAC_GET_STAT 0xff 79#define UAC_GET_STAT 0xff
68 80
81/* Audio class v2.0 handles all the parameter calls differently */
82#define UAC2_CS_CUR 0x01
83#define UAC2_CS_RANGE 0x02
84
69/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ 85/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
70#define UAC_MS_HEADER 0x01 86#define UAC_MS_HEADER 0x01
71#define UAC_MIDI_IN_JACK 0x02 87#define UAC_MIDI_IN_JACK 0x02
@@ -81,7 +97,7 @@
81 97
82/* Terminal Control Selectors */ 98/* Terminal Control Selectors */
83/* 4.3.2 Class-Specific AC Interface Descriptor */ 99/* 4.3.2 Class-Specific AC Interface Descriptor */
84struct uac_ac_header_descriptor { 100struct uac_ac_header_descriptor_v1 {
85 __u8 bLength; /* 8 + n */ 101 __u8 bLength; /* 8 + n */
86 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 102 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
87 __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ 103 __u8 bDescriptorSubtype; /* UAC_MS_HEADER */
@@ -95,7 +111,7 @@ struct uac_ac_header_descriptor {
95 111
96/* As above, but more useful for defining your own descriptors: */ 112/* As above, but more useful for defining your own descriptors: */
97#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ 113#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \
98struct uac_ac_header_descriptor_##n { \ 114struct uac_ac_header_descriptor_v1_##n { \
99 __u8 bLength; \ 115 __u8 bLength; \
100 __u8 bDescriptorType; \ 116 __u8 bDescriptorType; \
101 __u8 bDescriptorSubtype; \ 117 __u8 bDescriptorSubtype; \
@@ -130,8 +146,12 @@ struct uac_input_terminal_descriptor {
130#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 146#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205
131#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 147#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206
132 148
149/* Terminals - control selectors */
150
151#define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01
152
133/* 4.3.2.2 Output Terminal Descriptor */ 153/* 4.3.2.2 Output Terminal Descriptor */
134struct uac_output_terminal_descriptor { 154struct uac_output_terminal_descriptor_v1 {
135 __u8 bLength; /* in bytes: 9 */ 155 __u8 bLength; /* in bytes: 9 */
136 __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ 156 __u8 bDescriptorType; /* CS_INTERFACE descriptor type */
137 __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ 157 __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */
@@ -171,7 +191,7 @@ struct uac_feature_unit_descriptor_##ch { \
171} __attribute__ ((packed)) 191} __attribute__ ((packed))
172 192
173/* 4.5.2 Class-Specific AS Interface Descriptor */ 193/* 4.5.2 Class-Specific AS Interface Descriptor */
174struct uac_as_header_descriptor { 194struct uac_as_header_descriptor_v1 {
175 __u8 bLength; /* in bytes: 7 */ 195 __u8 bLength; /* in bytes: 7 */
176 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 196 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
177 __u8 bDescriptorSubtype; /* AS_GENERAL */ 197 __u8 bDescriptorSubtype; /* AS_GENERAL */
@@ -180,6 +200,19 @@ struct uac_as_header_descriptor {
180 __le16 wFormatTag; /* The Audio Data Format */ 200 __le16 wFormatTag; /* The Audio Data Format */
181} __attribute__ ((packed)); 201} __attribute__ ((packed));
182 202
203struct uac_as_header_descriptor_v2 {
204 __u8 bLength;
205 __u8 bDescriptorType;
206 __u8 bDescriptorSubtype;
207 __u8 bTerminalLink;
208 __u8 bmControls;
209 __u8 bFormatType;
210 __u32 bmFormats;
211 __u8 bNrChannels;
212 __u32 bmChannelConfig;
213 __u8 iChannelNames;
214} __attribute__((packed));
215
183#define UAC_DT_AS_HEADER_SIZE 7 216#define UAC_DT_AS_HEADER_SIZE 7
184 217
185/* Formats - A.1.1 Audio Data Format Type I Codes */ 218/* Formats - A.1.1 Audio Data Format Type I Codes */
@@ -232,11 +265,62 @@ struct uac_format_type_i_discrete_descriptor_##n { \
232 265
233#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) 266#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3))
234 267
268struct uac_format_type_i_ext_descriptor {
269 __u8 bLength;
270 __u8 bDescriptorType;
271 __u8 bDescriptorSubtype;
272 __u8 bFormatType;
273 __u8 bSubslotSize;
274 __u8 bBitResolution;
275 __u8 bHeaderLength;
276 __u8 bControlSize;
277 __u8 bSideBandProtocol;
278} __attribute__((packed));
279
280
281/* Formats - Audio Data Format Type I Codes */
282
283#define UAC_FORMAT_TYPE_II_MPEG 0x1001
284#define UAC_FORMAT_TYPE_II_AC3 0x1002
285
286struct uac_format_type_ii_discrete_descriptor {
287 __u8 bLength;
288 __u8 bDescriptorType;
289 __u8 bDescriptorSubtype;
290 __u8 bFormatType;
291 __le16 wMaxBitRate;
292 __le16 wSamplesPerFrame;
293 __u8 bSamFreqType;
294 __u8 tSamFreq[][3];
295} __attribute__((packed));
296
297struct uac_format_type_ii_ext_descriptor {
298 __u8 bLength;
299 __u8 bDescriptorType;
300 __u8 bDescriptorSubtype;
301 __u8 bFormatType;
302 __u16 wMaxBitRate;
303 __u16 wSamplesPerFrame;
304 __u8 bHeaderLength;
305 __u8 bSideBandProtocol;
306} __attribute__((packed));
307
308/* type III */
309#define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001
310#define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002
311#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003
312#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004
313#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005
314#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006
315
235/* Formats - A.2 Format Type Codes */ 316/* Formats - A.2 Format Type Codes */
236#define UAC_FORMAT_TYPE_UNDEFINED 0x0 317#define UAC_FORMAT_TYPE_UNDEFINED 0x0
237#define UAC_FORMAT_TYPE_I 0x1 318#define UAC_FORMAT_TYPE_I 0x1
238#define UAC_FORMAT_TYPE_II 0x2 319#define UAC_FORMAT_TYPE_II 0x2
239#define UAC_FORMAT_TYPE_III 0x3 320#define UAC_FORMAT_TYPE_III 0x3
321#define UAC_EXT_FORMAT_TYPE_I 0x81
322#define UAC_EXT_FORMAT_TYPE_II 0x82
323#define UAC_EXT_FORMAT_TYPE_III 0x83
240 324
241struct uac_iso_endpoint_descriptor { 325struct uac_iso_endpoint_descriptor {
242 __u8 bLength; /* in bytes: 7 */ 326 __u8 bLength; /* in bytes: 7 */
@@ -252,7 +336,31 @@ struct uac_iso_endpoint_descriptor {
252#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 336#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
253#define UAC_EP_CS_ATTR_FILL_MAX 0x80 337#define UAC_EP_CS_ATTR_FILL_MAX 0x80
254 338
339/* Audio class v2.0: CLOCK_SOURCE descriptor */
340
341struct uac_clock_source_descriptor {
342 __u8 bLength;
343 __u8 bDescriptorType;
344 __u8 bDescriptorSubtype;
345 __u8 bClockID;
346 __u8 bmAttributes;
347 __u8 bmControls;
348 __u8 bAssocTerminal;
349 __u8 iClockSource;
350} __attribute__((packed));
351
255/* A.10.2 Feature Unit Control Selectors */ 352/* A.10.2 Feature Unit Control Selectors */
353
354struct uac_feature_unit_descriptor {
355 __u8 bLength;
356 __u8 bDescriptorType;
357 __u8 bDescriptorSubtype;
358 __u8 bUnitID;
359 __u8 bSourceID;
360 __u8 bControlSize;
361 __u8 controls[0]; /* variable length */
362} __attribute__((packed));
363
256#define UAC_FU_CONTROL_UNDEFINED 0x00 364#define UAC_FU_CONTROL_UNDEFINED 0x00
257#define UAC_MUTE_CONTROL 0x01 365#define UAC_MUTE_CONTROL 0x01
258#define UAC_VOLUME_CONTROL 0x02 366#define UAC_VOLUME_CONTROL 0x02
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 94012e649d86..e58369ff8168 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -775,7 +775,7 @@ enum usb_device_speed {
775 USB_SPEED_UNKNOWN = 0, /* enumerating */ 775 USB_SPEED_UNKNOWN = 0, /* enumerating */
776 USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ 776 USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */
777 USB_SPEED_HIGH, /* usb 2.0 */ 777 USB_SPEED_HIGH, /* usb 2.0 */
778 USB_SPEED_VARIABLE, /* wireless (usb 2.5) */ 778 USB_SPEED_WIRELESS, /* wireless (usb 2.5) */
779 USB_SPEED_SUPER, /* usb 3.0 */ 779 USB_SPEED_SUPER, /* usb 3.0 */
780}; 780};
781 781
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index d43755669261..7acef0234c0e 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -30,26 +30,26 @@ struct musb_hdrc_eps_bits {
30struct musb_hdrc_config { 30struct musb_hdrc_config {
31 /* MUSB configuration-specific details */ 31 /* MUSB configuration-specific details */
32 unsigned multipoint:1; /* multipoint device */ 32 unsigned multipoint:1; /* multipoint device */
33 unsigned dyn_fifo:1; /* supports dynamic fifo sizing */ 33 unsigned dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */
34 unsigned soft_con:1; /* soft connect required */ 34 unsigned soft_con:1 __deprecated; /* soft connect required */
35 unsigned utm_16:1; /* utm data witdh is 16 bits */ 35 unsigned utm_16:1 __deprecated; /* utm data witdh is 16 bits */
36 unsigned big_endian:1; /* true if CPU uses big-endian */ 36 unsigned big_endian:1; /* true if CPU uses big-endian */
37 unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */ 37 unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */
38 unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */ 38 unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */
39 unsigned high_iso_tx:1; /* Tx ep required for HB iso */ 39 unsigned high_iso_tx:1; /* Tx ep required for HB iso */
40 unsigned high_iso_rx:1; /* Rx ep required for HD iso */ 40 unsigned high_iso_rx:1; /* Rx ep required for HD iso */
41 unsigned dma:1; /* supports DMA */ 41 unsigned dma:1 __deprecated; /* supports DMA */
42 unsigned vendor_req:1; /* vendor registers required */ 42 unsigned vendor_req:1 __deprecated; /* vendor registers required */
43 43
44 u8 num_eps; /* number of endpoints _with_ ep0 */ 44 u8 num_eps; /* number of endpoints _with_ ep0 */
45 u8 dma_channels; /* number of dma channels */ 45 u8 dma_channels __deprecated; /* number of dma channels */
46 u8 dyn_fifo_size; /* dynamic size in bytes */ 46 u8 dyn_fifo_size; /* dynamic size in bytes */
47 u8 vendor_ctrl; /* vendor control reg width */ 47 u8 vendor_ctrl __deprecated; /* vendor control reg width */
48 u8 vendor_stat; /* vendor status reg witdh */ 48 u8 vendor_stat __deprecated; /* vendor status reg witdh */
49 u8 dma_req_chan; /* bitmask for required dma channels */ 49 u8 dma_req_chan __deprecated; /* bitmask for required dma channels */
50 u8 ram_bits; /* ram address size */ 50 u8 ram_bits; /* ram address size */
51 51
52 struct musb_hdrc_eps_bits *eps_bits; 52 struct musb_hdrc_eps_bits *eps_bits __deprecated;
53#ifdef CONFIG_BLACKFIN 53#ifdef CONFIG_BLACKFIN
54 /* A GPIO controlling VRSEL in Blackfin */ 54 /* A GPIO controlling VRSEL in Blackfin */
55 unsigned int gpio_vrsel; 55 unsigned int gpio_vrsel;
@@ -76,6 +76,9 @@ struct musb_hdrc_platform_data {
76 /* (HOST or OTG) msec/2 after VBUS on till power good */ 76 /* (HOST or OTG) msec/2 after VBUS on till power good */
77 u8 potpgt; 77 u8 potpgt;
78 78
79 /* (HOST or OTG) program PHY for external Vbus */
80 unsigned extvbus:1;
81
79 /* Power the device on or off */ 82 /* Power the device on or off */
80 int (*set_power)(int state); 83 int (*set_power)(int state);
81 84
@@ -84,6 +87,9 @@ struct musb_hdrc_platform_data {
84 87
85 /* MUSB configuration-specific details */ 88 /* MUSB configuration-specific details */
86 struct musb_hdrc_config *config; 89 struct musb_hdrc_config *config;
90
91 /* Architecture specific board data */
92 void *board_data;
87}; 93};
88 94
89 95
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 52bb917641f0..f8302d036a76 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -9,6 +9,8 @@
9#ifndef __LINUX_USB_OTG_H 9#ifndef __LINUX_USB_OTG_H
10#define __LINUX_USB_OTG_H 10#define __LINUX_USB_OTG_H
11 11
12#include <linux/notifier.h>
13
12/* OTG defines lots of enumeration states before device reset */ 14/* OTG defines lots of enumeration states before device reset */
13enum usb_otg_state { 15enum usb_otg_state {
14 OTG_STATE_UNDEFINED = 0, 16 OTG_STATE_UNDEFINED = 0,
@@ -33,6 +35,14 @@ enum usb_otg_state {
33 OTG_STATE_A_VBUS_ERR, 35 OTG_STATE_A_VBUS_ERR,
34}; 36};
35 37
38enum usb_xceiv_events {
39 USB_EVENT_NONE, /* no events or cable disconnected */
40 USB_EVENT_VBUS, /* vbus valid event */
41 USB_EVENT_ID, /* id was grounded */
42 USB_EVENT_CHARGER, /* usb dedicated charger */
43 USB_EVENT_ENUMERATED, /* gadget driver enumerated */
44};
45
36#define USB_OTG_PULLUP_ID (1 << 0) 46#define USB_OTG_PULLUP_ID (1 << 0)
37#define USB_OTG_PULLDOWN_DP (1 << 1) 47#define USB_OTG_PULLDOWN_DP (1 << 1)
38#define USB_OTG_PULLDOWN_DM (1 << 2) 48#define USB_OTG_PULLDOWN_DM (1 << 2)
@@ -70,6 +80,9 @@ struct otg_transceiver {
70 struct otg_io_access_ops *io_ops; 80 struct otg_io_access_ops *io_ops;
71 void __iomem *io_priv; 81 void __iomem *io_priv;
72 82
83 /* for notification of usb_xceiv_events */
84 struct blocking_notifier_head notifier;
85
73 /* to pass extra port status to the root hub */ 86 /* to pass extra port status to the root hub */
74 u16 port_status; 87 u16 port_status;
75 u16 port_change; 88 u16 port_change;
@@ -110,9 +123,19 @@ struct otg_transceiver {
110/* for board-specific init logic */ 123/* for board-specific init logic */
111extern int otg_set_transceiver(struct otg_transceiver *); 124extern int otg_set_transceiver(struct otg_transceiver *);
112 125
126#if defined(CONFIG_NOP_USB_XCEIV) || defined(CONFIG_NOP_USB_XCEIV_MODULE)
113/* sometimes transceivers are accessed only through e.g. ULPI */ 127/* sometimes transceivers are accessed only through e.g. ULPI */
114extern void usb_nop_xceiv_register(void); 128extern void usb_nop_xceiv_register(void);
115extern void usb_nop_xceiv_unregister(void); 129extern void usb_nop_xceiv_unregister(void);
130#else
131static inline void usb_nop_xceiv_register(void)
132{
133}
134
135static inline void usb_nop_xceiv_unregister(void)
136{
137}
138#endif
116 139
117/* helpers for direct access thru low-level io interface */ 140/* helpers for direct access thru low-level io interface */
118static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) 141static inline int otg_io_read(struct otg_transceiver *otg, u32 reg)
@@ -203,6 +226,18 @@ otg_start_srp(struct otg_transceiver *otg)
203 return otg->start_srp(otg); 226 return otg->start_srp(otg);
204} 227}
205 228
229/* notifiers */
230static inline int
231otg_register_notifier(struct otg_transceiver *otg, struct notifier_block *nb)
232{
233 return blocking_notifier_chain_register(&otg->notifier, nb);
234}
235
236static inline void
237otg_unregister_notifier(struct otg_transceiver *otg, struct notifier_block *nb)
238{
239 blocking_notifier_chain_unregister(&otg->notifier, nb);
240}
206 241
207/* for OTG controller drivers (and maybe other stuff) */ 242/* for OTG controller drivers (and maybe other stuff) */
208extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); 243extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 2526f3bbd273..0a555dd131fc 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -19,4 +19,7 @@
19/* device can't handle its Configuration or Interface strings */ 19/* device can't handle its Configuration or Interface strings */
20#define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008 20#define USB_QUIRK_CONFIG_INTF_STRINGS 0x00000008
21 21
22/*device will morph if reset, don't use reset for handling errors */
23#define USB_QUIRK_RESET_MORPHS 0x00000010
24
22#endif /* __LINUX_USB_QUIRKS_H */ 25#endif /* __LINUX_USB_QUIRKS_H */
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index acf6e457c04b..0a458b861933 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -16,6 +16,7 @@
16#include <linux/kref.h> 16#include <linux/kref.h>
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/sysrq.h> 18#include <linux/sysrq.h>
19#include <linux/kfifo.h>
19 20
20#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ 21#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
21#define SERIAL_TTY_MINORS 254 /* loads of devices :) */ 22#define SERIAL_TTY_MINORS 254 /* loads of devices :) */
@@ -94,7 +95,7 @@ struct usb_serial_port {
94 unsigned char *bulk_out_buffer; 95 unsigned char *bulk_out_buffer;
95 int bulk_out_size; 96 int bulk_out_size;
96 struct urb *write_urb; 97 struct urb *write_urb;
97 struct kfifo *write_fifo; 98 struct kfifo write_fifo;
98 int write_urb_busy; 99 int write_urb_busy;
99 __u8 bulk_out_endpointAddress; 100 __u8 bulk_out_endpointAddress;
100 101
@@ -350,14 +351,11 @@ static inline void usb_serial_debug_data(int debug,
350 351
351/* Use our own dbg macro */ 352/* Use our own dbg macro */
352#undef dbg 353#undef dbg
353#define dbg(format, arg...) \ 354#define dbg(format, arg...) \
354 do { \ 355do { \
355 if (debug) \ 356 if (debug) \
356 printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , \ 357 printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \
357 ## arg); \ 358} while (0)
358 } while (0)
359
360
361 359
362#endif /* __LINUX_USB_SERIAL_H */ 360#endif /* __LINUX_USB_SERIAL_H */
363 361
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 8ce61359bf73..df1e83dd9a54 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -214,25 +214,4 @@ extern void usbnet_set_msglevel (struct net_device *, u32);
214extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); 214extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *);
215extern int usbnet_nway_reset(struct net_device *net); 215extern int usbnet_nway_reset(struct net_device *net);
216 216
217/* messaging support includes the interface name, so it must not be
218 * used before it has one ... notably, in minidriver bind() calls.
219 */
220#ifdef DEBUG
221#define devdbg(usbnet, fmt, arg...) \
222 printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
223#else
224#define devdbg(usbnet, fmt, arg...) \
225 ({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \
226 ## arg); 0; })
227#endif
228
229#define deverr(usbnet, fmt, arg...) \
230 printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
231#define devwarn(usbnet, fmt, arg...) \
232 printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net->name , ## arg)
233
234#define devinfo(usbnet, fmt, arg...) \
235 printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg); \
236
237
238#endif /* __LINUX_USB_USBNET_H */ 217#endif /* __LINUX_USB_USBNET_H */
diff --git a/include/linux/usb/vstusb.h b/include/linux/usb/vstusb.h
deleted file mode 100644
index 1cfac67191ff..000000000000
--- a/include/linux/usb/vstusb.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/*****************************************************************************
2 * File: drivers/usb/misc/vstusb.h
3 *
4 * Purpose: Support for the bulk USB Vernier Spectrophotometers
5 *
6 * Author: EQware Engineering, Inc.
7 * Oregon City, OR, USA 97045
8 *
9 * Copyright: 2007, 2008
10 * Vernier Software & Technology
11 * Beaverton, OR, USA 97005
12 *
13 * Web: www.vernier.com
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18 *
19 *****************************************************************************/
20/*****************************************************************************
21 *
22 * The vstusb module is a standard usb 'client' driver running on top of the
23 * standard usb host controller stack.
24 *
25 * In general, vstusb supports standard bulk usb pipes. It supports multiple
26 * devices and multiple pipes per device.
27 *
28 * The vstusb driver supports two interfaces:
29 * 1 - ioctl SEND_PIPE/RECV_PIPE - a general bulk write/read msg
30 * interface to any pipe with timeout support;
31 * 2 - standard read/write with ioctl config - offers standard read/write
32 * interface with ioctl configured pipes and timeouts.
33 *
34 * Both interfaces can be signal from other process and will abort its i/o
35 * operation.
36 *
37 * A timeout of 0 means NO timeout. The user can still terminate the read via
38 * signal.
39 *
40 * If using multiple threads with this driver, the user should ensure that
41 * any reads, writes, or ioctls are complete before closing the device.
42 * Changing read/write timeouts or pipes takes effect on next read/write.
43 *
44 *****************************************************************************/
45
46struct vstusb_args {
47 union {
48 /* this struct is used for IOCTL_VSTUSB_SEND_PIPE, *
49 * IOCTL_VSTUSB_RECV_PIPE, and read()/write() fops */
50 struct {
51 void __user *buffer;
52 size_t count;
53 unsigned int timeout_ms;
54 int pipe;
55 };
56
57 /* this one is used for IOCTL_VSTUSB_CONFIG_RW */
58 struct {
59 int rd_pipe;
60 int rd_timeout_ms;
61 int wr_pipe;
62 int wr_timeout_ms;
63 };
64 };
65};
66
67#define VST_IOC_MAGIC 'L'
68#define VST_IOC_FIRST 0x20
69#define IOCTL_VSTUSB_SEND_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST)
70#define IOCTL_VSTUSB_RECV_PIPE _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 1)
71#define IOCTL_VSTUSB_CONFIG_RW _IO(VST_IOC_MAGIC, VST_IOC_FIRST + 2)
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h
index 79b9837d9ca0..cf97b5b9d1fe 100644
--- a/include/linux/vermagic.h
+++ b/include/linux/vermagic.h
@@ -1,4 +1,4 @@
1#include <linux/utsrelease.h> 1#include <generated/utsrelease.h>
2#include <linux/module.h> 2#include <linux/module.h>
3 3
4/* Simply sanity version stamp for modules. */ 4/* Simply sanity version stamp for modules. */
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
new file mode 100644
index 000000000000..ae9ab13b963d
--- /dev/null
+++ b/include/linux/vga_switcheroo.h
@@ -0,0 +1,57 @@
1/*
2 * Copyright (c) 2010 Red Hat Inc.
3 * Author : Dave Airlie <airlied@redhat.com>
4 *
5 * Licensed under GPLv2
6 *
7 * vga_switcheroo.h - Support for laptop with dual GPU using one set of outputs
8 */
9
10#include <linux/fb.h>
11
12enum vga_switcheroo_state {
13 VGA_SWITCHEROO_OFF,
14 VGA_SWITCHEROO_ON,
15};
16
17enum vga_switcheroo_client_id {
18 VGA_SWITCHEROO_IGD,
19 VGA_SWITCHEROO_DIS,
20 VGA_SWITCHEROO_MAX_CLIENTS,
21};
22
23struct vga_switcheroo_handler {
24 int (*switchto)(enum vga_switcheroo_client_id id);
25 int (*power_state)(enum vga_switcheroo_client_id id,
26 enum vga_switcheroo_state state);
27 int (*init)(void);
28 int (*get_client_id)(struct pci_dev *pdev);
29};
30
31
32#if defined(CONFIG_VGA_SWITCHEROO)
33void vga_switcheroo_unregister_client(struct pci_dev *dev);
34int vga_switcheroo_register_client(struct pci_dev *dev,
35 void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state),
36 bool (*can_switch)(struct pci_dev *dev));
37
38void vga_switcheroo_client_fb_set(struct pci_dev *dev,
39 struct fb_info *info);
40
41int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler);
42void vga_switcheroo_unregister_handler(void);
43
44int vga_switcheroo_process_delayed_switch(void);
45
46#else
47
48static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {}
49static inline int vga_switcheroo_register_client(struct pci_dev *dev,
50 void (*set_gpu_state)(struct pci_dev *dev, enum vga_switcheroo_state),
51 bool (*can_switch)(struct pci_dev *dev)) { return 0; }
52static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_info *info) {}
53static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; }
54static inline void vga_switcheroo_unregister_handler(void) {}
55static inline int vga_switcheroo_process_delayed_switch(void) { return 0; }
56
57#endif
diff --git a/include/linux/vhost.h b/include/linux/vhost.h
new file mode 100644
index 000000000000..e847f1e30756
--- /dev/null
+++ b/include/linux/vhost.h
@@ -0,0 +1,130 @@
1#ifndef _LINUX_VHOST_H
2#define _LINUX_VHOST_H
3/* Userspace interface for in-kernel virtio accelerators. */
4
5/* vhost is used to reduce the number of system calls involved in virtio.
6 *
7 * Existing virtio net code is used in the guest without modification.
8 *
9 * This header includes interface used by userspace hypervisor for
10 * device configuration.
11 */
12
13#include <linux/types.h>
14#include <linux/compiler.h>
15#include <linux/ioctl.h>
16#include <linux/virtio_config.h>
17#include <linux/virtio_ring.h>
18
19struct vhost_vring_state {
20 unsigned int index;
21 unsigned int num;
22};
23
24struct vhost_vring_file {
25 unsigned int index;
26 int fd; /* Pass -1 to unbind from file. */
27
28};
29
30struct vhost_vring_addr {
31 unsigned int index;
32 /* Option flags. */
33 unsigned int flags;
34 /* Flag values: */
35 /* Whether log address is valid. If set enables logging. */
36#define VHOST_VRING_F_LOG 0
37
38 /* Start of array of descriptors (virtually contiguous) */
39 __u64 desc_user_addr;
40 /* Used structure address. Must be 32 bit aligned */
41 __u64 used_user_addr;
42 /* Available structure address. Must be 16 bit aligned */
43 __u64 avail_user_addr;
44 /* Logging support. */
45 /* Log writes to used structure, at offset calculated from specified
46 * address. Address must be 32 bit aligned. */
47 __u64 log_guest_addr;
48};
49
50struct vhost_memory_region {
51 __u64 guest_phys_addr;
52 __u64 memory_size; /* bytes */
53 __u64 userspace_addr;
54 __u64 flags_padding; /* No flags are currently specified. */
55};
56
57/* All region addresses and sizes must be 4K aligned. */
58#define VHOST_PAGE_SIZE 0x1000
59
60struct vhost_memory {
61 __u32 nregions;
62 __u32 padding;
63 struct vhost_memory_region regions[0];
64};
65
66/* ioctls */
67
68#define VHOST_VIRTIO 0xAF
69
70/* Features bitmask for forward compatibility. Transport bits are used for
71 * vhost specific features. */
72#define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, __u64)
73#define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, __u64)
74
75/* Set current process as the (exclusive) owner of this file descriptor. This
76 * must be called before any other vhost command. Further calls to
77 * VHOST_OWNER_SET fail until VHOST_OWNER_RESET is called. */
78#define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01)
79/* Give up ownership, and reset the device to default values.
80 * Allows subsequent call to VHOST_OWNER_SET to succeed. */
81#define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02)
82
83/* Set up/modify memory layout */
84#define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory)
85
86/* Write logging setup. */
87/* Memory writes can optionally be logged by setting bit at an offset
88 * (calculated from the physical address) from specified log base.
89 * The bit is set using an atomic 32 bit operation. */
90/* Set base address for logging. */
91#define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64)
92/* Specify an eventfd file descriptor to signal on log write. */
93#define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int)
94
95/* Ring setup. */
96/* Set number of descriptors in ring. This parameter can not
97 * be modified while ring is running (bound to a device). */
98#define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, struct vhost_vring_state)
99/* Set addresses for the ring. */
100#define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, struct vhost_vring_addr)
101/* Base value where queue looks for available descriptors */
102#define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
103/* Get accessor: reads index, writes value in num */
104#define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
105
106/* The following ioctls use eventfd file descriptors to signal and poll
107 * for events. */
108
109/* Set eventfd to poll for added buffers */
110#define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, struct vhost_vring_file)
111/* Set eventfd to signal when buffers have beed used */
112#define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, struct vhost_vring_file)
113/* Set eventfd to signal an error */
114#define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, struct vhost_vring_file)
115
116/* VHOST_NET specific defines */
117
118/* Attach virtio net ring to a raw socket, or tap device.
119 * The socket must be already bound to an ethernet device, this device will be
120 * used for transmit. Pass fd -1 to unbind from the socket and the transmit
121 * device. This can be used to stop the ring (e.g. for migration). */
122#define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file)
123
124/* Feature bits */
125/* Log all write descriptors. Can be changed while device is active. */
126#define VHOST_F_LOG_ALL 26
127/* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
128#define VHOST_NET_F_VIRTIO_NET_HDR 27
129
130#endif
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index d4962a782b8a..3793d168b44d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -350,6 +350,7 @@ struct v4l2_pix_format {
350#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ 350#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */
351 351
352/* Vendor-specific formats */ 352/* Vendor-specific formats */
353#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
353#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ 354#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
354#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ 355#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
355#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ 356#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
@@ -362,6 +363,7 @@ struct v4l2_pix_format {
362#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ 363#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
363#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ 364#define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
364#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ 365#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
366#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
365#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ 367#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
366#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ 368#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
367#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ 369#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 057a2e010758..40d1709bdbf4 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -51,6 +51,9 @@ struct virtqueue {
51 * This re-enables callbacks; it returns "false" if there are pending 51 * This re-enables callbacks; it returns "false" if there are pending
52 * buffers in the queue, to detect a possible race between the driver 52 * buffers in the queue, to detect a possible race between the driver
53 * checking for more work, and enabling callbacks. 53 * checking for more work, and enabling callbacks.
54 * @detach_unused_buf: detach first unused buffer
55 * vq: the struct virtqueue we're talking about.
56 * Returns NULL or the "data" token handed to add_buf
54 * 57 *
55 * Locking rules are straightforward: the driver is responsible for 58 * Locking rules are straightforward: the driver is responsible for
56 * locking. No two operations may be invoked simultaneously, with the exception 59 * locking. No two operations may be invoked simultaneously, with the exception
@@ -71,6 +74,7 @@ struct virtqueue_ops {
71 74
72 void (*disable_cb)(struct virtqueue *vq); 75 void (*disable_cb)(struct virtqueue *vq);
73 bool (*enable_cb)(struct virtqueue *vq); 76 bool (*enable_cb)(struct virtqueue *vq);
77 void *(*detach_unused_buf)(struct virtqueue *vq);
74}; 78};
75 79
76/** 80/**
@@ -94,6 +98,7 @@ struct virtio_device {
94 void *priv; 98 void *priv;
95}; 99};
96 100
101#define dev_to_virtio(dev) container_of(dev, struct virtio_device, dev)
97int register_virtio_device(struct virtio_device *dev); 102int register_virtio_device(struct virtio_device *dev);
98void unregister_virtio_device(struct virtio_device *dev); 103void unregister_virtio_device(struct virtio_device *dev);
99 104
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h
index 095e10d148b4..5cf11765146b 100644
--- a/include/linux/virtio_9p.h
+++ b/include/linux/virtio_9p.h
@@ -5,7 +5,16 @@
5#include <linux/virtio_ids.h> 5#include <linux/virtio_ids.h>
6#include <linux/virtio_config.h> 6#include <linux/virtio_config.h>
7 7
8/* Maximum number of virtio channels per partition (1 for now) */ 8/* The feature bitmap for virtio 9P */
9#define MAX_9P_CHAN 1 9
10/* The mount point is specified in a config variable */
11#define VIRTIO_9P_MOUNT_TAG 0
12
13struct virtio_9p_config {
14 /* length of the tag name */
15 __u16 tag_len;
16 /* non-NULL terminated tag name */
17 __u8 tag[0];
18} __attribute__((packed));
10 19
11#endif /* _LINUX_VIRTIO_9P_H */ 20#endif /* _LINUX_VIRTIO_9P_H */
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h
index 1418f048cb34..a50ecd1b81a2 100644
--- a/include/linux/virtio_balloon.h
+++ b/include/linux/virtio_balloon.h
@@ -7,6 +7,7 @@
7 7
8/* The feature bitmap for virtio balloon */ 8/* The feature bitmap for virtio balloon */
9#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ 9#define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */
10#define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */
10 11
11/* Size of a PFN in the balloon interface. */ 12/* Size of a PFN in the balloon interface. */
12#define VIRTIO_BALLOON_PFN_SHIFT 12 13#define VIRTIO_BALLOON_PFN_SHIFT 12
@@ -18,4 +19,18 @@ struct virtio_balloon_config
18 /* Number of pages we've actually got in balloon. */ 19 /* Number of pages we've actually got in balloon. */
19 __le32 actual; 20 __le32 actual;
20}; 21};
22
23#define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */
24#define VIRTIO_BALLOON_S_SWAP_OUT 1 /* Amount of memory swapped out */
25#define VIRTIO_BALLOON_S_MAJFLT 2 /* Number of major faults */
26#define VIRTIO_BALLOON_S_MINFLT 3 /* Number of minor faults */
27#define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */
28#define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */
29#define VIRTIO_BALLOON_S_NR 6
30
31struct virtio_balloon_stat {
32 u16 tag;
33 u64 val;
34} __attribute__((packed));
35
21#endif /* _LINUX_VIRTIO_BALLOON_H */ 36#endif /* _LINUX_VIRTIO_BALLOON_H */
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index fd294c56d571..e52029e98919 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -15,6 +15,7 @@
15#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ 15#define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/
16#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ 16#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */
17#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ 17#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */
18#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */
18 19
19struct virtio_blk_config { 20struct virtio_blk_config {
20 /* The capacity (in 512-byte sectors). */ 21 /* The capacity (in 512-byte sectors). */
@@ -29,8 +30,20 @@ struct virtio_blk_config {
29 __u8 heads; 30 __u8 heads;
30 __u8 sectors; 31 __u8 sectors;
31 } geometry; 32 } geometry;
33
32 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ 34 /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
33 __u32 blk_size; 35 __u32 blk_size;
36
37 /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
38 /* exponent for physical block per logical block. */
39 __u8 physical_block_exp;
40 /* alignment offset in logical blocks. */
41 __u8 alignment_offset;
42 /* minimum I/O size without performance penalty in logical blocks. */
43 __u16 min_io_size;
44 /* optimal sustained I/O size in logical blocks. */
45 __u32 opt_io_size;
46
34} __attribute__((packed)); 47} __attribute__((packed));
35 48
36/* 49/*
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index fe885174cc1f..ae4f039515b4 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -3,19 +3,45 @@
3#include <linux/types.h> 3#include <linux/types.h>
4#include <linux/virtio_ids.h> 4#include <linux/virtio_ids.h>
5#include <linux/virtio_config.h> 5#include <linux/virtio_config.h>
6/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so 6/*
7 * anyone can use the definitions to implement compatible drivers/servers. */ 7 * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
8 * anyone can use the definitions to implement compatible drivers/servers.
9 *
10 * Copyright (C) Red Hat, Inc., 2009, 2010
11 */
8 12
9/* Feature bits */ 13/* Feature bits */
10#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ 14#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
15#define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */
11 16
12struct virtio_console_config { 17struct virtio_console_config {
13 /* colums of the screens */ 18 /* colums of the screens */
14 __u16 cols; 19 __u16 cols;
15 /* rows of the screens */ 20 /* rows of the screens */
16 __u16 rows; 21 __u16 rows;
22 /* max. number of ports this device can hold */
23 __u32 max_nr_ports;
24 /* number of ports added so far */
25 __u32 nr_ports;
17} __attribute__((packed)); 26} __attribute__((packed));
18 27
28/*
29 * A message that's passed between the Host and the Guest for a
30 * particular port.
31 */
32struct virtio_console_control {
33 __u32 id; /* Port number */
34 __u16 event; /* The kind of control event (see below) */
35 __u16 value; /* Extra information for the key */
36};
37
38/* Some events for control messages */
39#define VIRTIO_CONSOLE_PORT_READY 0
40#define VIRTIO_CONSOLE_CONSOLE_PORT 1
41#define VIRTIO_CONSOLE_RESIZE 2
42#define VIRTIO_CONSOLE_PORT_OPEN 3
43#define VIRTIO_CONSOLE_PORT_NAME 4
44#define VIRTIO_CONSOLE_PORT_REMOVE 5
19 45
20#ifdef __KERNEL__ 46#ifdef __KERNEL__
21int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); 47int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index ee03bba9c5df..117f0dd8ad03 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -78,22 +78,22 @@ DECLARE_PER_CPU(struct vm_event_state, vm_event_states);
78 78
79static inline void __count_vm_event(enum vm_event_item item) 79static inline void __count_vm_event(enum vm_event_item item)
80{ 80{
81 __this_cpu_inc(per_cpu_var(vm_event_states).event[item]); 81 __this_cpu_inc(vm_event_states.event[item]);
82} 82}
83 83
84static inline void count_vm_event(enum vm_event_item item) 84static inline void count_vm_event(enum vm_event_item item)
85{ 85{
86 this_cpu_inc(per_cpu_var(vm_event_states).event[item]); 86 this_cpu_inc(vm_event_states.event[item]);
87} 87}
88 88
89static inline void __count_vm_events(enum vm_event_item item, long delta) 89static inline void __count_vm_events(enum vm_event_item item, long delta)
90{ 90{
91 __this_cpu_add(per_cpu_var(vm_event_states).event[item], delta); 91 __this_cpu_add(vm_event_states.event[item], delta);
92} 92}
93 93
94static inline void count_vm_events(enum vm_event_item item, long delta) 94static inline void count_vm_events(enum vm_event_item item, long delta)
95{ 95{
96 this_cpu_add(per_cpu_var(vm_event_states).event[item], delta); 96 this_cpu_add(vm_event_states.event[item], delta);
97} 97}
98 98
99extern void all_vm_events(unsigned long *); 99extern void all_vm_events(unsigned long *);
diff --git a/include/linux/vt.h b/include/linux/vt.h
index 3fb9944e50a6..d5dd0bc408fd 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -84,6 +84,8 @@ struct vt_setactivate {
84 84
85#define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ 85#define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */
86 86
87#ifdef __KERNEL__
88
87#ifdef CONFIG_VT_CONSOLE 89#ifdef CONFIG_VT_CONSOLE
88 90
89extern int vt_kmsg_redirect(int new); 91extern int vt_kmsg_redirect(int new);
@@ -97,6 +99,8 @@ static inline int vt_kmsg_redirect(int new)
97 99
98#endif 100#endif
99 101
102#endif /* __KERNEL__ */
103
100#define vt_get_kmsg_redirect() vt_kmsg_redirect(-1) 104#define vt_get_kmsg_redirect() vt_kmsg_redirect(-1)
101 105
102#endif /* _LINUX_VT_H */ 106#endif /* _LINUX_VT_H */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 705f01fe413a..76e8903cd204 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -70,6 +70,7 @@ struct writeback_control {
70struct bdi_writeback; 70struct bdi_writeback;
71int inode_wait(void *); 71int inode_wait(void *);
72void writeback_inodes_sb(struct super_block *); 72void writeback_inodes_sb(struct super_block *);
73int writeback_inodes_sb_if_idle(struct super_block *);
73void sync_inodes_sb(struct super_block *); 74void sync_inodes_sb(struct super_block *);
74void writeback_inodes_wbc(struct writeback_control *wbc); 75void writeback_inodes_wbc(struct writeback_control *wbc);
75long wb_do_writeback(struct bdi_writeback *wb, int force_wait); 76long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
@@ -79,8 +80,7 @@ void wakeup_flusher_threads(long nr_pages);
79static inline void wait_on_inode(struct inode *inode) 80static inline void wait_on_inode(struct inode *inode)
80{ 81{
81 might_sleep(); 82 might_sleep();
82 wait_on_bit(&inode->i_state, __I_LOCK, inode_wait, 83 wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE);
83 TASK_UNINTERRUPTIBLE);
84} 84}
85static inline void inode_sync_wait(struct inode *inode) 85static inline void inode_sync_wait(struct inode *inode)
86{ 86{
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index 5c84af8c5f6f..fb9b7e6e1e2d 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -38,12 +38,13 @@ struct dentry;
38 38
39struct xattr_handler { 39struct xattr_handler {
40 char *prefix; 40 char *prefix;
41 size_t (*list)(struct inode *inode, char *list, size_t list_size, 41 int flags; /* fs private flags passed back to the handlers */
42 const char *name, size_t name_len); 42 size_t (*list)(struct dentry *dentry, char *list, size_t list_size,
43 int (*get)(struct inode *inode, const char *name, void *buffer, 43 const char *name, size_t name_len, int handler_flags);
44 size_t size); 44 int (*get)(struct dentry *dentry, const char *name, void *buffer,
45 int (*set)(struct inode *inode, const char *name, const void *buffer, 45 size_t size, int handler_flags);
46 size_t size, int flags); 46 int (*set)(struct dentry *dentry, const char *name, const void *buffer,
47 size_t size, int flags, int handler_flags);
47}; 48};
48 49
49ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); 50ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t);
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 29e04beb1fc9..b971e3848493 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -267,8 +267,8 @@ enum xfrm_attr_type_t {
267 XFRMA_ALG_COMP, /* struct xfrm_algo */ 267 XFRMA_ALG_COMP, /* struct xfrm_algo */
268 XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ 268 XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */
269 XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ 269 XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */
270 XFRMA_SA, 270 XFRMA_SA, /* struct xfrm_usersa_info */
271 XFRMA_POLICY, 271 XFRMA_POLICY, /*struct xfrm_userpolicy_info */
272 XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ 272 XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */
273 XFRMA_LTIME_VAL, 273 XFRMA_LTIME_VAL,
274 XFRMA_REPLAY_VAL, 274 XFRMA_REPLAY_VAL,
@@ -276,17 +276,23 @@ enum xfrm_attr_type_t {
276 XFRMA_ETIMER_THRESH, 276 XFRMA_ETIMER_THRESH,
277 XFRMA_SRCADDR, /* xfrm_address_t */ 277 XFRMA_SRCADDR, /* xfrm_address_t */
278 XFRMA_COADDR, /* xfrm_address_t */ 278 XFRMA_COADDR, /* xfrm_address_t */
279 XFRMA_LASTUSED, 279 XFRMA_LASTUSED, /* unsigned long */
280 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ 280 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
281 XFRMA_MIGRATE, 281 XFRMA_MIGRATE,
282 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ 282 XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */
283 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ 283 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */
284 XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ 284 XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */
285 XFRMA_MARK, /* struct xfrm_mark */
285 __XFRMA_MAX 286 __XFRMA_MAX
286 287
287#define XFRMA_MAX (__XFRMA_MAX - 1) 288#define XFRMA_MAX (__XFRMA_MAX - 1)
288}; 289};
289 290
291struct xfrm_mark {
292 __u32 v; /* value */
293 __u32 m; /* mask */
294};
295
290enum xfrm_sadattr_type_t { 296enum xfrm_sadattr_type_t {
291 XFRMA_SAD_UNSPEC, 297 XFRMA_SAD_UNSPEC,
292 XFRMA_SAD_CNT, 298 XFRMA_SAD_CNT,