aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-08 05:47:46 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-08 05:47:46 -0500
commit41966710ab574f1fcedf3e10e1ceef911c096d1d (patch)
treea370f9fb2392267d1e7b06d7c9f43c6d80eb12be /include
parent4633fa48fb41dc6d6f0cd83d7f6b7e262820e7cb (diff)
parent1dd6c0770d7d4ca477a1a8452ab0161b1150e4ad (diff)
Merge branch 'for-3.2' into for-3.3
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_drivers.h2
-rw-r--r--include/acpi/acpiosxf.h2
-rw-r--r--include/acpi/actypes.h1
-rw-r--r--include/acpi/platform/aclinux.h1
-rw-r--r--include/acpi/processor.h1
-rw-r--r--include/asm-generic/bug.h11
-rw-r--r--include/asm-generic/checksum.h4
-rw-r--r--include/asm-generic/cputime.h4
-rw-r--r--include/asm-generic/dma-mapping-common.h14
-rw-r--r--include/asm-generic/fcntl.h5
-rw-r--r--include/asm-generic/gpio.h17
-rw-r--r--include/asm-generic/memory_model.h4
-rw-r--r--include/asm-generic/page.h4
-rw-r--r--include/asm-generic/rwsem.h132
-rw-r--r--include/asm-generic/unistd.h2
-rw-r--r--include/asm-generic/vmlinux.lds.h1
-rw-r--r--include/crypto/algapi.h2
-rw-r--r--include/crypto/blowfish.h23
-rw-r--r--include/crypto/sha.h5
-rw-r--r--include/drm/drmP.h16
-rw-r--r--include/drm/drm_crtc.h9
-rw-r--r--include/drm/drm_dp_helper.h64
-rw-r--r--include/drm/drm_edid.h9
-rw-r--r--include/drm/drm_mode.h12
-rw-r--r--include/drm/exynos_drm.h104
-rw-r--r--include/drm/intel-gtt.h2
-rw-r--r--include/drm/vmwgfx_drm.h367
-rw-r--r--include/linux/aio.h1
-rw-r--r--include/linux/alarmtimer.h51
-rw-r--r--include/linux/amba/pl061.h3
-rw-r--r--include/linux/amba/pl08x.h30
-rw-r--r--include/linux/amba/pl330.h6
-rw-r--r--include/linux/atalk.h3
-rw-r--r--include/linux/atmel-mci.h4
-rw-r--r--include/linux/atmel_pdc.h2
-rw-r--r--include/linux/audit.h11
-rw-r--r--include/linux/ax25.h2
-rw-r--r--include/linux/backing-dev.h14
-rw-r--r--include/linux/basic_mmio_gpio.h15
-rw-r--r--include/linux/bcma/bcma.h16
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h94
-rw-r--r--include/linux/bcma/bcma_driver_mips.h51
-rw-r--r--include/linux/bcma/bcma_soc.h16
-rw-r--r--include/linux/bio.h8
-rw-r--r--include/linux/blk_types.h24
-rw-r--r--include/linux/blkdev.h48
-rw-r--r--include/linux/blktrace_api.h7
-rw-r--r--include/linux/bma150.h46
-rw-r--r--include/linux/bsg-lib.h73
-rw-r--r--include/linux/caif/caif_socket.h7
-rw-r--r--include/linux/can.h4
-rw-r--r--include/linux/can/Kbuild1
-rw-r--r--include/linux/can/bcm.h3
-rw-r--r--include/linux/can/core.h2
-rw-r--r--include/linux/can/dev.h1
-rw-r--r--include/linux/can/error.h2
-rw-r--r--include/linux/can/gw.h162
-rw-r--r--include/linux/can/netlink.h2
-rw-r--r--include/linux/can/raw.h2
-rw-r--r--include/linux/capability.h3
-rw-r--r--include/linux/ceph/libceph.h4
-rw-r--r--include/linux/ceph/messenger.h4
-rw-r--r--include/linux/cgroup.h2
-rw-r--r--include/linux/clk.h43
-rw-r--r--include/linux/clkdev.h7
-rw-r--r--include/linux/clksrc-dbx500-prcmu.h20
-rw-r--r--include/linux/clockchips.h12
-rw-r--r--include/linux/cn_proc.h11
-rw-r--r--include/linux/compaction.h8
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/linux/connector.h2
-rw-r--r--include/linux/cpu.h4
-rw-r--r--include/linux/cpu_pm.h109
-rw-r--r--include/linux/cpuidle.h55
-rw-r--r--include/linux/crash_dump.h1
-rw-r--r--include/linux/cred.h6
-rw-r--r--include/linux/crypto.h11
-rw-r--r--include/linux/cryptouser.h102
-rw-r--r--include/linux/dcache.h8
-rw-r--r--include/linux/devfreq.h238
-rw-r--r--include/linux/device-mapper.h50
-rw-r--r--include/linux/device.h141
-rw-r--r--include/linux/device_cgroup.h1
-rw-r--r--include/linux/dm-ioctl.h4
-rw-r--r--include/linux/dm-kcopyd.h4
-rw-r--r--include/linux/dm-log-userspace.h18
-rw-r--r--include/linux/dma-mapping.h13
-rw-r--r--include/linux/dma_remapping.h10
-rw-r--r--include/linux/dmaengine.h15
-rw-r--r--include/linux/dmar.h45
-rw-r--r--include/linux/drbd_tag_magic.h2
-rw-r--r--include/linux/dvb/frontend.h1
-rw-r--r--include/linux/dvb/version.h2
-rw-r--r--include/linux/dw_apb_timer.h2
-rw-r--r--include/linux/dynamic_debug.h81
-rw-r--r--include/linux/edac.h350
-rw-r--r--include/linux/edac_mce.h31
-rw-r--r--include/linux/elevator.h6
-rw-r--r--include/linux/elf.h1
-rw-r--r--include/linux/ethtool.h182
-rw-r--r--include/linux/evm.h100
-rw-r--r--include/linux/export.h89
-rw-r--r--include/linux/ext2_fs.h4
-rw-r--r--include/linux/ext3_fs.h22
-rw-r--r--include/linux/ext3_fs_sb.h4
-rw-r--r--include/linux/filter.h2
-rw-r--r--include/linux/firmware.h2
-rw-r--r--include/linux/freezer.h21
-rw-r--r--include/linux/fs.h95
-rw-r--r--include/linux/fscache-cache.h8
-rw-r--r--include/linux/fsl-diu-fb.h92
-rw-r--r--include/linux/ftrace.h2
-rw-r--r--include/linux/fuse.h9
-rw-r--r--include/linux/gameport.h25
-rw-r--r--include/linux/genhd.h10
-rw-r--r--include/linux/gpio.h22
-rw-r--r--include/linux/hash.h2
-rw-r--r--include/linux/hid.h12
-rw-r--r--include/linux/huge_mm.h5
-rw-r--r--include/linux/hwspinlock.h46
-rw-r--r--include/linux/hyperv.h873
-rw-r--r--include/linux/i2c-omap.h5
-rw-r--r--include/linux/i2c.h27
-rw-r--r--include/linux/i2c/tsc2007.h2
-rw-r--r--include/linux/i2c/twl4030-madc.h4
-rw-r--r--include/linux/ieee80211.h156
-rw-r--r--include/linux/if.h1
-rw-r--r--include/linux/if_ether.h2
-rw-r--r--include/linux/if_link.h10
-rw-r--r--include/linux/if_macvlan.h1
-rw-r--r--include/linux/if_packet.h119
-rw-r--r--include/linux/if_pppol2tp.h2
-rw-r--r--include/linux/if_pppox.h9
-rw-r--r--include/linux/if_vlan.h6
-rw-r--r--include/linux/ima.h13
-rw-r--r--include/linux/in.h2
-rw-r--r--include/linux/inet_diag.h3
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/input.h4
-rw-r--r--include/linux/input/adp5589.h157
-rw-r--r--include/linux/input/adxl34x.h21
-rw-r--r--include/linux/integrity.h39
-rw-r--r--include/linux/intel-iommu.h10
-rw-r--r--include/linux/interrupt.h41
-rw-r--r--include/linux/io-mapping.h6
-rw-r--r--include/linux/iommu.h76
-rw-r--r--include/linux/ip6_tunnel.h2
-rw-r--r--include/linux/ipmi.h3
-rw-r--r--include/linux/ipmi_smi.h1
-rw-r--r--include/linux/ipx.h2
-rw-r--r--include/linux/irda.h9
-rw-r--r--include/linux/irq.h49
-rw-r--r--include/linux/irq_work.h15
-rw-r--r--include/linux/irqdesc.h3
-rw-r--r--include/linux/irqdomain.h17
-rw-r--r--include/linux/isdn.h2
-rw-r--r--include/linux/jbd.h64
-rw-r--r--include/linux/jbd2.h69
-rw-r--r--include/linux/jbd_common.h68
-rw-r--r--include/linux/jiffies.h2
-rw-r--r--include/linux/jump_label.h23
-rw-r--r--include/linux/kallsyms.h5
-rw-r--r--include/linux/kdb.h9
-rw-r--r--include/linux/kernel.h58
-rw-r--r--include/linux/kexec.h14
-rw-r--r--include/linux/kmod.h4
-rw-r--r--include/linux/kobject.h26
-rw-r--r--include/linux/kprobes.h2
-rw-r--r--include/linux/kthread.h4
-rw-r--r--include/linux/kvm.h7
-rw-r--r--include/linux/kvm_host.h32
-rw-r--r--include/linux/l2tp.h7
-rw-r--r--include/linux/lapb.h3
-rw-r--r--include/linux/libata.h20
-rw-r--r--include/linux/lis3lv02d.h1
-rw-r--r--include/linux/llc.h10
-rw-r--r--include/linux/llist.h77
-rw-r--r--include/linux/lockdep.h2
-rw-r--r--include/linux/loop.h7
-rw-r--r--include/linux/magic.h10
-rw-r--r--include/linux/mdio-bitbang.h3
-rw-r--r--include/linux/memblock.h1
-rw-r--r--include/linux/memcontrol.h66
-rw-r--r--include/linux/mfd/ab5500/ab5500.h140
-rw-r--r--include/linux/mfd/ab8500/gpadc.h5
-rw-r--r--include/linux/mfd/abx500.h54
-rw-r--r--include/linux/mfd/db5500-prcmu.h102
-rw-r--r--include/linux/mfd/db8500-prcmu.h368
-rw-r--r--include/linux/mfd/dbx500-prcmu.h549
-rw-r--r--include/linux/mfd/intel_msic.h456
-rw-r--r--include/linux/mfd/max8997-private.h1
-rw-r--r--include/linux/mfd/mc13783.h111
-rw-r--r--include/linux/mfd/mc13xxx.h38
-rw-r--r--include/linux/mfd/pcf50633/core.h3
-rw-r--r--include/linux/mfd/tps6586x.h16
-rw-r--r--include/linux/mfd/wm831x/core.h13
-rw-r--r--include/linux/mfd/wm831x/pdata.h3
-rw-r--r--include/linux/mfd/wm8400-private.h7
-rw-r--r--include/linux/mfd/wm8994/core.h9
-rw-r--r--include/linux/mfd/wm8994/pdata.h9
-rw-r--r--include/linux/mii.h210
-rw-r--r--include/linux/miscdevice.h4
-rw-r--r--include/linux/mlx4/device.h17
-rw-r--r--include/linux/mlx4/qp.h3
-rw-r--r--include/linux/mm.h88
-rw-r--r--include/linux/mm_types.h60
-rw-r--r--include/linux/mmc/card.h58
-rw-r--r--include/linux/mmc/core.h9
-rw-r--r--include/linux/mmc/dw_mmc.h4
-rw-r--r--include/linux/mmc/host.h31
-rw-r--r--include/linux/mmc/mmc.h38
-rw-r--r--include/linux/mmc/sdhci.h8
-rw-r--r--include/linux/mmc/sdio.h2
-rw-r--r--include/linux/mmc/sh_mmcif.h4
-rw-r--r--include/linux/mmc/sh_mobile_sdhi.h4
-rw-r--r--include/linux/mmiotrace.h8
-rw-r--r--include/linux/mmzone.h13
-rw-r--r--include/linux/mod_devicetable.h9
-rw-r--r--include/linux/module.h85
-rw-r--r--include/linux/moduleparam.h25
-rw-r--r--include/linux/mtd/bbm.h39
-rw-r--r--include/linux/mtd/mtd.h85
-rw-r--r--include/linux/mtd/nand.h92
-rw-r--r--include/linux/mtd/onenand.h4
-rw-r--r--include/linux/mtd/partitions.h46
-rw-r--r--include/linux/mtd/physmap.h17
-rw-r--r--include/linux/namei.h4
-rw-r--r--include/linux/net_tstamp.h13
-rw-r--r--include/linux/netdevice.h64
-rw-r--r--include/linux/netfilter/xt_connlimit.h1
-rw-r--r--include/linux/netfilter/xt_conntrack.h1
-rw-r--r--include/linux/netfilter/xt_iprange.h1
-rw-r--r--include/linux/netfilter_arp/arp_tables.h14
-rw-r--r--include/linux/netfilter_decnet.h3
-rw-r--r--include/linux/netfilter_ipv4.h3
-rw-r--r--include/linux/netfilter_ipv4/Kbuild1
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h20
-rw-r--r--include/linux/netfilter_ipv4/nf_nat.h58
-rw-r--r--include/linux/netfilter_ipv6.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h22
-rw-r--r--include/linux/netlink.h5
-rw-r--r--include/linux/netrom.h2
-rw-r--r--include/linux/nfc.h8
-rw-r--r--include/linux/nfs4.h21
-rw-r--r--include/linux/nfs_fs.h2
-rw-r--r--include/linux/nfs_page.h1
-rw-r--r--include/linux/nfs_xdr.h5
-rw-r--r--include/linux/nfsd/Kbuild2
-rw-r--r--include/linux/nfsd/const.h55
-rw-r--r--include/linux/nfsd/export.h2
-rw-r--r--include/linux/nfsd/nfsfh.h7
-rw-r--r--include/linux/nfsd/syscall.h116
-rw-r--r--include/linux/nl80211.h238
-rw-r--r--include/linux/of.h78
-rw-r--r--include/linux/of_irq.h3
-rw-r--r--include/linux/of_platform.h1
-rw-r--r--include/linux/omap3isp.h2
-rw-r--r--include/linux/oom.h1
-rw-r--r--include/linux/opp.h14
-rw-r--r--include/linux/oprofile.h2
-rw-r--r--include/linux/pci-ats.h75
-rw-r--r--include/linux/pci.h21
-rw-r--r--include/linux/pci_hotplug.h10
-rw-r--r--include/linux/pci_ids.h7
-rw-r--r--include/linux/pci_regs.h20
-rw-r--r--include/linux/percpu_counter.h2
-rw-r--r--include/linux/perf_event.h29
-rw-r--r--include/linux/personality.h1
-rw-r--r--include/linux/phonet.h5
-rw-r--r--include/linux/phy.h2
-rw-r--r--include/linux/pinctrl/machine.h107
-rw-r--r--include/linux/pinctrl/pinctrl.h133
-rw-r--r--include/linux/pinctrl/pinmux.h117
-rw-r--r--include/linux/platform_data/dwc3-omap.h47
-rw-r--r--include/linux/platform_data/exynos4_tmu.h83
-rw-r--r--include/linux/platform_data/leds-renesas-tpu.h14
-rw-r--r--include/linux/platform_data/mv_usb.h50
-rw-r--r--include/linux/platform_data/ntc_thermistor.h2
-rw-r--r--include/linux/platform_device.h65
-rw-r--r--include/linux/pm.h26
-rw-r--r--include/linux/pm_clock.h71
-rw-r--r--include/linux/pm_domain.h36
-rw-r--r--include/linux/pm_qos.h155
-rw-r--r--include/linux/pm_qos_params.h38
-rw-r--r--include/linux/pm_runtime.h43
-rw-r--r--include/linux/posix-timers.h5
-rw-r--r--include/linux/pps-gpio.h32
-rw-r--r--include/linux/printk.h12
-rw-r--r--include/linux/proportions.h6
-rw-r--r--include/linux/pstore.h6
-rw-r--r--include/linux/ptp_classify.h13
-rw-r--r--include/linux/pwm_backlight.h1
-rw-r--r--include/linux/quotaops.h2
-rw-r--r--include/linux/random.h13
-rw-r--r--include/linux/ratelimit.h6
-rw-r--r--include/linux/rcupdate.h300
-rw-r--r--include/linux/rcutiny.h20
-rw-r--r--include/linux/rcutree.h2
-rw-r--r--include/linux/regmap.h31
-rw-r--r--include/linux/regulator/consumer.h2
-rw-r--r--include/linux/regulator/driver.h1
-rw-r--r--include/linux/regulator/gpio-regulator.h87
-rw-r--r--include/linux/regulator/machine.h2
-rw-r--r--include/linux/rfkill-gpio.h4
-rw-r--r--include/linux/ring_buffer.h2
-rw-r--r--include/linux/rio_ids.h1
-rw-r--r--include/linux/rio_regs.h18
-rw-r--r--include/linux/rose.h7
-rw-r--r--include/linux/rtc.h3
-rw-r--r--include/linux/rtc/sirfsoc_rtciobrg.h18
-rw-r--r--include/linux/rwsem-spinlock.h2
-rw-r--r--include/linux/rwsem.h10
-rw-r--r--include/linux/sched.h27
-rw-r--r--include/linux/security.h32
-rw-r--r--include/linux/sem.h49
-rw-r--r--include/linux/semaphore.h4
-rw-r--r--include/linux/seq_file.h3
-rw-r--r--include/linux/serial.h1
-rw-r--r--include/linux/serial_8250.h2
-rw-r--r--include/linux/serial_core.h10
-rw-r--r--include/linux/serial_reg.h1
-rw-r--r--include/linux/serial_sci.h2
-rw-r--r--include/linux/serio.h21
-rw-r--r--include/linux/sh_eth.h25
-rw-r--r--include/linux/sh_pfc.h12
-rw-r--r--include/linux/shrinker.h1
-rw-r--r--include/linux/skbuff.h263
-rw-r--r--include/linux/slub_def.h4
-rw-r--r--include/linux/snmp.h2
-rw-r--r--include/linux/socket.h6
-rw-r--r--include/linux/spi/l4f00242t03.h2
-rw-r--r--include/linux/ssb/ssb.h9
-rw-r--r--include/linux/ssb/ssb_regs.h40
-rw-r--r--include/linux/stop_machine.h1
-rw-r--r--include/linux/string.h1
-rw-r--r--include/linux/sungem_phy.h132
-rw-r--r--include/linux/sunrpc/clnt.h13
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
-rw-r--r--include/linux/sunrpc/svc.h33
-rw-r--r--include/linux/sunrpc/svc_xprt.h3
-rw-r--r--include/linux/suspend.h95
-rw-r--r--include/linux/swap.h13
-rw-r--r--include/linux/syscalls.h16
-rw-r--r--include/linux/sysctl.h24
-rw-r--r--include/linux/sysdev.h1
-rw-r--r--include/linux/sysfs.h1
-rw-r--r--include/linux/tcp.h7
-rw-r--r--include/linux/textsearch.h3
-rw-r--r--include/linux/ti_wilink_st.h27
-rw-r--r--include/linux/tipc_config.h4
-rw-r--r--include/linux/topology.h4
-rw-r--r--include/linux/trace_clock.h1
-rw-r--r--include/linux/trace_seq.h8
-rw-r--r--include/linux/tracepoint.h25
-rw-r--r--include/linux/tty.h28
-rw-r--r--include/linux/tty_driver.h3
-rw-r--r--include/linux/types.h10
-rw-r--r--include/linux/uinput.h2
-rw-r--r--include/linux/uio_driver.h19
-rw-r--r--include/linux/un.h4
-rw-r--r--include/linux/usb.h29
-rw-r--r--include/linux/usb/Kbuild1
-rw-r--r--include/linux/usb/ch9.h46
-rw-r--r--include/linux/usb/gadget.h4
-rw-r--r--include/linux/usb/hcd.h3
-rw-r--r--include/linux/usb/r8a66597.h60
-rw-r--r--include/linux/usb/renesas_usbhs.h14
-rw-r--r--include/linux/utsname.h16
-rw-r--r--include/linux/uwb.h1
-rw-r--r--include/linux/uwb/umc.h7
-rw-r--r--include/linux/vermagic.h1
-rw-r--r--include/linux/videodev2.h119
-rw-r--r--include/linux/virtio.h9
-rw-r--r--include/linux/virtio_config.h3
-rw-r--r--include/linux/virtio_mmio.h111
-rw-r--r--include/linux/virtio_ring.h6
-rw-r--r--include/linux/vlynq.h3
-rw-r--r--include/linux/vmalloc.h1
-rw-r--r--include/linux/writeback.h44
-rw-r--r--include/linux/x25.h3
-rw-r--r--include/linux/xattr.h19
-rw-r--r--include/media/m5mols.h4
-rw-r--r--include/media/mt9p031.h19
-rw-r--r--include/media/mt9t001.h8
-rw-r--r--include/media/omap3isp.h140
-rw-r--r--include/media/ov772x.h26
-rw-r--r--include/media/pwc-ioctl.h1
-rw-r--r--include/media/rc-core.h7
-rw-r--r--include/media/rc-map.h3
-rw-r--r--include/media/s5k6aa.h51
-rw-r--r--include/media/s5p_fimc.h18
-rw-r--r--include/media/saa7146.h39
-rw-r--r--include/media/soc_camera.h104
-rw-r--r--include/media/soc_camera_platform.h4
-rw-r--r--include/media/soc_mediabus.h2
-rw-r--r--include/media/v4l2-chip-ident.h3
-rw-r--r--include/media/v4l2-ctrls.h15
-rw-r--r--include/media/v4l2-int-device.h3
-rw-r--r--include/media/v4l2-ioctl.h2
-rw-r--r--include/media/v4l2-mediabus.h12
-rw-r--r--include/media/v4l2-subdev.h5
-rw-r--r--include/media/videobuf-dma-sg.h2
-rw-r--r--include/media/videobuf2-core.h71
-rw-r--r--include/media/videobuf2-dma-contig.h6
-rw-r--r--include/misc/altera.h49
-rw-r--r--include/mtd/mtd-abi.h122
-rw-r--r--include/net/9p/9p.h43
-rw-r--r--include/net/9p/client.h8
-rw-r--r--include/net/9p/transport.h10
-rw-r--r--include/net/addrconf.h2
-rw-r--r--include/net/bluetooth/bluetooth.h2
-rw-r--r--include/net/bluetooth/hci.h10
-rw-r--r--include/net/bluetooth/hci_core.h49
-rw-r--r--include/net/bluetooth/l2cap.h11
-rw-r--r--include/net/bluetooth/mgmt.h16
-rw-r--r--include/net/bluetooth/rfcomm.h1
-rw-r--r--include/net/bluetooth/smp.h17
-rw-r--r--include/net/caif/caif_hsi.h37
-rw-r--r--include/net/cfg80211-wext.h55
-rw-r--r--include/net/cfg80211.h390
-rw-r--r--include/net/dcbevent.h18
-rw-r--r--include/net/dcbnl.h3
-rw-r--r--include/net/dst.h9
-rw-r--r--include/net/flow.h25
-rw-r--r--include/net/ieee80211_radiotap.h1
-rw-r--r--include/net/if_inet6.h1
-rw-r--r--include/net/inet_ecn.h8
-rw-r--r--include/net/inet_sock.h2
-rw-r--r--include/net/inet_timewait_sock.h5
-rw-r--r--include/net/ip.h12
-rw-r--r--include/net/ip_vs.h27
-rw-r--r--include/net/ipv6.h3
-rw-r--r--include/net/iucv/af_iucv.h52
-rw-r--r--include/net/iucv/iucv.h36
-rw-r--r--include/net/lapb.h2
-rw-r--r--include/net/lib80211.h6
-rw-r--r--include/net/mac80211.h297
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h27
-rw-r--r--include/net/netfilter/nf_log.h3
-rw-r--r--include/net/netfilter/nf_nat.h26
-rw-r--r--include/net/netlink.h11
-rw-r--r--include/net/nfc/nci.h313
-rw-r--r--include/net/nfc/nci_core.h184
-rw-r--r--include/net/nfc/nfc.h (renamed from include/net/nfc.h)11
-rw-r--r--include/net/regulatory.h16
-rw-r--r--include/net/request_sock.h3
-rw-r--r--include/net/sch_generic.h25
-rw-r--r--include/net/scm.h5
-rw-r--r--include/net/sctp/command.h1
-rw-r--r--include/net/sctp/structs.h1
-rw-r--r--include/net/secure_seq.h2
-rw-r--r--include/net/sock.h21
-rw-r--r--include/net/tcp.h103
-rw-r--r--include/net/transp_v6.h1
-rw-r--r--include/net/udp.h12
-rw-r--r--include/net/udplite.h63
-rw-r--r--include/rdma/ib_addr.h6
-rw-r--r--include/rdma/ib_user_verbs.h48
-rw-r--r--include/rdma/ib_verbs.h106
-rw-r--r--include/rdma/iw_cm.h4
-rw-r--r--include/rdma/rdma_cm.h1
-rw-r--r--include/rdma/rdma_user_cm.h3
-rw-r--r--include/scsi/iscsi_if.h135
-rw-r--r--include/scsi/libfc.h76
-rw-r--r--include/scsi/libfcoe.h5
-rw-r--r--include/scsi/libsas.h54
-rw-r--r--include/scsi/osd_ore.h80
-rw-r--r--include/scsi/sas.h24
-rw-r--r--include/scsi/scsi_bsg_iscsi.h110
-rw-r--r--include/scsi/scsi_device.h6
-rw-r--r--include/scsi/scsi_host.h16
-rw-r--r--include/scsi/scsi_transport_iscsi.h47
-rw-r--r--include/sound/asound.h4
-rw-r--r--include/sound/core.h6
-rw-r--r--include/sound/info.h4
-rw-r--r--include/sound/initval.h2
-rw-r--r--include/sound/jack.h1
-rw-r--r--include/sound/mpu401.h7
-rw-r--r--include/sound/pcm.h8
-rw-r--r--include/sound/seq_kernel.h4
-rw-r--r--include/target/configfs_macros.h4
-rw-r--r--include/target/target_core_base.h84
-rw-r--r--include/target/target_core_device.h2
-rw-r--r--include/target/target_core_fabric_ops.h17
-rw-r--r--include/target/target_core_tmr.h2
-rw-r--r--include/target/target_core_transport.h80
-rw-r--r--include/trace/define_trace.h10
-rw-r--r--include/trace/events/9p.h176
-rw-r--r--include/trace/events/block.h20
-rw-r--r--include/trace/events/ext4.h480
-rw-r--r--include/trace/events/module.h2
-rw-r--r--include/trace/events/rcu.h459
-rw-r--r--include/trace/events/regmap.h136
-rw-r--r--include/trace/events/rpm.h99
-rw-r--r--include/trace/events/sched.h9
-rw-r--r--include/trace/events/vmscan.h8
-rw-r--r--include/trace/events/writeback.h171
-rw-r--r--include/trace/ftrace.h3
-rw-r--r--include/video/omap-panel-dvi.h37
-rw-r--r--include/video/omap-panel-n8x0.h15
-rw-r--r--include/video/omap-panel-nokia-dsi.h8
-rw-r--r--include/video/omap-panel-picodlp.h23
-rw-r--r--include/video/omapdss.h100
-rw-r--r--include/video/sh_mobile_lcdc.h135
-rw-r--r--include/video/udlfb.h1
-rw-r--r--include/xen/balloon.h5
-rw-r--r--include/xen/grant_table.h2
-rw-r--r--include/xen/hvc-console.h4
-rw-r--r--include/xen/interface/io/blkif.h36
-rw-r--r--include/xen/interface/io/xs_wire.h6
-rw-r--r--include/xen/interface/physdev.h34
-rw-r--r--include/xen/interface/platform.h320
-rw-r--r--include/xen/interface/xen.h1
-rw-r--r--include/xen/page.h12
-rw-r--r--include/xen/xenbus.h13
516 files changed, 14921 insertions, 3937 deletions
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index e49c36d38d7e..bb145e4b935e 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -144,7 +144,7 @@ static inline void unregister_dock_notifier(struct notifier_block *nb)
144{ 144{
145} 145}
146static inline int register_hotplug_dock_device(acpi_handle handle, 146static inline int register_hotplug_dock_device(acpi_handle handle,
147 struct acpi_dock_ops *ops, 147 const struct acpi_dock_ops *ops,
148 void *context) 148 void *context)
149{ 149{
150 return -ENODEV; 150 return -ENODEV;
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 4543b6f75867..83062ed0ef2f 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -189,6 +189,8 @@ void acpi_os_fixed_event_count(u32 fixed_event_number);
189/* 189/*
190 * Threads and Scheduling 190 * Threads and Scheduling
191 */ 191 */
192extern struct workqueue_struct *kacpi_hotplug_wq;
193
192acpi_thread_id acpi_os_get_thread_id(void); 194acpi_thread_id acpi_os_get_thread_id(void);
193 195
194acpi_status 196acpi_status
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index b67231bef632..ed73f6705c86 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -470,7 +470,6 @@ typedef u64 acpi_integer;
470 */ 470 */
471#define ACPI_FULL_INITIALIZATION 0x00 471#define ACPI_FULL_INITIALIZATION 0x00
472#define ACPI_NO_ADDRESS_SPACE_INIT 0x01 472#define ACPI_NO_ADDRESS_SPACE_INIT 0x01
473#define ACPI_NO_HARDWARE_INIT 0x02
474#define ACPI_NO_EVENT_INIT 0x04 473#define ACPI_NO_EVENT_INIT 0x04
475#define ACPI_NO_HANDLER_INIT 0x08 474#define ACPI_NO_HANDLER_INIT 0x08
476#define ACPI_NO_ACPI_ENABLE 0x10 475#define ACPI_NO_ACPI_ENABLE 0x10
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index f72403c4b51a..f4b2effe0333 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -55,7 +55,6 @@
55 55
56#include <linux/string.h> 56#include <linux/string.h>
57#include <linux/kernel.h> 57#include <linux/kernel.h>
58#include <linux/module.h>
59#include <linux/ctype.h> 58#include <linux/ctype.h>
60#include <linux/sched.h> 59#include <linux/sched.h>
61#include <asm/system.h> 60#include <asm/system.h>
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 67055f180330..610f6fb1bbc2 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -329,6 +329,7 @@ extern void acpi_processor_throttling_init(void);
329int acpi_processor_power_init(struct acpi_processor *pr, 329int acpi_processor_power_init(struct acpi_processor *pr,
330 struct acpi_device *device); 330 struct acpi_device *device);
331int acpi_processor_cst_has_changed(struct acpi_processor *pr); 331int acpi_processor_cst_has_changed(struct acpi_processor *pr);
332int acpi_processor_hotplug(struct acpi_processor *pr);
332int acpi_processor_power_exit(struct acpi_processor *pr, 333int acpi_processor_power_exit(struct acpi_processor *pr,
333 struct acpi_device *device); 334 struct acpi_device *device);
334int acpi_processor_suspend(struct acpi_device * device, pm_message_t state); 335int acpi_processor_suspend(struct acpi_device * device, pm_message_t state);
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index dfb0ec666c94..84458b0c38d1 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -61,11 +61,12 @@ struct bug_entry {
61 */ 61 */
62#ifndef __WARN_TAINT 62#ifndef __WARN_TAINT
63#ifndef __ASSEMBLY__ 63#ifndef __ASSEMBLY__
64extern void warn_slowpath_fmt(const char *file, const int line, 64extern __printf(3, 4)
65 const char *fmt, ...) __attribute__((format(printf, 3, 4))); 65void warn_slowpath_fmt(const char *file, const int line,
66extern void warn_slowpath_fmt_taint(const char *file, const int line, 66 const char *fmt, ...);
67 unsigned taint, const char *fmt, ...) 67extern __printf(4, 5)
68 __attribute__((format(printf, 4, 5))); 68void warn_slowpath_fmt_taint(const char *file, const int line, unsigned taint,
69 const char *fmt, ...);
69extern void warn_slowpath_null(const char *file, const int line); 70extern void warn_slowpath_null(const char *file, const int line);
70#define WANT_WARN_ON_SLOWPATH 71#define WANT_WARN_ON_SLOWPATH
71#endif 72#endif
diff --git a/include/asm-generic/checksum.h b/include/asm-generic/checksum.h
index 4647c762d970..c084767c88bc 100644
--- a/include/asm-generic/checksum.h
+++ b/include/asm-generic/checksum.h
@@ -33,8 +33,10 @@ extern __wsum csum_partial_copy(const void *src, void *dst, int len, __wsum sum)
33extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst, 33extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
34 int len, __wsum sum, int *csum_err); 34 int len, __wsum sum, int *csum_err);
35 35
36#ifndef csum_partial_copy_nocheck
36#define csum_partial_copy_nocheck(src, dst, len, sum) \ 37#define csum_partial_copy_nocheck(src, dst, len, sum) \
37 csum_partial_copy((src), (dst), (len), (sum)) 38 csum_partial_copy((src), (dst), (len), (sum))
39#endif
38 40
39/* 41/*
40 * This is a version of ip_compute_csum() optimized for IP headers, 42 * This is a version of ip_compute_csum() optimized for IP headers,
@@ -63,12 +65,14 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
63 unsigned short proto, __wsum sum); 65 unsigned short proto, __wsum sum);
64#endif 66#endif
65 67
68#ifndef csum_tcpudp_magic
66static inline __sum16 69static inline __sum16
67csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len, 70csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
68 unsigned short proto, __wsum sum) 71 unsigned short proto, __wsum sum)
69{ 72{
70 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum)); 73 return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
71} 74}
75#endif
72 76
73/* 77/*
74 * this routine is used for miscellaneous IP-like checksums, mainly 78 * this routine is used for miscellaneous IP-like checksums, mainly
diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h
index 61e03dd7939e..62ce6823c0f2 100644
--- a/include/asm-generic/cputime.h
+++ b/include/asm-generic/cputime.h
@@ -38,8 +38,8 @@ typedef u64 cputime64_t;
38/* 38/*
39 * Convert cputime to microseconds and back. 39 * Convert cputime to microseconds and back.
40 */ 40 */
41#define cputime_to_usecs(__ct) jiffies_to_usecs(__ct); 41#define cputime_to_usecs(__ct) jiffies_to_usecs(__ct)
42#define usecs_to_cputime(__msecs) usecs_to_jiffies(__msecs); 42#define usecs_to_cputime(__msecs) usecs_to_jiffies(__msecs)
43 43
44/* 44/*
45 * Convert cputime to seconds and back. 45 * Convert cputime to seconds and back.
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index 0c80bb38773f..9fa3f96e38cf 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -123,7 +123,12 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
123 size_t size, 123 size_t size,
124 enum dma_data_direction dir) 124 enum dma_data_direction dir)
125{ 125{
126 dma_sync_single_for_cpu(dev, addr + offset, size, dir); 126 const struct dma_map_ops *ops = get_dma_ops(dev);
127
128 BUG_ON(!valid_dma_direction(dir));
129 if (ops->sync_single_for_cpu)
130 ops->sync_single_for_cpu(dev, addr + offset, size, dir);
131 debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir);
127} 132}
128 133
129static inline void dma_sync_single_range_for_device(struct device *dev, 134static inline void dma_sync_single_range_for_device(struct device *dev,
@@ -132,7 +137,12 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
132 size_t size, 137 size_t size,
133 enum dma_data_direction dir) 138 enum dma_data_direction dir)
134{ 139{
135 dma_sync_single_for_device(dev, addr + offset, size, dir); 140 const struct dma_map_ops *ops = get_dma_ops(dev);
141
142 BUG_ON(!valid_dma_direction(dir));
143 if (ops->sync_single_for_device)
144 ops->sync_single_for_device(dev, addr + offset, size, dir);
145 debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir);
136} 146}
137 147
138static inline void 148static inline void
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
index 84793c7025e2..9e5b0356e2bb 100644
--- a/include/asm-generic/fcntl.h
+++ b/include/asm-generic/fcntl.h
@@ -145,11 +145,6 @@ struct f_owner_ex {
145#define F_SHLCK 8 /* or 4 */ 145#define F_SHLCK 8 /* or 4 */
146#endif 146#endif
147 147
148/* for leases */
149#ifndef F_INPROGRESS
150#define F_INPROGRESS 16
151#endif
152
153/* operations for bsd flock(), also used by the kernel implementation */ 148/* operations for bsd flock(), also used by the kernel implementation */
154#define LOCK_SH 1 /* shared lock */ 149#define LOCK_SH 1 /* shared lock */
155#define LOCK_EX 2 /* exclusive lock */ 150#define LOCK_EX 2 /* exclusive lock */
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index d494001b1226..8c8621097fa0 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -41,6 +41,7 @@ static inline bool gpio_is_valid(int number)
41} 41}
42 42
43struct device; 43struct device;
44struct gpio;
44struct seq_file; 45struct seq_file;
45struct module; 46struct module;
46struct device_node; 47struct device_node;
@@ -170,18 +171,6 @@ extern int __gpio_cansleep(unsigned gpio);
170 171
171extern int __gpio_to_irq(unsigned gpio); 172extern int __gpio_to_irq(unsigned gpio);
172 173
173/**
174 * struct gpio - a structure describing a GPIO with configuration
175 * @gpio: the GPIO number
176 * @flags: GPIO configuration as specified by GPIOF_*
177 * @label: a literal description string of this GPIO
178 */
179struct gpio {
180 unsigned gpio;
181 unsigned long flags;
182 const char *label;
183};
184
185extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label); 174extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
186extern int gpio_request_array(const struct gpio *array, size_t num); 175extern int gpio_request_array(const struct gpio *array, size_t num);
187extern void gpio_free_array(const struct gpio *array, size_t num); 176extern void gpio_free_array(const struct gpio *array, size_t num);
@@ -220,13 +209,13 @@ static inline int gpio_cansleep(unsigned gpio)
220static inline int gpio_get_value_cansleep(unsigned gpio) 209static inline int gpio_get_value_cansleep(unsigned gpio)
221{ 210{
222 might_sleep(); 211 might_sleep();
223 return gpio_get_value(gpio); 212 return __gpio_get_value(gpio);
224} 213}
225 214
226static inline void gpio_set_value_cansleep(unsigned gpio, int value) 215static inline void gpio_set_value_cansleep(unsigned gpio, int value)
227{ 216{
228 might_sleep(); 217 might_sleep();
229 gpio_set_value(gpio, value); 218 __gpio_set_value(gpio, value);
230} 219}
231 220
232#endif /* !CONFIG_GPIOLIB */ 221#endif /* !CONFIG_GPIOLIB */
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h
index fb2d63f13f4c..aea9e45efce6 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -39,7 +39,7 @@
39}) 39})
40 40
41#define __page_to_pfn(pg) \ 41#define __page_to_pfn(pg) \
42({ struct page *__pg = (pg); \ 42({ const struct page *__pg = (pg); \
43 struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ 43 struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \
44 (unsigned long)(__pg - __pgdat->node_mem_map) + \ 44 (unsigned long)(__pg - __pgdat->node_mem_map) + \
45 __pgdat->node_start_pfn; \ 45 __pgdat->node_start_pfn; \
@@ -57,7 +57,7 @@
57 * section[i].section_mem_map == mem_map's address - start_pfn; 57 * section[i].section_mem_map == mem_map's address - start_pfn;
58 */ 58 */
59#define __page_to_pfn(pg) \ 59#define __page_to_pfn(pg) \
60({ struct page *__pg = (pg); \ 60({ const struct page *__pg = (pg); \
61 int __sec = page_to_section(__pg); \ 61 int __sec = page_to_section(__pg); \
62 (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \ 62 (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \
63}) 63})
diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
index 75fec18cdc59..351889d1de19 100644
--- a/include/asm-generic/page.h
+++ b/include/asm-generic/page.h
@@ -79,8 +79,8 @@ extern unsigned long memory_end;
79#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) 79#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
80#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) 80#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
81 81
82#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) 82#define virt_to_page(addr) pfn_to_page(virt_to_pfn(addr))
83#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) 83#define page_to_virt(page) pfn_to_virt(page_to_pfn(page))
84 84
85#ifndef page_to_phys 85#ifndef page_to_phys
86#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) 86#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
diff --git a/include/asm-generic/rwsem.h b/include/asm-generic/rwsem.h
new file mode 100644
index 000000000000..bb1e2cdeb9bf
--- /dev/null
+++ b/include/asm-generic/rwsem.h
@@ -0,0 +1,132 @@
1#ifndef _ASM_POWERPC_RWSEM_H
2#define _ASM_POWERPC_RWSEM_H
3
4#ifndef _LINUX_RWSEM_H
5#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
6#endif
7
8#ifdef __KERNEL__
9
10/*
11 * R/W semaphores for PPC using the stuff in lib/rwsem.c.
12 * Adapted largely from include/asm-i386/rwsem.h
13 * by Paul Mackerras <paulus@samba.org>.
14 */
15
16/*
17 * the semaphore definition
18 */
19#ifdef CONFIG_PPC64
20# define RWSEM_ACTIVE_MASK 0xffffffffL
21#else
22# define RWSEM_ACTIVE_MASK 0x0000ffffL
23#endif
24
25#define RWSEM_UNLOCKED_VALUE 0x00000000L
26#define RWSEM_ACTIVE_BIAS 0x00000001L
27#define RWSEM_WAITING_BIAS (-RWSEM_ACTIVE_MASK-1)
28#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
29#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
30
31/*
32 * lock for reading
33 */
34static inline void __down_read(struct rw_semaphore *sem)
35{
36 if (unlikely(atomic_long_inc_return((atomic_long_t *)&sem->count) <= 0))
37 rwsem_down_read_failed(sem);
38}
39
40static inline int __down_read_trylock(struct rw_semaphore *sem)
41{
42 long tmp;
43
44 while ((tmp = sem->count) >= 0) {
45 if (tmp == cmpxchg(&sem->count, tmp,
46 tmp + RWSEM_ACTIVE_READ_BIAS)) {
47 return 1;
48 }
49 }
50 return 0;
51}
52
53/*
54 * lock for writing
55 */
56static inline void __down_write_nested(struct rw_semaphore *sem, int subclass)
57{
58 long tmp;
59
60 tmp = atomic_long_add_return(RWSEM_ACTIVE_WRITE_BIAS,
61 (atomic_long_t *)&sem->count);
62 if (unlikely(tmp != RWSEM_ACTIVE_WRITE_BIAS))
63 rwsem_down_write_failed(sem);
64}
65
66static inline void __down_write(struct rw_semaphore *sem)
67{
68 __down_write_nested(sem, 0);
69}
70
71static inline int __down_write_trylock(struct rw_semaphore *sem)
72{
73 long tmp;
74
75 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
76 RWSEM_ACTIVE_WRITE_BIAS);
77 return tmp == RWSEM_UNLOCKED_VALUE;
78}
79
80/*
81 * unlock after reading
82 */
83static inline void __up_read(struct rw_semaphore *sem)
84{
85 long tmp;
86
87 tmp = atomic_long_dec_return((atomic_long_t *)&sem->count);
88 if (unlikely(tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0))
89 rwsem_wake(sem);
90}
91
92/*
93 * unlock after writing
94 */
95static inline void __up_write(struct rw_semaphore *sem)
96{
97 if (unlikely(atomic_long_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
98 (atomic_long_t *)&sem->count) < 0))
99 rwsem_wake(sem);
100}
101
102/*
103 * implement atomic add functionality
104 */
105static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem)
106{
107 atomic_long_add(delta, (atomic_long_t *)&sem->count);
108}
109
110/*
111 * downgrade write lock to read lock
112 */
113static inline void __downgrade_write(struct rw_semaphore *sem)
114{
115 long tmp;
116
117 tmp = atomic_long_add_return(-RWSEM_WAITING_BIAS,
118 (atomic_long_t *)&sem->count);
119 if (tmp < 0)
120 rwsem_downgrade_wake(sem);
121}
122
123/*
124 * implement exchange and add functionality
125 */
126static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem)
127{
128 return atomic_long_add_return(delta, (atomic_long_t *)&sem->count);
129}
130
131#endif /* __KERNEL__ */
132#endif /* _ASM_POWERPC_RWSEM_H */
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
index 4f76959397fa..f4c38d8c6674 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -143,7 +143,7 @@ __SYSCALL(__NR_pivot_root, sys_pivot_root)
143 143
144/* fs/nfsctl.c */ 144/* fs/nfsctl.c */
145#define __NR_nfsservctl 42 145#define __NR_nfsservctl 42
146__SC_COMP(__NR_nfsservctl, sys_nfsservctl, compat_sys_nfsservctl) 146__SYSCALL(__NR_nfsservctl, sys_ni_syscall)
147 147
148/* fs/open.c */ 148/* fs/open.c */
149#define __NR3264_statfs 43 149#define __NR3264_statfs 43
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index db22d136ad08..b5e2e4c6b017 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -222,7 +222,6 @@
222 VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \ 222 VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \
223 *(__tracepoints_ptrs) /* Tracepoints: pointer array */\ 223 *(__tracepoints_ptrs) /* Tracepoints: pointer array */\
224 VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \ 224 VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \
225 *(__markers_strings) /* Markers: strings */ \
226 *(__tracepoints_strings)/* Tracepoints: strings */ \ 225 *(__tracepoints_strings)/* Tracepoints: strings */ \
227 } \ 226 } \
228 \ 227 \
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h
index 59c3e5bd2c06..ecc721def10c 100644
--- a/include/crypto/algapi.h
+++ b/include/crypto/algapi.h
@@ -15,6 +15,7 @@
15#include <linux/crypto.h> 15#include <linux/crypto.h>
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/skbuff.h>
18 19
19struct module; 20struct module;
20struct rtattr; 21struct rtattr;
@@ -26,6 +27,7 @@ struct crypto_type {
26 int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask); 27 int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask);
27 int (*init_tfm)(struct crypto_tfm *tfm); 28 int (*init_tfm)(struct crypto_tfm *tfm);
28 void (*show)(struct seq_file *m, struct crypto_alg *alg); 29 void (*show)(struct seq_file *m, struct crypto_alg *alg);
30 int (*report)(struct sk_buff *skb, struct crypto_alg *alg);
29 struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask); 31 struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask);
30 32
31 unsigned int type; 33 unsigned int type;
diff --git a/include/crypto/blowfish.h b/include/crypto/blowfish.h
new file mode 100644
index 000000000000..1450d4a27980
--- /dev/null
+++ b/include/crypto/blowfish.h
@@ -0,0 +1,23 @@
1/*
2 * Common values for blowfish algorithms
3 */
4
5#ifndef _CRYPTO_BLOWFISH_H
6#define _CRYPTO_BLOWFISH_H
7
8#include <linux/types.h>
9#include <linux/crypto.h>
10
11#define BF_BLOCK_SIZE 8
12#define BF_MIN_KEY_SIZE 4
13#define BF_MAX_KEY_SIZE 56
14
15struct bf_ctx {
16 u32 p[18];
17 u32 s[1024];
18};
19
20int blowfish_setkey(struct crypto_tfm *tfm, const u8 *key,
21 unsigned int key_len);
22
23#endif
diff --git a/include/crypto/sha.h b/include/crypto/sha.h
index 069e85ba97e1..c6c9c1fe460c 100644
--- a/include/crypto/sha.h
+++ b/include/crypto/sha.h
@@ -82,4 +82,9 @@ struct sha512_state {
82 u8 buf[SHA512_BLOCK_SIZE]; 82 u8 buf[SHA512_BLOCK_SIZE];
83}; 83};
84 84
85struct shash_desc;
86
87extern int crypto_sha1_update(struct shash_desc *desc, const u8 *data,
88 unsigned int len);
89
85#endif 90#endif
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 9b7c2bb4bb44..cf399495d38f 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -42,7 +42,6 @@
42 * can build the DRM (part of PI DRI). 4/21/2000 S + B */ 42 * can build the DRM (part of PI DRI). 4/21/2000 S + B */
43#include <asm/current.h> 43#include <asm/current.h>
44#endif /* __alpha__ */ 44#endif /* __alpha__ */
45#include <linux/module.h>
46#include <linux/kernel.h> 45#include <linux/kernel.h>
47#include <linux/miscdevice.h> 46#include <linux/miscdevice.h>
48#include <linux/fs.h> 47#include <linux/fs.h>
@@ -80,6 +79,8 @@
80#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) 79#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
81#define __OS_HAS_MTRR (defined(CONFIG_MTRR)) 80#define __OS_HAS_MTRR (defined(CONFIG_MTRR))
82 81
82struct module;
83
83struct drm_file; 84struct drm_file;
84struct drm_device; 85struct drm_device;
85 86
@@ -122,12 +123,12 @@ struct drm_device;
122 * using the DRM_DEBUG_KMS and DRM_DEBUG. 123 * using the DRM_DEBUG_KMS and DRM_DEBUG.
123 */ 124 */
124 125
125extern __attribute__((format (printf, 4, 5))) 126extern __printf(4, 5)
126void drm_ut_debug_printk(unsigned int request_level, 127void drm_ut_debug_printk(unsigned int request_level,
127 const char *prefix, 128 const char *prefix,
128 const char *function_name, 129 const char *function_name,
129 const char *format, ...); 130 const char *format, ...);
130extern __attribute__((format (printf, 2, 3))) 131extern __printf(2, 3)
131int drm_err(const char *func, const char *format, ...); 132int drm_err(const char *func, const char *format, ...);
132 133
133/***********************************************************************/ 134/***********************************************************************/
@@ -1624,6 +1625,9 @@ drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
1624 drm_gem_object_unreference_unlocked(obj); 1625 drm_gem_object_unreference_unlocked(obj);
1625} 1626}
1626 1627
1628void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
1629int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
1630
1627struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, 1631struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
1628 struct drm_file *filp, 1632 struct drm_file *filp,
1629 u32 handle); 1633 u32 handle);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 44335e57eaaa..802079809282 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -466,6 +466,8 @@ enum drm_connector_force {
466/* DACs should rarely do this without a lot of testing */ 466/* DACs should rarely do this without a lot of testing */
467#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2) 467#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2)
468 468
469#define MAX_ELD_BYTES 128
470
469/** 471/**
470 * drm_connector - central DRM connector control structure 472 * drm_connector - central DRM connector control structure
471 * @crtc: CRTC this connector is currently connected to, NULL if none 473 * @crtc: CRTC this connector is currently connected to, NULL if none
@@ -523,6 +525,13 @@ struct drm_connector {
523 uint32_t force_encoder_id; 525 uint32_t force_encoder_id;
524 struct drm_encoder *encoder; /* currently active encoder */ 526 struct drm_encoder *encoder; /* currently active encoder */
525 527
528 /* EDID bits */
529 uint8_t eld[MAX_ELD_BYTES];
530 bool dvi_dual;
531 int max_tmds_clock; /* in MHz */
532 bool latency_present[2];
533 int video_latency[2]; /* [0]: progressive, [1]: interlaced */
534 int audio_latency[2];
526 int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */ 535 int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
527}; 536};
528 537
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 91567bbdb027..93df2d72750b 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -72,8 +72,23 @@
72 72
73#define DP_MAIN_LINK_CHANNEL_CODING 0x006 73#define DP_MAIN_LINK_CHANNEL_CODING 0x006
74 74
75#define DP_EDP_CONFIGURATION_CAP 0x00d
75#define DP_TRAINING_AUX_RD_INTERVAL 0x00e 76#define DP_TRAINING_AUX_RD_INTERVAL 0x00e
76 77
78#define DP_PSR_SUPPORT 0x070
79# define DP_PSR_IS_SUPPORTED 1
80#define DP_PSR_CAPS 0x071
81# define DP_PSR_NO_TRAIN_ON_EXIT 1
82# define DP_PSR_SETUP_TIME_330 (0 << 1)
83# define DP_PSR_SETUP_TIME_275 (1 << 1)
84# define DP_PSR_SETUP_TIME_220 (2 << 1)
85# define DP_PSR_SETUP_TIME_165 (3 << 1)
86# define DP_PSR_SETUP_TIME_110 (4 << 1)
87# define DP_PSR_SETUP_TIME_55 (5 << 1)
88# define DP_PSR_SETUP_TIME_0 (6 << 1)
89# define DP_PSR_SETUP_TIME_MASK (7 << 1)
90# define DP_PSR_SETUP_TIME_SHIFT 1
91
77/* link configuration */ 92/* link configuration */
78#define DP_LINK_BW_SET 0x100 93#define DP_LINK_BW_SET 0x100
79# define DP_LINK_BW_1_62 0x06 94# define DP_LINK_BW_1_62 0x06
@@ -133,6 +148,20 @@
133#define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108 148#define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108
134# define DP_SET_ANSI_8B10B (1 << 0) 149# define DP_SET_ANSI_8B10B (1 << 0)
135 150
151#define DP_PSR_EN_CFG 0x170
152# define DP_PSR_ENABLE (1 << 0)
153# define DP_PSR_MAIN_LINK_ACTIVE (1 << 1)
154# define DP_PSR_CRC_VERIFICATION (1 << 2)
155# define DP_PSR_FRAME_CAPTURE (1 << 3)
156
157#define DP_DEVICE_SERVICE_IRQ_VECTOR 0x201
158# define DP_REMOTE_CONTROL_COMMAND_PENDING (1 << 0)
159# define DP_AUTOMATED_TEST_REQUEST (1 << 1)
160# define DP_CP_IRQ (1 << 2)
161# define DP_SINK_SPECIFIC_IRQ (1 << 6)
162
163#define DP_EDP_CONFIGURATION_SET 0x10a
164
136#define DP_LANE0_1_STATUS 0x202 165#define DP_LANE0_1_STATUS 0x202
137#define DP_LANE2_3_STATUS 0x203 166#define DP_LANE2_3_STATUS 0x203
138# define DP_LANE_CR_DONE (1 << 0) 167# define DP_LANE_CR_DONE (1 << 0)
@@ -165,10 +194,45 @@
165# define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0 194# define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0
166# define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6 195# define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6
167 196
197#define DP_TEST_REQUEST 0x218
198# define DP_TEST_LINK_TRAINING (1 << 0)
199# define DP_TEST_LINK_PATTERN (1 << 1)
200# define DP_TEST_LINK_EDID_READ (1 << 2)
201# define DP_TEST_LINK_PHY_TEST_PATTERN (1 << 3) /* DPCD >= 1.1 */
202
203#define DP_TEST_LINK_RATE 0x219
204# define DP_LINK_RATE_162 (0x6)
205# define DP_LINK_RATE_27 (0xa)
206
207#define DP_TEST_LANE_COUNT 0x220
208
209#define DP_TEST_PATTERN 0x221
210
211#define DP_TEST_RESPONSE 0x260
212# define DP_TEST_ACK (1 << 0)
213# define DP_TEST_NAK (1 << 1)
214# define DP_TEST_EDID_CHECKSUM_WRITE (1 << 2)
215
168#define DP_SET_POWER 0x600 216#define DP_SET_POWER 0x600
169# define DP_SET_POWER_D0 0x1 217# define DP_SET_POWER_D0 0x1
170# define DP_SET_POWER_D3 0x2 218# define DP_SET_POWER_D3 0x2
171 219
220#define DP_PSR_ERROR_STATUS 0x2006
221# define DP_PSR_LINK_CRC_ERROR (1 << 0)
222# define DP_PSR_RFB_STORAGE_ERROR (1 << 1)
223
224#define DP_PSR_ESI 0x2007
225# define DP_PSR_CAPS_CHANGE (1 << 0)
226
227#define DP_PSR_STATUS 0x2008
228# define DP_PSR_SINK_INACTIVE 0
229# define DP_PSR_SINK_ACTIVE_SRC_SYNCED 1
230# define DP_PSR_SINK_ACTIVE_RFB 2
231# define DP_PSR_SINK_ACTIVE_SINK_SYNCED 3
232# define DP_PSR_SINK_ACTIVE_RESYNC 4
233# define DP_PSR_SINK_INTERNAL_ERROR 7
234# define DP_PSR_SINK_STATE_MASK 0x07
235
172#define MODE_I2C_START 1 236#define MODE_I2C_START 1
173#define MODE_I2C_WRITE 2 237#define MODE_I2C_WRITE 2
174#define MODE_I2C_READ 4 238#define MODE_I2C_READ 4
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index eacb415b309a..74ce91684629 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -230,4 +230,13 @@ struct edid {
230 230
231#define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) 231#define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8))
232 232
233struct drm_encoder;
234struct drm_connector;
235struct drm_display_mode;
236void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
237int drm_av_sync_delay(struct drm_connector *connector,
238 struct drm_display_mode *mode);
239struct drm_connector *drm_select_eld(struct drm_encoder *encoder,
240 struct drm_display_mode *mode);
241
233#endif /* __DRM_EDID_H__ */ 242#endif /* __DRM_EDID_H__ */
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h
index c4961ea50a49..d30bedfeb7ef 100644
--- a/include/drm/drm_mode.h
+++ b/include/drm/drm_mode.h
@@ -120,11 +120,12 @@ struct drm_mode_crtc {
120 struct drm_mode_modeinfo mode; 120 struct drm_mode_modeinfo mode;
121}; 121};
122 122
123#define DRM_MODE_ENCODER_NONE 0 123#define DRM_MODE_ENCODER_NONE 0
124#define DRM_MODE_ENCODER_DAC 1 124#define DRM_MODE_ENCODER_DAC 1
125#define DRM_MODE_ENCODER_TMDS 2 125#define DRM_MODE_ENCODER_TMDS 2
126#define DRM_MODE_ENCODER_LVDS 3 126#define DRM_MODE_ENCODER_LVDS 3
127#define DRM_MODE_ENCODER_TVDAC 4 127#define DRM_MODE_ENCODER_TVDAC 4
128#define DRM_MODE_ENCODER_VIRTUAL 5
128 129
129struct drm_mode_get_encoder { 130struct drm_mode_get_encoder {
130 __u32 encoder_id; 131 __u32 encoder_id;
@@ -162,6 +163,7 @@ struct drm_mode_get_encoder {
162#define DRM_MODE_CONNECTOR_HDMIB 12 163#define DRM_MODE_CONNECTOR_HDMIB 12
163#define DRM_MODE_CONNECTOR_TV 13 164#define DRM_MODE_CONNECTOR_TV 13
164#define DRM_MODE_CONNECTOR_eDP 14 165#define DRM_MODE_CONNECTOR_eDP 14
166#define DRM_MODE_CONNECTOR_VIRTUAL 15
165 167
166struct drm_mode_get_connector { 168struct drm_mode_get_connector {
167 169
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
new file mode 100644
index 000000000000..874c4d271328
--- /dev/null
+++ b/include/drm/exynos_drm.h
@@ -0,0 +1,104 @@
1/* exynos_drm.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * Authors:
5 * Inki Dae <inki.dae@samsung.com>
6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice (including the next
17 * paragraph) shall be included in all copies or substantial portions of the
18 * Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26 * OTHER DEALINGS IN THE SOFTWARE.
27 */
28
29#ifndef _EXYNOS_DRM_H_
30#define _EXYNOS_DRM_H_
31
32/**
33 * User-desired buffer creation information structure.
34 *
35 * @size: requested size for the object.
36 * - this size value would be page-aligned internally.
37 * @flags: user request for setting memory type or cache attributes.
38 * @handle: returned handle for the object.
39 */
40struct drm_exynos_gem_create {
41 unsigned int size;
42 unsigned int flags;
43 unsigned int handle;
44};
45
46/**
47 * A structure for getting buffer offset.
48 *
49 * @handle: a pointer to gem object created.
50 * @pad: just padding to be 64-bit aligned.
51 * @offset: relatived offset value of the memory region allocated.
52 * - this value should be set by user.
53 */
54struct drm_exynos_gem_map_off {
55 unsigned int handle;
56 unsigned int pad;
57 uint64_t offset;
58};
59
60/**
61 * A structure for mapping buffer.
62 *
63 * @handle: a handle to gem object created.
64 * @size: memory size to be mapped.
65 * @mapped: having user virtual address mmaped.
66 * - this variable would be filled by exynos gem module
67 * of kernel side with user virtual address which is allocated
68 * by do_mmap().
69 */
70struct drm_exynos_gem_mmap {
71 unsigned int handle;
72 unsigned int size;
73 uint64_t mapped;
74};
75
76#define DRM_EXYNOS_GEM_CREATE 0x00
77#define DRM_EXYNOS_GEM_MAP_OFFSET 0x01
78#define DRM_EXYNOS_GEM_MMAP 0x02
79
80#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
81 DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
82
83#define DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \
84 DRM_EXYNOS_GEM_MAP_OFFSET, struct drm_exynos_gem_map_off)
85
86#define DRM_IOCTL_EXYNOS_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + \
87 DRM_EXYNOS_GEM_MMAP, struct drm_exynos_gem_mmap)
88
89/**
90 * Platform Specific Structure for DRM based FIMD.
91 *
92 * @timing: default video mode for initializing
93 * @default_win: default window layer number to be used for UI.
94 * @bpp: default bit per pixel.
95 */
96struct exynos_drm_fimd_pdata {
97 struct fb_videomode timing;
98 u32 vidcon0;
99 u32 vidcon1;
100 unsigned int default_win;
101 unsigned int bpp;
102};
103
104#endif
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h
index 9e343c0998b4..b174620cc9b3 100644
--- a/include/drm/intel-gtt.h
+++ b/include/drm/intel-gtt.h
@@ -13,6 +13,8 @@ const struct intel_gtt {
13 unsigned int gtt_mappable_entries; 13 unsigned int gtt_mappable_entries;
14 /* Whether i915 needs to use the dmar apis or not. */ 14 /* Whether i915 needs to use the dmar apis or not. */
15 unsigned int needs_dmar : 1; 15 unsigned int needs_dmar : 1;
16 /* Whether we idle the gpu before mapping/unmapping */
17 unsigned int do_idle_maps : 1;
16} *intel_gtt_get(void); 18} *intel_gtt_get(void);
17 19
18void intel_gtt_chipset_flush(void); 20void intel_gtt_chipset_flush(void);
diff --git a/include/drm/vmwgfx_drm.h b/include/drm/vmwgfx_drm.h
index 5c36432d9ce5..bcb0912afe7a 100644
--- a/include/drm/vmwgfx_drm.h
+++ b/include/drm/vmwgfx_drm.h
@@ -31,7 +31,6 @@
31#define DRM_VMW_MAX_SURFACE_FACES 6 31#define DRM_VMW_MAX_SURFACE_FACES 6
32#define DRM_VMW_MAX_MIP_LEVELS 24 32#define DRM_VMW_MAX_MIP_LEVELS 24
33 33
34#define DRM_VMW_EXT_NAME_LEN 128
35 34
36#define DRM_VMW_GET_PARAM 0 35#define DRM_VMW_GET_PARAM 0
37#define DRM_VMW_ALLOC_DMABUF 1 36#define DRM_VMW_ALLOC_DMABUF 1
@@ -48,11 +47,14 @@
48#define DRM_VMW_UNREF_SURFACE 10 47#define DRM_VMW_UNREF_SURFACE 10
49#define DRM_VMW_REF_SURFACE 11 48#define DRM_VMW_REF_SURFACE 11
50#define DRM_VMW_EXECBUF 12 49#define DRM_VMW_EXECBUF 12
51#define DRM_VMW_FIFO_DEBUG 13 50#define DRM_VMW_GET_3D_CAP 13
52#define DRM_VMW_FENCE_WAIT 14 51#define DRM_VMW_FENCE_WAIT 14
53/* guarded by minor version >= 2 */ 52#define DRM_VMW_FENCE_SIGNALED 15
54#define DRM_VMW_UPDATE_LAYOUT 15 53#define DRM_VMW_FENCE_UNREF 16
55 54#define DRM_VMW_FENCE_EVENT 17
55#define DRM_VMW_PRESENT 18
56#define DRM_VMW_PRESENT_READBACK 19
57#define DRM_VMW_UPDATE_LAYOUT 20
56 58
57/*************************************************************************/ 59/*************************************************************************/
58/** 60/**
@@ -69,10 +71,10 @@
69#define DRM_VMW_PARAM_NUM_STREAMS 0 71#define DRM_VMW_PARAM_NUM_STREAMS 0
70#define DRM_VMW_PARAM_NUM_FREE_STREAMS 1 72#define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
71#define DRM_VMW_PARAM_3D 2 73#define DRM_VMW_PARAM_3D 2
72#define DRM_VMW_PARAM_FIFO_OFFSET 3 74#define DRM_VMW_PARAM_HW_CAPS 3
73#define DRM_VMW_PARAM_HW_CAPS 4 75#define DRM_VMW_PARAM_FIFO_CAPS 4
74#define DRM_VMW_PARAM_FIFO_CAPS 5 76#define DRM_VMW_PARAM_MAX_FB_SIZE 5
75#define DRM_VMW_PARAM_MAX_FB_SIZE 6 77#define DRM_VMW_PARAM_FIFO_HW_VERSION 6
76 78
77/** 79/**
78 * struct drm_vmw_getparam_arg 80 * struct drm_vmw_getparam_arg
@@ -91,49 +93,6 @@ struct drm_vmw_getparam_arg {
91 93
92/*************************************************************************/ 94/*************************************************************************/
93/** 95/**
94 * DRM_VMW_EXTENSION - Query device extensions.
95 */
96
97/**
98 * struct drm_vmw_extension_rep
99 *
100 * @exists: The queried extension exists.
101 * @driver_ioctl_offset: Ioctl number of the first ioctl in the extension.
102 * @driver_sarea_offset: Offset to any space in the DRI SAREA
103 * used by the extension.
104 * @major: Major version number of the extension.
105 * @minor: Minor version number of the extension.
106 * @pl: Patch level version number of the extension.
107 *
108 * Output argument to the DRM_VMW_EXTENSION Ioctl.
109 */
110
111struct drm_vmw_extension_rep {
112 int32_t exists;
113 uint32_t driver_ioctl_offset;
114 uint32_t driver_sarea_offset;
115 uint32_t major;
116 uint32_t minor;
117 uint32_t pl;
118 uint32_t pad64;
119};
120
121/**
122 * union drm_vmw_extension_arg
123 *
124 * @extension - Ascii name of the extension to be queried. //In
125 * @rep - Reply as defined above. //Out
126 *
127 * Argument to the DRM_VMW_EXTENSION Ioctl.
128 */
129
130union drm_vmw_extension_arg {
131 char extension[DRM_VMW_EXT_NAME_LEN];
132 struct drm_vmw_extension_rep rep;
133};
134
135/*************************************************************************/
136/**
137 * DRM_VMW_CREATE_CONTEXT - Create a host context. 96 * DRM_VMW_CREATE_CONTEXT - Create a host context.
138 * 97 *
139 * Allocates a device unique context id, and queues a create context command 98 * Allocates a device unique context id, and queues a create context command
@@ -292,7 +251,7 @@ union drm_vmw_surface_reference_arg {
292 * DRM_VMW_EXECBUF 251 * DRM_VMW_EXECBUF
293 * 252 *
294 * Submit a command buffer for execution on the host, and return a 253 * Submit a command buffer for execution on the host, and return a
295 * fence sequence that when signaled, indicates that the command buffer has 254 * fence seqno that when signaled, indicates that the command buffer has
296 * executed. 255 * executed.
297 */ 256 */
298 257
@@ -314,21 +273,30 @@ union drm_vmw_surface_reference_arg {
314 * Argument to the DRM_VMW_EXECBUF Ioctl. 273 * Argument to the DRM_VMW_EXECBUF Ioctl.
315 */ 274 */
316 275
317#define DRM_VMW_EXECBUF_VERSION 0 276#define DRM_VMW_EXECBUF_VERSION 1
318 277
319struct drm_vmw_execbuf_arg { 278struct drm_vmw_execbuf_arg {
320 uint64_t commands; 279 uint64_t commands;
321 uint32_t command_size; 280 uint32_t command_size;
322 uint32_t throttle_us; 281 uint32_t throttle_us;
323 uint64_t fence_rep; 282 uint64_t fence_rep;
324 uint32_t version; 283 uint32_t version;
325 uint32_t flags; 284 uint32_t flags;
326}; 285};
327 286
328/** 287/**
329 * struct drm_vmw_fence_rep 288 * struct drm_vmw_fence_rep
330 * 289 *
331 * @fence_seq: Fence sequence associated with a command submission. 290 * @handle: Fence object handle for fence associated with a command submission.
291 * @mask: Fence flags relevant for this fence object.
292 * @seqno: Fence sequence number in fifo. A fence object with a lower
293 * seqno will signal the EXEC flag before a fence object with a higher
294 * seqno. This can be used by user-space to avoid kernel calls to determine
295 * whether a fence has signaled the EXEC flag. Note that @seqno will
296 * wrap at 32-bit.
297 * @passed_seqno: The highest seqno number processed by the hardware
298 * so far. This can be used to mark user-space fence objects as signaled, and
299 * to determine whether a fence seqno might be stale.
332 * @error: This member should've been set to -EFAULT on submission. 300 * @error: This member should've been set to -EFAULT on submission.
333 * The following actions should be take on completion: 301 * The following actions should be take on completion:
334 * error == -EFAULT: Fence communication failed. The host is synchronized. 302 * error == -EFAULT: Fence communication failed. The host is synchronized.
@@ -342,9 +310,12 @@ struct drm_vmw_execbuf_arg {
342 */ 310 */
343 311
344struct drm_vmw_fence_rep { 312struct drm_vmw_fence_rep {
345 uint64_t fence_seq; 313 uint32_t handle;
346 int32_t error; 314 uint32_t mask;
315 uint32_t seqno;
316 uint32_t passed_seqno;
347 uint32_t pad64; 317 uint32_t pad64;
318 int32_t error;
348}; 319};
349 320
350/*************************************************************************/ 321/*************************************************************************/
@@ -435,39 +406,6 @@ struct drm_vmw_unref_dmabuf_arg {
435 406
436/*************************************************************************/ 407/*************************************************************************/
437/** 408/**
438 * DRM_VMW_FIFO_DEBUG - Get last FIFO submission.
439 *
440 * This IOCTL copies the last FIFO submission directly out of the FIFO buffer.
441 */
442
443/**
444 * struct drm_vmw_fifo_debug_arg
445 *
446 * @debug_buffer: User space address of a debug_buffer cast to an uint64_t //In
447 * @debug_buffer_size: Size in bytes of debug buffer //In
448 * @used_size: Number of bytes copied to the buffer // Out
449 * @did_not_fit: Boolean indicating that the fifo contents did not fit. //Out
450 *
451 * Argument to the DRM_VMW_FIFO_DEBUG Ioctl.
452 */
453
454struct drm_vmw_fifo_debug_arg {
455 uint64_t debug_buffer;
456 uint32_t debug_buffer_size;
457 uint32_t used_size;
458 int32_t did_not_fit;
459 uint32_t pad64;
460};
461
462struct drm_vmw_fence_wait_arg {
463 uint64_t sequence;
464 uint64_t kernel_cookie;
465 int32_t cookie_valid;
466 int32_t pad64;
467};
468
469/*************************************************************************/
470/**
471 * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams. 409 * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams.
472 * 410 *
473 * This IOCTL controls the overlay units of the svga device. 411 * This IOCTL controls the overlay units of the svga device.
@@ -590,22 +528,259 @@ struct drm_vmw_stream_arg {
590 528
591/*************************************************************************/ 529/*************************************************************************/
592/** 530/**
531 * DRM_VMW_GET_3D_CAP
532 *
533 * Read 3D capabilities from the FIFO
534 *
535 */
536
537/**
538 * struct drm_vmw_get_3d_cap_arg
539 *
540 * @buffer: Pointer to a buffer for capability data, cast to an uint64_t
541 * @size: Max size to copy
542 *
543 * Input argument to the DRM_VMW_GET_3D_CAP_IOCTL
544 * ioctls.
545 */
546
547struct drm_vmw_get_3d_cap_arg {
548 uint64_t buffer;
549 uint32_t max_size;
550 uint32_t pad64;
551};
552
553/*************************************************************************/
554/**
555 * DRM_VMW_FENCE_WAIT
556 *
557 * Waits for a fence object to signal. The wait is interruptible, so that
558 * signals may be delivered during the interrupt. The wait may timeout,
559 * in which case the calls returns -EBUSY. If the wait is restarted,
560 * that is restarting without resetting @cookie_valid to zero,
561 * the timeout is computed from the first call.
562 *
563 * The flags argument to the DRM_VMW_FENCE_WAIT ioctl indicates what to wait
564 * on:
565 * DRM_VMW_FENCE_FLAG_EXEC: All commands ahead of the fence in the command
566 * stream
567 * have executed.
568 * DRM_VMW_FENCE_FLAG_QUERY: All query results resulting from query finish
569 * commands
570 * in the buffer given to the EXECBUF ioctl returning the fence object handle
571 * are available to user-space.
572 *
573 * DRM_VMW_WAIT_OPTION_UNREF: If this wait option is given, and the
574 * fenc wait ioctl returns 0, the fence object has been unreferenced after
575 * the wait.
576 */
577
578#define DRM_VMW_FENCE_FLAG_EXEC (1 << 0)
579#define DRM_VMW_FENCE_FLAG_QUERY (1 << 1)
580
581#define DRM_VMW_WAIT_OPTION_UNREF (1 << 0)
582
583/**
584 * struct drm_vmw_fence_wait_arg
585 *
586 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
587 * @cookie_valid: Must be reset to 0 on first call. Left alone on restart.
588 * @kernel_cookie: Set to 0 on first call. Left alone on restart.
589 * @timeout_us: Wait timeout in microseconds. 0 for indefinite timeout.
590 * @lazy: Set to 1 if timing is not critical. Allow more than a kernel tick
591 * before returning.
592 * @flags: Fence flags to wait on.
593 * @wait_options: Options that control the behaviour of the wait ioctl.
594 *
595 * Input argument to the DRM_VMW_FENCE_WAIT ioctl.
596 */
597
598struct drm_vmw_fence_wait_arg {
599 uint32_t handle;
600 int32_t cookie_valid;
601 uint64_t kernel_cookie;
602 uint64_t timeout_us;
603 int32_t lazy;
604 int32_t flags;
605 int32_t wait_options;
606 int32_t pad64;
607};
608
609/*************************************************************************/
610/**
611 * DRM_VMW_FENCE_SIGNALED
612 *
613 * Checks if a fence object is signaled..
614 */
615
616/**
617 * struct drm_vmw_fence_signaled_arg
618 *
619 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
620 * @flags: Fence object flags input to DRM_VMW_FENCE_SIGNALED ioctl
621 * @signaled: Out: Flags signaled.
622 * @sequence: Out: Highest sequence passed so far. Can be used to signal the
623 * EXEC flag of user-space fence objects.
624 *
625 * Input/Output argument to the DRM_VMW_FENCE_SIGNALED and DRM_VMW_FENCE_UNREF
626 * ioctls.
627 */
628
629struct drm_vmw_fence_signaled_arg {
630 uint32_t handle;
631 uint32_t flags;
632 int32_t signaled;
633 uint32_t passed_seqno;
634 uint32_t signaled_flags;
635 uint32_t pad64;
636};
637
638/*************************************************************************/
639/**
640 * DRM_VMW_FENCE_UNREF
641 *
642 * Unreferences a fence object, and causes it to be destroyed if there are no
643 * other references to it.
644 *
645 */
646
647/**
648 * struct drm_vmw_fence_arg
649 *
650 * @handle: Fence object handle as returned by the DRM_VMW_EXECBUF ioctl.
651 *
652 * Input/Output argument to the DRM_VMW_FENCE_UNREF ioctl..
653 */
654
655struct drm_vmw_fence_arg {
656 uint32_t handle;
657 uint32_t pad64;
658};
659
660
661/*************************************************************************/
662/**
663 * DRM_VMW_FENCE_EVENT
664 *
665 * Queues an event on a fence to be delivered on the drm character device
666 * when the fence has signaled the DRM_VMW_FENCE_FLAG_EXEC flag.
667 * Optionally the approximate time when the fence signaled is
668 * given by the event.
669 */
670
671/*
672 * The event type
673 */
674#define DRM_VMW_EVENT_FENCE_SIGNALED 0x80000000
675
676struct drm_vmw_event_fence {
677 struct drm_event base;
678 uint64_t user_data;
679 uint32_t tv_sec;
680 uint32_t tv_usec;
681};
682
683/*
684 * Flags that may be given to the command.
685 */
686/* Request fence signaled time on the event. */
687#define DRM_VMW_FE_FLAG_REQ_TIME (1 << 0)
688
689/**
690 * struct drm_vmw_fence_event_arg
691 *
692 * @fence_rep: Pointer to fence_rep structure cast to uint64_t or 0 if
693 * the fence is not supposed to be referenced by user-space.
694 * @user_info: Info to be delivered with the event.
695 * @handle: Attach the event to this fence only.
696 * @flags: A set of flags as defined above.
697 */
698struct drm_vmw_fence_event_arg {
699 uint64_t fence_rep;
700 uint64_t user_data;
701 uint32_t handle;
702 uint32_t flags;
703};
704
705
706/*************************************************************************/
707/**
708 * DRM_VMW_PRESENT
709 *
710 * Executes an SVGA present on a given fb for a given surface. The surface
711 * is placed on the framebuffer. Cliprects are given relative to the given
712 * point (the point disignated by dest_{x|y}).
713 *
714 */
715
716/**
717 * struct drm_vmw_present_arg
718 * @fb_id: framebuffer id to present / read back from.
719 * @sid: Surface id to present from.
720 * @dest_x: X placement coordinate for surface.
721 * @dest_y: Y placement coordinate for surface.
722 * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t.
723 * @num_clips: Number of cliprects given relative to the framebuffer origin,
724 * in the same coordinate space as the frame buffer.
725 * @pad64: Unused 64-bit padding.
726 *
727 * Input argument to the DRM_VMW_PRESENT ioctl.
728 */
729
730struct drm_vmw_present_arg {
731 uint32_t fb_id;
732 uint32_t sid;
733 int32_t dest_x;
734 int32_t dest_y;
735 uint64_t clips_ptr;
736 uint32_t num_clips;
737 uint32_t pad64;
738};
739
740
741/*************************************************************************/
742/**
743 * DRM_VMW_PRESENT_READBACK
744 *
745 * Executes an SVGA present readback from a given fb to the dma buffer
746 * currently bound as the fb. If there is no dma buffer bound to the fb,
747 * an error will be returned.
748 *
749 */
750
751/**
752 * struct drm_vmw_present_arg
753 * @fb_id: fb_id to present / read back from.
754 * @num_clips: Number of cliprects.
755 * @clips_ptr: Pointer to an array of clip rects cast to an uint64_t.
756 * @fence_rep: Pointer to a struct drm_vmw_fence_rep, cast to an uint64_t.
757 * If this member is NULL, then the ioctl should not return a fence.
758 */
759
760struct drm_vmw_present_readback_arg {
761 uint32_t fb_id;
762 uint32_t num_clips;
763 uint64_t clips_ptr;
764 uint64_t fence_rep;
765};
766
767/*************************************************************************/
768/**
593 * DRM_VMW_UPDATE_LAYOUT - Update layout 769 * DRM_VMW_UPDATE_LAYOUT - Update layout
594 * 770 *
595 * Updates the preferred modes and connection status for connectors. The 771 * Updates the preferred modes and connection status for connectors. The
596 * command conisits of one drm_vmw_update_layout_arg pointing out a array 772 * command consists of one drm_vmw_update_layout_arg pointing to an array
597 * of num_outputs drm_vmw_rect's. 773 * of num_outputs drm_vmw_rect's.
598 */ 774 */
599 775
600/** 776/**
601 * struct drm_vmw_update_layout_arg 777 * struct drm_vmw_update_layout_arg
602 * 778 *
603 * @num_outputs: number of active 779 * @num_outputs: number of active connectors
604 * @rects: pointer to array of drm_vmw_rect 780 * @rects: pointer to array of drm_vmw_rect cast to an uint64_t
605 * 781 *
606 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl. 782 * Input argument to the DRM_VMW_UPDATE_LAYOUT Ioctl.
607 */ 783 */
608
609struct drm_vmw_update_layout_arg { 784struct drm_vmw_update_layout_arg {
610 uint32_t num_outputs; 785 uint32_t num_outputs;
611 uint32_t pad64; 786 uint32_t pad64;
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 2dcb72bff4b6..2314ad8b3c9c 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -117,6 +117,7 @@ struct kiocb {
117 117
118 struct list_head ki_list; /* the aio core uses this 118 struct list_head ki_list; /* the aio core uses this
119 * for cancellation */ 119 * for cancellation */
120 struct list_head ki_batch; /* batch allocation */
120 121
121 /* 122 /*
122 * If the aio_resfd field of the userspace iocb is not zero, 123 * If the aio_resfd field of the userspace iocb is not zero,
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h
index c5d6095b46f8..975009e1cbe6 100644
--- a/include/linux/alarmtimer.h
+++ b/include/linux/alarmtimer.h
@@ -13,6 +13,16 @@ enum alarmtimer_type {
13 ALARM_NUMTYPE, 13 ALARM_NUMTYPE,
14}; 14};
15 15
16enum alarmtimer_restart {
17 ALARMTIMER_NORESTART,
18 ALARMTIMER_RESTART,
19};
20
21
22#define ALARMTIMER_STATE_INACTIVE 0x00
23#define ALARMTIMER_STATE_ENQUEUED 0x01
24#define ALARMTIMER_STATE_CALLBACK 0x02
25
16/** 26/**
17 * struct alarm - Alarm timer structure 27 * struct alarm - Alarm timer structure
18 * @node: timerqueue node for adding to the event list this value 28 * @node: timerqueue node for adding to the event list this value
@@ -25,16 +35,45 @@ enum alarmtimer_type {
25 */ 35 */
26struct alarm { 36struct alarm {
27 struct timerqueue_node node; 37 struct timerqueue_node node;
28 ktime_t period; 38 enum alarmtimer_restart (*function)(struct alarm *, ktime_t now);
29 void (*function)(struct alarm *);
30 enum alarmtimer_type type; 39 enum alarmtimer_type type;
31 bool enabled; 40 int state;
32 void *data; 41 void *data;
33}; 42};
34 43
35void alarm_init(struct alarm *alarm, enum alarmtimer_type type, 44void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
36 void (*function)(struct alarm *)); 45 enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
37void alarm_start(struct alarm *alarm, ktime_t start, ktime_t period); 46void alarm_start(struct alarm *alarm, ktime_t start);
38void alarm_cancel(struct alarm *alarm); 47int alarm_try_to_cancel(struct alarm *alarm);
48int alarm_cancel(struct alarm *alarm);
49
50u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval);
51
52/*
53 * A alarmtimer is active, when it is enqueued into timerqueue or the
54 * callback function is running.
55 */
56static inline int alarmtimer_active(const struct alarm *timer)
57{
58 return timer->state != ALARMTIMER_STATE_INACTIVE;
59}
60
61/*
62 * Helper function to check, whether the timer is on one of the queues
63 */
64static inline int alarmtimer_is_queued(struct alarm *timer)
65{
66 return timer->state & ALARMTIMER_STATE_ENQUEUED;
67}
68
69/*
70 * Helper function to check, whether the timer is running the callback
71 * function
72 */
73static inline int alarmtimer_callback_running(struct alarm *timer)
74{
75 return timer->state & ALARMTIMER_STATE_CALLBACK;
76}
77
39 78
40#endif 79#endif
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h
index 5ddd9ad4b19c..2412af944f1f 100644
--- a/include/linux/amba/pl061.h
+++ b/include/linux/amba/pl061.h
@@ -7,8 +7,7 @@ struct pl061_platform_data {
7 unsigned gpio_base; 7 unsigned gpio_base;
8 8
9 /* number of the first IRQ. 9 /* number of the first IRQ.
10 * If the IRQ functionality in not desired this must be set to 10 * If the IRQ functionality in not desired this must be set to NO_IRQ.
11 * (unsigned) -1.
12 */ 11 */
13 unsigned irq_base; 12 unsigned irq_base;
14 13
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index e6e28f37d8ec..9eabffbc4e50 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -47,6 +47,9 @@ enum {
47 * @muxval: a number usually used to poke into some mux regiser to 47 * @muxval: a number usually used to poke into some mux regiser to
48 * mux in the signal to this channel 48 * mux in the signal to this channel
49 * @cctl_opt: default options for the channel control register 49 * @cctl_opt: default options for the channel control register
50 * @device_fc: Flow Controller Settings for ccfg register. Only valid for slave
51 * channels. Fill with 'true' if peripheral should be flow controller. Direction
52 * will be selected at Runtime.
50 * @addr: source/target address in physical memory for this DMA channel, 53 * @addr: source/target address in physical memory for this DMA channel,
51 * can be the address of a FIFO register for burst requests for example. 54 * can be the address of a FIFO register for burst requests for example.
52 * This can be left undefined if the PrimeCell API is used for configuring 55 * This can be left undefined if the PrimeCell API is used for configuring
@@ -65,6 +68,7 @@ struct pl08x_channel_data {
65 int max_signal; 68 int max_signal;
66 u32 muxval; 69 u32 muxval;
67 u32 cctl; 70 u32 cctl;
71 bool device_fc;
68 dma_addr_t addr; 72 dma_addr_t addr;
69 bool circular_buffer; 73 bool circular_buffer;
70 bool single; 74 bool single;
@@ -77,13 +81,11 @@ struct pl08x_channel_data {
77 * @addr: current address 81 * @addr: current address
78 * @maxwidth: the maximum width of a transfer on this bus 82 * @maxwidth: the maximum width of a transfer on this bus
79 * @buswidth: the width of this bus in bytes: 1, 2 or 4 83 * @buswidth: the width of this bus in bytes: 1, 2 or 4
80 * @fill_bytes: bytes required to fill to the next bus memory boundary
81 */ 84 */
82struct pl08x_bus_data { 85struct pl08x_bus_data {
83 dma_addr_t addr; 86 dma_addr_t addr;
84 u8 maxwidth; 87 u8 maxwidth;
85 u8 buswidth; 88 u8 buswidth;
86 size_t fill_bytes;
87}; 89};
88 90
89/** 91/**
@@ -104,17 +106,35 @@ struct pl08x_phy_chan {
104}; 106};
105 107
106/** 108/**
109 * struct pl08x_sg - structure containing data per sg
110 * @src_addr: src address of sg
111 * @dst_addr: dst address of sg
112 * @len: transfer len in bytes
113 * @node: node for txd's dsg_list
114 */
115struct pl08x_sg {
116 dma_addr_t src_addr;
117 dma_addr_t dst_addr;
118 size_t len;
119 struct list_head node;
120};
121
122/**
107 * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor 123 * struct pl08x_txd - wrapper for struct dma_async_tx_descriptor
124 * @tx: async tx descriptor
125 * @node: node for txd list for channels
126 * @dsg_list: list of children sg's
127 * @direction: direction of transfer
108 * @llis_bus: DMA memory address (physical) start for the LLIs 128 * @llis_bus: DMA memory address (physical) start for the LLIs
109 * @llis_va: virtual memory address start for the LLIs 129 * @llis_va: virtual memory address start for the LLIs
130 * @cctl: control reg values for current txd
131 * @ccfg: config reg values for current txd
110 */ 132 */
111struct pl08x_txd { 133struct pl08x_txd {
112 struct dma_async_tx_descriptor tx; 134 struct dma_async_tx_descriptor tx;
113 struct list_head node; 135 struct list_head node;
136 struct list_head dsg_list;
114 enum dma_data_direction direction; 137 enum dma_data_direction direction;
115 dma_addr_t src_addr;
116 dma_addr_t dst_addr;
117 size_t len;
118 dma_addr_t llis_bus; 138 dma_addr_t llis_bus;
119 struct pl08x_lli *llis_va; 139 struct pl08x_lli *llis_va;
120 /* Default cctl value for LLIs */ 140 /* Default cctl value for LLIs */
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h
index cbee7de7dd36..d12f077a6daf 100644
--- a/include/linux/amba/pl330.h
+++ b/include/linux/amba/pl330.h
@@ -19,12 +19,8 @@ struct dma_pl330_peri {
19 * Peri_Req i/f of the DMAC that is 19 * Peri_Req i/f of the DMAC that is
20 * peripheral could be reached from. 20 * peripheral could be reached from.
21 */ 21 */
22 u8 peri_id; /* {0, 31} */ 22 u8 peri_id; /* specific dma id */
23 enum pl330_reqtype rqtype; 23 enum pl330_reqtype rqtype;
24
25 /* For M->D and D->M Channels */
26 int burst_sz; /* in power of 2 */
27 dma_addr_t fifo_addr;
28}; 24};
29 25
30struct dma_pl330_platdata { 26struct dma_pl330_platdata {
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index d34c187432ed..f57c36881c48 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/byteorder.h> 5#include <asm/byteorder.h>
6#include <linux/socket.h>
6 7
7/* 8/*
8 * AppleTalk networking structures 9 * AppleTalk networking structures
@@ -28,7 +29,7 @@ struct atalk_addr {
28}; 29};
29 30
30struct sockaddr_at { 31struct sockaddr_at {
31 sa_family_t sat_family; 32 __kernel_sa_family_t sat_family;
32 __u8 sat_port; 33 __u8 sat_port;
33 struct atalk_addr sat_addr; 34 struct atalk_addr sat_addr;
34 char sat_zero[8]; 35 char sat_zero[8];
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h
index 3e09b345f4d6..4c7a4b2104bf 100644
--- a/include/linux/atmel-mci.h
+++ b/include/linux/atmel-mci.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_ATMEL_MCI_H 1#ifndef __LINUX_ATMEL_MCI_H
2#define __LINUX_ATMEL_MCI_H 2#define __LINUX_ATMEL_MCI_H
3 3
4#define ATMEL_MCI_MAX_NR_SLOTS 2 4#define ATMCI_MAX_NR_SLOTS 2
5 5
6/** 6/**
7 * struct mci_slot_pdata - board-specific per-slot configuration 7 * struct mci_slot_pdata - board-specific per-slot configuration
@@ -33,7 +33,7 @@ struct mci_slot_pdata {
33 */ 33 */
34struct mci_platform_data { 34struct mci_platform_data {
35 struct mci_dma_data *dma_slave; 35 struct mci_dma_data *dma_slave;
36 struct mci_slot_pdata slot[ATMEL_MCI_MAX_NR_SLOTS]; 36 struct mci_slot_pdata slot[ATMCI_MAX_NR_SLOTS];
37}; 37};
38 38
39#endif /* __LINUX_ATMEL_MCI_H */ 39#endif /* __LINUX_ATMEL_MCI_H */
diff --git a/include/linux/atmel_pdc.h b/include/linux/atmel_pdc.h
index 5058a31d2ce8..63499ce806ea 100644
--- a/include/linux/atmel_pdc.h
+++ b/include/linux/atmel_pdc.h
@@ -33,4 +33,6 @@
33 33
34#define ATMEL_PDC_PTSR 0x124 /* Transfer Status Register */ 34#define ATMEL_PDC_PTSR 0x124 /* Transfer Status Register */
35 35
36#define ATMEL_PDC_SCND_BUF_OFF 0x10 /* Offset between first and second buffer registers */
37
36#endif 38#endif
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 0c8006129fb2..2f81c6f3b630 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -584,14 +584,13 @@ extern int audit_signals;
584#ifdef CONFIG_AUDIT 584#ifdef CONFIG_AUDIT
585/* These are defined in audit.c */ 585/* These are defined in audit.c */
586 /* Public API */ 586 /* Public API */
587extern void audit_log(struct audit_context *ctx, gfp_t gfp_mask, 587extern __printf(4, 5)
588 int type, const char *fmt, ...) 588void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
589 __attribute__((format(printf,4,5))); 589 const char *fmt, ...);
590 590
591extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type); 591extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
592extern void audit_log_format(struct audit_buffer *ab, 592extern __printf(2, 3)
593 const char *fmt, ...) 593void audit_log_format(struct audit_buffer *ab, const char *fmt, ...);
594 __attribute__((format(printf,2,3)));
595extern void audit_log_end(struct audit_buffer *ab); 594extern void audit_log_end(struct audit_buffer *ab);
596extern int audit_string_contains_control(const char *string, 595extern int audit_string_contains_control(const char *string,
597 size_t len); 596 size_t len);
diff --git a/include/linux/ax25.h b/include/linux/ax25.h
index 56c11f0dbd80..74c89a41732d 100644
--- a/include/linux/ax25.h
+++ b/include/linux/ax25.h
@@ -47,7 +47,7 @@ typedef struct {
47} ax25_address; 47} ax25_address;
48 48
49struct sockaddr_ax25 { 49struct sockaddr_ax25 {
50 sa_family_t sax25_family; 50 __kernel_sa_family_t sax25_family;
51 ax25_address sax25_call; 51 ax25_address sax25_call;
52 int sax25_ndigis; 52 int sax25_ndigis;
53 /* Digipeater ax25_address sets follow */ 53 /* Digipeater ax25_address sets follow */
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 3b2f9cb82986..b1038bd686ac 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -40,6 +40,7 @@ typedef int (congested_fn)(void *, int);
40enum bdi_stat_item { 40enum bdi_stat_item {
41 BDI_RECLAIMABLE, 41 BDI_RECLAIMABLE,
42 BDI_WRITEBACK, 42 BDI_WRITEBACK,
43 BDI_DIRTIED,
43 BDI_WRITTEN, 44 BDI_WRITTEN,
44 NR_BDI_STAT_ITEMS 45 NR_BDI_STAT_ITEMS
45}; 46};
@@ -74,10 +75,20 @@ struct backing_dev_info {
74 struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; 75 struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS];
75 76
76 unsigned long bw_time_stamp; /* last time write bw is updated */ 77 unsigned long bw_time_stamp; /* last time write bw is updated */
78 unsigned long dirtied_stamp;
77 unsigned long written_stamp; /* pages written at bw_time_stamp */ 79 unsigned long written_stamp; /* pages written at bw_time_stamp */
78 unsigned long write_bandwidth; /* the estimated write bandwidth */ 80 unsigned long write_bandwidth; /* the estimated write bandwidth */
79 unsigned long avg_write_bandwidth; /* further smoothed write bw */ 81 unsigned long avg_write_bandwidth; /* further smoothed write bw */
80 82
83 /*
84 * The base dirty throttle rate, re-calculated on every 200ms.
85 * All the bdi tasks' dirty rate will be curbed under it.
86 * @dirty_ratelimit tracks the estimated @balanced_dirty_ratelimit
87 * in small steps and is much more smooth/stable than the latter.
88 */
89 unsigned long dirty_ratelimit;
90 unsigned long balanced_dirty_ratelimit;
91
81 struct prop_local_percpu completions; 92 struct prop_local_percpu completions;
82 int dirty_exceeded; 93 int dirty_exceeded;
83 94
@@ -107,7 +118,8 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
107int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 118int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
108void bdi_unregister(struct backing_dev_info *bdi); 119void bdi_unregister(struct backing_dev_info *bdi);
109int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int); 120int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int);
110void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages); 121void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages,
122 enum wb_reason reason);
111void bdi_start_background_writeback(struct backing_dev_info *bdi); 123void bdi_start_background_writeback(struct backing_dev_info *bdi);
112int bdi_writeback_thread(void *data); 124int bdi_writeback_thread(void *data);
113int bdi_has_dirty_io(struct backing_dev_info *bdi); 125int bdi_has_dirty_io(struct backing_dev_info *bdi);
diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h
index 98999cf107ce..feb912196745 100644
--- a/include/linux/basic_mmio_gpio.h
+++ b/include/linux/basic_mmio_gpio.h
@@ -63,15 +63,10 @@ static inline struct bgpio_chip *to_bgpio_chip(struct gpio_chip *gc)
63 return container_of(gc, struct bgpio_chip, gc); 63 return container_of(gc, struct bgpio_chip, gc);
64} 64}
65 65
66int __devexit bgpio_remove(struct bgpio_chip *bgc); 66int bgpio_remove(struct bgpio_chip *bgc);
67int __devinit bgpio_init(struct bgpio_chip *bgc, 67int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
68 struct device *dev, 68 unsigned long sz, void __iomem *dat, void __iomem *set,
69 unsigned long sz, 69 void __iomem *clr, void __iomem *dirout, void __iomem *dirin,
70 void __iomem *dat, 70 bool big_endian);
71 void __iomem *set,
72 void __iomem *clr,
73 void __iomem *dirout,
74 void __iomem *dirin,
75 bool big_endian);
76 71
77#endif /* __BASIC_MMIO_GPIO_H */ 72#endif /* __BASIC_MMIO_GPIO_H */
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 8c96654bef16..4d4b59de9467 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/bcma/bcma_driver_mips.h>
9#include <linux/ssb/ssb.h> /* SPROM sharing */ 10#include <linux/ssb/ssb.h> /* SPROM sharing */
10 11
11#include "bcma_regs.h" 12#include "bcma_regs.h"
@@ -14,9 +15,9 @@ struct bcma_device;
14struct bcma_bus; 15struct bcma_bus;
15 16
16enum bcma_hosttype { 17enum bcma_hosttype {
17 BCMA_HOSTTYPE_NONE,
18 BCMA_HOSTTYPE_PCI, 18 BCMA_HOSTTYPE_PCI,
19 BCMA_HOSTTYPE_SDIO, 19 BCMA_HOSTTYPE_SDIO,
20 BCMA_HOSTTYPE_SOC,
20}; 21};
21 22
22struct bcma_chipinfo { 23struct bcma_chipinfo {
@@ -130,6 +131,7 @@ struct bcma_device {
130 131
131 struct device dev; 132 struct device dev;
132 struct device *dma_dev; 133 struct device *dma_dev;
134
133 unsigned int irq; 135 unsigned int irq;
134 bool dev_registered; 136 bool dev_registered;
135 137
@@ -138,6 +140,9 @@ struct bcma_device {
138 u32 addr; 140 u32 addr;
139 u32 wrap; 141 u32 wrap;
140 142
143 void __iomem *io_addr;
144 void __iomem *io_wrap;
145
141 void *drvdata; 146 void *drvdata;
142 struct list_head list; 147 struct list_head list;
143}; 148};
@@ -165,10 +170,9 @@ struct bcma_driver {
165}; 170};
166extern 171extern
167int __bcma_driver_register(struct bcma_driver *drv, struct module *owner); 172int __bcma_driver_register(struct bcma_driver *drv, struct module *owner);
168static inline int bcma_driver_register(struct bcma_driver *drv) 173#define bcma_driver_register(drv) \
169{ 174 __bcma_driver_register(drv, THIS_MODULE)
170 return __bcma_driver_register(drv, THIS_MODULE); 175
171}
172extern void bcma_driver_unregister(struct bcma_driver *drv); 176extern void bcma_driver_unregister(struct bcma_driver *drv);
173 177
174struct bcma_bus { 178struct bcma_bus {
@@ -190,9 +194,11 @@ struct bcma_bus {
190 struct bcma_device *mapped_core; 194 struct bcma_device *mapped_core;
191 struct list_head cores; 195 struct list_head cores;
192 u8 nr_cores; 196 u8 nr_cores;
197 u8 init_done:1;
193 198
194 struct bcma_drv_cc drv_cc; 199 struct bcma_drv_cc drv_cc;
195 struct bcma_drv_pci drv_pci; 200 struct bcma_drv_pci drv_pci;
201 struct bcma_drv_mips drv_mips;
196 202
197 /* We decided to share SPROM struct with SSB as long as we do not need 203 /* We decided to share SPROM struct with SSB as long as we do not need
198 * any hacks for BCMA. This simplifies drivers code. */ 204 * any hacks for BCMA. This simplifies drivers code. */
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index a0f684615ae5..1526d965ed06 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -24,6 +24,7 @@
24#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ 24#define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */
25#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ 25#define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */
26#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ 26#define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */
27#define BCMA_CC_FLASHT_NFLASH 0x00000200
27#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ 28#define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */
28#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ 29#define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */
29#define BCMA_PLLTYPE_NONE 0x00000000 30#define BCMA_PLLTYPE_NONE 0x00000000
@@ -178,6 +179,7 @@
178#define BCMA_CC_PROG_CFG 0x0120 179#define BCMA_CC_PROG_CFG 0x0120
179#define BCMA_CC_PROG_WAITCNT 0x0124 180#define BCMA_CC_PROG_WAITCNT 0x0124
180#define BCMA_CC_FLASH_CFG 0x0128 181#define BCMA_CC_FLASH_CFG 0x0128
182#define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */
181#define BCMA_CC_FLASH_WAITCNT 0x012C 183#define BCMA_CC_FLASH_WAITCNT 0x012C
182/* 0x1E0 is defined as shared BCMA_CLKCTLST */ 184/* 0x1E0 is defined as shared BCMA_CLKCTLST */
183#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ 185#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */
@@ -239,6 +241,64 @@
239#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ 241#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */
240#define BCMA_CC_SPROM_PCIE6 0x0830 /* SPROM beginning on PCIe rev >= 6 */ 242#define BCMA_CC_SPROM_PCIE6 0x0830 /* SPROM beginning on PCIe rev >= 6 */
241 243
244/* Divider allocation in 4716/47162/5356 */
245#define BCMA_CC_PMU5_MAINPLL_CPU 1
246#define BCMA_CC_PMU5_MAINPLL_MEM 2
247#define BCMA_CC_PMU5_MAINPLL_SSB 3
248
249/* PLL usage in 4716/47162 */
250#define BCMA_CC_PMU4716_MAINPLL_PLL0 12
251
252/* PLL usage in 5356/5357 */
253#define BCMA_CC_PMU5356_MAINPLL_PLL0 0
254#define BCMA_CC_PMU5357_MAINPLL_PLL0 0
255
256/* 4706 PMU */
257#define BCMA_CC_PMU4706_MAINPLL_PLL0 0
258
259/* ALP clock on pre-PMU chips */
260#define BCMA_CC_PMU_ALP_CLOCK 20000000
261/* HT clock for systems with PMU-enabled chipcommon */
262#define BCMA_CC_PMU_HT_CLOCK 80000000
263
264/* PMU rev 5 (& 6) */
265#define BCMA_CC_PPL_P1P2_OFF 0
266#define BCMA_CC_PPL_P1_MASK 0x0f000000
267#define BCMA_CC_PPL_P1_SHIFT 24
268#define BCMA_CC_PPL_P2_MASK 0x00f00000
269#define BCMA_CC_PPL_P2_SHIFT 20
270#define BCMA_CC_PPL_M14_OFF 1
271#define BCMA_CC_PPL_MDIV_MASK 0x000000ff
272#define BCMA_CC_PPL_MDIV_WIDTH 8
273#define BCMA_CC_PPL_NM5_OFF 2
274#define BCMA_CC_PPL_NDIV_MASK 0xfff00000
275#define BCMA_CC_PPL_NDIV_SHIFT 20
276#define BCMA_CC_PPL_FMAB_OFF 3
277#define BCMA_CC_PPL_MRAT_MASK 0xf0000000
278#define BCMA_CC_PPL_MRAT_SHIFT 28
279#define BCMA_CC_PPL_ABRAT_MASK 0x08000000
280#define BCMA_CC_PPL_ABRAT_SHIFT 27
281#define BCMA_CC_PPL_FDIV_MASK 0x07ffffff
282#define BCMA_CC_PPL_PLLCTL_OFF 4
283#define BCMA_CC_PPL_PCHI_OFF 5
284#define BCMA_CC_PPL_PCHI_MASK 0x0000003f
285
286/* BCM4331 ChipControl numbers. */
287#define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */
288#define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */
289#define BCMA_CHIPCTL_4331_EXT_LNA BIT(2) /* 0 disable */
290#define BCMA_CHIPCTL_4331_SPROM_GPIO13_15 BIT(3) /* sprom/gpio13-15 mux */
291#define BCMA_CHIPCTL_4331_EXTPA_EN BIT(4) /* 0 ext pa disable, 1 ext pa enabled */
292#define BCMA_CHIPCTL_4331_GPIOCLK_ON_SPROMCS BIT(5) /* set drive out GPIO_CLK on sprom_cs pin */
293#define BCMA_CHIPCTL_4331_PCIE_MDIO_ON_SPROMCS BIT(6) /* use sprom_cs pin as PCIE mdio interface */
294#define BCMA_CHIPCTL_4331_EXTPA_ON_GPIO2_5 BIT(7) /* aband extpa will be at gpio2/5 and sprom_dout */
295#define BCMA_CHIPCTL_4331_OVR_PIPEAUXCLKEN BIT(8) /* override core control on pipe_AuxClkEnable */
296#define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */
297#define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */
298#define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */
299#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */
300#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */
301
242/* Data for the PMU, if available. 302/* Data for the PMU, if available.
243 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 303 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
244 */ 304 */
@@ -247,14 +307,37 @@ struct bcma_chipcommon_pmu {
247 u32 crystalfreq; /* The active crystal frequency (in kHz) */ 307 u32 crystalfreq; /* The active crystal frequency (in kHz) */
248}; 308};
249 309
310#ifdef CONFIG_BCMA_DRIVER_MIPS
311struct bcma_pflash {
312 u8 buswidth;
313 u32 window;
314 u32 window_size;
315};
316
317struct bcma_serial_port {
318 void *regs;
319 unsigned long clockspeed;
320 unsigned int irq;
321 unsigned int baud_base;
322 unsigned int reg_shift;
323};
324#endif /* CONFIG_BCMA_DRIVER_MIPS */
325
250struct bcma_drv_cc { 326struct bcma_drv_cc {
251 struct bcma_device *core; 327 struct bcma_device *core;
252 u32 status; 328 u32 status;
253 u32 capabilities; 329 u32 capabilities;
254 u32 capabilities_ext; 330 u32 capabilities_ext;
331 u8 setup_done:1;
255 /* Fast Powerup Delay constant */ 332 /* Fast Powerup Delay constant */
256 u16 fast_pwrup_delay; 333 u16 fast_pwrup_delay;
257 struct bcma_chipcommon_pmu pmu; 334 struct bcma_chipcommon_pmu pmu;
335#ifdef CONFIG_BCMA_DRIVER_MIPS
336 struct bcma_pflash pflash;
337
338 int nr_serial_ports;
339 struct bcma_serial_port serial_ports[4];
340#endif /* CONFIG_BCMA_DRIVER_MIPS */
258}; 341};
259 342
260/* Register access */ 343/* Register access */
@@ -275,6 +358,8 @@ extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
275extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); 358extern void bcma_chipco_suspend(struct bcma_drv_cc *cc);
276extern void bcma_chipco_resume(struct bcma_drv_cc *cc); 359extern void bcma_chipco_resume(struct bcma_drv_cc *cc);
277 360
361void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
362
278extern void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, 363extern void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc,
279 u32 ticks); 364 u32 ticks);
280 365
@@ -293,4 +378,13 @@ u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value);
293/* PMU support */ 378/* PMU support */
294extern void bcma_pmu_init(struct bcma_drv_cc *cc); 379extern void bcma_pmu_init(struct bcma_drv_cc *cc);
295 380
381extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset,
382 u32 value);
383extern void bcma_chipco_pll_maskset(struct bcma_drv_cc *cc, u32 offset,
384 u32 mask, u32 set);
385extern void bcma_chipco_chipctl_maskset(struct bcma_drv_cc *cc,
386 u32 offset, u32 mask, u32 set);
387extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc,
388 u32 offset, u32 mask, u32 set);
389
296#endif /* LINUX_BCMA_DRIVER_CC_H_ */ 390#endif /* LINUX_BCMA_DRIVER_CC_H_ */
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h
new file mode 100644
index 000000000000..c0043645cdcb
--- /dev/null
+++ b/include/linux/bcma/bcma_driver_mips.h
@@ -0,0 +1,51 @@
1#ifndef LINUX_BCMA_DRIVER_MIPS_H_
2#define LINUX_BCMA_DRIVER_MIPS_H_
3
4#define BCMA_MIPS_IPSFLAG 0x0F08
5/* which sbflags get routed to mips interrupt 1 */
6#define BCMA_MIPS_IPSFLAG_IRQ1 0x0000003F
7#define BCMA_MIPS_IPSFLAG_IRQ1_SHIFT 0
8/* which sbflags get routed to mips interrupt 2 */
9#define BCMA_MIPS_IPSFLAG_IRQ2 0x00003F00
10#define BCMA_MIPS_IPSFLAG_IRQ2_SHIFT 8
11/* which sbflags get routed to mips interrupt 3 */
12#define BCMA_MIPS_IPSFLAG_IRQ3 0x003F0000
13#define BCMA_MIPS_IPSFLAG_IRQ3_SHIFT 16
14/* which sbflags get routed to mips interrupt 4 */
15#define BCMA_MIPS_IPSFLAG_IRQ4 0x3F000000
16#define BCMA_MIPS_IPSFLAG_IRQ4_SHIFT 24
17
18/* MIPS 74K core registers */
19#define BCMA_MIPS_MIPS74K_CORECTL 0x0000
20#define BCMA_MIPS_MIPS74K_EXCEPTBASE 0x0004
21#define BCMA_MIPS_MIPS74K_BIST 0x000C
22#define BCMA_MIPS_MIPS74K_INTMASK_INT0 0x0014
23#define BCMA_MIPS_MIPS74K_INTMASK(int) \
24 ((int) * 4 + BCMA_MIPS_MIPS74K_INTMASK_INT0)
25#define BCMA_MIPS_MIPS74K_NMIMASK 0x002C
26#define BCMA_MIPS_MIPS74K_GPIOSEL 0x0040
27#define BCMA_MIPS_MIPS74K_GPIOOUT 0x0044
28#define BCMA_MIPS_MIPS74K_GPIOEN 0x0048
29#define BCMA_MIPS_MIPS74K_CLKCTLST 0x01E0
30
31#define BCMA_MIPS_OOBSELOUTA30 0x100
32
33struct bcma_device;
34
35struct bcma_drv_mips {
36 struct bcma_device *core;
37 u8 setup_done:1;
38 unsigned int assigned_irqs;
39};
40
41#ifdef CONFIG_BCMA_DRIVER_MIPS
42extern void bcma_core_mips_init(struct bcma_drv_mips *mcore);
43#else
44static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { }
45#endif
46
47extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
48
49extern unsigned int bcma_core_mips_irq(struct bcma_device *dev);
50
51#endif /* LINUX_BCMA_DRIVER_MIPS_H_ */
diff --git a/include/linux/bcma/bcma_soc.h b/include/linux/bcma/bcma_soc.h
new file mode 100644
index 000000000000..4203c5593b9f
--- /dev/null
+++ b/include/linux/bcma/bcma_soc.h
@@ -0,0 +1,16 @@
1#ifndef LINUX_BCMA_SOC_H_
2#define LINUX_BCMA_SOC_H_
3
4#include <linux/bcma/bcma.h>
5
6struct bcma_soc {
7 struct bcma_bus bus;
8 struct bcma_device core_cc;
9 struct bcma_device core_mips;
10};
11
12int __init bcma_host_soc_register(struct bcma_soc *soc);
13
14int bcma_bus_register(struct bcma_bus *bus);
15
16#endif /* LINUX_BCMA_SOC_H_ */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index ce33e6868a2f..a3c071c9e189 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -269,14 +269,6 @@ extern void bvec_free_bs(struct bio_set *, struct bio_vec *, unsigned int);
269extern unsigned int bvec_nr_vecs(unsigned short idx); 269extern unsigned int bvec_nr_vecs(unsigned short idx);
270 270
271/* 271/*
272 * Allow queuer to specify a completion CPU for this bio
273 */
274static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu)
275{
276 bio->bi_comp_cpu = cpu;
277}
278
279/*
280 * bio_set is used to allow other portions of the IO system to 272 * bio_set is used to allow other portions of the IO system to
281 * allocate their own private memory pools for bio and iovec structures. 273 * allocate their own private memory pools for bio and iovec structures.
282 * These memory pools in turn all allocate from the bio_slab 274 * These memory pools in turn all allocate from the bio_slab
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 6395692b2e7a..4053cbd4490e 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -59,8 +59,6 @@ struct bio {
59 59
60 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ 60 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */
61 61
62 unsigned int bi_comp_cpu; /* completion CPU */
63
64 atomic_t bi_cnt; /* pin count */ 62 atomic_t bi_cnt; /* pin count */
65 63
66 struct bio_vec *bi_io_vec; /* the actual vec list */ 64 struct bio_vec *bi_io_vec; /* the actual vec list */
@@ -93,11 +91,10 @@ struct bio {
93#define BIO_BOUNCED 5 /* bio is a bounce bio */ 91#define BIO_BOUNCED 5 /* bio is a bounce bio */
94#define BIO_USER_MAPPED 6 /* contains user pages */ 92#define BIO_USER_MAPPED 6 /* contains user pages */
95#define BIO_EOPNOTSUPP 7 /* not supported */ 93#define BIO_EOPNOTSUPP 7 /* not supported */
96#define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ 94#define BIO_NULL_MAPPED 8 /* contains invalid user pages */
97#define BIO_NULL_MAPPED 9 /* contains invalid user pages */ 95#define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */
98#define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ 96#define BIO_QUIET 10 /* Make BIO Quiet */
99#define BIO_QUIET 11 /* Make BIO Quiet */ 97#define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */
100#define BIO_MAPPED_INTEGRITY 12/* integrity metadata has been remapped */
101#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) 98#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
102 99
103/* 100/*
@@ -124,8 +121,13 @@ enum rq_flag_bits {
124 121
125 __REQ_SYNC, /* request is sync (sync write or read) */ 122 __REQ_SYNC, /* request is sync (sync write or read) */
126 __REQ_META, /* metadata io request */ 123 __REQ_META, /* metadata io request */
124 __REQ_PRIO, /* boost priority in cfq */
127 __REQ_DISCARD, /* request to discard sectors */ 125 __REQ_DISCARD, /* request to discard sectors */
126 __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
127
128 __REQ_NOIDLE, /* don't anticipate more IO after this one */ 128 __REQ_NOIDLE, /* don't anticipate more IO after this one */
129 __REQ_FUA, /* forced unit access */
130 __REQ_FLUSH, /* request for cache flush */
129 131
130 /* bio only flags */ 132 /* bio only flags */
131 __REQ_RAHEAD, /* read ahead, can fail anytime */ 133 __REQ_RAHEAD, /* read ahead, can fail anytime */
@@ -135,7 +137,6 @@ enum rq_flag_bits {
135 /* request only flags */ 137 /* request only flags */
136 __REQ_SORTED, /* elevator knows about this request */ 138 __REQ_SORTED, /* elevator knows about this request */
137 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ 139 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
138 __REQ_FUA, /* forced unit access */
139 __REQ_NOMERGE, /* don't touch this for merging */ 140 __REQ_NOMERGE, /* don't touch this for merging */
140 __REQ_STARTED, /* drive already may have started this one */ 141 __REQ_STARTED, /* drive already may have started this one */
141 __REQ_DONTPREP, /* don't call prep for this one */ 142 __REQ_DONTPREP, /* don't call prep for this one */
@@ -146,11 +147,9 @@ enum rq_flag_bits {
146 __REQ_PREEMPT, /* set for "ide_preempt" requests */ 147 __REQ_PREEMPT, /* set for "ide_preempt" requests */
147 __REQ_ALLOCED, /* request came from our alloc pool */ 148 __REQ_ALLOCED, /* request came from our alloc pool */
148 __REQ_COPY_USER, /* contains copies of user pages */ 149 __REQ_COPY_USER, /* contains copies of user pages */
149 __REQ_FLUSH, /* request for cache flush */
150 __REQ_FLUSH_SEQ, /* request for flush sequence */ 150 __REQ_FLUSH_SEQ, /* request for flush sequence */
151 __REQ_IO_STAT, /* account I/O stat */ 151 __REQ_IO_STAT, /* account I/O stat */
152 __REQ_MIXED_MERGE, /* merge of different types, fail separately */ 152 __REQ_MIXED_MERGE, /* merge of different types, fail separately */
153 __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
154 __REQ_NR_BITS, /* stops here */ 153 __REQ_NR_BITS, /* stops here */
155}; 154};
156 155
@@ -160,14 +159,15 @@ enum rq_flag_bits {
160#define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) 159#define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER)
161#define REQ_SYNC (1 << __REQ_SYNC) 160#define REQ_SYNC (1 << __REQ_SYNC)
162#define REQ_META (1 << __REQ_META) 161#define REQ_META (1 << __REQ_META)
162#define REQ_PRIO (1 << __REQ_PRIO)
163#define REQ_DISCARD (1 << __REQ_DISCARD) 163#define REQ_DISCARD (1 << __REQ_DISCARD)
164#define REQ_NOIDLE (1 << __REQ_NOIDLE) 164#define REQ_NOIDLE (1 << __REQ_NOIDLE)
165 165
166#define REQ_FAILFAST_MASK \ 166#define REQ_FAILFAST_MASK \
167 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) 167 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
168#define REQ_COMMON_MASK \ 168#define REQ_COMMON_MASK \
169 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \ 169 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | \
170 REQ_NOIDLE | REQ_FLUSH | REQ_FUA | REQ_SECURE) 170 REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | REQ_SECURE)
171#define REQ_CLONE_MASK REQ_COMMON_MASK 171#define REQ_CLONE_MASK REQ_COMMON_MASK
172 172
173#define REQ_RAHEAD (1 << __REQ_RAHEAD) 173#define REQ_RAHEAD (1 << __REQ_RAHEAD)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0e67c45b3bc9..c7a6d3b5bc7b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -14,7 +14,6 @@
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <linux/mempool.h> 15#include <linux/mempool.h>
16#include <linux/bio.h> 16#include <linux/bio.h>
17#include <linux/module.h>
18#include <linux/stringify.h> 17#include <linux/stringify.h>
19#include <linux/gfp.h> 18#include <linux/gfp.h>
20#include <linux/bsg.h> 19#include <linux/bsg.h>
@@ -22,6 +21,7 @@
22 21
23#include <asm/scatterlist.h> 22#include <asm/scatterlist.h>
24 23
24struct module;
25struct scsi_ioctl_command; 25struct scsi_ioctl_command;
26 26
27struct request_queue; 27struct request_queue;
@@ -30,6 +30,7 @@ struct request_pm_state;
30struct blk_trace; 30struct blk_trace;
31struct request; 31struct request;
32struct sg_io_hdr; 32struct sg_io_hdr;
33struct bsg_job;
33 34
34#define BLKDEV_MIN_RQ 4 35#define BLKDEV_MIN_RQ 4
35#define BLKDEV_MAX_RQ 128 /* Default maximum */ 36#define BLKDEV_MAX_RQ 128 /* Default maximum */
@@ -117,6 +118,7 @@ struct request {
117 struct { 118 struct {
118 unsigned int seq; 119 unsigned int seq;
119 struct list_head list; 120 struct list_head list;
121 rq_end_io_fn *saved_end_io;
120 } flush; 122 } flush;
121 }; 123 };
122 124
@@ -193,7 +195,7 @@ struct request_pm_state
193#include <linux/elevator.h> 195#include <linux/elevator.h>
194 196
195typedef void (request_fn_proc) (struct request_queue *q); 197typedef void (request_fn_proc) (struct request_queue *q);
196typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); 198typedef void (make_request_fn) (struct request_queue *q, struct bio *bio);
197typedef int (prep_rq_fn) (struct request_queue *, struct request *); 199typedef int (prep_rq_fn) (struct request_queue *, struct request *);
198typedef void (unprep_rq_fn) (struct request_queue *, struct request *); 200typedef void (unprep_rq_fn) (struct request_queue *, struct request *);
199 201
@@ -209,6 +211,7 @@ typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *,
209typedef void (softirq_done_fn)(struct request *); 211typedef void (softirq_done_fn)(struct request *);
210typedef int (dma_drain_needed_fn)(struct request *); 212typedef int (dma_drain_needed_fn)(struct request *);
211typedef int (lld_busy_fn) (struct request_queue *q); 213typedef int (lld_busy_fn) (struct request_queue *q);
214typedef int (bsg_job_fn) (struct bsg_job *);
212 215
213enum blk_eh_timer_return { 216enum blk_eh_timer_return {
214 BLK_EH_NOT_HANDLED, 217 BLK_EH_NOT_HANDLED,
@@ -375,6 +378,8 @@ struct request_queue {
375 struct mutex sysfs_lock; 378 struct mutex sysfs_lock;
376 379
377#if defined(CONFIG_BLK_DEV_BSG) 380#if defined(CONFIG_BLK_DEV_BSG)
381 bsg_job_fn *bsg_job_fn;
382 int bsg_job_size;
378 struct bsg_class_device bsg_dev; 383 struct bsg_class_device bsg_dev;
379#endif 384#endif
380 385
@@ -675,6 +680,8 @@ extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t,
675extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, 680extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
676 struct scsi_ioctl_command __user *); 681 struct scsi_ioctl_command __user *);
677 682
683extern void blk_queue_bio(struct request_queue *q, struct bio *bio);
684
678/* 685/*
679 * A queue has just exitted congestion. Note this in the global counter of 686 * A queue has just exitted congestion. Note this in the global counter of
680 * congested queues, and wake up anyone who was waiting for requests to be 687 * congested queues, and wake up anyone who was waiting for requests to be
@@ -858,17 +865,22 @@ struct request_queue *blk_alloc_queue_node(gfp_t, int);
858extern void blk_put_queue(struct request_queue *); 865extern void blk_put_queue(struct request_queue *);
859 866
860/* 867/*
861 * Note: Code in between changing the blk_plug list/cb_list or element of such 868 * blk_plug permits building a queue of related requests by holding the I/O
862 * lists is preemptable, but such code can't do sleep (or be very careful), 869 * fragments for a short period. This allows merging of sequential requests
863 * otherwise data is corrupted. For details, please check schedule() where 870 * into single larger request. As the requests are moved from a per-task list to
864 * blk_schedule_flush_plug() is called. 871 * the device's request_queue in a batch, this results in improved scalability
872 * as the lock contention for request_queue lock is reduced.
873 *
874 * It is ok not to disable preemption when adding the request to the plug list
875 * or when attempting a merge, because blk_schedule_flush_list() will only flush
876 * the plug list when the task sleeps by itself. For details, please see
877 * schedule() where blk_schedule_flush_plug() is called.
865 */ 878 */
866struct blk_plug { 879struct blk_plug {
867 unsigned long magic; 880 unsigned long magic; /* detect uninitialized use-cases */
868 struct list_head list; 881 struct list_head list; /* requests */
869 struct list_head cb_list; 882 struct list_head cb_list; /* md requires an unplug callback */
870 unsigned int should_sort; 883 unsigned int should_sort; /* list to be sorted before flushing? */
871 unsigned int count;
872}; 884};
873#define BLK_MAX_REQUEST_COUNT 16 885#define BLK_MAX_REQUEST_COUNT 16
874 886
@@ -1185,20 +1197,6 @@ static inline uint64_t rq_io_start_time_ns(struct request *req)
1185} 1197}
1186#endif 1198#endif
1187 1199
1188#ifdef CONFIG_BLK_DEV_THROTTLING
1189extern int blk_throtl_init(struct request_queue *q);
1190extern void blk_throtl_exit(struct request_queue *q);
1191extern int blk_throtl_bio(struct request_queue *q, struct bio **bio);
1192#else /* CONFIG_BLK_DEV_THROTTLING */
1193static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio)
1194{
1195 return 0;
1196}
1197
1198static inline int blk_throtl_init(struct request_queue *q) { return 0; }
1199static inline int blk_throtl_exit(struct request_queue *q) { return 0; }
1200#endif /* CONFIG_BLK_DEV_THROTTLING */
1201
1202#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 1200#define MODULE_ALIAS_BLOCKDEV(major,minor) \
1203 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) 1201 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
1204#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 1202#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 8c7c2de7631a..4d1a0748eaf8 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -14,7 +14,7 @@
14enum blktrace_cat { 14enum blktrace_cat {
15 BLK_TC_READ = 1 << 0, /* reads */ 15 BLK_TC_READ = 1 << 0, /* reads */
16 BLK_TC_WRITE = 1 << 1, /* writes */ 16 BLK_TC_WRITE = 1 << 1, /* writes */
17 BLK_TC_BARRIER = 1 << 2, /* barrier */ 17 BLK_TC_FLUSH = 1 << 2, /* flush */
18 BLK_TC_SYNC = 1 << 3, /* sync IO */ 18 BLK_TC_SYNC = 1 << 3, /* sync IO */
19 BLK_TC_SYNCIO = BLK_TC_SYNC, 19 BLK_TC_SYNCIO = BLK_TC_SYNC,
20 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ 20 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
@@ -28,8 +28,9 @@ enum blktrace_cat {
28 BLK_TC_META = 1 << 12, /* metadata */ 28 BLK_TC_META = 1 << 12, /* metadata */
29 BLK_TC_DISCARD = 1 << 13, /* discard requests */ 29 BLK_TC_DISCARD = 1 << 13, /* discard requests */
30 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ 30 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
31 BLK_TC_FUA = 1 << 15, /* fua requests */
31 32
32 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ 33 BLK_TC_END = 1 << 15, /* we've run out of bits! */
33}; 34};
34 35
35#define BLK_TC_SHIFT (16) 36#define BLK_TC_SHIFT (16)
@@ -169,7 +170,7 @@ extern void blk_trace_shutdown(struct request_queue *);
169extern int do_blk_trace_setup(struct request_queue *q, char *name, 170extern int do_blk_trace_setup(struct request_queue *q, char *name,
170 dev_t dev, struct block_device *bdev, 171 dev_t dev, struct block_device *bdev,
171 struct blk_user_trace_setup *buts); 172 struct blk_user_trace_setup *buts);
172extern __attribute__((format(printf, 2, 3))) 173extern __printf(2, 3)
173void __trace_note_message(struct blk_trace *, const char *fmt, ...); 174void __trace_note_message(struct blk_trace *, const char *fmt, ...);
174 175
175/** 176/**
diff --git a/include/linux/bma150.h b/include/linux/bma150.h
new file mode 100644
index 000000000000..7911fda23bb4
--- /dev/null
+++ b/include/linux/bma150.h
@@ -0,0 +1,46 @@
1/*
2 * Copyright (c) 2011 Bosch Sensortec GmbH
3 * Copyright (c) 2011 Unixphere
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 * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20#ifndef _BMA150_H_
21#define _BMA150_H_
22
23#define BMA150_DRIVER "bma150"
24
25struct bma150_cfg {
26 bool any_motion_int; /* Set to enable any-motion interrupt */
27 bool hg_int; /* Set to enable high-G interrupt */
28 bool lg_int; /* Set to enable low-G interrupt */
29 unsigned char any_motion_dur; /* Any-motion duration */
30 unsigned char any_motion_thres; /* Any-motion threshold */
31 unsigned char hg_hyst; /* High-G hysterisis */
32 unsigned char hg_dur; /* High-G duration */
33 unsigned char hg_thres; /* High-G threshold */
34 unsigned char lg_hyst; /* Low-G hysterisis */
35 unsigned char lg_dur; /* Low-G duration */
36 unsigned char lg_thres; /* Low-G threshold */
37 unsigned char range; /* BMA0150_RANGE_xxx (in G) */
38 unsigned char bandwidth; /* BMA0150_BW_xxx (in Hz) */
39};
40
41struct bma150_platform_data {
42 struct bma150_cfg cfg;
43 int (*irq_gpio_cfg)(void);
44};
45
46#endif /* _BMA150_H_ */
diff --git a/include/linux/bsg-lib.h b/include/linux/bsg-lib.h
new file mode 100644
index 000000000000..f55ab8cdc106
--- /dev/null
+++ b/include/linux/bsg-lib.h
@@ -0,0 +1,73 @@
1/*
2 * BSG helper library
3 *
4 * Copyright (C) 2008 James Smart, Emulex Corporation
5 * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
6 * Copyright (C) 2011 Mike Christie
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef _BLK_BSG_
24#define _BLK_BSG_
25
26#include <linux/blkdev.h>
27
28struct request;
29struct device;
30struct scatterlist;
31struct request_queue;
32
33struct bsg_buffer {
34 unsigned int payload_len;
35 int sg_cnt;
36 struct scatterlist *sg_list;
37};
38
39struct bsg_job {
40 struct device *dev;
41 struct request *req;
42
43 /* Transport/driver specific request/reply structs */
44 void *request;
45 void *reply;
46
47 unsigned int request_len;
48 unsigned int reply_len;
49 /*
50 * On entry : reply_len indicates the buffer size allocated for
51 * the reply.
52 *
53 * Upon completion : the message handler must set reply_len
54 * to indicates the size of the reply to be returned to the
55 * caller.
56 */
57
58 /* DMA payloads for the request/response */
59 struct bsg_buffer request_payload;
60 struct bsg_buffer reply_payload;
61
62 void *dd_data; /* Used for driver-specific storage */
63};
64
65void bsg_job_done(struct bsg_job *job, int result,
66 unsigned int reply_payload_rcv_len);
67int bsg_setup_queue(struct device *dev, struct request_queue *q, char *name,
68 bsg_job_fn *job_fn, int dd_job_size);
69void bsg_request_fn(struct request_queue *q);
70void bsg_remove_queue(struct request_queue *q);
71void bsg_goose_queue(struct request_queue *q);
72
73#endif
diff --git a/include/linux/caif/caif_socket.h b/include/linux/caif/caif_socket.h
index d9cb19b7cff7..3f3bac6af7bc 100644
--- a/include/linux/caif/caif_socket.h
+++ b/include/linux/caif/caif_socket.h
@@ -9,12 +9,7 @@
9#define _LINUX_CAIF_SOCKET_H 9#define _LINUX_CAIF_SOCKET_H
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12
13#ifdef __KERNEL__
14#include <linux/socket.h> 12#include <linux/socket.h>
15#else
16#include <sys/socket.h>
17#endif
18 13
19/** 14/**
20 * enum caif_link_selector - Physical Link Selection. 15 * enum caif_link_selector - Physical Link Selection.
@@ -144,7 +139,7 @@ enum caif_debug_service {
144 * CAIF Channel. It defines the service to connect to on the modem. 139 * CAIF Channel. It defines the service to connect to on the modem.
145 */ 140 */
146struct sockaddr_caif { 141struct sockaddr_caif {
147 sa_family_t family; 142 __kernel_sa_family_t family;
148 union { 143 union {
149 struct { 144 struct {
150 __u8 type; /* type: enum caif_at_type */ 145 __u8 type; /* type: enum caif_at_type */
diff --git a/include/linux/can.h b/include/linux/can.h
index d18333302cbd..9a19bcb3eeaf 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -8,8 +8,6 @@
8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Send feedback to <socketcan-users@lists.berlios.de>
12 *
13 */ 11 */
14 12
15#ifndef CAN_H 13#ifndef CAN_H
@@ -78,7 +76,7 @@ struct can_frame {
78 * @can_addr: protocol specific address information 76 * @can_addr: protocol specific address information
79 */ 77 */
80struct sockaddr_can { 78struct sockaddr_can {
81 sa_family_t can_family; 79 __kernel_sa_family_t can_family;
82 int can_ifindex; 80 int can_ifindex;
83 union { 81 union {
84 /* transport protocol class address information (e.g. ISOTP) */ 82 /* transport protocol class address information (e.g. ISOTP) */
diff --git a/include/linux/can/Kbuild b/include/linux/can/Kbuild
index 8cb05aae661c..c62b7f1728f9 100644
--- a/include/linux/can/Kbuild
+++ b/include/linux/can/Kbuild
@@ -1,4 +1,5 @@
1header-y += raw.h 1header-y += raw.h
2header-y += bcm.h 2header-y += bcm.h
3header-y += gw.h
3header-y += error.h 4header-y += error.h
4header-y += netlink.h 5header-y += netlink.h
diff --git a/include/linux/can/bcm.h b/include/linux/can/bcm.h
index 1432b278c52d..3ebe387fea4d 100644
--- a/include/linux/can/bcm.h
+++ b/include/linux/can/bcm.h
@@ -7,14 +7,13 @@
7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Send feedback to <socketcan-users@lists.berlios.de>
11 *
12 */ 10 */
13 11
14#ifndef CAN_BCM_H 12#ifndef CAN_BCM_H
15#define CAN_BCM_H 13#define CAN_BCM_H
16 14
17#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/can.h>
18 17
19/** 18/**
20 * struct bcm_msg_head - head of messages to/from the broadcast manager 19 * struct bcm_msg_head - head of messages to/from the broadcast manager
diff --git a/include/linux/can/core.h b/include/linux/can/core.h
index 5ce6b5d62ecc..0ccc1cd28b95 100644
--- a/include/linux/can/core.h
+++ b/include/linux/can/core.h
@@ -8,8 +8,6 @@
8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Send feedback to <socketcan-users@lists.berlios.de>
12 *
13 */ 11 */
14 12
15#ifndef CAN_CORE_H 13#ifndef CAN_CORE_H
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index cc0bb4961669..a0969fcb72b9 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -8,7 +8,6 @@
8 * 8 *
9 * Copyright (C) 2008 Wolfgang Grandegger <wg@grandegger.com> 9 * Copyright (C) 2008 Wolfgang Grandegger <wg@grandegger.com>
10 * 10 *
11 * Send feedback to <socketcan-users@lists.berlios.de>
12 */ 11 */
13 12
14#ifndef CAN_DEV_H 13#ifndef CAN_DEV_H
diff --git a/include/linux/can/error.h b/include/linux/can/error.h
index 5958074302a4..63e855ea6b84 100644
--- a/include/linux/can/error.h
+++ b/include/linux/can/error.h
@@ -7,8 +7,6 @@
7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Send feedback to <socketcan-users@lists.berlios.de>
11 *
12 */ 10 */
13 11
14#ifndef CAN_ERROR_H 12#ifndef CAN_ERROR_H
diff --git a/include/linux/can/gw.h b/include/linux/can/gw.h
new file mode 100644
index 000000000000..8e1db18c3cb6
--- /dev/null
+++ b/include/linux/can/gw.h
@@ -0,0 +1,162 @@
1/*
2 * linux/can/gw.h
3 *
4 * Definitions for CAN frame Gateway/Router/Bridge
5 *
6 * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
7 * Copyright (c) 2011 Volkswagen Group Electronic Research
8 * All rights reserved.
9 *
10 */
11
12#ifndef CAN_GW_H
13#define CAN_GW_H
14
15#include <linux/types.h>
16#include <linux/can.h>
17
18struct rtcanmsg {
19 __u8 can_family;
20 __u8 gwtype;
21 __u16 flags;
22};
23
24/* CAN gateway types */
25enum {
26 CGW_TYPE_UNSPEC,
27 CGW_TYPE_CAN_CAN, /* CAN->CAN routing */
28 __CGW_TYPE_MAX
29};
30
31#define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1)
32
33/* CAN rtnetlink attribute definitions */
34enum {
35 CGW_UNSPEC,
36 CGW_MOD_AND, /* CAN frame modification binary AND */
37 CGW_MOD_OR, /* CAN frame modification binary OR */
38 CGW_MOD_XOR, /* CAN frame modification binary XOR */
39 CGW_MOD_SET, /* CAN frame modification set alternate values */
40 CGW_CS_XOR, /* set data[] XOR checksum into data[index] */
41 CGW_CS_CRC8, /* set data[] CRC8 checksum into data[index] */
42 CGW_HANDLED, /* number of handled CAN frames */
43 CGW_DROPPED, /* number of dropped CAN frames */
44 CGW_SRC_IF, /* ifindex of source network interface */
45 CGW_DST_IF, /* ifindex of destination network interface */
46 CGW_FILTER, /* specify struct can_filter on source CAN device */
47 __CGW_MAX
48};
49
50#define CGW_MAX (__CGW_MAX - 1)
51
52#define CGW_FLAGS_CAN_ECHO 0x01
53#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
54
55#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
56
57/* CAN frame elements that are affected by curr. 3 CAN frame modifications */
58#define CGW_MOD_ID 0x01
59#define CGW_MOD_DLC 0x02
60#define CGW_MOD_DATA 0x04
61
62#define CGW_FRAME_MODS 3 /* ID DLC DATA */
63
64#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
65
66struct cgw_frame_mod {
67 struct can_frame cf;
68 __u8 modtype;
69} __attribute__((packed));
70
71#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)
72
73struct cgw_csum_xor {
74 __s8 from_idx;
75 __s8 to_idx;
76 __s8 result_idx;
77 __u8 init_xor_val;
78} __attribute__((packed));
79
80struct cgw_csum_crc8 {
81 __s8 from_idx;
82 __s8 to_idx;
83 __s8 result_idx;
84 __u8 init_crc_val;
85 __u8 final_xor_val;
86 __u8 crctab[256];
87 __u8 profile;
88 __u8 profile_data[20];
89} __attribute__((packed));
90
91/* length of checksum operation parameters. idx = index in CAN frame data[] */
92#define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor)
93#define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8)
94
95/* CRC8 profiles (compute CRC for additional data elements - see below) */
96enum {
97 CGW_CRC8PRF_UNSPEC,
98 CGW_CRC8PRF_1U8, /* compute one additional u8 value */
99 CGW_CRC8PRF_16U8, /* u8 value table indexed by data[1] & 0xF */
100 CGW_CRC8PRF_SFFID_XOR, /* (can_id & 0xFF) ^ (can_id >> 8 & 0xFF) */
101 __CGW_CRC8PRF_MAX
102};
103
104#define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1)
105
106/*
107 * CAN rtnetlink attribute contents in detail
108 *
109 * CGW_XXX_IF (length 4 bytes):
110 * Sets an interface index for source/destination network interfaces.
111 * For the CAN->CAN gwtype the indices of _two_ CAN interfaces are mandatory.
112 *
113 * CGW_FILTER (length 8 bytes):
114 * Sets a CAN receive filter for the gateway job specified by the
115 * struct can_filter described in include/linux/can.h
116 *
117 * CGW_MOD_XXX (length 17 bytes):
118 * Specifies a modification that's done to a received CAN frame before it is
119 * send out to the destination interface.
120 *
121 * <struct can_frame> data used as operator
122 * <u8> affected CAN frame elements
123 *
124 * CGW_CS_XOR (length 4 bytes):
125 * Set a simple XOR checksum starting with an initial value into
126 * data[result-idx] using data[start-idx] .. data[end-idx]
127 *
128 * The XOR checksum is calculated like this:
129 *
130 * xor = init_xor_val
131 *
132 * for (i = from_idx .. to_idx)
133 * xor ^= can_frame.data[i]
134 *
135 * can_frame.data[ result_idx ] = xor
136 *
137 * CGW_CS_CRC8 (length 282 bytes):
138 * Set a CRC8 value into data[result-idx] using a given 256 byte CRC8 table,
139 * a given initial value and a defined input data[start-idx] .. data[end-idx].
140 * Finally the result value is XOR'ed with the final_xor_val.
141 *
142 * The CRC8 checksum is calculated like this:
143 *
144 * crc = init_crc_val
145 *
146 * for (i = from_idx .. to_idx)
147 * crc = crctab[ crc ^ can_frame.data[i] ]
148 *
149 * can_frame.data[ result_idx ] = crc ^ final_xor_val
150 *
151 * The calculated CRC may contain additional source data elements that can be
152 * defined in the handling of 'checksum profiles' e.g. shown in AUTOSAR specs
153 * like http://www.autosar.org/download/R4.0/AUTOSAR_SWS_E2ELibrary.pdf
154 * E.g. the profile_data[] may contain additional u8 values (called DATA_IDs)
155 * that are used depending on counter values inside the CAN frame data[].
156 * So far only three profiles have been implemented for illustration.
157 *
158 * Remark: In general the attribute data is a linear buffer.
159 * Beware of sending unpacked or aligned structs!
160 */
161
162#endif
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h
index 34542d374dd8..14966ddb7df1 100644
--- a/include/linux/can/netlink.h
+++ b/include/linux/can/netlink.h
@@ -5,8 +5,6 @@
5 * 5 *
6 * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com> 6 * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com>
7 * 7 *
8 * Send feedback to <socketcan-users@lists.berlios.de>
9 *
10 */ 8 */
11 9
12#ifndef CAN_NETLINK_H 10#ifndef CAN_NETLINK_H
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h
index b2a0f87492c5..781f3a3701be 100644
--- a/include/linux/can/raw.h
+++ b/include/linux/can/raw.h
@@ -8,8 +8,6 @@
8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Send feedback to <socketcan-users@lists.berlios.de>
12 *
13 */ 11 */
14 12
15#ifndef CAN_RAW_H 13#ifndef CAN_RAW_H
diff --git a/include/linux/capability.h b/include/linux/capability.h
index c42112350003..a63d13d84ad8 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -198,7 +198,7 @@ struct cpu_vfs_cap_data {
198/* Allow modification of routing tables */ 198/* Allow modification of routing tables */
199/* Allow setting arbitrary process / process group ownership on 199/* Allow setting arbitrary process / process group ownership on
200 sockets */ 200 sockets */
201/* Allow binding to any address for transparent proxying */ 201/* Allow binding to any address for transparent proxying (also via NET_RAW) */
202/* Allow setting TOS (type of service) */ 202/* Allow setting TOS (type of service) */
203/* Allow setting promiscuous mode */ 203/* Allow setting promiscuous mode */
204/* Allow clearing driver statistics */ 204/* Allow clearing driver statistics */
@@ -210,6 +210,7 @@ struct cpu_vfs_cap_data {
210 210
211/* Allow use of RAW sockets */ 211/* Allow use of RAW sockets */
212/* Allow use of PACKET sockets */ 212/* Allow use of PACKET sockets */
213/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */
213 214
214#define CAP_NET_RAW 13 215#define CAP_NET_RAW 13
215 216
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 563755181c1e..95bd8502e715 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -215,7 +215,9 @@ extern void ceph_destroy_options(struct ceph_options *opt);
215extern int ceph_compare_options(struct ceph_options *new_opt, 215extern int ceph_compare_options(struct ceph_options *new_opt,
216 struct ceph_client *client); 216 struct ceph_client *client);
217extern struct ceph_client *ceph_create_client(struct ceph_options *opt, 217extern struct ceph_client *ceph_create_client(struct ceph_options *opt,
218 void *private); 218 void *private,
219 unsigned supported_features,
220 unsigned required_features);
219extern u64 ceph_client_id(struct ceph_client *client); 221extern u64 ceph_client_id(struct ceph_client *client);
220extern void ceph_destroy_client(struct ceph_client *client); 222extern void ceph_destroy_client(struct ceph_client *client);
221extern int __ceph_open_session(struct ceph_client *client, 223extern int __ceph_open_session(struct ceph_client *client,
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index d7adf151d335..ffbeb2c217b4 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -6,7 +6,6 @@
6#include <linux/net.h> 6#include <linux/net.h>
7#include <linux/radix-tree.h> 7#include <linux/radix-tree.h>
8#include <linux/uio.h> 8#include <linux/uio.h>
9#include <linux/version.h>
10#include <linux/workqueue.h> 9#include <linux/workqueue.h>
11 10
12#include "types.h" 11#include "types.h"
@@ -238,7 +237,8 @@ extern void ceph_con_keepalive(struct ceph_connection *con);
238extern struct ceph_connection *ceph_con_get(struct ceph_connection *con); 237extern struct ceph_connection *ceph_con_get(struct ceph_connection *con);
239extern void ceph_con_put(struct ceph_connection *con); 238extern void ceph_con_put(struct ceph_connection *con);
240 239
241extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags); 240extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags,
241 bool can_fail);
242extern void ceph_msg_kfree(struct ceph_msg *m); 242extern void ceph_msg_kfree(struct ceph_msg *m);
243 243
244 244
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index da7e4bc34e8c..1b7f9d525013 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -516,7 +516,7 @@ struct cgroup_subsys {
516 struct list_head sibling; 516 struct list_head sibling;
517 /* used when use_id == true */ 517 /* used when use_id == true */
518 struct idr idr; 518 struct idr idr;
519 spinlock_t id_lock; 519 rwlock_t id_lock;
520 520
521 /* should be defined only by modular subsystems */ 521 /* should be defined only by modular subsystems */
522 struct module *module; 522 struct module *module;
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 1d37f42ac294..7213b52b2c0e 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -11,6 +11,8 @@
11#ifndef __LINUX_CLK_H 11#ifndef __LINUX_CLK_H
12#define __LINUX_CLK_H 12#define __LINUX_CLK_H
13 13
14#include <linux/kernel.h>
15
14struct device; 16struct device;
15 17
16/* 18/*
@@ -41,11 +43,31 @@ struct clk;
41struct clk *clk_get(struct device *dev, const char *id); 43struct clk *clk_get(struct device *dev, const char *id);
42 44
43/** 45/**
46 * clk_prepare - prepare a clock source
47 * @clk: clock source
48 *
49 * This prepares the clock source for use.
50 *
51 * Must not be called from within atomic context.
52 */
53#ifdef CONFIG_HAVE_CLK_PREPARE
54int clk_prepare(struct clk *clk);
55#else
56static inline int clk_prepare(struct clk *clk)
57{
58 might_sleep();
59 return 0;
60}
61#endif
62
63/**
44 * clk_enable - inform the system when the clock source should be running. 64 * clk_enable - inform the system when the clock source should be running.
45 * @clk: clock source 65 * @clk: clock source
46 * 66 *
47 * If the clock can not be enabled/disabled, this should return success. 67 * If the clock can not be enabled/disabled, this should return success.
48 * 68 *
69 * May be called from atomic contexts.
70 *
49 * Returns success (0) or negative errno. 71 * Returns success (0) or negative errno.
50 */ 72 */
51int clk_enable(struct clk *clk); 73int clk_enable(struct clk *clk);
@@ -57,6 +79,8 @@ int clk_enable(struct clk *clk);
57 * Inform the system that a clock source is no longer required by 79 * Inform the system that a clock source is no longer required by
58 * a driver and may be shut down. 80 * a driver and may be shut down.
59 * 81 *
82 * May be called from atomic contexts.
83 *
60 * Implementation detail: if the clock source is shared between 84 * Implementation detail: if the clock source is shared between
61 * multiple drivers, clk_enable() calls must be balanced by the 85 * multiple drivers, clk_enable() calls must be balanced by the
62 * same number of clk_disable() calls for the clock source to be 86 * same number of clk_disable() calls for the clock source to be
@@ -64,6 +88,25 @@ int clk_enable(struct clk *clk);
64 */ 88 */
65void clk_disable(struct clk *clk); 89void clk_disable(struct clk *clk);
66 90
91
92/**
93 * clk_unprepare - undo preparation of a clock source
94 * @clk: clock source
95 *
96 * This undoes a previously prepared clock. The caller must balance
97 * the number of prepare and unprepare calls.
98 *
99 * Must not be called from within atomic context.
100 */
101#ifdef CONFIG_HAVE_CLK_PREPARE
102void clk_unprepare(struct clk *clk);
103#else
104static inline void clk_unprepare(struct clk *clk)
105{
106 might_sleep();
107}
108#endif
109
67/** 110/**
68 * clk_get_rate - obtain the current clock rate (in Hz) for a clock source. 111 * clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
69 * This is only valid once the clock source has been enabled. 112 * This is only valid once the clock source has been enabled.
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h
index 457bcb0a310a..d9a4fd028c9d 100644
--- a/include/linux/clkdev.h
+++ b/include/linux/clkdev.h
@@ -24,6 +24,13 @@ struct clk_lookup {
24 struct clk *clk; 24 struct clk *clk;
25}; 25};
26 26
27#define CLKDEV_INIT(d, n, c) \
28 { \
29 .dev_id = d, \
30 .con_id = n, \
31 .clk = c, \
32 }
33
27struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, 34struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
28 const char *dev_fmt, ...); 35 const char *dev_fmt, ...);
29 36
diff --git a/include/linux/clksrc-dbx500-prcmu.h b/include/linux/clksrc-dbx500-prcmu.h
new file mode 100644
index 000000000000..4fb8119c49e4
--- /dev/null
+++ b/include/linux/clksrc-dbx500-prcmu.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * License Terms: GNU General Public License v2
5 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
6 *
7 */
8#ifndef __CLKSRC_DBX500_PRCMU_H
9#define __CLKSRC_DBX500_PRCMU_H
10
11#include <linux/init.h>
12#include <linux/io.h>
13
14#ifdef CONFIG_CLKSRC_DBX500_PRCMU
15void __init clksrc_dbx500_prcmu_init(void __iomem *base);
16#else
17static inline void __init clksrc_dbx500_prcmu_init(void __iomem *base) {}
18#endif
19
20#endif
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index d6733e27af34..81e803e90aa4 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -45,20 +45,22 @@ enum clock_event_nofitiers {
45 */ 45 */
46#define CLOCK_EVT_FEAT_PERIODIC 0x000001 46#define CLOCK_EVT_FEAT_PERIODIC 0x000001
47#define CLOCK_EVT_FEAT_ONESHOT 0x000002 47#define CLOCK_EVT_FEAT_ONESHOT 0x000002
48#define CLOCK_EVT_FEAT_KTIME 0x000004
48/* 49/*
49 * x86(64) specific misfeatures: 50 * x86(64) specific misfeatures:
50 * 51 *
51 * - Clockevent source stops in C3 State and needs broadcast support. 52 * - Clockevent source stops in C3 State and needs broadcast support.
52 * - Local APIC timer is used as a dummy device. 53 * - Local APIC timer is used as a dummy device.
53 */ 54 */
54#define CLOCK_EVT_FEAT_C3STOP 0x000004 55#define CLOCK_EVT_FEAT_C3STOP 0x000008
55#define CLOCK_EVT_FEAT_DUMMY 0x000008 56#define CLOCK_EVT_FEAT_DUMMY 0x000010
56 57
57/** 58/**
58 * struct clock_event_device - clock event device descriptor 59 * struct clock_event_device - clock event device descriptor
59 * @event_handler: Assigned by the framework to be called by the low 60 * @event_handler: Assigned by the framework to be called by the low
60 * level handler of the event source 61 * level handler of the event source
61 * @set_next_event: set next event function 62 * @set_next_event: set next event function using a clocksource delta
63 * @set_next_ktime: set next event function using a direct ktime value
62 * @next_event: local storage for the next event in oneshot mode 64 * @next_event: local storage for the next event in oneshot mode
63 * @max_delta_ns: maximum delta value in ns 65 * @max_delta_ns: maximum delta value in ns
64 * @min_delta_ns: minimum delta value in ns 66 * @min_delta_ns: minimum delta value in ns
@@ -81,6 +83,8 @@ struct clock_event_device {
81 void (*event_handler)(struct clock_event_device *); 83 void (*event_handler)(struct clock_event_device *);
82 int (*set_next_event)(unsigned long evt, 84 int (*set_next_event)(unsigned long evt,
83 struct clock_event_device *); 85 struct clock_event_device *);
86 int (*set_next_ktime)(ktime_t expires,
87 struct clock_event_device *);
84 ktime_t next_event; 88 ktime_t next_event;
85 u64 max_delta_ns; 89 u64 max_delta_ns;
86 u64 min_delta_ns; 90 u64 min_delta_ns;
@@ -140,7 +144,7 @@ extern void clockevents_set_mode(struct clock_event_device *dev,
140 enum clock_event_mode mode); 144 enum clock_event_mode mode);
141extern int clockevents_register_notifier(struct notifier_block *nb); 145extern int clockevents_register_notifier(struct notifier_block *nb);
142extern int clockevents_program_event(struct clock_event_device *dev, 146extern int clockevents_program_event(struct clock_event_device *dev,
143 ktime_t expires, ktime_t now); 147 ktime_t expires, bool force);
144 148
145extern void clockevents_handle_noop(struct clock_event_device *dev); 149extern void clockevents_handle_noop(struct clock_event_device *dev);
146 150
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index 12c517b51ca2..d03612b196e1 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -54,6 +54,7 @@ struct proc_event {
54 PROC_EVENT_GID = 0x00000040, 54 PROC_EVENT_GID = 0x00000040,
55 PROC_EVENT_SID = 0x00000080, 55 PROC_EVENT_SID = 0x00000080,
56 PROC_EVENT_PTRACE = 0x00000100, 56 PROC_EVENT_PTRACE = 0x00000100,
57 PROC_EVENT_COMM = 0x00000200,
57 /* "next" should be 0x00000400 */ 58 /* "next" should be 0x00000400 */
58 /* "last" is the last process event: exit */ 59 /* "last" is the last process event: exit */
59 PROC_EVENT_EXIT = 0x80000000 60 PROC_EVENT_EXIT = 0x80000000
@@ -103,6 +104,12 @@ struct proc_event {
103 __kernel_pid_t tracer_tgid; 104 __kernel_pid_t tracer_tgid;
104 } ptrace; 105 } ptrace;
105 106
107 struct comm_proc_event {
108 __kernel_pid_t process_pid;
109 __kernel_pid_t process_tgid;
110 char comm[16];
111 } comm;
112
106 struct exit_proc_event { 113 struct exit_proc_event {
107 __kernel_pid_t process_pid; 114 __kernel_pid_t process_pid;
108 __kernel_pid_t process_tgid; 115 __kernel_pid_t process_tgid;
@@ -118,6 +125,7 @@ void proc_exec_connector(struct task_struct *task);
118void proc_id_connector(struct task_struct *task, int which_id); 125void proc_id_connector(struct task_struct *task, int which_id);
119void proc_sid_connector(struct task_struct *task); 126void proc_sid_connector(struct task_struct *task);
120void proc_ptrace_connector(struct task_struct *task, int which_id); 127void proc_ptrace_connector(struct task_struct *task, int which_id);
128void proc_comm_connector(struct task_struct *task);
121void proc_exit_connector(struct task_struct *task); 129void proc_exit_connector(struct task_struct *task);
122#else 130#else
123static inline void proc_fork_connector(struct task_struct *task) 131static inline void proc_fork_connector(struct task_struct *task)
@@ -133,6 +141,9 @@ static inline void proc_id_connector(struct task_struct *task,
133static inline void proc_sid_connector(struct task_struct *task) 141static inline void proc_sid_connector(struct task_struct *task)
134{} 142{}
135 143
144static inline void proc_comm_connector(struct task_struct *task)
145{}
146
136static inline void proc_ptrace_connector(struct task_struct *task, 147static inline void proc_ptrace_connector(struct task_struct *task,
137 int ptrace_id) 148 int ptrace_id)
138{} 149{}
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index cc9f7a428649..bb2bbdbe5464 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -24,8 +24,6 @@ extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
24 int order, gfp_t gfp_mask, nodemask_t *mask, 24 int order, gfp_t gfp_mask, nodemask_t *mask,
25 bool sync); 25 bool sync);
26extern unsigned long compaction_suitable(struct zone *zone, int order); 26extern unsigned long compaction_suitable(struct zone *zone, int order);
27extern unsigned long compact_zone_order(struct zone *zone, int order,
28 gfp_t gfp_mask, bool sync);
29 27
30/* Do not skip compaction more than 64 times */ 28/* Do not skip compaction more than 64 times */
31#define COMPACT_MAX_DEFER_SHIFT 6 29#define COMPACT_MAX_DEFER_SHIFT 6
@@ -69,12 +67,6 @@ static inline unsigned long compaction_suitable(struct zone *zone, int order)
69 return COMPACT_SKIPPED; 67 return COMPACT_SKIPPED;
70} 68}
71 69
72static inline unsigned long compact_zone_order(struct zone *zone, int order,
73 gfp_t gfp_mask, bool sync)
74{
75 return COMPACT_CONTINUE;
76}
77
78static inline void defer_compaction(struct zone *zone) 70static inline void defer_compaction(struct zone *zone)
79{ 71{
80} 72}
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 8779405e15a8..154bf5683015 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -438,7 +438,6 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
438 struct compat_timespec __user *tsp, 438 struct compat_timespec __user *tsp,
439 const compat_sigset_t __user *sigmask, 439 const compat_sigset_t __user *sigmask,
440 compat_size_t sigsetsize); 440 compat_size_t sigsetsize);
441asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2);
442asmlinkage long compat_sys_signalfd4(int ufd, 441asmlinkage long compat_sys_signalfd4(int ufd,
443 const compat_sigset_t __user *sigmask, 442 const compat_sigset_t __user *sigmask,
444 compat_size_t sigsetsize, int flags); 443 compat_size_t sigsetsize, int flags);
@@ -548,7 +547,8 @@ extern ssize_t compat_rw_copy_check_uvector(int type,
548 const struct compat_iovec __user *uvector, 547 const struct compat_iovec __user *uvector,
549 unsigned long nr_segs, 548 unsigned long nr_segs,
550 unsigned long fast_segs, struct iovec *fast_pointer, 549 unsigned long fast_segs, struct iovec *fast_pointer,
551 struct iovec **ret_pointer); 550 struct iovec **ret_pointer,
551 int check_access);
552 552
553extern void __user *compat_alloc_user_space(unsigned long len); 553extern void __user *compat_alloc_user_space(unsigned long len);
554 554
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 0c69ad825b39..3c9c54fd5690 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * connector.h 2 * connector.h
3 * 3 *
4 * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> 4 * 2004-2005 Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
5 * All rights reserved. 5 * All rights reserved.
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
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index b1a635acf72a..6cb60fd2ea84 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -196,13 +196,9 @@ static inline void cpu_hotplug_driver_unlock(void)
196#endif /* CONFIG_HOTPLUG_CPU */ 196#endif /* CONFIG_HOTPLUG_CPU */
197 197
198#ifdef CONFIG_PM_SLEEP_SMP 198#ifdef CONFIG_PM_SLEEP_SMP
199extern int suspend_cpu_hotplug;
200
201extern int disable_nonboot_cpus(void); 199extern int disable_nonboot_cpus(void);
202extern void enable_nonboot_cpus(void); 200extern void enable_nonboot_cpus(void);
203#else /* !CONFIG_PM_SLEEP_SMP */ 201#else /* !CONFIG_PM_SLEEP_SMP */
204#define suspend_cpu_hotplug 0
205
206static inline int disable_nonboot_cpus(void) { return 0; } 202static inline int disable_nonboot_cpus(void) { return 0; }
207static inline void enable_nonboot_cpus(void) {} 203static inline void enable_nonboot_cpus(void) {}
208#endif /* !CONFIG_PM_SLEEP_SMP */ 204#endif /* !CONFIG_PM_SLEEP_SMP */
diff --git a/include/linux/cpu_pm.h b/include/linux/cpu_pm.h
new file mode 100644
index 000000000000..455b233dd3b1
--- /dev/null
+++ b/include/linux/cpu_pm.h
@@ -0,0 +1,109 @@
1/*
2 * Copyright (C) 2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
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 */
17
18#ifndef _LINUX_CPU_PM_H
19#define _LINUX_CPU_PM_H
20
21#include <linux/kernel.h>
22#include <linux/notifier.h>
23
24/*
25 * When a CPU goes to a low power state that turns off power to the CPU's
26 * power domain, the contents of some blocks (floating point coprocessors,
27 * interrupt controllers, caches, timers) in the same power domain can
28 * be lost. The cpm_pm notifiers provide a method for platform idle, suspend,
29 * and hotplug implementations to notify the drivers for these blocks that
30 * they may be reset.
31 *
32 * All cpu_pm notifications must be called with interrupts disabled.
33 *
34 * The notifications are split into two classes: CPU notifications and CPU
35 * cluster notifications.
36 *
37 * CPU notifications apply to a single CPU and must be called on the affected
38 * CPU. They are used to save per-cpu context for affected blocks.
39 *
40 * CPU cluster notifications apply to all CPUs in a single power domain. They
41 * are used to save any global context for affected blocks, and must be called
42 * after all the CPUs in the power domain have been notified of the low power
43 * state.
44 */
45
46/*
47 * Event codes passed as unsigned long val to notifier calls
48 */
49enum cpu_pm_event {
50 /* A single cpu is entering a low power state */
51 CPU_PM_ENTER,
52
53 /* A single cpu failed to enter a low power state */
54 CPU_PM_ENTER_FAILED,
55
56 /* A single cpu is exiting a low power state */
57 CPU_PM_EXIT,
58
59 /* A cpu power domain is entering a low power state */
60 CPU_CLUSTER_PM_ENTER,
61
62 /* A cpu power domain failed to enter a low power state */
63 CPU_CLUSTER_PM_ENTER_FAILED,
64
65 /* A cpu power domain is exiting a low power state */
66 CPU_CLUSTER_PM_EXIT,
67};
68
69#ifdef CONFIG_CPU_PM
70int cpu_pm_register_notifier(struct notifier_block *nb);
71int cpu_pm_unregister_notifier(struct notifier_block *nb);
72int cpu_pm_enter(void);
73int cpu_pm_exit(void);
74int cpu_cluster_pm_enter(void);
75int cpu_cluster_pm_exit(void);
76
77#else
78
79static inline int cpu_pm_register_notifier(struct notifier_block *nb)
80{
81 return 0;
82}
83
84static inline int cpu_pm_unregister_notifier(struct notifier_block *nb)
85{
86 return 0;
87}
88
89static inline int cpu_pm_enter(void)
90{
91 return 0;
92}
93
94static inline int cpu_pm_exit(void)
95{
96 return 0;
97}
98
99static inline int cpu_cluster_pm_enter(void)
100{
101 return 0;
102}
103
104static inline int cpu_cluster_pm_exit(void)
105{
106 return 0;
107}
108#endif
109#endif
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index b51629e15cfc..7408af843b8a 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -13,7 +13,6 @@
13 13
14#include <linux/percpu.h> 14#include <linux/percpu.h>
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/module.h>
17#include <linux/kobject.h> 16#include <linux/kobject.h>
18#include <linux/completion.h> 17#include <linux/completion.h>
19 18
@@ -21,58 +20,65 @@
21#define CPUIDLE_NAME_LEN 16 20#define CPUIDLE_NAME_LEN 16
22#define CPUIDLE_DESC_LEN 32 21#define CPUIDLE_DESC_LEN 32
23 22
23struct module;
24
24struct cpuidle_device; 25struct cpuidle_device;
26struct cpuidle_driver;
25 27
26 28
27/**************************** 29/****************************
28 * CPUIDLE DEVICE INTERFACE * 30 * CPUIDLE DEVICE INTERFACE *
29 ****************************/ 31 ****************************/
30 32
33struct cpuidle_state_usage {
34 void *driver_data;
35
36 unsigned long long usage;
37 unsigned long long time; /* in US */
38};
39
31struct cpuidle_state { 40struct cpuidle_state {
32 char name[CPUIDLE_NAME_LEN]; 41 char name[CPUIDLE_NAME_LEN];
33 char desc[CPUIDLE_DESC_LEN]; 42 char desc[CPUIDLE_DESC_LEN];
34 void *driver_data;
35 43
36 unsigned int flags; 44 unsigned int flags;
37 unsigned int exit_latency; /* in US */ 45 unsigned int exit_latency; /* in US */
38 unsigned int power_usage; /* in mW */ 46 unsigned int power_usage; /* in mW */
39 unsigned int target_residency; /* in US */ 47 unsigned int target_residency; /* in US */
40 48
41 unsigned long long usage;
42 unsigned long long time; /* in US */
43
44 int (*enter) (struct cpuidle_device *dev, 49 int (*enter) (struct cpuidle_device *dev,
45 struct cpuidle_state *state); 50 struct cpuidle_driver *drv,
51 int index);
46}; 52};
47 53
48/* Idle State Flags */ 54/* Idle State Flags */
49#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ 55#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
50#define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */
51 56
52#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 57#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
53 58
54/** 59/**
55 * cpuidle_get_statedata - retrieves private driver state data 60 * cpuidle_get_statedata - retrieves private driver state data
56 * @state: the state 61 * @st_usage: the state usage statistics
57 */ 62 */
58static inline void * cpuidle_get_statedata(struct cpuidle_state *state) 63static inline void *cpuidle_get_statedata(struct cpuidle_state_usage *st_usage)
59{ 64{
60 return state->driver_data; 65 return st_usage->driver_data;
61} 66}
62 67
63/** 68/**
64 * cpuidle_set_statedata - stores private driver state data 69 * cpuidle_set_statedata - stores private driver state data
65 * @state: the state 70 * @st_usage: the state usage statistics
66 * @data: the private data 71 * @data: the private data
67 */ 72 */
68static inline void 73static inline void
69cpuidle_set_statedata(struct cpuidle_state *state, void *data) 74cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data)
70{ 75{
71 state->driver_data = data; 76 st_usage->driver_data = data;
72} 77}
73 78
74struct cpuidle_state_kobj { 79struct cpuidle_state_kobj {
75 struct cpuidle_state *state; 80 struct cpuidle_state *state;
81 struct cpuidle_state_usage *state_usage;
76 struct completion kobj_unregister; 82 struct completion kobj_unregister;
77 struct kobject kobj; 83 struct kobject kobj;
78}; 84};
@@ -80,22 +86,17 @@ struct cpuidle_state_kobj {
80struct cpuidle_device { 86struct cpuidle_device {
81 unsigned int registered:1; 87 unsigned int registered:1;
82 unsigned int enabled:1; 88 unsigned int enabled:1;
83 unsigned int power_specified:1;
84 unsigned int cpu; 89 unsigned int cpu;
85 90
86 int last_residency; 91 int last_residency;
87 int state_count; 92 int state_count;
88 struct cpuidle_state states[CPUIDLE_STATE_MAX]; 93 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
89 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; 94 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
90 struct cpuidle_state *last_state;
91 95
92 struct list_head device_list; 96 struct list_head device_list;
93 struct kobject kobj; 97 struct kobject kobj;
94 struct completion kobj_unregister; 98 struct completion kobj_unregister;
95 void *governor_data; 99 void *governor_data;
96 struct cpuidle_state *safe_state;
97
98 int (*prepare) (struct cpuidle_device *dev);
99}; 100};
100 101
101DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); 102DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices);
@@ -119,6 +120,11 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev)
119struct cpuidle_driver { 120struct cpuidle_driver {
120 char name[CPUIDLE_NAME_LEN]; 121 char name[CPUIDLE_NAME_LEN];
121 struct module *owner; 122 struct module *owner;
123
124 unsigned int power_specified:1;
125 struct cpuidle_state states[CPUIDLE_STATE_MAX];
126 int state_count;
127 int safe_state_index;
122}; 128};
123 129
124#ifdef CONFIG_CPU_IDLE 130#ifdef CONFIG_CPU_IDLE
@@ -165,11 +171,14 @@ struct cpuidle_governor {
165 struct list_head governor_list; 171 struct list_head governor_list;
166 unsigned int rating; 172 unsigned int rating;
167 173
168 int (*enable) (struct cpuidle_device *dev); 174 int (*enable) (struct cpuidle_driver *drv,
169 void (*disable) (struct cpuidle_device *dev); 175 struct cpuidle_device *dev);
176 void (*disable) (struct cpuidle_driver *drv,
177 struct cpuidle_device *dev);
170 178
171 int (*select) (struct cpuidle_device *dev); 179 int (*select) (struct cpuidle_driver *drv,
172 void (*reflect) (struct cpuidle_device *dev); 180 struct cpuidle_device *dev);
181 void (*reflect) (struct cpuidle_device *dev, int index);
173 182
174 struct module *owner; 183 struct module *owner;
175}; 184};
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index 74054074e876..5c4abce94ad1 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -10,6 +10,7 @@
10#define ELFCORE_ADDR_ERR (-2ULL) 10#define ELFCORE_ADDR_ERR (-2ULL)
11 11
12extern unsigned long long elfcorehdr_addr; 12extern unsigned long long elfcorehdr_addr;
13extern unsigned long long elfcorehdr_size;
13 14
14extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, 15extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
15 unsigned long, int); 16 unsigned long, int);
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 98f46efbe2d2..40308969ed00 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -269,7 +269,7 @@ static inline void put_cred(const struct cred *_cred)
269 * since nobody else can modify it. 269 * since nobody else can modify it.
270 */ 270 */
271#define current_cred() \ 271#define current_cred() \
272 (*(__force struct cred **)&current->cred) 272 rcu_dereference_protected(current->cred, 1)
273 273
274/** 274/**
275 * __task_cred - Access a task's objective credentials 275 * __task_cred - Access a task's objective credentials
@@ -307,7 +307,7 @@ static inline void put_cred(const struct cred *_cred)
307#define get_current_user() \ 307#define get_current_user() \
308({ \ 308({ \
309 struct user_struct *__u; \ 309 struct user_struct *__u; \
310 struct cred *__cred; \ 310 const struct cred *__cred; \
311 __cred = current_cred(); \ 311 __cred = current_cred(); \
312 __u = get_uid(__cred->user); \ 312 __u = get_uid(__cred->user); \
313 __u; \ 313 __u; \
@@ -322,7 +322,7 @@ static inline void put_cred(const struct cred *_cred)
322#define get_current_groups() \ 322#define get_current_groups() \
323({ \ 323({ \
324 struct group_info *__groups; \ 324 struct group_info *__groups; \
325 struct cred *__cred; \ 325 const struct cred *__cred; \
326 __cred = current_cred(); \ 326 __cred = current_cred(); \
327 __groups = get_group_info(__cred->group_info); \ 327 __groups = get_group_info(__cred->group_info); \
328 __groups; \ 328 __groups; \
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index e5e468e9133d..8a94217b298e 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -18,7 +18,6 @@
18#define _LINUX_CRYPTO_H 18#define _LINUX_CRYPTO_H
19 19
20#include <linux/atomic.h> 20#include <linux/atomic.h>
21#include <linux/module.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/list.h> 22#include <linux/list.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
@@ -72,6 +71,11 @@
72#define CRYPTO_ALG_TESTED 0x00000400 71#define CRYPTO_ALG_TESTED 0x00000400
73 72
74/* 73/*
74 * Set if the algorithm is an instance that is build from templates.
75 */
76#define CRYPTO_ALG_INSTANCE 0x00000800
77
78/*
75 * Transform masks and values (for crt_flags). 79 * Transform masks and values (for crt_flags).
76 */ 80 */
77#define CRYPTO_TFM_REQ_MASK 0x000fff00 81#define CRYPTO_TFM_REQ_MASK 0x000fff00
@@ -505,11 +509,6 @@ static inline int crypto_tfm_alg_priority(struct crypto_tfm *tfm)
505 return tfm->__crt_alg->cra_priority; 509 return tfm->__crt_alg->cra_priority;
506} 510}
507 511
508static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm)
509{
510 return module_name(tfm->__crt_alg->cra_module);
511}
512
513static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) 512static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
514{ 513{
515 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; 514 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
diff --git a/include/linux/cryptouser.h b/include/linux/cryptouser.h
new file mode 100644
index 000000000000..532fb58f16bf
--- /dev/null
+++ b/include/linux/cryptouser.h
@@ -0,0 +1,102 @@
1/*
2 * Crypto user configuration API.
3 *
4 * Copyright (C) 2011 secunet Security Networks AG
5 * Copyright (C) 2011 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/* Netlink configuration messages. */
22enum {
23 CRYPTO_MSG_BASE = 0x10,
24 CRYPTO_MSG_NEWALG = 0x10,
25 CRYPTO_MSG_DELALG,
26 CRYPTO_MSG_UPDATEALG,
27 CRYPTO_MSG_GETALG,
28 __CRYPTO_MSG_MAX
29};
30#define CRYPTO_MSG_MAX (__CRYPTO_MSG_MAX - 1)
31#define CRYPTO_NR_MSGTYPES (CRYPTO_MSG_MAX + 1 - CRYPTO_MSG_BASE)
32
33#define CRYPTO_MAX_NAME CRYPTO_MAX_ALG_NAME
34
35/* Netlink message attributes. */
36enum crypto_attr_type_t {
37 CRYPTOCFGA_UNSPEC,
38 CRYPTOCFGA_PRIORITY_VAL, /* __u32 */
39 CRYPTOCFGA_REPORT_LARVAL, /* struct crypto_report_larval */
40 CRYPTOCFGA_REPORT_HASH, /* struct crypto_report_hash */
41 CRYPTOCFGA_REPORT_BLKCIPHER, /* struct crypto_report_blkcipher */
42 CRYPTOCFGA_REPORT_AEAD, /* struct crypto_report_aead */
43 CRYPTOCFGA_REPORT_COMPRESS, /* struct crypto_report_comp */
44 CRYPTOCFGA_REPORT_RNG, /* struct crypto_report_rng */
45 CRYPTOCFGA_REPORT_CIPHER, /* struct crypto_report_cipher */
46 __CRYPTOCFGA_MAX
47
48#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
49};
50
51struct crypto_user_alg {
52 char cru_name[CRYPTO_MAX_ALG_NAME];
53 char cru_driver_name[CRYPTO_MAX_ALG_NAME];
54 char cru_module_name[CRYPTO_MAX_ALG_NAME];
55 __u32 cru_type;
56 __u32 cru_mask;
57 __u32 cru_refcnt;
58 __u32 cru_flags;
59};
60
61struct crypto_report_larval {
62 char type[CRYPTO_MAX_NAME];
63};
64
65struct crypto_report_hash {
66 char type[CRYPTO_MAX_NAME];
67 unsigned int blocksize;
68 unsigned int digestsize;
69};
70
71struct crypto_report_cipher {
72 char type[CRYPTO_MAX_ALG_NAME];
73 unsigned int blocksize;
74 unsigned int min_keysize;
75 unsigned int max_keysize;
76};
77
78struct crypto_report_blkcipher {
79 char type[CRYPTO_MAX_NAME];
80 char geniv[CRYPTO_MAX_NAME];
81 unsigned int blocksize;
82 unsigned int min_keysize;
83 unsigned int max_keysize;
84 unsigned int ivsize;
85};
86
87struct crypto_report_aead {
88 char type[CRYPTO_MAX_NAME];
89 char geniv[CRYPTO_MAX_NAME];
90 unsigned int blocksize;
91 unsigned int maxauthsize;
92 unsigned int ivsize;
93};
94
95struct crypto_report_comp {
96 char type[CRYPTO_MAX_NAME];
97};
98
99struct crypto_report_rng {
100 char type[CRYPTO_MAX_NAME];
101 unsigned int seedsize;
102};
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 62157c03caf7..4df926199369 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -165,6 +165,7 @@ struct dentry_operations {
165 unsigned int, const char *, const struct qstr *); 165 unsigned int, const char *, const struct qstr *);
166 int (*d_delete)(const struct dentry *); 166 int (*d_delete)(const struct dentry *);
167 void (*d_release)(struct dentry *); 167 void (*d_release)(struct dentry *);
168 void (*d_prune)(struct dentry *);
168 void (*d_iput)(struct dentry *, struct inode *); 169 void (*d_iput)(struct dentry *, struct inode *);
169 char *(*d_dname)(struct dentry *, char *, int); 170 char *(*d_dname)(struct dentry *, char *, int);
170 struct vfsmount *(*d_automount)(struct path *); 171 struct vfsmount *(*d_automount)(struct path *);
@@ -184,8 +185,9 @@ struct dentry_operations {
184#define DCACHE_OP_COMPARE 0x0002 185#define DCACHE_OP_COMPARE 0x0002
185#define DCACHE_OP_REVALIDATE 0x0004 186#define DCACHE_OP_REVALIDATE 0x0004
186#define DCACHE_OP_DELETE 0x0008 187#define DCACHE_OP_DELETE 0x0008
188#define DCACHE_OP_PRUNE 0x0010
187 189
188#define DCACHE_DISCONNECTED 0x0010 190#define DCACHE_DISCONNECTED 0x0020
189 /* This dentry is possibly not currently connected to the dcache tree, in 191 /* This dentry is possibly not currently connected to the dcache tree, in
190 * which case its parent will either be itself, or will have this flag as 192 * which case its parent will either be itself, or will have this flag as
191 * well. nfsd will not use a dentry with this bit set, but will first 193 * well. nfsd will not use a dentry with this bit set, but will first
@@ -196,8 +198,8 @@ struct dentry_operations {
196 * dentry into place and return that dentry rather than the passed one, 198 * dentry into place and return that dentry rather than the passed one,
197 * typically using d_splice_alias. */ 199 * typically using d_splice_alias. */
198 200
199#define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */ 201#define DCACHE_REFERENCED 0x0040 /* Recently used, don't discard. */
200#define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */ 202#define DCACHE_RCUACCESS 0x0080 /* Entry has ever been RCU-visible */
201 203
202#define DCACHE_CANT_MOUNT 0x0100 204#define DCACHE_CANT_MOUNT 0x0100
203#define DCACHE_GENOCIDE 0x0200 205#define DCACHE_GENOCIDE 0x0200
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
new file mode 100644
index 000000000000..afb94583960c
--- /dev/null
+++ b/include/linux/devfreq.h
@@ -0,0 +1,238 @@
1/*
2 * devfreq: Generic Dynamic Voltage and Frequency Scaling (DVFS) Framework
3 * for Non-CPU Devices.
4 *
5 * Copyright (C) 2011 Samsung Electronics
6 * MyungJoo Ham <myungjoo.ham@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __LINUX_DEVFREQ_H__
14#define __LINUX_DEVFREQ_H__
15
16#include <linux/device.h>
17#include <linux/notifier.h>
18#include <linux/opp.h>
19
20#define DEVFREQ_NAME_LEN 16
21
22struct devfreq;
23
24/**
25 * struct devfreq_dev_status - Data given from devfreq user device to
26 * governors. Represents the performance
27 * statistics.
28 * @total_time The total time represented by this instance of
29 * devfreq_dev_status
30 * @busy_time The time that the device was working among the
31 * total_time.
32 * @current_frequency The operating frequency.
33 * @private_data An entry not specified by the devfreq framework.
34 * A device and a specific governor may have their
35 * own protocol with private_data. However, because
36 * this is governor-specific, a governor using this
37 * will be only compatible with devices aware of it.
38 */
39struct devfreq_dev_status {
40 /* both since the last measure */
41 unsigned long total_time;
42 unsigned long busy_time;
43 unsigned long current_frequency;
44 void *private_date;
45};
46
47/**
48 * struct devfreq_dev_profile - Devfreq's user device profile
49 * @initial_freq The operating frequency when devfreq_add_device() is
50 * called.
51 * @polling_ms The polling interval in ms. 0 disables polling.
52 * @target The device should set its operating frequency at
53 * freq or lowest-upper-than-freq value. If freq is
54 * higher than any operable frequency, set maximum.
55 * Before returning, target function should set
56 * freq at the current frequency.
57 * @get_dev_status The device should provide the current performance
58 * status to devfreq, which is used by governors.
59 * @exit An optional callback that is called when devfreq
60 * is removing the devfreq object due to error or
61 * from devfreq_remove_device() call. If the user
62 * has registered devfreq->nb at a notifier-head,
63 * this is the time to unregister it.
64 */
65struct devfreq_dev_profile {
66 unsigned long initial_freq;
67 unsigned int polling_ms;
68
69 int (*target)(struct device *dev, unsigned long *freq);
70 int (*get_dev_status)(struct device *dev,
71 struct devfreq_dev_status *stat);
72 void (*exit)(struct device *dev);
73};
74
75/**
76 * struct devfreq_governor - Devfreq policy governor
77 * @name Governor's name
78 * @get_target_freq Returns desired operating frequency for the device.
79 * Basically, get_target_freq will run
80 * devfreq_dev_profile.get_dev_status() to get the
81 * status of the device (load = busy_time / total_time).
82 * If no_central_polling is set, this callback is called
83 * only with update_devfreq() notified by OPP.
84 * @init Called when the devfreq is being attached to a device
85 * @exit Called when the devfreq is being removed from a
86 * device. Governor should stop any internal routines
87 * before return because related data may be
88 * freed after exit().
89 * @no_central_polling Do not use devfreq's central polling mechanism.
90 * When this is set, devfreq will not call
91 * get_target_freq with devfreq_monitor(). However,
92 * devfreq will call get_target_freq with
93 * devfreq_update() notified by OPP framework.
94 *
95 * Note that the callbacks are called with devfreq->lock locked by devfreq.
96 */
97struct devfreq_governor {
98 const char name[DEVFREQ_NAME_LEN];
99 int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
100 int (*init)(struct devfreq *this);
101 void (*exit)(struct devfreq *this);
102 const bool no_central_polling;
103};
104
105/**
106 * struct devfreq - Device devfreq structure
107 * @node list node - contains the devices with devfreq that have been
108 * registered.
109 * @lock a mutex to protect accessing devfreq.
110 * @dev device registered by devfreq class. dev.parent is the device
111 * using devfreq.
112 * @profile device-specific devfreq profile
113 * @governor method how to choose frequency based on the usage.
114 * @nb notifier block used to notify devfreq object that it should
115 * reevaluate operable frequencies. Devfreq users may use
116 * devfreq.nb to the corresponding register notifier call chain.
117 * @polling_jiffies interval in jiffies.
118 * @previous_freq previously configured frequency value.
119 * @next_polling the number of remaining jiffies to poll with
120 * "devfreq_monitor" executions to reevaluate
121 * frequency/voltage of the device. Set by
122 * profile's polling_ms interval.
123 * @data Private data of the governor. The devfreq framework does not
124 * touch this.
125 * @being_removed a flag to mark that this object is being removed in
126 * order to prevent trying to remove the object multiple times.
127 *
128 * This structure stores the devfreq information for a give device.
129 *
130 * Note that when a governor accesses entries in struct devfreq in its
131 * functions except for the context of callbacks defined in struct
132 * devfreq_governor, the governor should protect its access with the
133 * struct mutex lock in struct devfreq. A governor may use this mutex
134 * to protect its own private data in void *data as well.
135 */
136struct devfreq {
137 struct list_head node;
138
139 struct mutex lock;
140 struct device dev;
141 struct devfreq_dev_profile *profile;
142 const struct devfreq_governor *governor;
143 struct notifier_block nb;
144
145 unsigned long polling_jiffies;
146 unsigned long previous_freq;
147 unsigned int next_polling;
148
149 void *data; /* private data for governors */
150
151 bool being_removed;
152};
153
154#if defined(CONFIG_PM_DEVFREQ)
155extern struct devfreq *devfreq_add_device(struct device *dev,
156 struct devfreq_dev_profile *profile,
157 const struct devfreq_governor *governor,
158 void *data);
159extern int devfreq_remove_device(struct devfreq *devfreq);
160
161/* Helper functions for devfreq user device driver with OPP. */
162extern struct opp *devfreq_recommended_opp(struct device *dev,
163 unsigned long *freq);
164extern int devfreq_register_opp_notifier(struct device *dev,
165 struct devfreq *devfreq);
166extern int devfreq_unregister_opp_notifier(struct device *dev,
167 struct devfreq *devfreq);
168
169#ifdef CONFIG_DEVFREQ_GOV_POWERSAVE
170extern const struct devfreq_governor devfreq_powersave;
171#endif
172#ifdef CONFIG_DEVFREQ_GOV_PERFORMANCE
173extern const struct devfreq_governor devfreq_performance;
174#endif
175#ifdef CONFIG_DEVFREQ_GOV_USERSPACE
176extern const struct devfreq_governor devfreq_userspace;
177#endif
178#ifdef CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
179extern const struct devfreq_governor devfreq_simple_ondemand;
180/**
181 * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq
182 * and devfreq_add_device
183 * @ upthreshold If the load is over this value, the frequency jumps.
184 * Specify 0 to use the default. Valid value = 0 to 100.
185 * @ downdifferential If the load is under upthreshold - downdifferential,
186 * the governor may consider slowing the frequency down.
187 * Specify 0 to use the default. Valid value = 0 to 100.
188 * downdifferential < upthreshold must hold.
189 *
190 * If the fed devfreq_simple_ondemand_data pointer is NULL to the governor,
191 * the governor uses the default values.
192 */
193struct devfreq_simple_ondemand_data {
194 unsigned int upthreshold;
195 unsigned int downdifferential;
196};
197#endif
198
199#else /* !CONFIG_PM_DEVFREQ */
200static struct devfreq *devfreq_add_device(struct device *dev,
201 struct devfreq_dev_profile *profile,
202 struct devfreq_governor *governor,
203 void *data);
204{
205 return NULL;
206}
207
208static int devfreq_remove_device(struct devfreq *devfreq);
209{
210 return 0;
211}
212
213static struct opp *devfreq_recommended_opp(struct device *dev,
214 unsigned long *freq)
215{
216 return -EINVAL;
217}
218
219static int devfreq_register_opp_notifier(struct device *dev,
220 struct devfreq *devfreq)
221{
222 return -EINVAL;
223}
224
225static int devfreq_unregister_opp_notifier(struct device *dev,
226 struct devfreq *devfreq)
227{
228 return -EINVAL;
229}
230
231#define devfreq_powersave NULL
232#define devfreq_performance NULL
233#define devfreq_userspace NULL
234#define devfreq_simple_ondemand NULL
235
236#endif /* CONFIG_PM_DEVFREQ */
237
238#endif /* __LINUX_DEVFREQ_H__ */
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 3fa1f3d90ce0..98f34b886f95 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -10,6 +10,7 @@
10 10
11#include <linux/bio.h> 11#include <linux/bio.h>
12#include <linux/blkdev.h> 12#include <linux/blkdev.h>
13#include <linux/ratelimit.h>
13 14
14struct dm_dev; 15struct dm_dev;
15struct dm_target; 16struct dm_target;
@@ -127,10 +128,6 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d);
127 * Information about a target type 128 * Information about a target type
128 */ 129 */
129 130
130/*
131 * Target features
132 */
133
134struct target_type { 131struct target_type {
135 uint64_t features; 132 uint64_t features;
136 const char *name; 133 const char *name;
@@ -159,6 +156,30 @@ struct target_type {
159 struct list_head list; 156 struct list_head list;
160}; 157};
161 158
159/*
160 * Target features
161 */
162
163/*
164 * Any table that contains an instance of this target must have only one.
165 */
166#define DM_TARGET_SINGLETON 0x00000001
167#define dm_target_needs_singleton(type) ((type)->features & DM_TARGET_SINGLETON)
168
169/*
170 * Indicates that a target does not support read-only devices.
171 */
172#define DM_TARGET_ALWAYS_WRITEABLE 0x00000002
173#define dm_target_always_writeable(type) \
174 ((type)->features & DM_TARGET_ALWAYS_WRITEABLE)
175
176/*
177 * Any device that contains a table with an instance of this target may never
178 * have tables containing any different target type.
179 */
180#define DM_TARGET_IMMUTABLE 0x00000004
181#define dm_target_is_immutable(type) ((type)->features & DM_TARGET_IMMUTABLE)
182
162struct dm_target { 183struct dm_target {
163 struct dm_table *table; 184 struct dm_table *table;
164 struct target_type *type; 185 struct target_type *type;
@@ -197,6 +218,11 @@ struct dm_target {
197 * whether or not its underlying devices have support. 218 * whether or not its underlying devices have support.
198 */ 219 */
199 unsigned discards_supported:1; 220 unsigned discards_supported:1;
221
222 /*
223 * Set if this target does not return zeroes on discarded blocks.
224 */
225 unsigned discard_zeroes_data_unsupported:1;
200}; 226};
201 227
202/* Each target can link one of these into the table */ 228/* Each target can link one of these into the table */
@@ -370,6 +396,14 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
370 *---------------------------------------------------------------*/ 396 *---------------------------------------------------------------*/
371#define DM_NAME "device-mapper" 397#define DM_NAME "device-mapper"
372 398
399#ifdef CONFIG_PRINTK
400extern struct ratelimit_state dm_ratelimit_state;
401
402#define dm_ratelimit() __ratelimit(&dm_ratelimit_state)
403#else
404#define dm_ratelimit() 0
405#endif
406
373#define DMCRIT(f, arg...) \ 407#define DMCRIT(f, arg...) \
374 printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 408 printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
375 409
@@ -377,7 +411,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
377 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 411 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
378#define DMERR_LIMIT(f, arg...) \ 412#define DMERR_LIMIT(f, arg...) \
379 do { \ 413 do { \
380 if (printk_ratelimit()) \ 414 if (dm_ratelimit()) \
381 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \ 415 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \
382 f "\n", ## arg); \ 416 f "\n", ## arg); \
383 } while (0) 417 } while (0)
@@ -386,7 +420,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
386 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 420 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
387#define DMWARN_LIMIT(f, arg...) \ 421#define DMWARN_LIMIT(f, arg...) \
388 do { \ 422 do { \
389 if (printk_ratelimit()) \ 423 if (dm_ratelimit()) \
390 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \ 424 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \
391 f "\n", ## arg); \ 425 f "\n", ## arg); \
392 } while (0) 426 } while (0)
@@ -395,7 +429,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
395 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 429 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
396#define DMINFO_LIMIT(f, arg...) \ 430#define DMINFO_LIMIT(f, arg...) \
397 do { \ 431 do { \
398 if (printk_ratelimit()) \ 432 if (dm_ratelimit()) \
399 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \ 433 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \
400 "\n", ## arg); \ 434 "\n", ## arg); \
401 } while (0) 435 } while (0)
@@ -405,7 +439,7 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size);
405 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) 439 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg)
406# define DMDEBUG_LIMIT(f, arg...) \ 440# define DMDEBUG_LIMIT(f, arg...) \
407 do { \ 441 do { \
408 if (printk_ratelimit()) \ 442 if (dm_ratelimit()) \
409 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \ 443 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \
410 "\n", ## arg); \ 444 "\n", ## arg); \
411 } while (0) 445 } while (0)
diff --git a/include/linux/device.h b/include/linux/device.h
index c20dfbfc49b4..ffbcf95cd97d 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -20,7 +20,7 @@
20#include <linux/lockdep.h> 20#include <linux/lockdep.h>
21#include <linux/compiler.h> 21#include <linux/compiler.h>
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/module.h> 23#include <linux/mutex.h>
24#include <linux/pm.h> 24#include <linux/pm.h>
25#include <linux/atomic.h> 25#include <linux/atomic.h>
26#include <asm/device.h> 26#include <asm/device.h>
@@ -29,10 +29,12 @@ struct device;
29struct device_private; 29struct device_private;
30struct device_driver; 30struct device_driver;
31struct driver_private; 31struct driver_private;
32struct module;
32struct class; 33struct class;
33struct subsys_private; 34struct subsys_private;
34struct bus_type; 35struct bus_type;
35struct device_node; 36struct device_node;
37struct iommu_ops;
36 38
37struct bus_attribute { 39struct bus_attribute {
38 struct attribute attr; 40 struct attribute attr;
@@ -67,6 +69,9 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
67 * @resume: Called to bring a device on this bus out of sleep mode. 69 * @resume: Called to bring a device on this bus out of sleep mode.
68 * @pm: Power management operations of this bus, callback the specific 70 * @pm: Power management operations of this bus, callback the specific
69 * device driver's pm-ops. 71 * device driver's pm-ops.
72 * @iommu_ops IOMMU specific operations for this bus, used to attach IOMMU
73 * driver implementations to a bus and allow the driver to do
74 * bus-specific setup
70 * @p: The private data of the driver core, only the driver core can 75 * @p: The private data of the driver core, only the driver core can
71 * touch this. 76 * touch this.
72 * 77 *
@@ -96,6 +101,8 @@ struct bus_type {
96 101
97 const struct dev_pm_ops *pm; 102 const struct dev_pm_ops *pm;
98 103
104 struct iommu_ops *iommu_ops;
105
99 struct subsys_private *p; 106 struct subsys_private *p;
100}; 107};
101 108
@@ -350,6 +357,8 @@ struct class_attribute {
350 char *buf); 357 char *buf);
351 ssize_t (*store)(struct class *class, struct class_attribute *attr, 358 ssize_t (*store)(struct class *class, struct class_attribute *attr,
352 const char *buf, size_t count); 359 const char *buf, size_t count);
360 const void *(*namespace)(struct class *class,
361 const struct class_attribute *attr);
353}; 362};
354 363
355#define CLASS_ATTR(_name, _mode, _show, _store) \ 364#define CLASS_ATTR(_name, _mode, _show, _store) \
@@ -614,8 +623,8 @@ static inline const char *dev_name(const struct device *dev)
614 return kobject_name(&dev->kobj); 623 return kobject_name(&dev->kobj);
615} 624}
616 625
617extern int dev_set_name(struct device *dev, const char *name, ...) 626extern __printf(2, 3)
618 __attribute__((format(printf, 2, 3))); 627int dev_set_name(struct device *dev, const char *name, ...);
619 628
620#ifdef CONFIG_NUMA 629#ifdef CONFIG_NUMA
621static inline int dev_to_node(struct device *dev) 630static inline int dev_to_node(struct device *dev)
@@ -636,6 +645,11 @@ static inline void set_dev_node(struct device *dev, int node)
636} 645}
637#endif 646#endif
638 647
648static inline struct pm_subsys_data *dev_to_psd(struct device *dev)
649{
650 return dev ? dev->power.subsys_data : NULL;
651}
652
639static inline unsigned int dev_get_uevent_suppress(const struct device *dev) 653static inline unsigned int dev_get_uevent_suppress(const struct device *dev)
640{ 654{
641 return dev->kobj.uevent_suppress; 655 return dev->kobj.uevent_suppress;
@@ -710,10 +724,14 @@ extern int dev_set_drvdata(struct device *dev, void *data);
710 */ 724 */
711extern struct device *__root_device_register(const char *name, 725extern struct device *__root_device_register(const char *name,
712 struct module *owner); 726 struct module *owner);
713static inline struct device *root_device_register(const char *name) 727
714{ 728/*
715 return __root_device_register(name, THIS_MODULE); 729 * This is a macro to avoid include problems with THIS_MODULE,
716} 730 * just as per what is done for device_schedule_callback() above.
731 */
732#define root_device_register(name) \
733 __root_device_register(name, THIS_MODULE)
734
717extern void root_device_unregister(struct device *root); 735extern void root_device_unregister(struct device *root);
718 736
719static inline void *dev_get_platdata(const struct device *dev) 737static inline void *dev_get_platdata(const struct device *dev)
@@ -740,10 +758,10 @@ extern struct device *device_create_vargs(struct class *cls,
740 void *drvdata, 758 void *drvdata,
741 const char *fmt, 759 const char *fmt,
742 va_list vargs); 760 va_list vargs);
743extern struct device *device_create(struct class *cls, struct device *parent, 761extern __printf(5, 6)
744 dev_t devt, void *drvdata, 762struct device *device_create(struct class *cls, struct device *parent,
745 const char *fmt, ...) 763 dev_t devt, void *drvdata,
746 __attribute__((format(printf, 5, 6))); 764 const char *fmt, ...);
747extern void device_destroy(struct class *cls, dev_t devt); 765extern void device_destroy(struct class *cls, dev_t devt);
748 766
749/* 767/*
@@ -785,61 +803,58 @@ extern const char *dev_driver_string(const struct device *dev);
785 803
786#ifdef CONFIG_PRINTK 804#ifdef CONFIG_PRINTK
787 805
788extern int dev_printk(const char *level, const struct device *dev, 806extern int __dev_printk(const char *level, const struct device *dev,
789 const char *fmt, ...) 807 struct va_format *vaf);
790 __attribute__ ((format (printf, 3, 4))); 808extern __printf(3, 4)
791extern int dev_emerg(const struct device *dev, const char *fmt, ...) 809int dev_printk(const char *level, const struct device *dev,
792 __attribute__ ((format (printf, 2, 3))); 810 const char *fmt, ...)
793extern int dev_alert(const struct device *dev, const char *fmt, ...) 811 ;
794 __attribute__ ((format (printf, 2, 3))); 812extern __printf(2, 3)
795extern int dev_crit(const struct device *dev, const char *fmt, ...) 813int dev_emerg(const struct device *dev, const char *fmt, ...);
796 __attribute__ ((format (printf, 2, 3))); 814extern __printf(2, 3)
797extern int dev_err(const struct device *dev, const char *fmt, ...) 815int dev_alert(const struct device *dev, const char *fmt, ...);
798 __attribute__ ((format (printf, 2, 3))); 816extern __printf(2, 3)
799extern int dev_warn(const struct device *dev, const char *fmt, ...) 817int dev_crit(const struct device *dev, const char *fmt, ...);
800 __attribute__ ((format (printf, 2, 3))); 818extern __printf(2, 3)
801extern int dev_notice(const struct device *dev, const char *fmt, ...) 819int dev_err(const struct device *dev, const char *fmt, ...);
802 __attribute__ ((format (printf, 2, 3))); 820extern __printf(2, 3)
803extern int _dev_info(const struct device *dev, const char *fmt, ...) 821int dev_warn(const struct device *dev, const char *fmt, ...);
804 __attribute__ ((format (printf, 2, 3))); 822extern __printf(2, 3)
823int dev_notice(const struct device *dev, const char *fmt, ...);
824extern __printf(2, 3)
825int _dev_info(const struct device *dev, const char *fmt, ...);
805 826
806#else 827#else
807 828
808static inline int dev_printk(const char *level, const struct device *dev, 829static inline int __dev_printk(const char *level, const struct device *dev,
809 const char *fmt, ...) 830 struct va_format *vaf)
810 __attribute__ ((format (printf, 3, 4))); 831{ return 0; }
811static inline int dev_printk(const char *level, const struct device *dev, 832static inline __printf(3, 4)
812 const char *fmt, ...) 833int dev_printk(const char *level, const struct device *dev,
813 { return 0; } 834 const char *fmt, ...)
814 835{ return 0; }
815static inline int dev_emerg(const struct device *dev, const char *fmt, ...) 836
816 __attribute__ ((format (printf, 2, 3))); 837static inline __printf(2, 3)
817static inline int dev_emerg(const struct device *dev, const char *fmt, ...) 838int dev_emerg(const struct device *dev, const char *fmt, ...)
818 { return 0; } 839{ return 0; }
819static inline int dev_crit(const struct device *dev, const char *fmt, ...) 840static inline __printf(2, 3)
820 __attribute__ ((format (printf, 2, 3))); 841int dev_crit(const struct device *dev, const char *fmt, ...)
821static inline int dev_crit(const struct device *dev, const char *fmt, ...) 842{ return 0; }
822 { return 0; } 843static inline __printf(2, 3)
823static inline int dev_alert(const struct device *dev, const char *fmt, ...) 844int dev_alert(const struct device *dev, const char *fmt, ...)
824 __attribute__ ((format (printf, 2, 3))); 845{ return 0; }
825static inline int dev_alert(const struct device *dev, const char *fmt, ...) 846static inline __printf(2, 3)
826 { return 0; } 847int dev_err(const struct device *dev, const char *fmt, ...)
827static inline int dev_err(const struct device *dev, const char *fmt, ...) 848{ return 0; }
828 __attribute__ ((format (printf, 2, 3))); 849static inline __printf(2, 3)
829static inline int dev_err(const struct device *dev, const char *fmt, ...) 850int dev_warn(const struct device *dev, const char *fmt, ...)
830 { return 0; } 851{ return 0; }
831static inline int dev_warn(const struct device *dev, const char *fmt, ...) 852static inline __printf(2, 3)
832 __attribute__ ((format (printf, 2, 3))); 853int dev_notice(const struct device *dev, const char *fmt, ...)
833static inline int dev_warn(const struct device *dev, const char *fmt, ...) 854{ return 0; }
834 { return 0; } 855static inline __printf(2, 3)
835static inline int dev_notice(const struct device *dev, const char *fmt, ...) 856int _dev_info(const struct device *dev, const char *fmt, ...)
836 __attribute__ ((format (printf, 2, 3))); 857{ return 0; }
837static inline int dev_notice(const struct device *dev, const char *fmt, ...)
838 { return 0; }
839static inline int _dev_info(const struct device *dev, const char *fmt, ...)
840 __attribute__ ((format (printf, 2, 3)));
841static inline int _dev_info(const struct device *dev, const char *fmt, ...)
842 { return 0; }
843 858
844#endif 859#endif
845 860
diff --git a/include/linux/device_cgroup.h b/include/linux/device_cgroup.h
index 7aad1f440867..8b64221b432b 100644
--- a/include/linux/device_cgroup.h
+++ b/include/linux/device_cgroup.h
@@ -1,4 +1,3 @@
1#include <linux/module.h>
2#include <linux/fs.h> 1#include <linux/fs.h>
3 2
4#ifdef CONFIG_CGROUP_DEVICE 3#ifdef CONFIG_CGROUP_DEVICE
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 0cb8eff76bd6..75fd5573516e 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -267,9 +267,9 @@ enum {
267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
268 268
269#define DM_VERSION_MAJOR 4 269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 21 270#define DM_VERSION_MINOR 22
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 0
272#define DM_VERSION_EXTRA "-ioctl (2011-07-06)" 272#define DM_VERSION_EXTRA "-ioctl (2011-10-19)"
273 273
274/* Status bits */ 274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 275#define DM_READONLY_FLAG (1 << 0) /* In/Out */
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h
index 5e54458e920f..47d9d376e4e7 100644
--- a/include/linux/dm-kcopyd.h
+++ b/include/linux/dm-kcopyd.h
@@ -57,5 +57,9 @@ void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc,
57 dm_kcopyd_notify_fn fn, void *context); 57 dm_kcopyd_notify_fn fn, void *context);
58void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err); 58void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err);
59 59
60int dm_kcopyd_zero(struct dm_kcopyd_client *kc,
61 unsigned num_dests, struct dm_io_region *dests,
62 unsigned flags, dm_kcopyd_notify_fn fn, void *context);
63
60#endif /* __KERNEL__ */ 64#endif /* __KERNEL__ */
61#endif /* _LINUX_DM_KCOPYD_H */ 65#endif /* _LINUX_DM_KCOPYD_H */
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h
index eeace7d3ff15..0678c2adc421 100644
--- a/include/linux/dm-log-userspace.h
+++ b/include/linux/dm-log-userspace.h
@@ -52,15 +52,20 @@
52 * Payload-to-userspace: 52 * Payload-to-userspace:
53 * A single string containing all the argv arguments separated by ' 's 53 * A single string containing all the argv arguments separated by ' 's
54 * Payload-to-kernel: 54 * Payload-to-kernel:
55 * None. ('data_size' in the dm_ulog_request struct should be 0.) 55 * A NUL-terminated string that is the name of the device that is used
56 * as the backing store for the log data. 'dm_get_device' will be called
57 * on this device. ('dm_put_device' will be called on this device
58 * automatically after calling DM_ULOG_DTR.) If there is no device needed
59 * for log data, 'data_size' in the dm_ulog_request struct should be 0.
56 * 60 *
57 * The UUID contained in the dm_ulog_request structure is the reference that 61 * The UUID contained in the dm_ulog_request structure is the reference that
58 * will be used by all request types to a specific log. The constructor must 62 * will be used by all request types to a specific log. The constructor must
59 * record this assotiation with instance created. 63 * record this association with the instance created.
60 * 64 *
61 * When the request has been processed, user-space must return the 65 * When the request has been processed, user-space must return the
62 * dm_ulog_request to the kernel - setting the 'error' field and 66 * dm_ulog_request to the kernel - setting the 'error' field, filling the
63 * 'data_size' appropriately. 67 * data field with the log device if necessary, and setting 'data_size'
68 * appropriately.
64 */ 69 */
65#define DM_ULOG_CTR 1 70#define DM_ULOG_CTR 1
66 71
@@ -377,8 +382,11 @@
377 * dm_ulog_request or a change in the way requests are 382 * dm_ulog_request or a change in the way requests are
378 * issued/handled. Changes are outlined here: 383 * issued/handled. Changes are outlined here:
379 * version 1: Initial implementation 384 * version 1: Initial implementation
385 * version 2: DM_ULOG_CTR allowed to return a string containing a
386 * device name that is to be registered with DM via
387 * 'dm_get_device'.
380 */ 388 */
381#define DM_ULOG_REQUEST_VERSION 1 389#define DM_ULOG_REQUEST_VERSION 2
382 390
383struct dm_ulog_request { 391struct dm_ulog_request {
384 /* 392 /*
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 347fdc32177a..e13117cbd2f7 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_DMA_MAPPING_H 1#ifndef _LINUX_DMA_MAPPING_H
2#define _LINUX_DMA_MAPPING_H 2#define _LINUX_DMA_MAPPING_H
3 3
4#include <linux/string.h>
4#include <linux/device.h> 5#include <linux/device.h>
5#include <linux/err.h> 6#include <linux/err.h>
6#include <linux/dma-attrs.h> 7#include <linux/dma-attrs.h>
@@ -41,6 +42,9 @@ struct dma_map_ops {
41 int (*mapping_error)(struct device *dev, dma_addr_t dma_addr); 42 int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
42 int (*dma_supported)(struct device *dev, u64 mask); 43 int (*dma_supported)(struct device *dev, u64 mask);
43 int (*set_dma_mask)(struct device *dev, u64 mask); 44 int (*set_dma_mask)(struct device *dev, u64 mask);
45#ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK
46 u64 (*get_required_mask)(struct device *dev);
47#endif
44 int is_phys; 48 int is_phys;
45}; 49};
46 50
@@ -117,6 +121,15 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
117 return -EIO; 121 return -EIO;
118} 122}
119 123
124static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
125 dma_addr_t *dma_handle, gfp_t flag)
126{
127 void *ret = dma_alloc_coherent(dev, size, dma_handle, flag);
128 if (ret)
129 memset(ret, 0, size);
130 return ret;
131}
132
120#ifdef CONFIG_HAS_DMA 133#ifdef CONFIG_HAS_DMA
121static inline int dma_get_cache_alignment(void) 134static inline int dma_get_cache_alignment(void)
122{ 135{
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
index bbd8661b3473..ef90cbd8e173 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -25,11 +25,12 @@ struct intel_iommu;
25struct dmar_domain; 25struct dmar_domain;
26struct root_entry; 26struct root_entry;
27 27
28extern void free_dmar_iommu(struct intel_iommu *iommu);
29 28
30#ifdef CONFIG_DMAR 29#ifdef CONFIG_INTEL_IOMMU
30extern void free_dmar_iommu(struct intel_iommu *iommu);
31extern int iommu_calculate_agaw(struct intel_iommu *iommu); 31extern int iommu_calculate_agaw(struct intel_iommu *iommu);
32extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); 32extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
33extern int dmar_disabled;
33#else 34#else
34static inline int iommu_calculate_agaw(struct intel_iommu *iommu) 35static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
35{ 36{
@@ -39,8 +40,11 @@ static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
39{ 40{
40 return 0; 41 return 0;
41} 42}
43static inline void free_dmar_iommu(struct intel_iommu *iommu)
44{
45}
46#define dmar_disabled (1)
42#endif 47#endif
43 48
44extern int dmar_disabled;
45 49
46#endif 50#endif
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 8fbf40e0713c..75f53f874b24 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -24,8 +24,9 @@
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/uio.h> 25#include <linux/uio.h>
26#include <linux/dma-direction.h> 26#include <linux/dma-direction.h>
27 27#include <linux/scatterlist.h>
28struct scatterlist; 28#include <linux/bitmap.h>
29#include <asm/page.h>
29 30
30/** 31/**
31 * typedef dma_cookie_t - an opaque DMA cookie 32 * typedef dma_cookie_t - an opaque DMA cookie
@@ -519,6 +520,16 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
519 (unsigned long)config); 520 (unsigned long)config);
520} 521}
521 522
523static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
524 struct dma_chan *chan, void *buf, size_t len,
525 enum dma_data_direction dir, unsigned long flags)
526{
527 struct scatterlist sg;
528 sg_init_one(&sg, buf, len);
529
530 return chan->device->device_prep_slave_sg(chan, &sg, 1, dir, flags);
531}
532
522static inline int dmaengine_terminate_all(struct dma_chan *chan) 533static inline int dmaengine_terminate_all(struct dma_chan *chan)
523{ 534{
524 return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); 535 return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 7b776d71d36d..731a60975101 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -26,8 +26,15 @@
26#include <linux/msi.h> 26#include <linux/msi.h>
27#include <linux/irqreturn.h> 27#include <linux/irqreturn.h>
28 28
29struct acpi_dmar_header;
30
31/* DMAR Flags */
32#define DMAR_INTR_REMAP 0x1
33#define DMAR_X2APIC_OPT_OUT 0x2
34
29struct intel_iommu; 35struct intel_iommu;
30#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) 36#ifdef CONFIG_DMAR_TABLE
37extern struct acpi_table_header *dmar_tbl;
31struct dmar_drhd_unit { 38struct dmar_drhd_unit {
32 struct list_head list; /* list of drhd units */ 39 struct list_head list; /* list of drhd units */
33 struct acpi_dmar_header *hdr; /* ACPI header */ 40 struct acpi_dmar_header *hdr; /* ACPI header */
@@ -76,7 +83,7 @@ static inline int enable_drhd_fault_handling(void)
76{ 83{
77 return -1; 84 return -1;
78} 85}
79#endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ 86#endif /* !CONFIG_DMAR_TABLE */
80 87
81struct irte { 88struct irte {
82 union { 89 union {
@@ -107,10 +114,10 @@ struct irte {
107 }; 114 };
108}; 115};
109 116
110#ifdef CONFIG_INTR_REMAP 117#ifdef CONFIG_IRQ_REMAP
111extern int intr_remapping_enabled; 118extern int intr_remapping_enabled;
112extern int intr_remapping_supported(void); 119extern int intr_remapping_supported(void);
113extern int enable_intr_remapping(int); 120extern int enable_intr_remapping(void);
114extern void disable_intr_remapping(void); 121extern void disable_intr_remapping(void);
115extern int reenable_intr_remapping(int); 122extern int reenable_intr_remapping(int);
116 123
@@ -177,7 +184,7 @@ static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)
177 184
178#define intr_remapping_enabled (0) 185#define intr_remapping_enabled (0)
179 186
180static inline int enable_intr_remapping(int eim) 187static inline int enable_intr_remapping(void)
181{ 188{
182 return -1; 189 return -1;
183} 190}
@@ -192,6 +199,11 @@ static inline int reenable_intr_remapping(int eim)
192} 199}
193#endif 200#endif
194 201
202enum {
203 IRQ_REMAP_XAPIC_MODE,
204 IRQ_REMAP_X2APIC_MODE,
205};
206
195/* Can't use the common MSI interrupt functions 207/* Can't use the common MSI interrupt functions
196 * since DMAR is not a pci device 208 * since DMAR is not a pci device
197 */ 209 */
@@ -204,7 +216,7 @@ extern int dmar_set_interrupt(struct intel_iommu *iommu);
204extern irqreturn_t dmar_fault(int irq, void *dev_id); 216extern irqreturn_t dmar_fault(int irq, void *dev_id);
205extern int arch_setup_dmar_msi(unsigned int irq); 217extern int arch_setup_dmar_msi(unsigned int irq);
206 218
207#ifdef CONFIG_DMAR 219#ifdef CONFIG_INTEL_IOMMU
208extern int iommu_detected, no_iommu; 220extern int iommu_detected, no_iommu;
209extern struct list_head dmar_rmrr_units; 221extern struct list_head dmar_rmrr_units;
210struct dmar_rmrr_unit { 222struct dmar_rmrr_unit {
@@ -227,9 +239,26 @@ struct dmar_atsr_unit {
227 u8 include_all:1; /* include all ports */ 239 u8 include_all:1; /* include all ports */
228}; 240};
229 241
242int dmar_parse_rmrr_atsr_dev(void);
243extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header);
244extern int dmar_parse_one_atsr(struct acpi_dmar_header *header);
245extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
246 struct pci_dev ***devices, u16 segment);
230extern int intel_iommu_init(void); 247extern int intel_iommu_init(void);
231#else /* !CONFIG_DMAR: */ 248#else /* !CONFIG_INTEL_IOMMU: */
232static inline int intel_iommu_init(void) { return -ENODEV; } 249static inline int intel_iommu_init(void) { return -ENODEV; }
233#endif /* CONFIG_DMAR */ 250static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header)
251{
252 return 0;
253}
254static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header)
255{
256 return 0;
257}
258static inline int dmar_parse_rmrr_atsr_dev(void)
259{
260 return 0;
261}
262#endif /* CONFIG_INTEL_IOMMU */
234 263
235#endif /* __DMAR_H__ */ 264#endif /* __DMAR_H__ */
diff --git a/include/linux/drbd_tag_magic.h b/include/linux/drbd_tag_magic.h
index 069543190516..81f52f2c5724 100644
--- a/include/linux/drbd_tag_magic.h
+++ b/include/linux/drbd_tag_magic.h
@@ -28,7 +28,7 @@ enum packet_types {
28#define NL_STRING(pn, pr, member, len) \ 28#define NL_STRING(pn, pr, member, len) \
29 unsigned char member[len]; int member ## _len; \ 29 unsigned char member[len]; int member ## _len; \
30 int tag_and_len ## member; 30 int tag_and_len ## member;
31#include "linux/drbd_nl.h" 31#include <linux/drbd_nl.h>
32 32
33/* declare tag-list-sizes */ 33/* declare tag-list-sizes */
34static const int tag_list_sizes[] = { 34static const int tag_list_sizes[] = {
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
index 36a3ed63f571..1b1094c35e4f 100644
--- a/include/linux/dvb/frontend.h
+++ b/include/linux/dvb/frontend.h
@@ -349,6 +349,7 @@ typedef enum fe_delivery_system {
349 SYS_CMMB, 349 SYS_CMMB,
350 SYS_DAB, 350 SYS_DAB,
351 SYS_DVBT2, 351 SYS_DVBT2,
352 SYS_TURBO,
352} fe_delivery_system_t; 353} fe_delivery_system_t;
353 354
354struct dtv_cmds_h { 355struct dtv_cmds_h {
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h
index 1421cc84afaa..66594b1d5d7b 100644
--- a/include/linux/dvb/version.h
+++ b/include/linux/dvb/version.h
@@ -24,6 +24,6 @@
24#define _DVBVERSION_H_ 24#define _DVBVERSION_H_
25 25
26#define DVB_API_VERSION 5 26#define DVB_API_VERSION 5
27#define DVB_API_VERSION_MINOR 3 27#define DVB_API_VERSION_MINOR 4
28 28
29#endif /*_DVBVERSION_H_*/ 29#endif /*_DVBVERSION_H_*/
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h
index 49638ea3b776..07261d52a6df 100644
--- a/include/linux/dw_apb_timer.h
+++ b/include/linux/dw_apb_timer.h
@@ -46,7 +46,7 @@ struct dw_apb_clock_event_device *
46dw_apb_clockevent_init(int cpu, const char *name, unsigned rating, 46dw_apb_clockevent_init(int cpu, const char *name, unsigned rating,
47 void __iomem *base, int irq, unsigned long freq); 47 void __iomem *base, int irq, unsigned long freq);
48struct dw_apb_clocksource * 48struct dw_apb_clocksource *
49dw_apb_clocksource_init(unsigned rating, char *name, void __iomem *base, 49dw_apb_clocksource_init(unsigned rating, const char *name, void __iomem *base,
50 unsigned long freq); 50 unsigned long freq);
51void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs); 51void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs);
52void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); 52void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs);
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index e747ecd48e1c..0564e3c39882 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -1,13 +1,6 @@
1#ifndef _DYNAMIC_DEBUG_H 1#ifndef _DYNAMIC_DEBUG_H
2#define _DYNAMIC_DEBUG_H 2#define _DYNAMIC_DEBUG_H
3 3
4/* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which
5 * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They
6 * use independent hash functions, to reduce the chance of false positives.
7 */
8extern long long dynamic_debug_enabled;
9extern long long dynamic_debug_enabled2;
10
11/* 4/*
12 * An instance of this structure is created in a special 5 * An instance of this structure is created in a special
13 * ELF section at every dynamic debug callsite. At runtime, 6 * ELF section at every dynamic debug callsite. At runtime,
@@ -44,29 +37,57 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n,
44 37
45#if defined(CONFIG_DYNAMIC_DEBUG) 38#if defined(CONFIG_DYNAMIC_DEBUG)
46extern int ddebug_remove_module(const char *mod_name); 39extern int ddebug_remove_module(const char *mod_name);
47extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...) 40extern __printf(2, 3)
48 __attribute__ ((format (printf, 2, 3))); 41int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...);
49 42
50#define dynamic_pr_debug(fmt, ...) do { \ 43struct device;
51 static struct _ddebug descriptor \ 44
52 __used \ 45extern __printf(3, 4)
53 __attribute__((section("__verbose"), aligned(8))) = \ 46int __dynamic_dev_dbg(struct _ddebug *descriptor, const struct device *dev,
54 { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ 47 const char *fmt, ...);
55 _DPRINTK_FLAGS_DEFAULT }; \ 48
56 if (unlikely(descriptor.enabled)) \ 49struct net_device;
57 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \ 50
58 } while (0) 51extern __printf(3, 4)
59 52int __dynamic_netdev_dbg(struct _ddebug *descriptor,
60 53 const struct net_device *dev,
61#define dynamic_dev_dbg(dev, fmt, ...) do { \ 54 const char *fmt, ...);
62 static struct _ddebug descriptor \ 55
63 __used \ 56#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
64 __attribute__((section("__verbose"), aligned(8))) = \ 57 static struct _ddebug __used __aligned(8) \
65 { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ 58 __attribute__((section("__verbose"))) name = { \
66 _DPRINTK_FLAGS_DEFAULT }; \ 59 .modname = KBUILD_MODNAME, \
67 if (unlikely(descriptor.enabled)) \ 60 .function = __func__, \
68 dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ 61 .filename = __FILE__, \
69 } while (0) 62 .format = (fmt), \
63 .lineno = __LINE__, \
64 .flags = _DPRINTK_FLAGS_DEFAULT, \
65 .enabled = false, \
66 }
67
68#define dynamic_pr_debug(fmt, ...) \
69do { \
70 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
71 if (unlikely(descriptor.enabled)) \
72 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \
73 ##__VA_ARGS__); \
74} while (0)
75
76#define dynamic_dev_dbg(dev, fmt, ...) \
77do { \
78 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
79 if (unlikely(descriptor.enabled)) \
80 __dynamic_dev_dbg(&descriptor, dev, fmt, \
81 ##__VA_ARGS__); \
82} while (0)
83
84#define dynamic_netdev_dbg(dev, fmt, ...) \
85do { \
86 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
87 if (unlikely(descriptor.enabled)) \
88 __dynamic_netdev_dbg(&descriptor, dev, fmt, \
89 ##__VA_ARGS__); \
90} while (0)
70 91
71#else 92#else
72 93
diff --git a/include/linux/edac.h b/include/linux/edac.h
index 4a73257b47d0..055b248bdd53 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -42,4 +42,354 @@ static inline void opstate_init(void)
42 return; 42 return;
43} 43}
44 44
45#define EDAC_MC_LABEL_LEN 31
46#define MC_PROC_NAME_MAX_LEN 7
47
48/* memory devices */
49enum dev_type {
50 DEV_UNKNOWN = 0,
51 DEV_X1,
52 DEV_X2,
53 DEV_X4,
54 DEV_X8,
55 DEV_X16,
56 DEV_X32, /* Do these parts exist? */
57 DEV_X64 /* Do these parts exist? */
58};
59
60#define DEV_FLAG_UNKNOWN BIT(DEV_UNKNOWN)
61#define DEV_FLAG_X1 BIT(DEV_X1)
62#define DEV_FLAG_X2 BIT(DEV_X2)
63#define DEV_FLAG_X4 BIT(DEV_X4)
64#define DEV_FLAG_X8 BIT(DEV_X8)
65#define DEV_FLAG_X16 BIT(DEV_X16)
66#define DEV_FLAG_X32 BIT(DEV_X32)
67#define DEV_FLAG_X64 BIT(DEV_X64)
68
69/* memory types */
70enum mem_type {
71 MEM_EMPTY = 0, /* Empty csrow */
72 MEM_RESERVED, /* Reserved csrow type */
73 MEM_UNKNOWN, /* Unknown csrow type */
74 MEM_FPM, /* Fast page mode */
75 MEM_EDO, /* Extended data out */
76 MEM_BEDO, /* Burst Extended data out */
77 MEM_SDR, /* Single data rate SDRAM */
78 MEM_RDR, /* Registered single data rate SDRAM */
79 MEM_DDR, /* Double data rate SDRAM */
80 MEM_RDDR, /* Registered Double data rate SDRAM */
81 MEM_RMBS, /* Rambus DRAM */
82 MEM_DDR2, /* DDR2 RAM */
83 MEM_FB_DDR2, /* fully buffered DDR2 */
84 MEM_RDDR2, /* Registered DDR2 RAM */
85 MEM_XDR, /* Rambus XDR */
86 MEM_DDR3, /* DDR3 RAM */
87 MEM_RDDR3, /* Registered DDR3 RAM */
88};
89
90#define MEM_FLAG_EMPTY BIT(MEM_EMPTY)
91#define MEM_FLAG_RESERVED BIT(MEM_RESERVED)
92#define MEM_FLAG_UNKNOWN BIT(MEM_UNKNOWN)
93#define MEM_FLAG_FPM BIT(MEM_FPM)
94#define MEM_FLAG_EDO BIT(MEM_EDO)
95#define MEM_FLAG_BEDO BIT(MEM_BEDO)
96#define MEM_FLAG_SDR BIT(MEM_SDR)
97#define MEM_FLAG_RDR BIT(MEM_RDR)
98#define MEM_FLAG_DDR BIT(MEM_DDR)
99#define MEM_FLAG_RDDR BIT(MEM_RDDR)
100#define MEM_FLAG_RMBS BIT(MEM_RMBS)
101#define MEM_FLAG_DDR2 BIT(MEM_DDR2)
102#define MEM_FLAG_FB_DDR2 BIT(MEM_FB_DDR2)
103#define MEM_FLAG_RDDR2 BIT(MEM_RDDR2)
104#define MEM_FLAG_XDR BIT(MEM_XDR)
105#define MEM_FLAG_DDR3 BIT(MEM_DDR3)
106#define MEM_FLAG_RDDR3 BIT(MEM_RDDR3)
107
108/* chipset Error Detection and Correction capabilities and mode */
109enum edac_type {
110 EDAC_UNKNOWN = 0, /* Unknown if ECC is available */
111 EDAC_NONE, /* Doesn't support ECC */
112 EDAC_RESERVED, /* Reserved ECC type */
113 EDAC_PARITY, /* Detects parity errors */
114 EDAC_EC, /* Error Checking - no correction */
115 EDAC_SECDED, /* Single bit error correction, Double detection */
116 EDAC_S2ECD2ED, /* Chipkill x2 devices - do these exist? */
117 EDAC_S4ECD4ED, /* Chipkill x4 devices */
118 EDAC_S8ECD8ED, /* Chipkill x8 devices */
119 EDAC_S16ECD16ED, /* Chipkill x16 devices */
120};
121
122#define EDAC_FLAG_UNKNOWN BIT(EDAC_UNKNOWN)
123#define EDAC_FLAG_NONE BIT(EDAC_NONE)
124#define EDAC_FLAG_PARITY BIT(EDAC_PARITY)
125#define EDAC_FLAG_EC BIT(EDAC_EC)
126#define EDAC_FLAG_SECDED BIT(EDAC_SECDED)
127#define EDAC_FLAG_S2ECD2ED BIT(EDAC_S2ECD2ED)
128#define EDAC_FLAG_S4ECD4ED BIT(EDAC_S4ECD4ED)
129#define EDAC_FLAG_S8ECD8ED BIT(EDAC_S8ECD8ED)
130#define EDAC_FLAG_S16ECD16ED BIT(EDAC_S16ECD16ED)
131
132/* scrubbing capabilities */
133enum scrub_type {
134 SCRUB_UNKNOWN = 0, /* Unknown if scrubber is available */
135 SCRUB_NONE, /* No scrubber */
136 SCRUB_SW_PROG, /* SW progressive (sequential) scrubbing */
137 SCRUB_SW_SRC, /* Software scrub only errors */
138 SCRUB_SW_PROG_SRC, /* Progressive software scrub from an error */
139 SCRUB_SW_TUNABLE, /* Software scrub frequency is tunable */
140 SCRUB_HW_PROG, /* HW progressive (sequential) scrubbing */
141 SCRUB_HW_SRC, /* Hardware scrub only errors */
142 SCRUB_HW_PROG_SRC, /* Progressive hardware scrub from an error */
143 SCRUB_HW_TUNABLE /* Hardware scrub frequency is tunable */
144};
145
146#define SCRUB_FLAG_SW_PROG BIT(SCRUB_SW_PROG)
147#define SCRUB_FLAG_SW_SRC BIT(SCRUB_SW_SRC)
148#define SCRUB_FLAG_SW_PROG_SRC BIT(SCRUB_SW_PROG_SRC)
149#define SCRUB_FLAG_SW_TUN BIT(SCRUB_SW_SCRUB_TUNABLE)
150#define SCRUB_FLAG_HW_PROG BIT(SCRUB_HW_PROG)
151#define SCRUB_FLAG_HW_SRC BIT(SCRUB_HW_SRC)
152#define SCRUB_FLAG_HW_PROG_SRC BIT(SCRUB_HW_PROG_SRC)
153#define SCRUB_FLAG_HW_TUN BIT(SCRUB_HW_TUNABLE)
154
155/* FIXME - should have notify capabilities: NMI, LOG, PROC, etc */
156
157/* EDAC internal operation states */
158#define OP_ALLOC 0x100
159#define OP_RUNNING_POLL 0x201
160#define OP_RUNNING_INTERRUPT 0x202
161#define OP_RUNNING_POLL_INTR 0x203
162#define OP_OFFLINE 0x300
163
164/*
165 * There are several things to be aware of that aren't at all obvious:
166 *
167 *
168 * SOCKETS, SOCKET SETS, BANKS, ROWS, CHIP-SELECT ROWS, CHANNELS, etc..
169 *
170 * These are some of the many terms that are thrown about that don't always
171 * mean what people think they mean (Inconceivable!). In the interest of
172 * creating a common ground for discussion, terms and their definitions
173 * will be established.
174 *
175 * Memory devices: The individual chip on a memory stick. These devices
176 * commonly output 4 and 8 bits each. Grouping several
177 * of these in parallel provides 64 bits which is common
178 * for a memory stick.
179 *
180 * Memory Stick: A printed circuit board that aggregates multiple
181 * memory devices in parallel. This is the atomic
182 * memory component that is purchaseable by Joe consumer
183 * and loaded into a memory socket.
184 *
185 * Socket: A physical connector on the motherboard that accepts
186 * a single memory stick.
187 *
188 * Channel: Set of memory devices on a memory stick that must be
189 * grouped in parallel with one or more additional
190 * channels from other memory sticks. This parallel
191 * grouping of the output from multiple channels are
192 * necessary for the smallest granularity of memory access.
193 * Some memory controllers are capable of single channel -
194 * which means that memory sticks can be loaded
195 * individually. Other memory controllers are only
196 * capable of dual channel - which means that memory
197 * sticks must be loaded as pairs (see "socket set").
198 *
199 * Chip-select row: All of the memory devices that are selected together.
200 * for a single, minimum grain of memory access.
201 * This selects all of the parallel memory devices across
202 * all of the parallel channels. Common chip-select rows
203 * for single channel are 64 bits, for dual channel 128
204 * bits.
205 *
206 * Single-Ranked stick: A Single-ranked stick has 1 chip-select row of memory.
207 * Motherboards commonly drive two chip-select pins to
208 * a memory stick. A single-ranked stick, will occupy
209 * only one of those rows. The other will be unused.
210 *
211 * Double-Ranked stick: A double-ranked stick has two chip-select rows which
212 * access different sets of memory devices. The two
213 * rows cannot be accessed concurrently.
214 *
215 * Double-sided stick: DEPRECATED TERM, see Double-Ranked stick.
216 * A double-sided stick has two chip-select rows which
217 * access different sets of memory devices. The two
218 * rows cannot be accessed concurrently. "Double-sided"
219 * is irrespective of the memory devices being mounted
220 * on both sides of the memory stick.
221 *
222 * Socket set: All of the memory sticks that are required for
223 * a single memory access or all of the memory sticks
224 * spanned by a chip-select row. A single socket set
225 * has two chip-select rows and if double-sided sticks
226 * are used these will occupy those chip-select rows.
227 *
228 * Bank: This term is avoided because it is unclear when
229 * needing to distinguish between chip-select rows and
230 * socket sets.
231 *
232 * Controller pages:
233 *
234 * Physical pages:
235 *
236 * Virtual pages:
237 *
238 *
239 * STRUCTURE ORGANIZATION AND CHOICES
240 *
241 *
242 *
243 * PS - I enjoyed writing all that about as much as you enjoyed reading it.
244 */
245
246struct channel_info {
247 int chan_idx; /* channel index */
248 u32 ce_count; /* Correctable Errors for this CHANNEL */
249 char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */
250 struct csrow_info *csrow; /* the parent */
251};
252
253struct csrow_info {
254 unsigned long first_page; /* first page number in dimm */
255 unsigned long last_page; /* last page number in dimm */
256 unsigned long page_mask; /* used for interleaving -
257 * 0UL for non intlv
258 */
259 u32 nr_pages; /* number of pages in csrow */
260 u32 grain; /* granularity of reported error in bytes */
261 int csrow_idx; /* the chip-select row */
262 enum dev_type dtype; /* memory device type */
263 u32 ue_count; /* Uncorrectable Errors for this csrow */
264 u32 ce_count; /* Correctable Errors for this csrow */
265 enum mem_type mtype; /* memory csrow type */
266 enum edac_type edac_mode; /* EDAC mode for this csrow */
267 struct mem_ctl_info *mci; /* the parent */
268
269 struct kobject kobj; /* sysfs kobject for this csrow */
270
271 /* channel information for this csrow */
272 u32 nr_channels;
273 struct channel_info *channels;
274};
275
276struct mcidev_sysfs_group {
277 const char *name; /* group name */
278 const struct mcidev_sysfs_attribute *mcidev_attr; /* group attributes */
279};
280
281struct mcidev_sysfs_group_kobj {
282 struct list_head list; /* list for all instances within a mc */
283
284 struct kobject kobj; /* kobj for the group */
285
286 const struct mcidev_sysfs_group *grp; /* group description table */
287 struct mem_ctl_info *mci; /* the parent */
288};
289
290/* mcidev_sysfs_attribute structure
291 * used for driver sysfs attributes and in mem_ctl_info
292 * sysfs top level entries
293 */
294struct mcidev_sysfs_attribute {
295 /* It should use either attr or grp */
296 struct attribute attr;
297 const struct mcidev_sysfs_group *grp; /* Points to a group of attributes */
298
299 /* Ops for show/store values at the attribute - not used on group */
300 ssize_t (*show)(struct mem_ctl_info *,char *);
301 ssize_t (*store)(struct mem_ctl_info *, const char *,size_t);
302};
303
304/* MEMORY controller information structure
305 */
306struct mem_ctl_info {
307 struct list_head link; /* for global list of mem_ctl_info structs */
308
309 struct module *owner; /* Module owner of this control struct */
310
311 unsigned long mtype_cap; /* memory types supported by mc */
312 unsigned long edac_ctl_cap; /* Mem controller EDAC capabilities */
313 unsigned long edac_cap; /* configuration capabilities - this is
314 * closely related to edac_ctl_cap. The
315 * difference is that the controller may be
316 * capable of s4ecd4ed which would be listed
317 * in edac_ctl_cap, but if channels aren't
318 * capable of s4ecd4ed then the edac_cap would
319 * not have that capability.
320 */
321 unsigned long scrub_cap; /* chipset scrub capabilities */
322 enum scrub_type scrub_mode; /* current scrub mode */
323
324 /* Translates sdram memory scrub rate given in bytes/sec to the
325 internal representation and configures whatever else needs
326 to be configured.
327 */
328 int (*set_sdram_scrub_rate) (struct mem_ctl_info * mci, u32 bw);
329
330 /* Get the current sdram memory scrub rate from the internal
331 representation and converts it to the closest matching
332 bandwidth in bytes/sec.
333 */
334 int (*get_sdram_scrub_rate) (struct mem_ctl_info * mci);
335
336
337 /* pointer to edac checking routine */
338 void (*edac_check) (struct mem_ctl_info * mci);
339
340 /*
341 * Remaps memory pages: controller pages to physical pages.
342 * For most MC's, this will be NULL.
343 */
344 /* FIXME - why not send the phys page to begin with? */
345 unsigned long (*ctl_page_to_phys) (struct mem_ctl_info * mci,
346 unsigned long page);
347 int mc_idx;
348 int nr_csrows;
349 struct csrow_info *csrows;
350 /*
351 * FIXME - what about controllers on other busses? - IDs must be
352 * unique. dev pointer should be sufficiently unique, but
353 * BUS:SLOT.FUNC numbers may not be unique.
354 */
355 struct device *dev;
356 const char *mod_name;
357 const char *mod_ver;
358 const char *ctl_name;
359 const char *dev_name;
360 char proc_name[MC_PROC_NAME_MAX_LEN + 1];
361 void *pvt_info;
362 u32 ue_noinfo_count; /* Uncorrectable Errors w/o info */
363 u32 ce_noinfo_count; /* Correctable Errors w/o info */
364 u32 ue_count; /* Total Uncorrectable Errors for this MC */
365 u32 ce_count; /* Total Correctable Errors for this MC */
366 unsigned long start_time; /* mci load start time (in jiffies) */
367
368 struct completion complete;
369
370 /* edac sysfs device control */
371 struct kobject edac_mci_kobj;
372
373 /* list for all grp instances within a mc */
374 struct list_head grp_kobj_list;
375
376 /* Additional top controller level attributes, but specified
377 * by the low level driver.
378 *
379 * Set by the low level driver to provide attributes at the
380 * controller level, same level as 'ue_count' and 'ce_count' above.
381 * An array of structures, NULL terminated
382 *
383 * If attributes are desired, then set to array of attributes
384 * If no attributes are desired, leave NULL
385 */
386 const struct mcidev_sysfs_attribute *mc_driver_sysfs_attributes;
387
388 /* work struct for this MC */
389 struct delayed_work work;
390
391 /* the internal state of this controller instance */
392 int op_state;
393};
394
45#endif 395#endif
diff --git a/include/linux/edac_mce.h b/include/linux/edac_mce.h
deleted file mode 100644
index f974fc035363..000000000000
--- a/include/linux/edac_mce.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* Provides edac interface to mcelog events
2 *
3 * This file may be distributed under the terms of the
4 * GNU General Public License version 2.
5 *
6 * Copyright (c) 2009 by:
7 * Mauro Carvalho Chehab <mchehab@redhat.com>
8 *
9 * Red Hat Inc. http://www.redhat.com
10 */
11
12#if defined(CONFIG_EDAC_MCE) || \
13 (defined(CONFIG_EDAC_MCE_MODULE) && defined(MODULE))
14
15#include <asm/mce.h>
16#include <linux/list.h>
17
18struct edac_mce {
19 struct list_head list;
20
21 void *priv;
22 int (*check_error)(void *priv, struct mce *mce);
23};
24
25int edac_mce_register(struct edac_mce *edac_mce);
26void edac_mce_unregister(struct edac_mce *edac_mce);
27int edac_mce_parse(struct mce *mce);
28
29#else
30#define edac_mce_parse(mce) (0)
31#endif
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index d800d5142184..1d0f7a2ff73b 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -38,6 +38,12 @@ struct elevator_ops
38 elevator_merged_fn *elevator_merged_fn; 38 elevator_merged_fn *elevator_merged_fn;
39 elevator_merge_req_fn *elevator_merge_req_fn; 39 elevator_merge_req_fn *elevator_merge_req_fn;
40 elevator_allow_merge_fn *elevator_allow_merge_fn; 40 elevator_allow_merge_fn *elevator_allow_merge_fn;
41
42 /*
43 * Used for both plugged list and elevator merging and in the
44 * former case called without queue_lock. Read comment on top of
45 * attempt_plug_merge() for details.
46 */
41 elevator_bio_merged_fn *elevator_bio_merged_fn; 47 elevator_bio_merged_fn *elevator_bio_merged_fn;
42 48
43 elevator_dispatch_fn *elevator_dispatch_fn; 49 elevator_dispatch_fn *elevator_dispatch_fn;
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 110821cb6ea5..31f0508d7da7 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -395,6 +395,7 @@ typedef struct elf64_shdr {
395#define NT_S390_CTRS 0x304 /* s390 control registers */ 395#define NT_S390_CTRS 0x304 /* s390 control registers */
396#define NT_S390_PREFIX 0x305 /* s390 prefix register */ 396#define NT_S390_PREFIX 0x305 /* s390 prefix register */
397#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ 397#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
398#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
398#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ 399#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
399 400
400 401
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c6e427ab65fe..de33de1e2052 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -117,99 +117,101 @@ struct ethtool_eeprom {
117 __u8 data[0]; 117 __u8 data[0];
118}; 118};
119 119
120/* for configuring coalescing parameters of chip */ 120/**
121 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
122 * @cmd: ETHTOOL_{G,S}COALESCE
123 * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
124 * a packet arrives.
125 * @rx_max_coalesced_frames: Maximum number of packets to receive
126 * before an RX interrupt.
127 * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
128 * this value applies while an IRQ is being serviced by the host.
129 * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
130 * except that this value applies while an IRQ is being serviced
131 * by the host.
132 * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
133 * a packet is sent.
134 * @tx_max_coalesced_frames: Maximum number of packets to be sent
135 * before a TX interrupt.
136 * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
137 * this value applies while an IRQ is being serviced by the host.
138 * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
139 * except that this value applies while an IRQ is being serviced
140 * by the host.
141 * @stats_block_coalesce_usecs: How many usecs to delay in-memory
142 * statistics block updates. Some drivers do not have an
143 * in-memory statistic block, and in such cases this value is
144 * ignored. This value must not be zero.
145 * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
146 * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
147 * @pkt_rate_low: Threshold for low packet rate (packets per second).
148 * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
149 * a packet arrives, when the packet rate is below @pkt_rate_low.
150 * @rx_max_coalesced_frames_low: Maximum number of packets to be received
151 * before an RX interrupt, when the packet rate is below @pkt_rate_low.
152 * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
153 * a packet is sent, when the packet rate is below @pkt_rate_low.
154 * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
155 * a TX interrupt, when the packet rate is below @pkt_rate_low.
156 * @pkt_rate_high: Threshold for high packet rate (packets per second).
157 * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
158 * a packet arrives, when the packet rate is above @pkt_rate_high.
159 * @rx_max_coalesced_frames_high: Maximum number of packets to be received
160 * before an RX interrupt, when the packet rate is above @pkt_rate_high.
161 * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
162 * a packet is sent, when the packet rate is above @pkt_rate_high.
163 * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
164 * a TX interrupt, when the packet rate is above @pkt_rate_high.
165 * @rate_sample_interval: How often to do adaptive coalescing packet rate
166 * sampling, measured in seconds. Must not be zero.
167 *
168 * Each pair of (usecs, max_frames) fields specifies this exit
169 * condition for interrupt coalescing:
170 * (usecs > 0 && time_since_first_completion >= usecs) ||
171 * (max_frames > 0 && completed_frames >= max_frames)
172 * It is illegal to set both usecs and max_frames to zero as this
173 * would cause interrupts to never be generated. To disable
174 * coalescing, set usecs = 0 and max_frames = 1.
175 *
176 * Some implementations ignore the value of max_frames and use the
177 * condition:
178 * time_since_first_completion >= usecs
179 * This is deprecated. Drivers for hardware that does not support
180 * counting completions should validate that max_frames == !rx_usecs.
181 *
182 * Adaptive RX/TX coalescing is an algorithm implemented by some
183 * drivers to improve latency under low packet rates and improve
184 * throughput under high packet rates. Some drivers only implement
185 * one of RX or TX adaptive coalescing. Anything not implemented by
186 * the driver causes these values to be silently ignored.
187 *
188 * When the packet rate is below @pkt_rate_high but above
189 * @pkt_rate_low (both measured in packets per second) the
190 * normal {rx,tx}_* coalescing parameters are used.
191 */
121struct ethtool_coalesce { 192struct ethtool_coalesce {
122 __u32 cmd; /* ETHTOOL_{G,S}COALESCE */ 193 __u32 cmd;
123
124 /* How many usecs to delay an RX interrupt after
125 * a packet arrives. If 0, only rx_max_coalesced_frames
126 * is used.
127 */
128 __u32 rx_coalesce_usecs; 194 __u32 rx_coalesce_usecs;
129
130 /* How many packets to delay an RX interrupt after
131 * a packet arrives. If 0, only rx_coalesce_usecs is
132 * used. It is illegal to set both usecs and max frames
133 * to zero as this would cause RX interrupts to never be
134 * generated.
135 */
136 __u32 rx_max_coalesced_frames; 195 __u32 rx_max_coalesced_frames;
137
138 /* Same as above two parameters, except that these values
139 * apply while an IRQ is being serviced by the host. Not
140 * all cards support this feature and the values are ignored
141 * in that case.
142 */
143 __u32 rx_coalesce_usecs_irq; 196 __u32 rx_coalesce_usecs_irq;
144 __u32 rx_max_coalesced_frames_irq; 197 __u32 rx_max_coalesced_frames_irq;
145
146 /* How many usecs to delay a TX interrupt after
147 * a packet is sent. If 0, only tx_max_coalesced_frames
148 * is used.
149 */
150 __u32 tx_coalesce_usecs; 198 __u32 tx_coalesce_usecs;
151
152 /* How many packets to delay a TX interrupt after
153 * a packet is sent. If 0, only tx_coalesce_usecs is
154 * used. It is illegal to set both usecs and max frames
155 * to zero as this would cause TX interrupts to never be
156 * generated.
157 */
158 __u32 tx_max_coalesced_frames; 199 __u32 tx_max_coalesced_frames;
159
160 /* Same as above two parameters, except that these values
161 * apply while an IRQ is being serviced by the host. Not
162 * all cards support this feature and the values are ignored
163 * in that case.
164 */
165 __u32 tx_coalesce_usecs_irq; 200 __u32 tx_coalesce_usecs_irq;
166 __u32 tx_max_coalesced_frames_irq; 201 __u32 tx_max_coalesced_frames_irq;
167
168 /* How many usecs to delay in-memory statistics
169 * block updates. Some drivers do not have an in-memory
170 * statistic block, and in such cases this value is ignored.
171 * This value must not be zero.
172 */
173 __u32 stats_block_coalesce_usecs; 202 __u32 stats_block_coalesce_usecs;
174
175 /* Adaptive RX/TX coalescing is an algorithm implemented by
176 * some drivers to improve latency under low packet rates and
177 * improve throughput under high packet rates. Some drivers
178 * only implement one of RX or TX adaptive coalescing. Anything
179 * not implemented by the driver causes these values to be
180 * silently ignored.
181 */
182 __u32 use_adaptive_rx_coalesce; 203 __u32 use_adaptive_rx_coalesce;
183 __u32 use_adaptive_tx_coalesce; 204 __u32 use_adaptive_tx_coalesce;
184
185 /* When the packet rate (measured in packets per second)
186 * is below pkt_rate_low, the {rx,tx}_*_low parameters are
187 * used.
188 */
189 __u32 pkt_rate_low; 205 __u32 pkt_rate_low;
190 __u32 rx_coalesce_usecs_low; 206 __u32 rx_coalesce_usecs_low;
191 __u32 rx_max_coalesced_frames_low; 207 __u32 rx_max_coalesced_frames_low;
192 __u32 tx_coalesce_usecs_low; 208 __u32 tx_coalesce_usecs_low;
193 __u32 tx_max_coalesced_frames_low; 209 __u32 tx_max_coalesced_frames_low;
194
195 /* When the packet rate is below pkt_rate_high but above
196 * pkt_rate_low (both measured in packets per second) the
197 * normal {rx,tx}_* coalescing parameters are used.
198 */
199
200 /* When the packet rate is (measured in packets per second)
201 * is above pkt_rate_high, the {rx,tx}_*_high parameters are
202 * used.
203 */
204 __u32 pkt_rate_high; 210 __u32 pkt_rate_high;
205 __u32 rx_coalesce_usecs_high; 211 __u32 rx_coalesce_usecs_high;
206 __u32 rx_max_coalesced_frames_high; 212 __u32 rx_max_coalesced_frames_high;
207 __u32 tx_coalesce_usecs_high; 213 __u32 tx_coalesce_usecs_high;
208 __u32 tx_max_coalesced_frames_high; 214 __u32 tx_max_coalesced_frames_high;
209
210 /* How often to do adaptive coalescing packet rate sampling,
211 * measured in seconds. Must not be zero.
212 */
213 __u32 rate_sample_interval; 215 __u32 rate_sample_interval;
214}; 216};
215 217
@@ -444,7 +446,7 @@ struct ethtool_flow_ext {
444}; 446};
445 447
446/** 448/**
447 * struct ethtool_rx_flow_spec - specification for RX flow filter 449 * struct ethtool_rx_flow_spec - classification rule for RX flows
448 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW 450 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
449 * @h_u: Flow fields to match (dependent on @flow_type) 451 * @h_u: Flow fields to match (dependent on @flow_type)
450 * @h_ext: Additional fields to match 452 * @h_ext: Additional fields to match
@@ -454,7 +456,9 @@ struct ethtool_flow_ext {
454 * includes the %FLOW_EXT flag. 456 * includes the %FLOW_EXT flag.
455 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC 457 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
456 * if packets should be discarded 458 * if packets should be discarded
457 * @location: Index of filter in hardware table 459 * @location: Location of rule in the table. Locations must be
460 * numbered such that a flow matching multiple rules will be
461 * classified according to the first (lowest numbered) rule.
458 */ 462 */
459struct ethtool_rx_flow_spec { 463struct ethtool_rx_flow_spec {
460 __u32 flow_type; 464 __u32 flow_type;
@@ -473,9 +477,9 @@ struct ethtool_rx_flow_spec {
473 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS 477 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
474 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW 478 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
475 * @data: Command-dependent value 479 * @data: Command-dependent value
476 * @fs: Flow filter specification 480 * @fs: Flow classification rule
477 * @rule_cnt: Number of rules to be affected 481 * @rule_cnt: Number of rules to be affected
478 * @rule_locs: Array of valid rule indices 482 * @rule_locs: Array of used rule locations
479 * 483 *
480 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating 484 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
481 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following 485 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
@@ -487,23 +491,20 @@ struct ethtool_rx_flow_spec {
487 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined 491 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
488 * rules on return. 492 * rules on return.
489 * 493 *
490 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the index of an 494 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
491 * existing filter rule on entry and @fs contains the rule on return. 495 * existing rule on entry and @fs contains the rule on return.
492 * 496 *
493 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the 497 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
494 * user buffer for @rule_locs on entry. On return, @data is the size 498 * user buffer for @rule_locs on entry. On return, @data is the size
495 * of the filter table and @rule_locs contains the indices of the 499 * of the rule table, @rule_cnt is the number of defined rules, and
496 * defined rules. 500 * @rule_locs contains the locations of the defined rules. Drivers
501 * must use the second parameter to get_rxnfc() instead of @rule_locs.
497 * 502 *
498 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the filter rule to add or 503 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
499 * update. @fs.@location specifies the index to use and must not be 504 * @fs.@location specifies the location to use and must not be ignored.
500 * ignored.
501 * 505 *
502 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the index of an 506 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
503 * existing filter rule on entry. 507 * existing rule on entry.
504 *
505 * Implementation of indexed classification rules generally requires a
506 * TCAM.
507 */ 508 */
508struct ethtool_rxnfc { 509struct ethtool_rxnfc {
509 __u32 cmd; 510 __u32 cmd;
@@ -726,6 +727,9 @@ enum ethtool_sfeatures_retval_bits {
726/* needed by dev_disable_lro() */ 727/* needed by dev_disable_lro() */
727extern int __ethtool_set_flags(struct net_device *dev, u32 flags); 728extern int __ethtool_set_flags(struct net_device *dev, u32 flags);
728 729
730extern int __ethtool_get_settings(struct net_device *dev,
731 struct ethtool_cmd *cmd);
732
729/** 733/**
730 * enum ethtool_phys_id_state - indicator state for physical identification 734 * enum ethtool_phys_id_state - indicator state for physical identification
731 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated 735 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
@@ -936,7 +940,7 @@ struct ethtool_ops {
936 int (*set_priv_flags)(struct net_device *, u32); 940 int (*set_priv_flags)(struct net_device *, u32);
937 int (*get_sset_count)(struct net_device *, int); 941 int (*get_sset_count)(struct net_device *, int);
938 int (*get_rxnfc)(struct net_device *, 942 int (*get_rxnfc)(struct net_device *,
939 struct ethtool_rxnfc *, void *); 943 struct ethtool_rxnfc *, u32 *rule_locs);
940 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 944 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
941 int (*flash_device)(struct net_device *, struct ethtool_flash *); 945 int (*flash_device)(struct net_device *, struct ethtool_flash *);
942 int (*reset)(struct net_device *, u32 *); 946 int (*reset)(struct net_device *, u32 *);
@@ -1093,10 +1097,12 @@ struct ethtool_ops {
1093#define SPEED_1000 1000 1097#define SPEED_1000 1000
1094#define SPEED_2500 2500 1098#define SPEED_2500 2500
1095#define SPEED_10000 10000 1099#define SPEED_10000 10000
1100#define SPEED_UNKNOWN -1
1096 1101
1097/* Duplex, half or full. */ 1102/* Duplex, half or full. */
1098#define DUPLEX_HALF 0x00 1103#define DUPLEX_HALF 0x00
1099#define DUPLEX_FULL 0x01 1104#define DUPLEX_FULL 0x01
1105#define DUPLEX_UNKNOWN 0xff
1100 1106
1101/* Which connector port. */ 1107/* Which connector port. */
1102#define PORT_TP 0x00 1108#define PORT_TP 0x00
diff --git a/include/linux/evm.h b/include/linux/evm.h
new file mode 100644
index 000000000000..9fc13a760928
--- /dev/null
+++ b/include/linux/evm.h
@@ -0,0 +1,100 @@
1/*
2 * evm.h
3 *
4 * Copyright (c) 2009 IBM Corporation
5 * Author: Mimi Zohar <zohar@us.ibm.com>
6 */
7
8#ifndef _LINUX_EVM_H
9#define _LINUX_EVM_H
10
11#include <linux/integrity.h>
12#include <linux/xattr.h>
13
14struct integrity_iint_cache;
15
16#ifdef CONFIG_EVM
17extern enum integrity_status evm_verifyxattr(struct dentry *dentry,
18 const char *xattr_name,
19 void *xattr_value,
20 size_t xattr_value_len,
21 struct integrity_iint_cache *iint);
22extern int evm_inode_setattr(struct dentry *dentry, struct iattr *attr);
23extern void evm_inode_post_setattr(struct dentry *dentry, int ia_valid);
24extern int evm_inode_setxattr(struct dentry *dentry, const char *name,
25 const void *value, size_t size);
26extern void evm_inode_post_setxattr(struct dentry *dentry,
27 const char *xattr_name,
28 const void *xattr_value,
29 size_t xattr_value_len);
30extern int evm_inode_removexattr(struct dentry *dentry, const char *xattr_name);
31extern void evm_inode_post_removexattr(struct dentry *dentry,
32 const char *xattr_name);
33extern int evm_inode_init_security(struct inode *inode,
34 const struct xattr *xattr_array,
35 struct xattr *evm);
36#ifdef CONFIG_FS_POSIX_ACL
37extern int posix_xattr_acl(const char *xattrname);
38#else
39static inline int posix_xattr_acl(const char *xattrname)
40{
41 return 0;
42}
43#endif
44#else
45#ifdef CONFIG_INTEGRITY
46static inline enum integrity_status evm_verifyxattr(struct dentry *dentry,
47 const char *xattr_name,
48 void *xattr_value,
49 size_t xattr_value_len,
50 struct integrity_iint_cache *iint)
51{
52 return INTEGRITY_UNKNOWN;
53}
54#endif
55
56static inline int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
57{
58 return 0;
59}
60
61static inline void evm_inode_post_setattr(struct dentry *dentry, int ia_valid)
62{
63 return;
64}
65
66static inline int evm_inode_setxattr(struct dentry *dentry, const char *name,
67 const void *value, size_t size)
68{
69 return 0;
70}
71
72static inline void evm_inode_post_setxattr(struct dentry *dentry,
73 const char *xattr_name,
74 const void *xattr_value,
75 size_t xattr_value_len)
76{
77 return;
78}
79
80static inline int evm_inode_removexattr(struct dentry *dentry,
81 const char *xattr_name)
82{
83 return 0;
84}
85
86static inline void evm_inode_post_removexattr(struct dentry *dentry,
87 const char *xattr_name)
88{
89 return;
90}
91
92static inline int evm_inode_init_security(struct inode *inode,
93 const struct xattr *xattr_array,
94 struct xattr *evm)
95{
96 return 0;
97}
98
99#endif /* CONFIG_EVM_H */
100#endif /* LINUX_EVM_H */
diff --git a/include/linux/export.h b/include/linux/export.h
new file mode 100644
index 000000000000..696c0f48afc7
--- /dev/null
+++ b/include/linux/export.h
@@ -0,0 +1,89 @@
1#ifndef _LINUX_EXPORT_H
2#define _LINUX_EXPORT_H
3/*
4 * Export symbols from the kernel to modules. Forked from module.h
5 * to reduce the amount of pointless cruft we feed to gcc when only
6 * exporting a simple symbol or two.
7 *
8 * If you feel the need to add #include <linux/foo.h> to this file
9 * then you are doing something wrong and should go away silently.
10 */
11
12/* Some toolchains use a `_' prefix for all user symbols. */
13#ifdef CONFIG_SYMBOL_PREFIX
14#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
15#else
16#define MODULE_SYMBOL_PREFIX ""
17#endif
18
19struct kernel_symbol
20{
21 unsigned long value;
22 const char *name;
23};
24
25#ifdef MODULE
26extern struct module __this_module;
27#define THIS_MODULE (&__this_module)
28#else
29#define THIS_MODULE ((struct module *)0)
30#endif
31
32#ifdef CONFIG_MODULES
33
34#ifndef __GENKSYMS__
35#ifdef CONFIG_MODVERSIONS
36/* Mark the CRC weak since genksyms apparently decides not to
37 * generate a checksums for some symbols */
38#define __CRC_SYMBOL(sym, sec) \
39 extern void *__crc_##sym __attribute__((weak)); \
40 static const unsigned long __kcrctab_##sym \
41 __used \
42 __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
43 = (unsigned long) &__crc_##sym;
44#else
45#define __CRC_SYMBOL(sym, sec)
46#endif
47
48/* For every exported symbol, place a struct in the __ksymtab section */
49#define __EXPORT_SYMBOL(sym, sec) \
50 extern typeof(sym) sym; \
51 __CRC_SYMBOL(sym, sec) \
52 static const char __kstrtab_##sym[] \
53 __attribute__((section("__ksymtab_strings"), aligned(1))) \
54 = MODULE_SYMBOL_PREFIX #sym; \
55 static const struct kernel_symbol __ksymtab_##sym \
56 __used \
57 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
58 = { (unsigned long)&sym, __kstrtab_##sym }
59
60#define EXPORT_SYMBOL(sym) \
61 __EXPORT_SYMBOL(sym, "")
62
63#define EXPORT_SYMBOL_GPL(sym) \
64 __EXPORT_SYMBOL(sym, "_gpl")
65
66#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
67 __EXPORT_SYMBOL(sym, "_gpl_future")
68
69#ifdef CONFIG_UNUSED_SYMBOLS
70#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
71#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
72#else
73#define EXPORT_UNUSED_SYMBOL(sym)
74#define EXPORT_UNUSED_SYMBOL_GPL(sym)
75#endif
76
77#endif /* __GENKSYMS__ */
78
79#else /* !CONFIG_MODULES... */
80
81#define EXPORT_SYMBOL(sym)
82#define EXPORT_SYMBOL_GPL(sym)
83#define EXPORT_SYMBOL_GPL_FUTURE(sym)
84#define EXPORT_UNUSED_SYMBOL(sym)
85#define EXPORT_UNUSED_SYMBOL_GPL(sym)
86
87#endif /* CONFIG_MODULES */
88
89#endif /* _LINUX_EXPORT_H */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 53792bf36c71..ce1b719e8bd4 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -197,8 +197,8 @@ struct ext2_group_desc
197 197
198/* Flags that should be inherited by new inodes from their parent. */ 198/* Flags that should be inherited by new inodes from their parent. */
199#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\ 199#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\
200 EXT2_SYNC_FL | EXT2_IMMUTABLE_FL | EXT2_APPEND_FL |\ 200 EXT2_SYNC_FL | EXT2_NODUMP_FL |\
201 EXT2_NODUMP_FL | EXT2_NOATIME_FL | EXT2_COMPRBLK_FL|\ 201 EXT2_NOATIME_FL | EXT2_COMPRBLK_FL |\
202 EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\ 202 EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\
203 EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL) 203 EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL)
204 204
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 67a803aee619..dec99116a0e4 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -180,8 +180,8 @@ struct ext3_group_desc
180 180
181/* Flags that should be inherited by new inodes from their parent. */ 181/* Flags that should be inherited by new inodes from their parent. */
182#define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\ 182#define EXT3_FL_INHERITED (EXT3_SECRM_FL | EXT3_UNRM_FL | EXT3_COMPR_FL |\
183 EXT3_SYNC_FL | EXT3_IMMUTABLE_FL | EXT3_APPEND_FL |\ 183 EXT3_SYNC_FL | EXT3_NODUMP_FL |\
184 EXT3_NODUMP_FL | EXT3_NOATIME_FL | EXT3_COMPRBLK_FL|\ 184 EXT3_NOATIME_FL | EXT3_COMPRBLK_FL |\
185 EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\ 185 EXT3_NOCOMPR_FL | EXT3_JOURNAL_DATA_FL |\
186 EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL) 186 EXT3_NOTAIL_FL | EXT3_DIRSYNC_FL)
187 187
@@ -381,7 +381,7 @@ struct ext3_inode {
381 * Mount flags 381 * Mount flags
382 */ 382 */
383#define EXT3_MOUNT_CHECK 0x00001 /* Do mount-time checks */ 383#define EXT3_MOUNT_CHECK 0x00001 /* Do mount-time checks */
384#define EXT3_MOUNT_OLDALLOC 0x00002 /* Don't use the new Orlov allocator */ 384/* EXT3_MOUNT_OLDALLOC was there */
385#define EXT3_MOUNT_GRPID 0x00004 /* Create files with directory's group */ 385#define EXT3_MOUNT_GRPID 0x00004 /* Create files with directory's group */
386#define EXT3_MOUNT_DEBUG 0x00008 /* Some debugging messages */ 386#define EXT3_MOUNT_DEBUG 0x00008 /* Some debugging messages */
387#define EXT3_MOUNT_ERRORS_CONT 0x00010 /* Continue on errors */ 387#define EXT3_MOUNT_ERRORS_CONT 0x00010 /* Continue on errors */
@@ -937,15 +937,15 @@ extern int ext3_group_extend(struct super_block *sb,
937 ext3_fsblk_t n_blocks_count); 937 ext3_fsblk_t n_blocks_count);
938 938
939/* super.c */ 939/* super.c */
940extern void ext3_error (struct super_block *, const char *, const char *, ...) 940extern __printf(3, 4)
941 __attribute__ ((format (printf, 3, 4))); 941void ext3_error(struct super_block *, const char *, const char *, ...);
942extern void __ext3_std_error (struct super_block *, const char *, int); 942extern void __ext3_std_error (struct super_block *, const char *, int);
943extern void ext3_abort (struct super_block *, const char *, const char *, ...) 943extern __printf(3, 4)
944 __attribute__ ((format (printf, 3, 4))); 944void ext3_abort(struct super_block *, const char *, const char *, ...);
945extern void ext3_warning (struct super_block *, const char *, const char *, ...) 945extern __printf(3, 4)
946 __attribute__ ((format (printf, 3, 4))); 946void ext3_warning(struct super_block *, const char *, const char *, ...);
947extern void ext3_msg(struct super_block *, const char *, const char *, ...) 947extern __printf(3, 4)
948 __attribute__ ((format (printf, 3, 4))); 948void ext3_msg(struct super_block *, const char *, const char *, ...);
949extern void ext3_update_dynamic_rev (struct super_block *sb); 949extern void ext3_update_dynamic_rev (struct super_block *sb);
950 950
951#define ext3_std_error(sb, errno) \ 951#define ext3_std_error(sb, errno) \
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
index 258088ab3c6b..64365252f1b0 100644
--- a/include/linux/ext3_fs_sb.h
+++ b/include/linux/ext3_fs_sb.h
@@ -76,10 +76,6 @@ struct ext3_sb_info {
76 struct mutex s_resize_lock; 76 struct mutex s_resize_lock;
77 unsigned long s_commit_interval; 77 unsigned long s_commit_interval;
78 struct block_device *journal_bdev; 78 struct block_device *journal_bdev;
79#ifdef CONFIG_JBD_DEBUG
80 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
81 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
82#endif
83#ifdef CONFIG_QUOTA 79#ifdef CONFIG_QUOTA
84 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ 80 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
85 int s_jquota_fmt; /* Format of quota to use */ 81 int s_jquota_fmt; /* Format of quota to use */
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 741956fa5bfd..8eeb205f298b 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -155,7 +155,7 @@ extern unsigned int sk_run_filter(const struct sk_buff *skb,
155 const struct sock_filter *filter); 155 const struct sock_filter *filter);
156extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 156extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
157extern int sk_detach_filter(struct sock *sk); 157extern int sk_detach_filter(struct sock *sk);
158extern int sk_chk_filter(struct sock_filter *filter, int flen); 158extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
159 159
160#ifdef CONFIG_BPF_JIT 160#ifdef CONFIG_BPF_JIT
161extern void bpf_jit_compile(struct sk_filter *fp); 161extern void bpf_jit_compile(struct sk_filter *fp);
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 21b3e7588abd..1e7c01189fa6 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_FIRMWARE_H 1#ifndef _LINUX_FIRMWARE_H
2#define _LINUX_FIRMWARE_H 2#define _LINUX_FIRMWARE_H
3 3
4#include <linux/module.h>
5#include <linux/types.h> 4#include <linux/types.h>
6#include <linux/compiler.h> 5#include <linux/compiler.h>
7#include <linux/gfp.h> 6#include <linux/gfp.h>
@@ -15,6 +14,7 @@ struct firmware {
15 struct page **pages; 14 struct page **pages;
16}; 15};
17 16
17struct module;
18struct device; 18struct device;
19 19
20struct builtin_fw { 20struct builtin_fw {
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 1effc8b56b4e..a5386e3ee756 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -49,6 +49,7 @@ extern int thaw_process(struct task_struct *p);
49 49
50extern void refrigerator(void); 50extern void refrigerator(void);
51extern int freeze_processes(void); 51extern int freeze_processes(void);
52extern int freeze_kernel_threads(void);
52extern void thaw_processes(void); 53extern void thaw_processes(void);
53 54
54static inline int try_to_freeze(void) 55static inline int try_to_freeze(void)
@@ -134,10 +135,20 @@ static inline void set_freezable_with_signal(void)
134} 135}
135 136
136/* 137/*
137 * Freezer-friendly wrappers around wait_event_interruptible() and 138 * Freezer-friendly wrappers around wait_event_interruptible(),
138 * wait_event_interruptible_timeout(), originally defined in <linux/wait.h> 139 * wait_event_killable() and wait_event_interruptible_timeout(), originally
140 * defined in <linux/wait.h>
139 */ 141 */
140 142
143#define wait_event_freezekillable(wq, condition) \
144({ \
145 int __retval; \
146 freezer_do_not_count(); \
147 __retval = wait_event_killable(wq, (condition)); \
148 freezer_count(); \
149 __retval; \
150})
151
141#define wait_event_freezable(wq, condition) \ 152#define wait_event_freezable(wq, condition) \
142({ \ 153({ \
143 int __retval; \ 154 int __retval; \
@@ -171,7 +182,8 @@ static inline void clear_freeze_flag(struct task_struct *p) {}
171static inline int thaw_process(struct task_struct *p) { return 1; } 182static inline int thaw_process(struct task_struct *p) { return 1; }
172 183
173static inline void refrigerator(void) {} 184static inline void refrigerator(void) {}
174static inline int freeze_processes(void) { BUG(); return 0; } 185static inline int freeze_processes(void) { return -ENOSYS; }
186static inline int freeze_kernel_threads(void) { return -ENOSYS; }
175static inline void thaw_processes(void) {} 187static inline void thaw_processes(void) {}
176 188
177static inline int try_to_freeze(void) { return 0; } 189static inline int try_to_freeze(void) { return 0; }
@@ -188,6 +200,9 @@ static inline void set_freezable_with_signal(void) {}
188#define wait_event_freezable_timeout(wq, condition, timeout) \ 200#define wait_event_freezable_timeout(wq, condition, timeout) \
189 wait_event_interruptible_timeout(wq, condition, timeout) 201 wait_event_interruptible_timeout(wq, condition, timeout)
190 202
203#define wait_event_freezekillable(wq, condition) \
204 wait_event_killable(wq, condition)
205
191#endif /* !CONFIG_FREEZER */ 206#endif /* !CONFIG_FREEZER */
192 207
193#endif /* FREEZER_H_INCLUDED */ 208#endif /* FREEZER_H_INCLUDED */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 178cdb4f1d4a..0c4df261af7e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -58,14 +58,15 @@ struct inodes_stat_t {
58 58
59#define NR_FILE 8192 /* this can well be larger on a larger system */ 59#define NR_FILE 8192 /* this can well be larger on a larger system */
60 60
61#define MAY_EXEC 1 61#define MAY_EXEC 0x00000001
62#define MAY_WRITE 2 62#define MAY_WRITE 0x00000002
63#define MAY_READ 4 63#define MAY_READ 0x00000004
64#define MAY_APPEND 8 64#define MAY_APPEND 0x00000008
65#define MAY_ACCESS 16 65#define MAY_ACCESS 0x00000010
66#define MAY_OPEN 32 66#define MAY_OPEN 0x00000020
67#define MAY_CHDIR 64 67#define MAY_CHDIR 0x00000040
68#define MAY_NOT_BLOCK 128 /* called from RCU mode, don't block */ 68/* called from RCU mode, don't block */
69#define MAY_NOT_BLOCK 0x00000080
69 70
70/* 71/*
71 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond 72 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
@@ -162,10 +163,8 @@ struct inodes_stat_t {
162#define READA RWA_MASK 163#define READA RWA_MASK
163 164
164#define READ_SYNC (READ | REQ_SYNC) 165#define READ_SYNC (READ | REQ_SYNC)
165#define READ_META (READ | REQ_META)
166#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) 166#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE)
167#define WRITE_ODIRECT (WRITE | REQ_SYNC) 167#define WRITE_ODIRECT (WRITE | REQ_SYNC)
168#define WRITE_META (WRITE | REQ_META)
169#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH) 168#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH)
170#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) 169#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA)
171#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) 170#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
@@ -769,14 +768,25 @@ struct inode {
769 768
770 /* Stat data, not accessed from path walking */ 769 /* Stat data, not accessed from path walking */
771 unsigned long i_ino; 770 unsigned long i_ino;
772 unsigned int i_nlink; 771 /*
772 * Filesystems may only read i_nlink directly. They shall use the
773 * following functions for modification:
774 *
775 * (set|clear|inc|drop)_nlink
776 * inode_(inc|dec)_link_count
777 */
778 union {
779 const unsigned int i_nlink;
780 unsigned int __i_nlink;
781 };
773 dev_t i_rdev; 782 dev_t i_rdev;
774 loff_t i_size;
775 struct timespec i_atime; 783 struct timespec i_atime;
776 struct timespec i_mtime; 784 struct timespec i_mtime;
777 struct timespec i_ctime; 785 struct timespec i_ctime;
778 unsigned int i_blkbits; 786 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
787 unsigned short i_bytes;
779 blkcnt_t i_blocks; 788 blkcnt_t i_blocks;
789 loff_t i_size;
780 790
781#ifdef __NEED_I_SIZE_ORDERED 791#ifdef __NEED_I_SIZE_ORDERED
782 seqcount_t i_size_seqcount; 792 seqcount_t i_size_seqcount;
@@ -784,7 +794,6 @@ struct inode {
784 794
785 /* Misc */ 795 /* Misc */
786 unsigned long i_state; 796 unsigned long i_state;
787 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
788 struct mutex i_mutex; 797 struct mutex i_mutex;
789 798
790 unsigned long dirtied_when; /* jiffies of first dirtying */ 799 unsigned long dirtied_when; /* jiffies of first dirtying */
@@ -798,9 +807,10 @@ struct inode {
798 struct rcu_head i_rcu; 807 struct rcu_head i_rcu;
799 }; 808 };
800 atomic_t i_count; 809 atomic_t i_count;
810 unsigned int i_blkbits;
801 u64 i_version; 811 u64 i_version;
802 unsigned short i_bytes;
803 atomic_t i_dio_count; 812 atomic_t i_dio_count;
813 atomic_t i_writecount;
804 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 814 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
805 struct file_lock *i_flock; 815 struct file_lock *i_flock;
806 struct address_space i_data; 816 struct address_space i_data;
@@ -824,7 +834,6 @@ struct inode {
824#ifdef CONFIG_IMA 834#ifdef CONFIG_IMA
825 atomic_t i_readcount; /* struct files open RO */ 835 atomic_t i_readcount; /* struct files open RO */
826#endif 836#endif
827 atomic_t i_writecount;
828 void *i_private; /* fs or device private pointer */ 837 void *i_private; /* fs or device private pointer */
829}; 838};
830 839
@@ -965,7 +974,12 @@ struct file {
965#define f_dentry f_path.dentry 974#define f_dentry f_path.dentry
966#define f_vfsmnt f_path.mnt 975#define f_vfsmnt f_path.mnt
967 const struct file_operations *f_op; 976 const struct file_operations *f_op;
968 spinlock_t f_lock; /* f_ep_links, f_flags, no IRQ */ 977
978 /*
979 * Protects f_ep_links, f_flags, f_pos vs i_size in lseek SEEK_CUR.
980 * Must not be taken from IRQ context.
981 */
982 spinlock_t f_lock;
969#ifdef CONFIG_SMP 983#ifdef CONFIG_SMP
970 int f_sb_list_cpu; 984 int f_sb_list_cpu;
971#endif 985#endif
@@ -1065,6 +1079,8 @@ static inline int file_check_writeable(struct file *filp)
1065#define FL_LEASE 32 /* lease held on this file */ 1079#define FL_LEASE 32 /* lease held on this file */
1066#define FL_CLOSE 64 /* unlock on close */ 1080#define FL_CLOSE 64 /* unlock on close */
1067#define FL_SLEEP 128 /* A blocking lock */ 1081#define FL_SLEEP 128 /* A blocking lock */
1082#define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */
1083#define FL_UNLOCK_PENDING 512 /* Lease is being broken */
1068 1084
1069/* 1085/*
1070 * Special return value from posix_lock_file() and vfs_lock_file() for 1086 * Special return value from posix_lock_file() and vfs_lock_file() for
@@ -1111,7 +1127,7 @@ struct file_lock {
1111 struct list_head fl_link; /* doubly linked list of all locks */ 1127 struct list_head fl_link; /* doubly linked list of all locks */
1112 struct list_head fl_block; /* circular list of blocked processes */ 1128 struct list_head fl_block; /* circular list of blocked processes */
1113 fl_owner_t fl_owner; 1129 fl_owner_t fl_owner;
1114 unsigned char fl_flags; 1130 unsigned int fl_flags;
1115 unsigned char fl_type; 1131 unsigned char fl_type;
1116 unsigned int fl_pid; 1132 unsigned int fl_pid;
1117 struct pid *fl_nspid; 1133 struct pid *fl_nspid;
@@ -1121,7 +1137,9 @@ struct file_lock {
1121 loff_t fl_end; 1137 loff_t fl_end;
1122 1138
1123 struct fasync_struct * fl_fasync; /* for lease break notifications */ 1139 struct fasync_struct * fl_fasync; /* for lease break notifications */
1124 unsigned long fl_break_time; /* for nonblocking lease breaks */ 1140 /* for lease breaks: */
1141 unsigned long fl_break_time;
1142 unsigned long fl_downgrade_time;
1125 1143
1126 const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */ 1144 const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */
1127 const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ 1145 const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
@@ -1625,9 +1643,10 @@ struct inode_operations {
1625struct seq_file; 1643struct seq_file;
1626 1644
1627ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, 1645ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
1628 unsigned long nr_segs, unsigned long fast_segs, 1646 unsigned long nr_segs, unsigned long fast_segs,
1629 struct iovec *fast_pointer, 1647 struct iovec *fast_pointer,
1630 struct iovec **ret_pointer); 1648 struct iovec **ret_pointer,
1649 int check_access);
1631 1650
1632extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); 1651extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
1633extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); 1652extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
@@ -1746,6 +1765,19 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1746} 1765}
1747 1766
1748/** 1767/**
1768 * set_nlink - directly set an inode's link count
1769 * @inode: inode
1770 * @nlink: new nlink (should be non-zero)
1771 *
1772 * This is a low-level filesystem helper to replace any
1773 * direct filesystem manipulation of i_nlink.
1774 */
1775static inline void set_nlink(struct inode *inode, unsigned int nlink)
1776{
1777 inode->__i_nlink = nlink;
1778}
1779
1780/**
1749 * inc_nlink - directly increment an inode's link count 1781 * inc_nlink - directly increment an inode's link count
1750 * @inode: inode 1782 * @inode: inode
1751 * 1783 *
@@ -1755,7 +1787,7 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1755 */ 1787 */
1756static inline void inc_nlink(struct inode *inode) 1788static inline void inc_nlink(struct inode *inode)
1757{ 1789{
1758 inode->i_nlink++; 1790 inode->__i_nlink++;
1759} 1791}
1760 1792
1761static inline void inode_inc_link_count(struct inode *inode) 1793static inline void inode_inc_link_count(struct inode *inode)
@@ -1777,7 +1809,7 @@ static inline void inode_inc_link_count(struct inode *inode)
1777 */ 1809 */
1778static inline void drop_nlink(struct inode *inode) 1810static inline void drop_nlink(struct inode *inode)
1779{ 1811{
1780 inode->i_nlink--; 1812 inode->__i_nlink--;
1781} 1813}
1782 1814
1783/** 1815/**
@@ -1790,7 +1822,7 @@ static inline void drop_nlink(struct inode *inode)
1790 */ 1822 */
1791static inline void clear_nlink(struct inode *inode) 1823static inline void clear_nlink(struct inode *inode)
1792{ 1824{
1793 inode->i_nlink = 0; 1825 inode->__i_nlink = 0;
1794} 1826}
1795 1827
1796static inline void inode_dec_link_count(struct inode *inode) 1828static inline void inode_dec_link_count(struct inode *inode)
@@ -2318,6 +2350,11 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te
2318extern struct inode * iget_locked(struct super_block *, unsigned long); 2350extern struct inode * iget_locked(struct super_block *, unsigned long);
2319extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); 2351extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
2320extern int insert_inode_locked(struct inode *); 2352extern int insert_inode_locked(struct inode *);
2353#ifdef CONFIG_DEBUG_LOCK_ALLOC
2354extern void lockdep_annotate_inode_mutex_key(struct inode *inode);
2355#else
2356static inline void lockdep_annotate_inode_mutex_key(struct inode *inode) { };
2357#endif
2321extern void unlock_new_inode(struct inode *); 2358extern void unlock_new_inode(struct inode *);
2322extern unsigned int get_next_ino(void); 2359extern unsigned int get_next_ino(void);
2323 2360
@@ -2394,8 +2431,8 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
2394extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); 2431extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
2395extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 2432extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
2396extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 2433extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
2397extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset, 2434extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
2398 int origin); 2435 int origin, loff_t maxsize);
2399extern int generic_file_open(struct inode * inode, struct file * filp); 2436extern int generic_file_open(struct inode * inode, struct file * filp);
2400extern int nonseekable_open(struct inode * inode, struct file * filp); 2437extern int nonseekable_open(struct inode * inode, struct file * filp);
2401 2438
@@ -2621,8 +2658,8 @@ static const struct file_operations __fops = { \
2621 .llseek = generic_file_llseek, \ 2658 .llseek = generic_file_llseek, \
2622}; 2659};
2623 2660
2624static inline void __attribute__((format(printf, 1, 2))) 2661static inline __printf(1, 2)
2625__simple_attr_check_format(const char *fmt, ...) 2662void __simple_attr_check_format(const char *fmt, ...)
2626{ 2663{
2627 /* don't do anything, just let the compiler check the arguments; */ 2664 /* don't do anything, just let the compiler check the arguments; */
2628} 2665}
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
index af095b54502e..ce31408b1e47 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -492,10 +492,10 @@ static inline void fscache_end_io(struct fscache_retrieval *op,
492/* 492/*
493 * out-of-line cache backend functions 493 * out-of-line cache backend functions
494 */ 494 */
495extern void fscache_init_cache(struct fscache_cache *cache, 495extern __printf(3, 4)
496 const struct fscache_cache_ops *ops, 496void fscache_init_cache(struct fscache_cache *cache,
497 const char *idfmt, 497 const struct fscache_cache_ops *ops,
498 ...) __attribute__ ((format (printf, 3, 4))); 498 const char *idfmt, ...);
499 499
500extern int fscache_add_cache(struct fscache_cache *cache, 500extern int fscache_add_cache(struct fscache_cache *cache,
501 struct fscache_object *fsdef, 501 struct fscache_object *fsdef,
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index daa9952d2174..11c16a1fb9e3 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -20,18 +20,8 @@
20#ifndef __FSL_DIU_FB_H__ 20#ifndef __FSL_DIU_FB_H__
21#define __FSL_DIU_FB_H__ 21#define __FSL_DIU_FB_H__
22 22
23/* Arbitrary threshold to determine the allocation method
24 * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory()
25 */
26#define MEM_ALLOC_THRESHOLD (1024*768*4+32)
27
28#include <linux/types.h> 23#include <linux/types.h>
29 24
30struct mfb_alpha {
31 int enable;
32 int alpha;
33};
34
35struct mfb_chroma_key { 25struct mfb_chroma_key {
36 int enable; 26 int enable;
37 __u8 red_max; 27 __u8 red_max;
@@ -43,25 +33,29 @@ struct mfb_chroma_key {
43}; 33};
44 34
45struct aoi_display_offset { 35struct aoi_display_offset {
46 int x_aoi_d; 36 __s32 x_aoi_d;
47 int y_aoi_d; 37 __s32 y_aoi_d;
48}; 38};
49 39
50#define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) 40#define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key)
51#define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) 41#define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8)
42#define MFB_SET_ALPHA _IOW('M', 0, __u8)
43#define MFB_GET_ALPHA _IOR('M', 0, __u8)
44#define MFB_SET_AOID _IOW('M', 4, struct aoi_display_offset)
45#define MFB_GET_AOID _IOR('M', 4, struct aoi_display_offset)
46#define MFB_SET_PIXFMT _IOW('M', 8, __u32)
47#define MFB_GET_PIXFMT _IOR('M', 8, __u32)
52 48
53#define MFB_SET_ALPHA 0x80014d00 49/*
54#define MFB_GET_ALPHA 0x40014d00 50 * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the
55#define MFB_SET_AOID 0x80084d04 51 * wrong value for 'size' field of the ioctl. The current macros above use the
56#define MFB_GET_AOID 0x40084d04 52 * right size, but we still need to provide backwards compatibility, at least
57#define MFB_SET_PIXFMT 0x80014d08 53 * for a while.
58#define MFB_GET_PIXFMT 0x40014d08 54*/
59 55#define MFB_SET_PIXFMT_OLD 0x80014d08
60#define FBIOGET_GWINFO 0x46E0 56#define MFB_GET_PIXFMT_OLD 0x40014d08
61#define FBIOPUT_GWINFO 0x46E1
62 57
63#ifdef __KERNEL__ 58#ifdef __KERNEL__
64#include <linux/spinlock.h>
65 59
66/* 60/*
67 * These are the fields of area descriptor(in DDR memory) for every plane 61 * These are the fields of area descriptor(in DDR memory) for every plane
@@ -159,58 +153,12 @@ struct diu {
159 __be32 plut; 153 __be32 plut;
160} __attribute__ ((packed)); 154} __attribute__ ((packed));
161 155
162struct diu_hw { 156/*
163 struct diu *diu_reg; 157 * Modes of operation of DIU. The DIU supports five different modes, but
164 spinlock_t reg_lock; 158 * the driver only supports modes 0 and 1.
165 159 */
166 __u32 mode; /* DIU operation mode */
167};
168
169struct diu_addr {
170 __u8 __iomem *vaddr; /* Virtual address */
171 dma_addr_t paddr; /* Physical address */
172 __u32 offset;
173};
174
175struct diu_pool {
176 struct diu_addr ad;
177 struct diu_addr gamma;
178 struct diu_addr pallete;
179 struct diu_addr cursor;
180};
181
182#define FSL_DIU_BASE_OFFSET 0x2C000 /* Offset of DIU */
183#define INT_LCDC 64 /* DIU interrupt number */
184
185#define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */
186 /* 1 for plane 0, 2 for plane 1&2 each */
187
188/* Minimum X and Y resolutions */
189#define MIN_XRES 64
190#define MIN_YRES 64
191
192/* HW cursor parameters */
193#define MAX_CURS 32
194
195/* Modes of operation of DIU */
196#define MFB_MODE0 0 /* DIU off */ 160#define MFB_MODE0 0 /* DIU off */
197#define MFB_MODE1 1 /* All three planes output to display */ 161#define MFB_MODE1 1 /* All three planes output to display */
198#define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/
199#define MFB_MODE3 3 /* All three planes written back to memory */
200#define MFB_MODE4 4 /* Color bar generation */
201
202/* INT_STATUS/INT_MASK field descriptions */
203#define INT_VSYNC 0x01 /* Vsync interrupt */
204#define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */
205#define INT_UNDRUN 0x04 /* Under run exception interrupt */
206#define INT_PARERR 0x08 /* Display parameters error interrupt */
207#define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
208
209/* Panels'operation modes */
210#define MFB_TYPE_OUTPUT 0 /* Panel output to display */
211#define MFB_TYPE_OFF 1 /* Panel off */
212#define MFB_TYPE_WB 2 /* Panel written back to memory */
213#define MFB_TYPE_TEST 3 /* Panel generate color bar */
214 162
215#endif /* __KERNEL__ */ 163#endif /* __KERNEL__ */
216#endif /* __FSL_DIU_FB_H__ */ 164#endif /* __FSL_DIU_FB_H__ */
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index f0c0e8a47ae6..26eafcef75be 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -10,7 +10,6 @@
10#include <linux/kallsyms.h> 10#include <linux/kallsyms.h>
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <linux/bitops.h> 12#include <linux/bitops.h>
13#include <linux/module.h>
14#include <linux/ktime.h> 13#include <linux/ktime.h>
15#include <linux/sched.h> 14#include <linux/sched.h>
16#include <linux/types.h> 15#include <linux/types.h>
@@ -19,6 +18,7 @@
19 18
20#include <asm/ftrace.h> 19#include <asm/ftrace.h>
21 20
21struct module;
22struct ftrace_hash; 22struct ftrace_hash;
23 23
24#ifdef CONFIG_FUNCTION_TRACER 24#ifdef CONFIG_FUNCTION_TRACER
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index d464de53db43..464cff526860 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -47,6 +47,9 @@
47 * - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct 47 * - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct
48 * fuse_ioctl_iovec' instead of ambiguous 'struct iovec' 48 * fuse_ioctl_iovec' instead of ambiguous 'struct iovec'
49 * - add FUSE_IOCTL_32BIT flag 49 * - add FUSE_IOCTL_32BIT flag
50 *
51 * 7.17
52 * - add FUSE_FLOCK_LOCKS and FUSE_RELEASE_FLOCK_UNLOCK
50 */ 53 */
51 54
52#ifndef _LINUX_FUSE_H 55#ifndef _LINUX_FUSE_H
@@ -78,7 +81,7 @@
78#define FUSE_KERNEL_VERSION 7 81#define FUSE_KERNEL_VERSION 7
79 82
80/** Minor version number of this interface */ 83/** Minor version number of this interface */
81#define FUSE_KERNEL_MINOR_VERSION 16 84#define FUSE_KERNEL_MINOR_VERSION 17
82 85
83/** The node ID of the root inode */ 86/** The node ID of the root inode */
84#define FUSE_ROOT_ID 1 87#define FUSE_ROOT_ID 1
@@ -153,8 +156,10 @@ struct fuse_file_lock {
153/** 156/**
154 * INIT request/reply flags 157 * INIT request/reply flags
155 * 158 *
159 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
156 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." 160 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
157 * FUSE_DONT_MASK: don't apply umask to file mode on create operations 161 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
162 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
158 */ 163 */
159#define FUSE_ASYNC_READ (1 << 0) 164#define FUSE_ASYNC_READ (1 << 0)
160#define FUSE_POSIX_LOCKS (1 << 1) 165#define FUSE_POSIX_LOCKS (1 << 1)
@@ -163,6 +168,7 @@ struct fuse_file_lock {
163#define FUSE_EXPORT_SUPPORT (1 << 4) 168#define FUSE_EXPORT_SUPPORT (1 << 4)
164#define FUSE_BIG_WRITES (1 << 5) 169#define FUSE_BIG_WRITES (1 << 5)
165#define FUSE_DONT_MASK (1 << 6) 170#define FUSE_DONT_MASK (1 << 6)
171#define FUSE_FLOCK_LOCKS (1 << 10)
166 172
167/** 173/**
168 * CUSE INIT request/reply flags 174 * CUSE INIT request/reply flags
@@ -175,6 +181,7 @@ struct fuse_file_lock {
175 * Release flags 181 * Release flags
176 */ 182 */
177#define FUSE_RELEASE_FLUSH (1 << 0) 183#define FUSE_RELEASE_FLUSH (1 << 0)
184#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
178 185
179/** 186/**
180 * Getattr flags 187 * Getattr flags
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index b65a6f472775..b456b08d70ed 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -71,15 +71,14 @@ void gameport_close(struct gameport *gameport);
71#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) 71#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
72 72
73void __gameport_register_port(struct gameport *gameport, struct module *owner); 73void __gameport_register_port(struct gameport *gameport, struct module *owner);
74static inline void gameport_register_port(struct gameport *gameport) 74/* use a define to avoid include chaining to get THIS_MODULE */
75{ 75#define gameport_register_port(gameport) \
76 __gameport_register_port(gameport, THIS_MODULE); 76 __gameport_register_port(gameport, THIS_MODULE)
77}
78 77
79void gameport_unregister_port(struct gameport *gameport); 78void gameport_unregister_port(struct gameport *gameport);
80 79
81void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) 80__printf(2, 3)
82 __attribute__ ((format (printf, 2, 3))); 81void gameport_set_phys(struct gameport *gameport, const char *fmt, ...);
83 82
84#else 83#else
85 84
@@ -93,8 +92,8 @@ static inline void gameport_unregister_port(struct gameport *gameport)
93 return; 92 return;
94} 93}
95 94
96static inline void gameport_set_phys(struct gameport *gameport, 95static inline __printf(2, 3)
97 const char *fmt, ...) 96void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
98{ 97{
99 return; 98 return;
100} 99}
@@ -145,12 +144,12 @@ static inline void gameport_unpin_driver(struct gameport *gameport)
145 mutex_unlock(&gameport->drv_mutex); 144 mutex_unlock(&gameport->drv_mutex);
146} 145}
147 146
148int __gameport_register_driver(struct gameport_driver *drv, 147int __must_check __gameport_register_driver(struct gameport_driver *drv,
149 struct module *owner, const char *mod_name); 148 struct module *owner, const char *mod_name);
150static inline int __must_check gameport_register_driver(struct gameport_driver *drv) 149
151{ 150/* use a define to avoid include chaining to get THIS_MODULE & friends */
152 return __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); 151#define gameport_register_driver(drv) \
153} 152 __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
154 153
155void gameport_unregister_driver(struct gameport_driver *drv); 154void gameport_unregister_driver(struct gameport_driver *drv);
156 155
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 02fa4697a0e5..9de31bc98c88 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -21,6 +21,8 @@
21#define dev_to_part(device) container_of((device), struct hd_struct, __dev) 21#define dev_to_part(device) container_of((device), struct hd_struct, __dev)
22#define disk_to_dev(disk) (&(disk)->part0.__dev) 22#define disk_to_dev(disk) (&(disk)->part0.__dev)
23#define part_to_dev(part) (&((part)->__dev)) 23#define part_to_dev(part) (&((part)->__dev))
24#define alias_name(disk) ((disk)->alias ? (disk)->alias : \
25 (disk)->disk_name)
24 26
25extern struct device_type part_type; 27extern struct device_type part_type;
26extern struct kobject *block_depr; 28extern struct kobject *block_depr;
@@ -58,6 +60,7 @@ enum {
58 60
59#define DISK_MAX_PARTS 256 61#define DISK_MAX_PARTS 256
60#define DISK_NAME_LEN 32 62#define DISK_NAME_LEN 32
63#define ALIAS_LEN 256
61 64
62#include <linux/major.h> 65#include <linux/major.h>
63#include <linux/device.h> 66#include <linux/device.h>
@@ -128,6 +131,7 @@ struct hd_struct {
128#define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ 131#define GENHD_FL_EXT_DEVT 64 /* allow extended devt */
129#define GENHD_FL_NATIVE_CAPACITY 128 132#define GENHD_FL_NATIVE_CAPACITY 128
130#define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256 133#define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256
134#define GENHD_FL_NO_PART_SCAN 512
131 135
132enum { 136enum {
133 DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */ 137 DISK_EVENT_MEDIA_CHANGE = 1 << 0, /* media changed */
@@ -162,6 +166,7 @@ struct gendisk {
162 * disks that can't be partitioned. */ 166 * disks that can't be partitioned. */
163 167
164 char disk_name[DISK_NAME_LEN]; /* name of major driver */ 168 char disk_name[DISK_NAME_LEN]; /* name of major driver */
169 char *alias; /* alias name of disk */
165 char *(*devnode)(struct gendisk *gd, mode_t *mode); 170 char *(*devnode)(struct gendisk *gd, mode_t *mode);
166 171
167 unsigned int events; /* supported events */ 172 unsigned int events; /* supported events */
@@ -234,9 +239,10 @@ static inline int disk_max_parts(struct gendisk *disk)
234 return disk->minors; 239 return disk->minors;
235} 240}
236 241
237static inline bool disk_partitionable(struct gendisk *disk) 242static inline bool disk_part_scan_enabled(struct gendisk *disk)
238{ 243{
239 return disk_max_parts(disk) > 1; 244 return disk_max_parts(disk) > 1 &&
245 !(disk->flags & GENHD_FL_NO_PART_SCAN);
240} 246}
241 247
242static inline dev_t disk_devt(struct gendisk *disk) 248static inline dev_t disk_devt(struct gendisk *disk)
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 17b5a0d80e42..38ac48b7d3a8 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -14,6 +14,18 @@
14#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) 14#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
15#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) 15#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
16 16
17/**
18 * struct gpio - a structure describing a GPIO with configuration
19 * @gpio: the GPIO number
20 * @flags: GPIO configuration as specified by GPIOF_*
21 * @label: a literal description string of this GPIO
22 */
23struct gpio {
24 unsigned gpio;
25 unsigned long flags;
26 const char *label;
27};
28
17#ifdef CONFIG_GENERIC_GPIO 29#ifdef CONFIG_GENERIC_GPIO
18#include <asm/gpio.h> 30#include <asm/gpio.h>
19 31
@@ -24,18 +36,8 @@
24#include <linux/errno.h> 36#include <linux/errno.h>
25 37
26struct device; 38struct device;
27struct gpio;
28struct gpio_chip; 39struct gpio_chip;
29 40
30/*
31 * Some platforms don't support the GPIO programming interface.
32 *
33 * In case some driver uses it anyway (it should normally have
34 * depended on GENERIC_GPIO), these routines help the compiler
35 * optimize out much GPIO-related code ... or trigger a runtime
36 * warning when something is wrongly called.
37 */
38
39static inline bool gpio_is_valid(int number) 41static inline bool gpio_is_valid(int number)
40{ 42{
41 return false; 43 return false;
diff --git a/include/linux/hash.h b/include/linux/hash.h
index 06d25c189cc5..b80506bdd733 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -63,7 +63,7 @@ static inline u32 hash_32(u32 val, unsigned int bits)
63 return hash >> (32 - bits); 63 return hash >> (32 - bits);
64} 64}
65 65
66static inline unsigned long hash_ptr(void *ptr, unsigned int bits) 66static inline unsigned long hash_ptr(const void *ptr, unsigned int bits)
67{ 67{
68 return hash_long((unsigned long)ptr, bits); 68 return hash_long((unsigned long)ptr, bits);
69} 69}
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 9cf8e7ae7450..c235e4e8767c 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -71,6 +71,7 @@
71#include <linux/timer.h> 71#include <linux/timer.h>
72#include <linux/workqueue.h> 72#include <linux/workqueue.h>
73#include <linux/input.h> 73#include <linux/input.h>
74#include <linux/semaphore.h>
74 75
75/* 76/*
76 * We parse each description item into this structure. Short items data 77 * We parse each description item into this structure. Short items data
@@ -312,6 +313,7 @@ struct hid_item {
312#define HID_QUIRK_BADPAD 0x00000020 313#define HID_QUIRK_BADPAD 0x00000020
313#define HID_QUIRK_MULTI_INPUT 0x00000040 314#define HID_QUIRK_MULTI_INPUT 0x00000040
314#define HID_QUIRK_HIDINPUT_FORCE 0x00000080 315#define HID_QUIRK_HIDINPUT_FORCE 0x00000080
316#define HID_QUIRK_MULTITOUCH 0x00000100
315#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 317#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
316#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 318#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
317#define HID_QUIRK_NO_INIT_REPORTS 0x20000000 319#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
@@ -475,6 +477,7 @@ struct hid_device { /* device report descriptor */
475 unsigned country; /* HID country */ 477 unsigned country; /* HID country */
476 struct hid_report_enum report_enum[HID_REPORT_TYPES]; 478 struct hid_report_enum report_enum[HID_REPORT_TYPES];
477 479
480 struct semaphore driver_lock; /* protects the current driver */
478 struct device dev; /* device */ 481 struct device dev; /* device */
479 struct hid_driver *driver; 482 struct hid_driver *driver;
480 struct hid_ll_driver *ll_driver; 483 struct hid_ll_driver *ll_driver;
@@ -694,10 +697,11 @@ extern void hid_destroy_device(struct hid_device *);
694 697
695extern int __must_check __hid_register_driver(struct hid_driver *, 698extern int __must_check __hid_register_driver(struct hid_driver *,
696 struct module *, const char *mod_name); 699 struct module *, const char *mod_name);
697static inline int __must_check hid_register_driver(struct hid_driver *driver) 700
698{ 701/* use a define to avoid include chaining to get THIS_MODULE & friends */
699 return __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); 702#define hid_register_driver(driver) \
700} 703 __hid_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
704
701extern void hid_unregister_driver(struct hid_driver *); 705extern void hid_unregister_driver(struct hid_driver *);
702 706
703extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 707extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 48c32ebf65a7..a9ace9c32507 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -22,6 +22,11 @@ extern int zap_huge_pmd(struct mmu_gather *tlb,
22extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, 22extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
23 unsigned long addr, unsigned long end, 23 unsigned long addr, unsigned long end,
24 unsigned char *vec); 24 unsigned char *vec);
25extern int move_huge_pmd(struct vm_area_struct *vma,
26 struct vm_area_struct *new_vma,
27 unsigned long old_addr,
28 unsigned long new_addr, unsigned long old_end,
29 pmd_t *old_pmd, pmd_t *new_pmd);
25extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, 30extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
26 unsigned long addr, pgprot_t newprot); 31 unsigned long addr, pgprot_t newprot);
27 32
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
index 8390efc457eb..08a2fee40659 100644
--- a/include/linux/hwspinlock.h
+++ b/include/linux/hwspinlock.h
@@ -20,17 +20,49 @@
20 20
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/sched.h> 22#include <linux/sched.h>
23#include <linux/device.h>
23 24
24/* hwspinlock mode argument */ 25/* hwspinlock mode argument */
25#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */ 26#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */
26#define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */ 27#define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */
27 28
28struct hwspinlock; 29struct hwspinlock;
30struct hwspinlock_device;
31struct hwspinlock_ops;
32
33/**
34 * struct hwspinlock_pdata - platform data for hwspinlock drivers
35 * @base_id: base id for this hwspinlock device
36 *
37 * hwspinlock devices provide system-wide hardware locks that are used
38 * by remote processors that have no other way to achieve synchronization.
39 *
40 * To achieve that, each physical lock must have a system-wide id number
41 * that is agreed upon, otherwise remote processors can't possibly assume
42 * they're using the same hardware lock.
43 *
44 * Usually boards have a single hwspinlock device, which provides several
45 * hwspinlocks, and in this case, they can be trivially numbered 0 to
46 * (num-of-locks - 1).
47 *
48 * In case boards have several hwspinlocks devices, a different base id
49 * should be used for each hwspinlock device (they can't all use 0 as
50 * a starting id!).
51 *
52 * This platform data structure should be used to provide the base id
53 * for each device (which is trivially 0 when only a single hwspinlock
54 * device exists). It can be shared between different platforms, hence
55 * its location.
56 */
57struct hwspinlock_pdata {
58 int base_id;
59};
29 60
30#if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE) 61#if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE)
31 62
32int hwspin_lock_register(struct hwspinlock *lock); 63int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
33struct hwspinlock *hwspin_lock_unregister(unsigned int id); 64 const struct hwspinlock_ops *ops, int base_id, int num_locks);
65int hwspin_lock_unregister(struct hwspinlock_device *bank);
34struct hwspinlock *hwspin_lock_request(void); 66struct hwspinlock *hwspin_lock_request(void);
35struct hwspinlock *hwspin_lock_request_specific(unsigned int id); 67struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
36int hwspin_lock_free(struct hwspinlock *hwlock); 68int hwspin_lock_free(struct hwspinlock *hwlock);
@@ -94,16 +126,6 @@ static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
94 return 0; 126 return 0;
95} 127}
96 128
97static inline int hwspin_lock_register(struct hwspinlock *hwlock)
98{
99 return -ENODEV;
100}
101
102static inline struct hwspinlock *hwspin_lock_unregister(unsigned int id)
103{
104 return NULL;
105}
106
107#endif /* !CONFIG_HWSPINLOCK */ 129#endif /* !CONFIG_HWSPINLOCK */
108 130
109/** 131/**
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
new file mode 100644
index 000000000000..12ec328481de
--- /dev/null
+++ b/include/linux/hyperv.h
@@ -0,0 +1,873 @@
1/*
2 *
3 * Copyright (c) 2011, Microsoft Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
20 * Hank Janssen <hjanssen@microsoft.com>
21 * K. Y. Srinivasan <kys@microsoft.com>
22 *
23 */
24
25#ifndef _HYPERV_H
26#define _HYPERV_H
27
28#include <linux/scatterlist.h>
29#include <linux/list.h>
30#include <linux/uuid.h>
31#include <linux/timer.h>
32#include <linux/workqueue.h>
33#include <linux/completion.h>
34#include <linux/device.h>
35#include <linux/mod_devicetable.h>
36
37
38#define MAX_PAGE_BUFFER_COUNT 16
39#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
40
41#pragma pack(push, 1)
42
43/* Single-page buffer */
44struct hv_page_buffer {
45 u32 len;
46 u32 offset;
47 u64 pfn;
48};
49
50/* Multiple-page buffer */
51struct hv_multipage_buffer {
52 /* Length and Offset determines the # of pfns in the array */
53 u32 len;
54 u32 offset;
55 u64 pfn_array[MAX_MULTIPAGE_BUFFER_COUNT];
56};
57
58/* 0x18 includes the proprietary packet header */
59#define MAX_PAGE_BUFFER_PACKET (0x18 + \
60 (sizeof(struct hv_page_buffer) * \
61 MAX_PAGE_BUFFER_COUNT))
62#define MAX_MULTIPAGE_BUFFER_PACKET (0x18 + \
63 sizeof(struct hv_multipage_buffer))
64
65
66#pragma pack(pop)
67
68struct hv_ring_buffer {
69 /* Offset in bytes from the start of ring data below */
70 u32 write_index;
71
72 /* Offset in bytes from the start of ring data below */
73 u32 read_index;
74
75 u32 interrupt_mask;
76
77 /* Pad it to PAGE_SIZE so that data starts on page boundary */
78 u8 reserved[4084];
79
80 /* NOTE:
81 * The interrupt_mask field is used only for channels but since our
82 * vmbus connection also uses this data structure and its data starts
83 * here, we commented out this field.
84 */
85
86 /*
87 * Ring data starts here + RingDataStartOffset
88 * !!! DO NOT place any fields below this !!!
89 */
90 u8 buffer[0];
91} __packed;
92
93struct hv_ring_buffer_info {
94 struct hv_ring_buffer *ring_buffer;
95 u32 ring_size; /* Include the shared header */
96 spinlock_t ring_lock;
97
98 u32 ring_datasize; /* < ring_size */
99 u32 ring_data_startoffset;
100};
101
102struct hv_ring_buffer_debug_info {
103 u32 current_interrupt_mask;
104 u32 current_read_index;
105 u32 current_write_index;
106 u32 bytes_avail_toread;
107 u32 bytes_avail_towrite;
108};
109
110/*
111 * We use the same version numbering for all Hyper-V modules.
112 *
113 * Definition of versioning is as follows;
114 *
115 * Major Number Changes for these scenarios;
116 * 1. When a new version of Windows Hyper-V
117 * is released.
118 * 2. A Major change has occurred in the
119 * Linux IC's.
120 * (For example the merge for the first time
121 * into the kernel) Every time the Major Number
122 * changes, the Revision number is reset to 0.
123 * Minor Number Changes when new functionality is added
124 * to the Linux IC's that is not a bug fix.
125 *
126 * 3.1 - Added completed hv_utils driver. Shutdown/Heartbeat/Timesync
127 */
128#define HV_DRV_VERSION "3.1"
129
130
131/*
132 * A revision number of vmbus that is used for ensuring both ends on a
133 * partition are using compatible versions.
134 */
135#define VMBUS_REVISION_NUMBER 13
136
137/* Make maximum size of pipe payload of 16K */
138#define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384)
139
140/* Define PipeMode values. */
141#define VMBUS_PIPE_TYPE_BYTE 0x00000000
142#define VMBUS_PIPE_TYPE_MESSAGE 0x00000004
143
144/* The size of the user defined data buffer for non-pipe offers. */
145#define MAX_USER_DEFINED_BYTES 120
146
147/* The size of the user defined data buffer for pipe offers. */
148#define MAX_PIPE_USER_DEFINED_BYTES 116
149
150/*
151 * At the center of the Channel Management library is the Channel Offer. This
152 * struct contains the fundamental information about an offer.
153 */
154struct vmbus_channel_offer {
155 uuid_le if_type;
156 uuid_le if_instance;
157 u64 int_latency; /* in 100ns units */
158 u32 if_revision;
159 u32 server_ctx_size; /* in bytes */
160 u16 chn_flags;
161 u16 mmio_megabytes; /* in bytes * 1024 * 1024 */
162
163 union {
164 /* Non-pipes: The user has MAX_USER_DEFINED_BYTES bytes. */
165 struct {
166 unsigned char user_def[MAX_USER_DEFINED_BYTES];
167 } std;
168
169 /*
170 * Pipes:
171 * The following sructure is an integrated pipe protocol, which
172 * is implemented on top of standard user-defined data. Pipe
173 * clients have MAX_PIPE_USER_DEFINED_BYTES left for their own
174 * use.
175 */
176 struct {
177 u32 pipe_mode;
178 unsigned char user_def[MAX_PIPE_USER_DEFINED_BYTES];
179 } pipe;
180 } u;
181 u32 padding;
182} __packed;
183
184/* Server Flags */
185#define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1
186#define VMBUS_CHANNEL_SERVER_SUPPORTS_TRANSFER_PAGES 2
187#define VMBUS_CHANNEL_SERVER_SUPPORTS_GPADLS 4
188#define VMBUS_CHANNEL_NAMED_PIPE_MODE 0x10
189#define VMBUS_CHANNEL_LOOPBACK_OFFER 0x100
190#define VMBUS_CHANNEL_PARENT_OFFER 0x200
191#define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION 0x400
192
193struct vmpacket_descriptor {
194 u16 type;
195 u16 offset8;
196 u16 len8;
197 u16 flags;
198 u64 trans_id;
199} __packed;
200
201struct vmpacket_header {
202 u32 prev_pkt_start_offset;
203 struct vmpacket_descriptor descriptor;
204} __packed;
205
206struct vmtransfer_page_range {
207 u32 byte_count;
208 u32 byte_offset;
209} __packed;
210
211struct vmtransfer_page_packet_header {
212 struct vmpacket_descriptor d;
213 u16 xfer_pageset_id;
214 bool sender_owns_set;
215 u8 reserved;
216 u32 range_cnt;
217 struct vmtransfer_page_range ranges[1];
218} __packed;
219
220struct vmgpadl_packet_header {
221 struct vmpacket_descriptor d;
222 u32 gpadl;
223 u32 reserved;
224} __packed;
225
226struct vmadd_remove_transfer_page_set {
227 struct vmpacket_descriptor d;
228 u32 gpadl;
229 u16 xfer_pageset_id;
230 u16 reserved;
231} __packed;
232
233/*
234 * This structure defines a range in guest physical space that can be made to
235 * look virtually contiguous.
236 */
237struct gpa_range {
238 u32 byte_count;
239 u32 byte_offset;
240 u64 pfn_array[0];
241};
242
243/*
244 * This is the format for an Establish Gpadl packet, which contains a handle by
245 * which this GPADL will be known and a set of GPA ranges associated with it.
246 * This can be converted to a MDL by the guest OS. If there are multiple GPA
247 * ranges, then the resulting MDL will be "chained," representing multiple VA
248 * ranges.
249 */
250struct vmestablish_gpadl {
251 struct vmpacket_descriptor d;
252 u32 gpadl;
253 u32 range_cnt;
254 struct gpa_range range[1];
255} __packed;
256
257/*
258 * This is the format for a Teardown Gpadl packet, which indicates that the
259 * GPADL handle in the Establish Gpadl packet will never be referenced again.
260 */
261struct vmteardown_gpadl {
262 struct vmpacket_descriptor d;
263 u32 gpadl;
264 u32 reserved; /* for alignment to a 8-byte boundary */
265} __packed;
266
267/*
268 * This is the format for a GPA-Direct packet, which contains a set of GPA
269 * ranges, in addition to commands and/or data.
270 */
271struct vmdata_gpa_direct {
272 struct vmpacket_descriptor d;
273 u32 reserved;
274 u32 range_cnt;
275 struct gpa_range range[1];
276} __packed;
277
278/* This is the format for a Additional Data Packet. */
279struct vmadditional_data {
280 struct vmpacket_descriptor d;
281 u64 total_bytes;
282 u32 offset;
283 u32 byte_cnt;
284 unsigned char data[1];
285} __packed;
286
287union vmpacket_largest_possible_header {
288 struct vmpacket_descriptor simple_hdr;
289 struct vmtransfer_page_packet_header xfer_page_hdr;
290 struct vmgpadl_packet_header gpadl_hdr;
291 struct vmadd_remove_transfer_page_set add_rm_xfer_page_hdr;
292 struct vmestablish_gpadl establish_gpadl_hdr;
293 struct vmteardown_gpadl teardown_gpadl_hdr;
294 struct vmdata_gpa_direct data_gpa_direct_hdr;
295};
296
297#define VMPACKET_DATA_START_ADDRESS(__packet) \
298 (void *)(((unsigned char *)__packet) + \
299 ((struct vmpacket_descriptor)__packet)->offset8 * 8)
300
301#define VMPACKET_DATA_LENGTH(__packet) \
302 ((((struct vmpacket_descriptor)__packet)->len8 - \
303 ((struct vmpacket_descriptor)__packet)->offset8) * 8)
304
305#define VMPACKET_TRANSFER_MODE(__packet) \
306 (((struct IMPACT)__packet)->type)
307
308enum vmbus_packet_type {
309 VM_PKT_INVALID = 0x0,
310 VM_PKT_SYNCH = 0x1,
311 VM_PKT_ADD_XFER_PAGESET = 0x2,
312 VM_PKT_RM_XFER_PAGESET = 0x3,
313 VM_PKT_ESTABLISH_GPADL = 0x4,
314 VM_PKT_TEARDOWN_GPADL = 0x5,
315 VM_PKT_DATA_INBAND = 0x6,
316 VM_PKT_DATA_USING_XFER_PAGES = 0x7,
317 VM_PKT_DATA_USING_GPADL = 0x8,
318 VM_PKT_DATA_USING_GPA_DIRECT = 0x9,
319 VM_PKT_CANCEL_REQUEST = 0xa,
320 VM_PKT_COMP = 0xb,
321 VM_PKT_DATA_USING_ADDITIONAL_PKT = 0xc,
322 VM_PKT_ADDITIONAL_DATA = 0xd
323};
324
325#define VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED 1
326
327
328/* Version 1 messages */
329enum vmbus_channel_message_type {
330 CHANNELMSG_INVALID = 0,
331 CHANNELMSG_OFFERCHANNEL = 1,
332 CHANNELMSG_RESCIND_CHANNELOFFER = 2,
333 CHANNELMSG_REQUESTOFFERS = 3,
334 CHANNELMSG_ALLOFFERS_DELIVERED = 4,
335 CHANNELMSG_OPENCHANNEL = 5,
336 CHANNELMSG_OPENCHANNEL_RESULT = 6,
337 CHANNELMSG_CLOSECHANNEL = 7,
338 CHANNELMSG_GPADL_HEADER = 8,
339 CHANNELMSG_GPADL_BODY = 9,
340 CHANNELMSG_GPADL_CREATED = 10,
341 CHANNELMSG_GPADL_TEARDOWN = 11,
342 CHANNELMSG_GPADL_TORNDOWN = 12,
343 CHANNELMSG_RELID_RELEASED = 13,
344 CHANNELMSG_INITIATE_CONTACT = 14,
345 CHANNELMSG_VERSION_RESPONSE = 15,
346 CHANNELMSG_UNLOAD = 16,
347#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
348 CHANNELMSG_VIEWRANGE_ADD = 17,
349 CHANNELMSG_VIEWRANGE_REMOVE = 18,
350#endif
351 CHANNELMSG_COUNT
352};
353
354struct vmbus_channel_message_header {
355 enum vmbus_channel_message_type msgtype;
356 u32 padding;
357} __packed;
358
359/* Query VMBus Version parameters */
360struct vmbus_channel_query_vmbus_version {
361 struct vmbus_channel_message_header header;
362 u32 version;
363} __packed;
364
365/* VMBus Version Supported parameters */
366struct vmbus_channel_version_supported {
367 struct vmbus_channel_message_header header;
368 bool version_supported;
369} __packed;
370
371/* Offer Channel parameters */
372struct vmbus_channel_offer_channel {
373 struct vmbus_channel_message_header header;
374 struct vmbus_channel_offer offer;
375 u32 child_relid;
376 u8 monitorid;
377 bool monitor_allocated;
378} __packed;
379
380/* Rescind Offer parameters */
381struct vmbus_channel_rescind_offer {
382 struct vmbus_channel_message_header header;
383 u32 child_relid;
384} __packed;
385
386/*
387 * Request Offer -- no parameters, SynIC message contains the partition ID
388 * Set Snoop -- no parameters, SynIC message contains the partition ID
389 * Clear Snoop -- no parameters, SynIC message contains the partition ID
390 * All Offers Delivered -- no parameters, SynIC message contains the partition
391 * ID
392 * Flush Client -- no parameters, SynIC message contains the partition ID
393 */
394
395/* Open Channel parameters */
396struct vmbus_channel_open_channel {
397 struct vmbus_channel_message_header header;
398
399 /* Identifies the specific VMBus channel that is being opened. */
400 u32 child_relid;
401
402 /* ID making a particular open request at a channel offer unique. */
403 u32 openid;
404
405 /* GPADL for the channel's ring buffer. */
406 u32 ringbuffer_gpadlhandle;
407
408 /* GPADL for the channel's server context save area. */
409 u32 server_contextarea_gpadlhandle;
410
411 /*
412 * The upstream ring buffer begins at offset zero in the memory
413 * described by RingBufferGpadlHandle. The downstream ring buffer
414 * follows it at this offset (in pages).
415 */
416 u32 downstream_ringbuffer_pageoffset;
417
418 /* User-specific data to be passed along to the server endpoint. */
419 unsigned char userdata[MAX_USER_DEFINED_BYTES];
420} __packed;
421
422/* Open Channel Result parameters */
423struct vmbus_channel_open_result {
424 struct vmbus_channel_message_header header;
425 u32 child_relid;
426 u32 openid;
427 u32 status;
428} __packed;
429
430/* Close channel parameters; */
431struct vmbus_channel_close_channel {
432 struct vmbus_channel_message_header header;
433 u32 child_relid;
434} __packed;
435
436/* Channel Message GPADL */
437#define GPADL_TYPE_RING_BUFFER 1
438#define GPADL_TYPE_SERVER_SAVE_AREA 2
439#define GPADL_TYPE_TRANSACTION 8
440
441/*
442 * The number of PFNs in a GPADL message is defined by the number of
443 * pages that would be spanned by ByteCount and ByteOffset. If the
444 * implied number of PFNs won't fit in this packet, there will be a
445 * follow-up packet that contains more.
446 */
447struct vmbus_channel_gpadl_header {
448 struct vmbus_channel_message_header header;
449 u32 child_relid;
450 u32 gpadl;
451 u16 range_buflen;
452 u16 rangecount;
453 struct gpa_range range[0];
454} __packed;
455
456/* This is the followup packet that contains more PFNs. */
457struct vmbus_channel_gpadl_body {
458 struct vmbus_channel_message_header header;
459 u32 msgnumber;
460 u32 gpadl;
461 u64 pfn[0];
462} __packed;
463
464struct vmbus_channel_gpadl_created {
465 struct vmbus_channel_message_header header;
466 u32 child_relid;
467 u32 gpadl;
468 u32 creation_status;
469} __packed;
470
471struct vmbus_channel_gpadl_teardown {
472 struct vmbus_channel_message_header header;
473 u32 child_relid;
474 u32 gpadl;
475} __packed;
476
477struct vmbus_channel_gpadl_torndown {
478 struct vmbus_channel_message_header header;
479 u32 gpadl;
480} __packed;
481
482#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
483struct vmbus_channel_view_range_add {
484 struct vmbus_channel_message_header header;
485 PHYSICAL_ADDRESS viewrange_base;
486 u64 viewrange_length;
487 u32 child_relid;
488} __packed;
489
490struct vmbus_channel_view_range_remove {
491 struct vmbus_channel_message_header header;
492 PHYSICAL_ADDRESS viewrange_base;
493 u32 child_relid;
494} __packed;
495#endif
496
497struct vmbus_channel_relid_released {
498 struct vmbus_channel_message_header header;
499 u32 child_relid;
500} __packed;
501
502struct vmbus_channel_initiate_contact {
503 struct vmbus_channel_message_header header;
504 u32 vmbus_version_requested;
505 u32 padding2;
506 u64 interrupt_page;
507 u64 monitor_page1;
508 u64 monitor_page2;
509} __packed;
510
511struct vmbus_channel_version_response {
512 struct vmbus_channel_message_header header;
513 bool version_supported;
514} __packed;
515
516enum vmbus_channel_state {
517 CHANNEL_OFFER_STATE,
518 CHANNEL_OPENING_STATE,
519 CHANNEL_OPEN_STATE,
520};
521
522struct vmbus_channel_debug_info {
523 u32 relid;
524 enum vmbus_channel_state state;
525 uuid_le interfacetype;
526 uuid_le interface_instance;
527 u32 monitorid;
528 u32 servermonitor_pending;
529 u32 servermonitor_latency;
530 u32 servermonitor_connectionid;
531 u32 clientmonitor_pending;
532 u32 clientmonitor_latency;
533 u32 clientmonitor_connectionid;
534
535 struct hv_ring_buffer_debug_info inbound;
536 struct hv_ring_buffer_debug_info outbound;
537};
538
539/*
540 * Represents each channel msg on the vmbus connection This is a
541 * variable-size data structure depending on the msg type itself
542 */
543struct vmbus_channel_msginfo {
544 /* Bookkeeping stuff */
545 struct list_head msglistentry;
546
547 /* So far, this is only used to handle gpadl body message */
548 struct list_head submsglist;
549
550 /* Synchronize the request/response if needed */
551 struct completion waitevent;
552 union {
553 struct vmbus_channel_version_supported version_supported;
554 struct vmbus_channel_open_result open_result;
555 struct vmbus_channel_gpadl_torndown gpadl_torndown;
556 struct vmbus_channel_gpadl_created gpadl_created;
557 struct vmbus_channel_version_response version_response;
558 } response;
559
560 u32 msgsize;
561 /*
562 * The channel message that goes out on the "wire".
563 * It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header
564 */
565 unsigned char msg[0];
566};
567
568struct vmbus_close_msg {
569 struct vmbus_channel_msginfo info;
570 struct vmbus_channel_close_channel msg;
571};
572
573struct vmbus_channel {
574 struct list_head listentry;
575
576 struct hv_device *device_obj;
577
578 struct work_struct work;
579
580 enum vmbus_channel_state state;
581
582 struct vmbus_channel_offer_channel offermsg;
583 /*
584 * These are based on the OfferMsg.MonitorId.
585 * Save it here for easy access.
586 */
587 u8 monitor_grp;
588 u8 monitor_bit;
589
590 u32 ringbuffer_gpadlhandle;
591
592 /* Allocated memory for ring buffer */
593 void *ringbuffer_pages;
594 u32 ringbuffer_pagecount;
595 struct hv_ring_buffer_info outbound; /* send to parent */
596 struct hv_ring_buffer_info inbound; /* receive from parent */
597 spinlock_t inbound_lock;
598 struct workqueue_struct *controlwq;
599
600 struct vmbus_close_msg close_msg;
601
602 /* Channel callback are invoked in this workqueue context */
603 /* HANDLE dataWorkQueue; */
604
605 void (*onchannel_callback)(void *context);
606 void *channel_callback_context;
607};
608
609void vmbus_onmessage(void *context);
610
611int vmbus_request_offers(void);
612
613/* The format must be the same as struct vmdata_gpa_direct */
614struct vmbus_channel_packet_page_buffer {
615 u16 type;
616 u16 dataoffset8;
617 u16 length8;
618 u16 flags;
619 u64 transactionid;
620 u32 reserved;
621 u32 rangecount;
622 struct hv_page_buffer range[MAX_PAGE_BUFFER_COUNT];
623} __packed;
624
625/* The format must be the same as struct vmdata_gpa_direct */
626struct vmbus_channel_packet_multipage_buffer {
627 u16 type;
628 u16 dataoffset8;
629 u16 length8;
630 u16 flags;
631 u64 transactionid;
632 u32 reserved;
633 u32 rangecount; /* Always 1 in this case */
634 struct hv_multipage_buffer range;
635} __packed;
636
637
638extern int vmbus_open(struct vmbus_channel *channel,
639 u32 send_ringbuffersize,
640 u32 recv_ringbuffersize,
641 void *userdata,
642 u32 userdatalen,
643 void(*onchannel_callback)(void *context),
644 void *context);
645
646extern void vmbus_close(struct vmbus_channel *channel);
647
648extern int vmbus_sendpacket(struct vmbus_channel *channel,
649 const void *buffer,
650 u32 bufferLen,
651 u64 requestid,
652 enum vmbus_packet_type type,
653 u32 flags);
654
655extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
656 struct hv_page_buffer pagebuffers[],
657 u32 pagecount,
658 void *buffer,
659 u32 bufferlen,
660 u64 requestid);
661
662extern int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel,
663 struct hv_multipage_buffer *mpb,
664 void *buffer,
665 u32 bufferlen,
666 u64 requestid);
667
668extern int vmbus_establish_gpadl(struct vmbus_channel *channel,
669 void *kbuffer,
670 u32 size,
671 u32 *gpadl_handle);
672
673extern int vmbus_teardown_gpadl(struct vmbus_channel *channel,
674 u32 gpadl_handle);
675
676extern int vmbus_recvpacket(struct vmbus_channel *channel,
677 void *buffer,
678 u32 bufferlen,
679 u32 *buffer_actual_len,
680 u64 *requestid);
681
682extern int vmbus_recvpacket_raw(struct vmbus_channel *channel,
683 void *buffer,
684 u32 bufferlen,
685 u32 *buffer_actual_len,
686 u64 *requestid);
687
688
689extern void vmbus_get_debug_info(struct vmbus_channel *channel,
690 struct vmbus_channel_debug_info *debug);
691
692extern void vmbus_ontimer(unsigned long data);
693
694struct hv_dev_port_info {
695 u32 int_mask;
696 u32 read_idx;
697 u32 write_idx;
698 u32 bytes_avail_toread;
699 u32 bytes_avail_towrite;
700};
701
702/* Base driver object */
703struct hv_driver {
704 const char *name;
705
706 /* the device type supported by this driver */
707 uuid_le dev_type;
708 const struct hv_vmbus_device_id *id_table;
709
710 struct device_driver driver;
711
712 int (*probe)(struct hv_device *, const struct hv_vmbus_device_id *);
713 int (*remove)(struct hv_device *);
714 void (*shutdown)(struct hv_device *);
715
716};
717
718/* Base device object */
719struct hv_device {
720 /* the device type id of this device */
721 uuid_le dev_type;
722
723 /* the device instance id of this device */
724 uuid_le dev_instance;
725
726 struct device device;
727
728 struct vmbus_channel *channel;
729};
730
731
732static inline struct hv_device *device_to_hv_device(struct device *d)
733{
734 return container_of(d, struct hv_device, device);
735}
736
737static inline struct hv_driver *drv_to_hv_drv(struct device_driver *d)
738{
739 return container_of(d, struct hv_driver, driver);
740}
741
742static inline void hv_set_drvdata(struct hv_device *dev, void *data)
743{
744 dev_set_drvdata(&dev->device, data);
745}
746
747static inline void *hv_get_drvdata(struct hv_device *dev)
748{
749 return dev_get_drvdata(&dev->device);
750}
751
752/* Vmbus interface */
753#define vmbus_driver_register(driver) \
754 __vmbus_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)
755int __must_check __vmbus_driver_register(struct hv_driver *hv_driver,
756 struct module *owner,
757 const char *mod_name);
758void vmbus_driver_unregister(struct hv_driver *hv_driver);
759
760/**
761 * VMBUS_DEVICE - macro used to describe a specific hyperv vmbus device
762 *
763 * This macro is used to create a struct hv_vmbus_device_id that matches a
764 * specific device.
765 */
766#define VMBUS_DEVICE(g0, g1, g2, g3, g4, g5, g6, g7, \
767 g8, g9, ga, gb, gc, gd, ge, gf) \
768 .guid = { g0, g1, g2, g3, g4, g5, g6, g7, \
769 g8, g9, ga, gb, gc, gd, ge, gf },
770
771/*
772 * Common header for Hyper-V ICs
773 */
774
775#define ICMSGTYPE_NEGOTIATE 0
776#define ICMSGTYPE_HEARTBEAT 1
777#define ICMSGTYPE_KVPEXCHANGE 2
778#define ICMSGTYPE_SHUTDOWN 3
779#define ICMSGTYPE_TIMESYNC 4
780#define ICMSGTYPE_VSS 5
781
782#define ICMSGHDRFLAG_TRANSACTION 1
783#define ICMSGHDRFLAG_REQUEST 2
784#define ICMSGHDRFLAG_RESPONSE 4
785
786#define HV_S_OK 0x00000000
787#define HV_E_FAIL 0x80004005
788#define HV_ERROR_NOT_SUPPORTED 0x80070032
789#define HV_ERROR_MACHINE_LOCKED 0x800704F7
790
791/*
792 * While we want to handle util services as regular devices,
793 * there is only one instance of each of these services; so
794 * we statically allocate the service specific state.
795 */
796
797struct hv_util_service {
798 u8 *recv_buffer;
799 void (*util_cb)(void *);
800 int (*util_init)(struct hv_util_service *);
801 void (*util_deinit)(void);
802};
803
804struct vmbuspipe_hdr {
805 u32 flags;
806 u32 msgsize;
807} __packed;
808
809struct ic_version {
810 u16 major;
811 u16 minor;
812} __packed;
813
814struct icmsg_hdr {
815 struct ic_version icverframe;
816 u16 icmsgtype;
817 struct ic_version icvermsg;
818 u16 icmsgsize;
819 u32 status;
820 u8 ictransaction_id;
821 u8 icflags;
822 u8 reserved[2];
823} __packed;
824
825struct icmsg_negotiate {
826 u16 icframe_vercnt;
827 u16 icmsg_vercnt;
828 u32 reserved;
829 struct ic_version icversion_data[1]; /* any size array */
830} __packed;
831
832struct shutdown_msg_data {
833 u32 reason_code;
834 u32 timeout_seconds;
835 u32 flags;
836 u8 display_message[2048];
837} __packed;
838
839struct heartbeat_msg_data {
840 u64 seq_num;
841 u32 reserved[8];
842} __packed;
843
844/* Time Sync IC defs */
845#define ICTIMESYNCFLAG_PROBE 0
846#define ICTIMESYNCFLAG_SYNC 1
847#define ICTIMESYNCFLAG_SAMPLE 2
848
849#ifdef __x86_64__
850#define WLTIMEDELTA 116444736000000000L /* in 100ns unit */
851#else
852#define WLTIMEDELTA 116444736000000000LL
853#endif
854
855struct ictimesync_data {
856 u64 parenttime;
857 u64 childtime;
858 u64 roundtriptime;
859 u8 flags;
860} __packed;
861
862struct hyperv_service_callback {
863 u8 msg_type;
864 char *log_msg;
865 uuid_le data;
866 struct vmbus_channel *channel;
867 void (*callback) (void *context);
868};
869
870extern void vmbus_prep_negotiate_resp(struct icmsg_hdr *,
871 struct icmsg_negotiate *, u8 *);
872
873#endif /* _HYPERV_H */
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index 0aa0cbd676f7..92a0dc75bc74 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -32,10 +32,9 @@
32 32
33struct omap_i2c_bus_platform_data { 33struct omap_i2c_bus_platform_data {
34 u32 clkrate; 34 u32 clkrate;
35 u32 rev;
36 u32 flags;
35 void (*set_mpu_wkup_lat)(struct device *dev, long set); 37 void (*set_mpu_wkup_lat)(struct device *dev, long set);
36 int (*device_enable) (struct platform_device *pdev);
37 int (*device_shutdown) (struct platform_device *pdev);
38 int (*device_idle) (struct platform_device *pdev);
39}; 38};
40 39
41#endif 40#endif
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index a6c652ef516d..a81bf6d23b3e 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -28,12 +28,12 @@
28 28
29#include <linux/types.h> 29#include <linux/types.h>
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31#include <linux/module.h>
32#include <linux/mod_devicetable.h> 31#include <linux/mod_devicetable.h>
33#include <linux/device.h> /* for struct device */ 32#include <linux/device.h> /* for struct device */
34#include <linux/sched.h> /* for completion */ 33#include <linux/sched.h> /* for completion */
35#include <linux/mutex.h> 34#include <linux/mutex.h>
36#include <linux/of.h> /* for struct device_node */ 35#include <linux/of.h> /* for struct device_node */
36#include <linux/swab.h> /* for swab16 */
37 37
38extern struct bus_type i2c_bus_type; 38extern struct bus_type i2c_bus_type;
39extern struct device_type i2c_adapter_type; 39extern struct device_type i2c_adapter_type;
@@ -48,6 +48,8 @@ struct i2c_driver;
48union i2c_smbus_data; 48union i2c_smbus_data;
49struct i2c_board_info; 49struct i2c_board_info;
50 50
51struct module;
52
51#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 53#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
52/* 54/*
53 * The master routines are the ones normally used to transmit data to devices 55 * The master routines are the ones normally used to transmit data to devices
@@ -88,6 +90,22 @@ extern s32 i2c_smbus_read_word_data(const struct i2c_client *client,
88 u8 command); 90 u8 command);
89extern s32 i2c_smbus_write_word_data(const struct i2c_client *client, 91extern s32 i2c_smbus_write_word_data(const struct i2c_client *client,
90 u8 command, u16 value); 92 u8 command, u16 value);
93
94static inline s32
95i2c_smbus_read_word_swapped(const struct i2c_client *client, u8 command)
96{
97 s32 value = i2c_smbus_read_word_data(client, command);
98
99 return (value < 0) ? value : swab16(value);
100}
101
102static inline s32
103i2c_smbus_write_word_swapped(const struct i2c_client *client,
104 u8 command, u16 value)
105{
106 return i2c_smbus_write_word_data(client, command, swab16(value));
107}
108
91/* Returns the number of read bytes */ 109/* Returns the number of read bytes */
92extern s32 i2c_smbus_read_block_data(const struct i2c_client *client, 110extern s32 i2c_smbus_read_block_data(const struct i2c_client *client,
93 u8 command, u8 *values); 111 u8 command, u8 *values);
@@ -434,10 +452,9 @@ extern int i2c_add_numbered_adapter(struct i2c_adapter *);
434extern int i2c_register_driver(struct module *, struct i2c_driver *); 452extern int i2c_register_driver(struct module *, struct i2c_driver *);
435extern void i2c_del_driver(struct i2c_driver *); 453extern void i2c_del_driver(struct i2c_driver *);
436 454
437static inline int i2c_add_driver(struct i2c_driver *driver) 455/* use a define to avoid include chaining to get THIS_MODULE */
438{ 456#define i2c_add_driver(driver) \
439 return i2c_register_driver(THIS_MODULE, driver); 457 i2c_register_driver(THIS_MODULE, driver)
440}
441 458
442extern struct i2c_client *i2c_use_client(struct i2c_client *client); 459extern struct i2c_client *i2c_use_client(struct i2c_client *client);
443extern void i2c_release_client(struct i2c_client *client); 460extern void i2c_release_client(struct i2c_client *client);
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h
index 591427a63b06..506a9f7af51e 100644
--- a/include/linux/i2c/tsc2007.h
+++ b/include/linux/i2c/tsc2007.h
@@ -5,7 +5,7 @@
5 5
6struct tsc2007_platform_data { 6struct tsc2007_platform_data {
7 u16 model; /* 2007. */ 7 u16 model; /* 2007. */
8 u16 x_plate_ohms; 8 u16 x_plate_ohms; /* must be non-zero value */
9 u16 max_rt; /* max. resistance above which samples are ignored */ 9 u16 max_rt; /* max. resistance above which samples are ignored */
10 unsigned long poll_delay; /* delay (in ms) after pen-down event 10 unsigned long poll_delay; /* delay (in ms) after pen-down event
11 before polling starts */ 11 before polling starts */
diff --git a/include/linux/i2c/twl4030-madc.h b/include/linux/i2c/twl4030-madc.h
index 6427d298fbfc..530e11ba0738 100644
--- a/include/linux/i2c/twl4030-madc.h
+++ b/include/linux/i2c/twl4030-madc.h
@@ -129,6 +129,10 @@ enum sample_type {
129#define REG_BCICTL2 0x024 129#define REG_BCICTL2 0x024
130#define TWL4030_BCI_ITHSENS 0x007 130#define TWL4030_BCI_ITHSENS 0x007
131 131
132/* Register and bits for GPBR1 register */
133#define TWL4030_REG_GPBR1 0x0c
134#define TWL4030_GPBR1_MADC_HFCLK_EN (1 << 7)
135
132struct twl4030_madc_user_parms { 136struct twl4030_madc_user_parms {
133 int channel; 137 int channel;
134 int average; 138 int average;
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 54c878960872..48363c3c40f8 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -130,6 +130,8 @@
130#define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060 130#define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060
131/* A-MSDU 802.11n */ 131/* A-MSDU 802.11n */
132#define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080 132#define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080
133/* Mesh Control 802.11s */
134#define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100
133 135
134/* U-APSD queue for WMM IEs sent by AP */ 136/* U-APSD queue for WMM IEs sent by AP */
135#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) 137#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7)
@@ -629,9 +631,14 @@ struct ieee80211_rann_ie {
629 u8 rann_ttl; 631 u8 rann_ttl;
630 u8 rann_addr[6]; 632 u8 rann_addr[6];
631 u32 rann_seq; 633 u32 rann_seq;
634 u32 rann_interval;
632 u32 rann_metric; 635 u32 rann_metric;
633} __attribute__ ((packed)); 636} __attribute__ ((packed));
634 637
638enum ieee80211_rann_flags {
639 RANN_FLAG_IS_GATE = 1 << 0,
640};
641
635#define WLAN_SA_QUERY_TR_ID_LEN 2 642#define WLAN_SA_QUERY_TR_ID_LEN 2
636 643
637struct ieee80211_mgmt { 644struct ieee80211_mgmt {
@@ -736,19 +743,10 @@ struct ieee80211_mgmt {
736 __le16 params; 743 __le16 params;
737 __le16 reason_code; 744 __le16 reason_code;
738 } __attribute__((packed)) delba; 745 } __attribute__((packed)) delba;
739 struct{ 746 struct {
740 u8 action_code; 747 u8 action_code;
741 /* capab_info for open and confirm,
742 * reason for close
743 */
744 __le16 aux;
745 /* Followed in plink_confirm by status
746 * code, AID and supported rates,
747 * and directly by supported rates in
748 * plink_open and plink_close
749 */
750 u8 variable[0]; 748 u8 variable[0];
751 } __attribute__((packed)) plink_action; 749 } __attribute__((packed)) self_prot;
752 struct{ 750 struct{
753 u8 action_code; 751 u8 action_code;
754 u8 variable[0]; 752 u8 variable[0];
@@ -761,6 +759,12 @@ struct ieee80211_mgmt {
761 u8 action; 759 u8 action;
762 u8 smps_control; 760 u8 smps_control;
763 } __attribute__ ((packed)) ht_smps; 761 } __attribute__ ((packed)) ht_smps;
762 struct {
763 u8 action_code;
764 u8 dialog_token;
765 __le16 capability;
766 u8 variable[0];
767 } __packed tdls_discover_resp;
764 } u; 768 } u;
765 } __attribute__ ((packed)) action; 769 } __attribute__ ((packed)) action;
766 } u; 770 } u;
@@ -779,6 +783,13 @@ struct ieee80211_mmie {
779 u8 mic[8]; 783 u8 mic[8];
780} __attribute__ ((packed)); 784} __attribute__ ((packed));
781 785
786struct ieee80211_vendor_ie {
787 u8 element_id;
788 u8 len;
789 u8 oui[3];
790 u8 oui_type;
791} __packed;
792
782/* Control frames */ 793/* Control frames */
783struct ieee80211_rts { 794struct ieee80211_rts {
784 __le16 frame_control; 795 __le16 frame_control;
@@ -800,6 +811,52 @@ struct ieee80211_pspoll {
800 u8 ta[6]; 811 u8 ta[6];
801} __attribute__ ((packed)); 812} __attribute__ ((packed));
802 813
814/* TDLS */
815
816/* Link-id information element */
817struct ieee80211_tdls_lnkie {
818 u8 ie_type; /* Link Identifier IE */
819 u8 ie_len;
820 u8 bssid[6];
821 u8 init_sta[6];
822 u8 resp_sta[6];
823} __packed;
824
825struct ieee80211_tdls_data {
826 u8 da[6];
827 u8 sa[6];
828 __be16 ether_type;
829 u8 payload_type;
830 u8 category;
831 u8 action_code;
832 union {
833 struct {
834 u8 dialog_token;
835 __le16 capability;
836 u8 variable[0];
837 } __packed setup_req;
838 struct {
839 __le16 status_code;
840 u8 dialog_token;
841 __le16 capability;
842 u8 variable[0];
843 } __packed setup_resp;
844 struct {
845 __le16 status_code;
846 u8 dialog_token;
847 u8 variable[0];
848 } __packed setup_cfm;
849 struct {
850 __le16 reason_code;
851 u8 variable[0];
852 } __packed teardown;
853 struct {
854 u8 dialog_token;
855 u8 variable[0];
856 } __packed discover_req;
857 } u;
858} __packed;
859
803/** 860/**
804 * struct ieee80211_bar - HT Block Ack Request 861 * struct ieee80211_bar - HT Block Ack Request
805 * 862 *
@@ -816,9 +873,11 @@ struct ieee80211_bar {
816} __attribute__((packed)); 873} __attribute__((packed));
817 874
818/* 802.11 BAR control masks */ 875/* 802.11 BAR control masks */
819#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 876#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000
820#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 877#define IEEE80211_BAR_CTRL_MULTI_TID 0x0002
821 878#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
879#define IEEE80211_BAR_CTRL_TID_INFO_MASK 0xf000
880#define IEEE80211_BAR_CTRL_TID_INFO_SHIFT 12
822 881
823#define IEEE80211_HT_MCS_MASK_LEN 10 882#define IEEE80211_HT_MCS_MASK_LEN 10
824 883
@@ -1189,16 +1248,13 @@ enum ieee80211_eid {
1189 WLAN_EID_TS_DELAY = 43, 1248 WLAN_EID_TS_DELAY = 43,
1190 WLAN_EID_TCLAS_PROCESSING = 44, 1249 WLAN_EID_TCLAS_PROCESSING = 44,
1191 WLAN_EID_QOS_CAPA = 46, 1250 WLAN_EID_QOS_CAPA = 46,
1251 /* 802.11z */
1252 WLAN_EID_LINK_ID = 101,
1192 /* 802.11s */ 1253 /* 802.11s */
1193 WLAN_EID_MESH_CONFIG = 113, 1254 WLAN_EID_MESH_CONFIG = 113,
1194 WLAN_EID_MESH_ID = 114, 1255 WLAN_EID_MESH_ID = 114,
1195 WLAN_EID_LINK_METRIC_REPORT = 115, 1256 WLAN_EID_LINK_METRIC_REPORT = 115,
1196 WLAN_EID_CONGESTION_NOTIFICATION = 116, 1257 WLAN_EID_CONGESTION_NOTIFICATION = 116,
1197 /* Note that the Peer Link IE has been replaced with the similar
1198 * Peer Management IE. We will keep the former definition until mesh
1199 * code is changed to comply with latest 802.11s drafts.
1200 */
1201 WLAN_EID_PEER_LINK = 55, /* no longer in 802.11s drafts */
1202 WLAN_EID_PEER_MGMT = 117, 1258 WLAN_EID_PEER_MGMT = 117,
1203 WLAN_EID_CHAN_SWITCH_PARAM = 118, 1259 WLAN_EID_CHAN_SWITCH_PARAM = 118,
1204 WLAN_EID_MESH_AWAKE_WINDOW = 119, 1260 WLAN_EID_MESH_AWAKE_WINDOW = 119,
@@ -1277,13 +1333,11 @@ enum ieee80211_category {
1277 WLAN_CATEGORY_HT = 7, 1333 WLAN_CATEGORY_HT = 7,
1278 WLAN_CATEGORY_SA_QUERY = 8, 1334 WLAN_CATEGORY_SA_QUERY = 8,
1279 WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, 1335 WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
1336 WLAN_CATEGORY_TDLS = 12,
1280 WLAN_CATEGORY_MESH_ACTION = 13, 1337 WLAN_CATEGORY_MESH_ACTION = 13,
1281 WLAN_CATEGORY_MULTIHOP_ACTION = 14, 1338 WLAN_CATEGORY_MULTIHOP_ACTION = 14,
1282 WLAN_CATEGORY_SELF_PROTECTED = 15, 1339 WLAN_CATEGORY_SELF_PROTECTED = 15,
1283 WLAN_CATEGORY_WMM = 17, 1340 WLAN_CATEGORY_WMM = 17,
1284 /* TODO: remove MESH_PATH_SEL after mesh is updated
1285 * to current 802.11s draft */
1286 WLAN_CATEGORY_MESH_PATH_SEL = 32,
1287 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, 1341 WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
1288 WLAN_CATEGORY_VENDOR_SPECIFIC = 127, 1342 WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
1289}; 1343};
@@ -1309,6 +1363,31 @@ enum ieee80211_ht_actioncode {
1309 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, 1363 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7,
1310}; 1364};
1311 1365
1366/* Self Protected Action codes */
1367enum ieee80211_self_protected_actioncode {
1368 WLAN_SP_RESERVED = 0,
1369 WLAN_SP_MESH_PEERING_OPEN = 1,
1370 WLAN_SP_MESH_PEERING_CONFIRM = 2,
1371 WLAN_SP_MESH_PEERING_CLOSE = 3,
1372 WLAN_SP_MGK_INFORM = 4,
1373 WLAN_SP_MGK_ACK = 5,
1374};
1375
1376/* Mesh action codes */
1377enum ieee80211_mesh_actioncode {
1378 WLAN_MESH_ACTION_LINK_METRIC_REPORT,
1379 WLAN_MESH_ACTION_HWMP_PATH_SELECTION,
1380 WLAN_MESH_ACTION_GATE_ANNOUNCEMENT,
1381 WLAN_MESH_ACTION_CONGESTION_CONTROL_NOTIFICATION,
1382 WLAN_MESH_ACTION_MCCA_SETUP_REQUEST,
1383 WLAN_MESH_ACTION_MCCA_SETUP_REPLY,
1384 WLAN_MESH_ACTION_MCCA_ADVERTISEMENT_REQUEST,
1385 WLAN_MESH_ACTION_MCCA_ADVERTISEMENT,
1386 WLAN_MESH_ACTION_MCCA_TEARDOWN,
1387 WLAN_MESH_ACTION_TBTT_ADJUSTMENT_REQUEST,
1388 WLAN_MESH_ACTION_TBTT_ADJUSTMENT_RESPONSE,
1389};
1390
1312/* Security key length */ 1391/* Security key length */
1313enum ieee80211_key_len { 1392enum ieee80211_key_len {
1314 WLAN_KEY_LEN_WEP40 = 5, 1393 WLAN_KEY_LEN_WEP40 = 5,
@@ -1318,6 +1397,36 @@ enum ieee80211_key_len {
1318 WLAN_KEY_LEN_AES_CMAC = 16, 1397 WLAN_KEY_LEN_AES_CMAC = 16,
1319}; 1398};
1320 1399
1400/* Public action codes */
1401enum ieee80211_pub_actioncode {
1402 WLAN_PUB_ACTION_TDLS_DISCOVER_RES = 14,
1403};
1404
1405/* TDLS action codes */
1406enum ieee80211_tdls_actioncode {
1407 WLAN_TDLS_SETUP_REQUEST = 0,
1408 WLAN_TDLS_SETUP_RESPONSE = 1,
1409 WLAN_TDLS_SETUP_CONFIRM = 2,
1410 WLAN_TDLS_TEARDOWN = 3,
1411 WLAN_TDLS_PEER_TRAFFIC_INDICATION = 4,
1412 WLAN_TDLS_CHANNEL_SWITCH_REQUEST = 5,
1413 WLAN_TDLS_CHANNEL_SWITCH_RESPONSE = 6,
1414 WLAN_TDLS_PEER_PSM_REQUEST = 7,
1415 WLAN_TDLS_PEER_PSM_RESPONSE = 8,
1416 WLAN_TDLS_PEER_TRAFFIC_RESPONSE = 9,
1417 WLAN_TDLS_DISCOVERY_REQUEST = 10,
1418};
1419
1420/*
1421 * TDLS capabililites to be enabled in the 5th byte of the
1422 * @WLAN_EID_EXT_CAPABILITY information element
1423 */
1424#define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5)
1425#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
1426
1427/* TDLS specific payload type in the LLC/SNAP header */
1428#define WLAN_TDLS_SNAP_RFTYPE 0x2
1429
1321/** 1430/**
1322 * enum - mesh path selection protocol identifier 1431 * enum - mesh path selection protocol identifier
1323 * 1432 *
@@ -1453,6 +1562,9 @@ enum ieee80211_sa_query_action {
1453 1562
1454#define WLAN_PMKID_LEN 16 1563#define WLAN_PMKID_LEN 16
1455 1564
1565#define WLAN_OUI_WFA 0x506f9a
1566#define WLAN_OUI_TYPE_WFA_P2P 9
1567
1456/* 1568/*
1457 * WMM/802.11e Tspec Element 1569 * WMM/802.11e Tspec Element
1458 */ 1570 */
diff --git a/include/linux/if.h b/include/linux/if.h
index 03489ca92ded..db20bd4fd16b 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -78,6 +78,7 @@
78 * datapath port */ 78 * datapath port */
79#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing 79#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
80 * skbs on transmit */ 80 * skbs on transmit */
81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
81 82
82#define IF_GET_IFACE 0x0001 /* for querying only */ 83#define IF_GET_IFACE 0x0001 /* for querying only */
83#define IF_GET_PROTO 0x0002 84#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index a3d99ff6e3b5..e473003e4bda 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -83,11 +83,13 @@
83#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ 83#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
84#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ 84#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
85#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ 85#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
86#define ETH_P_TDLS 0x890D /* TDLS */
86#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ 87#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
87#define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ 88#define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
88#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ 89#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
89#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ 90#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
90#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ 91#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
92#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
91 93
92/* 94/*
93 * Non DIX types. Won't clash for 1500 types. 95 * Non DIX types. Won't clash for 1500 types.
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 0ee969a5593d..c52d4b5f872a 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -279,6 +279,7 @@ enum {
279 IFLA_VF_MAC, /* Hardware queue specific attributes */ 279 IFLA_VF_MAC, /* Hardware queue specific attributes */
280 IFLA_VF_VLAN, 280 IFLA_VF_VLAN,
281 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ 281 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
282 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
282 __IFLA_VF_MAX, 283 __IFLA_VF_MAX,
283}; 284};
284 285
@@ -300,13 +301,22 @@ struct ifla_vf_tx_rate {
300 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */ 301 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
301}; 302};
302 303
304struct ifla_vf_spoofchk {
305 __u32 vf;
306 __u32 setting;
307};
308#ifdef __KERNEL__
309
310/* We don't want this structure exposed to user space */
303struct ifla_vf_info { 311struct ifla_vf_info {
304 __u32 vf; 312 __u32 vf;
305 __u8 mac[32]; 313 __u8 mac[32];
306 __u32 vlan; 314 __u32 vlan;
307 __u32 qos; 315 __u32 qos;
308 __u32 tx_rate; 316 __u32 tx_rate;
317 __u32 spoofchk;
309}; 318};
319#endif
310 320
311/* VF ports management section 321/* VF ports management section
312 * 322 *
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index e28b2e4959d4..d103dca5c563 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -64,6 +64,7 @@ struct macvlan_dev {
64 int (*forward)(struct net_device *dev, struct sk_buff *skb); 64 int (*forward)(struct net_device *dev, struct sk_buff *skb);
65 struct macvtap_queue *taps[MAX_MACVTAP_QUEUES]; 65 struct macvtap_queue *taps[MAX_MACVTAP_QUEUES];
66 int numvtaps; 66 int numvtaps;
67 int minor;
67}; 68};
68 69
69static inline void macvlan_count_rx(const struct macvlan_dev *vlan, 70static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index c1486060f5ed..f3799295d231 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -61,6 +61,17 @@ struct tpacket_stats {
61 unsigned int tp_drops; 61 unsigned int tp_drops;
62}; 62};
63 63
64struct tpacket_stats_v3 {
65 unsigned int tp_packets;
66 unsigned int tp_drops;
67 unsigned int tp_freeze_q_cnt;
68};
69
70union tpacket_stats_u {
71 struct tpacket_stats stats1;
72 struct tpacket_stats_v3 stats3;
73};
74
64struct tpacket_auxdata { 75struct tpacket_auxdata {
65 __u32 tp_status; 76 __u32 tp_status;
66 __u32 tp_len; 77 __u32 tp_len;
@@ -78,6 +89,7 @@ struct tpacket_auxdata {
78#define TP_STATUS_LOSING 0x4 89#define TP_STATUS_LOSING 0x4
79#define TP_STATUS_CSUMNOTREADY 0x8 90#define TP_STATUS_CSUMNOTREADY 0x8
80#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */ 91#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */
92#define TP_STATUS_BLK_TMO 0x20
81 93
82/* Tx ring - header status */ 94/* Tx ring - header status */
83#define TP_STATUS_AVAILABLE 0x0 95#define TP_STATUS_AVAILABLE 0x0
@@ -85,6 +97,9 @@ struct tpacket_auxdata {
85#define TP_STATUS_SENDING 0x2 97#define TP_STATUS_SENDING 0x2
86#define TP_STATUS_WRONG_FORMAT 0x4 98#define TP_STATUS_WRONG_FORMAT 0x4
87 99
100/* Rx ring - feature request bits */
101#define TP_FT_REQ_FILL_RXHASH 0x1
102
88struct tpacket_hdr { 103struct tpacket_hdr {
89 unsigned long tp_status; 104 unsigned long tp_status;
90 unsigned int tp_len; 105 unsigned int tp_len;
@@ -111,11 +126,100 @@ struct tpacket2_hdr {
111 __u16 tp_padding; 126 __u16 tp_padding;
112}; 127};
113 128
129struct tpacket_hdr_variant1 {
130 __u32 tp_rxhash;
131 __u32 tp_vlan_tci;
132};
133
134struct tpacket3_hdr {
135 __u32 tp_next_offset;
136 __u32 tp_sec;
137 __u32 tp_nsec;
138 __u32 tp_snaplen;
139 __u32 tp_len;
140 __u32 tp_status;
141 __u16 tp_mac;
142 __u16 tp_net;
143 /* pkt_hdr variants */
144 union {
145 struct tpacket_hdr_variant1 hv1;
146 };
147};
148
149struct tpacket_bd_ts {
150 unsigned int ts_sec;
151 union {
152 unsigned int ts_usec;
153 unsigned int ts_nsec;
154 };
155};
156
157struct tpacket_hdr_v1 {
158 __u32 block_status;
159 __u32 num_pkts;
160 __u32 offset_to_first_pkt;
161
162 /* Number of valid bytes (including padding)
163 * blk_len <= tp_block_size
164 */
165 __u32 blk_len;
166
167 /*
168 * Quite a few uses of sequence number:
169 * 1. Make sure cache flush etc worked.
170 * Well, one can argue - why not use the increasing ts below?
171 * But look at 2. below first.
172 * 2. When you pass around blocks to other user space decoders,
173 * you can see which blk[s] is[are] outstanding etc.
174 * 3. Validate kernel code.
175 */
176 __aligned_u64 seq_num;
177
178 /*
179 * ts_last_pkt:
180 *
181 * Case 1. Block has 'N'(N >=1) packets and TMO'd(timed out)
182 * ts_last_pkt == 'time-stamp of last packet' and NOT the
183 * time when the timer fired and the block was closed.
184 * By providing the ts of the last packet we can absolutely
185 * guarantee that time-stamp wise, the first packet in the
186 * next block will never precede the last packet of the
187 * previous block.
188 * Case 2. Block has zero packets and TMO'd
189 * ts_last_pkt = time when the timer fired and the block
190 * was closed.
191 * Case 3. Block has 'N' packets and NO TMO.
192 * ts_last_pkt = time-stamp of the last pkt in the block.
193 *
194 * ts_first_pkt:
195 * Is always the time-stamp when the block was opened.
196 * Case a) ZERO packets
197 * No packets to deal with but atleast you know the
198 * time-interval of this block.
199 * Case b) Non-zero packets
200 * Use the ts of the first packet in the block.
201 *
202 */
203 struct tpacket_bd_ts ts_first_pkt, ts_last_pkt;
204};
205
206union tpacket_bd_header_u {
207 struct tpacket_hdr_v1 bh1;
208};
209
210struct tpacket_block_desc {
211 __u32 version;
212 __u32 offset_to_priv;
213 union tpacket_bd_header_u hdr;
214};
215
114#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) 216#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
217#define TPACKET3_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket3_hdr)) + sizeof(struct sockaddr_ll))
115 218
116enum tpacket_versions { 219enum tpacket_versions {
117 TPACKET_V1, 220 TPACKET_V1,
118 TPACKET_V2, 221 TPACKET_V2,
222 TPACKET_V3
119}; 223};
120 224
121/* 225/*
@@ -138,6 +242,21 @@ struct tpacket_req {
138 unsigned int tp_frame_nr; /* Total number of frames */ 242 unsigned int tp_frame_nr; /* Total number of frames */
139}; 243};
140 244
245struct tpacket_req3 {
246 unsigned int tp_block_size; /* Minimal size of contiguous block */
247 unsigned int tp_block_nr; /* Number of blocks */
248 unsigned int tp_frame_size; /* Size of frame */
249 unsigned int tp_frame_nr; /* Total number of frames */
250 unsigned int tp_retire_blk_tov; /* timeout in msecs */
251 unsigned int tp_sizeof_priv; /* offset to private data area */
252 unsigned int tp_feature_req_word;
253};
254
255union tpacket_req_u {
256 struct tpacket_req req;
257 struct tpacket_req3 req3;
258};
259
141struct packet_mreq { 260struct packet_mreq {
142 int mr_ifindex; 261 int mr_ifindex;
143 unsigned short mr_type; 262 unsigned short mr_type;
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index 184bc5566207..23cefa1111bf 100644
--- a/include/linux/if_pppol2tp.h
+++ b/include/linux/if_pppol2tp.h
@@ -39,7 +39,7 @@ struct pppol2tp_addr {
39 * bits. So we need a different sockaddr structure. 39 * bits. So we need a different sockaddr structure.
40 */ 40 */
41struct pppol2tpv3_addr { 41struct pppol2tpv3_addr {
42 pid_t pid; /* pid that owns the fd. 42 __kernel_pid_t pid; /* pid that owns the fd.
43 * 0 => current */ 43 * 0 => current */
44 int fd; /* FD of UDP or IP socket to use */ 44 int fd; /* FD of UDP or IP socket to use */
45 45
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 397921b09ef9..b5f927f59f26 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -20,8 +20,9 @@
20#include <linux/types.h> 20#include <linux/types.h>
21#include <asm/byteorder.h> 21#include <asm/byteorder.h>
22 22
23#ifdef __KERNEL__ 23#include <linux/socket.h>
24#include <linux/if_ether.h> 24#include <linux/if_ether.h>
25#ifdef __KERNEL__
25#include <linux/if.h> 26#include <linux/if.h>
26#include <linux/netdevice.h> 27#include <linux/netdevice.h>
27#include <linux/ppp_channel.h> 28#include <linux/ppp_channel.h>
@@ -63,7 +64,7 @@ struct pptp_addr {
63#define PX_MAX_PROTO 3 64#define PX_MAX_PROTO 3
64 65
65struct sockaddr_pppox { 66struct sockaddr_pppox {
66 sa_family_t sa_family; /* address family, AF_PPPOX */ 67 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
67 unsigned int sa_protocol; /* protocol identifier */ 68 unsigned int sa_protocol; /* protocol identifier */
68 union { 69 union {
69 struct pppoe_addr pppoe; 70 struct pppoe_addr pppoe;
@@ -77,7 +78,7 @@ struct sockaddr_pppox {
77 * type instead. 78 * type instead.
78 */ 79 */
79struct sockaddr_pppol2tp { 80struct sockaddr_pppol2tp {
80 sa_family_t sa_family; /* address family, AF_PPPOX */ 81 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
81 unsigned int sa_protocol; /* protocol identifier */ 82 unsigned int sa_protocol; /* protocol identifier */
82 struct pppol2tp_addr pppol2tp; 83 struct pppol2tp_addr pppol2tp;
83} __attribute__((packed)); 84} __attribute__((packed));
@@ -86,7 +87,7 @@ struct sockaddr_pppol2tp {
86 * bits. So we need a different sockaddr structure. 87 * bits. So we need a different sockaddr structure.
87 */ 88 */
88struct sockaddr_pppol2tpv3 { 89struct sockaddr_pppol2tpv3 {
89 sa_family_t sa_family; /* address family, AF_PPPOX */ 90 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
90 unsigned int sa_protocol; /* protocol identifier */ 91 unsigned int sa_protocol; /* protocol identifier */
91 struct pppol2tpv3_addr pppol2tp; 92 struct pppol2tpv3_addr pppol2tp;
92} __attribute__((packed)); 93} __attribute__((packed));
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 44da4822bcab..12d5543b14f2 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -106,7 +106,7 @@ extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
106extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 106extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
107extern u16 vlan_dev_vlan_id(const struct net_device *dev); 107extern u16 vlan_dev_vlan_id(const struct net_device *dev);
108 108
109extern bool vlan_do_receive(struct sk_buff **skb); 109extern bool vlan_do_receive(struct sk_buff **skb, bool last_handler);
110extern struct sk_buff *vlan_untag(struct sk_buff *skb); 110extern struct sk_buff *vlan_untag(struct sk_buff *skb);
111 111
112#else 112#else
@@ -128,9 +128,9 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
128 return 0; 128 return 0;
129} 129}
130 130
131static inline bool vlan_do_receive(struct sk_buff **skb) 131static inline bool vlan_do_receive(struct sk_buff **skb, bool last_handler)
132{ 132{
133 if ((*skb)->vlan_tci & VLAN_VID_MASK) 133 if (((*skb)->vlan_tci & VLAN_VID_MASK) && last_handler)
134 (*skb)->pkt_type = PACKET_OTHERHOST; 134 (*skb)->pkt_type = PACKET_OTHERHOST;
135 return false; 135 return false;
136} 136}
diff --git a/include/linux/ima.h b/include/linux/ima.h
index 09e6e62f9953..6ac8e50c6cf5 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -15,8 +15,6 @@ struct linux_binprm;
15 15
16#ifdef CONFIG_IMA 16#ifdef CONFIG_IMA
17extern int ima_bprm_check(struct linux_binprm *bprm); 17extern int ima_bprm_check(struct linux_binprm *bprm);
18extern int ima_inode_alloc(struct inode *inode);
19extern void ima_inode_free(struct inode *inode);
20extern int ima_file_check(struct file *file, int mask); 18extern int ima_file_check(struct file *file, int mask);
21extern void ima_file_free(struct file *file); 19extern void ima_file_free(struct file *file);
22extern int ima_file_mmap(struct file *file, unsigned long prot); 20extern int ima_file_mmap(struct file *file, unsigned long prot);
@@ -27,16 +25,6 @@ static inline int ima_bprm_check(struct linux_binprm *bprm)
27 return 0; 25 return 0;
28} 26}
29 27
30static inline int ima_inode_alloc(struct inode *inode)
31{
32 return 0;
33}
34
35static inline void ima_inode_free(struct inode *inode)
36{
37 return;
38}
39
40static inline int ima_file_check(struct file *file, int mask) 28static inline int ima_file_check(struct file *file, int mask)
41{ 29{
42 return 0; 30 return 0;
@@ -51,6 +39,5 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot)
51{ 39{
52 return 0; 40 return 0;
53} 41}
54
55#endif /* CONFIG_IMA_H */ 42#endif /* CONFIG_IMA_H */
56#endif /* _LINUX_IMA_H */ 43#endif /* _LINUX_IMA_H */
diff --git a/include/linux/in.h b/include/linux/in.h
index beeb6dee2b49..01129c0ea87c 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -182,7 +182,7 @@ struct in_pktinfo {
182/* Structure describing an Internet (IP) socket address. */ 182/* Structure describing an Internet (IP) socket address. */
183#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ 183#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
184struct sockaddr_in { 184struct sockaddr_in {
185 sa_family_t sin_family; /* Address family */ 185 __kernel_sa_family_t sin_family; /* Address family */
186 __be16 sin_port; /* Port number */ 186 __be16 sin_port; /* Port number */
187 struct in_addr sin_addr; /* Internet address */ 187 struct in_addr sin_addr; /* Internet address */
188 188
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index bc8c49022084..80b480c97532 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -97,9 +97,10 @@ enum {
97 INET_DIAG_INFO, 97 INET_DIAG_INFO,
98 INET_DIAG_VEGASINFO, 98 INET_DIAG_VEGASINFO,
99 INET_DIAG_CONG, 99 INET_DIAG_CONG,
100 INET_DIAG_TOS,
100}; 101};
101 102
102#define INET_DIAG_MAX INET_DIAG_CONG 103#define INET_DIAG_MAX INET_DIAG_TOS
103 104
104 105
105/* INET_DIAG_MEM */ 106/* INET_DIAG_MEM */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d14e058aaeed..08ffab01e76c 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -42,7 +42,7 @@ extern struct fs_struct init_fs;
42 .cputimer = { \ 42 .cputimer = { \
43 .cputime = INIT_CPUTIME, \ 43 .cputime = INIT_CPUTIME, \
44 .running = 0, \ 44 .running = 0, \
45 .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ 45 .lock = __RAW_SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \
46 }, \ 46 }, \
47 .cred_guard_mutex = \ 47 .cred_guard_mutex = \
48 __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ 48 __MUTEX_INITIALIZER(sig.cred_guard_mutex), \
diff --git a/include/linux/input.h b/include/linux/input.h
index a637e7814334..3862e32c4eeb 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -505,6 +505,7 @@ struct input_keymap_entry {
505#define BTN_TOOL_FINGER 0x145 505#define BTN_TOOL_FINGER 0x145
506#define BTN_TOOL_MOUSE 0x146 506#define BTN_TOOL_MOUSE 0x146
507#define BTN_TOOL_LENS 0x147 507#define BTN_TOOL_LENS 0x147
508#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */
508#define BTN_TOUCH 0x14a 509#define BTN_TOUCH 0x14a
509#define BTN_STYLUS 0x14b 510#define BTN_STYLUS 0x14b
510#define BTN_STYLUS2 0x14c 511#define BTN_STYLUS2 0x14c
@@ -814,6 +815,7 @@ struct input_keymap_entry {
814#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ 815#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */
815#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ 816#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */
816#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ 817#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */
818#define SW_LINEIN_INSERT 0x0d /* set = inserted */
817#define SW_MAX 0x0f 819#define SW_MAX 0x0f
818#define SW_CNT (SW_MAX+1) 820#define SW_CNT (SW_MAX+1)
819 821
@@ -1609,7 +1611,7 @@ struct ff_device {
1609 struct file *effect_owners[]; 1611 struct file *effect_owners[];
1610}; 1612};
1611 1613
1612int input_ff_create(struct input_dev *dev, int max_effects); 1614int input_ff_create(struct input_dev *dev, unsigned int max_effects);
1613void input_ff_destroy(struct input_dev *dev); 1615void input_ff_destroy(struct input_dev *dev);
1614 1616
1615int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); 1617int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
diff --git a/include/linux/input/adp5589.h b/include/linux/input/adp5589.h
index ef792ecfaabf..1a05eee15e67 100644
--- a/include/linux/input/adp5589.h
+++ b/include/linux/input/adp5589.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Analog Devices ADP5589 I/O Expander and QWERTY Keypad Controller 2 * Analog Devices ADP5589/ADP5585 I/O Expander and QWERTY Keypad Controller
3 * 3 *
4 * Copyright 2010-2011 Analog Devices Inc. 4 * Copyright 2010-2011 Analog Devices Inc.
5 * 5 *
@@ -9,89 +9,9 @@
9#ifndef _ADP5589_H 9#ifndef _ADP5589_H
10#define _ADP5589_H 10#define _ADP5589_H
11 11
12#define ADP5589_ID 0x00 12/*
13#define ADP5589_INT_STATUS 0x01 13 * ADP5589 specific GPI and Keymap defines
14#define ADP5589_STATUS 0x02 14 */
15#define ADP5589_FIFO_1 0x03
16#define ADP5589_FIFO_2 0x04
17#define ADP5589_FIFO_3 0x05
18#define ADP5589_FIFO_4 0x06
19#define ADP5589_FIFO_5 0x07
20#define ADP5589_FIFO_6 0x08
21#define ADP5589_FIFO_7 0x09
22#define ADP5589_FIFO_8 0x0A
23#define ADP5589_FIFO_9 0x0B
24#define ADP5589_FIFO_10 0x0C
25#define ADP5589_FIFO_11 0x0D
26#define ADP5589_FIFO_12 0x0E
27#define ADP5589_FIFO_13 0x0F
28#define ADP5589_FIFO_14 0x10
29#define ADP5589_FIFO_15 0x11
30#define ADP5589_FIFO_16 0x12
31#define ADP5589_GPI_INT_STAT_A 0x13
32#define ADP5589_GPI_INT_STAT_B 0x14
33#define ADP5589_GPI_INT_STAT_C 0x15
34#define ADP5589_GPI_STATUS_A 0x16
35#define ADP5589_GPI_STATUS_B 0x17
36#define ADP5589_GPI_STATUS_C 0x18
37#define ADP5589_RPULL_CONFIG_A 0x19
38#define ADP5589_RPULL_CONFIG_B 0x1A
39#define ADP5589_RPULL_CONFIG_C 0x1B
40#define ADP5589_RPULL_CONFIG_D 0x1C
41#define ADP5589_RPULL_CONFIG_E 0x1D
42#define ADP5589_GPI_INT_LEVEL_A 0x1E
43#define ADP5589_GPI_INT_LEVEL_B 0x1F
44#define ADP5589_GPI_INT_LEVEL_C 0x20
45#define ADP5589_GPI_EVENT_EN_A 0x21
46#define ADP5589_GPI_EVENT_EN_B 0x22
47#define ADP5589_GPI_EVENT_EN_C 0x23
48#define ADP5589_GPI_INTERRUPT_EN_A 0x24
49#define ADP5589_GPI_INTERRUPT_EN_B 0x25
50#define ADP5589_GPI_INTERRUPT_EN_C 0x26
51#define ADP5589_DEBOUNCE_DIS_A 0x27
52#define ADP5589_DEBOUNCE_DIS_B 0x28
53#define ADP5589_DEBOUNCE_DIS_C 0x29
54#define ADP5589_GPO_DATA_OUT_A 0x2A
55#define ADP5589_GPO_DATA_OUT_B 0x2B
56#define ADP5589_GPO_DATA_OUT_C 0x2C
57#define ADP5589_GPO_OUT_MODE_A 0x2D
58#define ADP5589_GPO_OUT_MODE_B 0x2E
59#define ADP5589_GPO_OUT_MODE_C 0x2F
60#define ADP5589_GPIO_DIRECTION_A 0x30
61#define ADP5589_GPIO_DIRECTION_B 0x31
62#define ADP5589_GPIO_DIRECTION_C 0x32
63#define ADP5589_UNLOCK1 0x33
64#define ADP5589_UNLOCK2 0x34
65#define ADP5589_EXT_LOCK_EVENT 0x35
66#define ADP5589_UNLOCK_TIMERS 0x36
67#define ADP5589_LOCK_CFG 0x37
68#define ADP5589_RESET1_EVENT_A 0x38
69#define ADP5589_RESET1_EVENT_B 0x39
70#define ADP5589_RESET1_EVENT_C 0x3A
71#define ADP5589_RESET2_EVENT_A 0x3B
72#define ADP5589_RESET2_EVENT_B 0x3C
73#define ADP5589_RESET_CFG 0x3D
74#define ADP5589_PWM_OFFT_LOW 0x3E
75#define ADP5589_PWM_OFFT_HIGH 0x3F
76#define ADP5589_PWM_ONT_LOW 0x40
77#define ADP5589_PWM_ONT_HIGH 0x41
78#define ADP5589_PWM_CFG 0x42
79#define ADP5589_CLOCK_DIV_CFG 0x43
80#define ADP5589_LOGIC_1_CFG 0x44
81#define ADP5589_LOGIC_2_CFG 0x45
82#define ADP5589_LOGIC_FF_CFG 0x46
83#define ADP5589_LOGIC_INT_EVENT_EN 0x47
84#define ADP5589_POLL_PTIME_CFG 0x48
85#define ADP5589_PIN_CONFIG_A 0x49
86#define ADP5589_PIN_CONFIG_B 0x4A
87#define ADP5589_PIN_CONFIG_C 0x4B
88#define ADP5589_PIN_CONFIG_D 0x4C
89#define ADP5589_GENERAL_CFG 0x4D
90#define ADP5589_INT_EN 0x4E
91
92#define ADP5589_DEVICE_ID_MASK 0xF
93
94/* Put one of these structures in i2c_board_info platform_data */
95 15
96#define ADP5589_KEYMAPSIZE 88 16#define ADP5589_KEYMAPSIZE 88
97 17
@@ -127,6 +47,35 @@
127 47
128#define ADP5589_GPIMAPSIZE_MAX (ADP5589_GPI_PIN_END - ADP5589_GPI_PIN_BASE + 1) 48#define ADP5589_GPIMAPSIZE_MAX (ADP5589_GPI_PIN_END - ADP5589_GPI_PIN_BASE + 1)
129 49
50/*
51 * ADP5585 specific GPI and Keymap defines
52 */
53
54#define ADP5585_KEYMAPSIZE 30
55
56#define ADP5585_GPI_PIN_ROW0 37
57#define ADP5585_GPI_PIN_ROW1 38
58#define ADP5585_GPI_PIN_ROW2 39
59#define ADP5585_GPI_PIN_ROW3 40
60#define ADP5585_GPI_PIN_ROW4 41
61#define ADP5585_GPI_PIN_ROW5 42
62#define ADP5585_GPI_PIN_COL0 43
63#define ADP5585_GPI_PIN_COL1 44
64#define ADP5585_GPI_PIN_COL2 45
65#define ADP5585_GPI_PIN_COL3 46
66#define ADP5585_GPI_PIN_COL4 47
67#define GPI_LOGIC 48
68
69#define ADP5585_GPI_PIN_ROW_BASE ADP5585_GPI_PIN_ROW0
70#define ADP5585_GPI_PIN_ROW_END ADP5585_GPI_PIN_ROW5
71#define ADP5585_GPI_PIN_COL_BASE ADP5585_GPI_PIN_COL0
72#define ADP5585_GPI_PIN_COL_END ADP5585_GPI_PIN_COL4
73
74#define ADP5585_GPI_PIN_BASE ADP5585_GPI_PIN_ROW_BASE
75#define ADP5585_GPI_PIN_END ADP5585_GPI_PIN_COL_END
76
77#define ADP5585_GPIMAPSIZE_MAX (ADP5585_GPI_PIN_END - ADP5585_GPI_PIN_BASE + 1)
78
130struct adp5589_gpi_map { 79struct adp5589_gpi_map {
131 unsigned short pin; 80 unsigned short pin;
132 unsigned short sw_evt; 81 unsigned short sw_evt;
@@ -159,7 +108,7 @@ struct adp5589_gpi_map {
159#define RESET2_POL_HIGH (1 << 7) 108#define RESET2_POL_HIGH (1 << 7)
160#define RESET2_POL_LOW (0 << 7) 109#define RESET2_POL_LOW (0 << 7)
161 110
162/* Mask Bits: 111/* ADP5589 Mask Bits:
163 * C C C C C C C C C C C | R R R R R R R R 112 * C C C C C C C C C C C | R R R R R R R R
164 * 1 9 8 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 113 * 1 9 8 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0
165 * 0 114 * 0
@@ -168,18 +117,44 @@ struct adp5589_gpi_map {
168 * 8 7 6 5 4 3 2 1 0 9 8 | 7 6 5 4 3 2 1 0 117 * 8 7 6 5 4 3 2 1 0 9 8 | 7 6 5 4 3 2 1 0
169 */ 118 */
170 119
171#define ADP_ROW(x) (1 << (x)) 120#define ADP_ROW(x) (1 << (x))
172#define ADP_COL(x) (1 << (x + 8)) 121#define ADP_COL(x) (1 << (x + 8))
122#define ADP5589_ROW_MASK 0xFF
123#define ADP5589_COL_MASK 0xFF
124#define ADP5589_COL_SHIFT 8
125#define ADP5589_MAX_ROW_NUM 7
126#define ADP5589_MAX_COL_NUM 10
127
128/* ADP5585 Mask Bits:
129 * C C C C C | R R R R R R
130 * 4 3 2 1 0 | 5 4 3 2 1 0
131 *
132 * ---- BIT -- -----------
133 * 1 0 0 0 0 | 0 0 0 0 0 0
134 * 0 9 8 7 6 | 5 4 3 2 1 0
135 */
136
137#define ADP5585_ROW_MASK 0x3F
138#define ADP5585_COL_MASK 0x1F
139#define ADP5585_ROW_SHIFT 0
140#define ADP5585_COL_SHIFT 6
141#define ADP5585_MAX_ROW_NUM 5
142#define ADP5585_MAX_COL_NUM 4
143
144#define ADP5585_ROW(x) (1 << ((x) & ADP5585_ROW_MASK))
145#define ADP5585_COL(x) (1 << (((x) & ADP5585_COL_MASK) + ADP5585_COL_SHIFT))
146
147/* Put one of these structures in i2c_board_info platform_data */
173 148
174struct adp5589_kpad_platform_data { 149struct adp5589_kpad_platform_data {
175 unsigned keypad_en_mask; /* Keypad (Rows/Columns) enable mask */ 150 unsigned keypad_en_mask; /* Keypad (Rows/Columns) enable mask */
176 const unsigned short *keymap; /* Pointer to keymap */ 151 const unsigned short *keymap; /* Pointer to keymap */
177 unsigned short keymapsize; /* Keymap size */ 152 unsigned short keymapsize; /* Keymap size */
178 bool repeat; /* Enable key repeat */ 153 bool repeat; /* Enable key repeat */
179 bool en_keylock; /* Enable key lock feature */ 154 bool en_keylock; /* Enable key lock feature (ADP5589 only)*/
180 unsigned char unlock_key1; /* Unlock Key 1 */ 155 unsigned char unlock_key1; /* Unlock Key 1 (ADP5589 only) */
181 unsigned char unlock_key2; /* Unlock Key 2 */ 156 unsigned char unlock_key2; /* Unlock Key 2 (ADP5589 only) */
182 unsigned char unlock_timer; /* Time in seconds [0..7] between the two unlock keys 0=disable */ 157 unsigned char unlock_timer; /* Time in seconds [0..7] between the two unlock keys 0=disable (ADP5589 only) */
183 unsigned char scan_cycle_time; /* Time between consecutive scan cycles */ 158 unsigned char scan_cycle_time; /* Time between consecutive scan cycles */
184 unsigned char reset_cfg; /* Reset config */ 159 unsigned char reset_cfg; /* Reset config */
185 unsigned short reset1_key_1; /* Reset Key 1 */ 160 unsigned short reset1_key_1; /* Reset Key 1 */
diff --git a/include/linux/input/adxl34x.h b/include/linux/input/adxl34x.h
index df00d998a44a..57e01a7cb006 100644
--- a/include/linux/input/adxl34x.h
+++ b/include/linux/input/adxl34x.h
@@ -30,8 +30,9 @@ struct adxl34x_platform_data {
30 * Y, or Z participation in Tap detection. A '0' excludes the 30 * Y, or Z participation in Tap detection. A '0' excludes the
31 * selected axis from participation in Tap detection. 31 * selected axis from participation in Tap detection.
32 * Setting the SUPPRESS bit suppresses Double Tap detection if 32 * Setting the SUPPRESS bit suppresses Double Tap detection if
33 * acceleration greater than tap_threshold is present between 33 * acceleration greater than tap_threshold is present during the
34 * taps. 34 * tap_latency period, i.e. after the first tap but before the
35 * opening of the second tap window.
35 */ 36 */
36 37
37#define ADXL_SUPPRESS (1 << 3) 38#define ADXL_SUPPRESS (1 << 3)
@@ -226,13 +227,13 @@ struct adxl34x_platform_data {
226 * detection will begin and prevent the detection of activity. This 227 * detection will begin and prevent the detection of activity. This
227 * bit serially links the activity and inactivity functions. When '0' 228 * bit serially links the activity and inactivity functions. When '0'
228 * the inactivity and activity functions are concurrent. Additional 229 * the inactivity and activity functions are concurrent. Additional
229 * information can be found in the Application section under Link 230 * information can be found in the ADXL34x datasheet's Application
230 * Mode. 231 * section under Link Mode.
231 * AUTO_SLEEP: A '1' sets the ADXL34x to switch to Sleep Mode 232 * AUTO_SLEEP: A '1' sets the ADXL34x to switch to Sleep Mode
232 * when inactivity (acceleration has been below inactivity_threshold 233 * when inactivity (acceleration has been below inactivity_threshold
233 * for at least inactivity_time) is detected and the LINK bit is set. 234 * for at least inactivity_time) is detected and the LINK bit is set.
234 * A '0' disables automatic switching to Sleep Mode. See SLEEP 235 * A '0' disables automatic switching to Sleep Mode. See the
235 * for further description. 236 * Sleep Bit section of the ADXL34x datasheet for more information.
236 */ 237 */
237 238
238#define ADXL_LINK (1 << 5) 239#define ADXL_LINK (1 << 5)
@@ -266,6 +267,12 @@ struct adxl34x_platform_data {
266 267
267 u8 watermark; 268 u8 watermark;
268 269
270 /*
271 * When acceleration measurements are received from the ADXL34x
272 * events are sent to the event subsystem. The following settings
273 * select the event type and event code for new x, y and z axis data
274 * respectively.
275 */
269 u32 ev_type; /* EV_ABS or EV_REL */ 276 u32 ev_type; /* EV_ABS or EV_REL */
270 277
271 u32 ev_code_x; /* ABS_X,Y,Z or REL_X,Y,Z */ 278 u32 ev_code_x; /* ABS_X,Y,Z or REL_X,Y,Z */
@@ -289,7 +296,7 @@ struct adxl34x_platform_data {
289 u32 ev_code_act_inactivity; /* EV_KEY */ 296 u32 ev_code_act_inactivity; /* EV_KEY */
290 297
291 /* 298 /*
292 * Use ADXL34x INT2 instead of INT1 299 * Use ADXL34x INT2 pin instead of INT1 pin for interrupt output
293 */ 300 */
294 u8 use_int2; 301 u8 use_int2;
295 302
diff --git a/include/linux/integrity.h b/include/linux/integrity.h
new file mode 100644
index 000000000000..a0c41256cb92
--- /dev/null
+++ b/include/linux/integrity.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2009 IBM Corporation
3 * Author: Mimi Zohar <zohar@us.ibm.com>
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, version 2 of the License.
8 */
9
10#ifndef _LINUX_INTEGRITY_H
11#define _LINUX_INTEGRITY_H
12
13#include <linux/fs.h>
14
15enum integrity_status {
16 INTEGRITY_PASS = 0,
17 INTEGRITY_FAIL,
18 INTEGRITY_NOLABEL,
19 INTEGRITY_NOXATTRS,
20 INTEGRITY_UNKNOWN,
21};
22
23/* List of EVM protected security xattrs */
24#ifdef CONFIG_INTEGRITY
25extern int integrity_inode_alloc(struct inode *inode);
26extern void integrity_inode_free(struct inode *inode);
27
28#else
29static inline int integrity_inode_alloc(struct inode *inode)
30{
31 return 0;
32}
33
34static inline void integrity_inode_free(struct inode *inode)
35{
36 return;
37}
38#endif /* CONFIG_INTEGRITY_H */
39#endif /* _LINUX_INTEGRITY_H */
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 9310c699a37d..e6ca56de9936 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -271,7 +271,7 @@ struct qi_desc {
271}; 271};
272 272
273struct q_inval { 273struct q_inval {
274 spinlock_t q_lock; 274 raw_spinlock_t q_lock;
275 struct qi_desc *desc; /* invalidation queue */ 275 struct qi_desc *desc; /* invalidation queue */
276 int *desc_status; /* desc status */ 276 int *desc_status; /* desc status */
277 int free_head; /* first free entry */ 277 int free_head; /* first free entry */
@@ -279,7 +279,7 @@ struct q_inval {
279 int free_cnt; 279 int free_cnt;
280}; 280};
281 281
282#ifdef CONFIG_INTR_REMAP 282#ifdef CONFIG_IRQ_REMAP
283/* 1MB - maximum possible interrupt remapping table size */ 283/* 1MB - maximum possible interrupt remapping table size */
284#define INTR_REMAP_PAGE_ORDER 8 284#define INTR_REMAP_PAGE_ORDER 8
285#define INTR_REMAP_TABLE_REG_SIZE 0xf 285#define INTR_REMAP_TABLE_REG_SIZE 0xf
@@ -311,14 +311,14 @@ struct intel_iommu {
311 u64 cap; 311 u64 cap;
312 u64 ecap; 312 u64 ecap;
313 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ 313 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */
314 spinlock_t register_lock; /* protect register handling */ 314 raw_spinlock_t register_lock; /* protect register handling */
315 int seq_id; /* sequence id of the iommu */ 315 int seq_id; /* sequence id of the iommu */
316 int agaw; /* agaw of this iommu */ 316 int agaw; /* agaw of this iommu */
317 int msagaw; /* max sagaw of this iommu */ 317 int msagaw; /* max sagaw of this iommu */
318 unsigned int irq; 318 unsigned int irq;
319 unsigned char name[13]; /* Device Name */ 319 unsigned char name[13]; /* Device Name */
320 320
321#ifdef CONFIG_DMAR 321#ifdef CONFIG_INTEL_IOMMU
322 unsigned long *domain_ids; /* bitmap of domains */ 322 unsigned long *domain_ids; /* bitmap of domains */
323 struct dmar_domain **domains; /* ptr to domains */ 323 struct dmar_domain **domains; /* ptr to domains */
324 spinlock_t lock; /* protect context, domain ids */ 324 spinlock_t lock; /* protect context, domain ids */
@@ -329,7 +329,7 @@ struct intel_iommu {
329 struct q_inval *qi; /* Queued invalidation info */ 329 struct q_inval *qi; /* Queued invalidation info */
330 u32 *iommu_state; /* Store iommu states between suspend and resume.*/ 330 u32 *iommu_state; /* Store iommu states between suspend and resume.*/
331 331
332#ifdef CONFIG_INTR_REMAP 332#ifdef CONFIG_IRQ_REMAP
333 struct ir_table *ir_table; /* Interrupt remapping info */ 333 struct ir_table *ir_table; /* Interrupt remapping info */
334#endif 334#endif
335 int node; 335 int node;
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index a103732b7588..a64b00e286f5 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -59,6 +59,8 @@
59 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend 59 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
60 * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set 60 * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
61 * IRQF_NO_THREAD - Interrupt cannot be threaded 61 * IRQF_NO_THREAD - Interrupt cannot be threaded
62 * IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device
63 * resume time.
62 */ 64 */
63#define IRQF_DISABLED 0x00000020 65#define IRQF_DISABLED 0x00000020
64#define IRQF_SAMPLE_RANDOM 0x00000040 66#define IRQF_SAMPLE_RANDOM 0x00000040
@@ -72,6 +74,7 @@
72#define IRQF_NO_SUSPEND 0x00004000 74#define IRQF_NO_SUSPEND 0x00004000
73#define IRQF_FORCE_RESUME 0x00008000 75#define IRQF_FORCE_RESUME 0x00008000
74#define IRQF_NO_THREAD 0x00010000 76#define IRQF_NO_THREAD 0x00010000
77#define IRQF_EARLY_RESUME 0x00020000
75 78
76#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) 79#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
77 80
@@ -95,6 +98,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
95 * @flags: flags (see IRQF_* above) 98 * @flags: flags (see IRQF_* above)
96 * @name: name of the device 99 * @name: name of the device
97 * @dev_id: cookie to identify the device 100 * @dev_id: cookie to identify the device
101 * @percpu_dev_id: cookie to identify the device
98 * @next: pointer to the next irqaction for shared interrupts 102 * @next: pointer to the next irqaction for shared interrupts
99 * @irq: interrupt number 103 * @irq: interrupt number
100 * @dir: pointer to the proc/irq/NN/name entry 104 * @dir: pointer to the proc/irq/NN/name entry
@@ -104,17 +108,18 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
104 * @thread_mask: bitmask for keeping track of @thread activity 108 * @thread_mask: bitmask for keeping track of @thread activity
105 */ 109 */
106struct irqaction { 110struct irqaction {
107 irq_handler_t handler; 111 irq_handler_t handler;
108 unsigned long flags; 112 unsigned long flags;
109 void *dev_id; 113 void *dev_id;
110 struct irqaction *next; 114 void __percpu *percpu_dev_id;
111 int irq; 115 struct irqaction *next;
112 irq_handler_t thread_fn; 116 int irq;
113 struct task_struct *thread; 117 irq_handler_t thread_fn;
114 unsigned long thread_flags; 118 struct task_struct *thread;
115 unsigned long thread_mask; 119 unsigned long thread_flags;
116 const char *name; 120 unsigned long thread_mask;
117 struct proc_dir_entry *dir; 121 const char *name;
122 struct proc_dir_entry *dir;
118} ____cacheline_internodealigned_in_smp; 123} ____cacheline_internodealigned_in_smp;
119 124
120extern irqreturn_t no_action(int cpl, void *dev_id); 125extern irqreturn_t no_action(int cpl, void *dev_id);
@@ -136,6 +141,10 @@ extern int __must_check
136request_any_context_irq(unsigned int irq, irq_handler_t handler, 141request_any_context_irq(unsigned int irq, irq_handler_t handler,
137 unsigned long flags, const char *name, void *dev_id); 142 unsigned long flags, const char *name, void *dev_id);
138 143
144extern int __must_check
145request_percpu_irq(unsigned int irq, irq_handler_t handler,
146 const char *devname, void __percpu *percpu_dev_id);
147
139extern void exit_irq_thread(void); 148extern void exit_irq_thread(void);
140#else 149#else
141 150
@@ -164,10 +173,18 @@ request_any_context_irq(unsigned int irq, irq_handler_t handler,
164 return request_irq(irq, handler, flags, name, dev_id); 173 return request_irq(irq, handler, flags, name, dev_id);
165} 174}
166 175
176static inline int __must_check
177request_percpu_irq(unsigned int irq, irq_handler_t handler,
178 const char *devname, void __percpu *percpu_dev_id)
179{
180 return request_irq(irq, handler, 0, devname, percpu_dev_id);
181}
182
167static inline void exit_irq_thread(void) { } 183static inline void exit_irq_thread(void) { }
168#endif 184#endif
169 185
170extern void free_irq(unsigned int, void *); 186extern void free_irq(unsigned int, void *);
187extern void free_percpu_irq(unsigned int, void __percpu *);
171 188
172struct device; 189struct device;
173 190
@@ -207,7 +224,9 @@ extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
207 224
208extern void disable_irq_nosync(unsigned int irq); 225extern void disable_irq_nosync(unsigned int irq);
209extern void disable_irq(unsigned int irq); 226extern void disable_irq(unsigned int irq);
227extern void disable_percpu_irq(unsigned int irq);
210extern void enable_irq(unsigned int irq); 228extern void enable_irq(unsigned int irq);
229extern void enable_percpu_irq(unsigned int irq, unsigned int type);
211 230
212/* The following three functions are for the core kernel use only. */ 231/* The following three functions are for the core kernel use only. */
213#ifdef CONFIG_GENERIC_HARDIRQS 232#ifdef CONFIG_GENERIC_HARDIRQS
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index 8cdcc2a199ad..e44e84f0156c 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -27,7 +27,7 @@
27 * The io_mapping mechanism provides an abstraction for mapping 27 * The io_mapping mechanism provides an abstraction for mapping
28 * individual pages from an io device to the CPU in an efficient fashion. 28 * individual pages from an io device to the CPU in an efficient fashion.
29 * 29 *
30 * See Documentation/io_mapping.txt 30 * See Documentation/io-mapping.txt
31 */ 31 */
32 32
33#ifdef CONFIG_HAVE_ATOMIC_IOMAP 33#ifdef CONFIG_HAVE_ATOMIC_IOMAP
@@ -117,6 +117,8 @@ io_mapping_unmap(void __iomem *vaddr)
117 117
118#else 118#else
119 119
120#include <linux/uaccess.h>
121
120/* this struct isn't actually defined anywhere */ 122/* this struct isn't actually defined anywhere */
121struct io_mapping; 123struct io_mapping;
122 124
@@ -138,12 +140,14 @@ static inline void __iomem *
138io_mapping_map_atomic_wc(struct io_mapping *mapping, 140io_mapping_map_atomic_wc(struct io_mapping *mapping,
139 unsigned long offset) 141 unsigned long offset)
140{ 142{
143 pagefault_disable();
141 return ((char __force __iomem *) mapping) + offset; 144 return ((char __force __iomem *) mapping) + offset;
142} 145}
143 146
144static inline void 147static inline void
145io_mapping_unmap_atomic(void __iomem *vaddr) 148io_mapping_unmap_atomic(void __iomem *vaddr)
146{ 149{
150 pagefault_enable();
147} 151}
148 152
149/* Non-atomic map/unmap */ 153/* Non-atomic map/unmap */
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 9940319d6f9d..432acc4c054d 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -25,15 +25,29 @@
25#define IOMMU_WRITE (2) 25#define IOMMU_WRITE (2)
26#define IOMMU_CACHE (4) /* DMA cache coherency */ 26#define IOMMU_CACHE (4) /* DMA cache coherency */
27 27
28struct iommu_ops;
29struct bus_type;
28struct device; 30struct device;
31struct iommu_domain;
32
33/* iommu fault flags */
34#define IOMMU_FAULT_READ 0x0
35#define IOMMU_FAULT_WRITE 0x1
36
37typedef int (*iommu_fault_handler_t)(struct iommu_domain *,
38 struct device *, unsigned long, int);
29 39
30struct iommu_domain { 40struct iommu_domain {
41 struct iommu_ops *ops;
31 void *priv; 42 void *priv;
43 iommu_fault_handler_t handler;
32}; 44};
33 45
34#define IOMMU_CAP_CACHE_COHERENCY 0x1 46#define IOMMU_CAP_CACHE_COHERENCY 0x1
35#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ 47#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
36 48
49#ifdef CONFIG_IOMMU_API
50
37struct iommu_ops { 51struct iommu_ops {
38 int (*domain_init)(struct iommu_domain *domain); 52 int (*domain_init)(struct iommu_domain *domain);
39 void (*domain_destroy)(struct iommu_domain *domain); 53 void (*domain_destroy)(struct iommu_domain *domain);
@@ -49,11 +63,9 @@ struct iommu_ops {
49 unsigned long cap); 63 unsigned long cap);
50}; 64};
51 65
52#ifdef CONFIG_IOMMU_API 66extern int bus_set_iommu(struct bus_type *bus, struct iommu_ops *ops);
53 67extern bool iommu_present(struct bus_type *bus);
54extern void register_iommu(struct iommu_ops *ops); 68extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
55extern bool iommu_found(void);
56extern struct iommu_domain *iommu_domain_alloc(void);
57extern void iommu_domain_free(struct iommu_domain *domain); 69extern void iommu_domain_free(struct iommu_domain *domain);
58extern int iommu_attach_device(struct iommu_domain *domain, 70extern int iommu_attach_device(struct iommu_domain *domain,
59 struct device *dev); 71 struct device *dev);
@@ -67,19 +79,58 @@ extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
67 unsigned long iova); 79 unsigned long iova);
68extern int iommu_domain_has_cap(struct iommu_domain *domain, 80extern int iommu_domain_has_cap(struct iommu_domain *domain,
69 unsigned long cap); 81 unsigned long cap);
82extern void iommu_set_fault_handler(struct iommu_domain *domain,
83 iommu_fault_handler_t handler);
84
85/**
86 * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework
87 * @domain: the iommu domain where the fault has happened
88 * @dev: the device where the fault has happened
89 * @iova: the faulting address
90 * @flags: mmu fault flags (e.g. IOMMU_FAULT_READ/IOMMU_FAULT_WRITE/...)
91 *
92 * This function should be called by the low-level IOMMU implementations
93 * whenever IOMMU faults happen, to allow high-level users, that are
94 * interested in such events, to know about them.
95 *
96 * This event may be useful for several possible use cases:
97 * - mere logging of the event
98 * - dynamic TLB/PTE loading
99 * - if restarting of the faulting device is required
100 *
101 * Returns 0 on success and an appropriate error code otherwise (if dynamic
102 * PTE/TLB loading will one day be supported, implementations will be able
103 * to tell whether it succeeded or not according to this return value).
104 *
105 * Specifically, -ENOSYS is returned if a fault handler isn't installed
106 * (though fault handlers can also return -ENOSYS, in case they want to
107 * elicit the default behavior of the IOMMU drivers).
108 */
109static inline int report_iommu_fault(struct iommu_domain *domain,
110 struct device *dev, unsigned long iova, int flags)
111{
112 int ret = -ENOSYS;
70 113
71#else /* CONFIG_IOMMU_API */ 114 /*
115 * if upper layers showed interest and installed a fault handler,
116 * invoke it.
117 */
118 if (domain->handler)
119 ret = domain->handler(domain, dev, iova, flags);
72 120
73static inline void register_iommu(struct iommu_ops *ops) 121 return ret;
74{
75} 122}
76 123
77static inline bool iommu_found(void) 124#else /* CONFIG_IOMMU_API */
125
126struct iommu_ops {};
127
128static inline bool iommu_present(struct bus_type *bus)
78{ 129{
79 return false; 130 return false;
80} 131}
81 132
82static inline struct iommu_domain *iommu_domain_alloc(void) 133static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
83{ 134{
84 return NULL; 135 return NULL;
85} 136}
@@ -123,6 +174,11 @@ static inline int domain_has_cap(struct iommu_domain *domain,
123 return 0; 174 return 0;
124} 175}
125 176
177static inline void iommu_set_fault_handler(struct iommu_domain *domain,
178 iommu_fault_handler_t handler)
179{
180}
181
126#endif /* CONFIG_IOMMU_API */ 182#endif /* CONFIG_IOMMU_API */
127 183
128#endif /* __LINUX_IOMMU_H */ 184#endif /* __LINUX_IOMMU_H */
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h
index acb9ad684d63..bf22b0317902 100644
--- a/include/linux/ip6_tunnel.h
+++ b/include/linux/ip6_tunnel.h
@@ -16,6 +16,8 @@
16#define IP6_TNL_F_MIP6_DEV 0x8 16#define IP6_TNL_F_MIP6_DEV 0x8
17/* copy DSCP from the outer packet */ 17/* copy DSCP from the outer packet */
18#define IP6_TNL_F_RCV_DSCP_COPY 0x10 18#define IP6_TNL_F_RCV_DSCP_COPY 0x10
19/* copy fwmark from inner packet */
20#define IP6_TNL_F_USE_ORIG_FWMARK 0x20
19 21
20struct ip6_tnl_parm { 22struct ip6_tnl_parm {
21 char name[IFNAMSIZ]; /* name of tunnel device */ 23 char name[IFNAMSIZ]; /* name of tunnel device */
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index ca85cf894e33..bbd156bb953b 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -220,10 +220,11 @@ struct kernel_ipmi_msg {
220 * The in-kernel interface. 220 * The in-kernel interface.
221 */ 221 */
222#include <linux/list.h> 222#include <linux/list.h>
223#include <linux/module.h>
224#include <linux/device.h> 223#include <linux/device.h>
225#include <linux/proc_fs.h> 224#include <linux/proc_fs.h>
226 225
226struct module;
227
227/* Opaque type for a IPMI message user. One of these is needed to 228/* Opaque type for a IPMI message user. One of these is needed to
228 send and receive messages. */ 229 send and receive messages. */
229typedef struct ipmi_user *ipmi_user_t; 230typedef struct ipmi_user *ipmi_user_t;
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 204f9cd26c16..3ef0d8b6aa6f 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -36,7 +36,6 @@
36 36
37#include <linux/ipmi_msgdefs.h> 37#include <linux/ipmi_msgdefs.h>
38#include <linux/proc_fs.h> 38#include <linux/proc_fs.h>
39#include <linux/module.h>
40#include <linux/device.h> 39#include <linux/device.h>
41#include <linux/platform_device.h> 40#include <linux/platform_device.h>
42#include <linux/ipmi.h> 41#include <linux/ipmi.h>
diff --git a/include/linux/ipx.h b/include/linux/ipx.h
index aabb1d294025..3d48014cdd71 100644
--- a/include/linux/ipx.h
+++ b/include/linux/ipx.h
@@ -7,7 +7,7 @@
7#define IPX_MTU 576 7#define IPX_MTU 576
8 8
9struct sockaddr_ipx { 9struct sockaddr_ipx {
10 sa_family_t sipx_family; 10 __kernel_sa_family_t sipx_family;
11 __be16 sipx_port; 11 __be16 sipx_port;
12 __be32 sipx_network; 12 __be32 sipx_network;
13 unsigned char sipx_node[IPX_NODE_LEN]; 13 unsigned char sipx_node[IPX_NODE_LEN];
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 00bdad0e8515..a014c3252311 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -26,12 +26,9 @@
26#define KERNEL_IRDA_H 26#define KERNEL_IRDA_H
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/socket.h>
29 30
30/* Please do *not* add any #include in this file, this file is 31/* Note that this file is shared with user space. */
31 * included as-is in user space.
32 * Please fix the calling file to properly included needed files before
33 * this one, or preferably to include <net/irda/irda.h> instead.
34 * Jean II */
35 32
36/* Hint bit positions for first hint byte */ 33/* Hint bit positions for first hint byte */
37#define HINT_PNP 0x01 34#define HINT_PNP 0x01
@@ -125,7 +122,7 @@ enum {
125#define LSAP_ANY 0xff 122#define LSAP_ANY 0xff
126 123
127struct sockaddr_irda { 124struct sockaddr_irda {
128 sa_family_t sir_family; /* AF_IRDA */ 125 __kernel_sa_family_t sir_family; /* AF_IRDA */
129 __u8 sir_lsap_sel; /* LSAP selector */ 126 __u8 sir_lsap_sel; /* LSAP selector */
130 __u32 sir_addr; /* Device address */ 127 __u32 sir_addr; /* Device address */
131 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */ 128 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 87a06f345bd2..bff29c58da23 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -29,6 +29,7 @@
29#include <asm/irq_regs.h> 29#include <asm/irq_regs.h>
30 30
31struct seq_file; 31struct seq_file;
32struct module;
32struct irq_desc; 33struct irq_desc;
33struct irq_data; 34struct irq_data;
34typedef void (*irq_flow_handler_t)(unsigned int irq, 35typedef void (*irq_flow_handler_t)(unsigned int irq,
@@ -65,6 +66,7 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data);
65 * IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set) 66 * IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set)
66 * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context 67 * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context
67 * IRQ_NESTED_TRHEAD - Interrupt nests into another thread 68 * IRQ_NESTED_TRHEAD - Interrupt nests into another thread
69 * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable
68 */ 70 */
69enum { 71enum {
70 IRQ_TYPE_NONE = 0x00000000, 72 IRQ_TYPE_NONE = 0x00000000,
@@ -87,12 +89,13 @@ enum {
87 IRQ_MOVE_PCNTXT = (1 << 14), 89 IRQ_MOVE_PCNTXT = (1 << 14),
88 IRQ_NESTED_THREAD = (1 << 15), 90 IRQ_NESTED_THREAD = (1 << 15),
89 IRQ_NOTHREAD = (1 << 16), 91 IRQ_NOTHREAD = (1 << 16),
92 IRQ_PER_CPU_DEVID = (1 << 17),
90}; 93};
91 94
92#define IRQF_MODIFY_MASK \ 95#define IRQF_MODIFY_MASK \
93 (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ 96 (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
94 IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ 97 IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \
95 IRQ_PER_CPU | IRQ_NESTED_THREAD) 98 IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID)
96 99
97#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) 100#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
98 101
@@ -335,12 +338,14 @@ struct irq_chip {
335 * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path 338 * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path
336 * IRQCHIP_ONOFFLINE_ENABLED: Only call irq_on/off_line callbacks 339 * IRQCHIP_ONOFFLINE_ENABLED: Only call irq_on/off_line callbacks
337 * when irq enabled 340 * when irq enabled
341 * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip
338 */ 342 */
339enum { 343enum {
340 IRQCHIP_SET_TYPE_MASKED = (1 << 0), 344 IRQCHIP_SET_TYPE_MASKED = (1 << 0),
341 IRQCHIP_EOI_IF_HANDLED = (1 << 1), 345 IRQCHIP_EOI_IF_HANDLED = (1 << 1),
342 IRQCHIP_MASK_ON_SUSPEND = (1 << 2), 346 IRQCHIP_MASK_ON_SUSPEND = (1 << 2),
343 IRQCHIP_ONOFFLINE_ENABLED = (1 << 3), 347 IRQCHIP_ONOFFLINE_ENABLED = (1 << 3),
348 IRQCHIP_SKIP_SET_WAKE = (1 << 4),
344}; 349};
345 350
346/* This include will go away once we isolated irq_desc usage to core code */ 351/* This include will go away once we isolated irq_desc usage to core code */
@@ -364,6 +369,8 @@ enum {
364struct irqaction; 369struct irqaction;
365extern int setup_irq(unsigned int irq, struct irqaction *new); 370extern int setup_irq(unsigned int irq, struct irqaction *new);
366extern void remove_irq(unsigned int irq, struct irqaction *act); 371extern void remove_irq(unsigned int irq, struct irqaction *act);
372extern int setup_percpu_irq(unsigned int irq, struct irqaction *new);
373extern void remove_percpu_irq(unsigned int irq, struct irqaction *act);
367 374
368extern void irq_cpu_online(void); 375extern void irq_cpu_online(void);
369extern void irq_cpu_offline(void); 376extern void irq_cpu_offline(void);
@@ -391,6 +398,7 @@ extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc);
391extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc); 398extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc);
392extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc); 399extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
393extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc); 400extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
401extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc);
394extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); 402extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
395extern void handle_nested_irq(unsigned int irq); 403extern void handle_nested_irq(unsigned int irq);
396 404
@@ -419,6 +427,8 @@ static inline void irq_set_chip_and_handler(unsigned int irq, struct irq_chip *c
419 irq_set_chip_and_handler_name(irq, chip, handle, NULL); 427 irq_set_chip_and_handler_name(irq, chip, handle, NULL);
420} 428}
421 429
430extern int irq_set_percpu_devid(unsigned int irq);
431
422extern void 432extern void
423__irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, 433__irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
424 const char *name); 434 const char *name);
@@ -480,6 +490,13 @@ static inline void irq_set_nested_thread(unsigned int irq, bool nest)
480 irq_clear_status_flags(irq, IRQ_NESTED_THREAD); 490 irq_clear_status_flags(irq, IRQ_NESTED_THREAD);
481} 491}
482 492
493static inline void irq_set_percpu_devid_flags(unsigned int irq)
494{
495 irq_set_status_flags(irq,
496 IRQ_NOAUTOEN | IRQ_PER_CPU | IRQ_NOTHREAD |
497 IRQ_NOPROBE | IRQ_PER_CPU_DEVID);
498}
499
483/* Handle dynamic irq creation and destruction */ 500/* Handle dynamic irq creation and destruction */
484extern unsigned int create_irq_nr(unsigned int irq_want, int node); 501extern unsigned int create_irq_nr(unsigned int irq_want, int node);
485extern int create_irq(void); 502extern int create_irq(void);
@@ -547,24 +564,24 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
547 return d->msi_desc; 564 return d->msi_desc;
548} 565}
549 566
550int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node); 567int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
551void irq_free_descs(unsigned int irq, unsigned int cnt); 568 struct module *owner);
552int irq_reserve_irqs(unsigned int from, unsigned int cnt);
553 569
554static inline int irq_alloc_desc(int node) 570/* use macros to avoid needing export.h for THIS_MODULE */
555{ 571#define irq_alloc_descs(irq, from, cnt, node) \
556 return irq_alloc_descs(-1, 0, 1, node); 572 __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE)
557}
558 573
559static inline int irq_alloc_desc_at(unsigned int at, int node) 574#define irq_alloc_desc(node) \
560{ 575 irq_alloc_descs(-1, 0, 1, node)
561 return irq_alloc_descs(at, at, 1, node);
562}
563 576
564static inline int irq_alloc_desc_from(unsigned int from, int node) 577#define irq_alloc_desc_at(at, node) \
565{ 578 irq_alloc_descs(at, at, 1, node)
566 return irq_alloc_descs(-1, from, 1, node); 579
567} 580#define irq_alloc_desc_from(from, node) \
581 irq_alloc_descs(-1, from, 1, node)
582
583void irq_free_descs(unsigned int irq, unsigned int cnt);
584int irq_reserve_irqs(unsigned int from, unsigned int cnt);
568 585
569static inline void irq_free_desc(unsigned int irq) 586static inline void irq_free_desc(unsigned int irq)
570{ 587{
diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h
index 4fa09d4d0b71..6a9e8f5399e2 100644
--- a/include/linux/irq_work.h
+++ b/include/linux/irq_work.h
@@ -1,20 +1,23 @@
1#ifndef _LINUX_IRQ_WORK_H 1#ifndef _LINUX_IRQ_WORK_H
2#define _LINUX_IRQ_WORK_H 2#define _LINUX_IRQ_WORK_H
3 3
4#include <linux/llist.h>
5
4struct irq_work { 6struct irq_work {
5 struct irq_work *next; 7 unsigned long flags;
8 struct llist_node llnode;
6 void (*func)(struct irq_work *); 9 void (*func)(struct irq_work *);
7}; 10};
8 11
9static inline 12static inline
10void init_irq_work(struct irq_work *entry, void (*func)(struct irq_work *)) 13void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
11{ 14{
12 entry->next = NULL; 15 work->flags = 0;
13 entry->func = func; 16 work->func = func;
14} 17}
15 18
16bool irq_work_queue(struct irq_work *entry); 19bool irq_work_queue(struct irq_work *work);
17void irq_work_run(void); 20void irq_work_run(void);
18void irq_work_sync(struct irq_work *entry); 21void irq_work_sync(struct irq_work *work);
19 22
20#endif /* _LINUX_IRQ_WORK_H */ 23#endif /* _LINUX_IRQ_WORK_H */
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 2d921b35212c..f1e2527006bd 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -11,6 +11,7 @@
11struct irq_affinity_notify; 11struct irq_affinity_notify;
12struct proc_dir_entry; 12struct proc_dir_entry;
13struct timer_rand_state; 13struct timer_rand_state;
14struct module;
14/** 15/**
15 * struct irq_desc - interrupt descriptor 16 * struct irq_desc - interrupt descriptor
16 * @irq_data: per irq and chip data passed down to chip functions 17 * @irq_data: per irq and chip data passed down to chip functions
@@ -53,6 +54,7 @@ struct irq_desc {
53 unsigned long last_unhandled; /* Aging timer for unhandled count */ 54 unsigned long last_unhandled; /* Aging timer for unhandled count */
54 unsigned int irqs_unhandled; 55 unsigned int irqs_unhandled;
55 raw_spinlock_t lock; 56 raw_spinlock_t lock;
57 struct cpumask *percpu_enabled;
56#ifdef CONFIG_SMP 58#ifdef CONFIG_SMP
57 const struct cpumask *affinity_hint; 59 const struct cpumask *affinity_hint;
58 struct irq_affinity_notify *affinity_notify; 60 struct irq_affinity_notify *affinity_notify;
@@ -66,6 +68,7 @@ struct irq_desc {
66#ifdef CONFIG_PROC_FS 68#ifdef CONFIG_PROC_FS
67 struct proc_dir_entry *dir; 69 struct proc_dir_entry *dir;
68#endif 70#endif
71 struct module *owner;
69 const char *name; 72 const char *name;
70} ____cacheline_internodealigned_in_smp; 73} ____cacheline_internodealigned_in_smp;
71 74
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index e807ad687a07..99834e581b9e 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -47,6 +47,7 @@ struct irq_domain_ops {
47 * of the irq_domain is responsible for allocating the array of 47 * of the irq_domain is responsible for allocating the array of
48 * irq_desc structures. 48 * irq_desc structures.
49 * @nr_irq: Number of irqs managed by the irq domain 49 * @nr_irq: Number of irqs managed by the irq domain
50 * @hwirq_base: Starting number for hwirqs managed by the irq domain
50 * @ops: pointer to irq_domain methods 51 * @ops: pointer to irq_domain methods
51 * @priv: private data pointer for use by owner. Not touched by irq_domain 52 * @priv: private data pointer for use by owner. Not touched by irq_domain
52 * core code. 53 * core code.
@@ -57,6 +58,7 @@ struct irq_domain {
57 struct list_head list; 58 struct list_head list;
58 unsigned int irq_base; 59 unsigned int irq_base;
59 unsigned int nr_irq; 60 unsigned int nr_irq;
61 unsigned int hwirq_base;
60 const struct irq_domain_ops *ops; 62 const struct irq_domain_ops *ops;
61 void *priv; 63 void *priv;
62 struct device_node *of_node; 64 struct device_node *of_node;
@@ -72,14 +74,27 @@ struct irq_domain {
72static inline unsigned int irq_domain_to_irq(struct irq_domain *d, 74static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
73 unsigned long hwirq) 75 unsigned long hwirq)
74{ 76{
75 return d->ops->to_irq ? d->ops->to_irq(d, hwirq) : d->irq_base + hwirq; 77 if (d->ops->to_irq)
78 return d->ops->to_irq(d, hwirq);
79 if (WARN_ON(hwirq < d->hwirq_base))
80 return 0;
81 return d->irq_base + hwirq - d->hwirq_base;
76} 82}
77 83
84#define irq_domain_for_each_hwirq(d, hw) \
85 for (hw = d->hwirq_base; hw < d->hwirq_base + d->nr_irq; hw++)
86
87#define irq_domain_for_each_irq(d, hw, irq) \
88 for (hw = d->hwirq_base, irq = irq_domain_to_irq(d, hw); \
89 hw < d->hwirq_base + d->nr_irq; \
90 hw++, irq = irq_domain_to_irq(d, hw))
91
78extern void irq_domain_add(struct irq_domain *domain); 92extern void irq_domain_add(struct irq_domain *domain);
79extern void irq_domain_del(struct irq_domain *domain); 93extern void irq_domain_del(struct irq_domain *domain);
80#endif /* CONFIG_IRQ_DOMAIN */ 94#endif /* CONFIG_IRQ_DOMAIN */
81 95
82#if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ) 96#if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ)
97extern struct irq_domain_ops irq_domain_simple_ops;
83extern void irq_domain_add_simple(struct device_node *controller, int irq_base); 98extern void irq_domain_add_simple(struct device_node *controller, int irq_base);
84extern void irq_domain_generate_simple(const struct of_device_id *match, 99extern void irq_domain_generate_simple(const struct of_device_id *match,
85 u64 phys_base, unsigned int irq_start); 100 u64 phys_base, unsigned int irq_start);
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 44cd663c53b6..4ccf95d681b4 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -68,7 +68,7 @@
68#define ISDN_NET_ENCAP_SYNCPPP 4 68#define ISDN_NET_ENCAP_SYNCPPP 4
69#define ISDN_NET_ENCAP_UIHDLC 5 69#define ISDN_NET_ENCAP_UIHDLC 5
70#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */ 70#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
71#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt*/ 71#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt */
72#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE 72#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
73 73
74/* Facility which currently uses an ISDN-channel */ 74/* Facility which currently uses an ISDN-channel */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index e6a5e34bed4f..c7acdde3243d 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -244,6 +244,7 @@ typedef struct journal_superblock_s
244 244
245#include <linux/fs.h> 245#include <linux/fs.h>
246#include <linux/sched.h> 246#include <linux/sched.h>
247#include <linux/jbd_common.h>
247 248
248#define J_ASSERT(assert) BUG_ON(!(assert)) 249#define J_ASSERT(assert) BUG_ON(!(assert))
249 250
@@ -270,69 +271,6 @@ typedef struct journal_superblock_s
270#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) 271#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why)
271#endif 272#endif
272 273
273enum jbd_state_bits {
274 BH_JBD /* Has an attached ext3 journal_head */
275 = BH_PrivateStart,
276 BH_JWrite, /* Being written to log (@@@ DEBUGGING) */
277 BH_Freed, /* Has been freed (truncated) */
278 BH_Revoked, /* Has been revoked from the log */
279 BH_RevokeValid, /* Revoked flag is valid */
280 BH_JBDDirty, /* Is dirty but journaled */
281 BH_State, /* Pins most journal_head state */
282 BH_JournalHead, /* Pins bh->b_private and jh->b_bh */
283 BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */
284};
285
286BUFFER_FNS(JBD, jbd)
287BUFFER_FNS(JWrite, jwrite)
288BUFFER_FNS(JBDDirty, jbddirty)
289TAS_BUFFER_FNS(JBDDirty, jbddirty)
290BUFFER_FNS(Revoked, revoked)
291TAS_BUFFER_FNS(Revoked, revoked)
292BUFFER_FNS(RevokeValid, revokevalid)
293TAS_BUFFER_FNS(RevokeValid, revokevalid)
294BUFFER_FNS(Freed, freed)
295
296static inline struct buffer_head *jh2bh(struct journal_head *jh)
297{
298 return jh->b_bh;
299}
300
301static inline struct journal_head *bh2jh(struct buffer_head *bh)
302{
303 return bh->b_private;
304}
305
306static inline void jbd_lock_bh_state(struct buffer_head *bh)
307{
308 bit_spin_lock(BH_State, &bh->b_state);
309}
310
311static inline int jbd_trylock_bh_state(struct buffer_head *bh)
312{
313 return bit_spin_trylock(BH_State, &bh->b_state);
314}
315
316static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
317{
318 return bit_spin_is_locked(BH_State, &bh->b_state);
319}
320
321static inline void jbd_unlock_bh_state(struct buffer_head *bh)
322{
323 bit_spin_unlock(BH_State, &bh->b_state);
324}
325
326static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
327{
328 bit_spin_lock(BH_JournalHead, &bh->b_state);
329}
330
331static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
332{
333 bit_spin_unlock(BH_JournalHead, &bh->b_state);
334}
335
336struct jbd_revoke_table_s; 274struct jbd_revoke_table_s;
337 275
338/** 276/**
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 38f307b8c334..2092ea21e469 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -275,6 +275,7 @@ typedef struct journal_superblock_s
275 275
276#include <linux/fs.h> 276#include <linux/fs.h>
277#include <linux/sched.h> 277#include <linux/sched.h>
278#include <linux/jbd_common.h>
278 279
279#define J_ASSERT(assert) BUG_ON(!(assert)) 280#define J_ASSERT(assert) BUG_ON(!(assert))
280 281
@@ -302,70 +303,6 @@ typedef struct journal_superblock_s
302#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) 303#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why)
303#endif 304#endif
304 305
305enum jbd_state_bits {
306 BH_JBD /* Has an attached ext3 journal_head */
307 = BH_PrivateStart,
308 BH_JWrite, /* Being written to log (@@@ DEBUGGING) */
309 BH_Freed, /* Has been freed (truncated) */
310 BH_Revoked, /* Has been revoked from the log */
311 BH_RevokeValid, /* Revoked flag is valid */
312 BH_JBDDirty, /* Is dirty but journaled */
313 BH_State, /* Pins most journal_head state */
314 BH_JournalHead, /* Pins bh->b_private and jh->b_bh */
315 BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */
316 BH_JBDPrivateStart, /* First bit available for private use by FS */
317};
318
319BUFFER_FNS(JBD, jbd)
320BUFFER_FNS(JWrite, jwrite)
321BUFFER_FNS(JBDDirty, jbddirty)
322TAS_BUFFER_FNS(JBDDirty, jbddirty)
323BUFFER_FNS(Revoked, revoked)
324TAS_BUFFER_FNS(Revoked, revoked)
325BUFFER_FNS(RevokeValid, revokevalid)
326TAS_BUFFER_FNS(RevokeValid, revokevalid)
327BUFFER_FNS(Freed, freed)
328
329static inline struct buffer_head *jh2bh(struct journal_head *jh)
330{
331 return jh->b_bh;
332}
333
334static inline struct journal_head *bh2jh(struct buffer_head *bh)
335{
336 return bh->b_private;
337}
338
339static inline void jbd_lock_bh_state(struct buffer_head *bh)
340{
341 bit_spin_lock(BH_State, &bh->b_state);
342}
343
344static inline int jbd_trylock_bh_state(struct buffer_head *bh)
345{
346 return bit_spin_trylock(BH_State, &bh->b_state);
347}
348
349static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
350{
351 return bit_spin_is_locked(BH_State, &bh->b_state);
352}
353
354static inline void jbd_unlock_bh_state(struct buffer_head *bh)
355{
356 bit_spin_unlock(BH_State, &bh->b_state);
357}
358
359static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
360{
361 bit_spin_lock(BH_JournalHead, &bh->b_state);
362}
363
364static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
365{
366 bit_spin_unlock(BH_JournalHead, &bh->b_state);
367}
368
369/* Flags in jbd_inode->i_flags */ 306/* Flags in jbd_inode->i_flags */
370#define __JI_COMMIT_RUNNING 0 307#define __JI_COMMIT_RUNNING 0
371/* Commit of the inode data in progress. We use this flag to protect us from 308/* Commit of the inode data in progress. We use this flag to protect us from
@@ -1106,9 +1043,9 @@ static inline handle_t *journal_current_handle(void)
1106 */ 1043 */
1107 1044
1108extern handle_t *jbd2_journal_start(journal_t *, int nblocks); 1045extern handle_t *jbd2_journal_start(journal_t *, int nblocks);
1109extern handle_t *jbd2__journal_start(journal_t *, int nblocks, int gfp_mask); 1046extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask);
1110extern int jbd2_journal_restart(handle_t *, int nblocks); 1047extern int jbd2_journal_restart(handle_t *, int nblocks);
1111extern int jbd2__journal_restart(handle_t *, int nblocks, int gfp_mask); 1048extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask);
1112extern int jbd2_journal_extend (handle_t *, int nblocks); 1049extern int jbd2_journal_extend (handle_t *, int nblocks);
1113extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); 1050extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *);
1114extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); 1051extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *);
diff --git a/include/linux/jbd_common.h b/include/linux/jbd_common.h
new file mode 100644
index 000000000000..6230f8556a4e
--- /dev/null
+++ b/include/linux/jbd_common.h
@@ -0,0 +1,68 @@
1#ifndef _LINUX_JBD_STATE_H
2#define _LINUX_JBD_STATE_H
3
4enum jbd_state_bits {
5 BH_JBD /* Has an attached ext3 journal_head */
6 = BH_PrivateStart,
7 BH_JWrite, /* Being written to log (@@@ DEBUGGING) */
8 BH_Freed, /* Has been freed (truncated) */
9 BH_Revoked, /* Has been revoked from the log */
10 BH_RevokeValid, /* Revoked flag is valid */
11 BH_JBDDirty, /* Is dirty but journaled */
12 BH_State, /* Pins most journal_head state */
13 BH_JournalHead, /* Pins bh->b_private and jh->b_bh */
14 BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */
15 BH_JBDPrivateStart, /* First bit available for private use by FS */
16};
17
18BUFFER_FNS(JBD, jbd)
19BUFFER_FNS(JWrite, jwrite)
20BUFFER_FNS(JBDDirty, jbddirty)
21TAS_BUFFER_FNS(JBDDirty, jbddirty)
22BUFFER_FNS(Revoked, revoked)
23TAS_BUFFER_FNS(Revoked, revoked)
24BUFFER_FNS(RevokeValid, revokevalid)
25TAS_BUFFER_FNS(RevokeValid, revokevalid)
26BUFFER_FNS(Freed, freed)
27
28static inline struct buffer_head *jh2bh(struct journal_head *jh)
29{
30 return jh->b_bh;
31}
32
33static inline struct journal_head *bh2jh(struct buffer_head *bh)
34{
35 return bh->b_private;
36}
37
38static inline void jbd_lock_bh_state(struct buffer_head *bh)
39{
40 bit_spin_lock(BH_State, &bh->b_state);
41}
42
43static inline int jbd_trylock_bh_state(struct buffer_head *bh)
44{
45 return bit_spin_trylock(BH_State, &bh->b_state);
46}
47
48static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
49{
50 return bit_spin_is_locked(BH_State, &bh->b_state);
51}
52
53static inline void jbd_unlock_bh_state(struct buffer_head *bh)
54{
55 bit_spin_unlock(BH_State, &bh->b_state);
56}
57
58static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
59{
60 bit_spin_lock(BH_JournalHead, &bh->b_state);
61}
62
63static inline void jbd_unlock_bh_journal_head(struct buffer_head *bh)
64{
65 bit_spin_unlock(BH_JournalHead, &bh->b_state);
66}
67
68#endif
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index f97672a36fa8..265e2c3cbd1c 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -303,7 +303,7 @@ extern void jiffies_to_timespec(const unsigned long jiffies,
303extern unsigned long timeval_to_jiffies(const struct timeval *value); 303extern unsigned long timeval_to_jiffies(const struct timeval *value);
304extern void jiffies_to_timeval(const unsigned long jiffies, 304extern void jiffies_to_timeval(const unsigned long jiffies,
305 struct timeval *value); 305 struct timeval *value);
306extern clock_t jiffies_to_clock_t(long x); 306extern clock_t jiffies_to_clock_t(unsigned long x);
307extern unsigned long clock_t_to_jiffies(unsigned long x); 307extern unsigned long clock_t_to_jiffies(unsigned long x);
308extern u64 jiffies_64_to_clock_t(u64 x); 308extern u64 jiffies_64_to_clock_t(u64 x);
309extern u64 nsec_to_clock_t(u64 x); 309extern u64 nsec_to_clock_t(u64 x);
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 66f23dc5e76a..388b0d425b50 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -16,7 +16,7 @@ struct jump_label_key {
16 16
17# include <asm/jump_label.h> 17# include <asm/jump_label.h>
18# define HAVE_JUMP_LABEL 18# define HAVE_JUMP_LABEL
19#endif 19#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */
20 20
21enum jump_label_type { 21enum jump_label_type {
22 JUMP_LABEL_DISABLE = 0, 22 JUMP_LABEL_DISABLE = 0,
@@ -28,9 +28,9 @@ struct module;
28#ifdef HAVE_JUMP_LABEL 28#ifdef HAVE_JUMP_LABEL
29 29
30#ifdef CONFIG_MODULES 30#ifdef CONFIG_MODULES
31#define JUMP_LABEL_INIT {{ 0 }, NULL, NULL} 31#define JUMP_LABEL_INIT {ATOMIC_INIT(0), NULL, NULL}
32#else 32#else
33#define JUMP_LABEL_INIT {{ 0 }, NULL} 33#define JUMP_LABEL_INIT {ATOMIC_INIT(0), NULL}
34#endif 34#endif
35 35
36static __always_inline bool static_branch(struct jump_label_key *key) 36static __always_inline bool static_branch(struct jump_label_key *key)
@@ -41,18 +41,20 @@ static __always_inline bool static_branch(struct jump_label_key *key)
41extern struct jump_entry __start___jump_table[]; 41extern struct jump_entry __start___jump_table[];
42extern struct jump_entry __stop___jump_table[]; 42extern struct jump_entry __stop___jump_table[];
43 43
44extern void jump_label_init(void);
44extern void jump_label_lock(void); 45extern void jump_label_lock(void);
45extern void jump_label_unlock(void); 46extern void jump_label_unlock(void);
46extern void arch_jump_label_transform(struct jump_entry *entry, 47extern void arch_jump_label_transform(struct jump_entry *entry,
47 enum jump_label_type type); 48 enum jump_label_type type);
48extern void arch_jump_label_text_poke_early(jump_label_t addr); 49extern void arch_jump_label_transform_static(struct jump_entry *entry,
50 enum jump_label_type type);
49extern int jump_label_text_reserved(void *start, void *end); 51extern int jump_label_text_reserved(void *start, void *end);
50extern void jump_label_inc(struct jump_label_key *key); 52extern void jump_label_inc(struct jump_label_key *key);
51extern void jump_label_dec(struct jump_label_key *key); 53extern void jump_label_dec(struct jump_label_key *key);
52extern bool jump_label_enabled(struct jump_label_key *key); 54extern bool jump_label_enabled(struct jump_label_key *key);
53extern void jump_label_apply_nops(struct module *mod); 55extern void jump_label_apply_nops(struct module *mod);
54 56
55#else 57#else /* !HAVE_JUMP_LABEL */
56 58
57#include <linux/atomic.h> 59#include <linux/atomic.h>
58 60
@@ -62,6 +64,10 @@ struct jump_label_key {
62 atomic_t enabled; 64 atomic_t enabled;
63}; 65};
64 66
67static __always_inline void jump_label_init(void)
68{
69}
70
65static __always_inline bool static_branch(struct jump_label_key *key) 71static __always_inline bool static_branch(struct jump_label_key *key)
66{ 72{
67 if (unlikely(atomic_read(&key->enabled))) 73 if (unlikely(atomic_read(&key->enabled)))
@@ -96,7 +102,6 @@ static inline int jump_label_apply_nops(struct module *mod)
96{ 102{
97 return 0; 103 return 0;
98} 104}
105#endif /* HAVE_JUMP_LABEL */
99 106
100#endif 107#endif /* _LINUX_JUMP_LABEL_H */
101
102#endif
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 0df513b7a9f8..387571959dd9 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -101,9 +101,8 @@ static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, u
101#endif /*CONFIG_KALLSYMS*/ 101#endif /*CONFIG_KALLSYMS*/
102 102
103/* This macro allows us to keep printk typechecking */ 103/* This macro allows us to keep printk typechecking */
104static void __check_printsym_format(const char *fmt, ...) 104static __printf(1, 2)
105__attribute__((format(printf,1,2))); 105void __check_printsym_format(const char *fmt, ...)
106static inline void __check_printsym_format(const char *fmt, ...)
107{ 106{
108} 107}
109 108
diff --git a/include/linux/kdb.h b/include/linux/kdb.h
index 529d9a0c75a5..064725854db8 100644
--- a/include/linux/kdb.h
+++ b/include/linux/kdb.h
@@ -114,12 +114,9 @@ typedef enum {
114} kdb_reason_t; 114} kdb_reason_t;
115 115
116extern int kdb_trap_printk; 116extern int kdb_trap_printk;
117extern int vkdb_printf(const char *fmt, va_list args) 117extern __printf(1, 0) int vkdb_printf(const char *fmt, va_list args);
118 __attribute__ ((format (printf, 1, 0))); 118extern __printf(1, 2) int kdb_printf(const char *, ...);
119extern int kdb_printf(const char *, ...) 119typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...);
120 __attribute__ ((format (printf, 1, 2)));
121typedef int (*kdb_printf_t)(const char *, ...)
122 __attribute__ ((format (printf, 1, 2)));
123 120
124extern void kdb_init(int level); 121extern void kdb_init(int level);
125 122
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 46ac9a50528d..e8b1597b5cf2 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -287,6 +287,8 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t
287 return kstrtoint_from_user(s, count, base, res); 287 return kstrtoint_from_user(s, count, base, res);
288} 288}
289 289
290/* Obsolete, do not use. Use kstrto<foo> instead */
291
290extern unsigned long simple_strtoul(const char *,char **,unsigned int); 292extern unsigned long simple_strtoul(const char *,char **,unsigned int);
291extern long simple_strtol(const char *,char **,unsigned int); 293extern long simple_strtol(const char *,char **,unsigned int);
292extern unsigned long long simple_strtoull(const char *,char **,unsigned int); 294extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
@@ -296,20 +298,20 @@ extern long long simple_strtoll(const char *,char **,unsigned int);
296#define strict_strtoull kstrtoull 298#define strict_strtoull kstrtoull
297#define strict_strtoll kstrtoll 299#define strict_strtoll kstrtoll
298 300
299extern int sprintf(char * buf, const char * fmt, ...) 301/* lib/printf utilities */
300 __attribute__ ((format (printf, 2, 3))); 302
301extern int vsprintf(char *buf, const char *, va_list) 303extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...);
302 __attribute__ ((format (printf, 2, 0))); 304extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
303extern int snprintf(char * buf, size_t size, const char * fmt, ...) 305extern __printf(3, 4)
304 __attribute__ ((format (printf, 3, 4))); 306int snprintf(char *buf, size_t size, const char *fmt, ...);
305extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) 307extern __printf(3, 0)
306 __attribute__ ((format (printf, 3, 0))); 308int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
307extern int scnprintf(char * buf, size_t size, const char * fmt, ...) 309extern __printf(3, 4)
308 __attribute__ ((format (printf, 3, 4))); 310int scnprintf(char *buf, size_t size, const char *fmt, ...);
309extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) 311extern __printf(3, 0)
310 __attribute__ ((format (printf, 3, 0))); 312int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
311extern char *kasprintf(gfp_t gfp, const char *fmt, ...) 313extern __printf(2, 3)
312 __attribute__ ((format (printf, 2, 3))); 314char *kasprintf(gfp_t gfp, const char *fmt, ...);
313extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args); 315extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
314 316
315extern int sscanf(const char *, const char *, ...) 317extern int sscanf(const char *, const char *, ...)
@@ -369,20 +371,26 @@ extern enum system_states {
369#define TAINT_WARN 9 371#define TAINT_WARN 9
370#define TAINT_CRAP 10 372#define TAINT_CRAP 10
371#define TAINT_FIRMWARE_WORKAROUND 11 373#define TAINT_FIRMWARE_WORKAROUND 11
374#define TAINT_OOT_MODULE 12
372 375
373extern const char hex_asc[]; 376extern const char hex_asc[];
374#define hex_asc_lo(x) hex_asc[((x) & 0x0f)] 377#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
375#define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] 378#define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4]
376 379
377static inline char *pack_hex_byte(char *buf, u8 byte) 380static inline char *hex_byte_pack(char *buf, u8 byte)
378{ 381{
379 *buf++ = hex_asc_hi(byte); 382 *buf++ = hex_asc_hi(byte);
380 *buf++ = hex_asc_lo(byte); 383 *buf++ = hex_asc_lo(byte);
381 return buf; 384 return buf;
382} 385}
383 386
387static inline char * __deprecated pack_hex_byte(char *buf, u8 byte)
388{
389 return hex_byte_pack(buf, byte);
390}
391
384extern int hex_to_bin(char ch); 392extern int hex_to_bin(char ch);
385extern void hex2bin(u8 *dst, const char *src, size_t count); 393extern int __must_check hex2bin(u8 *dst, const char *src, size_t count);
386 394
387/* 395/*
388 * General tracing related utility functions - trace_printk(), 396 * General tracing related utility functions - trace_printk(),
@@ -427,8 +435,8 @@ extern void tracing_start(void);
427extern void tracing_stop(void); 435extern void tracing_stop(void);
428extern void ftrace_off_permanent(void); 436extern void ftrace_off_permanent(void);
429 437
430static inline void __attribute__ ((format (printf, 1, 2))) 438static inline __printf(1, 2)
431____trace_printk_check_format(const char *fmt, ...) 439void ____trace_printk_check_format(const char *fmt, ...)
432{ 440{
433} 441}
434#define __trace_printk_check_format(fmt, args...) \ 442#define __trace_printk_check_format(fmt, args...) \
@@ -467,13 +475,11 @@ do { \
467 __trace_printk(_THIS_IP_, fmt, ##args); \ 475 __trace_printk(_THIS_IP_, fmt, ##args); \
468} while (0) 476} while (0)
469 477
470extern int 478extern __printf(2, 3)
471__trace_bprintk(unsigned long ip, const char *fmt, ...) 479int __trace_bprintk(unsigned long ip, const char *fmt, ...);
472 __attribute__ ((format (printf, 2, 3)));
473 480
474extern int 481extern __printf(2, 3)
475__trace_printk(unsigned long ip, const char *fmt, ...) 482int __trace_printk(unsigned long ip, const char *fmt, ...);
476 __attribute__ ((format (printf, 2, 3)));
477 483
478extern void trace_dump_stack(void); 484extern void trace_dump_stack(void);
479 485
@@ -502,8 +508,8 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
502 508
503extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); 509extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
504#else 510#else
505static inline int 511static inline __printf(1, 2)
506trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 512int trace_printk(const char *fmt, ...);
507 513
508static inline void tracing_start(void) { } 514static inline void tracing_start(void) { }
509static inline void tracing_stop(void) { } 515static inline void tracing_stop(void) { }
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index c2478a342cd7..2fa0901219d4 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -33,6 +33,14 @@
33#error KEXEC_ARCH not defined 33#error KEXEC_ARCH not defined
34#endif 34#endif
35 35
36#ifndef KEXEC_CRASH_CONTROL_MEMORY_LIMIT
37#define KEXEC_CRASH_CONTROL_MEMORY_LIMIT KEXEC_CONTROL_MEMORY_LIMIT
38#endif
39
40#ifndef KEXEC_CRASH_MEM_ALIGN
41#define KEXEC_CRASH_MEM_ALIGN PAGE_SIZE
42#endif
43
36#define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) 44#define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4)
37#define KEXEC_CORE_NOTE_NAME "CORE" 45#define KEXEC_CORE_NOTE_NAME "CORE"
38#define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4) 46#define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4)
@@ -129,9 +137,11 @@ extern void crash_kexec(struct pt_regs *);
129int kexec_should_crash(struct task_struct *); 137int kexec_should_crash(struct task_struct *);
130void crash_save_cpu(struct pt_regs *regs, int cpu); 138void crash_save_cpu(struct pt_regs *regs, int cpu);
131void crash_save_vmcoreinfo(void); 139void crash_save_vmcoreinfo(void);
140void crash_map_reserved_pages(void);
141void crash_unmap_reserved_pages(void);
132void arch_crash_save_vmcoreinfo(void); 142void arch_crash_save_vmcoreinfo(void);
133void vmcoreinfo_append_str(const char *fmt, ...) 143__printf(1, 2)
134 __attribute__ ((format (printf, 1, 2))); 144void vmcoreinfo_append_str(const char *fmt, ...);
135unsigned long paddr_vmcoreinfo_note(void); 145unsigned long paddr_vmcoreinfo_note(void);
136 146
137#define VMCOREINFO_OSRELEASE(value) \ 147#define VMCOREINFO_OSRELEASE(value) \
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 0da38cf7db7b..b16f65390734 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -32,8 +32,8 @@
32extern char modprobe_path[]; /* for sysctl */ 32extern char modprobe_path[]; /* for sysctl */
33/* modprobe exit status on success, -ve on error. Return value 33/* modprobe exit status on success, -ve on error. Return value
34 * usually useless though. */ 34 * usually useless though. */
35extern int __request_module(bool wait, const char *name, ...) \ 35extern __printf(2, 3)
36 __attribute__((format(printf, 2, 3))); 36int __request_module(bool wait, const char *name, ...);
37#define request_module(mod...) __request_module(true, mod) 37#define request_module(mod...) __request_module(true, mod)
38#define request_module_nowait(mod...) __request_module(false, mod) 38#define request_module_nowait(mod...) __request_module(false, mod)
39#define try_then_request_module(x, mod...) \ 39#define try_then_request_module(x, mod...) \
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 668729cc0fe9..ad81e1c51487 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -72,8 +72,8 @@ struct kobject {
72 unsigned int uevent_suppress:1; 72 unsigned int uevent_suppress:1;
73}; 73};
74 74
75extern int kobject_set_name(struct kobject *kobj, const char *name, ...) 75extern __printf(2, 3)
76 __attribute__((format(printf, 2, 3))); 76int kobject_set_name(struct kobject *kobj, const char *name, ...);
77extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, 77extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
78 va_list vargs); 78 va_list vargs);
79 79
@@ -83,15 +83,13 @@ static inline const char *kobject_name(const struct kobject *kobj)
83} 83}
84 84
85extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); 85extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
86extern int __must_check kobject_add(struct kobject *kobj, 86extern __printf(3, 4) __must_check
87 struct kobject *parent, 87int kobject_add(struct kobject *kobj, struct kobject *parent,
88 const char *fmt, ...) 88 const char *fmt, ...);
89 __attribute__((format(printf, 3, 4))); 89extern __printf(4, 5) __must_check
90extern int __must_check kobject_init_and_add(struct kobject *kobj, 90int kobject_init_and_add(struct kobject *kobj,
91 struct kobj_type *ktype, 91 struct kobj_type *ktype, struct kobject *parent,
92 struct kobject *parent, 92 const char *fmt, ...);
93 const char *fmt, ...)
94 __attribute__((format(printf, 4, 5)));
95 93
96extern void kobject_del(struct kobject *kobj); 94extern void kobject_del(struct kobject *kobj);
97 95
@@ -212,8 +210,8 @@ int kobject_uevent(struct kobject *kobj, enum kobject_action action);
212int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, 210int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
213 char *envp[]); 211 char *envp[]);
214 212
215int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) 213__printf(2, 3)
216 __attribute__((format (printf, 2, 3))); 214int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);
217 215
218int kobject_action_type(const char *buf, size_t count, 216int kobject_action_type(const char *buf, size_t count,
219 enum kobject_action *type); 217 enum kobject_action *type);
@@ -226,7 +224,7 @@ static inline int kobject_uevent_env(struct kobject *kobj,
226 char *envp[]) 224 char *envp[])
227{ return 0; } 225{ return 0; }
228 226
229static inline __attribute__((format(printf, 2, 3))) 227static inline __printf(2, 3)
230int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) 228int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
231{ return 0; } 229{ return 0; }
232 230
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index dd7c12e875bc..dce6e4dbeda7 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -181,7 +181,7 @@ struct kretprobe {
181 int nmissed; 181 int nmissed;
182 size_t data_size; 182 size_t data_size;
183 struct hlist_head free_instances; 183 struct hlist_head free_instances;
184 spinlock_t lock; 184 raw_spinlock_t lock;
185}; 185};
186 186
187struct kretprobe_instance { 187struct kretprobe_instance {
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 1e923e5e88e8..5cac19b3a266 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -4,11 +4,11 @@
4#include <linux/err.h> 4#include <linux/err.h>
5#include <linux/sched.h> 5#include <linux/sched.h>
6 6
7__printf(4, 5)
7struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), 8struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
8 void *data, 9 void *data,
9 int node, 10 int node,
10 const char namefmt[], ...) 11 const char namefmt[], ...);
11 __attribute__((format(printf, 4, 5)));
12 12
13#define kthread_create(threadfn, data, namefmt, arg...) \ 13#define kthread_create(threadfn, data, namefmt, arg...) \
14 kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) 14 kthread_create_on_node(threadfn, data, -1, namefmt, ##arg)
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 2c366b52f505..f47fcd30273d 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -371,6 +371,7 @@ struct kvm_s390_psw {
371#define KVM_S390_INT_VIRTIO 0xffff2603u 371#define KVM_S390_INT_VIRTIO 0xffff2603u
372#define KVM_S390_INT_SERVICE 0xffff2401u 372#define KVM_S390_INT_SERVICE 0xffff2401u
373#define KVM_S390_INT_EMERGENCY 0xffff1201u 373#define KVM_S390_INT_EMERGENCY 0xffff1201u
374#define KVM_S390_INT_EXTERNAL_CALL 0xffff1202u
374 375
375struct kvm_s390_interrupt { 376struct kvm_s390_interrupt {
376 __u32 type; 377 __u32 type;
@@ -463,7 +464,7 @@ struct kvm_ppc_pvinfo {
463#define KVM_CAP_VAPIC 6 464#define KVM_CAP_VAPIC 6
464#define KVM_CAP_EXT_CPUID 7 465#define KVM_CAP_EXT_CPUID 7
465#define KVM_CAP_CLOCKSOURCE 8 466#define KVM_CAP_CLOCKSOURCE 8
466#define KVM_CAP_NR_VCPUS 9 /* returns max vcpus per vm */ 467#define KVM_CAP_NR_VCPUS 9 /* returns recommended max vcpus per vm */
467#define KVM_CAP_NR_MEMSLOTS 10 /* returns max memory slots per vm */ 468#define KVM_CAP_NR_MEMSLOTS 10 /* returns max memory slots per vm */
468#define KVM_CAP_PIT 11 469#define KVM_CAP_PIT 11
469#define KVM_CAP_NOP_IO_DELAY 12 470#define KVM_CAP_NOP_IO_DELAY 12
@@ -553,6 +554,10 @@ struct kvm_ppc_pvinfo {
553#define KVM_CAP_SPAPR_TCE 63 554#define KVM_CAP_SPAPR_TCE 63
554#define KVM_CAP_PPC_SMT 64 555#define KVM_CAP_PPC_SMT 64
555#define KVM_CAP_PPC_RMA 65 556#define KVM_CAP_PPC_RMA 65
557#define KVM_CAP_MAX_VCPUS 66 /* returns max vcpus per vm */
558#define KVM_CAP_PPC_HIOR 67
559#define KVM_CAP_PPC_PAPR 68
560#define KVM_CAP_S390_GMAP 71
556 561
557#ifdef KVM_CAP_IRQ_ROUTING 562#ifdef KVM_CAP_IRQ_ROUTING
558 563
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index eabb21a30c34..d52623199978 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -18,6 +18,7 @@
18#include <linux/msi.h> 18#include <linux/msi.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/rcupdate.h> 20#include <linux/rcupdate.h>
21#include <linux/ratelimit.h>
21#include <asm/signal.h> 22#include <asm/signal.h>
22 23
23#include <linux/kvm.h> 24#include <linux/kvm.h>
@@ -48,6 +49,7 @@
48#define KVM_REQ_EVENT 11 49#define KVM_REQ_EVENT 11
49#define KVM_REQ_APF_HALT 12 50#define KVM_REQ_APF_HALT 12
50#define KVM_REQ_STEAL_UPDATE 13 51#define KVM_REQ_STEAL_UPDATE 13
52#define KVM_REQ_NMI 14
51 53
52#define KVM_USERSPACE_IRQ_SOURCE_ID 0 54#define KVM_USERSPACE_IRQ_SOURCE_ID 0
53 55
@@ -55,16 +57,16 @@ struct kvm;
55struct kvm_vcpu; 57struct kvm_vcpu;
56extern struct kmem_cache *kvm_vcpu_cache; 58extern struct kmem_cache *kvm_vcpu_cache;
57 59
58/* 60struct kvm_io_range {
59 * It would be nice to use something smarter than a linear search, TBD... 61 gpa_t addr;
60 * Thankfully we dont expect many devices to register (famous last words :), 62 int len;
61 * so until then it will suffice. At least its abstracted so we can change 63 struct kvm_io_device *dev;
62 * in one place. 64};
63 */ 65
64struct kvm_io_bus { 66struct kvm_io_bus {
65 int dev_count; 67 int dev_count;
66#define NR_IOBUS_DEVS 200 68#define NR_IOBUS_DEVS 300
67 struct kvm_io_device *devs[NR_IOBUS_DEVS]; 69 struct kvm_io_range range[NR_IOBUS_DEVS];
68}; 70};
69 71
70enum kvm_bus { 72enum kvm_bus {
@@ -77,8 +79,8 @@ int kvm_io_bus_write(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
77 int len, const void *val); 79 int len, const void *val);
78int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, 80int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len,
79 void *val); 81 void *val);
80int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, 82int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
81 struct kvm_io_device *dev); 83 int len, struct kvm_io_device *dev);
82int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, 84int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
83 struct kvm_io_device *dev); 85 struct kvm_io_device *dev);
84 86
@@ -256,8 +258,9 @@ struct kvm {
256 struct kvm_arch arch; 258 struct kvm_arch arch;
257 atomic_t users_count; 259 atomic_t users_count;
258#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET 260#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET
259 struct kvm_coalesced_mmio_dev *coalesced_mmio_dev;
260 struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; 261 struct kvm_coalesced_mmio_ring *coalesced_mmio_ring;
262 spinlock_t ring_lock;
263 struct list_head coalesced_zones;
261#endif 264#endif
262 265
263 struct mutex irq_lock; 266 struct mutex irq_lock;
@@ -281,11 +284,8 @@ struct kvm {
281 284
282/* The guest did something we don't support. */ 285/* The guest did something we don't support. */
283#define pr_unimpl(vcpu, fmt, ...) \ 286#define pr_unimpl(vcpu, fmt, ...) \
284 do { \ 287 pr_err_ratelimited("kvm: %i: cpu%i " fmt, \
285 if (printk_ratelimit()) \ 288 current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__)
286 printk(KERN_ERR "kvm: %i: cpu%i " fmt, \
287 current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__); \
288 } while (0)
289 289
290#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) 290#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt)
291#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) 291#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt)
diff --git a/include/linux/l2tp.h b/include/linux/l2tp.h
index 4bdb31df8e72..e77d7f9bb246 100644
--- a/include/linux/l2tp.h
+++ b/include/linux/l2tp.h
@@ -8,8 +8,8 @@
8#define _LINUX_L2TP_H_ 8#define _LINUX_L2TP_H_
9 9
10#include <linux/types.h> 10#include <linux/types.h>
11#ifdef __KERNEL__
12#include <linux/socket.h> 11#include <linux/socket.h>
12#ifdef __KERNEL__
13#include <linux/in.h> 13#include <linux/in.h>
14#else 14#else
15#include <netinet/in.h> 15#include <netinet/in.h>
@@ -26,14 +26,15 @@
26#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ 26#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
27struct sockaddr_l2tpip { 27struct sockaddr_l2tpip {
28 /* The first fields must match struct sockaddr_in */ 28 /* The first fields must match struct sockaddr_in */
29 sa_family_t l2tp_family; /* AF_INET */ 29 __kernel_sa_family_t l2tp_family; /* AF_INET */
30 __be16 l2tp_unused; /* INET port number (unused) */ 30 __be16 l2tp_unused; /* INET port number (unused) */
31 struct in_addr l2tp_addr; /* Internet address */ 31 struct in_addr l2tp_addr; /* Internet address */
32 32
33 __u32 l2tp_conn_id; /* Connection ID of tunnel */ 33 __u32 l2tp_conn_id; /* Connection ID of tunnel */
34 34
35 /* Pad to size of `struct sockaddr'. */ 35 /* Pad to size of `struct sockaddr'. */
36 unsigned char __pad[sizeof(struct sockaddr) - sizeof(sa_family_t) - 36 unsigned char __pad[sizeof(struct sockaddr) -
37 sizeof(__kernel_sa_family_t) -
37 sizeof(__be16) - sizeof(struct in_addr) - 38 sizeof(__be16) - sizeof(struct in_addr) -
38 sizeof(__u32)]; 39 sizeof(__u32)];
39}; 40};
diff --git a/include/linux/lapb.h b/include/linux/lapb.h
index ce709e1885cc..873c1eb635e4 100644
--- a/include/linux/lapb.h
+++ b/include/linux/lapb.h
@@ -44,7 +44,8 @@ struct lapb_parms_struct {
44 unsigned int mode; 44 unsigned int mode;
45}; 45};
46 46
47extern int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks); 47extern int lapb_register(struct net_device *dev,
48 const struct lapb_register_struct *callbacks);
48extern int lapb_unregister(struct net_device *dev); 49extern int lapb_unregister(struct net_device *dev);
49extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms); 50extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms);
50extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms); 51extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index efd6f9800762..cafc09a64fe4 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1052,6 +1052,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev);
1052extern void ata_scsi_slave_destroy(struct scsi_device *sdev); 1052extern void ata_scsi_slave_destroy(struct scsi_device *sdev);
1053extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, 1053extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
1054 int queue_depth, int reason); 1054 int queue_depth, int reason);
1055extern int __ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev,
1056 int queue_depth, int reason);
1055extern struct ata_device *ata_dev_pair(struct ata_device *adev); 1057extern struct ata_device *ata_dev_pair(struct ata_device *adev);
1056extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); 1058extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev);
1057extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap); 1059extern void ata_scsi_port_error_handler(struct Scsi_Host *host, struct ata_port *ap);
@@ -1254,13 +1256,13 @@ static inline int sata_srst_pmp(struct ata_link *link)
1254/* 1256/*
1255 * printk helpers 1257 * printk helpers
1256 */ 1258 */
1257__attribute__((format (printf, 3, 4))) 1259__printf(3, 4)
1258int ata_port_printk(const struct ata_port *ap, const char *level, 1260int ata_port_printk(const struct ata_port *ap, const char *level,
1259 const char *fmt, ...); 1261 const char *fmt, ...);
1260__attribute__((format (printf, 3, 4))) 1262__printf(3, 4)
1261int ata_link_printk(const struct ata_link *link, const char *level, 1263int ata_link_printk(const struct ata_link *link, const char *level,
1262 const char *fmt, ...); 1264 const char *fmt, ...);
1263__attribute__((format (printf, 3, 4))) 1265__printf(3, 4)
1264int ata_dev_printk(const struct ata_device *dev, const char *level, 1266int ata_dev_printk(const struct ata_device *dev, const char *level,
1265 const char *fmt, ...); 1267 const char *fmt, ...);
1266 1268
@@ -1302,10 +1304,10 @@ void ata_print_version(const struct device *dev, const char *version);
1302/* 1304/*
1303 * ata_eh_info helpers 1305 * ata_eh_info helpers
1304 */ 1306 */
1305extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...) 1307extern __printf(2, 3)
1306 __attribute__ ((format (printf, 2, 3))); 1308void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
1307extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...) 1309extern __printf(2, 3)
1308 __attribute__ ((format (printf, 2, 3))); 1310void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
1309extern void ata_ehi_clear_desc(struct ata_eh_info *ehi); 1311extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
1310 1312
1311static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi) 1313static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
@@ -1319,8 +1321,8 @@ static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
1319/* 1321/*
1320 * port description helpers 1322 * port description helpers
1321 */ 1323 */
1322extern void ata_port_desc(struct ata_port *ap, const char *fmt, ...) 1324extern __printf(2, 3)
1323 __attribute__ ((format (printf, 2, 3))); 1325void ata_port_desc(struct ata_port *ap, const char *fmt, ...);
1324#ifdef CONFIG_PCI 1326#ifdef CONFIG_PCI
1325extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset, 1327extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset,
1326 const char *name); 1328 const char *name);
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h
index d4292c8431e0..f1664c636af0 100644
--- a/include/linux/lis3lv02d.h
+++ b/include/linux/lis3lv02d.h
@@ -113,7 +113,6 @@ struct lis3lv02d_platform_data {
113 s8 axis_x; 113 s8 axis_x;
114 s8 axis_y; 114 s8 axis_y;
115 s8 axis_z; 115 s8 axis_z;
116#define LIS3_USE_REGULATOR_CTRL 0x01
117#define LIS3_USE_BLOCK_READ 0x02 116#define LIS3_USE_BLOCK_READ 0x02
118 u16 driver_features; 117 u16 driver_features;
119 int default_rate; 118 int default_rate;
diff --git a/include/linux/llc.h b/include/linux/llc.h
index ad7074ba81af..a2418ae13ee9 100644
--- a/include/linux/llc.h
+++ b/include/linux/llc.h
@@ -12,16 +12,20 @@
12 * 12 *
13 * See the GNU General Public License for more details. 13 * See the GNU General Public License for more details.
14 */ 14 */
15
16#include <linux/socket.h>
17
15#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */ 18#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
16struct sockaddr_llc { 19struct sockaddr_llc {
17 sa_family_t sllc_family; /* AF_LLC */ 20 __kernel_sa_family_t sllc_family; /* AF_LLC */
18 sa_family_t sllc_arphrd; /* ARPHRD_ETHER */ 21 __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
19 unsigned char sllc_test; 22 unsigned char sllc_test;
20 unsigned char sllc_xid; 23 unsigned char sllc_xid;
21 unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */ 24 unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */
22 unsigned char sllc_sap; 25 unsigned char sllc_sap;
23 unsigned char sllc_mac[IFHWADDRLEN]; 26 unsigned char sllc_mac[IFHWADDRLEN];
24 unsigned char __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 - 27 unsigned char __pad[__LLC_SOCK_SIZE__ -
28 sizeof(__kernel_sa_family_t) * 2 -
25 sizeof(unsigned char) * 4 - IFHWADDRLEN]; 29 sizeof(unsigned char) * 4 - IFHWADDRLEN];
26}; 30};
27 31
diff --git a/include/linux/llist.h b/include/linux/llist.h
index aa0c8b5b3cd0..801b44b07aac 100644
--- a/include/linux/llist.h
+++ b/include/linux/llist.h
@@ -35,10 +35,30 @@
35 * 35 *
36 * The basic atomic operation of this list is cmpxchg on long. On 36 * The basic atomic operation of this list is cmpxchg on long. On
37 * architectures that don't have NMI-safe cmpxchg implementation, the 37 * architectures that don't have NMI-safe cmpxchg implementation, the
38 * list can NOT be used in NMI handler. So code uses the list in NMI 38 * list can NOT be used in NMI handlers. So code that uses the list in
39 * handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. 39 * an NMI handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
40 *
41 * Copyright 2010,2011 Intel Corp.
42 * Author: Huang Ying <ying.huang@intel.com>
43 *
44 * This program is free software; you can redistribute it and/or
45 * modify it under the terms of the GNU General Public License version
46 * 2 as published by the Free Software Foundation;
47 *
48 * This program is distributed in the hope that it will be useful,
49 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 * GNU General Public License for more details.
52 *
53 * You should have received a copy of the GNU General Public License
54 * along with this program; if not, write to the Free Software
55 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 */ 56 */
41 57
58#include <linux/kernel.h>
59#include <asm/system.h>
60#include <asm/processor.h>
61
42struct llist_head { 62struct llist_head {
43 struct llist_node *first; 63 struct llist_node *first;
44}; 64};
@@ -113,14 +133,55 @@ static inline void init_llist_head(struct llist_head *list)
113 * test whether the list is empty without deleting something from the 133 * test whether the list is empty without deleting something from the
114 * list. 134 * list.
115 */ 135 */
116static inline int llist_empty(const struct llist_head *head) 136static inline bool llist_empty(const struct llist_head *head)
117{ 137{
118 return ACCESS_ONCE(head->first) == NULL; 138 return ACCESS_ONCE(head->first) == NULL;
119} 139}
120 140
121void llist_add(struct llist_node *new, struct llist_head *head); 141static inline struct llist_node *llist_next(struct llist_node *node)
122void llist_add_batch(struct llist_node *new_first, struct llist_node *new_last, 142{
123 struct llist_head *head); 143 return node->next;
124struct llist_node *llist_del_first(struct llist_head *head); 144}
125struct llist_node *llist_del_all(struct llist_head *head); 145
146/**
147 * llist_add - add a new entry
148 * @new: new entry to be added
149 * @head: the head for your lock-less list
150 *
151 * Returns true if the list was empty prior to adding this entry.
152 */
153static inline bool llist_add(struct llist_node *new, struct llist_head *head)
154{
155 struct llist_node *entry, *old_entry;
156
157 entry = head->first;
158 for (;;) {
159 old_entry = entry;
160 new->next = entry;
161 entry = cmpxchg(&head->first, old_entry, new);
162 if (entry == old_entry)
163 break;
164 }
165
166 return old_entry == NULL;
167}
168
169/**
170 * llist_del_all - delete all entries from lock-less list
171 * @head: the head of lock-less list to delete all entries
172 *
173 * If list is empty, return NULL, otherwise, delete all entries and
174 * return the pointer to the first entry. The order of entries
175 * deleted is from the newest to the oldest added one.
176 */
177static inline struct llist_node *llist_del_all(struct llist_head *head)
178{
179 return xchg(&head->first, NULL);
180}
181
182extern bool llist_add_batch(struct llist_node *new_first,
183 struct llist_node *new_last,
184 struct llist_head *head);
185extern struct llist_node *llist_del_first(struct llist_head *head);
186
126#endif /* LLIST_H */ 187#endif /* LLIST_H */
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index ef820a3c378b..b6a56e37284c 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -548,7 +548,7 @@ do { \
548#endif 548#endif
549 549
550#ifdef CONFIG_PROVE_RCU 550#ifdef CONFIG_PROVE_RCU
551extern void lockdep_rcu_dereference(const char *file, const int line); 551void lockdep_rcu_suspicious(const char *file, const int line, const char *s);
552#endif 552#endif
553 553
554#endif /* __LINUX_LOCKDEP_H */ 554#endif /* __LINUX_LOCKDEP_H */
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 66c194e2d9b9..11a41a8f08eb 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -64,7 +64,6 @@ struct loop_device {
64 64
65 struct request_queue *lo_queue; 65 struct request_queue *lo_queue;
66 struct gendisk *lo_disk; 66 struct gendisk *lo_disk;
67 struct list_head lo_list;
68}; 67};
69 68
70#endif /* __KERNEL__ */ 69#endif /* __KERNEL__ */
@@ -74,8 +73,8 @@ struct loop_device {
74 */ 73 */
75enum { 74enum {
76 LO_FLAGS_READ_ONLY = 1, 75 LO_FLAGS_READ_ONLY = 1,
77 LO_FLAGS_USE_AOPS = 2,
78 LO_FLAGS_AUTOCLEAR = 4, 76 LO_FLAGS_AUTOCLEAR = 4,
77 LO_FLAGS_PARTSCAN = 8,
79}; 78};
80 79
81#include <asm/posix_types.h> /* for __kernel_old_dev_t */ 80#include <asm/posix_types.h> /* for __kernel_old_dev_t */
@@ -161,4 +160,8 @@ int loop_unregister_transfer(int number);
161#define LOOP_CHANGE_FD 0x4C06 160#define LOOP_CHANGE_FD 0x4C06
162#define LOOP_SET_CAPACITY 0x4C07 161#define LOOP_SET_CAPACITY 0x4C07
163 162
163/* /dev/loop-control interface */
164#define LOOP_CTL_ADD 0x4C80
165#define LOOP_CTL_REMOVE 0x4C81
166#define LOOP_CTL_GET_FREE 0x4C82
164#endif 167#endif
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 1e5df2af8d84..2d4beab0d5b7 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -30,11 +30,11 @@
30#define ANON_INODE_FS_MAGIC 0x09041934 30#define ANON_INODE_FS_MAGIC 0x09041934
31#define PSTOREFS_MAGIC 0x6165676C 31#define PSTOREFS_MAGIC 0x6165676C
32 32
33#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ 33#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
34#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ 34#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
35#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */ 35#define MINIX2_SUPER_MAGIC 0x2468 /* minix v2 fs, 14 char names */
36#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */ 36#define MINIX2_SUPER_MAGIC2 0x2478 /* minix v2 fs, 30 char names */
37#define MINIX3_SUPER_MAGIC 0x4d5a /* minix V3 fs */ 37#define MINIX3_SUPER_MAGIC 0x4d5a /* minix v3 fs, 60 char names */
38 38
39#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */ 39#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
40#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */ 40#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
diff --git a/include/linux/mdio-bitbang.h b/include/linux/mdio-bitbang.h
index 8ea9a42a4c02..0fe00cd4c93c 100644
--- a/include/linux/mdio-bitbang.h
+++ b/include/linux/mdio-bitbang.h
@@ -2,7 +2,8 @@
2#define __LINUX_MDIO_BITBANG_H 2#define __LINUX_MDIO_BITBANG_H
3 3
4#include <linux/phy.h> 4#include <linux/phy.h>
5#include <linux/module.h> 5
6struct module;
6 7
7struct mdiobb_ctrl; 8struct mdiobb_ctrl;
8 9
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 7525e38c434d..e6b843e16e81 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -80,6 +80,7 @@ extern phys_addr_t __memblock_alloc_base(phys_addr_t size,
80 phys_addr_t align, 80 phys_addr_t align,
81 phys_addr_t max_addr); 81 phys_addr_t max_addr);
82extern phys_addr_t memblock_phys_mem_size(void); 82extern phys_addr_t memblock_phys_mem_size(void);
83extern phys_addr_t memblock_start_of_DRAM(void);
83extern phys_addr_t memblock_end_of_DRAM(void); 84extern phys_addr_t memblock_end_of_DRAM(void);
84extern void memblock_enforce_memory_limit(phys_addr_t memory_limit); 85extern void memblock_enforce_memory_limit(phys_addr_t memory_limit);
85extern int memblock_is_memory(phys_addr_t addr); 86extern int memblock_is_memory(phys_addr_t addr);
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 3b535db00a94..b87068a1a09e 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -35,20 +35,11 @@ enum mem_cgroup_page_stat_item {
35extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, 35extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
36 struct list_head *dst, 36 struct list_head *dst,
37 unsigned long *scanned, int order, 37 unsigned long *scanned, int order,
38 int mode, struct zone *z, 38 isolate_mode_t mode,
39 struct zone *z,
39 struct mem_cgroup *mem_cont, 40 struct mem_cgroup *mem_cont,
40 int active, int file); 41 int active, int file);
41 42
42struct memcg_scanrecord {
43 struct mem_cgroup *mem; /* scanend memory cgroup */
44 struct mem_cgroup *root; /* scan target hierarchy root */
45 int context; /* scanning context (see memcontrol.c) */
46 unsigned long nr_scanned[2]; /* the number of scanned pages */
47 unsigned long nr_rotated[2]; /* the number of rotated pages */
48 unsigned long nr_freed[2]; /* the number of freed pages */
49 unsigned long elapsed; /* nsec of time elapsed while scanning */
50};
51
52#ifdef CONFIG_CGROUP_MEM_RES_CTLR 43#ifdef CONFIG_CGROUP_MEM_RES_CTLR
53/* 44/*
54 * All "charge" functions with gfp_mask should use GFP_KERNEL or 45 * All "charge" functions with gfp_mask should use GFP_KERNEL or
@@ -87,8 +78,8 @@ extern void mem_cgroup_uncharge_end(void);
87extern void mem_cgroup_uncharge_page(struct page *page); 78extern void mem_cgroup_uncharge_page(struct page *page);
88extern void mem_cgroup_uncharge_cache_page(struct page *page); 79extern void mem_cgroup_uncharge_cache_page(struct page *page);
89 80
90extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 81extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask);
91int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 82int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg);
92 83
93extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); 84extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
94extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); 85extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
@@ -97,26 +88,28 @@ extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm);
97static inline 88static inline
98int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) 89int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
99{ 90{
100 struct mem_cgroup *mem; 91 struct mem_cgroup *memcg;
101 rcu_read_lock(); 92 rcu_read_lock();
102 mem = mem_cgroup_from_task(rcu_dereference((mm)->owner)); 93 memcg = mem_cgroup_from_task(rcu_dereference((mm)->owner));
103 rcu_read_unlock(); 94 rcu_read_unlock();
104 return cgroup == mem; 95 return cgroup == memcg;
105} 96}
106 97
107extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); 98extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *memcg);
108 99
109extern int 100extern int
110mem_cgroup_prepare_migration(struct page *page, 101mem_cgroup_prepare_migration(struct page *page,
111 struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask); 102 struct page *newpage, struct mem_cgroup **ptr, gfp_t gfp_mask);
112extern void mem_cgroup_end_migration(struct mem_cgroup *mem, 103extern void mem_cgroup_end_migration(struct mem_cgroup *memcg,
113 struct page *oldpage, struct page *newpage, bool migration_ok); 104 struct page *oldpage, struct page *newpage, bool migration_ok);
114 105
115/* 106/*
116 * For memory reclaim. 107 * For memory reclaim.
117 */ 108 */
118int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); 109int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg,
119int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); 110 struct zone *zone);
111int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg,
112 struct zone *zone);
120int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); 113int mem_cgroup_select_victim_node(struct mem_cgroup *memcg);
121unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, 114unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg,
122 int nid, int zid, unsigned int lrumask); 115 int nid, int zid, unsigned int lrumask);
@@ -127,15 +120,6 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page);
127extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, 120extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,
128 struct task_struct *p); 121 struct task_struct *p);
129 122
130extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
131 gfp_t gfp_mask, bool noswap,
132 struct memcg_scanrecord *rec);
133extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
134 gfp_t gfp_mask, bool noswap,
135 struct zone *zone,
136 struct memcg_scanrecord *rec,
137 unsigned long *nr_scanned);
138
139#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 123#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
140extern int do_swap_account; 124extern int do_swap_account;
141#endif 125#endif
@@ -166,7 +150,7 @@ static inline void mem_cgroup_dec_page_stat(struct page *page,
166unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, 150unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
167 gfp_t gfp_mask, 151 gfp_t gfp_mask,
168 unsigned long *total_scanned); 152 unsigned long *total_scanned);
169u64 mem_cgroup_get_limit(struct mem_cgroup *mem); 153u64 mem_cgroup_get_limit(struct mem_cgroup *memcg);
170 154
171void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); 155void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
172#ifdef CONFIG_TRANSPARENT_HUGEPAGE 156#ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -262,18 +246,20 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm
262 return NULL; 246 return NULL;
263} 247}
264 248
265static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) 249static inline int mm_match_cgroup(struct mm_struct *mm,
250 struct mem_cgroup *memcg)
266{ 251{
267 return 1; 252 return 1;
268} 253}
269 254
270static inline int task_in_mem_cgroup(struct task_struct *task, 255static inline int task_in_mem_cgroup(struct task_struct *task,
271 const struct mem_cgroup *mem) 256 const struct mem_cgroup *memcg)
272{ 257{
273 return 1; 258 return 1;
274} 259}
275 260
276static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem) 261static inline struct cgroup_subsys_state
262 *mem_cgroup_css(struct mem_cgroup *memcg)
277{ 263{
278 return NULL; 264 return NULL;
279} 265}
@@ -285,22 +271,22 @@ mem_cgroup_prepare_migration(struct page *page, struct page *newpage,
285 return 0; 271 return 0;
286} 272}
287 273
288static inline void mem_cgroup_end_migration(struct mem_cgroup *mem, 274static inline void mem_cgroup_end_migration(struct mem_cgroup *memcg,
289 struct page *oldpage, struct page *newpage, bool migration_ok) 275 struct page *oldpage, struct page *newpage, bool migration_ok)
290{ 276{
291} 277}
292 278
293static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem) 279static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *memcg)
294{ 280{
295 return 0; 281 return 0;
296} 282}
297 283
298static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, 284static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *memcg,
299 int priority) 285 int priority)
300{ 286{
301} 287}
302 288
303static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, 289static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *memcg,
304 int priority) 290 int priority)
305{ 291{
306} 292}
@@ -311,13 +297,13 @@ static inline bool mem_cgroup_disabled(void)
311} 297}
312 298
313static inline int 299static inline int
314mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) 300mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg, struct zone *zone)
315{ 301{
316 return 1; 302 return 1;
317} 303}
318 304
319static inline int 305static inline int
320mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) 306mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg, struct zone *zone)
321{ 307{
322 return 1; 308 return 1;
323} 309}
@@ -366,7 +352,7 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
366} 352}
367 353
368static inline 354static inline
369u64 mem_cgroup_get_limit(struct mem_cgroup *mem) 355u64 mem_cgroup_get_limit(struct mem_cgroup *memcg)
370{ 356{
371 return 0; 357 return 0;
372} 358}
diff --git a/include/linux/mfd/ab5500/ab5500.h b/include/linux/mfd/ab5500/ab5500.h
new file mode 100644
index 000000000000..a720051ae933
--- /dev/null
+++ b/include/linux/mfd/ab5500/ab5500.h
@@ -0,0 +1,140 @@
1/*
2 * Copyright (C) ST-Ericsson 2011
3 *
4 * License Terms: GNU General Public License v2
5 */
6#ifndef MFD_AB5500_H
7#define MFD_AB5500_H
8
9#include <linux/device.h>
10
11enum ab5500_devid {
12 AB5500_DEVID_ADC,
13 AB5500_DEVID_LEDS,
14 AB5500_DEVID_POWER,
15 AB5500_DEVID_REGULATORS,
16 AB5500_DEVID_SIM,
17 AB5500_DEVID_RTC,
18 AB5500_DEVID_CHARGER,
19 AB5500_DEVID_FUELGAUGE,
20 AB5500_DEVID_VIBRATOR,
21 AB5500_DEVID_CODEC,
22 AB5500_DEVID_USB,
23 AB5500_DEVID_OTP,
24 AB5500_DEVID_VIDEO,
25 AB5500_DEVID_DBIECI,
26 AB5500_DEVID_ONSWA,
27 AB5500_NUM_DEVICES,
28};
29
30enum ab5500_banks {
31 AB5500_BANK_VIT_IO_I2C_CLK_TST_OTP = 0,
32 AB5500_BANK_VDDDIG_IO_I2C_CLK_TST = 1,
33 AB5500_BANK_VDENC = 2,
34 AB5500_BANK_SIM_USBSIM = 3,
35 AB5500_BANK_LED = 4,
36 AB5500_BANK_ADC = 5,
37 AB5500_BANK_RTC = 6,
38 AB5500_BANK_STARTUP = 7,
39 AB5500_BANK_DBI_ECI = 8,
40 AB5500_BANK_CHG = 9,
41 AB5500_BANK_FG_BATTCOM_ACC = 10,
42 AB5500_BANK_USB = 11,
43 AB5500_BANK_IT = 12,
44 AB5500_BANK_VIBRA = 13,
45 AB5500_BANK_AUDIO_HEADSETUSB = 14,
46 AB5500_NUM_BANKS = 15,
47};
48
49enum ab5500_banks_addr {
50 AB5500_ADDR_VIT_IO_I2C_CLK_TST_OTP = 0x4A,
51 AB5500_ADDR_VDDDIG_IO_I2C_CLK_TST = 0x4B,
52 AB5500_ADDR_VDENC = 0x06,
53 AB5500_ADDR_SIM_USBSIM = 0x04,
54 AB5500_ADDR_LED = 0x10,
55 AB5500_ADDR_ADC = 0x0A,
56 AB5500_ADDR_RTC = 0x0F,
57 AB5500_ADDR_STARTUP = 0x03,
58 AB5500_ADDR_DBI_ECI = 0x07,
59 AB5500_ADDR_CHG = 0x0B,
60 AB5500_ADDR_FG_BATTCOM_ACC = 0x0C,
61 AB5500_ADDR_USB = 0x05,
62 AB5500_ADDR_IT = 0x0E,
63 AB5500_ADDR_VIBRA = 0x02,
64 AB5500_ADDR_AUDIO_HEADSETUSB = 0x0D,
65};
66
67/*
68 * Interrupt register offsets
69 * Bank : 0x0E
70 */
71#define AB5500_IT_SOURCE0_REG 0x20
72#define AB5500_IT_SOURCE1_REG 0x21
73#define AB5500_IT_SOURCE2_REG 0x22
74#define AB5500_IT_SOURCE3_REG 0x23
75#define AB5500_IT_SOURCE4_REG 0x24
76#define AB5500_IT_SOURCE5_REG 0x25
77#define AB5500_IT_SOURCE6_REG 0x26
78#define AB5500_IT_SOURCE7_REG 0x27
79#define AB5500_IT_SOURCE8_REG 0x28
80#define AB5500_IT_SOURCE9_REG 0x29
81#define AB5500_IT_SOURCE10_REG 0x2A
82#define AB5500_IT_SOURCE11_REG 0x2B
83#define AB5500_IT_SOURCE12_REG 0x2C
84#define AB5500_IT_SOURCE13_REG 0x2D
85#define AB5500_IT_SOURCE14_REG 0x2E
86#define AB5500_IT_SOURCE15_REG 0x2F
87#define AB5500_IT_SOURCE16_REG 0x30
88#define AB5500_IT_SOURCE17_REG 0x31
89#define AB5500_IT_SOURCE18_REG 0x32
90#define AB5500_IT_SOURCE19_REG 0x33
91#define AB5500_IT_SOURCE20_REG 0x34
92#define AB5500_IT_SOURCE21_REG 0x35
93#define AB5500_IT_SOURCE22_REG 0x36
94#define AB5500_IT_SOURCE23_REG 0x37
95
96#define AB5500_NUM_IRQ_REGS 23
97
98/**
99 * struct ab5500
100 * @access_mutex: lock out concurrent accesses to the AB registers
101 * @dev: a pointer to the device struct for this chip driver
102 * @ab5500_irq: the analog baseband irq
103 * @irq_base: the platform configuration irq base for subdevices
104 * @chip_name: name of this chip variant
105 * @chip_id: 8 bit chip ID for this chip variant
106 * @irq_lock: a lock to protect the mask
107 * @abb_events: a local bit mask of the prcmu wakeup events
108 * @event_mask: a local copy of the mask event registers
109 * @last_event_mask: a copy of the last event_mask written to hardware
110 * @startup_events: a copy of the first reading of the event registers
111 * @startup_events_read: whether the first events have been read
112 */
113struct ab5500 {
114 struct mutex access_mutex;
115 struct device *dev;
116 unsigned int ab5500_irq;
117 unsigned int irq_base;
118 char chip_name[32];
119 u8 chip_id;
120 struct mutex irq_lock;
121 u32 abb_events;
122 u8 mask[AB5500_NUM_IRQ_REGS];
123 u8 oldmask[AB5500_NUM_IRQ_REGS];
124 u8 startup_events[AB5500_NUM_IRQ_REGS];
125 bool startup_events_read;
126#ifdef CONFIG_DEBUG_FS
127 unsigned int debug_bank;
128 unsigned int debug_address;
129#endif
130};
131
132struct ab5500_platform_data {
133 struct {unsigned int base; unsigned int count; } irq;
134 void *dev_data[AB5500_NUM_DEVICES];
135 struct abx500_init_settings *init_settings;
136 unsigned int init_settings_sz;
137 bool pm_power_off;
138};
139
140#endif /* MFD_AB5500_H */
diff --git a/include/linux/mfd/ab8500/gpadc.h b/include/linux/mfd/ab8500/gpadc.h
index 46b954011f16..252966769d93 100644
--- a/include/linux/mfd/ab8500/gpadc.h
+++ b/include/linux/mfd/ab8500/gpadc.h
@@ -27,6 +27,9 @@
27struct ab8500_gpadc; 27struct ab8500_gpadc;
28 28
29struct ab8500_gpadc *ab8500_gpadc_get(char *name); 29struct ab8500_gpadc *ab8500_gpadc_get(char *name);
30int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 input); 30int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 channel);
31int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel);
32int ab8500_gpadc_ad_to_voltage(struct ab8500_gpadc *gpadc,
33 u8 channel, int ad_value);
31 34
32#endif /* _AB8500_GPADC_H */ 35#endif /* _AB8500_GPADC_H */
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 896b5e47f16e..9970337ff041 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -6,7 +6,7 @@
6 * 6 *
7 * ABX500 core access functions. 7 * ABX500 core access functions.
8 * The abx500 interface is used for the Analog Baseband chip 8 * The abx500 interface is used for the Analog Baseband chip
9 * ab3100, ab3550, ab5500, and ab8500. 9 * ab3100, ab5500, and ab8500.
10 * 10 *
11 * Author: Mattias Wallin <mattias.wallin@stericsson.com> 11 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
12 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com> 12 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
@@ -29,17 +29,16 @@
29#define AB3100_P1G 0xc6 29#define AB3100_P1G 0xc6
30#define AB3100_R2A 0xc7 30#define AB3100_R2A 0xc7
31#define AB3100_R2B 0xc8 31#define AB3100_R2B 0xc8
32#define AB3550_P1A 0x10
33#define AB5500_1_0 0x20 32#define AB5500_1_0 0x20
34#define AB5500_2_0 0x21 33#define AB5500_1_1 0x21
35#define AB5500_2_1 0x22 34#define AB5500_2_0 0x24
36 35
37/* AB8500 CIDs*/ 36/* AB8500 CIDs*/
38#define AB8500_CUTEARLY 0x00
39#define AB8500_CUT1P0 0x10 37#define AB8500_CUT1P0 0x10
40#define AB8500_CUT1P1 0x11 38#define AB8500_CUT1P1 0x11
41#define AB8500_CUT2P0 0x20 39#define AB8500_CUT2P0 0x20
42#define AB8500_CUT3P0 0x30 40#define AB8500_CUT3P0 0x30
41#define AB8500_CUT3P3 0x33
43 42
44/* 43/*
45 * AB3100, EVENTA1, A2 and A3 event register flags 44 * AB3100, EVENTA1, A2 and A3 event register flags
@@ -143,39 +142,6 @@ int ab3100_event_register(struct ab3100 *ab3100,
143int ab3100_event_unregister(struct ab3100 *ab3100, 142int ab3100_event_unregister(struct ab3100 *ab3100,
144 struct notifier_block *nb); 143 struct notifier_block *nb);
145 144
146/* AB3550, STR register flags */
147#define AB3550_STR_ONSWA (0x01)
148#define AB3550_STR_ONSWB (0x02)
149#define AB3550_STR_ONSWC (0x04)
150#define AB3550_STR_DCIO (0x08)
151#define AB3550_STR_BOOT_MODE (0x10)
152#define AB3550_STR_SIM_OFF (0x20)
153#define AB3550_STR_BATT_REMOVAL (0x40)
154#define AB3550_STR_VBUS (0x80)
155
156/* Interrupt mask registers */
157#define AB3550_IMR1 0x29
158#define AB3550_IMR2 0x2a
159#define AB3550_IMR3 0x2b
160#define AB3550_IMR4 0x2c
161#define AB3550_IMR5 0x2d
162
163enum ab3550_devid {
164 AB3550_DEVID_ADC,
165 AB3550_DEVID_DAC,
166 AB3550_DEVID_LEDS,
167 AB3550_DEVID_POWER,
168 AB3550_DEVID_REGULATORS,
169 AB3550_DEVID_SIM,
170 AB3550_DEVID_UART,
171 AB3550_DEVID_RTC,
172 AB3550_DEVID_CHARGER,
173 AB3550_DEVID_FUELGAUGE,
174 AB3550_DEVID_VIBRATOR,
175 AB3550_DEVID_CODEC,
176 AB3550_NUM_DEVICES,
177};
178
179/** 145/**
180 * struct abx500_init_setting 146 * struct abx500_init_setting
181 * Initial value of the registers for driver to use during setup. 147 * Initial value of the registers for driver to use during setup.
@@ -186,18 +152,6 @@ struct abx500_init_settings {
186 u8 setting; 152 u8 setting;
187}; 153};
188 154
189/**
190 * struct ab3550_platform_data
191 * Data supplied to initialize board connections to the AB3550
192 */
193struct ab3550_platform_data {
194 struct {unsigned int base; unsigned int count; } irq;
195 void *dev_data[AB3550_NUM_DEVICES];
196 size_t dev_data_sz[AB3550_NUM_DEVICES];
197 struct abx500_init_settings *init_settings;
198 unsigned int init_settings_sz;
199};
200
201int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, 155int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
202 u8 value); 156 u8 value);
203int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg, 157int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg,
diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h
index f0977986402c..9890687f582d 100644
--- a/include/linux/mfd/db5500-prcmu.h
+++ b/include/linux/mfd/db5500-prcmu.h
@@ -5,21 +5,35 @@
5 * 5 *
6 * U5500 PRCMU API. 6 * U5500 PRCMU API.
7 */ 7 */
8#ifndef __MACH_PRCMU_U5500_H 8#ifndef __MFD_DB5500_PRCMU_H
9#define __MACH_PRCMU_U5500_H 9#define __MFD_DB5500_PRCMU_H
10 10
11#ifdef CONFIG_UX500_SOC_DB5500 11#ifdef CONFIG_MFD_DB5500_PRCMU
12 12
13void db5500_prcmu_early_init(void); 13void db5500_prcmu_early_init(void);
14 14int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state);
15int db5500_prcmu_set_display_clocks(void);
16int db5500_prcmu_disable_dsipll(void);
17int db5500_prcmu_enable_dsipll(void);
15int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); 18int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
16int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); 19int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
20void db5500_prcmu_enable_wakeups(u32 wakeups);
21int db5500_prcmu_request_clock(u8 clock, bool enable);
22void db5500_prcmu_config_abb_event_readout(u32 abb_events);
23void db5500_prcmu_get_abb_event_buffer(void __iomem **buf);
24int prcmu_resetout(u8 resoutn, u8 state);
25int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk,
26 bool keep_ap_pll);
27int db5500_prcmu_config_esram0_deep_sleep(u8 state);
28void db5500_prcmu_system_reset(u16 reset_code);
29u16 db5500_prcmu_get_reset_code(void);
30bool db5500_prcmu_is_ac_wake_requested(void);
31int db5500_prcmu_set_arm_opp(u8 opp);
32int db5500_prcmu_get_arm_opp(void);
17 33
18#else /* !CONFIG_UX500_SOC_DB5500 */ 34#else /* !CONFIG_UX500_SOC_DB5500 */
19 35
20static inline void db5500_prcmu_early_init(void) 36static inline void db5500_prcmu_early_init(void) {}
21{
22}
23 37
24static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) 38static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)
25{ 39{
@@ -31,15 +45,75 @@ static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
31 return -ENOSYS; 45 return -ENOSYS;
32} 46}
33 47
34#endif /* CONFIG_UX500_SOC_DB5500 */ 48static inline int db5500_prcmu_request_clock(u8 clock, bool enable)
49{
50 return 0;
51}
52
53static inline int db5500_prcmu_set_display_clocks(void)
54{
55 return 0;
56}
57
58static inline int db5500_prcmu_disable_dsipll(void)
59{
60 return 0;
61}
62
63static inline int db5500_prcmu_enable_dsipll(void)
64{
65 return 0;
66}
35 67
36static inline int db5500_prcmu_config_abb_event_readout(u32 abb_events) 68static inline int db5500_prcmu_config_esram0_deep_sleep(u8 state)
37{ 69{
38#ifdef CONFIG_MACH_U5500_SIMULATOR
39 return 0; 70 return 0;
40#else
41 return -1;
42#endif
43} 71}
44 72
45#endif /* __MACH_PRCMU_U5500_H */ 73static inline void db5500_prcmu_enable_wakeups(u32 wakeups) {}
74
75static inline int prcmu_resetout(u8 resoutn, u8 state)
76{
77 return 0;
78}
79
80static inline int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state)
81{
82 return 0;
83}
84
85static inline void db5500_prcmu_get_abb_event_buffer(void __iomem **buf) {}
86static inline void db5500_prcmu_config_abb_event_readout(u32 abb_events) {}
87
88static inline int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk,
89 bool keep_ap_pll)
90{
91 return 0;
92}
93
94static inline void db5500_prcmu_system_reset(u16 reset_code) {}
95
96static inline u16 db5500_prcmu_get_reset_code(void)
97{
98 return 0;
99}
100
101static inline bool db5500_prcmu_is_ac_wake_requested(void)
102{
103 return 0;
104}
105
106static inline int db5500_prcmu_set_arm_opp(u8 opp)
107{
108 return 0;
109}
110
111static inline int db5500_prcmu_get_arm_opp(void)
112{
113 return 0;
114}
115
116
117#endif /* CONFIG_MFD_DB5500_PRCMU */
118
119#endif /* __MFD_DB5500_PRCMU_H */
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
index 917dbcab701c..60d27f7bfc1f 100644
--- a/include/linux/mfd/db8500-prcmu.h
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -11,7 +11,6 @@
11#define __MFD_DB8500_PRCMU_H 11#define __MFD_DB8500_PRCMU_H
12 12
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/notifier.h>
15 14
16/* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ 15/* This portion previously known as <mach/prcmu-fw-defs_v1.h> */
17 16
@@ -133,7 +132,7 @@ enum ap_pwrst {
133 * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle 132 * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle
134 */ 133 */
135enum ap_pwrst_trans { 134enum ap_pwrst_trans {
136 NO_TRANSITION = 0x00, 135 PRCMU_AP_NO_CHANGE = 0x00,
137 APEXECUTE_TO_APSLEEP = 0x01, 136 APEXECUTE_TO_APSLEEP = 0x01,
138 APIDLE_TO_APSLEEP = 0x02, /* To be removed */ 137 APIDLE_TO_APSLEEP = 0x02, /* To be removed */
139 PRCMU_AP_SLEEP = 0x01, 138 PRCMU_AP_SLEEP = 0x01,
@@ -146,54 +145,6 @@ enum ap_pwrst_trans {
146}; 145};
147 146
148/** 147/**
149 * enum ddr_pwrst - DDR power states definition
150 * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged
151 * @DDR_PWR_STATE_ON:
152 * @DDR_PWR_STATE_OFFLOWLAT:
153 * @DDR_PWR_STATE_OFFHIGHLAT:
154 */
155enum ddr_pwrst {
156 DDR_PWR_STATE_UNCHANGED = 0x00,
157 DDR_PWR_STATE_ON = 0x01,
158 DDR_PWR_STATE_OFFLOWLAT = 0x02,
159 DDR_PWR_STATE_OFFHIGHLAT = 0x03
160};
161
162/**
163 * enum arm_opp - ARM OPP states definition
164 * @ARM_OPP_INIT:
165 * @ARM_NO_CHANGE: The ARM operating point is unchanged
166 * @ARM_100_OPP: The new ARM operating point is arm100opp
167 * @ARM_50_OPP: The new ARM operating point is arm50opp
168 * @ARM_MAX_OPP: Operating point is "max" (more than 100)
169 * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100
170 * @ARM_EXTCLK: The new ARM operating point is armExtClk
171 */
172enum arm_opp {
173 ARM_OPP_INIT = 0x00,
174 ARM_NO_CHANGE = 0x01,
175 ARM_100_OPP = 0x02,
176 ARM_50_OPP = 0x03,
177 ARM_MAX_OPP = 0x04,
178 ARM_MAX_FREQ100OPP = 0x05,
179 ARM_EXTCLK = 0x07
180};
181
182/**
183 * enum ape_opp - APE OPP states definition
184 * @APE_OPP_INIT:
185 * @APE_NO_CHANGE: The APE operating point is unchanged
186 * @APE_100_OPP: The new APE operating point is ape100opp
187 * @APE_50_OPP: 50%
188 */
189enum ape_opp {
190 APE_OPP_INIT = 0x00,
191 APE_NO_CHANGE = 0x01,
192 APE_100_OPP = 0x02,
193 APE_50_OPP = 0x03
194};
195
196/**
197 * enum hw_acc_state - State definition for hardware accelerator 148 * enum hw_acc_state - State definition for hardware accelerator
198 * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged 149 * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged
199 * @HW_OFF: The hardware accelerator must be switched off 150 * @HW_OFF: The hardware accelerator must be switched off
@@ -469,26 +420,6 @@ enum auto_enable {
469 420
470/* End of file previously known as prcmu-fw-defs_v1.h */ 421/* End of file previously known as prcmu-fw-defs_v1.h */
471 422
472/* PRCMU Wakeup defines */
473enum prcmu_wakeup_index {
474 PRCMU_WAKEUP_INDEX_RTC,
475 PRCMU_WAKEUP_INDEX_RTT0,
476 PRCMU_WAKEUP_INDEX_RTT1,
477 PRCMU_WAKEUP_INDEX_HSI0,
478 PRCMU_WAKEUP_INDEX_HSI1,
479 PRCMU_WAKEUP_INDEX_USB,
480 PRCMU_WAKEUP_INDEX_ABB,
481 PRCMU_WAKEUP_INDEX_ABB_FIFO,
482 PRCMU_WAKEUP_INDEX_ARM,
483 NUM_PRCMU_WAKEUP_INDICES
484};
485#define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name))
486
487/* PRCMU QoS APE OPP class */
488#define PRCMU_QOS_APE_OPP 1
489#define PRCMU_QOS_DDR_OPP 2
490#define PRCMU_QOS_DEFAULT_VALUE -1
491
492/** 423/**
493 * enum hw_acc_dev - enum for hw accelerators 424 * enum hw_acc_dev - enum for hw accelerators
494 * @HW_ACC_SVAMMDSP: for SVAMMDSP 425 * @HW_ACC_SVAMMDSP: for SVAMMDSP
@@ -527,64 +458,6 @@ enum hw_acc_dev {
527}; 458};
528 459
529/* 460/*
530 * Ids for all EPODs (power domains)
531 * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP
532 * - EPOD_ID_SVAPIPE: power domain for SVA pipe
533 * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP
534 * - EPOD_ID_SIAPIPE: power domain for SIA pipe
535 * - EPOD_ID_SGA: power domain for SGA
536 * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE
537 * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2
538 * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4
539 * - NUM_EPOD_ID: number of power domains
540 */
541#define EPOD_ID_SVAMMDSP 0
542#define EPOD_ID_SVAPIPE 1
543#define EPOD_ID_SIAMMDSP 2
544#define EPOD_ID_SIAPIPE 3
545#define EPOD_ID_SGA 4
546#define EPOD_ID_B2R2_MCDE 5
547#define EPOD_ID_ESRAM12 6
548#define EPOD_ID_ESRAM34 7
549#define NUM_EPOD_ID 8
550
551/*
552 * state definition for EPOD (power domain)
553 * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged
554 * - EPOD_STATE_OFF: The EPOD is switched off
555 * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in
556 * retention
557 * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off
558 * - EPOD_STATE_ON: Same as above, but with clock enabled
559 */
560#define EPOD_STATE_NO_CHANGE 0x00
561#define EPOD_STATE_OFF 0x01
562#define EPOD_STATE_RAMRET 0x02
563#define EPOD_STATE_ON_CLK_OFF 0x03
564#define EPOD_STATE_ON 0x04
565
566/*
567 * CLKOUT sources
568 */
569#define PRCMU_CLKSRC_CLK38M 0x00
570#define PRCMU_CLKSRC_ACLK 0x01
571#define PRCMU_CLKSRC_SYSCLK 0x02
572#define PRCMU_CLKSRC_LCDCLK 0x03
573#define PRCMU_CLKSRC_SDMMCCLK 0x04
574#define PRCMU_CLKSRC_TVCLK 0x05
575#define PRCMU_CLKSRC_TIMCLK 0x06
576#define PRCMU_CLKSRC_CLK009 0x07
577/* These are only valid for CLKOUT1: */
578#define PRCMU_CLKSRC_SIAMMDSPCLK 0x40
579#define PRCMU_CLKSRC_I2CCLK 0x41
580#define PRCMU_CLKSRC_MSP02CLK 0x42
581#define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43
582#define PRCMU_CLKSRC_HSIRXCLK 0x44
583#define PRCMU_CLKSRC_HSITXCLK 0x45
584#define PRCMU_CLKSRC_ARMCLKFIX 0x46
585#define PRCMU_CLKSRC_HDMICLK 0x47
586
587/*
588 * Definitions for autonomous power management configuration. 461 * Definitions for autonomous power management configuration.
589 */ 462 */
590 463
@@ -620,88 +493,12 @@ struct prcmu_auto_pm_config {
620 u8 sva_policy; 493 u8 sva_policy;
621}; 494};
622 495
623/**
624 * enum ddr_opp - DDR OPP states definition
625 * @DDR_100_OPP: The new DDR operating point is ddr100opp
626 * @DDR_50_OPP: The new DDR operating point is ddr50opp
627 * @DDR_25_OPP: The new DDR operating point is ddr25opp
628 */
629enum ddr_opp {
630 DDR_100_OPP = 0x00,
631 DDR_50_OPP = 0x01,
632 DDR_25_OPP = 0x02,
633};
634
635/*
636 * Clock identifiers.
637 */
638enum prcmu_clock {
639 PRCMU_SGACLK,
640 PRCMU_UARTCLK,
641 PRCMU_MSP02CLK,
642 PRCMU_MSP1CLK,
643 PRCMU_I2CCLK,
644 PRCMU_SDMMCCLK,
645 PRCMU_SLIMCLK,
646 PRCMU_PER1CLK,
647 PRCMU_PER2CLK,
648 PRCMU_PER3CLK,
649 PRCMU_PER5CLK,
650 PRCMU_PER6CLK,
651 PRCMU_PER7CLK,
652 PRCMU_LCDCLK,
653 PRCMU_BMLCLK,
654 PRCMU_HSITXCLK,
655 PRCMU_HSIRXCLK,
656 PRCMU_HDMICLK,
657 PRCMU_APEATCLK,
658 PRCMU_APETRACECLK,
659 PRCMU_MCDECLK,
660 PRCMU_IPI2CCLK,
661 PRCMU_DSIALTCLK,
662 PRCMU_DMACLK,
663 PRCMU_B2R2CLK,
664 PRCMU_TVCLK,
665 PRCMU_SSPCLK,
666 PRCMU_RNGCLK,
667 PRCMU_UICCCLK,
668 PRCMU_NUM_REG_CLOCKS,
669 PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS,
670 PRCMU_TIMCLK,
671};
672
673/*
674 * Definitions for controlling ESRAM0 in deep sleep.
675 */
676#define ESRAM0_DEEP_SLEEP_STATE_OFF 1
677#define ESRAM0_DEEP_SLEEP_STATE_RET 2
678
679#ifdef CONFIG_MFD_DB8500_PRCMU
680void __init prcmu_early_init(void);
681int prcmu_set_display_clocks(void);
682int prcmu_disable_dsipll(void);
683int prcmu_enable_dsipll(void);
684#else
685static inline void __init prcmu_early_init(void) {}
686#endif
687
688#ifdef CONFIG_MFD_DB8500_PRCMU 496#ifdef CONFIG_MFD_DB8500_PRCMU
689 497
498void db8500_prcmu_early_init(void);
690int prcmu_set_rc_a2p(enum romcode_write); 499int prcmu_set_rc_a2p(enum romcode_write);
691enum romcode_read prcmu_get_rc_p2a(void); 500enum romcode_read prcmu_get_rc_p2a(void);
692enum ap_pwrst prcmu_get_xp70_current_state(void); 501enum ap_pwrst prcmu_get_xp70_current_state(void);
693int prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll);
694
695void prcmu_enable_wakeups(u32 wakeups);
696static inline void prcmu_disable_wakeups(void)
697{
698 prcmu_enable_wakeups(0);
699}
700
701void prcmu_config_abb_event_readout(u32 abb_events);
702void prcmu_get_abb_event_buffer(void __iomem **buf);
703int prcmu_set_arm_opp(u8 opp);
704int prcmu_get_arm_opp(void);
705bool prcmu_has_arm_maxopp(void); 502bool prcmu_has_arm_maxopp(void);
706bool prcmu_is_u8400(void); 503bool prcmu_is_u8400(void);
707int prcmu_set_ape_opp(u8 opp); 504int prcmu_set_ape_opp(u8 opp);
@@ -710,19 +507,14 @@ int prcmu_request_ape_opp_100_voltage(bool enable);
710int prcmu_release_usb_wakeup_state(void); 507int prcmu_release_usb_wakeup_state(void);
711int prcmu_set_ddr_opp(u8 opp); 508int prcmu_set_ddr_opp(u8 opp);
712int prcmu_get_ddr_opp(void); 509int prcmu_get_ddr_opp(void);
713unsigned long prcmu_qos_get_cpufreq_opp_delay(void);
714void prcmu_qos_set_cpufreq_opp_delay(unsigned long);
715/* NOTE! Use regulator framework instead */ 510/* NOTE! Use regulator framework instead */
716int prcmu_set_hwacc(u16 hw_acc_dev, u8 state); 511int prcmu_set_hwacc(u16 hw_acc_dev, u8 state);
717int prcmu_set_epod(u16 epod_id, u8 epod_state);
718void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, 512void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep,
719 struct prcmu_auto_pm_config *idle); 513 struct prcmu_auto_pm_config *idle);
720bool prcmu_is_auto_pm_enabled(void); 514bool prcmu_is_auto_pm_enabled(void);
721 515
722int prcmu_config_clkout(u8 clkout, u8 source, u8 div); 516int prcmu_config_clkout(u8 clkout, u8 source, u8 div);
723int prcmu_request_clock(u8 clock, bool enable);
724int prcmu_set_clock_divider(u8 clock, u8 divider); 517int prcmu_set_clock_divider(u8 clock, u8 divider);
725int prcmu_config_esram0_deep_sleep(u8 state);
726int prcmu_config_hotdog(u8 threshold); 518int prcmu_config_hotdog(u8 threshold);
727int prcmu_config_hotmon(u8 low, u8 high); 519int prcmu_config_hotmon(u8 low, u8 high);
728int prcmu_start_temp_sense(u16 cycles32k); 520int prcmu_start_temp_sense(u16 cycles32k);
@@ -732,14 +524,36 @@ int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
732 524
733void prcmu_ac_wake_req(void); 525void prcmu_ac_wake_req(void);
734void prcmu_ac_sleep_req(void); 526void prcmu_ac_sleep_req(void);
735void prcmu_system_reset(u16 reset_code);
736void prcmu_modem_reset(void); 527void prcmu_modem_reset(void);
737bool prcmu_is_ac_wake_requested(void);
738void prcmu_enable_spi2(void); 528void prcmu_enable_spi2(void);
739void prcmu_disable_spi2(void); 529void prcmu_disable_spi2(void);
740 530
531int prcmu_config_a9wdog(u8 num, bool sleep_auto_off);
532int prcmu_enable_a9wdog(u8 id);
533int prcmu_disable_a9wdog(u8 id);
534int prcmu_kick_a9wdog(u8 id);
535int prcmu_load_a9wdog(u8 id, u32 val);
536
537void db8500_prcmu_system_reset(u16 reset_code);
538int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll);
539void db8500_prcmu_enable_wakeups(u32 wakeups);
540int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state);
541int db8500_prcmu_request_clock(u8 clock, bool enable);
542int db8500_prcmu_set_display_clocks(void);
543int db8500_prcmu_disable_dsipll(void);
544int db8500_prcmu_enable_dsipll(void);
545void db8500_prcmu_config_abb_event_readout(u32 abb_events);
546void db8500_prcmu_get_abb_event_buffer(void __iomem **buf);
547int db8500_prcmu_config_esram0_deep_sleep(u8 state);
548u16 db8500_prcmu_get_reset_code(void);
549bool db8500_prcmu_is_ac_wake_requested(void);
550int db8500_prcmu_set_arm_opp(u8 opp);
551int db8500_prcmu_get_arm_opp(void);
552
741#else /* !CONFIG_MFD_DB8500_PRCMU */ 553#else /* !CONFIG_MFD_DB8500_PRCMU */
742 554
555static inline void db8500_prcmu_early_init(void) {}
556
743static inline int prcmu_set_rc_a2p(enum romcode_write code) 557static inline int prcmu_set_rc_a2p(enum romcode_write code)
744{ 558{
745 return 0; 559 return 0;
@@ -755,34 +569,12 @@ static inline enum ap_pwrst prcmu_get_xp70_current_state(void)
755 return AP_EXECUTE; 569 return AP_EXECUTE;
756} 570}
757 571
758static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, 572static inline bool prcmu_has_arm_maxopp(void)
759 bool keep_ap_pll)
760{
761 return 0;
762}
763
764static inline void prcmu_enable_wakeups(u32 wakeups) {}
765
766static inline void prcmu_disable_wakeups(void) {}
767
768static inline void prcmu_config_abb_event_readout(u32 abb_events) {}
769
770static inline int prcmu_set_arm_opp(u8 opp)
771{
772 return 0;
773}
774
775static inline int prcmu_get_arm_opp(void)
776{
777 return ARM_100_OPP;
778}
779
780static bool prcmu_has_arm_maxopp(void)
781{ 573{
782 return false; 574 return false;
783} 575}
784 576
785static bool prcmu_is_u8400(void) 577static inline bool prcmu_is_u8400(void)
786{ 578{
787 return false; 579 return false;
788} 580}
@@ -817,13 +609,6 @@ static inline int prcmu_get_ddr_opp(void)
817 return DDR_100_OPP; 609 return DDR_100_OPP;
818} 610}
819 611
820static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void)
821{
822 return 0;
823}
824
825static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {}
826
827static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state) 612static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state)
828{ 613{
829 return 0; 614 return 0;
@@ -844,21 +629,11 @@ static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div)
844 return 0; 629 return 0;
845} 630}
846 631
847static inline int prcmu_request_clock(u8 clock, bool enable)
848{
849 return 0;
850}
851
852static inline int prcmu_set_clock_divider(u8 clock, u8 divider) 632static inline int prcmu_set_clock_divider(u8 clock, u8 divider)
853{ 633{
854 return 0; 634 return 0;
855} 635}
856 636
857int prcmu_config_esram0_deep_sleep(u8 state)
858{
859 return 0;
860}
861
862static inline int prcmu_config_hotdog(u8 threshold) 637static inline int prcmu_config_hotdog(u8 threshold)
863{ 638{
864 return 0; 639 return 0;
@@ -893,86 +668,107 @@ static inline void prcmu_ac_wake_req(void) {}
893 668
894static inline void prcmu_ac_sleep_req(void) {} 669static inline void prcmu_ac_sleep_req(void) {}
895 670
896static inline void prcmu_system_reset(u16 reset_code) {}
897
898static inline void prcmu_modem_reset(void) {} 671static inline void prcmu_modem_reset(void) {}
899 672
900static inline bool prcmu_is_ac_wake_requested(void) 673static inline int prcmu_enable_spi2(void)
901{ 674{
902 return false; 675 return 0;
903} 676}
904 677
905#ifndef CONFIG_UX500_SOC_DB5500 678static inline int prcmu_disable_spi2(void)
906static inline int prcmu_set_display_clocks(void)
907{ 679{
908 return 0; 680 return 0;
909} 681}
910 682
911static inline int prcmu_disable_dsipll(void) 683static inline void db8500_prcmu_system_reset(u16 reset_code) {}
684
685static inline int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk,
686 bool keep_ap_pll)
912{ 687{
913 return 0; 688 return 0;
914} 689}
915 690
916static inline int prcmu_enable_dsipll(void) 691static inline void db8500_prcmu_enable_wakeups(u32 wakeups) {}
692
693static inline int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state)
917{ 694{
918 return 0; 695 return 0;
919} 696}
920#endif
921 697
922static inline int prcmu_enable_spi2(void) 698static inline int db8500_prcmu_request_clock(u8 clock, bool enable)
923{ 699{
924 return 0; 700 return 0;
925} 701}
926 702
927static inline int prcmu_disable_spi2(void) 703static inline int db8500_prcmu_set_display_clocks(void)
928{ 704{
929 return 0; 705 return 0;
930} 706}
931 707
932#endif /* !CONFIG_MFD_DB8500_PRCMU */ 708static inline int db8500_prcmu_disable_dsipll(void)
709{
710 return 0;
711}
712
713static inline int db8500_prcmu_enable_dsipll(void)
714{
715 return 0;
716}
717
718static inline int db8500_prcmu_config_esram0_deep_sleep(u8 state)
719{
720 return 0;
721}
722
723static inline void db8500_prcmu_config_abb_event_readout(u32 abb_events) {}
933 724
934#ifdef CONFIG_UX500_PRCMU_QOS_POWER 725static inline void db8500_prcmu_get_abb_event_buffer(void __iomem **buf) {}
935int prcmu_qos_requirement(int pm_qos_class); 726
936int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value); 727static inline u16 db8500_prcmu_get_reset_code(void)
937int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value);
938void prcmu_qos_remove_requirement(int pm_qos_class, char *name);
939int prcmu_qos_add_notifier(int prcmu_qos_class,
940 struct notifier_block *notifier);
941int prcmu_qos_remove_notifier(int prcmu_qos_class,
942 struct notifier_block *notifier);
943#else
944static inline int prcmu_qos_requirement(int prcmu_qos_class)
945{ 728{
946 return 0; 729 return 0;
947} 730}
948 731
949static inline int prcmu_qos_add_requirement(int prcmu_qos_class, 732static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off)
950 char *name, s32 value)
951{ 733{
952 return 0; 734 return 0;
953} 735}
954 736
955static inline int prcmu_qos_update_requirement(int prcmu_qos_class, 737static inline int prcmu_enable_a9wdog(u8 id)
956 char *name, s32 new_value)
957{ 738{
958 return 0; 739 return 0;
959} 740}
960 741
961static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name) 742static inline int prcmu_disable_a9wdog(u8 id)
962{ 743{
744 return 0;
963} 745}
964 746
965static inline int prcmu_qos_add_notifier(int prcmu_qos_class, 747static inline int prcmu_kick_a9wdog(u8 id)
966 struct notifier_block *notifier)
967{ 748{
968 return 0; 749 return 0;
969} 750}
970static inline int prcmu_qos_remove_notifier(int prcmu_qos_class, 751
971 struct notifier_block *notifier) 752static inline int prcmu_load_a9wdog(u8 id, u32 val)
972{ 753{
973 return 0; 754 return 0;
974} 755}
975 756
976#endif 757static inline bool db8500_prcmu_is_ac_wake_requested(void)
758{
759 return 0;
760}
761
762static inline int db8500_prcmu_set_arm_opp(u8 opp)
763{
764 return 0;
765}
766
767static inline int db8500_prcmu_get_arm_opp(void)
768{
769 return 0;
770}
771
772#endif /* !CONFIG_MFD_DB8500_PRCMU */
977 773
978#endif /* __MFD_DB8500_PRCMU_H */ 774#endif /* __MFD_DB8500_PRCMU_H */
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
new file mode 100644
index 000000000000..bac942f959c1
--- /dev/null
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -0,0 +1,549 @@
1/*
2 * Copyright (C) ST Ericsson SA 2011
3 *
4 * License Terms: GNU General Public License v2
5 *
6 * STE Ux500 PRCMU API
7 */
8#ifndef __MACH_PRCMU_H
9#define __MACH_PRCMU_H
10
11#include <linux/interrupt.h>
12#include <linux/notifier.h>
13#include <asm/mach-types.h>
14
15/* PRCMU Wakeup defines */
16enum prcmu_wakeup_index {
17 PRCMU_WAKEUP_INDEX_RTC,
18 PRCMU_WAKEUP_INDEX_RTT0,
19 PRCMU_WAKEUP_INDEX_RTT1,
20 PRCMU_WAKEUP_INDEX_HSI0,
21 PRCMU_WAKEUP_INDEX_HSI1,
22 PRCMU_WAKEUP_INDEX_USB,
23 PRCMU_WAKEUP_INDEX_ABB,
24 PRCMU_WAKEUP_INDEX_ABB_FIFO,
25 PRCMU_WAKEUP_INDEX_ARM,
26 PRCMU_WAKEUP_INDEX_CD_IRQ,
27 NUM_PRCMU_WAKEUP_INDICES
28};
29#define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name))
30
31/* EPOD (power domain) IDs */
32
33/*
34 * DB8500 EPODs
35 * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP
36 * - EPOD_ID_SVAPIPE: power domain for SVA pipe
37 * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP
38 * - EPOD_ID_SIAPIPE: power domain for SIA pipe
39 * - EPOD_ID_SGA: power domain for SGA
40 * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE
41 * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2
42 * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4
43 * - NUM_EPOD_ID: number of power domains
44 *
45 * TODO: These should be prefixed.
46 */
47#define EPOD_ID_SVAMMDSP 0
48#define EPOD_ID_SVAPIPE 1
49#define EPOD_ID_SIAMMDSP 2
50#define EPOD_ID_SIAPIPE 3
51#define EPOD_ID_SGA 4
52#define EPOD_ID_B2R2_MCDE 5
53#define EPOD_ID_ESRAM12 6
54#define EPOD_ID_ESRAM34 7
55#define NUM_EPOD_ID 8
56
57/*
58 * DB5500 EPODs
59 */
60#define DB5500_EPOD_ID_BASE 0x0100
61#define DB5500_EPOD_ID_SGA (DB5500_EPOD_ID_BASE + 0)
62#define DB5500_EPOD_ID_HVA (DB5500_EPOD_ID_BASE + 1)
63#define DB5500_EPOD_ID_SIA (DB5500_EPOD_ID_BASE + 2)
64#define DB5500_EPOD_ID_DISP (DB5500_EPOD_ID_BASE + 3)
65#define DB5500_EPOD_ID_ESRAM12 (DB5500_EPOD_ID_BASE + 6)
66#define DB5500_NUM_EPOD_ID 7
67
68/*
69 * state definition for EPOD (power domain)
70 * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged
71 * - EPOD_STATE_OFF: The EPOD is switched off
72 * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in
73 * retention
74 * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off
75 * - EPOD_STATE_ON: Same as above, but with clock enabled
76 */
77#define EPOD_STATE_NO_CHANGE 0x00
78#define EPOD_STATE_OFF 0x01
79#define EPOD_STATE_RAMRET 0x02
80#define EPOD_STATE_ON_CLK_OFF 0x03
81#define EPOD_STATE_ON 0x04
82
83/*
84 * CLKOUT sources
85 */
86#define PRCMU_CLKSRC_CLK38M 0x00
87#define PRCMU_CLKSRC_ACLK 0x01
88#define PRCMU_CLKSRC_SYSCLK 0x02
89#define PRCMU_CLKSRC_LCDCLK 0x03
90#define PRCMU_CLKSRC_SDMMCCLK 0x04
91#define PRCMU_CLKSRC_TVCLK 0x05
92#define PRCMU_CLKSRC_TIMCLK 0x06
93#define PRCMU_CLKSRC_CLK009 0x07
94/* These are only valid for CLKOUT1: */
95#define PRCMU_CLKSRC_SIAMMDSPCLK 0x40
96#define PRCMU_CLKSRC_I2CCLK 0x41
97#define PRCMU_CLKSRC_MSP02CLK 0x42
98#define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43
99#define PRCMU_CLKSRC_HSIRXCLK 0x44
100#define PRCMU_CLKSRC_HSITXCLK 0x45
101#define PRCMU_CLKSRC_ARMCLKFIX 0x46
102#define PRCMU_CLKSRC_HDMICLK 0x47
103
104/*
105 * Clock identifiers.
106 */
107enum prcmu_clock {
108 PRCMU_SGACLK,
109 PRCMU_UARTCLK,
110 PRCMU_MSP02CLK,
111 PRCMU_MSP1CLK,
112 PRCMU_I2CCLK,
113 PRCMU_SDMMCCLK,
114 PRCMU_SLIMCLK,
115 PRCMU_PER1CLK,
116 PRCMU_PER2CLK,
117 PRCMU_PER3CLK,
118 PRCMU_PER5CLK,
119 PRCMU_PER6CLK,
120 PRCMU_PER7CLK,
121 PRCMU_LCDCLK,
122 PRCMU_BMLCLK,
123 PRCMU_HSITXCLK,
124 PRCMU_HSIRXCLK,
125 PRCMU_HDMICLK,
126 PRCMU_APEATCLK,
127 PRCMU_APETRACECLK,
128 PRCMU_MCDECLK,
129 PRCMU_IPI2CCLK,
130 PRCMU_DSIALTCLK,
131 PRCMU_DMACLK,
132 PRCMU_B2R2CLK,
133 PRCMU_TVCLK,
134 PRCMU_SSPCLK,
135 PRCMU_RNGCLK,
136 PRCMU_UICCCLK,
137 PRCMU_PWMCLK,
138 PRCMU_IRDACLK,
139 PRCMU_IRRCCLK,
140 PRCMU_SIACLK,
141 PRCMU_SVACLK,
142 PRCMU_NUM_REG_CLOCKS,
143 PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS,
144 PRCMU_TIMCLK,
145 PRCMU_PLLSOC0,
146 PRCMU_PLLSOC1,
147 PRCMU_PLLDDR,
148};
149
150/**
151 * enum ape_opp - APE OPP states definition
152 * @APE_OPP_INIT:
153 * @APE_NO_CHANGE: The APE operating point is unchanged
154 * @APE_100_OPP: The new APE operating point is ape100opp
155 * @APE_50_OPP: 50%
156 */
157enum ape_opp {
158 APE_OPP_INIT = 0x00,
159 APE_NO_CHANGE = 0x01,
160 APE_100_OPP = 0x02,
161 APE_50_OPP = 0x03
162};
163
164/**
165 * enum arm_opp - ARM OPP states definition
166 * @ARM_OPP_INIT:
167 * @ARM_NO_CHANGE: The ARM operating point is unchanged
168 * @ARM_100_OPP: The new ARM operating point is arm100opp
169 * @ARM_50_OPP: The new ARM operating point is arm50opp
170 * @ARM_MAX_OPP: Operating point is "max" (more than 100)
171 * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100
172 * @ARM_EXTCLK: The new ARM operating point is armExtClk
173 */
174enum arm_opp {
175 ARM_OPP_INIT = 0x00,
176 ARM_NO_CHANGE = 0x01,
177 ARM_100_OPP = 0x02,
178 ARM_50_OPP = 0x03,
179 ARM_MAX_OPP = 0x04,
180 ARM_MAX_FREQ100OPP = 0x05,
181 ARM_EXTCLK = 0x07
182};
183
184/**
185 * enum ddr_opp - DDR OPP states definition
186 * @DDR_100_OPP: The new DDR operating point is ddr100opp
187 * @DDR_50_OPP: The new DDR operating point is ddr50opp
188 * @DDR_25_OPP: The new DDR operating point is ddr25opp
189 */
190enum ddr_opp {
191 DDR_100_OPP = 0x00,
192 DDR_50_OPP = 0x01,
193 DDR_25_OPP = 0x02,
194};
195
196/*
197 * Definitions for controlling ESRAM0 in deep sleep.
198 */
199#define ESRAM0_DEEP_SLEEP_STATE_OFF 1
200#define ESRAM0_DEEP_SLEEP_STATE_RET 2
201
202/**
203 * enum ddr_pwrst - DDR power states definition
204 * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged
205 * @DDR_PWR_STATE_ON:
206 * @DDR_PWR_STATE_OFFLOWLAT:
207 * @DDR_PWR_STATE_OFFHIGHLAT:
208 */
209enum ddr_pwrst {
210 DDR_PWR_STATE_UNCHANGED = 0x00,
211 DDR_PWR_STATE_ON = 0x01,
212 DDR_PWR_STATE_OFFLOWLAT = 0x02,
213 DDR_PWR_STATE_OFFHIGHLAT = 0x03
214};
215
216#include <linux/mfd/db8500-prcmu.h>
217#include <linux/mfd/db5500-prcmu.h>
218
219#if defined(CONFIG_UX500_SOC_DB8500) || defined(CONFIG_UX500_SOC_DB5500)
220
221static inline void __init prcmu_early_init(void)
222{
223 if (machine_is_u5500())
224 return db5500_prcmu_early_init();
225 else
226 return db8500_prcmu_early_init();
227}
228
229static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
230 bool keep_ap_pll)
231{
232 if (machine_is_u5500())
233 return db5500_prcmu_set_power_state(state, keep_ulp_clk,
234 keep_ap_pll);
235 else
236 return db8500_prcmu_set_power_state(state, keep_ulp_clk,
237 keep_ap_pll);
238}
239
240static inline int prcmu_set_epod(u16 epod_id, u8 epod_state)
241{
242 if (machine_is_u5500())
243 return -EINVAL;
244 else
245 return db8500_prcmu_set_epod(epod_id, epod_state);
246}
247
248static inline void prcmu_enable_wakeups(u32 wakeups)
249{
250 if (machine_is_u5500())
251 db5500_prcmu_enable_wakeups(wakeups);
252 else
253 db8500_prcmu_enable_wakeups(wakeups);
254}
255
256static inline void prcmu_disable_wakeups(void)
257{
258 prcmu_enable_wakeups(0);
259}
260
261static inline void prcmu_config_abb_event_readout(u32 abb_events)
262{
263 if (machine_is_u5500())
264 db5500_prcmu_config_abb_event_readout(abb_events);
265 else
266 db8500_prcmu_config_abb_event_readout(abb_events);
267}
268
269static inline void prcmu_get_abb_event_buffer(void __iomem **buf)
270{
271 if (machine_is_u5500())
272 db5500_prcmu_get_abb_event_buffer(buf);
273 else
274 db8500_prcmu_get_abb_event_buffer(buf);
275}
276
277int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
278int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
279
280int prcmu_config_clkout(u8 clkout, u8 source, u8 div);
281
282static inline int prcmu_request_clock(u8 clock, bool enable)
283{
284 if (machine_is_u5500())
285 return db5500_prcmu_request_clock(clock, enable);
286 else
287 return db8500_prcmu_request_clock(clock, enable);
288}
289
290int prcmu_set_ape_opp(u8 opp);
291int prcmu_get_ape_opp(void);
292int prcmu_set_ddr_opp(u8 opp);
293int prcmu_get_ddr_opp(void);
294
295static inline int prcmu_set_arm_opp(u8 opp)
296{
297 if (machine_is_u5500())
298 return -EINVAL;
299 else
300 return db8500_prcmu_set_arm_opp(opp);
301}
302
303static inline int prcmu_get_arm_opp(void)
304{
305 if (machine_is_u5500())
306 return -EINVAL;
307 else
308 return db8500_prcmu_get_arm_opp();
309}
310
311static inline void prcmu_system_reset(u16 reset_code)
312{
313 if (machine_is_u5500())
314 return db5500_prcmu_system_reset(reset_code);
315 else
316 return db8500_prcmu_system_reset(reset_code);
317}
318
319static inline u16 prcmu_get_reset_code(void)
320{
321 if (machine_is_u5500())
322 return db5500_prcmu_get_reset_code();
323 else
324 return db8500_prcmu_get_reset_code();
325}
326
327void prcmu_ac_wake_req(void);
328void prcmu_ac_sleep_req(void);
329void prcmu_modem_reset(void);
330static inline bool prcmu_is_ac_wake_requested(void)
331{
332 if (machine_is_u5500())
333 return db5500_prcmu_is_ac_wake_requested();
334 else
335 return db8500_prcmu_is_ac_wake_requested();
336}
337
338static inline int prcmu_set_display_clocks(void)
339{
340 if (machine_is_u5500())
341 return db5500_prcmu_set_display_clocks();
342 else
343 return db8500_prcmu_set_display_clocks();
344}
345
346static inline int prcmu_disable_dsipll(void)
347{
348 if (machine_is_u5500())
349 return db5500_prcmu_disable_dsipll();
350 else
351 return db8500_prcmu_disable_dsipll();
352}
353
354static inline int prcmu_enable_dsipll(void)
355{
356 if (machine_is_u5500())
357 return db5500_prcmu_enable_dsipll();
358 else
359 return db8500_prcmu_enable_dsipll();
360}
361
362static inline int prcmu_config_esram0_deep_sleep(u8 state)
363{
364 if (machine_is_u5500())
365 return -EINVAL;
366 else
367 return db8500_prcmu_config_esram0_deep_sleep(state);
368}
369#else
370
371static inline void __init prcmu_early_init(void) {}
372
373static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
374 bool keep_ap_pll)
375{
376 return 0;
377}
378
379static inline int prcmu_set_epod(u16 epod_id, u8 epod_state)
380{
381 return 0;
382}
383
384static inline void prcmu_enable_wakeups(u32 wakeups) {}
385
386static inline void prcmu_disable_wakeups(void) {}
387
388static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)
389{
390 return -ENOSYS;
391}
392
393static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
394{
395 return -ENOSYS;
396}
397
398static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div)
399{
400 return 0;
401}
402
403static inline int prcmu_request_clock(u8 clock, bool enable)
404{
405 return 0;
406}
407
408static inline int prcmu_set_ape_opp(u8 opp)
409{
410 return 0;
411}
412
413static inline int prcmu_get_ape_opp(void)
414{
415 return APE_100_OPP;
416}
417
418static inline int prcmu_set_arm_opp(u8 opp)
419{
420 return 0;
421}
422
423static inline int prcmu_get_arm_opp(void)
424{
425 return ARM_100_OPP;
426}
427
428static inline int prcmu_set_ddr_opp(u8 opp)
429{
430 return 0;
431}
432
433static inline int prcmu_get_ddr_opp(void)
434{
435 return DDR_100_OPP;
436}
437
438static inline void prcmu_system_reset(u16 reset_code) {}
439
440static inline u16 prcmu_get_reset_code(void)
441{
442 return 0;
443}
444
445static inline void prcmu_ac_wake_req(void) {}
446
447static inline void prcmu_ac_sleep_req(void) {}
448
449static inline void prcmu_modem_reset(void) {}
450
451static inline bool prcmu_is_ac_wake_requested(void)
452{
453 return false;
454}
455
456static inline int prcmu_set_display_clocks(void)
457{
458 return 0;
459}
460
461static inline int prcmu_disable_dsipll(void)
462{
463 return 0;
464}
465
466static inline int prcmu_enable_dsipll(void)
467{
468 return 0;
469}
470
471static inline int prcmu_config_esram0_deep_sleep(u8 state)
472{
473 return 0;
474}
475
476static inline void prcmu_config_abb_event_readout(u32 abb_events) {}
477
478static inline void prcmu_get_abb_event_buffer(void __iomem **buf)
479{
480 *buf = NULL;
481}
482
483#endif
484
485/* PRCMU QoS APE OPP class */
486#define PRCMU_QOS_APE_OPP 1
487#define PRCMU_QOS_DDR_OPP 2
488#define PRCMU_QOS_DEFAULT_VALUE -1
489
490#ifdef CONFIG_UX500_PRCMU_QOS_POWER
491
492unsigned long prcmu_qos_get_cpufreq_opp_delay(void);
493void prcmu_qos_set_cpufreq_opp_delay(unsigned long);
494void prcmu_qos_force_opp(int, s32);
495int prcmu_qos_requirement(int pm_qos_class);
496int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value);
497int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value);
498void prcmu_qos_remove_requirement(int pm_qos_class, char *name);
499int prcmu_qos_add_notifier(int prcmu_qos_class,
500 struct notifier_block *notifier);
501int prcmu_qos_remove_notifier(int prcmu_qos_class,
502 struct notifier_block *notifier);
503
504#else
505
506static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void)
507{
508 return 0;
509}
510
511static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {}
512
513static inline void prcmu_qos_force_opp(int prcmu_qos_class, s32 i) {}
514
515static inline int prcmu_qos_requirement(int prcmu_qos_class)
516{
517 return 0;
518}
519
520static inline int prcmu_qos_add_requirement(int prcmu_qos_class,
521 char *name, s32 value)
522{
523 return 0;
524}
525
526static inline int prcmu_qos_update_requirement(int prcmu_qos_class,
527 char *name, s32 new_value)
528{
529 return 0;
530}
531
532static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name)
533{
534}
535
536static inline int prcmu_qos_add_notifier(int prcmu_qos_class,
537 struct notifier_block *notifier)
538{
539 return 0;
540}
541static inline int prcmu_qos_remove_notifier(int prcmu_qos_class,
542 struct notifier_block *notifier)
543{
544 return 0;
545}
546
547#endif
548
549#endif /* __MACH_PRCMU_H */
diff --git a/include/linux/mfd/intel_msic.h b/include/linux/mfd/intel_msic.h
new file mode 100644
index 000000000000..439a7a617bc9
--- /dev/null
+++ b/include/linux/mfd/intel_msic.h
@@ -0,0 +1,456 @@
1/*
2 * include/linux/mfd/intel_msic.h - Core interface for Intel MSIC
3 *
4 * Copyright (C) 2011, Intel Corporation
5 * Author: Mika Westerberg <mika.westerberg@linux.intel.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_INTEL_MSIC_H__
13#define __LINUX_MFD_INTEL_MSIC_H__
14
15/* ID */
16#define INTEL_MSIC_ID0 0x000 /* RO */
17#define INTEL_MSIC_ID1 0x001 /* RO */
18
19/* IRQ */
20#define INTEL_MSIC_IRQLVL1 0x002
21#define INTEL_MSIC_ADC1INT 0x003
22#define INTEL_MSIC_CCINT 0x004
23#define INTEL_MSIC_PWRSRCINT 0x005
24#define INTEL_MSIC_PWRSRCINT1 0x006
25#define INTEL_MSIC_CHRINT 0x007
26#define INTEL_MSIC_CHRINT1 0x008
27#define INTEL_MSIC_RTCIRQ 0x009
28#define INTEL_MSIC_GPIO0LVIRQ 0x00a
29#define INTEL_MSIC_GPIO1LVIRQ 0x00b
30#define INTEL_MSIC_GPIOHVIRQ 0x00c
31#define INTEL_MSIC_VRINT 0x00d
32#define INTEL_MSIC_OCAUDIO 0x00e
33#define INTEL_MSIC_ACCDET 0x00f
34#define INTEL_MSIC_RESETIRQ1 0x010
35#define INTEL_MSIC_RESETIRQ2 0x011
36#define INTEL_MSIC_MADC1INT 0x012
37#define INTEL_MSIC_MCCINT 0x013
38#define INTEL_MSIC_MPWRSRCINT 0x014
39#define INTEL_MSIC_MPWRSRCINT1 0x015
40#define INTEL_MSIC_MCHRINT 0x016
41#define INTEL_MSIC_MCHRINT1 0x017
42#define INTEL_MSIC_RTCIRQMASK 0x018
43#define INTEL_MSIC_GPIO0LVIRQMASK 0x019
44#define INTEL_MSIC_GPIO1LVIRQMASK 0x01a
45#define INTEL_MSIC_GPIOHVIRQMASK 0x01b
46#define INTEL_MSIC_VRINTMASK 0x01c
47#define INTEL_MSIC_OCAUDIOMASK 0x01d
48#define INTEL_MSIC_ACCDETMASK 0x01e
49#define INTEL_MSIC_RESETIRQ1MASK 0x01f
50#define INTEL_MSIC_RESETIRQ2MASK 0x020
51#define INTEL_MSIC_IRQLVL1MSK 0x021
52#define INTEL_MSIC_PBCONFIG 0x03e
53#define INTEL_MSIC_PBSTATUS 0x03f /* RO */
54
55/* GPIO */
56#define INTEL_MSIC_GPIO0LV7CTLO 0x040
57#define INTEL_MSIC_GPIO0LV6CTLO 0x041
58#define INTEL_MSIC_GPIO0LV5CTLO 0x042
59#define INTEL_MSIC_GPIO0LV4CTLO 0x043
60#define INTEL_MSIC_GPIO0LV3CTLO 0x044
61#define INTEL_MSIC_GPIO0LV2CTLO 0x045
62#define INTEL_MSIC_GPIO0LV1CTLO 0x046
63#define INTEL_MSIC_GPIO0LV0CTLO 0x047
64#define INTEL_MSIC_GPIO1LV7CTLOS 0x048
65#define INTEL_MSIC_GPIO1LV6CTLO 0x049
66#define INTEL_MSIC_GPIO1LV5CTLO 0x04a
67#define INTEL_MSIC_GPIO1LV4CTLO 0x04b
68#define INTEL_MSIC_GPIO1LV3CTLO 0x04c
69#define INTEL_MSIC_GPIO1LV2CTLO 0x04d
70#define INTEL_MSIC_GPIO1LV1CTLO 0x04e
71#define INTEL_MSIC_GPIO1LV0CTLO 0x04f
72#define INTEL_MSIC_GPIO0LV7CTLI 0x050
73#define INTEL_MSIC_GPIO0LV6CTLI 0x051
74#define INTEL_MSIC_GPIO0LV5CTLI 0x052
75#define INTEL_MSIC_GPIO0LV4CTLI 0x053
76#define INTEL_MSIC_GPIO0LV3CTLI 0x054
77#define INTEL_MSIC_GPIO0LV2CTLI 0x055
78#define INTEL_MSIC_GPIO0LV1CTLI 0x056
79#define INTEL_MSIC_GPIO0LV0CTLI 0x057
80#define INTEL_MSIC_GPIO1LV7CTLIS 0x058
81#define INTEL_MSIC_GPIO1LV6CTLI 0x059
82#define INTEL_MSIC_GPIO1LV5CTLI 0x05a
83#define INTEL_MSIC_GPIO1LV4CTLI 0x05b
84#define INTEL_MSIC_GPIO1LV3CTLI 0x05c
85#define INTEL_MSIC_GPIO1LV2CTLI 0x05d
86#define INTEL_MSIC_GPIO1LV1CTLI 0x05e
87#define INTEL_MSIC_GPIO1LV0CTLI 0x05f
88#define INTEL_MSIC_PWM0CLKDIV1 0x061
89#define INTEL_MSIC_PWM0CLKDIV0 0x062
90#define INTEL_MSIC_PWM1CLKDIV1 0x063
91#define INTEL_MSIC_PWM1CLKDIV0 0x064
92#define INTEL_MSIC_PWM2CLKDIV1 0x065
93#define INTEL_MSIC_PWM2CLKDIV0 0x066
94#define INTEL_MSIC_PWM0DUTYCYCLE 0x067
95#define INTEL_MSIC_PWM1DUTYCYCLE 0x068
96#define INTEL_MSIC_PWM2DUTYCYCLE 0x069
97#define INTEL_MSIC_GPIO0HV3CTLO 0x06d
98#define INTEL_MSIC_GPIO0HV2CTLO 0x06e
99#define INTEL_MSIC_GPIO0HV1CTLO 0x06f
100#define INTEL_MSIC_GPIO0HV0CTLO 0x070
101#define INTEL_MSIC_GPIO1HV3CTLO 0x071
102#define INTEL_MSIC_GPIO1HV2CTLO 0x072
103#define INTEL_MSIC_GPIO1HV1CTLO 0x073
104#define INTEL_MSIC_GPIO1HV0CTLO 0x074
105#define INTEL_MSIC_GPIO0HV3CTLI 0x075
106#define INTEL_MSIC_GPIO0HV2CTLI 0x076
107#define INTEL_MSIC_GPIO0HV1CTLI 0x077
108#define INTEL_MSIC_GPIO0HV0CTLI 0x078
109#define INTEL_MSIC_GPIO1HV3CTLI 0x079
110#define INTEL_MSIC_GPIO1HV2CTLI 0x07a
111#define INTEL_MSIC_GPIO1HV1CTLI 0x07b
112#define INTEL_MSIC_GPIO1HV0CTLI 0x07c
113
114/* SVID */
115#define INTEL_MSIC_SVIDCTRL0 0x080
116#define INTEL_MSIC_SVIDCTRL1 0x081
117#define INTEL_MSIC_SVIDCTRL2 0x082
118#define INTEL_MSIC_SVIDTXLASTPKT3 0x083 /* RO */
119#define INTEL_MSIC_SVIDTXLASTPKT2 0x084 /* RO */
120#define INTEL_MSIC_SVIDTXLASTPKT1 0x085 /* RO */
121#define INTEL_MSIC_SVIDTXLASTPKT0 0x086 /* RO */
122#define INTEL_MSIC_SVIDPKTOUTBYTE3 0x087
123#define INTEL_MSIC_SVIDPKTOUTBYTE2 0x088
124#define INTEL_MSIC_SVIDPKTOUTBYTE1 0x089
125#define INTEL_MSIC_SVIDPKTOUTBYTE0 0x08a
126#define INTEL_MSIC_SVIDRXVPDEBUG1 0x08b
127#define INTEL_MSIC_SVIDRXVPDEBUG0 0x08c
128#define INTEL_MSIC_SVIDRXLASTPKT3 0x08d /* RO */
129#define INTEL_MSIC_SVIDRXLASTPKT2 0x08e /* RO */
130#define INTEL_MSIC_SVIDRXLASTPKT1 0x08f /* RO */
131#define INTEL_MSIC_SVIDRXLASTPKT0 0x090 /* RO */
132#define INTEL_MSIC_SVIDRXCHKSTATUS3 0x091 /* RO */
133#define INTEL_MSIC_SVIDRXCHKSTATUS2 0x092 /* RO */
134#define INTEL_MSIC_SVIDRXCHKSTATUS1 0x093 /* RO */
135#define INTEL_MSIC_SVIDRXCHKSTATUS0 0x094 /* RO */
136
137/* VREG */
138#define INTEL_MSIC_VCCLATCH 0x0c0
139#define INTEL_MSIC_VNNLATCH 0x0c1
140#define INTEL_MSIC_VCCCNT 0x0c2
141#define INTEL_MSIC_SMPSRAMP 0x0c3
142#define INTEL_MSIC_VNNCNT 0x0c4
143#define INTEL_MSIC_VNNAONCNT 0x0c5
144#define INTEL_MSIC_VCC122AONCNT 0x0c6
145#define INTEL_MSIC_V180AONCNT 0x0c7
146#define INTEL_MSIC_V500CNT 0x0c8
147#define INTEL_MSIC_VIHFCNT 0x0c9
148#define INTEL_MSIC_LDORAMP1 0x0ca
149#define INTEL_MSIC_LDORAMP2 0x0cb
150#define INTEL_MSIC_VCC108AONCNT 0x0cc
151#define INTEL_MSIC_VCC108ASCNT 0x0cd
152#define INTEL_MSIC_VCC108CNT 0x0ce
153#define INTEL_MSIC_VCCA100ASCNT 0x0cf
154#define INTEL_MSIC_VCCA100CNT 0x0d0
155#define INTEL_MSIC_VCC180AONCNT 0x0d1
156#define INTEL_MSIC_VCC180CNT 0x0d2
157#define INTEL_MSIC_VCC330CNT 0x0d3
158#define INTEL_MSIC_VUSB330CNT 0x0d4
159#define INTEL_MSIC_VCCSDIOCNT 0x0d5
160#define INTEL_MSIC_VPROG1CNT 0x0d6
161#define INTEL_MSIC_VPROG2CNT 0x0d7
162#define INTEL_MSIC_VEMMCSCNT 0x0d8
163#define INTEL_MSIC_VEMMC1CNT 0x0d9
164#define INTEL_MSIC_VEMMC2CNT 0x0da
165#define INTEL_MSIC_VAUDACNT 0x0db
166#define INTEL_MSIC_VHSPCNT 0x0dc
167#define INTEL_MSIC_VHSNCNT 0x0dd
168#define INTEL_MSIC_VHDMICNT 0x0de
169#define INTEL_MSIC_VOTGCNT 0x0df
170#define INTEL_MSIC_V1P35CNT 0x0e0
171#define INTEL_MSIC_V330AONCNT 0x0e1
172
173/* RESET */
174#define INTEL_MSIC_CHIPCNTRL 0x100 /* WO */
175#define INTEL_MSIC_ERCONFIG 0x101
176
177/* BURST */
178#define INTEL_MSIC_BATCURRENTLIMIT12 0x102
179#define INTEL_MSIC_BATTIMELIMIT12 0x103
180#define INTEL_MSIC_BATTIMELIMIT3 0x104
181#define INTEL_MSIC_BATTIMEDB 0x105
182#define INTEL_MSIC_BRSTCONFIGOUTPUTS 0x106
183#define INTEL_MSIC_BRSTCONFIGACTIONS 0x107
184#define INTEL_MSIC_BURSTCONTROLSTATUS 0x108
185
186/* RTC */
187#define INTEL_MSIC_RTCB1 0x140 /* RO */
188#define INTEL_MSIC_RTCB2 0x141 /* RO */
189#define INTEL_MSIC_RTCB3 0x142 /* RO */
190#define INTEL_MSIC_RTCB4 0x143 /* RO */
191#define INTEL_MSIC_RTCOB1 0x144
192#define INTEL_MSIC_RTCOB2 0x145
193#define INTEL_MSIC_RTCOB3 0x146
194#define INTEL_MSIC_RTCOB4 0x147
195#define INTEL_MSIC_RTCAB1 0x148
196#define INTEL_MSIC_RTCAB2 0x149
197#define INTEL_MSIC_RTCAB3 0x14a
198#define INTEL_MSIC_RTCAB4 0x14b
199#define INTEL_MSIC_RTCWAB1 0x14c
200#define INTEL_MSIC_RTCWAB2 0x14d
201#define INTEL_MSIC_RTCWAB3 0x14e
202#define INTEL_MSIC_RTCWAB4 0x14f
203#define INTEL_MSIC_RTCSC1 0x150
204#define INTEL_MSIC_RTCSC2 0x151
205#define INTEL_MSIC_RTCSC3 0x152
206#define INTEL_MSIC_RTCSC4 0x153
207#define INTEL_MSIC_RTCSTATUS 0x154 /* RO */
208#define INTEL_MSIC_RTCCONFIG1 0x155
209#define INTEL_MSIC_RTCCONFIG2 0x156
210
211/* CHARGER */
212#define INTEL_MSIC_BDTIMER 0x180
213#define INTEL_MSIC_BATTRMV 0x181
214#define INTEL_MSIC_VBUSDET 0x182
215#define INTEL_MSIC_VBUSDET1 0x183
216#define INTEL_MSIC_ADPHVDET 0x184
217#define INTEL_MSIC_ADPLVDET 0x185
218#define INTEL_MSIC_ADPDETDBDM 0x186
219#define INTEL_MSIC_LOWBATTDET 0x187
220#define INTEL_MSIC_CHRCTRL 0x188
221#define INTEL_MSIC_CHRCVOLTAGE 0x189
222#define INTEL_MSIC_CHRCCURRENT 0x18a
223#define INTEL_MSIC_SPCHARGER 0x18b
224#define INTEL_MSIC_CHRTTIME 0x18c
225#define INTEL_MSIC_CHRCTRL1 0x18d
226#define INTEL_MSIC_PWRSRCLMT 0x18e
227#define INTEL_MSIC_CHRSTWDT 0x18f
228#define INTEL_MSIC_WDTWRITE 0x190 /* WO */
229#define INTEL_MSIC_CHRSAFELMT 0x191
230#define INTEL_MSIC_SPWRSRCINT 0x192 /* RO */
231#define INTEL_MSIC_SPWRSRCINT1 0x193 /* RO */
232#define INTEL_MSIC_CHRLEDPWM 0x194
233#define INTEL_MSIC_CHRLEDCTRL 0x195
234
235/* ADC */
236#define INTEL_MSIC_ADC1CNTL1 0x1c0
237#define INTEL_MSIC_ADC1CNTL2 0x1c1
238#define INTEL_MSIC_ADC1CNTL3 0x1c2
239#define INTEL_MSIC_ADC1OFFSETH 0x1c3 /* RO */
240#define INTEL_MSIC_ADC1OFFSETL 0x1c4 /* RO */
241#define INTEL_MSIC_ADC1ADDR0 0x1c5
242#define INTEL_MSIC_ADC1ADDR1 0x1c6
243#define INTEL_MSIC_ADC1ADDR2 0x1c7
244#define INTEL_MSIC_ADC1ADDR3 0x1c8
245#define INTEL_MSIC_ADC1ADDR4 0x1c9
246#define INTEL_MSIC_ADC1ADDR5 0x1ca
247#define INTEL_MSIC_ADC1ADDR6 0x1cb
248#define INTEL_MSIC_ADC1ADDR7 0x1cc
249#define INTEL_MSIC_ADC1ADDR8 0x1cd
250#define INTEL_MSIC_ADC1ADDR9 0x1ce
251#define INTEL_MSIC_ADC1ADDR10 0x1cf
252#define INTEL_MSIC_ADC1ADDR11 0x1d0
253#define INTEL_MSIC_ADC1ADDR12 0x1d1
254#define INTEL_MSIC_ADC1ADDR13 0x1d2
255#define INTEL_MSIC_ADC1ADDR14 0x1d3
256#define INTEL_MSIC_ADC1SNS0H 0x1d4 /* RO */
257#define INTEL_MSIC_ADC1SNS0L 0x1d5 /* RO */
258#define INTEL_MSIC_ADC1SNS1H 0x1d6 /* RO */
259#define INTEL_MSIC_ADC1SNS1L 0x1d7 /* RO */
260#define INTEL_MSIC_ADC1SNS2H 0x1d8 /* RO */
261#define INTEL_MSIC_ADC1SNS2L 0x1d9 /* RO */
262#define INTEL_MSIC_ADC1SNS3H 0x1da /* RO */
263#define INTEL_MSIC_ADC1SNS3L 0x1db /* RO */
264#define INTEL_MSIC_ADC1SNS4H 0x1dc /* RO */
265#define INTEL_MSIC_ADC1SNS4L 0x1dd /* RO */
266#define INTEL_MSIC_ADC1SNS5H 0x1de /* RO */
267#define INTEL_MSIC_ADC1SNS5L 0x1df /* RO */
268#define INTEL_MSIC_ADC1SNS6H 0x1e0 /* RO */
269#define INTEL_MSIC_ADC1SNS6L 0x1e1 /* RO */
270#define INTEL_MSIC_ADC1SNS7H 0x1e2 /* RO */
271#define INTEL_MSIC_ADC1SNS7L 0x1e3 /* RO */
272#define INTEL_MSIC_ADC1SNS8H 0x1e4 /* RO */
273#define INTEL_MSIC_ADC1SNS8L 0x1e5 /* RO */
274#define INTEL_MSIC_ADC1SNS9H 0x1e6 /* RO */
275#define INTEL_MSIC_ADC1SNS9L 0x1e7 /* RO */
276#define INTEL_MSIC_ADC1SNS10H 0x1e8 /* RO */
277#define INTEL_MSIC_ADC1SNS10L 0x1e9 /* RO */
278#define INTEL_MSIC_ADC1SNS11H 0x1ea /* RO */
279#define INTEL_MSIC_ADC1SNS11L 0x1eb /* RO */
280#define INTEL_MSIC_ADC1SNS12H 0x1ec /* RO */
281#define INTEL_MSIC_ADC1SNS12L 0x1ed /* RO */
282#define INTEL_MSIC_ADC1SNS13H 0x1ee /* RO */
283#define INTEL_MSIC_ADC1SNS13L 0x1ef /* RO */
284#define INTEL_MSIC_ADC1SNS14H 0x1f0 /* RO */
285#define INTEL_MSIC_ADC1SNS14L 0x1f1 /* RO */
286#define INTEL_MSIC_ADC1BV0H 0x1f2 /* RO */
287#define INTEL_MSIC_ADC1BV0L 0x1f3 /* RO */
288#define INTEL_MSIC_ADC1BV1H 0x1f4 /* RO */
289#define INTEL_MSIC_ADC1BV1L 0x1f5 /* RO */
290#define INTEL_MSIC_ADC1BV2H 0x1f6 /* RO */
291#define INTEL_MSIC_ADC1BV2L 0x1f7 /* RO */
292#define INTEL_MSIC_ADC1BV3H 0x1f8 /* RO */
293#define INTEL_MSIC_ADC1BV3L 0x1f9 /* RO */
294#define INTEL_MSIC_ADC1BI0H 0x1fa /* RO */
295#define INTEL_MSIC_ADC1BI0L 0x1fb /* RO */
296#define INTEL_MSIC_ADC1BI1H 0x1fc /* RO */
297#define INTEL_MSIC_ADC1BI1L 0x1fd /* RO */
298#define INTEL_MSIC_ADC1BI2H 0x1fe /* RO */
299#define INTEL_MSIC_ADC1BI2L 0x1ff /* RO */
300#define INTEL_MSIC_ADC1BI3H 0x200 /* RO */
301#define INTEL_MSIC_ADC1BI3L 0x201 /* RO */
302#define INTEL_MSIC_CCCNTL 0x202
303#define INTEL_MSIC_CCOFFSETH 0x203 /* RO */
304#define INTEL_MSIC_CCOFFSETL 0x204 /* RO */
305#define INTEL_MSIC_CCADCHA 0x205 /* RO */
306#define INTEL_MSIC_CCADCLA 0x206 /* RO */
307
308/* AUDIO */
309#define INTEL_MSIC_AUDPLLCTRL 0x240
310#define INTEL_MSIC_DMICBUF0123 0x241
311#define INTEL_MSIC_DMICBUF45 0x242
312#define INTEL_MSIC_DMICGPO 0x244
313#define INTEL_MSIC_DMICMUX 0x245
314#define INTEL_MSIC_DMICCLK 0x246
315#define INTEL_MSIC_MICBIAS 0x247
316#define INTEL_MSIC_ADCCONFIG 0x248
317#define INTEL_MSIC_MICAMP1 0x249
318#define INTEL_MSIC_MICAMP2 0x24a
319#define INTEL_MSIC_NOISEMUX 0x24b
320#define INTEL_MSIC_AUDIOMUX12 0x24c
321#define INTEL_MSIC_AUDIOMUX34 0x24d
322#define INTEL_MSIC_AUDIOSINC 0x24e
323#define INTEL_MSIC_AUDIOTXEN 0x24f
324#define INTEL_MSIC_HSEPRXCTRL 0x250
325#define INTEL_MSIC_IHFRXCTRL 0x251
326#define INTEL_MSIC_VOICETXVOL 0x252
327#define INTEL_MSIC_SIDETONEVOL 0x253
328#define INTEL_MSIC_MUSICSHARVOL 0x254
329#define INTEL_MSIC_VOICETXCTRL 0x255
330#define INTEL_MSIC_HSMIXER 0x256
331#define INTEL_MSIC_DACCONFIG 0x257
332#define INTEL_MSIC_SOFTMUTE 0x258
333#define INTEL_MSIC_HSLVOLCTRL 0x259
334#define INTEL_MSIC_HSRVOLCTRL 0x25a
335#define INTEL_MSIC_IHFLVOLCTRL 0x25b
336#define INTEL_MSIC_IHFRVOLCTRL 0x25c
337#define INTEL_MSIC_DRIVEREN 0x25d
338#define INTEL_MSIC_LINEOUTCTRL 0x25e
339#define INTEL_MSIC_VIB1CTRL1 0x25f
340#define INTEL_MSIC_VIB1CTRL2 0x260
341#define INTEL_MSIC_VIB1CTRL3 0x261
342#define INTEL_MSIC_VIB1SPIPCM_1 0x262
343#define INTEL_MSIC_VIB1SPIPCM_2 0x263
344#define INTEL_MSIC_VIB1CTRL5 0x264
345#define INTEL_MSIC_VIB2CTRL1 0x265
346#define INTEL_MSIC_VIB2CTRL2 0x266
347#define INTEL_MSIC_VIB2CTRL3 0x267
348#define INTEL_MSIC_VIB2SPIPCM_1 0x268
349#define INTEL_MSIC_VIB2SPIPCM_2 0x269
350#define INTEL_MSIC_VIB2CTRL5 0x26a
351#define INTEL_MSIC_BTNCTRL1 0x26b
352#define INTEL_MSIC_BTNCTRL2 0x26c
353#define INTEL_MSIC_PCM1TXSLOT01 0x26d
354#define INTEL_MSIC_PCM1TXSLOT23 0x26e
355#define INTEL_MSIC_PCM1TXSLOT45 0x26f
356#define INTEL_MSIC_PCM1RXSLOT0123 0x270
357#define INTEL_MSIC_PCM1RXSLOT045 0x271
358#define INTEL_MSIC_PCM2TXSLOT01 0x272
359#define INTEL_MSIC_PCM2TXSLOT23 0x273
360#define INTEL_MSIC_PCM2TXSLOT45 0x274
361#define INTEL_MSIC_PCM2RXSLOT01 0x275
362#define INTEL_MSIC_PCM2RXSLOT23 0x276
363#define INTEL_MSIC_PCM2RXSLOT45 0x277
364#define INTEL_MSIC_PCM1CTRL1 0x278
365#define INTEL_MSIC_PCM1CTRL2 0x279
366#define INTEL_MSIC_PCM1CTRL3 0x27a
367#define INTEL_MSIC_PCM2CTRL1 0x27b
368#define INTEL_MSIC_PCM2CTRL2 0x27c
369
370/* HDMI */
371#define INTEL_MSIC_HDMIPUEN 0x280
372#define INTEL_MSIC_HDMISTATUS 0x281 /* RO */
373
374/* Physical address of the start of the MSIC interrupt tree in SRAM */
375#define INTEL_MSIC_IRQ_PHYS_BASE 0xffff7fc0
376
377/**
378 * struct intel_msic_gpio_pdata - platform data for the MSIC GPIO driver
379 * @gpio_base: base number for the GPIOs
380 */
381struct intel_msic_gpio_pdata {
382 unsigned gpio_base;
383};
384
385/**
386 * struct intel_msic_ocd_pdata - platform data for the MSIC OCD driver
387 * @gpio: GPIO number used for OCD interrupts
388 *
389 * The MSIC MFD driver converts @gpio into an IRQ number and passes it to
390 * the OCD driver as %IORESOURCE_IRQ.
391 */
392struct intel_msic_ocd_pdata {
393 unsigned gpio;
394};
395
396/* MSIC embedded blocks (subdevices) */
397enum intel_msic_block {
398 INTEL_MSIC_BLOCK_TOUCH,
399 INTEL_MSIC_BLOCK_ADC,
400 INTEL_MSIC_BLOCK_BATTERY,
401 INTEL_MSIC_BLOCK_GPIO,
402 INTEL_MSIC_BLOCK_AUDIO,
403 INTEL_MSIC_BLOCK_HDMI,
404 INTEL_MSIC_BLOCK_THERMAL,
405 INTEL_MSIC_BLOCK_POWER_BTN,
406 INTEL_MSIC_BLOCK_OCD,
407
408 INTEL_MSIC_BLOCK_LAST,
409};
410
411/**
412 * struct intel_msic_platform_data - platform data for the MSIC driver
413 * @irq: array of interrupt numbers, one per device. If @irq is set to %0
414 * for a given block, the corresponding platform device is not
415 * created. For devices which don't have an interrupt, use %0xff
416 * (this is same as in SFI spec).
417 * @gpio: platform data for the MSIC GPIO driver
418 * @ocd: platform data for the MSIC OCD driver
419 *
420 * Once the MSIC driver is initialized, the register interface is ready to
421 * use. All the platform devices for subdevices are created after the
422 * register interface is ready so that we can guarantee its availability to
423 * the subdevice drivers.
424 *
425 * Interrupt numbers are passed to the subdevices via %IORESOURCE_IRQ
426 * resources of the created platform device.
427 */
428struct intel_msic_platform_data {
429 int irq[INTEL_MSIC_BLOCK_LAST];
430 struct intel_msic_gpio_pdata *gpio;
431 struct intel_msic_ocd_pdata *ocd;
432};
433
434struct intel_msic;
435
436extern int intel_msic_reg_read(unsigned short reg, u8 *val);
437extern int intel_msic_reg_write(unsigned short reg, u8 val);
438extern int intel_msic_reg_update(unsigned short reg, u8 val, u8 mask);
439extern int intel_msic_bulk_read(unsigned short *reg, u8 *buf, size_t count);
440extern int intel_msic_bulk_write(unsigned short *reg, u8 *buf, size_t count);
441
442/*
443 * pdev_to_intel_msic - gets an MSIC instance from the platform device
444 * @pdev: platform device pointer
445 *
446 * The client drivers need to have pointer to the MSIC instance if they
447 * want to call intel_msic_irq_read(). This macro can be used for
448 * convenience to get the MSIC pointer from @pdev where needed. This is
449 * _only_ valid for devices which are managed by the MSIC.
450 */
451#define pdev_to_intel_msic(pdev) (dev_get_drvdata(pdev->dev.parent))
452
453extern int intel_msic_irq_read(struct intel_msic *msic, unsigned short reg,
454 u8 *val);
455
456#endif /* __LINUX_MFD_INTEL_MSIC_H__ */
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 5ff2400ad46c..3f4deb62d6b0 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -326,7 +326,6 @@ struct max8997_dev {
326 int irq; 326 int irq;
327 int ono; 327 int ono;
328 int irq_base; 328 int irq_base;
329 bool wakeup;
330 struct mutex irqlock; 329 struct mutex irqlock;
331 int irq_masks_cur[MAX8997_IRQ_GROUP_NR]; 330 int irq_masks_cur[MAX8997_IRQ_GROUP_NR];
332 int irq_masks_cache[MAX8997_IRQ_GROUP_NR]; 331 int irq_masks_cache[MAX8997_IRQ_GROUP_NR];
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 7d0f3d6a0002..a8eeda773a7b 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -12,117 +12,6 @@
12 12
13#include <linux/mfd/mc13xxx.h> 13#include <linux/mfd/mc13xxx.h>
14 14
15struct mc13783;
16
17struct mc13xxx *mc13783_to_mc13xxx(struct mc13783 *mc13783);
18
19static inline void mc13783_lock(struct mc13783 *mc13783)
20{
21 mc13xxx_lock(mc13783_to_mc13xxx(mc13783));
22}
23
24static inline void mc13783_unlock(struct mc13783 *mc13783)
25{
26 mc13xxx_unlock(mc13783_to_mc13xxx(mc13783));
27}
28
29static inline int mc13783_reg_read(struct mc13783 *mc13783,
30 unsigned int offset, u32 *val)
31{
32 return mc13xxx_reg_read(mc13783_to_mc13xxx(mc13783), offset, val);
33}
34
35static inline int mc13783_reg_write(struct mc13783 *mc13783,
36 unsigned int offset, u32 val)
37{
38 return mc13xxx_reg_write(mc13783_to_mc13xxx(mc13783), offset, val);
39}
40
41static inline int mc13783_reg_rmw(struct mc13783 *mc13783,
42 unsigned int offset, u32 mask, u32 val)
43{
44 return mc13xxx_reg_rmw(mc13783_to_mc13xxx(mc13783), offset, mask, val);
45}
46
47static inline int mc13783_get_flags(struct mc13783 *mc13783)
48{
49 return mc13xxx_get_flags(mc13783_to_mc13xxx(mc13783));
50}
51
52static inline int mc13783_irq_request(struct mc13783 *mc13783, int irq,
53 irq_handler_t handler, const char *name, void *dev)
54{
55 return mc13xxx_irq_request(mc13783_to_mc13xxx(mc13783), irq,
56 handler, name, dev);
57}
58
59static inline int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
60 irq_handler_t handler, const char *name, void *dev)
61{
62 return mc13xxx_irq_request_nounmask(mc13783_to_mc13xxx(mc13783), irq,
63 handler, name, dev);
64}
65
66static inline int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev)
67{
68 return mc13xxx_irq_free(mc13783_to_mc13xxx(mc13783), irq, dev);
69}
70
71static inline int mc13783_irq_mask(struct mc13783 *mc13783, int irq)
72{
73 return mc13xxx_irq_mask(mc13783_to_mc13xxx(mc13783), irq);
74}
75
76static inline int mc13783_irq_unmask(struct mc13783 *mc13783, int irq)
77{
78 return mc13xxx_irq_unmask(mc13783_to_mc13xxx(mc13783), irq);
79}
80static inline int mc13783_irq_status(struct mc13783 *mc13783, int irq,
81 int *enabled, int *pending)
82{
83 return mc13xxx_irq_status(mc13783_to_mc13xxx(mc13783),
84 irq, enabled, pending);
85}
86
87static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
88{
89 return mc13xxx_irq_ack(mc13783_to_mc13xxx(mc13783), irq);
90}
91
92#define MC13783_ADC0 43
93#define MC13783_ADC0_ADREFEN (1 << 10)
94#define MC13783_ADC0_ADREFMODE (1 << 11)
95#define MC13783_ADC0_TSMOD0 (1 << 12)
96#define MC13783_ADC0_TSMOD1 (1 << 13)
97#define MC13783_ADC0_TSMOD2 (1 << 14)
98#define MC13783_ADC0_ADINC1 (1 << 16)
99#define MC13783_ADC0_ADINC2 (1 << 17)
100
101#define MC13783_ADC0_TSMOD_MASK (MC13783_ADC0_TSMOD0 | \
102 MC13783_ADC0_TSMOD1 | \
103 MC13783_ADC0_TSMOD2)
104
105#define mc13783_regulator_init_data mc13xxx_regulator_init_data
106#define mc13783_regulator_platform_data mc13xxx_regulator_platform_data
107#define mc13783_led_platform_data mc13xxx_led_platform_data
108#define mc13783_leds_platform_data mc13xxx_leds_platform_data
109
110#define mc13783_platform_data mc13xxx_platform_data
111#define MC13783_USE_TOUCHSCREEN MC13XXX_USE_TOUCHSCREEN
112#define MC13783_USE_CODEC MC13XXX_USE_CODEC
113#define MC13783_USE_ADC MC13XXX_USE_ADC
114#define MC13783_USE_RTC MC13XXX_USE_RTC
115#define MC13783_USE_REGULATOR MC13XXX_USE_REGULATOR
116#define MC13783_USE_LED MC13XXX_USE_LED
117
118#define MC13783_ADC_MODE_TS 1
119#define MC13783_ADC_MODE_SINGLE_CHAN 2
120#define MC13783_ADC_MODE_MULT_CHAN 3
121
122int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
123 unsigned int channel, unsigned int *sample);
124
125
126#define MC13783_REG_SW1A 0 15#define MC13783_REG_SW1A 0
127#define MC13783_REG_SW1B 1 16#define MC13783_REG_SW1B 1
128#define MC13783_REG_SW2A 2 17#define MC13783_REG_SW2A 2
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index c064beaaccb7..3816c2fac0ad 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -37,6 +37,9 @@ int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq);
37 37
38int mc13xxx_get_flags(struct mc13xxx *mc13xxx); 38int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
39 39
40int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx,
41 unsigned int mode, unsigned int channel, unsigned int *sample);
42
40#define MC13XXX_IRQ_ADCDONE 0 43#define MC13XXX_IRQ_ADCDONE 0
41#define MC13XXX_IRQ_ADCBISDONE 1 44#define MC13XXX_IRQ_ADCBISDONE 1
42#define MC13XXX_IRQ_TS 2 45#define MC13XXX_IRQ_TS 2
@@ -137,17 +140,48 @@ struct mc13xxx_leds_platform_data {
137 char tc3_period; 140 char tc3_period;
138}; 141};
139 142
143struct mc13xxx_buttons_platform_data {
144#define MC13783_BUTTON_DBNC_0MS 0
145#define MC13783_BUTTON_DBNC_30MS 1
146#define MC13783_BUTTON_DBNC_150MS 2
147#define MC13783_BUTTON_DBNC_750MS 3
148#define MC13783_BUTTON_ENABLE (1 << 2)
149#define MC13783_BUTTON_POL_INVERT (1 << 3)
150#define MC13783_BUTTON_RESET_EN (1 << 4)
151 int b1on_flags;
152 unsigned short b1on_key;
153 int b2on_flags;
154 unsigned short b2on_key;
155 int b3on_flags;
156 unsigned short b3on_key;
157};
158
140struct mc13xxx_platform_data { 159struct mc13xxx_platform_data {
141#define MC13XXX_USE_TOUCHSCREEN (1 << 0) 160#define MC13XXX_USE_TOUCHSCREEN (1 << 0)
142#define MC13XXX_USE_CODEC (1 << 1) 161#define MC13XXX_USE_CODEC (1 << 1)
143#define MC13XXX_USE_ADC (1 << 2) 162#define MC13XXX_USE_ADC (1 << 2)
144#define MC13XXX_USE_RTC (1 << 3) 163#define MC13XXX_USE_RTC (1 << 3)
145#define MC13XXX_USE_REGULATOR (1 << 4)
146#define MC13XXX_USE_LED (1 << 5)
147 unsigned int flags; 164 unsigned int flags;
148 165
149 struct mc13xxx_regulator_platform_data regulators; 166 struct mc13xxx_regulator_platform_data regulators;
150 struct mc13xxx_leds_platform_data *leds; 167 struct mc13xxx_leds_platform_data *leds;
168 struct mc13xxx_buttons_platform_data *buttons;
151}; 169};
152 170
171#define MC13XXX_ADC_MODE_TS 1
172#define MC13XXX_ADC_MODE_SINGLE_CHAN 2
173#define MC13XXX_ADC_MODE_MULT_CHAN 3
174
175#define MC13XXX_ADC0 43
176#define MC13XXX_ADC0_ADREFEN (1 << 10)
177#define MC13XXX_ADC0_TSMOD0 (1 << 12)
178#define MC13XXX_ADC0_TSMOD1 (1 << 13)
179#define MC13XXX_ADC0_TSMOD2 (1 << 14)
180#define MC13XXX_ADC0_ADINC1 (1 << 16)
181#define MC13XXX_ADC0_ADINC2 (1 << 17)
182
183#define MC13XXX_ADC0_TSMOD_MASK (MC13XXX_ADC0_TSMOD0 | \
184 MC13XXX_ADC0_TSMOD1 | \
185 MC13XXX_ADC0_TSMOD2)
186
153#endif /* ifndef __LINUX_MFD_MC13XXX_H */ 187#endif /* ifndef __LINUX_MFD_MC13XXX_H */
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index 50d4a047118d..a80840752b4c 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -21,6 +21,7 @@
21#include <linux/mfd/pcf50633/backlight.h> 21#include <linux/mfd/pcf50633/backlight.h>
22 22
23struct pcf50633; 23struct pcf50633;
24struct regmap;
24 25
25#define PCF50633_NUM_REGULATORS 11 26#define PCF50633_NUM_REGULATORS 11
26 27
@@ -134,7 +135,7 @@ enum {
134 135
135struct pcf50633 { 136struct pcf50633 {
136 struct device *dev; 137 struct device *dev;
137 struct i2c_client *i2c_client; 138 struct regmap *regmap;
138 139
139 struct pcf50633_platform_data *pdata; 140 struct pcf50633_platform_data *pdata;
140 int irq; 141 int irq;
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index b6bab1b04e25..b19176eab44d 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -1,6 +1,18 @@
1#ifndef __LINUX_MFD_TPS6586X_H 1#ifndef __LINUX_MFD_TPS6586X_H
2#define __LINUX_MFD_TPS6586X_H 2#define __LINUX_MFD_TPS6586X_H
3 3
4#define TPS6586X_SLEW_RATE_INSTANTLY 0x00
5#define TPS6586X_SLEW_RATE_110UV 0x01
6#define TPS6586X_SLEW_RATE_220UV 0x02
7#define TPS6586X_SLEW_RATE_440UV 0x03
8#define TPS6586X_SLEW_RATE_880UV 0x04
9#define TPS6586X_SLEW_RATE_1760UV 0x05
10#define TPS6586X_SLEW_RATE_3520UV 0x06
11#define TPS6586X_SLEW_RATE_7040UV 0x07
12
13#define TPS6586X_SLEW_RATE_SET 0x08
14#define TPS6586X_SLEW_RATE_MASK 0x07
15
4enum { 16enum {
5 TPS6586X_ID_SM_0, 17 TPS6586X_ID_SM_0,
6 TPS6586X_ID_SM_1, 18 TPS6586X_ID_SM_1,
@@ -48,6 +60,10 @@ enum {
48 TPS6586X_INT_RTC_ALM2, 60 TPS6586X_INT_RTC_ALM2,
49}; 61};
50 62
63struct tps6586x_settings {
64 int slew_rate;
65};
66
51struct tps6586x_subdev_info { 67struct tps6586x_subdev_info {
52 int id; 68 int id;
53 const char *name; 69 const char *name;
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index 8dda8ded5cda..4b1211859f74 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -18,6 +18,7 @@
18#include <linux/completion.h> 18#include <linux/completion.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/list.h> 20#include <linux/list.h>
21#include <linux/regmap.h>
21 22
22/* 23/*
23 * Register values. 24 * Register values.
@@ -361,12 +362,8 @@ struct wm831x {
361 struct mutex io_lock; 362 struct mutex io_lock;
362 363
363 struct device *dev; 364 struct device *dev;
364 int (*read_dev)(struct wm831x *wm831x, unsigned short reg,
365 int bytes, void *dest);
366 int (*write_dev)(struct wm831x *wm831x, unsigned short reg,
367 int bytes, void *src);
368 365
369 void *control_data; 366 struct regmap *regmap;
370 367
371 int irq; /* Our chip IRQ */ 368 int irq; /* Our chip IRQ */
372 struct mutex irq_lock; 369 struct mutex irq_lock;
@@ -374,6 +371,8 @@ struct wm831x {
374 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ 371 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */
375 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ 372 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
376 373
374 bool soft_shutdown;
375
377 /* Chip revision based flags */ 376 /* Chip revision based flags */
378 unsigned has_gpio_ena:1; /* Has GPIO enable bit */ 377 unsigned has_gpio_ena:1; /* Has GPIO enable bit */
379 unsigned has_cs_sts:1; /* Has current sink status bit */ 378 unsigned has_cs_sts:1; /* Has current sink status bit */
@@ -383,6 +382,7 @@ struct wm831x {
383 382
384 /* Used by the interrupt controller code to post writes */ 383 /* Used by the interrupt controller code to post writes */
385 int gpio_update[WM831X_NUM_GPIO_REGS]; 384 int gpio_update[WM831X_NUM_GPIO_REGS];
385 bool gpio_level[WM831X_NUM_GPIO_REGS];
386 386
387 struct mutex auxadc_lock; 387 struct mutex auxadc_lock;
388 struct list_head auxadc_pending; 388 struct list_head auxadc_pending;
@@ -412,8 +412,11 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
412int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq); 412int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq);
413void wm831x_device_exit(struct wm831x *wm831x); 413void wm831x_device_exit(struct wm831x *wm831x);
414int wm831x_device_suspend(struct wm831x *wm831x); 414int wm831x_device_suspend(struct wm831x *wm831x);
415void wm831x_device_shutdown(struct wm831x *wm831x);
415int wm831x_irq_init(struct wm831x *wm831x, int irq); 416int wm831x_irq_init(struct wm831x *wm831x, int irq);
416void wm831x_irq_exit(struct wm831x *wm831x); 417void wm831x_irq_exit(struct wm831x *wm831x);
417void wm831x_auxadc_init(struct wm831x *wm831x); 418void wm831x_auxadc_init(struct wm831x *wm831x);
418 419
420extern struct regmap_config wm831x_regmap_config;
421
419#endif 422#endif
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index 0ba24599fe51..1d7a3f7b3b5d 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -123,6 +123,9 @@ struct wm831x_pdata {
123 /** Disable the touchscreen */ 123 /** Disable the touchscreen */
124 bool disable_touch; 124 bool disable_touch;
125 125
126 /** The driver should initiate a power off sequence during shutdown */
127 bool soft_shutdown;
128
126 int irq_base; 129 int irq_base;
127 int gpio_base; 130 int gpio_base;
128 int gpio_defaults[WM831X_GPIO_NUM]; 131 int gpio_defaults[WM831X_GPIO_NUM];
diff --git a/include/linux/mfd/wm8400-private.h b/include/linux/mfd/wm8400-private.h
index 2aab4e93a5c9..0147b6968510 100644
--- a/include/linux/mfd/wm8400-private.h
+++ b/include/linux/mfd/wm8400-private.h
@@ -25,16 +25,15 @@
25#include <linux/mutex.h> 25#include <linux/mutex.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27 27
28struct regmap;
29
28#define WM8400_REGISTER_COUNT 0x55 30#define WM8400_REGISTER_COUNT 0x55
29 31
30struct wm8400 { 32struct wm8400 {
31 struct device *dev; 33 struct device *dev;
32 34
33 int (*read_dev)(void *data, char reg, int count, u16 *dst);
34 int (*write_dev)(void *data, char reg, int count, const u16 *src);
35
36 struct mutex io_lock; 35 struct mutex io_lock;
37 void *io_data; 36 struct regmap *regmap;
38 37
39 u16 reg_cache[WM8400_REGISTER_COUNT]; 38 u16 reg_cache[WM8400_REGISTER_COUNT];
40 39
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index bfb221b3abf7..f44bdb7273bd 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -25,6 +25,7 @@ enum wm8994_type {
25 25
26struct regulator_dev; 26struct regulator_dev;
27struct regulator_bulk_data; 27struct regulator_bulk_data;
28struct regmap;
28 29
29#define WM8994_NUM_GPIO_REGS 11 30#define WM8994_NUM_GPIO_REGS 11
30#define WM8994_NUM_LDO_REGS 2 31#define WM8994_NUM_LDO_REGS 2
@@ -51,18 +52,14 @@ struct regulator_bulk_data;
51#define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN) 52#define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN)
52 53
53struct wm8994 { 54struct wm8994 {
54 struct mutex io_lock;
55 struct mutex irq_lock; 55 struct mutex irq_lock;
56 56
57 enum wm8994_type type; 57 enum wm8994_type type;
58 58
59 struct device *dev; 59 struct device *dev;
60 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, 60 struct regmap *regmap;
61 int bytes, void *dest);
62 int (*write_dev)(struct wm8994 *wm8994, unsigned short reg,
63 int bytes, const void *src);
64 61
65 void *control_data; 62 bool ldo_ena_always_driven;
66 63
67 int gpio_base; 64 int gpio_base;
68 int irq_base; 65 int irq_base;
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index d12f8d635a81..ea32f306dca6 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -26,7 +26,7 @@ struct wm8994_ldo_pdata {
26 struct regulator_init_data *init_data; 26 struct regulator_init_data *init_data;
27}; 27};
28 28
29#define WM8994_CONFIGURE_GPIO 0x8000 29#define WM8994_CONFIGURE_GPIO 0x10000
30 30
31#define WM8994_DRC_REGS 5 31#define WM8994_DRC_REGS 5
32#define WM8994_EQ_REGS 20 32#define WM8994_EQ_REGS 20
@@ -167,6 +167,13 @@ struct wm8994_pdata {
167 167
168 /* WM8958 microphone bias configuration */ 168 /* WM8958 microphone bias configuration */
169 int micbias[2]; 169 int micbias[2];
170
171 /* Disable the internal pull downs on the LDOs if they are
172 * always driven (eg, connected to an always on supply or
173 * GPIO that always drives an output. If they float power
174 * consumption will rise.
175 */
176 bool ldo_ena_always_driven;
170}; 177};
171 178
172#endif 179#endif
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 103113a2fd18..27748230aa69 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -11,131 +11,130 @@
11#include <linux/types.h> 11#include <linux/types.h>
12 12
13/* Generic MII registers. */ 13/* Generic MII registers. */
14 14#define MII_BMCR 0x00 /* Basic mode control register */
15#define MII_BMCR 0x00 /* Basic mode control register */ 15#define MII_BMSR 0x01 /* Basic mode status register */
16#define MII_BMSR 0x01 /* Basic mode status register */ 16#define MII_PHYSID1 0x02 /* PHYS ID 1 */
17#define MII_PHYSID1 0x02 /* PHYS ID 1 */ 17#define MII_PHYSID2 0x03 /* PHYS ID 2 */
18#define MII_PHYSID2 0x03 /* PHYS ID 2 */ 18#define MII_ADVERTISE 0x04 /* Advertisement control reg */
19#define MII_ADVERTISE 0x04 /* Advertisement control reg */ 19#define MII_LPA 0x05 /* Link partner ability reg */
20#define MII_LPA 0x05 /* Link partner ability reg */ 20#define MII_EXPANSION 0x06 /* Expansion register */
21#define MII_EXPANSION 0x06 /* Expansion register */ 21#define MII_CTRL1000 0x09 /* 1000BASE-T control */
22#define MII_CTRL1000 0x09 /* 1000BASE-T control */ 22#define MII_STAT1000 0x0a /* 1000BASE-T status */
23#define MII_STAT1000 0x0a /* 1000BASE-T status */ 23#define MII_ESTATUS 0x0f /* Extended Status */
24#define MII_ESTATUS 0x0f /* Extended Status */ 24#define MII_DCOUNTER 0x12 /* Disconnect counter */
25#define MII_DCOUNTER 0x12 /* Disconnect counter */ 25#define MII_FCSCOUNTER 0x13 /* False carrier counter */
26#define MII_FCSCOUNTER 0x13 /* False carrier counter */ 26#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
27#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ 27#define MII_RERRCOUNTER 0x15 /* Receive error counter */
28#define MII_RERRCOUNTER 0x15 /* Receive error counter */ 28#define MII_SREVISION 0x16 /* Silicon revision */
29#define MII_SREVISION 0x16 /* Silicon revision */ 29#define MII_RESV1 0x17 /* Reserved... */
30#define MII_RESV1 0x17 /* Reserved... */ 30#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
31#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */ 31#define MII_PHYADDR 0x19 /* PHY address */
32#define MII_PHYADDR 0x19 /* PHY address */ 32#define MII_RESV2 0x1a /* Reserved... */
33#define MII_RESV2 0x1a /* Reserved... */ 33#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
34#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */ 34#define MII_NCONFIG 0x1c /* Network interface config */
35#define MII_NCONFIG 0x1c /* Network interface config */
36 35
37/* Basic mode control register. */ 36/* Basic mode control register. */
38#define BMCR_RESV 0x003f /* Unused... */ 37#define BMCR_RESV 0x003f /* Unused... */
39#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */ 38#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */
40#define BMCR_CTST 0x0080 /* Collision test */ 39#define BMCR_CTST 0x0080 /* Collision test */
41#define BMCR_FULLDPLX 0x0100 /* Full duplex */ 40#define BMCR_FULLDPLX 0x0100 /* Full duplex */
42#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */ 41#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
43#define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */ 42#define BMCR_ISOLATE 0x0400 /* Isolate data paths from MII */
44#define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */ 43#define BMCR_PDOWN 0x0800 /* Enable low power state */
45#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */ 44#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
46#define BMCR_SPEED100 0x2000 /* Select 100Mbps */ 45#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
47#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */ 46#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
48#define BMCR_RESET 0x8000 /* Reset the DP83840 */ 47#define BMCR_RESET 0x8000 /* Reset to default state */
49 48
50/* Basic mode status register. */ 49/* Basic mode status register. */
51#define BMSR_ERCAP 0x0001 /* Ext-reg capability */ 50#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
52#define BMSR_JCD 0x0002 /* Jabber detected */ 51#define BMSR_JCD 0x0002 /* Jabber detected */
53#define BMSR_LSTATUS 0x0004 /* Link status */ 52#define BMSR_LSTATUS 0x0004 /* Link status */
54#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */ 53#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
55#define BMSR_RFAULT 0x0010 /* Remote fault detected */ 54#define BMSR_RFAULT 0x0010 /* Remote fault detected */
56#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ 55#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
57#define BMSR_RESV 0x00c0 /* Unused... */ 56#define BMSR_RESV 0x00c0 /* Unused... */
58#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */ 57#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
59#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */ 58#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */
60#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */ 59#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */
61#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ 60#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
62#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ 61#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
63#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ 62#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
64#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */ 63#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
65#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */ 64#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */
66 65
67/* Advertisement control register. */ 66/* Advertisement control register. */
68#define ADVERTISE_SLCT 0x001f /* Selector bits */ 67#define ADVERTISE_SLCT 0x001f /* Selector bits */
69#define ADVERTISE_CSMA 0x0001 /* Only selector supported */ 68#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
70#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ 69#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
71#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */ 70#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
72#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ 71#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
73#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */ 72#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */
74#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */ 73#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
75#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */ 74#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */
76#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */ 75#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
77#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */ 76#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */
78#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ 77#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
79#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */ 78#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */
80#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */ 79#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */
81#define ADVERTISE_RESV 0x1000 /* Unused... */ 80#define ADVERTISE_RESV 0x1000 /* Unused... */
82#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */ 81#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */
83#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */ 82#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */
84#define ADVERTISE_NPAGE 0x8000 /* Next page bit */ 83#define ADVERTISE_NPAGE 0x8000 /* Next page bit */
85 84
86#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ 85#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
87 ADVERTISE_CSMA) 86 ADVERTISE_CSMA)
88#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ 87#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
89 ADVERTISE_100HALF | ADVERTISE_100FULL) 88 ADVERTISE_100HALF | ADVERTISE_100FULL)
90 89
91/* Link partner ability register. */ 90/* Link partner ability register. */
92#define LPA_SLCT 0x001f /* Same as advertise selector */ 91#define LPA_SLCT 0x001f /* Same as advertise selector */
93#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ 92#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
94#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */ 93#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
95#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ 94#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
96#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */ 95#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */
97#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */ 96#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */
98#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */ 97#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */
99#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */ 98#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */
100#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/ 99#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
101#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ 100#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
102#define LPA_PAUSE_CAP 0x0400 /* Can pause */ 101#define LPA_PAUSE_CAP 0x0400 /* Can pause */
103#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */ 102#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
104#define LPA_RESV 0x1000 /* Unused... */ 103#define LPA_RESV 0x1000 /* Unused... */
105#define LPA_RFAULT 0x2000 /* Link partner faulted */ 104#define LPA_RFAULT 0x2000 /* Link partner faulted */
106#define LPA_LPACK 0x4000 /* Link partner acked us */ 105#define LPA_LPACK 0x4000 /* Link partner acked us */
107#define LPA_NPAGE 0x8000 /* Next page bit */ 106#define LPA_NPAGE 0x8000 /* Next page bit */
108 107
109#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) 108#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
110#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) 109#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
111 110
112/* Expansion register for auto-negotiation. */ 111/* Expansion register for auto-negotiation. */
113#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */ 112#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */
114#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */ 113#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */
115#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */ 114#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
116#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */ 115#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */
117#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */ 116#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
118#define EXPANSION_RESV 0xffe0 /* Unused... */ 117#define EXPANSION_RESV 0xffe0 /* Unused... */
119 118
120#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */ 119#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
121#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */ 120#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
122 121
123/* N-way test register. */ 122/* N-way test register. */
124#define NWAYTEST_RESV1 0x00ff /* Unused... */ 123#define NWAYTEST_RESV1 0x00ff /* Unused... */
125#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */ 124#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
126#define NWAYTEST_RESV2 0xfe00 /* Unused... */ 125#define NWAYTEST_RESV2 0xfe00 /* Unused... */
127 126
128/* 1000BASE-T Control register */ 127/* 1000BASE-T Control register */
129#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */ 128#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
130#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */ 129#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
131#define CTL1000_AS_MASTER 0x0800 130#define CTL1000_AS_MASTER 0x0800
132#define CTL1000_ENABLE_MASTER 0x1000 131#define CTL1000_ENABLE_MASTER 0x1000
133 132
134/* 1000BASE-T Status register */ 133/* 1000BASE-T Status register */
135#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */ 134#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
136#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */ 135#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */
137#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ 136#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
138#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ 137#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
139 138
140/* Flow control flags */ 139/* Flow control flags */
141#define FLOW_CTRL_TX 0x01 140#define FLOW_CTRL_TX 0x01
@@ -149,7 +148,7 @@ struct mii_ioctl_data {
149 __u16 val_out; 148 __u16 val_out;
150}; 149};
151 150
152#ifdef __KERNEL__ 151#ifdef __KERNEL__
153 152
154#include <linux/if.h> 153#include <linux/if.h>
155 154
@@ -180,7 +179,7 @@ extern unsigned int mii_check_media (struct mii_if_info *mii,
180 unsigned int ok_to_print, 179 unsigned int ok_to_print,
181 unsigned int init_media); 180 unsigned int init_media);
182extern int generic_mii_ioctl(struct mii_if_info *mii_if, 181extern int generic_mii_ioctl(struct mii_if_info *mii_if,
183 struct mii_ioctl_data *mii_data, int cmd, 182 struct mii_ioctl_data *mii_data, int cmd,
184 unsigned int *duplex_changed); 183 unsigned int *duplex_changed);
185 184
186 185
@@ -189,7 +188,6 @@ static inline struct mii_ioctl_data *if_mii(struct ifreq *rq)
189 return (struct mii_ioctl_data *) &rq->ifr_ifru; 188 return (struct mii_ioctl_data *) &rq->ifr_ifru;
190} 189}
191 190
192
193/** 191/**
194 * mii_nway_result 192 * mii_nway_result
195 * @negotiated: value of MII ANAR and'd with ANLPAR 193 * @negotiated: value of MII ANAR and'd with ANLPAR
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 18fd13028ba1..c41d7270c6c6 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -1,7 +1,8 @@
1#ifndef _LINUX_MISCDEVICE_H 1#ifndef _LINUX_MISCDEVICE_H
2#define _LINUX_MISCDEVICE_H 2#define _LINUX_MISCDEVICE_H
3#include <linux/module.h>
4#include <linux/major.h> 3#include <linux/major.h>
4#include <linux/list.h>
5#include <linux/types.h>
5 6
6/* 7/*
7 * These allocations are managed by device@lanana.org. If you use an 8 * These allocations are managed by device@lanana.org. If you use an
@@ -40,6 +41,7 @@
40#define BTRFS_MINOR 234 41#define BTRFS_MINOR 234
41#define AUTOFS_MINOR 235 42#define AUTOFS_MINOR 235
42#define MAPPER_CTRL_MINOR 236 43#define MAPPER_CTRL_MINOR 236
44#define LOOP_CTRL_MINOR 237
43#define MISC_DYNAMIC_MINOR 255 45#define MISC_DYNAMIC_MINOR 255
44 46
45struct device; 47struct device;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 53ef894bfa05..84b0b1848f17 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -61,6 +61,7 @@ enum {
61 MLX4_DEV_CAP_FLAG_RC = 1LL << 0, 61 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
62 MLX4_DEV_CAP_FLAG_UC = 1LL << 1, 62 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
63 MLX4_DEV_CAP_FLAG_UD = 1LL << 2, 63 MLX4_DEV_CAP_FLAG_UD = 1LL << 2,
64 MLX4_DEV_CAP_FLAG_XRC = 1LL << 3,
64 MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6, 65 MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6,
65 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7, 66 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7,
66 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8, 67 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8,
@@ -75,6 +76,7 @@ enum {
75 MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21, 76 MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21,
76 MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30, 77 MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30,
77 MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32, 78 MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32,
79 MLX4_DEV_CAP_FLAG_FCS_KEEP = 1LL << 34,
78 MLX4_DEV_CAP_FLAG_WOL = 1LL << 38, 80 MLX4_DEV_CAP_FLAG_WOL = 1LL << 38,
79 MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40, 81 MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40,
80 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, 82 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41,
@@ -82,6 +84,12 @@ enum {
82 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48 84 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48
83}; 85};
84 86
87#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)
88
89enum {
90 MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0
91};
92
85enum { 93enum {
86 MLX4_BMME_FLAG_LOCAL_INV = 1 << 6, 94 MLX4_BMME_FLAG_LOCAL_INV = 1 << 6,
87 MLX4_BMME_FLAG_REMOTE_INV = 1 << 7, 95 MLX4_BMME_FLAG_REMOTE_INV = 1 << 7,
@@ -256,6 +264,8 @@ struct mlx4_caps {
256 int num_qp_per_mgm; 264 int num_qp_per_mgm;
257 int num_pds; 265 int num_pds;
258 int reserved_pds; 266 int reserved_pds;
267 int max_xrcds;
268 int reserved_xrcds;
259 int mtt_entry_sz; 269 int mtt_entry_sz;
260 u32 max_msg_sz; 270 u32 max_msg_sz;
261 u32 page_size_cap; 271 u32 page_size_cap;
@@ -276,6 +286,7 @@ struct mlx4_caps {
276 u32 port_mask; 286 u32 port_mask;
277 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; 287 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
278 u32 max_counters; 288 u32 max_counters;
289 u8 ext_port_cap[MLX4_MAX_PORTS + 1];
279}; 290};
280 291
281struct mlx4_buf_list { 292struct mlx4_buf_list {
@@ -499,6 +510,8 @@ static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset)
499 510
500int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); 511int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn);
501void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); 512void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn);
513int mlx4_xrcd_alloc(struct mlx4_dev *dev, u32 *xrcdn);
514void mlx4_xrcd_free(struct mlx4_dev *dev, u32 xrcdn);
502 515
503int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar); 516int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar);
504void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar); 517void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar);
@@ -538,8 +551,8 @@ void mlx4_qp_release_range(struct mlx4_dev *dev, int base_qpn, int cnt);
538int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp); 551int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp);
539void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp); 552void mlx4_qp_free(struct mlx4_dev *dev, struct mlx4_qp *qp);
540 553
541int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt, 554int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, u32 cqn, u16 xrcdn,
542 u64 db_rec, struct mlx4_srq *srq); 555 struct mlx4_mtt *mtt, u64 db_rec, struct mlx4_srq *srq);
543void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); 556void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq);
544int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); 557int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark);
545int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark); 558int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 4001c8249dbb..48cc4cb97858 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -75,6 +75,7 @@ enum {
75 MLX4_QP_ST_UC = 0x1, 75 MLX4_QP_ST_UC = 0x1,
76 MLX4_QP_ST_RD = 0x2, 76 MLX4_QP_ST_RD = 0x2,
77 MLX4_QP_ST_UD = 0x3, 77 MLX4_QP_ST_UD = 0x3,
78 MLX4_QP_ST_XRC = 0x6,
78 MLX4_QP_ST_MLX = 0x7 79 MLX4_QP_ST_MLX = 0x7
79}; 80};
80 81
@@ -137,7 +138,7 @@ struct mlx4_qp_context {
137 __be32 ssn; 138 __be32 ssn;
138 __be32 params2; 139 __be32 params2;
139 __be32 rnr_nextrecvpsn; 140 __be32 rnr_nextrecvpsn;
140 __be32 srcd; 141 __be32 xrcd;
141 __be32 cqn_recv; 142 __be32 cqn_recv;
142 __be64 db_rec_addr; 143 __be64 db_rec_addr;
143 __be32 qkey; 144 __be32 qkey;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f2690cf49827..3dc3a8c2c485 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -356,36 +356,50 @@ static inline struct page *compound_head(struct page *page)
356 return page; 356 return page;
357} 357}
358 358
359/*
360 * The atomic page->_mapcount, starts from -1: so that transitions
361 * both from it and to it can be tracked, using atomic_inc_and_test
362 * and atomic_add_negative(-1).
363 */
364static inline void reset_page_mapcount(struct page *page)
365{
366 atomic_set(&(page)->_mapcount, -1);
367}
368
369static inline int page_mapcount(struct page *page)
370{
371 return atomic_read(&(page)->_mapcount) + 1;
372}
373
359static inline int page_count(struct page *page) 374static inline int page_count(struct page *page)
360{ 375{
361 return atomic_read(&compound_head(page)->_count); 376 return atomic_read(&compound_head(page)->_count);
362} 377}
363 378
379static inline void get_huge_page_tail(struct page *page)
380{
381 /*
382 * __split_huge_page_refcount() cannot run
383 * from under us.
384 */
385 VM_BUG_ON(page_mapcount(page) < 0);
386 VM_BUG_ON(atomic_read(&page->_count) != 0);
387 atomic_inc(&page->_mapcount);
388}
389
390extern bool __get_page_tail(struct page *page);
391
364static inline void get_page(struct page *page) 392static inline void get_page(struct page *page)
365{ 393{
394 if (unlikely(PageTail(page)))
395 if (likely(__get_page_tail(page)))
396 return;
366 /* 397 /*
367 * Getting a normal page or the head of a compound page 398 * Getting a normal page or the head of a compound page
368 * requires to already have an elevated page->_count. Only if 399 * requires to already have an elevated page->_count.
369 * we're getting a tail page, the elevated page->_count is
370 * required only in the head page, so for tail pages the
371 * bugcheck only verifies that the page->_count isn't
372 * negative.
373 */ 400 */
374 VM_BUG_ON(atomic_read(&page->_count) < !PageTail(page)); 401 VM_BUG_ON(atomic_read(&page->_count) <= 0);
375 atomic_inc(&page->_count); 402 atomic_inc(&page->_count);
376 /*
377 * Getting a tail page will elevate both the head and tail
378 * page->_count(s).
379 */
380 if (unlikely(PageTail(page))) {
381 /*
382 * This is safe only because
383 * __split_huge_page_refcount can't run under
384 * get_page().
385 */
386 VM_BUG_ON(atomic_read(&page->first_page->_count) <= 0);
387 atomic_inc(&page->first_page->_count);
388 }
389} 403}
390 404
391static inline struct page *virt_to_head_page(const void *x) 405static inline struct page *virt_to_head_page(const void *x)
@@ -685,7 +699,7 @@ static inline void set_page_section(struct page *page, unsigned long section)
685 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; 699 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
686} 700}
687 701
688static inline unsigned long page_to_section(struct page *page) 702static inline unsigned long page_to_section(const struct page *page)
689{ 703{
690 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; 704 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
691} 705}
@@ -720,7 +734,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
720 734
721static __always_inline void *lowmem_page_address(const struct page *page) 735static __always_inline void *lowmem_page_address(const struct page *page)
722{ 736{
723 return __va(PFN_PHYS(page_to_pfn((struct page *)page))); 737 return __va(PFN_PHYS(page_to_pfn(page)));
724} 738}
725 739
726#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) 740#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
@@ -737,7 +751,7 @@ static __always_inline void *lowmem_page_address(const struct page *page)
737#endif 751#endif
738 752
739#if defined(HASHED_PAGE_VIRTUAL) 753#if defined(HASHED_PAGE_VIRTUAL)
740void *page_address(struct page *page); 754void *page_address(const struct page *page);
741void set_page_address(struct page *page, void *virtual); 755void set_page_address(struct page *page, void *virtual);
742void page_address_init(void); 756void page_address_init(void);
743#endif 757#endif
@@ -804,21 +818,6 @@ static inline pgoff_t page_index(struct page *page)
804} 818}
805 819
806/* 820/*
807 * The atomic page->_mapcount, like _count, starts from -1:
808 * so that transitions both from it and to it can be tracked,
809 * using atomic_inc_and_test and atomic_add_negative(-1).
810 */
811static inline void reset_page_mapcount(struct page *page)
812{
813 atomic_set(&(page)->_mapcount, -1);
814}
815
816static inline int page_mapcount(struct page *page)
817{
818 return atomic_read(&(page)->_mapcount) + 1;
819}
820
821/*
822 * Return true if this page is mapped into pagetables. 821 * Return true if this page is mapped into pagetables.
823 */ 822 */
824static inline int page_mapped(struct page *page) 823static inline int page_mapped(struct page *page)
@@ -962,6 +961,8 @@ int invalidate_inode_page(struct page *page);
962#ifdef CONFIG_MMU 961#ifdef CONFIG_MMU
963extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, 962extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
964 unsigned long address, unsigned int flags); 963 unsigned long address, unsigned int flags);
964extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
965 unsigned long address, unsigned int fault_flags);
965#else 966#else
966static inline int handle_mm_fault(struct mm_struct *mm, 967static inline int handle_mm_fault(struct mm_struct *mm,
967 struct vm_area_struct *vma, unsigned long address, 968 struct vm_area_struct *vma, unsigned long address,
@@ -971,6 +972,14 @@ static inline int handle_mm_fault(struct mm_struct *mm,
971 BUG(); 972 BUG();
972 return VM_FAULT_SIGBUS; 973 return VM_FAULT_SIGBUS;
973} 974}
975static inline int fixup_user_fault(struct task_struct *tsk,
976 struct mm_struct *mm, unsigned long address,
977 unsigned int fault_flags)
978{
979 /* should never happen if there's no MMU */
980 BUG();
981 return -EFAULT;
982}
974#endif 983#endif
975 984
976extern int make_pages_present(unsigned long addr, unsigned long end); 985extern int make_pages_present(unsigned long addr, unsigned long end);
@@ -988,8 +997,6 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
988int get_user_pages_fast(unsigned long start, int nr_pages, int write, 997int get_user_pages_fast(unsigned long start, int nr_pages, int write,
989 struct page **pages); 998 struct page **pages);
990struct page *get_dump_page(unsigned long addr); 999struct page *get_dump_page(unsigned long addr);
991extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
992 unsigned long address, unsigned int fault_flags);
993 1000
994extern int try_to_release_page(struct page * page, gfp_t gfp_mask); 1001extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
995extern void do_invalidatepage(struct page *page, unsigned long offset); 1002extern void do_invalidatepage(struct page *page, unsigned long offset);
@@ -1326,7 +1333,8 @@ extern void si_meminfo(struct sysinfo * val);
1326extern void si_meminfo_node(struct sysinfo *val, int nid); 1333extern void si_meminfo_node(struct sysinfo *val, int nid);
1327extern int after_bootmem; 1334extern int after_bootmem;
1328 1335
1329extern void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...); 1336extern __printf(3, 4)
1337void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);
1330 1338
1331extern void setup_per_cpu_pageset(void); 1339extern void setup_per_cpu_pageset(void);
1332 1340
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 774b8952deb4..5b42f1b34eb7 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -62,10 +62,23 @@ struct page {
62 struct { 62 struct {
63 63
64 union { 64 union {
65 atomic_t _mapcount; /* Count of ptes mapped in mms, 65 /*
66 * to show when page is mapped 66 * Count of ptes mapped in
67 * & limit reverse map searches. 67 * mms, to show when page is
68 */ 68 * mapped & limit reverse map
69 * searches.
70 *
71 * Used also for tail pages
72 * refcounting instead of
73 * _count. Tail pages cannot
74 * be mapped and keeping the
75 * tail page _count zero at
76 * all times guarantees
77 * get_page_unless_zero() will
78 * never succeed on tail
79 * pages.
80 */
81 atomic_t _mapcount;
69 82
70 struct { 83 struct {
71 unsigned inuse:16; 84 unsigned inuse:16;
@@ -79,9 +92,21 @@ struct page {
79 }; 92 };
80 93
81 /* Third double word block */ 94 /* Third double word block */
82 struct list_head lru; /* Pageout list, eg. active_list 95 union {
96 struct list_head lru; /* Pageout list, eg. active_list
83 * protected by zone->lru_lock ! 97 * protected by zone->lru_lock !
84 */ 98 */
99 struct { /* slub per cpu partial pages */
100 struct page *next; /* Next partial slab */
101#ifdef CONFIG_64BIT
102 int pages; /* Nr of partial slabs left */
103 int pobjects; /* Approximate # of objects */
104#else
105 short int pages;
106 short int pobjects;
107#endif
108 };
109 };
85 110
86 /* Remainder is not double word aligned */ 111 /* Remainder is not double word aligned */
87 union { 112 union {
@@ -135,6 +160,17 @@ struct page {
135#endif 160#endif
136; 161;
137 162
163struct page_frag {
164 struct page *page;
165#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
166 __u32 offset;
167 __u32 size;
168#else
169 __u16 offset;
170 __u16 size;
171#endif
172};
173
138typedef unsigned long __nocast vm_flags_t; 174typedef unsigned long __nocast vm_flags_t;
139 175
140/* 176/*
@@ -281,8 +317,15 @@ struct mm_struct {
281 unsigned long hiwater_rss; /* High-watermark of RSS usage */ 317 unsigned long hiwater_rss; /* High-watermark of RSS usage */
282 unsigned long hiwater_vm; /* High-water virtual memory usage */ 318 unsigned long hiwater_vm; /* High-water virtual memory usage */
283 319
284 unsigned long total_vm, locked_vm, shared_vm, exec_vm; 320 unsigned long total_vm; /* Total pages mapped */
285 unsigned long stack_vm, reserved_vm, def_flags, nr_ptes; 321 unsigned long locked_vm; /* Pages that have PG_mlocked set */
322 unsigned long pinned_vm; /* Refcount permanently increased */
323 unsigned long shared_vm; /* Shared pages (files) */
324 unsigned long exec_vm; /* VM_EXEC & ~VM_WRITE */
325 unsigned long stack_vm; /* VM_GROWSUP/DOWN */
326 unsigned long reserved_vm; /* VM_RESERVED|VM_IO pages */
327 unsigned long def_flags;
328 unsigned long nr_ptes; /* Page table pages */
286 unsigned long start_code, end_code, start_data, end_data; 329 unsigned long start_code, end_code, start_data, end_data;
287 unsigned long start_brk, brk, start_stack; 330 unsigned long start_brk, brk, start_stack;
288 unsigned long arg_start, arg_end, env_start, env_end; 331 unsigned long arg_start, arg_end, env_start, env_end;
@@ -313,9 +356,6 @@ struct mm_struct {
313 unsigned int token_priority; 356 unsigned int token_priority;
314 unsigned int last_interval; 357 unsigned int last_interval;
315 358
316 /* How many tasks sharing this mm are OOM_DISABLE */
317 atomic_t oom_disable_count;
318
319 unsigned long flags; /* Must use atomic bitops to access the bits */ 359 unsigned long flags; /* Must use atomic bitops to access the bits */
320 360
321 struct core_state *core_state; /* coredumping support */ 361 struct core_state *core_state; /* coredumping support */
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index b460fc2af8a1..415f2db414e1 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -50,8 +50,12 @@ struct mmc_ext_csd {
50 u8 rel_sectors; 50 u8 rel_sectors;
51 u8 rel_param; 51 u8 rel_param;
52 u8 part_config; 52 u8 part_config;
53 u8 cache_ctrl;
54 u8 rst_n_function;
53 unsigned int part_time; /* Units: ms */ 55 unsigned int part_time; /* Units: ms */
54 unsigned int sa_timeout; /* Units: 100ns */ 56 unsigned int sa_timeout; /* Units: 100ns */
57 unsigned int generic_cmd6_time; /* Units: 10ms */
58 unsigned int power_off_longtime; /* Units: ms */
55 unsigned int hs_max_dtr; 59 unsigned int hs_max_dtr;
56 unsigned int sectors; 60 unsigned int sectors;
57 unsigned int card_type; 61 unsigned int card_type;
@@ -63,11 +67,15 @@ struct mmc_ext_csd {
63 bool enhanced_area_en; /* enable bit */ 67 bool enhanced_area_en; /* enable bit */
64 unsigned long long enhanced_area_offset; /* Units: Byte */ 68 unsigned long long enhanced_area_offset; /* Units: Byte */
65 unsigned int enhanced_area_size; /* Units: KB */ 69 unsigned int enhanced_area_size; /* Units: KB */
66 unsigned int boot_size; /* in bytes */ 70 unsigned int cache_size; /* Units: KB */
71 bool hpi_en; /* HPI enablebit */
72 bool hpi; /* HPI support bit */
73 unsigned int hpi_cmd; /* cmd used as HPI */
67 u8 raw_partition_support; /* 160 */ 74 u8 raw_partition_support; /* 160 */
68 u8 raw_erased_mem_count; /* 181 */ 75 u8 raw_erased_mem_count; /* 181 */
69 u8 raw_ext_csd_structure; /* 194 */ 76 u8 raw_ext_csd_structure; /* 194 */
70 u8 raw_card_type; /* 196 */ 77 u8 raw_card_type; /* 196 */
78 u8 out_of_int_time; /* 198 */
71 u8 raw_s_a_timeout; /* 217 */ 79 u8 raw_s_a_timeout; /* 217 */
72 u8 raw_hc_erase_gap_size; /* 221 */ 80 u8 raw_hc_erase_gap_size; /* 221 */
73 u8 raw_erase_timeout_mult; /* 223 */ 81 u8 raw_erase_timeout_mult; /* 223 */
@@ -77,6 +85,9 @@ struct mmc_ext_csd {
77 u8 raw_sec_feature_support;/* 231 */ 85 u8 raw_sec_feature_support;/* 231 */
78 u8 raw_trim_mult; /* 232 */ 86 u8 raw_trim_mult; /* 232 */
79 u8 raw_sectors[4]; /* 212 - 4 bytes */ 87 u8 raw_sectors[4]; /* 212 - 4 bytes */
88
89 unsigned int feature_support;
90#define MMC_DISCARD_FEATURE BIT(0) /* CMD38 feature */
80}; 91};
81 92
82struct sd_scr { 93struct sd_scr {
@@ -157,6 +168,24 @@ struct sdio_func_tuple;
157 168
158#define SDIO_MAX_FUNCS 7 169#define SDIO_MAX_FUNCS 7
159 170
171/* The number of MMC physical partitions. These consist of:
172 * boot partitions (2), general purpose partitions (4) in MMC v4.4.
173 */
174#define MMC_NUM_BOOT_PARTITION 2
175#define MMC_NUM_GP_PARTITION 4
176#define MMC_NUM_PHY_PARTITION 6
177#define MAX_MMC_PART_NAME_LEN 20
178
179/*
180 * MMC Physical partitions
181 */
182struct mmc_part {
183 unsigned int size; /* partition size (in bytes) */
184 unsigned int part_cfg; /* partition type */
185 char name[MAX_MMC_PART_NAME_LEN];
186 bool force_ro; /* to make boot parts RO by default */
187};
188
160/* 189/*
161 * MMC device 190 * MMC device
162 */ 191 */
@@ -188,6 +217,13 @@ struct mmc_card {
188#define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ 217#define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */
189#define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ 218#define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */
190#define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ 219#define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */
220#define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */
221 /* byte mode */
222 unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */
223#define MMC_NO_POWER_NOTIFICATION 0
224#define MMC_POWERED_ON 1
225#define MMC_POWEROFF_SHORT 2
226#define MMC_POWEROFF_LONG 3
191 227
192 unsigned int erase_size; /* erase size in sectors */ 228 unsigned int erase_size; /* erase size in sectors */
193 unsigned int erase_shift; /* if erase unit is power 2 */ 229 unsigned int erase_shift; /* if erase unit is power 2 */
@@ -216,9 +252,24 @@ struct mmc_card {
216 unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */ 252 unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */
217 253
218 struct dentry *debugfs_root; 254 struct dentry *debugfs_root;
255 struct mmc_part part[MMC_NUM_PHY_PARTITION]; /* physical partitions */
256 unsigned int nr_parts;
219}; 257};
220 258
221/* 259/*
260 * This function fill contents in mmc_part.
261 */
262static inline void mmc_part_add(struct mmc_card *card, unsigned int size,
263 unsigned int part_cfg, char *name, int idx, bool ro)
264{
265 card->part[card->nr_parts].size = size;
266 card->part[card->nr_parts].part_cfg = part_cfg;
267 sprintf(card->part[card->nr_parts].name, name, idx);
268 card->part[card->nr_parts].force_ro = ro;
269 card->nr_parts++;
270}
271
272/*
222 * The world is not perfect and supplies us with broken mmc/sdio devices. 273 * The world is not perfect and supplies us with broken mmc/sdio devices.
223 * For at least some of these bugs we need a work-around. 274 * For at least some of these bugs we need a work-around.
224 */ 275 */
@@ -377,6 +428,11 @@ static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c)
377 return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; 428 return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF;
378} 429}
379 430
431static inline int mmc_card_broken_byte_mode_512(const struct mmc_card *c)
432{
433 return c->quirks & MMC_QUIRK_BROKEN_BYTE_MODE_512;
434}
435
380#define mmc_card_name(c) ((c)->cid.prod_name) 436#define mmc_card_name(c) ((c)->cid.prod_name)
381#define mmc_card_id(c) (dev_name(&(c)->dev)) 437#define mmc_card_id(c) (dev_name(&(c)->dev))
382 438
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index b8b1b7a311f1..174a844a5dda 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -136,6 +136,7 @@ struct mmc_async_req;
136 136
137extern struct mmc_async_req *mmc_start_req(struct mmc_host *, 137extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
138 struct mmc_async_req *, int *); 138 struct mmc_async_req *, int *);
139extern int mmc_interrupt_hpi(struct mmc_card *);
139extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); 140extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
140extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); 141extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
141extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); 142extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
@@ -146,6 +147,7 @@ extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
146#define MMC_ERASE_ARG 0x00000000 147#define MMC_ERASE_ARG 0x00000000
147#define MMC_SECURE_ERASE_ARG 0x80000000 148#define MMC_SECURE_ERASE_ARG 0x80000000
148#define MMC_TRIM_ARG 0x00000001 149#define MMC_TRIM_ARG 0x00000001
150#define MMC_DISCARD_ARG 0x00000003
149#define MMC_SECURE_TRIM1_ARG 0x80000001 151#define MMC_SECURE_TRIM1_ARG 0x80000001
150#define MMC_SECURE_TRIM2_ARG 0x80008000 152#define MMC_SECURE_TRIM2_ARG 0x80008000
151 153
@@ -156,12 +158,17 @@ extern int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
156 unsigned int arg); 158 unsigned int arg);
157extern int mmc_can_erase(struct mmc_card *card); 159extern int mmc_can_erase(struct mmc_card *card);
158extern int mmc_can_trim(struct mmc_card *card); 160extern int mmc_can_trim(struct mmc_card *card);
161extern int mmc_can_discard(struct mmc_card *card);
162extern int mmc_can_sanitize(struct mmc_card *card);
159extern int mmc_can_secure_erase_trim(struct mmc_card *card); 163extern int mmc_can_secure_erase_trim(struct mmc_card *card);
160extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, 164extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
161 unsigned int nr); 165 unsigned int nr);
162extern unsigned int mmc_calc_max_discard(struct mmc_card *card); 166extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
163 167
164extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); 168extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
169extern int mmc_hw_reset(struct mmc_host *host);
170extern int mmc_hw_reset_check(struct mmc_host *host);
171extern int mmc_can_reset(struct mmc_card *card);
165 172
166extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); 173extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
167extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); 174extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
@@ -171,6 +178,8 @@ extern void mmc_release_host(struct mmc_host *host);
171extern void mmc_do_release_host(struct mmc_host *host); 178extern void mmc_do_release_host(struct mmc_host *host);
172extern int mmc_try_claim_host(struct mmc_host *host); 179extern int mmc_try_claim_host(struct mmc_host *host);
173 180
181extern int mmc_flush_cache(struct mmc_card *);
182
174/** 183/**
175 * mmc_claim_host - exclusively claim a host 184 * mmc_claim_host - exclusively claim a host
176 * @host: mmc host to claim 185 * @host: mmc host to claim
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index 6b46819705d1..6dc9b80568a0 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -72,6 +72,8 @@ struct mmc_data;
72 * rate and timeout calculations. 72 * rate and timeout calculations.
73 * @current_speed: Configured rate of the controller. 73 * @current_speed: Configured rate of the controller.
74 * @num_slots: Number of slots available. 74 * @num_slots: Number of slots available.
75 * @verid: Denote Version ID.
76 * @data_offset: Set the offset of DATA register according to VERID.
75 * @pdev: Platform device associated with the MMC controller. 77 * @pdev: Platform device associated with the MMC controller.
76 * @pdata: Platform data associated with the MMC controller. 78 * @pdata: Platform data associated with the MMC controller.
77 * @slot: Slots sharing this MMC controller. 79 * @slot: Slots sharing this MMC controller.
@@ -147,6 +149,8 @@ struct dw_mci {
147 u32 current_speed; 149 u32 current_speed;
148 u32 num_slots; 150 u32 num_slots;
149 u32 fifoth_val; 151 u32 fifoth_val;
152 u16 verid;
153 u16 data_offset;
150 struct platform_device *pdev; 154 struct platform_device *pdev;
151 struct dw_mci_board *pdata; 155 struct dw_mci_board *pdata;
152 struct dw_mci_slot *slot[MAX_MCI_SLOTS]; 156 struct dw_mci_slot *slot[MAX_MCI_SLOTS];
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 0f83858147a6..a3ac9c48e5de 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -12,6 +12,7 @@
12 12
13#include <linux/leds.h> 13#include <linux/leds.h>
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/fault-inject.h>
15 16
16#include <linux/mmc/core.h> 17#include <linux/mmc/core.h>
17#include <linux/mmc/pm.h> 18#include <linux/mmc/pm.h>
@@ -56,8 +57,6 @@ struct mmc_ios {
56#define MMC_TIMING_UHS_SDR104 4 57#define MMC_TIMING_UHS_SDR104 4
57#define MMC_TIMING_UHS_DDR50 5 58#define MMC_TIMING_UHS_DDR50 5
58 59
59 unsigned char ddr; /* dual data rate used */
60
61#define MMC_SDR_MODE 0 60#define MMC_SDR_MODE 0
62#define MMC_1_2V_DDR_MODE 1 61#define MMC_1_2V_DDR_MODE 1
63#define MMC_1_8V_DDR_MODE 2 62#define MMC_1_8V_DDR_MODE 2
@@ -110,6 +109,9 @@ struct mmc_host_ops {
110 * It is optional for the host to implement pre_req and post_req in 109 * It is optional for the host to implement pre_req and post_req in
111 * order to support double buffering of requests (prepare one 110 * order to support double buffering of requests (prepare one
112 * request while another request is active). 111 * request while another request is active).
112 * pre_req() must always be followed by a post_req().
113 * To undo a call made to pre_req(), call post_req() with
114 * a nonzero err condition.
113 */ 115 */
114 void (*post_req)(struct mmc_host *host, struct mmc_request *req, 116 void (*post_req)(struct mmc_host *host, struct mmc_request *req,
115 int err); 117 int err);
@@ -149,6 +151,7 @@ struct mmc_host_ops {
149 int (*execute_tuning)(struct mmc_host *host); 151 int (*execute_tuning)(struct mmc_host *host);
150 void (*enable_preset_value)(struct mmc_host *host, bool enable); 152 void (*enable_preset_value)(struct mmc_host *host, bool enable);
151 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); 153 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
154 void (*hw_reset)(struct mmc_host *host);
152}; 155};
153 156
154struct mmc_card; 157struct mmc_card;
@@ -231,8 +234,20 @@ struct mmc_host {
231#define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ 234#define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */
232#define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ 235#define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */
233#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ 236#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
237#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */
238
239 unsigned int caps2; /* More host capabilities */
240
241#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */
242#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */
243#define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */
244#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */
234 245
235 mmc_pm_flag_t pm_caps; /* supported pm features */ 246 mmc_pm_flag_t pm_caps; /* supported pm features */
247 unsigned int power_notify_type;
248#define MMC_HOST_PW_NOTIFY_NONE 0
249#define MMC_HOST_PW_NOTIFY_SHORT 1
250#define MMC_HOST_PW_NOTIFY_LONG 2
236 251
237#ifdef CONFIG_MMC_CLKGATE 252#ifdef CONFIG_MMC_CLKGATE
238 int clk_requests; /* internal reference counter */ 253 int clk_requests; /* internal reference counter */
@@ -304,6 +319,10 @@ struct mmc_host {
304 319
305 struct mmc_async_req *areq; /* active async req */ 320 struct mmc_async_req *areq; /* active async req */
306 321
322#ifdef CONFIG_FAIL_MMC_REQUEST
323 struct fault_attr fail_mmc_request;
324#endif
325
307 unsigned long private[0] ____cacheline_aligned; 326 unsigned long private[0] ____cacheline_aligned;
308}; 327};
309 328
@@ -332,6 +351,8 @@ extern int mmc_power_restore_host(struct mmc_host *host);
332extern void mmc_detect_change(struct mmc_host *, unsigned long delay); 351extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
333extern void mmc_request_done(struct mmc_host *, struct mmc_request *); 352extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
334 353
354extern int mmc_cache_ctrl(struct mmc_host *, u8);
355
335static inline void mmc_signal_sdio_irq(struct mmc_host *host) 356static inline void mmc_signal_sdio_irq(struct mmc_host *host)
336{ 357{
337 host->ops->enable_sdio_irq(host, 0); 358 host->ops->enable_sdio_irq(host, 0);
@@ -396,4 +417,10 @@ static inline int mmc_host_cmd23(struct mmc_host *host)
396{ 417{
397 return host->caps & MMC_CAP_CMD23; 418 return host->caps & MMC_CAP_CMD23;
398} 419}
420
421static inline int mmc_boot_partition_access(struct mmc_host *host)
422{
423 return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
424}
425
399#endif /* LINUX_MMC_HOST_H */ 426#endif /* LINUX_MMC_HOST_H */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 5a794cb503ea..0e7135697d11 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -270,18 +270,31 @@ struct _mmc_csd {
270 * EXT_CSD fields 270 * EXT_CSD fields
271 */ 271 */
272 272
273#define EXT_CSD_FLUSH_CACHE 32 /* W */
274#define EXT_CSD_CACHE_CTRL 33 /* R/W */
275#define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */
276#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */
273#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ 277#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
274#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ 278#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */
279#define EXT_CSD_HPI_MGMT 161 /* R/W */
280#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */
281#define EXT_CSD_SANITIZE_START 165 /* W */
275#define EXT_CSD_WR_REL_PARAM 166 /* RO */ 282#define EXT_CSD_WR_REL_PARAM 166 /* RO */
276#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ 283#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
277#define EXT_CSD_PART_CONFIG 179 /* R/W */ 284#define EXT_CSD_PART_CONFIG 179 /* R/W */
278#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ 285#define EXT_CSD_ERASED_MEM_CONT 181 /* RO */
279#define EXT_CSD_BUS_WIDTH 183 /* R/W */ 286#define EXT_CSD_BUS_WIDTH 183 /* R/W */
280#define EXT_CSD_HS_TIMING 185 /* R/W */ 287#define EXT_CSD_HS_TIMING 185 /* R/W */
288#define EXT_CSD_POWER_CLASS 187 /* R/W */
281#define EXT_CSD_REV 192 /* RO */ 289#define EXT_CSD_REV 192 /* RO */
282#define EXT_CSD_STRUCTURE 194 /* RO */ 290#define EXT_CSD_STRUCTURE 194 /* RO */
283#define EXT_CSD_CARD_TYPE 196 /* RO */ 291#define EXT_CSD_CARD_TYPE 196 /* RO */
292#define EXT_CSD_OUT_OF_INTERRUPT_TIME 198 /* RO */
284#define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ 293#define EXT_CSD_PART_SWITCH_TIME 199 /* RO */
294#define EXT_CSD_PWR_CL_52_195 200 /* RO */
295#define EXT_CSD_PWR_CL_26_195 201 /* RO */
296#define EXT_CSD_PWR_CL_52_360 202 /* RO */
297#define EXT_CSD_PWR_CL_26_360 203 /* RO */
285#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ 298#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */
286#define EXT_CSD_S_A_TIMEOUT 217 /* RO */ 299#define EXT_CSD_S_A_TIMEOUT 217 /* RO */
287#define EXT_CSD_REL_WR_SEC_C 222 /* RO */ 300#define EXT_CSD_REL_WR_SEC_C 222 /* RO */
@@ -293,6 +306,14 @@ struct _mmc_csd {
293#define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ 306#define EXT_CSD_SEC_ERASE_MULT 230 /* RO */
294#define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ 307#define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */
295#define EXT_CSD_TRIM_MULT 232 /* RO */ 308#define EXT_CSD_TRIM_MULT 232 /* RO */
309#define EXT_CSD_PWR_CL_200_195 236 /* RO */
310#define EXT_CSD_PWR_CL_200_360 237 /* RO */
311#define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */
312#define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */
313#define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */
314#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */
315#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */
316#define EXT_CSD_HPI_FEATURES 503 /* RO */
296 317
297/* 318/*
298 * EXT_CSD field definitions 319 * EXT_CSD field definitions
@@ -302,7 +323,9 @@ struct _mmc_csd {
302 323
303#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) 324#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7)
304#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) 325#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1)
305#define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2) 326#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4)
327
328#define EXT_CSD_PART_SUPPORT_PART_EN (0x1)
306 329
307#define EXT_CSD_CMD_SET_NORMAL (1<<0) 330#define EXT_CSD_CMD_SET_NORMAL (1<<0)
308#define EXT_CSD_CMD_SET_SECURE (1<<1) 331#define EXT_CSD_CMD_SET_SECURE (1<<1)
@@ -327,7 +350,20 @@ struct _mmc_csd {
327#define EXT_CSD_SEC_ER_EN BIT(0) 350#define EXT_CSD_SEC_ER_EN BIT(0)
328#define EXT_CSD_SEC_BD_BLK_EN BIT(2) 351#define EXT_CSD_SEC_BD_BLK_EN BIT(2)
329#define EXT_CSD_SEC_GB_CL_EN BIT(4) 352#define EXT_CSD_SEC_GB_CL_EN BIT(4)
353#define EXT_CSD_SEC_SANITIZE BIT(6) /* v4.5 only */
354
355#define EXT_CSD_RST_N_EN_MASK 0x3
356#define EXT_CSD_RST_N_ENABLED 1 /* RST_n is enabled on card */
357
358#define EXT_CSD_NO_POWER_NOTIFICATION 0
359#define EXT_CSD_POWER_ON 1
360#define EXT_CSD_POWER_OFF_SHORT 2
361#define EXT_CSD_POWER_OFF_LONG 3
330 362
363#define EXT_CSD_PWR_CL_8BIT_MASK 0xF0 /* 8 bit PWR CLS */
364#define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */
365#define EXT_CSD_PWR_CL_8BIT_SHIFT 4
366#define EXT_CSD_PWR_CL_4BIT_SHIFT 0
331/* 367/*
332 * MMC_SWITCH access modes 368 * MMC_SWITCH access modes
333 */ 369 */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 5666f3abfab7..e4b69353678d 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -88,6 +88,10 @@ struct sdhci_host {
88/* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ 88/* The read-only detection via SDHCI_PRESENT_STATE register is unstable */
89#define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) 89#define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31)
90 90
91 unsigned int quirks2; /* More deviations from spec. */
92
93#define SDHCI_QUIRK2_OWN_CARD_DETECTION (1<<0)
94
91 int irq; /* Device IRQ */ 95 int irq; /* Device IRQ */
92 void __iomem *ioaddr; /* Mapped address */ 96 void __iomem *ioaddr; /* Mapped address */
93 97
@@ -115,6 +119,8 @@ struct sdhci_host {
115#define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */ 119#define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */
116#define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ 120#define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */
117#define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ 121#define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */
122#define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */
123#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */
118 124
119 unsigned int version; /* SDHCI spec. version */ 125 unsigned int version; /* SDHCI spec. version */
120 126
@@ -125,6 +131,8 @@ struct sdhci_host {
125 unsigned int clock; /* Current clock (MHz) */ 131 unsigned int clock; /* Current clock (MHz) */
126 u8 pwr; /* Current voltage */ 132 u8 pwr; /* Current voltage */
127 133
134 bool runtime_suspended; /* Host is runtime suspended */
135
128 struct mmc_request *mrq; /* Current request */ 136 struct mmc_request *mrq; /* Current request */
129 struct mmc_command *cmd; /* Current command */ 137 struct mmc_command *cmd; /* Current command */
130 struct mmc_data *data; /* Current data request */ 138 struct mmc_data *data; /* Current data request */
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
index 2a2e9905a247..e0b1123497b9 100644
--- a/include/linux/mmc/sdio.h
+++ b/include/linux/mmc/sdio.h
@@ -72,11 +72,13 @@
72#define SDIO_CCCR_REV_1_00 0 /* CCCR/FBR Version 1.00 */ 72#define SDIO_CCCR_REV_1_00 0 /* CCCR/FBR Version 1.00 */
73#define SDIO_CCCR_REV_1_10 1 /* CCCR/FBR Version 1.10 */ 73#define SDIO_CCCR_REV_1_10 1 /* CCCR/FBR Version 1.10 */
74#define SDIO_CCCR_REV_1_20 2 /* CCCR/FBR Version 1.20 */ 74#define SDIO_CCCR_REV_1_20 2 /* CCCR/FBR Version 1.20 */
75#define SDIO_CCCR_REV_3_00 3 /* CCCR/FBR Version 3.00 */
75 76
76#define SDIO_SDIO_REV_1_00 0 /* SDIO Spec Version 1.00 */ 77#define SDIO_SDIO_REV_1_00 0 /* SDIO Spec Version 1.00 */
77#define SDIO_SDIO_REV_1_10 1 /* SDIO Spec Version 1.10 */ 78#define SDIO_SDIO_REV_1_10 1 /* SDIO Spec Version 1.10 */
78#define SDIO_SDIO_REV_1_20 2 /* SDIO Spec Version 1.20 */ 79#define SDIO_SDIO_REV_1_20 2 /* SDIO Spec Version 1.20 */
79#define SDIO_SDIO_REV_2_00 3 /* SDIO Spec Version 2.00 */ 80#define SDIO_SDIO_REV_2_00 3 /* SDIO Spec Version 2.00 */
81#define SDIO_SDIO_REV_3_00 4 /* SDIO Spec Version 3.00 */
80 82
81#define SDIO_CCCR_SD 0x01 83#define SDIO_CCCR_SD 0x01
82 84
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 0222cd8ebe76..04ff452bf5c3 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -41,7 +41,9 @@ struct sh_mmcif_plat_data {
41 void (*set_pwr)(struct platform_device *pdev, int state); 41 void (*set_pwr)(struct platform_device *pdev, int state);
42 void (*down_pwr)(struct platform_device *pdev); 42 void (*down_pwr)(struct platform_device *pdev);
43 int (*get_cd)(struct platform_device *pdef); 43 int (*get_cd)(struct platform_device *pdef);
44 struct sh_mmcif_dma *dma; 44 struct sh_mmcif_dma *dma; /* Deprecated. Instead */
45 unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */
46 unsigned int slave_id_rx;
45 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ 47 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
46 unsigned long caps; 48 unsigned long caps;
47 u32 ocr; 49 u32 ocr;
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
index bd50b365167f..71b805451bd8 100644
--- a/include/linux/mmc/sh_mobile_sdhi.h
+++ b/include/linux/mmc/sh_mobile_sdhi.h
@@ -6,6 +6,10 @@
6struct platform_device; 6struct platform_device;
7struct tmio_mmc_data; 7struct tmio_mmc_data;
8 8
9#define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect"
10#define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard"
11#define SH_MOBILE_SDHI_IRQ_SDIO "sdio"
12
9struct sh_mobile_sdhi_info { 13struct sh_mobile_sdhi_info {
10 int dma_slave_tx; 14 int dma_slave_tx;
11 int dma_slave_rx; 15 int dma_slave_rx;
diff --git a/include/linux/mmiotrace.h b/include/linux/mmiotrace.h
index 97491f78b08c..c5d52780d6a0 100644
--- a/include/linux/mmiotrace.h
+++ b/include/linux/mmiotrace.h
@@ -49,8 +49,7 @@ extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
49extern void mmiotrace_iounmap(volatile void __iomem *addr); 49extern void mmiotrace_iounmap(volatile void __iomem *addr);
50 50
51/* For anyone to insert markers. Remember trailing newline. */ 51/* For anyone to insert markers. Remember trailing newline. */
52extern int mmiotrace_printk(const char *fmt, ...) 52extern __printf(1, 2) int mmiotrace_printk(const char *fmt, ...);
53 __attribute__ ((format (printf, 1, 2)));
54#else /* !CONFIG_MMIOTRACE: */ 53#else /* !CONFIG_MMIOTRACE: */
55static inline int is_kmmio_active(void) 54static inline int is_kmmio_active(void)
56{ 55{
@@ -71,10 +70,7 @@ static inline void mmiotrace_iounmap(volatile void __iomem *addr)
71{ 70{
72} 71}
73 72
74static inline int mmiotrace_printk(const char *fmt, ...) 73static inline __printf(1, 2) int mmiotrace_printk(const char *fmt, ...)
75 __attribute__ ((format (printf, 1, 0)));
76
77static inline int mmiotrace_printk(const char *fmt, ...)
78{ 74{
79 return 0; 75 return 0;
80} 76}
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index be1ac8d7789b..188cb2ffe8db 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -100,6 +100,7 @@ enum zone_stat_item {
100 NR_UNSTABLE_NFS, /* NFS unstable pages */ 100 NR_UNSTABLE_NFS, /* NFS unstable pages */
101 NR_BOUNCE, 101 NR_BOUNCE,
102 NR_VMSCAN_WRITE, 102 NR_VMSCAN_WRITE,
103 NR_VMSCAN_IMMEDIATE, /* Prioritise for reclaim when writeback ends */
103 NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */ 104 NR_WRITEBACK_TEMP, /* Writeback using temporary buffers */
104 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ 105 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
105 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ 106 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
@@ -164,6 +165,18 @@ static inline int is_unevictable_lru(enum lru_list l)
164#define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON) 165#define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON)
165#define LRU_ALL ((1 << NR_LRU_LISTS) - 1) 166#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)
166 167
168/* Isolate inactive pages */
169#define ISOLATE_INACTIVE ((__force isolate_mode_t)0x1)
170/* Isolate active pages */
171#define ISOLATE_ACTIVE ((__force isolate_mode_t)0x2)
172/* Isolate clean file */
173#define ISOLATE_CLEAN ((__force isolate_mode_t)0x4)
174/* Isolate unmapped file */
175#define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x8)
176
177/* LRU Isolation modes. */
178typedef unsigned __bitwise__ isolate_mode_t;
179
167enum zone_watermarks { 180enum zone_watermarks {
168 WMARK_MIN, 181 WMARK_MIN,
169 WMARK_LOW, 182 WMARK_LOW,
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index ae28e93fd072..468819cdde87 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -405,6 +405,15 @@ struct virtio_device_id {
405}; 405};
406#define VIRTIO_DEV_ANY_ID 0xffffffff 406#define VIRTIO_DEV_ANY_ID 0xffffffff
407 407
408/*
409 * For Hyper-V devices we use the device guid as the id.
410 */
411struct hv_vmbus_device_id {
412 __u8 guid[16];
413 kernel_ulong_t driver_data /* Data private to the driver */
414 __attribute__((aligned(sizeof(kernel_ulong_t))));
415};
416
408/* i2c */ 417/* i2c */
409 418
410#define I2C_NAME_SIZE 20 419#define I2C_NAME_SIZE 20
diff --git a/include/linux/module.h b/include/linux/module.h
index 1c30087a2d81..3cb7839a60b9 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -16,6 +16,7 @@
16#include <linux/kobject.h> 16#include <linux/kobject.h>
17#include <linux/moduleparam.h> 17#include <linux/moduleparam.h>
18#include <linux/tracepoint.h> 18#include <linux/tracepoint.h>
19#include <linux/export.h>
19 20
20#include <linux/percpu.h> 21#include <linux/percpu.h>
21#include <asm/module.h> 22#include <asm/module.h>
@@ -25,21 +26,8 @@
25/* Not Yet Implemented */ 26/* Not Yet Implemented */
26#define MODULE_SUPPORTED_DEVICE(name) 27#define MODULE_SUPPORTED_DEVICE(name)
27 28
28/* Some toolchains use a `_' prefix for all user symbols. */
29#ifdef CONFIG_SYMBOL_PREFIX
30#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
31#else
32#define MODULE_SYMBOL_PREFIX ""
33#endif
34
35#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN 29#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
36 30
37struct kernel_symbol
38{
39 unsigned long value;
40 const char *name;
41};
42
43struct modversion_info 31struct modversion_info
44{ 32{
45 unsigned long crc; 33 unsigned long crc;
@@ -98,11 +86,8 @@ void trim_init_extable(struct module *m);
98extern const struct gtype##_id __mod_##gtype##_table \ 86extern const struct gtype##_id __mod_##gtype##_table \
99 __attribute__ ((unused, alias(__stringify(name)))) 87 __attribute__ ((unused, alias(__stringify(name))))
100 88
101extern struct module __this_module;
102#define THIS_MODULE (&__this_module)
103#else /* !MODULE */ 89#else /* !MODULE */
104#define MODULE_GENERIC_TABLE(gtype,name) 90#define MODULE_GENERIC_TABLE(gtype,name)
105#define THIS_MODULE ((struct module *)0)
106#endif 91#endif
107 92
108/* Generic info of form tag = "info" */ 93/* Generic info of form tag = "info" */
@@ -150,11 +135,6 @@ extern struct module __this_module;
150/* What your module does. */ 135/* What your module does. */
151#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) 136#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
152 137
153/* One for each parameter, describing how to use it. Some files do
154 multiple of these per line, so can't just use MODULE_INFO. */
155#define MODULE_PARM_DESC(_parm, desc) \
156 __MODULE_INFO(parm, _parm, #_parm ":" desc)
157
158#define MODULE_DEVICE_TABLE(type,name) \ 138#define MODULE_DEVICE_TABLE(type,name) \
159 MODULE_GENERIC_TABLE(type##_device,name) 139 MODULE_GENERIC_TABLE(type##_device,name)
160 140
@@ -218,52 +198,6 @@ struct module_use {
218 struct module *source, *target; 198 struct module *source, *target;
219}; 199};
220 200
221#ifndef __GENKSYMS__
222#ifdef CONFIG_MODVERSIONS
223/* Mark the CRC weak since genksyms apparently decides not to
224 * generate a checksums for some symbols */
225#define __CRC_SYMBOL(sym, sec) \
226 extern void *__crc_##sym __attribute__((weak)); \
227 static const unsigned long __kcrctab_##sym \
228 __used \
229 __attribute__((section("___kcrctab" sec "+" #sym), unused)) \
230 = (unsigned long) &__crc_##sym;
231#else
232#define __CRC_SYMBOL(sym, sec)
233#endif
234
235/* For every exported symbol, place a struct in the __ksymtab section */
236#define __EXPORT_SYMBOL(sym, sec) \
237 extern typeof(sym) sym; \
238 __CRC_SYMBOL(sym, sec) \
239 static const char __kstrtab_##sym[] \
240 __attribute__((section("__ksymtab_strings"), aligned(1))) \
241 = MODULE_SYMBOL_PREFIX #sym; \
242 static const struct kernel_symbol __ksymtab_##sym \
243 __used \
244 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
245 = { (unsigned long)&sym, __kstrtab_##sym }
246
247#define EXPORT_SYMBOL(sym) \
248 __EXPORT_SYMBOL(sym, "")
249
250#define EXPORT_SYMBOL_GPL(sym) \
251 __EXPORT_SYMBOL(sym, "_gpl")
252
253#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
254 __EXPORT_SYMBOL(sym, "_gpl_future")
255
256
257#ifdef CONFIG_UNUSED_SYMBOLS
258#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
259#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
260#else
261#define EXPORT_UNUSED_SYMBOL(sym)
262#define EXPORT_UNUSED_SYMBOL_GPL(sym)
263#endif
264
265#endif
266
267enum module_state 201enum module_state
268{ 202{
269 MODULE_STATE_LIVE, 203 MODULE_STATE_LIVE,
@@ -580,15 +514,7 @@ int unregister_module_notifier(struct notifier_block * nb);
580 514
581extern void print_modules(void); 515extern void print_modules(void);
582 516
583extern void module_update_tracepoints(void);
584extern int module_get_iter_tracepoints(struct tracepoint_iter *iter);
585
586#else /* !CONFIG_MODULES... */ 517#else /* !CONFIG_MODULES... */
587#define EXPORT_SYMBOL(sym)
588#define EXPORT_SYMBOL_GPL(sym)
589#define EXPORT_SYMBOL_GPL_FUTURE(sym)
590#define EXPORT_UNUSED_SYMBOL(sym)
591#define EXPORT_UNUSED_SYMBOL_GPL(sym)
592 518
593/* Given an address, look for it in the exception tables. */ 519/* Given an address, look for it in the exception tables. */
594static inline const struct exception_table_entry * 520static inline const struct exception_table_entry *
@@ -698,15 +624,6 @@ static inline int unregister_module_notifier(struct notifier_block * nb)
698static inline void print_modules(void) 624static inline void print_modules(void)
699{ 625{
700} 626}
701
702static inline void module_update_tracepoints(void)
703{
704}
705
706static inline int module_get_iter_tracepoints(struct tracepoint_iter *iter)
707{
708 return 0;
709}
710#endif /* CONFIG_MODULES */ 627#endif /* CONFIG_MODULES */
711 628
712#ifdef CONFIG_SYSFS 629#ifdef CONFIG_SYSFS
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index ddaae98c53f9..7939f636c8ba 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -31,6 +31,11 @@ static const char __module_cat(name,__LINE__)[] \
31#define __MODULE_PARM_TYPE(name, _type) \ 31#define __MODULE_PARM_TYPE(name, _type) \
32 __MODULE_INFO(parmtype, name##type, #name ":" _type) 32 __MODULE_INFO(parmtype, name##type, #name ":" _type)
33 33
34/* One for each parameter, describing how to use it. Some files do
35 multiple of these per line, so can't just use MODULE_INFO. */
36#define MODULE_PARM_DESC(_parm, desc) \
37 __MODULE_INFO(parm, _parm, #_parm ":" desc)
38
34struct kernel_param; 39struct kernel_param;
35 40
36struct kernel_param_ops { 41struct kernel_param_ops {
@@ -262,6 +267,26 @@ static inline void __kernel_param_unlock(void)
262 .str = &__param_string_##name, 0, perm); \ 267 .str = &__param_string_##name, 0, perm); \
263 __MODULE_PARM_TYPE(name, "string") 268 __MODULE_PARM_TYPE(name, "string")
264 269
270/**
271 * parameq - checks if two parameter names match
272 * @name1: parameter name 1
273 * @name2: parameter name 2
274 *
275 * Returns true if the two parameter names are equal.
276 * Dashes (-) are considered equal to underscores (_).
277 */
278extern bool parameq(const char *name1, const char *name2);
279
280/**
281 * parameqn - checks if two parameter names match
282 * @name1: parameter name 1
283 * @name2: parameter name 2
284 * @n: the length to compare
285 *
286 * Similar to parameq(), except it compares @n characters.
287 */
288extern bool parameqn(const char *name1, const char *name2, size_t n);
289
265/* Called on module insert or kernel boot */ 290/* Called on module insert or kernel boot */
266extern int parse_args(const char *name, 291extern int parse_args(const char *name,
267 char *args, 292 char *args,
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 57cc0e63714f..c4eec228eef9 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -86,24 +86,39 @@ struct nand_bbt_descr {
86#define NAND_BBT_VERSION 0x00000100 86#define NAND_BBT_VERSION 0x00000100
87/* Create a bbt if none exists */ 87/* Create a bbt if none exists */
88#define NAND_BBT_CREATE 0x00000200 88#define NAND_BBT_CREATE 0x00000200
89/*
90 * Create an empty BBT with no vendor information. Vendor's information may be
91 * unavailable, for example, if the NAND controller has a different data and OOB
92 * layout or if this information is already purged. Must be used in conjunction
93 * with NAND_BBT_CREATE.
94 */
95#define NAND_BBT_CREATE_EMPTY 0x00000400
89/* Search good / bad pattern through all pages of a block */ 96/* Search good / bad pattern through all pages of a block */
90#define NAND_BBT_SCANALLPAGES 0x00000400 97#define NAND_BBT_SCANALLPAGES 0x00000800
91/* Scan block empty during good / bad block scan */ 98/* Scan block empty during good / bad block scan */
92#define NAND_BBT_SCANEMPTY 0x00000800 99#define NAND_BBT_SCANEMPTY 0x00001000
93/* Write bbt if neccecary */ 100/* Write bbt if neccecary */
94#define NAND_BBT_WRITE 0x00001000 101#define NAND_BBT_WRITE 0x00002000
95/* Read and write back block contents when writing bbt */ 102/* Read and write back block contents when writing bbt */
96#define NAND_BBT_SAVECONTENT 0x00002000 103#define NAND_BBT_SAVECONTENT 0x00004000
97/* Search good / bad pattern on the first and the second page */ 104/* Search good / bad pattern on the first and the second page */
98#define NAND_BBT_SCAN2NDPAGE 0x00004000 105#define NAND_BBT_SCAN2NDPAGE 0x00008000
99/* Search good / bad pattern on the last page of the eraseblock */ 106/* Search good / bad pattern on the last page of the eraseblock */
100#define NAND_BBT_SCANLASTPAGE 0x00008000 107#define NAND_BBT_SCANLASTPAGE 0x00010000
101/* Chip stores bad block marker on BOTH 1st and 6th bytes of OOB */ 108/*
102#define NAND_BBT_SCANBYTE1AND6 0x00100000 109 * Use a flash based bad block table. By default, OOB identifier is saved in
103/* The nand_bbt_descr was created dynamicaly and must be freed */ 110 * OOB area. This option is passed to the default bad block table function.
104#define NAND_BBT_DYNAMICSTRUCT 0x00200000 111 */
105/* The bad block table does not OOB for marker */ 112#define NAND_BBT_USE_FLASH 0x00020000
106#define NAND_BBT_NO_OOB 0x00400000 113/* Do not store flash based bad block table in OOB area; store it in-band */
114#define NAND_BBT_NO_OOB 0x00040000
115
116/*
117 * Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr
118 * was allocated dynamicaly and must be freed in nand_release(). Has no meaning
119 * in nand_chip.bbt_options.
120 */
121#define NAND_BBT_DYNAMICSTRUCT 0x80000000
107 122
108/* The maximum number of blocks to scan for a bbt */ 123/* The maximum number of blocks to scan for a bbt */
109#define NAND_BBT_SCAN_MAXBLOCKS 4 124#define NAND_BBT_SCAN_MAXBLOCKS 4
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 2541fb848daa..9f5b312af783 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -21,7 +21,6 @@
21#define __MTD_MTD_H__ 21#define __MTD_MTD_H__
22 22
23#include <linux/types.h> 23#include <linux/types.h>
24#include <linux/module.h>
25#include <linux/uio.h> 24#include <linux/uio.h>
26#include <linux/notifier.h> 25#include <linux/notifier.h>
27#include <linux/device.h> 26#include <linux/device.h>
@@ -33,17 +32,19 @@
33#define MTD_CHAR_MAJOR 90 32#define MTD_CHAR_MAJOR 90
34#define MTD_BLOCK_MAJOR 31 33#define MTD_BLOCK_MAJOR 31
35 34
36#define MTD_ERASE_PENDING 0x01 35#define MTD_ERASE_PENDING 0x01
37#define MTD_ERASING 0x02 36#define MTD_ERASING 0x02
38#define MTD_ERASE_SUSPEND 0x04 37#define MTD_ERASE_SUSPEND 0x04
39#define MTD_ERASE_DONE 0x08 38#define MTD_ERASE_DONE 0x08
40#define MTD_ERASE_FAILED 0x10 39#define MTD_ERASE_FAILED 0x10
41 40
42#define MTD_FAIL_ADDR_UNKNOWN -1LL 41#define MTD_FAIL_ADDR_UNKNOWN -1LL
43 42
44/* If the erase fails, fail_addr might indicate exactly which block failed. If 43/*
45 fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level or was not 44 * If the erase fails, fail_addr might indicate exactly which block failed. If
46 specific to any particular block. */ 45 * fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not at the device level
46 * or was not specific to any particular block.
47 */
47struct erase_info { 48struct erase_info {
48 struct mtd_info *mtd; 49 struct mtd_info *mtd;
49 uint64_t addr; 50 uint64_t addr;
@@ -60,26 +61,12 @@ struct erase_info {
60}; 61};
61 62
62struct mtd_erase_region_info { 63struct mtd_erase_region_info {
63 uint64_t offset; /* At which this region starts, from the beginning of the MTD */ 64 uint64_t offset; /* At which this region starts, from the beginning of the MTD */
64 uint32_t erasesize; /* For this region */ 65 uint32_t erasesize; /* For this region */
65 uint32_t numblocks; /* Number of blocks of erasesize in this region */ 66 uint32_t numblocks; /* Number of blocks of erasesize in this region */
66 unsigned long *lockmap; /* If keeping bitmap of locks */ 67 unsigned long *lockmap; /* If keeping bitmap of locks */
67}; 68};
68 69
69/*
70 * oob operation modes
71 *
72 * MTD_OOB_PLACE: oob data are placed at the given offset
73 * MTD_OOB_AUTO: oob data are automatically placed at the free areas
74 * which are defined by the ecclayout
75 * MTD_OOB_RAW: mode to read oob and data without doing ECC checking
76 */
77typedef enum {
78 MTD_OOB_PLACE,
79 MTD_OOB_AUTO,
80 MTD_OOB_RAW,
81} mtd_oob_mode_t;
82
83/** 70/**
84 * struct mtd_oob_ops - oob operation operands 71 * struct mtd_oob_ops - oob operation operands
85 * @mode: operation mode 72 * @mode: operation mode
@@ -91,7 +78,7 @@ typedef enum {
91 * @ooblen: number of oob bytes to write/read 78 * @ooblen: number of oob bytes to write/read
92 * @oobretlen: number of oob bytes written/read 79 * @oobretlen: number of oob bytes written/read
93 * @ooboffs: offset of oob data in the oob area (only relevant when 80 * @ooboffs: offset of oob data in the oob area (only relevant when
94 * mode = MTD_OOB_PLACE) 81 * mode = MTD_OPS_PLACE_OOB or MTD_OPS_RAW)
95 * @datbuf: data buffer - if NULL only oob data are read/written 82 * @datbuf: data buffer - if NULL only oob data are read/written
96 * @oobbuf: oob data buffer 83 * @oobbuf: oob data buffer
97 * 84 *
@@ -100,7 +87,7 @@ typedef enum {
100 * OOB area. 87 * OOB area.
101 */ 88 */
102struct mtd_oob_ops { 89struct mtd_oob_ops {
103 mtd_oob_mode_t mode; 90 unsigned int mode;
104 size_t len; 91 size_t len;
105 size_t retlen; 92 size_t retlen;
106 size_t ooblen; 93 size_t ooblen;
@@ -125,6 +112,8 @@ struct nand_ecclayout {
125 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE]; 112 struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES_LARGE];
126}; 113};
127 114
115struct module; /* only needed for owner field in mtd_info */
116
128struct mtd_info { 117struct mtd_info {
129 u_char type; 118 u_char type;
130 uint32_t flags; 119 uint32_t flags;
@@ -172,7 +161,7 @@ struct mtd_info {
172 const char *name; 161 const char *name;
173 int index; 162 int index;
174 163
175 /* ecc layout structure pointer - read only ! */ 164 /* ECC layout structure pointer - read only! */
176 struct nand_ecclayout *ecclayout; 165 struct nand_ecclayout *ecclayout;
177 166
178 /* Data for variable erase regions. If numeraseregions is zero, 167 /* Data for variable erase regions. If numeraseregions is zero,
@@ -323,10 +312,15 @@ static inline uint32_t mtd_mod_by_ws(uint64_t sz, struct mtd_info *mtd)
323 /* Kernel-side ioctl definitions */ 312 /* Kernel-side ioctl definitions */
324 313
325struct mtd_partition; 314struct mtd_partition;
326 315struct mtd_part_parser_data;
327extern int mtd_device_register(struct mtd_info *master, 316
328 const struct mtd_partition *parts, 317extern int mtd_device_parse_register(struct mtd_info *mtd,
329 int nr_parts); 318 const char **part_probe_types,
319 struct mtd_part_parser_data *parser_data,
320 const struct mtd_partition *defparts,
321 int defnr_parts);
322#define mtd_device_register(master, parts, nr_parts) \
323 mtd_device_parse_register(master, NULL, NULL, parts, nr_parts)
330extern int mtd_device_unregister(struct mtd_info *master); 324extern int mtd_device_unregister(struct mtd_info *master);
331extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); 325extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
332extern int __get_mtd_device(struct mtd_info *mtd); 326extern int __get_mtd_device(struct mtd_info *mtd);
@@ -355,27 +349,16 @@ void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size);
355 349
356void mtd_erase_callback(struct erase_info *instr); 350void mtd_erase_callback(struct erase_info *instr);
357 351
358/* 352static inline int mtd_is_bitflip(int err) {
359 * Debugging macro and defines 353 return err == -EUCLEAN;
360 */ 354}
361#define MTD_DEBUG_LEVEL0 (0) /* Quiet */ 355
362#define MTD_DEBUG_LEVEL1 (1) /* Audible */ 356static inline int mtd_is_eccerr(int err) {
363#define MTD_DEBUG_LEVEL2 (2) /* Loud */ 357 return err == -EBADMSG;
364#define MTD_DEBUG_LEVEL3 (3) /* Noisy */ 358}
365 359
366#ifdef CONFIG_MTD_DEBUG 360static inline int mtd_is_bitflip_or_eccerr(int err) {
367#define DEBUG(n, args...) \ 361 return mtd_is_bitflip(err) || mtd_is_eccerr(err);
368 do { \ 362}
369 if (n <= CONFIG_MTD_DEBUG_VERBOSE) \
370 printk(KERN_INFO args); \
371 } while(0)
372#else /* CONFIG_MTD_DEBUG */
373#define DEBUG(n, args...) \
374 do { \
375 if (0) \
376 printk(KERN_INFO args); \
377 } while(0)
378
379#endif /* CONFIG_MTD_DEBUG */
380 363
381#endif /* __MTD_MTD_H__ */ 364#endif /* __MTD_MTD_H__ */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index c2b9ac4fbc4a..904131bab501 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -42,10 +42,10 @@ extern void nand_release(struct mtd_info *mtd);
42/* Internal helper for board drivers which need to override command function */ 42/* Internal helper for board drivers which need to override command function */
43extern void nand_wait_ready(struct mtd_info *mtd); 43extern void nand_wait_ready(struct mtd_info *mtd);
44 44
45/* locks all blockes present in the device */ 45/* locks all blocks present in the device */
46extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len); 46extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
47 47
48/* unlocks specified locked blockes */ 48/* unlocks specified locked blocks */
49extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len); 49extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
50 50
51/* The maximum number of NAND chips in an array */ 51/* The maximum number of NAND chips in an array */
@@ -150,7 +150,7 @@ typedef enum {
150#define NAND_ECC_READ 0 150#define NAND_ECC_READ 0
151/* Reset Hardware ECC for write */ 151/* Reset Hardware ECC for write */
152#define NAND_ECC_WRITE 1 152#define NAND_ECC_WRITE 1
153/* Enable Hardware ECC before syndrom is read back from flash */ 153/* Enable Hardware ECC before syndrome is read back from flash */
154#define NAND_ECC_READSYN 2 154#define NAND_ECC_READSYN 2
155 155
156/* Bit mask for flags passed to do_nand_read_ecc */ 156/* Bit mask for flags passed to do_nand_read_ecc */
@@ -163,7 +163,7 @@ typedef enum {
163 */ 163 */
164/* Chip can not auto increment pages */ 164/* Chip can not auto increment pages */
165#define NAND_NO_AUTOINCR 0x00000001 165#define NAND_NO_AUTOINCR 0x00000001
166/* Buswitdh is 16 bit */ 166/* Buswidth is 16 bit */
167#define NAND_BUSWIDTH_16 0x00000002 167#define NAND_BUSWIDTH_16 0x00000002
168/* Device supports partial programming without padding */ 168/* Device supports partial programming without padding */
169#define NAND_NO_PADDING 0x00000004 169#define NAND_NO_PADDING 0x00000004
@@ -219,27 +219,15 @@ typedef enum {
219#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) 219#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR)
220 220
221/* Non chip related options */ 221/* Non chip related options */
222/*
223 * Use a flash based bad block table. OOB identifier is saved in OOB area.
224 * This option is passed to the default bad block table function.
225 */
226#define NAND_USE_FLASH_BBT 0x00010000
227/* This option skips the bbt scan during initialization. */ 222/* This option skips the bbt scan during initialization. */
228#define NAND_SKIP_BBTSCAN 0x00020000 223#define NAND_SKIP_BBTSCAN 0x00010000
229/* 224/*
230 * This option is defined if the board driver allocates its own buffers 225 * This option is defined if the board driver allocates its own buffers
231 * (e.g. because it needs them DMA-coherent). 226 * (e.g. because it needs them DMA-coherent).
232 */ 227 */
233#define NAND_OWN_BUFFERS 0x00040000 228#define NAND_OWN_BUFFERS 0x00020000
234/* Chip may not exist, so silence any errors in scan */ 229/* Chip may not exist, so silence any errors in scan */
235#define NAND_SCAN_SILENT_NODEV 0x00080000 230#define NAND_SCAN_SILENT_NODEV 0x00040000
236/*
237 * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch
238 * the OOB area.
239 */
240#define NAND_USE_FLASH_BBT_NO_OOB 0x00800000
241/* Create an empty BBT with no vendor information if the BBT is available */
242#define NAND_CREATE_EMPTY_BBT 0x01000000
243 231
244/* Options set by nand scan */ 232/* Options set by nand scan */
245/* Nand scan has allocated controller struct */ 233/* Nand scan has allocated controller struct */
@@ -331,27 +319,29 @@ struct nand_hw_control {
331}; 319};
332 320
333/** 321/**
334 * struct nand_ecc_ctrl - Control structure for ecc 322 * struct nand_ecc_ctrl - Control structure for ECC
335 * @mode: ecc mode 323 * @mode: ECC mode
336 * @steps: number of ecc steps per page 324 * @steps: number of ECC steps per page
337 * @size: data bytes per ecc step 325 * @size: data bytes per ECC step
338 * @bytes: ecc bytes per step 326 * @bytes: ECC bytes per step
339 * @total: total number of ecc bytes per page 327 * @total: total number of ECC bytes per page
340 * @prepad: padding information for syndrome based ecc generators 328 * @prepad: padding information for syndrome based ECC generators
341 * @postpad: padding information for syndrome based ecc generators 329 * @postpad: padding information for syndrome based ECC generators
342 * @layout: ECC layout control struct pointer 330 * @layout: ECC layout control struct pointer
343 * @priv: pointer to private ecc control data 331 * @priv: pointer to private ECC control data
344 * @hwctl: function to control hardware ecc generator. Must only 332 * @hwctl: function to control hardware ECC generator. Must only
345 * be provided if an hardware ECC is available 333 * be provided if an hardware ECC is available
346 * @calculate: function for ecc calculation or readback from ecc hardware 334 * @calculate: function for ECC calculation or readback from ECC hardware
347 * @correct: function for ecc correction, matching to ecc generator (sw/hw) 335 * @correct: function for ECC correction, matching to ECC generator (sw/hw)
348 * @read_page_raw: function to read a raw page without ECC 336 * @read_page_raw: function to read a raw page without ECC
349 * @write_page_raw: function to write a raw page without ECC 337 * @write_page_raw: function to write a raw page without ECC
350 * @read_page: function to read a page according to the ecc generator 338 * @read_page: function to read a page according to the ECC generator
351 * requirements. 339 * requirements.
352 * @read_subpage: function to read parts of the page covered by ECC. 340 * @read_subpage: function to read parts of the page covered by ECC.
353 * @write_page: function to write a page according to the ecc generator 341 * @write_page: function to write a page according to the ECC generator
354 * requirements. 342 * requirements.
343 * @write_oob_raw: function to write chip OOB data without ECC
344 * @read_oob_raw: function to read chip OOB data without ECC
355 * @read_oob: function to read chip OOB data 345 * @read_oob: function to read chip OOB data
356 * @write_oob: function to write chip OOB data 346 * @write_oob: function to write chip OOB data
357 */ 347 */
@@ -380,6 +370,10 @@ struct nand_ecc_ctrl {
380 uint32_t offs, uint32_t len, uint8_t *buf); 370 uint32_t offs, uint32_t len, uint8_t *buf);
381 void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, 371 void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
382 const uint8_t *buf); 372 const uint8_t *buf);
373 int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
374 int page);
375 int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
376 int page, int sndcmd);
383 int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page, 377 int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page,
384 int sndcmd); 378 int sndcmd);
385 int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip, 379 int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip,
@@ -388,8 +382,8 @@ struct nand_ecc_ctrl {
388 382
389/** 383/**
390 * struct nand_buffers - buffer structure for read/write 384 * struct nand_buffers - buffer structure for read/write
391 * @ecccalc: buffer for calculated ecc 385 * @ecccalc: buffer for calculated ECC
392 * @ecccode: buffer for ecc read from flash 386 * @ecccode: buffer for ECC read from flash
393 * @databuf: buffer for data - dynamically sized 387 * @databuf: buffer for data - dynamically sized
394 * 388 *
395 * Do not change the order of buffers. databuf and oobrbuf must be in 389 * Do not change the order of buffers. databuf and oobrbuf must be in
@@ -422,7 +416,7 @@ struct nand_buffers {
422 * mtd->oobsize, mtd->writesize and so on. 416 * mtd->oobsize, mtd->writesize and so on.
423 * @id_data contains the 8 bytes values of NAND_CMD_READID. 417 * @id_data contains the 8 bytes values of NAND_CMD_READID.
424 * Return with the bus width. 418 * Return with the bus width.
425 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accesing 419 * @dev_ready: [BOARDSPECIFIC] hardwarespecific function for accessing
426 * device ready/busy line. If set to NULL no access to 420 * device ready/busy line. If set to NULL no access to
427 * ready/busy is available and the ready/busy information 421 * ready/busy is available and the ready/busy information
428 * is read from the chip status register. 422 * is read from the chip status register.
@@ -430,17 +424,17 @@ struct nand_buffers {
430 * commands to the chip. 424 * commands to the chip.
431 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on 425 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on
432 * ready. 426 * ready.
433 * @ecc: [BOARDSPECIFIC] ecc control ctructure 427 * @ecc: [BOARDSPECIFIC] ECC control structure
434 * @buffers: buffer structure for read/write 428 * @buffers: buffer structure for read/write
435 * @hwcontrol: platform-specific hardware control structure 429 * @hwcontrol: platform-specific hardware control structure
436 * @ops: oob operation operands
437 * @erase_cmd: [INTERN] erase command write function, selectable due 430 * @erase_cmd: [INTERN] erase command write function, selectable due
438 * to AND support. 431 * to AND support.
439 * @scan_bbt: [REPLACEABLE] function to scan bad block table 432 * @scan_bbt: [REPLACEABLE] function to scan bad block table
440 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring 433 * @chip_delay: [BOARDSPECIFIC] chip dependent delay for transferring
441 * data from array to read regs (tR). 434 * data from array to read regs (tR).
442 * @state: [INTERN] the current state of the NAND device 435 * @state: [INTERN] the current state of the NAND device
443 * @oob_poi: poison value buffer 436 * @oob_poi: "poison value buffer," used for laying out OOB data
437 * before writing
444 * @page_shift: [INTERN] number of address bits in a page (column 438 * @page_shift: [INTERN] number of address bits in a page (column
445 * address bits). 439 * address bits).
446 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock 440 * @phys_erase_shift: [INTERN] number of address bits in a physical eraseblock
@@ -449,6 +443,9 @@ struct nand_buffers {
449 * @options: [BOARDSPECIFIC] various chip options. They can partly 443 * @options: [BOARDSPECIFIC] various chip options. They can partly
450 * be set to inform nand_scan about special functionality. 444 * be set to inform nand_scan about special functionality.
451 * See the defines for further explanation. 445 * See the defines for further explanation.
446 * @bbt_options: [INTERN] bad block specific options. All options used
447 * here must come from bbm.h. By default, these options
448 * will be copied to the appropriate nand_bbt_descr's.
452 * @badblockpos: [INTERN] position of the bad block marker in the oob 449 * @badblockpos: [INTERN] position of the bad block marker in the oob
453 * area. 450 * area.
454 * @badblockbits: [INTERN] number of bits to left-shift the bad block 451 * @badblockbits: [INTERN] number of bits to left-shift the bad block
@@ -464,7 +461,7 @@ struct nand_buffers {
464 * non 0 if ONFI supported. 461 * non 0 if ONFI supported.
465 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is 462 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is
466 * supported, 0 otherwise. 463 * supported, 0 otherwise.
467 * @ecclayout: [REPLACEABLE] the default ecc placement scheme 464 * @ecclayout: [REPLACEABLE] the default ECC placement scheme
468 * @bbt: [INTERN] bad block table pointer 465 * @bbt: [INTERN] bad block table pointer
469 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash 466 * @bbt_td: [REPLACEABLE] bad block table descriptor for flash
470 * lookup. 467 * lookup.
@@ -472,9 +469,9 @@ struct nand_buffers {
472 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial 469 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial
473 * bad block scan. 470 * bad block scan.
474 * @controller: [REPLACEABLE] a pointer to a hardware controller 471 * @controller: [REPLACEABLE] a pointer to a hardware controller
475 * structure which is shared among multiple independend 472 * structure which is shared among multiple independent
476 * devices. 473 * devices.
477 * @priv: [OPTIONAL] pointer to private chip date 474 * @priv: [OPTIONAL] pointer to private chip data
478 * @errstat: [OPTIONAL] hardware specific function to perform 475 * @errstat: [OPTIONAL] hardware specific function to perform
479 * additional error status checks (determine if errors are 476 * additional error status checks (determine if errors are
480 * correctable). 477 * correctable).
@@ -509,6 +506,7 @@ struct nand_chip {
509 506
510 int chip_delay; 507 int chip_delay;
511 unsigned int options; 508 unsigned int options;
509 unsigned int bbt_options;
512 510
513 int page_shift; 511 int page_shift;
514 int phys_erase_shift; 512 int phys_erase_shift;
@@ -536,8 +534,6 @@ struct nand_chip {
536 struct nand_buffers *buffers; 534 struct nand_buffers *buffers;
537 struct nand_hw_control hwcontrol; 535 struct nand_hw_control hwcontrol;
538 536
539 struct mtd_oob_ops ops;
540
541 uint8_t *bbt; 537 uint8_t *bbt;
542 struct nand_bbt_descr *bbt_td; 538 struct nand_bbt_descr *bbt_td;
543 struct nand_bbt_descr *bbt_md; 539 struct nand_bbt_descr *bbt_md;
@@ -611,10 +607,9 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
611 * @partitions: mtd partition list 607 * @partitions: mtd partition list
612 * @chip_delay: R/B delay value in us 608 * @chip_delay: R/B delay value in us
613 * @options: Option flags, e.g. 16bit buswidth 609 * @options: Option flags, e.g. 16bit buswidth
614 * @ecclayout: ecc layout info structure 610 * @bbt_options: BBT option flags, e.g. NAND_BBT_USE_FLASH
611 * @ecclayout: ECC layout info structure
615 * @part_probe_types: NULL-terminated array of probe types 612 * @part_probe_types: NULL-terminated array of probe types
616 * @set_parts: platform specific function to set partitions
617 * @priv: hardware controller specific settings
618 */ 613 */
619struct platform_nand_chip { 614struct platform_nand_chip {
620 int nr_chips; 615 int nr_chips;
@@ -624,9 +619,8 @@ struct platform_nand_chip {
624 struct nand_ecclayout *ecclayout; 619 struct nand_ecclayout *ecclayout;
625 int chip_delay; 620 int chip_delay;
626 unsigned int options; 621 unsigned int options;
622 unsigned int bbt_options;
627 const char **part_probe_types; 623 const char **part_probe_types;
628 void (*set_parts)(uint64_t size, struct platform_nand_chip *chip);
629 void *priv;
630}; 624};
631 625
632/* Keep gcc happy */ 626/* Keep gcc happy */
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 52b6f187bf49..4596503c9da9 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -184,6 +184,9 @@ struct onenand_chip {
184#define ONENAND_IS_CACHE_PROGRAM(this) \ 184#define ONENAND_IS_CACHE_PROGRAM(this) \
185 (this->options & ONENAND_HAS_CACHE_PROGRAM) 185 (this->options & ONENAND_HAS_CACHE_PROGRAM)
186 186
187#define ONENAND_IS_NOP_1(this) \
188 (this->options & ONENAND_HAS_NOP_1)
189
187/* Check byte access in OneNAND */ 190/* Check byte access in OneNAND */
188#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) 191#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
189 192
@@ -195,6 +198,7 @@ struct onenand_chip {
195#define ONENAND_HAS_2PLANE (0x0004) 198#define ONENAND_HAS_2PLANE (0x0004)
196#define ONENAND_HAS_4KB_PAGE (0x0008) 199#define ONENAND_HAS_4KB_PAGE (0x0008)
197#define ONENAND_HAS_CACHE_PROGRAM (0x0010) 200#define ONENAND_HAS_CACHE_PROGRAM (0x0010)
201#define ONENAND_HAS_NOP_1 (0x0020)
198#define ONENAND_SKIP_UNLOCK_CHECK (0x0100) 202#define ONENAND_SKIP_UNLOCK_CHECK (0x0100)
199#define ONENAND_PAGEBUF_ALLOC (0x1000) 203#define ONENAND_PAGEBUF_ALLOC (0x1000)
200#define ONENAND_OOBBUF_ALLOC (0x2000) 204#define ONENAND_OOBBUF_ALLOC (0x2000)
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 3a6f0372fc96..2475228c1158 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -24,7 +24,9 @@
24 * will extend to the end of the master MTD device. 24 * will extend to the end of the master MTD device.
25 * offset: absolute starting position within the master MTD device; if 25 * offset: absolute starting position within the master MTD device; if
26 * defined as MTDPART_OFS_APPEND, the partition will start where the 26 * defined as MTDPART_OFS_APPEND, the partition will start where the
27 * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block. 27 * previous one ended; if MTDPART_OFS_NXTBLK, at the next erase block;
28 * if MTDPART_OFS_RETAIN, consume as much as possible, leaving size
29 * after the end of partition.
28 * mask_flags: contains flags that have to be masked (removed) from the 30 * mask_flags: contains flags that have to be masked (removed) from the
29 * master MTD flag set for the corresponding MTD partition. 31 * master MTD flag set for the corresponding MTD partition.
30 * For example, to force a read-only partition, simply adding 32 * For example, to force a read-only partition, simply adding
@@ -42,12 +44,25 @@ struct mtd_partition {
42 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */ 44 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only) */
43}; 45};
44 46
47#define MTDPART_OFS_RETAIN (-3)
45#define MTDPART_OFS_NXTBLK (-2) 48#define MTDPART_OFS_NXTBLK (-2)
46#define MTDPART_OFS_APPEND (-1) 49#define MTDPART_OFS_APPEND (-1)
47#define MTDPART_SIZ_FULL (0) 50#define MTDPART_SIZ_FULL (0)
48 51
49 52
50struct mtd_info; 53struct mtd_info;
54struct device_node;
55
56/**
57 * struct mtd_part_parser_data - used to pass data to MTD partition parsers.
58 * @origin: for RedBoot, start address of MTD device
59 * @of_node: for OF parsers, device node containing partitioning information
60 */
61struct mtd_part_parser_data {
62 unsigned long origin;
63 struct device_node *of_node;
64};
65
51 66
52/* 67/*
53 * Functions dealing with the various ways of partitioning the space 68 * Functions dealing with the various ways of partitioning the space
@@ -57,37 +72,12 @@ struct mtd_part_parser {
57 struct list_head list; 72 struct list_head list;
58 struct module *owner; 73 struct module *owner;
59 const char *name; 74 const char *name;
60 int (*parse_fn)(struct mtd_info *, struct mtd_partition **, unsigned long); 75 int (*parse_fn)(struct mtd_info *, struct mtd_partition **,
76 struct mtd_part_parser_data *);
61}; 77};
62 78
63extern int register_mtd_parser(struct mtd_part_parser *parser); 79extern int register_mtd_parser(struct mtd_part_parser *parser);
64extern int deregister_mtd_parser(struct mtd_part_parser *parser); 80extern int deregister_mtd_parser(struct mtd_part_parser *parser);
65extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
66 struct mtd_partition **pparts, unsigned long origin);
67
68#define put_partition_parser(p) do { module_put((p)->owner); } while(0)
69
70struct device;
71struct device_node;
72
73#ifdef CONFIG_MTD_OF_PARTS
74int __devinit of_mtd_parse_partitions(struct device *dev,
75 struct device_node *node,
76 struct mtd_partition **pparts);
77#else
78static inline int of_mtd_parse_partitions(struct device *dev,
79 struct device_node *node,
80 struct mtd_partition **pparts)
81{
82 return 0;
83}
84#endif
85
86#ifdef CONFIG_MTD_CMDLINE_PARTS
87static inline int mtd_has_cmdlinepart(void) { return 1; }
88#else
89static inline int mtd_has_cmdlinepart(void) { return 0; }
90#endif
91 81
92int mtd_is_partition(struct mtd_info *mtd); 82int mtd_is_partition(struct mtd_info *mtd);
93int mtd_add_partition(struct mtd_info *master, char *name, 83int mtd_add_partition(struct mtd_info *master, char *name,
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index e5f21d293c70..04e018160e2b 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -32,21 +32,4 @@ struct physmap_flash_data {
32 struct mtd_partition *parts; 32 struct mtd_partition *parts;
33}; 33};
34 34
35/*
36 * Board needs to specify the exact mapping during their setup time.
37 */
38void physmap_configure(unsigned long addr, unsigned long size,
39 int bankwidth, void (*set_vpp)(struct map_info *, int) );
40
41/*
42 * Machines that wish to do flash partition may want to call this function in
43 * their setup routine.
44 *
45 * physmap_set_partitions(mypartitions, num_parts);
46 *
47 * Note that one can always override this hard-coded partition with
48 * command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS).
49 */
50void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
51
52#endif /* __LINUX_MTD_PHYSMAP__ */ 35#endif /* __LINUX_MTD_PHYSMAP__ */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 76fe2c62ae71..ffc02135c483 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -48,11 +48,12 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
48 */ 48 */
49#define LOOKUP_FOLLOW 0x0001 49#define LOOKUP_FOLLOW 0x0001
50#define LOOKUP_DIRECTORY 0x0002 50#define LOOKUP_DIRECTORY 0x0002
51#define LOOKUP_AUTOMOUNT 0x0004
51 52
52#define LOOKUP_PARENT 0x0010 53#define LOOKUP_PARENT 0x0010
53#define LOOKUP_REVAL 0x0020 54#define LOOKUP_REVAL 0x0020
54#define LOOKUP_RCU 0x0040 55#define LOOKUP_RCU 0x0040
55#define LOOKUP_NO_AUTOMOUNT 0x0080 56
56/* 57/*
57 * Intent data 58 * Intent data
58 */ 59 */
@@ -66,6 +67,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
66#define LOOKUP_EMPTY 0x4000 67#define LOOKUP_EMPTY 0x4000
67 68
68extern int user_path_at(int, const char __user *, unsigned, struct path *); 69extern int user_path_at(int, const char __user *, unsigned, struct path *);
70extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty);
69 71
70#define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) 72#define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path)
71#define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path) 73#define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path)
diff --git a/include/linux/net_tstamp.h b/include/linux/net_tstamp.h
index a3b8546354ac..ae5df122e42f 100644
--- a/include/linux/net_tstamp.h
+++ b/include/linux/net_tstamp.h
@@ -45,7 +45,7 @@ struct hwtstamp_config {
45}; 45};
46 46
47/* possible values for hwtstamp_config->tx_type */ 47/* possible values for hwtstamp_config->tx_type */
48enum { 48enum hwtstamp_tx_types {
49 /* 49 /*
50 * No outgoing packet will need hardware time stamping; 50 * No outgoing packet will need hardware time stamping;
51 * should a packet arrive which asks for it, no hardware 51 * should a packet arrive which asks for it, no hardware
@@ -60,10 +60,19 @@ enum {
60 * before sending the packet. 60 * before sending the packet.
61 */ 61 */
62 HWTSTAMP_TX_ON, 62 HWTSTAMP_TX_ON,
63
64 /*
65 * Enables time stamping for outgoing packets just as
66 * HWTSTAMP_TX_ON does, but also enables time stamp insertion
67 * directly into Sync packets. In this case, transmitted Sync
68 * packets will not received a time stamp via the socket error
69 * queue.
70 */
71 HWTSTAMP_TX_ONESTEP_SYNC,
63}; 72};
64 73
65/* possible values for hwtstamp_config->rx_filter */ 74/* possible values for hwtstamp_config->rx_filter */
66enum { 75enum hwtstamp_rx_filters {
67 /* time stamp no incoming packet at all */ 76 /* time stamp no incoming packet at all */
68 HWTSTAMP_FILTER_NONE, 77 HWTSTAMP_FILTER_NONE,
69 78
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ddee79bb8f15..cbeb5867cff7 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -31,7 +31,7 @@
31#include <linux/if_link.h> 31#include <linux/if_link.h>
32 32
33#ifdef __KERNEL__ 33#ifdef __KERNEL__
34#include <linux/pm_qos_params.h> 34#include <linux/pm_qos.h>
35#include <linux/timer.h> 35#include <linux/timer.h>
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/atomic.h> 37#include <linux/atomic.h>
@@ -723,9 +723,8 @@ struct netdev_tc_txq {
723 * 723 *
724 * void (*ndo_set_rx_mode)(struct net_device *dev); 724 * void (*ndo_set_rx_mode)(struct net_device *dev);
725 * This function is called device changes address list filtering. 725 * This function is called device changes address list filtering.
726 * 726 * If driver handles unicast address filtering, it should set
727 * void (*ndo_set_multicast_list)(struct net_device *dev); 727 * IFF_UNICAST_FLT to its priv_flags.
728 * This function is called when the multicast address list changes.
729 * 728 *
730 * int (*ndo_set_mac_address)(struct net_device *dev, void *addr); 729 * int (*ndo_set_mac_address)(struct net_device *dev, void *addr);
731 * This function is called when the Media Access Control address 730 * This function is called when the Media Access Control address
@@ -782,6 +781,7 @@ struct netdev_tc_txq {
782 * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac); 781 * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac);
783 * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos); 782 * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos);
784 * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); 783 * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate);
784 * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting);
785 * int (*ndo_get_vf_config)(struct net_device *dev, 785 * int (*ndo_get_vf_config)(struct net_device *dev,
786 * int vf, struct ifla_vf_info *ivf); 786 * int vf, struct ifla_vf_info *ivf);
787 * int (*ndo_set_vf_port)(struct net_device *dev, int vf, 787 * int (*ndo_set_vf_port)(struct net_device *dev, int vf,
@@ -868,7 +868,6 @@ struct net_device_ops {
868 void (*ndo_change_rx_flags)(struct net_device *dev, 868 void (*ndo_change_rx_flags)(struct net_device *dev,
869 int flags); 869 int flags);
870 void (*ndo_set_rx_mode)(struct net_device *dev); 870 void (*ndo_set_rx_mode)(struct net_device *dev);
871 void (*ndo_set_multicast_list)(struct net_device *dev);
872 int (*ndo_set_mac_address)(struct net_device *dev, 871 int (*ndo_set_mac_address)(struct net_device *dev,
873 void *addr); 872 void *addr);
874 int (*ndo_validate_addr)(struct net_device *dev); 873 int (*ndo_validate_addr)(struct net_device *dev);
@@ -902,6 +901,8 @@ struct net_device_ops {
902 int queue, u16 vlan, u8 qos); 901 int queue, u16 vlan, u8 qos);
903 int (*ndo_set_vf_tx_rate)(struct net_device *dev, 902 int (*ndo_set_vf_tx_rate)(struct net_device *dev,
904 int vf, int rate); 903 int vf, int rate);
904 int (*ndo_set_vf_spoofchk)(struct net_device *dev,
905 int vf, bool setting);
905 int (*ndo_get_vf_config)(struct net_device *dev, 906 int (*ndo_get_vf_config)(struct net_device *dev,
906 int vf, 907 int vf,
907 struct ifla_vf_info *ivf); 908 struct ifla_vf_info *ivf);
@@ -924,11 +925,15 @@ struct net_device_ops {
924 u16 xid, 925 u16 xid,
925 struct scatterlist *sgl, 926 struct scatterlist *sgl,
926 unsigned int sgc); 927 unsigned int sgc);
928#endif
929
930#if defined(CONFIG_LIBFCOE) || defined(CONFIG_LIBFCOE_MODULE)
927#define NETDEV_FCOE_WWNN 0 931#define NETDEV_FCOE_WWNN 0
928#define NETDEV_FCOE_WWPN 1 932#define NETDEV_FCOE_WWPN 1
929 int (*ndo_fcoe_get_wwn)(struct net_device *dev, 933 int (*ndo_fcoe_get_wwn)(struct net_device *dev,
930 u64 *wwn, int type); 934 u64 *wwn, int type);
931#endif 935#endif
936
932#ifdef CONFIG_RFS_ACCEL 937#ifdef CONFIG_RFS_ACCEL
933 int (*ndo_rx_flow_steer)(struct net_device *dev, 938 int (*ndo_rx_flow_steer)(struct net_device *dev,
934 const struct sk_buff *skb, 939 const struct sk_buff *skb,
@@ -964,7 +969,7 @@ struct net_device {
964 */ 969 */
965 char name[IFNAMSIZ]; 970 char name[IFNAMSIZ];
966 971
967 struct pm_qos_request_list pm_qos_req; 972 struct pm_qos_request pm_qos_req;
968 973
969 /* device name hash chain */ 974 /* device name hash chain */
970 struct hlist_node name_hlist; 975 struct hlist_node name_hlist;
@@ -2587,9 +2592,6 @@ static inline int netif_is_bond_slave(struct net_device *dev)
2587 2592
2588extern struct pernet_operations __net_initdata loopback_net_ops; 2593extern struct pernet_operations __net_initdata loopback_net_ops;
2589 2594
2590int dev_ethtool_get_settings(struct net_device *dev,
2591 struct ethtool_cmd *cmd);
2592
2593static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev) 2595static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev)
2594{ 2596{
2595 if (dev->features & NETIF_F_RXCSUM) 2597 if (dev->features & NETIF_F_RXCSUM)
@@ -2617,23 +2619,26 @@ static inline const char *netdev_name(const struct net_device *dev)
2617 return dev->name; 2619 return dev->name;
2618} 2620}
2619 2621
2620extern int netdev_printk(const char *level, const struct net_device *dev, 2622extern int __netdev_printk(const char *level, const struct net_device *dev,
2621 const char *format, ...) 2623 struct va_format *vaf);
2622 __attribute__ ((format (printf, 3, 4))); 2624
2623extern int netdev_emerg(const struct net_device *dev, const char *format, ...) 2625extern __printf(3, 4)
2624 __attribute__ ((format (printf, 2, 3))); 2626int netdev_printk(const char *level, const struct net_device *dev,
2625extern int netdev_alert(const struct net_device *dev, const char *format, ...) 2627 const char *format, ...);
2626 __attribute__ ((format (printf, 2, 3))); 2628extern __printf(2, 3)
2627extern int netdev_crit(const struct net_device *dev, const char *format, ...) 2629int netdev_emerg(const struct net_device *dev, const char *format, ...);
2628 __attribute__ ((format (printf, 2, 3))); 2630extern __printf(2, 3)
2629extern int netdev_err(const struct net_device *dev, const char *format, ...) 2631int netdev_alert(const struct net_device *dev, const char *format, ...);
2630 __attribute__ ((format (printf, 2, 3))); 2632extern __printf(2, 3)
2631extern int netdev_warn(const struct net_device *dev, const char *format, ...) 2633int netdev_crit(const struct net_device *dev, const char *format, ...);
2632 __attribute__ ((format (printf, 2, 3))); 2634extern __printf(2, 3)
2633extern int netdev_notice(const struct net_device *dev, const char *format, ...) 2635int netdev_err(const struct net_device *dev, const char *format, ...);
2634 __attribute__ ((format (printf, 2, 3))); 2636extern __printf(2, 3)
2635extern int netdev_info(const struct net_device *dev, const char *format, ...) 2637int netdev_warn(const struct net_device *dev, const char *format, ...);
2636 __attribute__ ((format (printf, 2, 3))); 2638extern __printf(2, 3)
2639int netdev_notice(const struct net_device *dev, const char *format, ...);
2640extern __printf(2, 3)
2641int netdev_info(const struct net_device *dev, const char *format, ...);
2637 2642
2638#define MODULE_ALIAS_NETDEV(device) \ 2643#define MODULE_ALIAS_NETDEV(device) \
2639 MODULE_ALIAS("netdev-" device) 2644 MODULE_ALIAS("netdev-" device)
@@ -2644,8 +2649,7 @@ extern int netdev_info(const struct net_device *dev, const char *format, ...)
2644#elif defined(CONFIG_DYNAMIC_DEBUG) 2649#elif defined(CONFIG_DYNAMIC_DEBUG)
2645#define netdev_dbg(__dev, format, args...) \ 2650#define netdev_dbg(__dev, format, args...) \
2646do { \ 2651do { \
2647 dynamic_dev_dbg((__dev)->dev.parent, "%s: " format, \ 2652 dynamic_netdev_dbg(__dev, format, ##args); \
2648 netdev_name(__dev), ##args); \
2649} while (0) 2653} while (0)
2650#else 2654#else
2651#define netdev_dbg(__dev, format, args...) \ 2655#define netdev_dbg(__dev, format, args...) \
@@ -2712,9 +2716,7 @@ do { \
2712#define netif_dbg(priv, type, netdev, format, args...) \ 2716#define netif_dbg(priv, type, netdev, format, args...) \
2713do { \ 2717do { \
2714 if (netif_msg_##type(priv)) \ 2718 if (netif_msg_##type(priv)) \
2715 dynamic_dev_dbg((netdev)->dev.parent, \ 2719 dynamic_netdev_dbg(netdev, format, ##args); \
2716 "%s: " format, \
2717 netdev_name(netdev), ##args); \
2718} while (0) 2720} while (0)
2719#else 2721#else
2720#define netif_dbg(priv, type, dev, format, args...) \ 2722#define netif_dbg(priv, type, dev, format, args...) \
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h
index 0ca66e97acbc..d1366f05d1b2 100644
--- a/include/linux/netfilter/xt_connlimit.h
+++ b/include/linux/netfilter/xt_connlimit.h
@@ -2,6 +2,7 @@
2#define _XT_CONNLIMIT_H 2#define _XT_CONNLIMIT_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netfilter.h>
5 6
6struct xt_connlimit_data; 7struct xt_connlimit_data;
7 8
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h
index 74b904d8f99c..e3c041d54020 100644
--- a/include/linux/netfilter/xt_conntrack.h
+++ b/include/linux/netfilter/xt_conntrack.h
@@ -6,6 +6,7 @@
6#define _XT_CONNTRACK_H 6#define _XT_CONNTRACK_H
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/netfilter.h>
9#include <linux/netfilter/nf_conntrack_tuple_common.h> 10#include <linux/netfilter/nf_conntrack_tuple_common.h>
10 11
11#define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) 12#define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
diff --git a/include/linux/netfilter/xt_iprange.h b/include/linux/netfilter/xt_iprange.h
index c1f21a779a45..25fd7cf851f0 100644
--- a/include/linux/netfilter/xt_iprange.h
+++ b/include/linux/netfilter/xt_iprange.h
@@ -2,6 +2,7 @@
2#define _LINUX_NETFILTER_XT_IPRANGE_H 1 2#define _LINUX_NETFILTER_XT_IPRANGE_H 1
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netfilter.h>
5 6
6enum { 7enum {
7 IPRANGE_SRC = 1 << 0, /* match source IP address */ 8 IPRANGE_SRC = 1 << 0, /* match source IP address */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index adbf4bff87ed..e08565d45178 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -52,7 +52,7 @@ struct arpt_arp {
52 struct in_addr smsk, tmsk; 52 struct in_addr smsk, tmsk;
53 53
54 /* Device hw address length, src+target device addresses */ 54 /* Device hw address length, src+target device addresses */
55 u_int8_t arhln, arhln_mask; 55 __u8 arhln, arhln_mask;
56 struct arpt_devaddr_info src_devaddr; 56 struct arpt_devaddr_info src_devaddr;
57 struct arpt_devaddr_info tgt_devaddr; 57 struct arpt_devaddr_info tgt_devaddr;
58 58
@@ -71,9 +71,9 @@ struct arpt_arp {
71 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; 71 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
72 72
73 /* Flags word */ 73 /* Flags word */
74 u_int8_t flags; 74 __u8 flags;
75 /* Inverse flags */ 75 /* Inverse flags */
76 u_int16_t invflags; 76 __u16 invflags;
77}; 77};
78 78
79/* Values for "flag" field in struct arpt_ip (general arp structure). 79/* Values for "flag" field in struct arpt_ip (general arp structure).
@@ -102,9 +102,9 @@ struct arpt_entry
102 struct arpt_arp arp; 102 struct arpt_arp arp;
103 103
104 /* Size of arpt_entry + matches */ 104 /* Size of arpt_entry + matches */
105 u_int16_t target_offset; 105 __u16 target_offset;
106 /* Size of arpt_entry + matches + target */ 106 /* Size of arpt_entry + matches + target */
107 u_int16_t next_offset; 107 __u16 next_offset;
108 108
109 /* Back pointer */ 109 /* Back pointer */
110 unsigned int comefrom; 110 unsigned int comefrom;
@@ -260,8 +260,8 @@ extern unsigned int arpt_do_table(struct sk_buff *skb,
260 260
261struct compat_arpt_entry { 261struct compat_arpt_entry {
262 struct arpt_arp arp; 262 struct arpt_arp arp;
263 u_int16_t target_offset; 263 __u16 target_offset;
264 u_int16_t next_offset; 264 __u16 next_offset;
265 compat_uint_t comefrom; 265 compat_uint_t comefrom;
266 struct compat_xt_counters counters; 266 struct compat_xt_counters counters;
267 unsigned char elems[0]; 267 unsigned char elems[0];
diff --git a/include/linux/netfilter_decnet.h b/include/linux/netfilter_decnet.h
index 6f425369ee29..0b09732aacd5 100644
--- a/include/linux/netfilter_decnet.h
+++ b/include/linux/netfilter_decnet.h
@@ -11,6 +11,9 @@
11 11
12/* only for userspace compatibility */ 12/* only for userspace compatibility */
13#ifndef __KERNEL__ 13#ifndef __KERNEL__
14
15#include <limits.h> /* for INT_MIN, INT_MAX */
16
14/* IP Cache bits. */ 17/* IP Cache bits. */
15/* Src IP address. */ 18/* Src IP address. */
16#define NFC_DN_SRC 0x0001 19#define NFC_DN_SRC 0x0001
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 29c7727ff0e8..fa0946c549d3 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -9,6 +9,9 @@
9 9
10/* only for userspace compatibility */ 10/* only for userspace compatibility */
11#ifndef __KERNEL__ 11#ifndef __KERNEL__
12
13#include <limits.h> /* for INT_MIN, INT_MAX */
14
12/* IP Cache bits. */ 15/* IP Cache bits. */
13/* Src IP address. */ 16/* Src IP address. */
14#define NFC_IP_SRC 0x0001 17#define NFC_IP_SRC 0x0001
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index f9930c87fff3..c3b45480ecf7 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -12,3 +12,4 @@ header-y += ipt_ah.h
12header-y += ipt_ecn.h 12header-y += ipt_ecn.h
13header-y += ipt_realm.h 13header-y += ipt_realm.h
14header-y += ipt_ttl.h 14header-y += ipt_ttl.h
15header-y += nf_nat.h
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 64a5d95c58e8..db79231914ce 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -81,12 +81,12 @@ struct ipt_ip {
81 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; 81 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
82 82
83 /* Protocol, 0 = ANY */ 83 /* Protocol, 0 = ANY */
84 u_int16_t proto; 84 __u16 proto;
85 85
86 /* Flags word */ 86 /* Flags word */
87 u_int8_t flags; 87 __u8 flags;
88 /* Inverse flags */ 88 /* Inverse flags */
89 u_int8_t invflags; 89 __u8 invflags;
90}; 90};
91 91
92/* Values for "flag" field in struct ipt_ip (general ip structure). */ 92/* Values for "flag" field in struct ipt_ip (general ip structure). */
@@ -114,9 +114,9 @@ struct ipt_entry {
114 unsigned int nfcache; 114 unsigned int nfcache;
115 115
116 /* Size of ipt_entry + matches */ 116 /* Size of ipt_entry + matches */
117 u_int16_t target_offset; 117 __u16 target_offset;
118 /* Size of ipt_entry + matches + target */ 118 /* Size of ipt_entry + matches + target */
119 u_int16_t next_offset; 119 __u16 next_offset;
120 120
121 /* Back pointer */ 121 /* Back pointer */
122 unsigned int comefrom; 122 unsigned int comefrom;
@@ -149,9 +149,9 @@ struct ipt_entry {
149 149
150/* ICMP matching stuff */ 150/* ICMP matching stuff */
151struct ipt_icmp { 151struct ipt_icmp {
152 u_int8_t type; /* type to match */ 152 __u8 type; /* type to match */
153 u_int8_t code[2]; /* range of code */ 153 __u8 code[2]; /* range of code */
154 u_int8_t invflags; /* Inverse flags */ 154 __u8 invflags; /* Inverse flags */
155}; 155};
156 156
157/* Values for "inv" field for struct ipt_icmp. */ 157/* Values for "inv" field for struct ipt_icmp. */
@@ -288,8 +288,8 @@ extern unsigned int ipt_do_table(struct sk_buff *skb,
288struct compat_ipt_entry { 288struct compat_ipt_entry {
289 struct ipt_ip ip; 289 struct ipt_ip ip;
290 compat_uint_t nfcache; 290 compat_uint_t nfcache;
291 u_int16_t target_offset; 291 __u16 target_offset;
292 u_int16_t next_offset; 292 __u16 next_offset;
293 compat_uint_t comefrom; 293 compat_uint_t comefrom;
294 struct compat_xt_counters counters; 294 struct compat_xt_counters counters;
295 unsigned char elems[0]; 295 unsigned char elems[0];
diff --git a/include/linux/netfilter_ipv4/nf_nat.h b/include/linux/netfilter_ipv4/nf_nat.h
new file mode 100644
index 000000000000..7a861d09fc86
--- /dev/null
+++ b/include/linux/netfilter_ipv4/nf_nat.h
@@ -0,0 +1,58 @@
1#ifndef _LINUX_NF_NAT_H
2#define _LINUX_NF_NAT_H
3
4#include <linux/types.h>
5
6#define IP_NAT_RANGE_MAP_IPS 1
7#define IP_NAT_RANGE_PROTO_SPECIFIED 2
8#define IP_NAT_RANGE_PROTO_RANDOM 4
9#define IP_NAT_RANGE_PERSISTENT 8
10
11/* The protocol-specific manipulable parts of the tuple. */
12union nf_conntrack_man_proto {
13 /* Add other protocols here. */
14 __be16 all;
15
16 struct {
17 __be16 port;
18 } tcp;
19 struct {
20 __be16 port;
21 } udp;
22 struct {
23 __be16 id;
24 } icmp;
25 struct {
26 __be16 port;
27 } dccp;
28 struct {
29 __be16 port;
30 } sctp;
31 struct {
32 __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */
33 } gre;
34};
35
36/* Single range specification. */
37struct nf_nat_range {
38 /* Set to OR of flags above. */
39 unsigned int flags;
40
41 /* Inclusive: network order. */
42 __be32 min_ip, max_ip;
43
44 /* Inclusive: network order */
45 union nf_conntrack_man_proto min, max;
46};
47
48/* For backwards compat: don't use in modern code. */
49struct nf_nat_multi_range_compat {
50 unsigned int rangesize; /* Must be 1. */
51
52 /* hangs off end. */
53 struct nf_nat_range range[1];
54};
55
56#define nf_nat_multi_range nf_nat_multi_range_compat
57
58#endif
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 1f7e300094cd..57c025127f1d 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -12,6 +12,9 @@
12 12
13/* only for userspace compatibility */ 13/* only for userspace compatibility */
14#ifndef __KERNEL__ 14#ifndef __KERNEL__
15
16#include <limits.h> /* for INT_MIN, INT_MAX */
17
15/* IP Cache bits. */ 18/* IP Cache bits. */
16/* Src IP address. */ 19/* Src IP address. */
17#define NFC_IP6_SRC 0x0001 20#define NFC_IP6_SRC 0x0001
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index c9784f7a9c1f..f549adccc94c 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -81,14 +81,14 @@ struct ip6t_ip6 {
81 * MH do not match any packets. 81 * MH do not match any packets.
82 * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol. 82 * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
83 */ 83 */
84 u_int16_t proto; 84 __u16 proto;
85 /* TOS to match iff flags & IP6T_F_TOS */ 85 /* TOS to match iff flags & IP6T_F_TOS */
86 u_int8_t tos; 86 __u8 tos;
87 87
88 /* Flags word */ 88 /* Flags word */
89 u_int8_t flags; 89 __u8 flags;
90 /* Inverse flags */ 90 /* Inverse flags */
91 u_int8_t invflags; 91 __u8 invflags;
92}; 92};
93 93
94/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ 94/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
@@ -118,9 +118,9 @@ struct ip6t_entry {
118 unsigned int nfcache; 118 unsigned int nfcache;
119 119
120 /* Size of ipt_entry + matches */ 120 /* Size of ipt_entry + matches */
121 u_int16_t target_offset; 121 __u16 target_offset;
122 /* Size of ipt_entry + matches + target */ 122 /* Size of ipt_entry + matches + target */
123 u_int16_t next_offset; 123 __u16 next_offset;
124 124
125 /* Back pointer */ 125 /* Back pointer */
126 unsigned int comefrom; 126 unsigned int comefrom;
@@ -186,9 +186,9 @@ struct ip6t_error {
186 186
187/* ICMP matching stuff */ 187/* ICMP matching stuff */
188struct ip6t_icmp { 188struct ip6t_icmp {
189 u_int8_t type; /* type to match */ 189 __u8 type; /* type to match */
190 u_int8_t code[2]; /* range of code */ 190 __u8 code[2]; /* range of code */
191 u_int8_t invflags; /* Inverse flags */ 191 __u8 invflags; /* Inverse flags */
192}; 192};
193 193
194/* Values for "inv" field for struct ipt_icmp. */ 194/* Values for "inv" field for struct ipt_icmp. */
@@ -298,8 +298,8 @@ extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
298struct compat_ip6t_entry { 298struct compat_ip6t_entry {
299 struct ip6t_ip6 ipv6; 299 struct ip6t_ip6 ipv6;
300 compat_uint_t nfcache; 300 compat_uint_t nfcache;
301 u_int16_t target_offset; 301 __u16 target_offset;
302 u_int16_t next_offset; 302 __u16 next_offset;
303 compat_uint_t comefrom; 303 compat_uint_t comefrom;
304 struct compat_xt_counters counters; 304 struct compat_xt_counters counters;
305 unsigned char elems[0]; 305 unsigned char elems[0];
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 2e17c5dbdcb8..8374d2967362 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_NETLINK_H 1#ifndef __LINUX_NETLINK_H
2#define __LINUX_NETLINK_H 2#define __LINUX_NETLINK_H
3 3
4#include <linux/socket.h> /* for sa_family_t */ 4#include <linux/socket.h> /* for __kernel_sa_family_t */
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7#define NETLINK_ROUTE 0 /* Routing/device hook */ 7#define NETLINK_ROUTE 0 /* Routing/device hook */
@@ -25,11 +25,12 @@
25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ 25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
26#define NETLINK_ECRYPTFS 19 26#define NETLINK_ECRYPTFS 19
27#define NETLINK_RDMA 20 27#define NETLINK_RDMA 20
28#define NETLINK_CRYPTO 21 /* Crypto layer */
28 29
29#define MAX_LINKS 32 30#define MAX_LINKS 32
30 31
31struct sockaddr_nl { 32struct sockaddr_nl {
32 sa_family_t nl_family; /* AF_NETLINK */ 33 __kernel_sa_family_t nl_family; /* AF_NETLINK */
33 unsigned short nl_pad; /* zero */ 34 unsigned short nl_pad; /* zero */
34 __u32 nl_pid; /* port ID */ 35 __u32 nl_pid; /* port ID */
35 __u32 nl_groups; /* multicast groups mask */ 36 __u32 nl_groups; /* multicast groups mask */
diff --git a/include/linux/netrom.h b/include/linux/netrom.h
index 6939b32f66a0..af7313cc9cb6 100644
--- a/include/linux/netrom.h
+++ b/include/linux/netrom.h
@@ -7,6 +7,8 @@
7#ifndef NETROM_KERNEL_H 7#ifndef NETROM_KERNEL_H
8#define NETROM_KERNEL_H 8#define NETROM_KERNEL_H
9 9
10#include <linux/ax25.h>
11
10#define NETROM_MTU 236 12#define NETROM_MTU 236
11 13
12#define NETROM_T1 1 14#define NETROM_T1 1
diff --git a/include/linux/nfc.h b/include/linux/nfc.h
index 330a4c5db588..36cb955b05cc 100644
--- a/include/linux/nfc.h
+++ b/include/linux/nfc.h
@@ -39,6 +39,10 @@
39 * 39 *
40 * @NFC_CMD_GET_DEVICE: request information about a device (requires 40 * @NFC_CMD_GET_DEVICE: request information about a device (requires
41 * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices 41 * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices
42 * @NFC_CMD_DEV_UP: turn on the nfc device
43 * (requires %NFC_ATTR_DEVICE_INDEX)
44 * @NFC_CMD_DEV_DOWN: turn off the nfc device
45 * (requires %NFC_ATTR_DEVICE_INDEX)
42 * @NFC_CMD_START_POLL: start polling for targets using the given protocols 46 * @NFC_CMD_START_POLL: start polling for targets using the given protocols
43 * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS) 47 * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS)
44 * @NFC_CMD_STOP_POLL: stop polling for targets (requires 48 * @NFC_CMD_STOP_POLL: stop polling for targets (requires
@@ -56,6 +60,8 @@
56enum nfc_commands { 60enum nfc_commands {
57 NFC_CMD_UNSPEC, 61 NFC_CMD_UNSPEC,
58 NFC_CMD_GET_DEVICE, 62 NFC_CMD_GET_DEVICE,
63 NFC_CMD_DEV_UP,
64 NFC_CMD_DEV_DOWN,
59 NFC_CMD_START_POLL, 65 NFC_CMD_START_POLL,
60 NFC_CMD_STOP_POLL, 66 NFC_CMD_STOP_POLL,
61 NFC_CMD_GET_TARGET, 67 NFC_CMD_GET_TARGET,
@@ -123,4 +129,6 @@ struct sockaddr_nfc {
123#define NFC_SOCKPROTO_RAW 0 129#define NFC_SOCKPROTO_RAW 0
124#define NFC_SOCKPROTO_MAX 1 130#define NFC_SOCKPROTO_MAX 1
125 131
132#define NFC_HEADER_SIZE 1
133
126#endif /*__LINUX_NFC_H */ 134#endif /*__LINUX_NFC_H */
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 76f99e8714f3..32345c2805c0 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -373,6 +373,22 @@ enum nfsstat4 {
373 NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */ 373 NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */
374}; 374};
375 375
376static inline bool seqid_mutating_err(u32 err)
377{
378 /* rfc 3530 section 8.1.5: */
379 switch (err) {
380 case NFS4ERR_STALE_CLIENTID:
381 case NFS4ERR_STALE_STATEID:
382 case NFS4ERR_BAD_STATEID:
383 case NFS4ERR_BAD_SEQID:
384 case NFS4ERR_BADXDR:
385 case NFS4ERR_RESOURCE:
386 case NFS4ERR_NOFILEHANDLE:
387 return false;
388 };
389 return true;
390}
391
376/* 392/*
377 * Note: NF4BAD is not actually part of the protocol; it is just used 393 * Note: NF4BAD is not actually part of the protocol; it is just used
378 * internally by nfsd. 394 * internally by nfsd.
@@ -394,7 +410,10 @@ enum open_claim_type4 {
394 NFS4_OPEN_CLAIM_NULL = 0, 410 NFS4_OPEN_CLAIM_NULL = 0,
395 NFS4_OPEN_CLAIM_PREVIOUS = 1, 411 NFS4_OPEN_CLAIM_PREVIOUS = 1,
396 NFS4_OPEN_CLAIM_DELEGATE_CUR = 2, 412 NFS4_OPEN_CLAIM_DELEGATE_CUR = 2,
397 NFS4_OPEN_CLAIM_DELEGATE_PREV = 3 413 NFS4_OPEN_CLAIM_DELEGATE_PREV = 3,
414 NFS4_OPEN_CLAIM_FH = 4, /* 4.1 */
415 NFS4_OPEN_CLAIM_DELEG_CUR_FH = 5, /* 4.1 */
416 NFS4_OPEN_CLAIM_DELEG_PREV_FH = 6, /* 4.1 */
398}; 417};
399 418
400enum opentype4 { 419enum opentype4 {
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index eaac770f886e..ab2c6343361a 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -149,7 +149,6 @@ struct nfs_inode {
149 unsigned long read_cache_jiffies; 149 unsigned long read_cache_jiffies;
150 unsigned long attrtimeo; 150 unsigned long attrtimeo;
151 unsigned long attrtimeo_timestamp; 151 unsigned long attrtimeo_timestamp;
152 __u64 change_attr; /* v4 only */
153 152
154 unsigned long attr_gencount; 153 unsigned long attr_gencount;
155 /* "Generation counter" for the attribute cache. This is 154 /* "Generation counter" for the attribute cache. This is
@@ -230,6 +229,7 @@ struct nfs_inode {
230#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ 229#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */
231#define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */ 230#define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */
232#define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */ 231#define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */
232#define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */
233 233
234static inline struct nfs_inode *NFS_I(const struct inode *inode) 234static inline struct nfs_inode *NFS_I(const struct inode *inode)
235{ 235{
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index e2791a27a901..ab465fe8c3d6 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -34,6 +34,7 @@ enum {
34 PG_NEED_COMMIT, 34 PG_NEED_COMMIT,
35 PG_NEED_RESCHED, 35 PG_NEED_RESCHED,
36 PG_PNFS_COMMIT, 36 PG_PNFS_COMMIT,
37 PG_PARTIAL_READ_FAILED,
37}; 38};
38 39
39struct nfs_inode; 40struct nfs_inode;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index abd615d74a29..c74595ba7094 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1133,7 +1133,6 @@ struct nfs_page;
1133#define NFS_PAGEVEC_SIZE (8U) 1133#define NFS_PAGEVEC_SIZE (8U)
1134 1134
1135struct nfs_read_data { 1135struct nfs_read_data {
1136 int flags;
1137 struct rpc_task task; 1136 struct rpc_task task;
1138 struct inode *inode; 1137 struct inode *inode;
1139 struct rpc_cred *cred; 1138 struct rpc_cred *cred;
@@ -1156,7 +1155,6 @@ struct nfs_read_data {
1156}; 1155};
1157 1156
1158struct nfs_write_data { 1157struct nfs_write_data {
1159 int flags;
1160 struct rpc_task task; 1158 struct rpc_task task;
1161 struct inode *inode; 1159 struct inode *inode;
1162 struct rpc_cred *cred; 1160 struct rpc_cred *cred;
@@ -1197,9 +1195,6 @@ struct nfs_rpc_ops {
1197 1195
1198 int (*getroot) (struct nfs_server *, struct nfs_fh *, 1196 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1199 struct nfs_fsinfo *); 1197 struct nfs_fsinfo *);
1200 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
1201 struct qstr *, struct nfs_fh *,
1202 struct nfs_fattr *);
1203 int (*getattr) (struct nfs_server *, struct nfs_fh *, 1198 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1204 struct nfs_fattr *); 1199 struct nfs_fattr *);
1205 int (*setattr) (struct dentry *, struct nfs_fattr *, 1200 int (*setattr) (struct dentry *, struct nfs_fattr *,
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild
index 55d1467de3c1..b8d4001212b3 100644
--- a/include/linux/nfsd/Kbuild
+++ b/include/linux/nfsd/Kbuild
@@ -1,6 +1,4 @@
1header-y += const.h
2header-y += debug.h 1header-y += debug.h
3header-y += export.h 2header-y += export.h
4header-y += nfsfh.h 3header-y += nfsfh.h
5header-y += stats.h 4header-y += stats.h
6header-y += syscall.h
diff --git a/include/linux/nfsd/const.h b/include/linux/nfsd/const.h
deleted file mode 100644
index 323f8cfa060a..000000000000
--- a/include/linux/nfsd/const.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * include/linux/nfsd/const.h
3 *
4 * Various constants related to NFS.
5 *
6 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef _LINUX_NFSD_CONST_H
10#define _LINUX_NFSD_CONST_H
11
12#include <linux/nfs.h>
13#include <linux/nfs2.h>
14#include <linux/nfs3.h>
15#include <linux/nfs4.h>
16
17/*
18 * Maximum protocol version supported by knfsd
19 */
20#define NFSSVC_MAXVERS 3
21
22/*
23 * Maximum blocksizes supported by daemon under various circumstances.
24 */
25#define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD
26/* NFSv2 is limited by the protocol specification, see RFC 1094 */
27#define NFSSVC_MAXBLKSIZE_V2 (8*1024)
28
29#ifdef __KERNEL__
30
31#include <linux/sunrpc/msg_prot.h>
32
33/*
34 * Largest number of bytes we need to allocate for an NFS
35 * call or reply. Used to control buffer sizes. We use
36 * the length of v3 WRITE, READDIR and READDIR replies
37 * which are an RPC header, up to 26 XDR units of reply
38 * data, and some page data.
39 *
40 * Note that accuracy here doesn't matter too much as the
41 * size is rounded up to a page size when allocating space.
42 */
43#define NFSD_BUFSIZE ((RPC_MAX_HEADER_WITH_AUTH+26)*XDR_UNIT + NFSSVC_MAXBLKSIZE)
44
45#ifdef CONFIG_NFSD_V4
46# define NFSSVC_XDRSIZE NFS4_SVC_XDRSIZE
47#elif defined(CONFIG_NFSD_V3)
48# define NFSSVC_XDRSIZE NFS3_SVC_XDRSIZE
49#else
50# define NFSSVC_XDRSIZE NFS2_SVC_XDRSIZE
51#endif
52
53#endif /* __KERNEL__ */
54
55#endif /* _LINUX_NFSD_CONST_H */
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 8a31a20efe7e..f85308e688fd 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -96,7 +96,6 @@ struct svc_export {
96 struct auth_domain * ex_client; 96 struct auth_domain * ex_client;
97 int ex_flags; 97 int ex_flags;
98 struct path ex_path; 98 struct path ex_path;
99 char *ex_pathname;
100 uid_t ex_anon_uid; 99 uid_t ex_anon_uid;
101 gid_t ex_anon_gid; 100 gid_t ex_anon_gid;
102 int ex_fsid; 101 int ex_fsid;
@@ -137,6 +136,7 @@ struct svc_export * rqst_exp_get_by_name(struct svc_rqst *,
137 struct path *); 136 struct path *);
138struct svc_export * rqst_exp_parent(struct svc_rqst *, 137struct svc_export * rqst_exp_parent(struct svc_rqst *,
139 struct path *); 138 struct path *);
139struct svc_export * rqst_find_fsidzero_export(struct svc_rqst *);
140int exp_rootfh(struct auth_domain *, 140int exp_rootfh(struct auth_domain *,
141 char *path, struct knfsd_fh *, int maxsize); 141 char *path, struct knfsd_fh *, int maxsize);
142__be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *); 142__be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *);
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index f76d80ccec10..ce4743a26015 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -14,11 +14,14 @@
14#ifndef _LINUX_NFSD_FH_H 14#ifndef _LINUX_NFSD_FH_H
15#define _LINUX_NFSD_FH_H 15#define _LINUX_NFSD_FH_H
16 16
17# include <linux/types.h> 17#include <linux/types.h>
18#include <linux/nfs.h>
19#include <linux/nfs2.h>
20#include <linux/nfs3.h>
21#include <linux/nfs4.h>
18#ifdef __KERNEL__ 22#ifdef __KERNEL__
19# include <linux/sunrpc/svc.h> 23# include <linux/sunrpc/svc.h>
20#endif 24#endif
21#include <linux/nfsd/const.h>
22 25
23/* 26/*
24 * This is the old "dentry style" Linux NFSv2 file handle. 27 * This is the old "dentry style" Linux NFSv2 file handle.
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
deleted file mode 100644
index 812bc1e160dc..000000000000
--- a/include/linux/nfsd/syscall.h
+++ /dev/null
@@ -1,116 +0,0 @@
1/*
2 * include/linux/nfsd/syscall.h
3 *
4 * This file holds all declarations for the knfsd syscall interface.
5 *
6 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef NFSD_SYSCALL_H
10#define NFSD_SYSCALL_H
11
12#include <linux/types.h>
13#include <linux/nfsd/export.h>
14
15/*
16 * Version of the syscall interface
17 */
18#define NFSCTL_VERSION 0x0201
19
20/*
21 * These are the commands understood by nfsctl().
22 */
23#define NFSCTL_SVC 0 /* This is a server process. */
24#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
25#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
26#define NFSCTL_EXPORT 3 /* export a file system. */
27#define NFSCTL_UNEXPORT 4 /* unexport a file system. */
28/*#define NFSCTL_UGIDUPDATE 5 / * update a client's uid/gid map. DISCARDED */
29/*#define NFSCTL_GETFH 6 / * get an fh by ino DISCARDED */
30#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
31#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
32
33/* SVC */
34struct nfsctl_svc {
35 unsigned short svc_port;
36 int svc_nthreads;
37};
38
39/* ADDCLIENT/DELCLIENT */
40struct nfsctl_client {
41 char cl_ident[NFSCLNT_IDMAX+1];
42 int cl_naddr;
43 struct in_addr cl_addrlist[NFSCLNT_ADDRMAX];
44 int cl_fhkeytype;
45 int cl_fhkeylen;
46 unsigned char cl_fhkey[NFSCLNT_KEYMAX];
47};
48
49/* EXPORT/UNEXPORT */
50struct nfsctl_export {
51 char ex_client[NFSCLNT_IDMAX+1];
52 char ex_path[NFS_MAXPATHLEN+1];
53 __kernel_old_dev_t ex_dev;
54 __kernel_ino_t ex_ino;
55 int ex_flags;
56 __kernel_uid_t ex_anon_uid;
57 __kernel_gid_t ex_anon_gid;
58};
59
60/* GETFD */
61struct nfsctl_fdparm {
62 struct sockaddr gd_addr;
63 char gd_path[NFS_MAXPATHLEN+1];
64 int gd_version;
65};
66
67/* GETFS - GET Filehandle with Size */
68struct nfsctl_fsparm {
69 struct sockaddr gd_addr;
70 char gd_path[NFS_MAXPATHLEN+1];
71 int gd_maxlen;
72};
73
74/*
75 * This is the argument union.
76 */
77struct nfsctl_arg {
78 int ca_version; /* safeguard */
79 union {
80 struct nfsctl_svc u_svc;
81 struct nfsctl_client u_client;
82 struct nfsctl_export u_export;
83 struct nfsctl_fdparm u_getfd;
84 struct nfsctl_fsparm u_getfs;
85 /*
86 * The following dummy member is needed to preserve binary compatibility
87 * on platforms where alignof(void*)>alignof(int). It's needed because
88 * this union used to contain a member (u_umap) which contained a
89 * pointer.
90 */
91 void *u_ptr;
92 } u;
93#define ca_svc u.u_svc
94#define ca_client u.u_client
95#define ca_export u.u_export
96#define ca_getfd u.u_getfd
97#define ca_getfs u.u_getfs
98};
99
100union nfsctl_res {
101 __u8 cr_getfh[NFS_FHSIZE];
102 struct knfsd_fh cr_getfs;
103};
104
105#ifdef __KERNEL__
106/*
107 * Kernel syscall implementation.
108 */
109extern int exp_addclient(struct nfsctl_client *ncp);
110extern int exp_delclient(struct nfsctl_client *ncp);
111extern int exp_export(struct nfsctl_export *nxp);
112extern int exp_unexport(struct nfsctl_export *nxp);
113
114#endif /* __KERNEL__ */
115
116#endif /* NFSD_SYSCALL_H */
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 8ad70dcac3f9..8049bf77d799 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -161,6 +161,13 @@
161 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface 161 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface
162 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, 162 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD,
163 * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes. 163 * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes.
164 * Following attributes are provided for drivers that generate full Beacon
165 * and Probe Response frames internally: %NL80211_ATTR_SSID,
166 * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE,
167 * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS,
168 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
169 * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_IE, %NL80211_ATTR_IE_PROBE_RESP,
170 * %NL80211_ATTR_IE_ASSOC_RESP.
164 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, 171 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface,
165 * parameters are like for %NL80211_CMD_SET_BEACON. 172 * parameters are like for %NL80211_CMD_SET_BEACON.
166 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it 173 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
@@ -231,6 +238,8 @@
231 * 238 *
232 * @NL80211_CMD_GET_SCAN: get scan results 239 * @NL80211_CMD_GET_SCAN: get scan results
233 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters 240 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
241 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
242 * probe requests at CCK rate or not.
234 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to 243 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
235 * NL80211_CMD_GET_SCAN and on the "scan" multicast group) 244 * NL80211_CMD_GET_SCAN and on the "scan" multicast group)
236 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, 245 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
@@ -425,6 +434,8 @@
425 * specified using %NL80211_ATTR_DURATION. When called, this operation 434 * specified using %NL80211_ATTR_DURATION. When called, this operation
426 * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the 435 * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
427 * TX status event pertaining to the TX request. 436 * TX status event pertaining to the TX request.
437 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
438 * management frames at CCK rate or not in 2GHz band.
428 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this 439 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
429 * command may be used with the corresponding cookie to cancel the wait 440 * command may be used with the corresponding cookie to cancel the wait
430 * time if it is known that it is no longer necessary. 441 * time if it is known that it is no longer necessary.
@@ -492,6 +503,12 @@
492 * this command may also be sent by the driver as an MLME event to 503 * this command may also be sent by the driver as an MLME event to
493 * inform userspace of the new replay counter. 504 * inform userspace of the new replay counter.
494 * 505 *
506 * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
507 * of PMKSA caching dandidates.
508 *
509 * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
510 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame.
511 *
495 * @NL80211_CMD_MAX: highest used command number 512 * @NL80211_CMD_MAX: highest used command number
496 * @__NL80211_CMD_AFTER_LAST: internal use 513 * @__NL80211_CMD_AFTER_LAST: internal use
497 */ 514 */
@@ -616,6 +633,11 @@ enum nl80211_commands {
616 633
617 NL80211_CMD_SET_REKEY_OFFLOAD, 634 NL80211_CMD_SET_REKEY_OFFLOAD,
618 635
636 NL80211_CMD_PMKSA_CANDIDATE,
637
638 NL80211_CMD_TDLS_OPER,
639 NL80211_CMD_TDLS_MGMT,
640
619 /* add new commands above here */ 641 /* add new commands above here */
620 642
621 /* used to define NL80211_CMD_MAX below */ 643 /* used to define NL80211_CMD_MAX below */
@@ -762,6 +784,8 @@ enum nl80211_commands {
762 * that can be added to a scan request 784 * that can be added to a scan request
763 * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information 785 * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information
764 * elements that can be added to a scheduled scan request 786 * elements that can be added to a scheduled scan request
787 * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be
788 * used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute.
765 * 789 *
766 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) 790 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
767 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive 791 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
@@ -842,18 +866,20 @@ enum nl80211_commands {
842 * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT 866 * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT
843 * event (u16) 867 * event (u16)
844 * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating 868 * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating
845 * that protected APs should be used. 869 * that protected APs should be used. This is also used with NEW_BEACON to
870 * indicate that the BSS is to use protection.
846 * 871 *
847 * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT and ASSOCIATE to 872 * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON
848 * indicate which unicast key ciphers will be used with the connection 873 * to indicate which unicast key ciphers will be used with the connection
849 * (an array of u32). 874 * (an array of u32).
850 * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT and ASSOCIATE to indicate 875 * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
851 * which group key cipher will be used with the connection (a u32). 876 * indicate which group key cipher will be used with the connection (a
852 * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT and ASSOCIATE to indicate 877 * u32).
853 * which WPA version(s) the AP we want to associate with is using 878 * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
879 * indicate which WPA version(s) the AP we want to associate with is using
854 * (a u32 with flags from &enum nl80211_wpa_versions). 880 * (a u32 with flags from &enum nl80211_wpa_versions).
855 * @NL80211_ATTR_AKM_SUITES: Used with CONNECT and ASSOCIATE to indicate 881 * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
856 * which key management algorithm(s) to use (an array of u32). 882 * indicate which key management algorithm(s) to use (an array of u32).
857 * 883 *
858 * @NL80211_ATTR_REQ_IE: (Re)association request information elements as 884 * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
859 * sent out by the card, for ROAM and successful CONNECT events. 885 * sent out by the card, for ROAM and successful CONNECT events.
@@ -1002,6 +1028,24 @@ enum nl80211_commands {
1002 1028
1003 * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan 1029 * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan
1004 * cycles, in msecs. 1030 * cycles, in msecs.
1031
1032 * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more
1033 * sets of attributes to match during scheduled scans. Only BSSs
1034 * that match any of the sets will be reported. These are
1035 * pass-thru filter rules.
1036 * For a match to succeed, the BSS must match all attributes of a
1037 * set. Since not every hardware supports matching all types of
1038 * attributes, there is no guarantee that the reported BSSs are
1039 * fully complying with the match sets and userspace needs to be
1040 * able to ignore them by itself.
1041 * Thus, the implementation is somewhat hardware-dependent, but
1042 * this is only an optimization and the userspace application
1043 * needs to handle all the non-filtered results anyway.
1044 * If the match attributes don't make sense when combined with
1045 * the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID
1046 * is included in the probe request, but the match attributes
1047 * will never let it go through), -EINVAL may be returned.
1048 * If ommited, no filtering is done.
1005 * 1049 *
1006 * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported 1050 * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
1007 * interface combinations. In each nested item, it contains attributes 1051 * interface combinations. In each nested item, it contains attributes
@@ -1019,6 +1063,52 @@ enum nl80211_commands {
1019 * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but 1063 * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but
1020 * without the length restriction (at most %NL80211_MAX_SUPP_RATES). 1064 * without the length restriction (at most %NL80211_MAX_SUPP_RATES).
1021 * 1065 *
1066 * @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon
1067 * and Probe Response (when response to wildcard Probe Request); see
1068 * &enum nl80211_hidden_ssid, represented as a u32
1069 *
1070 * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame.
1071 * This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to
1072 * provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the
1073 * driver (or firmware) replies to Probe Request frames.
1074 * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association
1075 * Response frames. This is used with %NL80211_CMD_NEW_BEACON and
1076 * %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into
1077 * (Re)Association Response frames when the driver (or firmware) replies to
1078 * (Re)Association Request frames.
1079 *
1080 * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration
1081 * of the station, see &enum nl80211_sta_wme_attr.
1082 * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working
1083 * as AP.
1084 *
1085 * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of
1086 * roaming to another AP in the same ESS if the signal lever is low.
1087 *
1088 * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching
1089 * candidate information, see &enum nl80211_pmksa_candidate_attr.
1090 *
1091 * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not
1092 * for management frames transmission. In order to avoid p2p probe/action
1093 * frames are being transmitted at CCK rate in 2GHz band, the user space
1094 * applications use this attribute.
1095 * This attribute is used with %NL80211_CMD_TRIGGER_SCAN and
1096 * %NL80211_CMD_FRAME commands.
1097 *
1098 * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup
1099 * request, link setup confirm, link teardown, etc.). Values are
1100 * described in the TDLS (802.11z) specification.
1101 * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a
1102 * TDLS conversation between two devices.
1103 * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see
1104 * &enum nl80211_tdls_operation, represented as a u8.
1105 * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate
1106 * as a TDLS peer sta.
1107 * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown
1108 * procedures should be performed by sending TDLS packets via
1109 * %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be
1110 * used for asking the driver to perform a TDLS operation.
1111 *
1022 * @NL80211_ATTR_MAX: highest attribute number currently defined 1112 * @NL80211_ATTR_MAX: highest attribute number currently defined
1023 * @__NL80211_ATTR_AFTER_LAST: internal use 1113 * @__NL80211_ATTR_AFTER_LAST: internal use
1024 */ 1114 */
@@ -1224,6 +1314,29 @@ enum nl80211_attrs {
1224 1314
1225 NL80211_ATTR_SCAN_SUPP_RATES, 1315 NL80211_ATTR_SCAN_SUPP_RATES,
1226 1316
1317 NL80211_ATTR_HIDDEN_SSID,
1318
1319 NL80211_ATTR_IE_PROBE_RESP,
1320 NL80211_ATTR_IE_ASSOC_RESP,
1321
1322 NL80211_ATTR_STA_WME,
1323 NL80211_ATTR_SUPPORT_AP_UAPSD,
1324
1325 NL80211_ATTR_ROAM_SUPPORT,
1326
1327 NL80211_ATTR_SCHED_SCAN_MATCH,
1328 NL80211_ATTR_MAX_MATCH_SETS,
1329
1330 NL80211_ATTR_PMKSA_CANDIDATE,
1331
1332 NL80211_ATTR_TX_NO_CCK_RATE,
1333
1334 NL80211_ATTR_TDLS_ACTION,
1335 NL80211_ATTR_TDLS_DIALOG_TOKEN,
1336 NL80211_ATTR_TDLS_OPERATION,
1337 NL80211_ATTR_TDLS_SUPPORT,
1338 NL80211_ATTR_TDLS_EXTERNAL_SETUP,
1339
1227 /* add attributes here, update the policy in nl80211.c */ 1340 /* add attributes here, update the policy in nl80211.c */
1228 1341
1229 __NL80211_ATTR_AFTER_LAST, 1342 __NL80211_ATTR_AFTER_LAST,
@@ -1321,6 +1434,7 @@ enum nl80211_iftype {
1321 * @NL80211_STA_FLAG_WME: station is WME/QoS capable 1434 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
1322 * @NL80211_STA_FLAG_MFP: station uses management frame protection 1435 * @NL80211_STA_FLAG_MFP: station uses management frame protection
1323 * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated 1436 * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated
1437 * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer
1324 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined 1438 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
1325 * @__NL80211_STA_FLAG_AFTER_LAST: internal use 1439 * @__NL80211_STA_FLAG_AFTER_LAST: internal use
1326 */ 1440 */
@@ -1331,6 +1445,7 @@ enum nl80211_sta_flags {
1331 NL80211_STA_FLAG_WME, 1445 NL80211_STA_FLAG_WME,
1332 NL80211_STA_FLAG_MFP, 1446 NL80211_STA_FLAG_MFP,
1333 NL80211_STA_FLAG_AUTHENTICATED, 1447 NL80211_STA_FLAG_AUTHENTICATED,
1448 NL80211_STA_FLAG_TDLS_PEER,
1334 1449
1335 /* keep last */ 1450 /* keep last */
1336 __NL80211_STA_FLAG_AFTER_LAST, 1451 __NL80211_STA_FLAG_AFTER_LAST,
@@ -1433,6 +1548,7 @@ enum nl80211_sta_bss_param {
1433 * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute 1548 * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute
1434 * containing info as possible, see &enum nl80211_sta_bss_param 1549 * containing info as possible, see &enum nl80211_sta_bss_param
1435 * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected 1550 * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
1551 * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
1436 * @__NL80211_STA_INFO_AFTER_LAST: internal 1552 * @__NL80211_STA_INFO_AFTER_LAST: internal
1437 * @NL80211_STA_INFO_MAX: highest possible station info attribute 1553 * @NL80211_STA_INFO_MAX: highest possible station info attribute
1438 */ 1554 */
@@ -1454,6 +1570,7 @@ enum nl80211_sta_info {
1454 NL80211_STA_INFO_RX_BITRATE, 1570 NL80211_STA_INFO_RX_BITRATE,
1455 NL80211_STA_INFO_BSS_PARAM, 1571 NL80211_STA_INFO_BSS_PARAM,
1456 NL80211_STA_INFO_CONNECTED_TIME, 1572 NL80211_STA_INFO_CONNECTED_TIME,
1573 NL80211_STA_INFO_STA_FLAGS,
1457 1574
1458 /* keep last */ 1575 /* keep last */
1459 __NL80211_STA_INFO_AFTER_LAST, 1576 __NL80211_STA_INFO_AFTER_LAST,
@@ -1683,6 +1800,26 @@ enum nl80211_reg_rule_attr {
1683}; 1800};
1684 1801
1685/** 1802/**
1803 * enum nl80211_sched_scan_match_attr - scheduled scan match attributes
1804 * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
1805 * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
1806 * only report BSS with matching SSID.
1807 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
1808 * attribute number currently defined
1809 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
1810 */
1811enum nl80211_sched_scan_match_attr {
1812 __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID,
1813
1814 NL80211_ATTR_SCHED_SCAN_MATCH_SSID,
1815
1816 /* keep last */
1817 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
1818 NL80211_SCHED_SCAN_MATCH_ATTR_MAX =
1819 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1
1820};
1821
1822/**
1686 * enum nl80211_reg_rule_flags - regulatory rule flags 1823 * enum nl80211_reg_rule_flags - regulatory rule flags
1687 * 1824 *
1688 * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed 1825 * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed
@@ -1833,6 +1970,13 @@ enum nl80211_mntr_flags {
1833 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a 1970 * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
1834 * source mesh point for path selection elements. 1971 * source mesh point for path selection elements.
1835 * 1972 *
1973 * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between
1974 * root announcements are transmitted.
1975 *
1976 * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has
1977 * access to a broader network beyond the MBSS. This is done via Root
1978 * Announcement frames.
1979 *
1836 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute 1980 * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
1837 * 1981 *
1838 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 1982 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
@@ -1854,6 +1998,8 @@ enum nl80211_meshconf_params {
1854 NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, 1998 NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
1855 NL80211_MESHCONF_HWMP_ROOTMODE, 1999 NL80211_MESHCONF_HWMP_ROOTMODE,
1856 NL80211_MESHCONF_ELEMENT_TTL, 2000 NL80211_MESHCONF_ELEMENT_TTL,
2001 NL80211_MESHCONF_HWMP_RANN_INTERVAL,
2002 NL80211_MESHCONF_GATE_ANNOUNCEMENTS,
1857 2003
1858 /* keep last */ 2004 /* keep last */
1859 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2005 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -2430,4 +2576,78 @@ enum nl80211_rekey_data {
2430 MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1 2576 MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
2431}; 2577};
2432 2578
2579/**
2580 * enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID
2581 * @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in
2582 * Beacon frames)
2583 * @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element
2584 * in Beacon frames
2585 * @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID
2586 * element in Beacon frames but zero out each byte in the SSID
2587 */
2588enum nl80211_hidden_ssid {
2589 NL80211_HIDDEN_SSID_NOT_IN_USE,
2590 NL80211_HIDDEN_SSID_ZERO_LEN,
2591 NL80211_HIDDEN_SSID_ZERO_CONTENTS
2592};
2593
2594/**
2595 * enum nl80211_sta_wme_attr - station WME attributes
2596 * @__NL80211_STA_WME_INVALID: invalid number for nested attribute
2597 * @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format
2598 * is the same as the AC bitmap in the QoS info field.
2599 * @NL80211_STA_WME_MAX_SP: max service period. the format is the same
2600 * as the MAX_SP field in the QoS info field (but already shifted down).
2601 * @__NL80211_STA_WME_AFTER_LAST: internal
2602 * @NL80211_STA_WME_MAX: highest station WME attribute
2603 */
2604enum nl80211_sta_wme_attr {
2605 __NL80211_STA_WME_INVALID,
2606 NL80211_STA_WME_UAPSD_QUEUES,
2607 NL80211_STA_WME_MAX_SP,
2608
2609 /* keep last */
2610 __NL80211_STA_WME_AFTER_LAST,
2611 NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1
2612};
2613
2614/**
2615 * enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates
2616 * @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes
2617 * @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher
2618 * priority)
2619 * @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets)
2620 * @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag)
2621 * @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes
2622 * (internal)
2623 * @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute
2624 * (internal)
2625 */
2626enum nl80211_pmksa_candidate_attr {
2627 __NL80211_PMKSA_CANDIDATE_INVALID,
2628 NL80211_PMKSA_CANDIDATE_INDEX,
2629 NL80211_PMKSA_CANDIDATE_BSSID,
2630 NL80211_PMKSA_CANDIDATE_PREAUTH,
2631
2632 /* keep last */
2633 NUM_NL80211_PMKSA_CANDIDATE,
2634 MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1
2635};
2636
2637/**
2638 * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION
2639 * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request
2640 * @NL80211_TDLS_SETUP: Setup TDLS link
2641 * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established
2642 * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link
2643 * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link
2644 */
2645enum nl80211_tdls_operation {
2646 NL80211_TDLS_DISCOVERY_REQ,
2647 NL80211_TDLS_SETUP,
2648 NL80211_TDLS_TEARDOWN,
2649 NL80211_TDLS_ENABLE_LINK,
2650 NL80211_TDLS_DISABLE_LINK,
2651};
2652
2433#endif /* __LINUX_NL80211_H */ 2653#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index 0085bb01c041..4948552d60f5 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -17,11 +17,13 @@
17 */ 17 */
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/bitops.h> 19#include <linux/bitops.h>
20#include <linux/errno.h>
20#include <linux/kref.h> 21#include <linux/kref.h>
21#include <linux/mod_devicetable.h> 22#include <linux/mod_devicetable.h>
22#include <linux/spinlock.h> 23#include <linux/spinlock.h>
23 24
24#include <asm/byteorder.h> 25#include <asm/byteorder.h>
26#include <asm/errno.h>
25 27
26typedef u32 phandle; 28typedef u32 phandle;
27typedef u32 ihandle; 29typedef u32 ihandle;
@@ -68,6 +70,7 @@ struct device_node {
68/* Pointer for first entry in chain of all nodes. */ 70/* Pointer for first entry in chain of all nodes. */
69extern struct device_node *allnodes; 71extern struct device_node *allnodes;
70extern struct device_node *of_chosen; 72extern struct device_node *of_chosen;
73extern struct device_node *of_aliases;
71extern rwlock_t devtree_lock; 74extern rwlock_t devtree_lock;
72 75
73static inline bool of_have_populated_dt(void) 76static inline bool of_have_populated_dt(void)
@@ -199,16 +202,26 @@ extern int of_property_read_u32_array(const struct device_node *np,
199 const char *propname, 202 const char *propname,
200 u32 *out_values, 203 u32 *out_values,
201 size_t sz); 204 size_t sz);
205extern int of_property_read_u64(const struct device_node *np,
206 const char *propname, u64 *out_value);
202 207
203extern int of_property_read_string(struct device_node *np, 208extern int of_property_read_string(struct device_node *np,
204 const char *propname, 209 const char *propname,
205 const char **out_string); 210 const char **out_string);
211extern int of_property_read_string_index(struct device_node *np,
212 const char *propname,
213 int index, const char **output);
214extern int of_property_count_strings(struct device_node *np,
215 const char *propname);
206extern int of_device_is_compatible(const struct device_node *device, 216extern int of_device_is_compatible(const struct device_node *device,
207 const char *); 217 const char *);
208extern int of_device_is_available(const struct device_node *device); 218extern int of_device_is_available(const struct device_node *device);
209extern const void *of_get_property(const struct device_node *node, 219extern const void *of_get_property(const struct device_node *node,
210 const char *name, 220 const char *name,
211 int *lenp); 221 int *lenp);
222#define for_each_property(pp, properties) \
223 for (pp = properties; pp != NULL; pp = pp->next)
224
212extern int of_n_addr_cells(struct device_node *np); 225extern int of_n_addr_cells(struct device_node *np);
213extern int of_n_size_cells(struct device_node *np); 226extern int of_n_size_cells(struct device_node *np);
214extern const struct of_device_id *of_match_node( 227extern const struct of_device_id *of_match_node(
@@ -221,6 +234,9 @@ extern int of_parse_phandles_with_args(struct device_node *np,
221 const char *list_name, const char *cells_name, int index, 234 const char *list_name, const char *cells_name, int index,
222 struct device_node **out_node, const void **out_args); 235 struct device_node **out_node, const void **out_args);
223 236
237extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
238extern int of_alias_get_id(struct device_node *np, const char *stem);
239
224extern int of_machine_is_compatible(const char *compat); 240extern int of_machine_is_compatible(const char *compat);
225 241
226extern int prom_add_property(struct device_node* np, struct property* prop); 242extern int prom_add_property(struct device_node* np, struct property* prop);
@@ -235,6 +251,7 @@ extern void of_attach_node(struct device_node *);
235extern void of_detach_node(struct device_node *); 251extern void of_detach_node(struct device_node *);
236#endif 252#endif
237 253
254#define of_match_ptr(_ptr) (_ptr)
238#else /* CONFIG_OF */ 255#else /* CONFIG_OF */
239 256
240static inline bool of_have_populated_dt(void) 257static inline bool of_have_populated_dt(void)
@@ -242,6 +259,22 @@ static inline bool of_have_populated_dt(void)
242 return false; 259 return false;
243} 260}
244 261
262#define for_each_child_of_node(parent, child) \
263 while (0)
264
265static inline int of_device_is_compatible(const struct device_node *device,
266 const char *name)
267{
268 return 0;
269}
270
271static inline struct property *of_find_property(const struct device_node *np,
272 const char *name,
273 int *lenp)
274{
275 return NULL;
276}
277
245static inline int of_property_read_u32_array(const struct device_node *np, 278static inline int of_property_read_u32_array(const struct device_node *np,
246 const char *propname, 279 const char *propname,
247 u32 *out_values, size_t sz) 280 u32 *out_values, size_t sz)
@@ -256,6 +289,51 @@ static inline int of_property_read_string(struct device_node *np,
256 return -ENOSYS; 289 return -ENOSYS;
257} 290}
258 291
292static inline int of_property_read_string_index(struct device_node *np,
293 const char *propname, int index,
294 const char **out_string)
295{
296 return -ENOSYS;
297}
298
299static inline int of_property_count_strings(struct device_node *np,
300 const char *propname)
301{
302 return -ENOSYS;
303}
304
305static inline const void *of_get_property(const struct device_node *node,
306 const char *name,
307 int *lenp)
308{
309 return NULL;
310}
311
312static inline int of_property_read_u64(const struct device_node *np,
313 const char *propname, u64 *out_value)
314{
315 return -ENOSYS;
316}
317
318static inline struct device_node *of_parse_phandle(struct device_node *np,
319 const char *phandle_name,
320 int index)
321{
322 return NULL;
323}
324
325static inline int of_alias_get_id(struct device_node *np, const char *stem)
326{
327 return -ENOSYS;
328}
329
330static inline int of_machine_is_compatible(const char *compat)
331{
332 return 0;
333}
334
335#define of_match_ptr(_ptr) NULL
336#define of_match_node(_matches, _node) NULL
259#endif /* CONFIG_OF */ 337#endif /* CONFIG_OF */
260 338
261static inline int of_property_read_u32(const struct device_node *np, 339static inline int of_property_read_u32(const struct device_node *np,
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index cd2e61ce4e83..d0307eed20c9 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -33,6 +33,8 @@ struct of_irq {
33 u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ 33 u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */
34}; 34};
35 35
36typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *);
37
36/* 38/*
37 * Workarounds only applied to 32bit powermac machines 39 * Workarounds only applied to 32bit powermac machines
38 */ 40 */
@@ -73,6 +75,7 @@ extern int of_irq_to_resource_table(struct device_node *dev,
73 struct resource *res, int nr_irqs); 75 struct resource *res, int nr_irqs);
74extern struct device_node *of_irq_find_parent(struct device_node *child); 76extern struct device_node *of_irq_find_parent(struct device_node *child);
75 77
78extern void of_irq_init(const struct of_device_id *matches);
76 79
77#endif /* CONFIG_OF_IRQ */ 80#endif /* CONFIG_OF_IRQ */
78#endif /* CONFIG_OF */ 81#endif /* CONFIG_OF */
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 5a6f458a4bb7..040ce2f6e8de 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14#ifdef CONFIG_OF_DEVICE 14#ifdef CONFIG_OF_DEVICE
15#include <linux/module.h>
16#include <linux/device.h> 15#include <linux/device.h>
17#include <linux/mod_devicetable.h> 16#include <linux/mod_devicetable.h>
18#include <linux/pm.h> 17#include <linux/pm.h>
diff --git a/include/linux/omap3isp.h b/include/linux/omap3isp.h
index b6111f8cd49a..c73a34c3434d 100644
--- a/include/linux/omap3isp.h
+++ b/include/linux/omap3isp.h
@@ -62,14 +62,12 @@
62 * V4L2_EVENT_OMAP3ISP_AEWB: AEWB statistics data ready 62 * V4L2_EVENT_OMAP3ISP_AEWB: AEWB statistics data ready
63 * V4L2_EVENT_OMAP3ISP_AF: AF statistics data ready 63 * V4L2_EVENT_OMAP3ISP_AF: AF statistics data ready
64 * V4L2_EVENT_OMAP3ISP_HIST: Histogram statistics data ready 64 * V4L2_EVENT_OMAP3ISP_HIST: Histogram statistics data ready
65 * V4L2_EVENT_OMAP3ISP_HS_VS: Horizontal/vertical synchronization detected
66 */ 65 */
67 66
68#define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100) 67#define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100)
69#define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1) 68#define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1)
70#define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2) 69#define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2)
71#define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3) 70#define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3)
72#define V4L2_EVENT_OMAP3ISP_HS_VS (V4L2_EVENT_OMAP3ISP_CLASS | 0x4)
73 71
74struct omap3isp_stat_event_status { 72struct omap3isp_stat_event_status {
75 __u32 frame_number; 73 __u32 frame_number;
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 13b7b02e599a..6f9d04a85336 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -40,6 +40,7 @@ enum oom_constraint {
40 CONSTRAINT_MEMCG, 40 CONSTRAINT_MEMCG,
41}; 41};
42 42
43extern void compare_swap_oom_score_adj(int old_val, int new_val);
43extern int test_set_oom_score_adj(int new_val); 44extern int test_set_oom_score_adj(int new_val);
44 45
45extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, 46extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem,
diff --git a/include/linux/opp.h b/include/linux/opp.h
index 7020e9736fc5..ee94b33080c2 100644
--- a/include/linux/opp.h
+++ b/include/linux/opp.h
@@ -16,9 +16,14 @@
16 16
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/notifier.h>
19 20
20struct opp; 21struct opp;
21 22
23enum opp_event {
24 OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE,
25};
26
22#if defined(CONFIG_PM_OPP) 27#if defined(CONFIG_PM_OPP)
23 28
24unsigned long opp_get_voltage(struct opp *opp); 29unsigned long opp_get_voltage(struct opp *opp);
@@ -40,6 +45,8 @@ int opp_enable(struct device *dev, unsigned long freq);
40 45
41int opp_disable(struct device *dev, unsigned long freq); 46int opp_disable(struct device *dev, unsigned long freq);
42 47
48struct srcu_notifier_head *opp_get_notifier(struct device *dev);
49
43#else 50#else
44static inline unsigned long opp_get_voltage(struct opp *opp) 51static inline unsigned long opp_get_voltage(struct opp *opp)
45{ 52{
@@ -89,7 +96,12 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
89{ 96{
90 return 0; 97 return 0;
91} 98}
92#endif /* CONFIG_PM */ 99
100static inline struct srcu_notifier_head *opp_get_notifier(struct device *dev)
101{
102 return ERR_PTR(-EINVAL);
103}
104#endif /* CONFIG_PM_OPP */
93 105
94#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) 106#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
95int opp_init_cpufreq_table(struct device *dev, 107int opp_init_cpufreq_table(struct device *dev,
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 49c8727eeb57..a4c562453f6b 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -166,7 +166,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t co
166int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count); 166int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count);
167 167
168/** lock for read/write safety */ 168/** lock for read/write safety */
169extern spinlock_t oprofilefs_lock; 169extern raw_spinlock_t oprofilefs_lock;
170 170
171/** 171/**
172 * Add the contents of a circular buffer to the event buffer. 172 * Add the contents of a circular buffer to the event buffer.
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
index 655824fa4c76..e3d0b3890249 100644
--- a/include/linux/pci-ats.h
+++ b/include/linux/pci-ats.h
@@ -1,6 +1,8 @@
1#ifndef LINUX_PCI_ATS_H 1#ifndef LINUX_PCI_ATS_H
2#define LINUX_PCI_ATS_H 2#define LINUX_PCI_ATS_H
3 3
4#include <linux/pci.h>
5
4/* Address Translation Service */ 6/* Address Translation Service */
5struct pci_ats { 7struct pci_ats {
6 int pos; /* capability position */ 8 int pos; /* capability position */
@@ -15,6 +17,7 @@ struct pci_ats {
15extern int pci_enable_ats(struct pci_dev *dev, int ps); 17extern int pci_enable_ats(struct pci_dev *dev, int ps);
16extern void pci_disable_ats(struct pci_dev *dev); 18extern void pci_disable_ats(struct pci_dev *dev);
17extern int pci_ats_queue_depth(struct pci_dev *dev); 19extern int pci_ats_queue_depth(struct pci_dev *dev);
20
18/** 21/**
19 * pci_ats_enabled - query the ATS status 22 * pci_ats_enabled - query the ATS status
20 * @dev: the PCI device 23 * @dev: the PCI device
@@ -49,4 +52,76 @@ static inline int pci_ats_enabled(struct pci_dev *dev)
49 52
50#endif /* CONFIG_PCI_IOV */ 53#endif /* CONFIG_PCI_IOV */
51 54
55#ifdef CONFIG_PCI_PRI
56
57extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
58extern void pci_disable_pri(struct pci_dev *pdev);
59extern bool pci_pri_enabled(struct pci_dev *pdev);
60extern int pci_reset_pri(struct pci_dev *pdev);
61extern bool pci_pri_stopped(struct pci_dev *pdev);
62extern int pci_pri_status(struct pci_dev *pdev);
63
64#else /* CONFIG_PCI_PRI */
65
66static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
67{
68 return -ENODEV;
69}
70
71static inline void pci_disable_pri(struct pci_dev *pdev)
72{
73}
74
75static inline bool pci_pri_enabled(struct pci_dev *pdev)
76{
77 return false;
78}
79
80static inline int pci_reset_pri(struct pci_dev *pdev)
81{
82 return -ENODEV;
83}
84
85static inline bool pci_pri_stopped(struct pci_dev *pdev)
86{
87 return true;
88}
89
90static inline int pci_pri_status(struct pci_dev *pdev)
91{
92 return -ENODEV;
93}
94#endif /* CONFIG_PCI_PRI */
95
96#ifdef CONFIG_PCI_PASID
97
98extern int pci_enable_pasid(struct pci_dev *pdev, int features);
99extern void pci_disable_pasid(struct pci_dev *pdev);
100extern int pci_pasid_features(struct pci_dev *pdev);
101extern int pci_max_pasids(struct pci_dev *pdev);
102
103#else /* CONFIG_PCI_PASID */
104
105static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
106{
107 return -EINVAL;
108}
109
110static inline void pci_disable_pasid(struct pci_dev *pdev)
111{
112}
113
114static inline int pci_pasid_features(struct pci_dev *pdev)
115{
116 return -EINVAL;
117}
118
119static inline int pci_max_pasids(struct pci_dev *pdev)
120{
121 return -EINVAL;
122}
123
124#endif /* CONFIG_PCI_PASID */
125
126
52#endif /* LINUX_PCI_ATS_H*/ 127#endif /* LINUX_PCI_ATS_H*/
diff --git a/include/linux/pci.h b/include/linux/pci.h
index f27893b3b724..337df0d5d5f7 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -174,6 +174,8 @@ enum pci_dev_flags {
174 PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1, 174 PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1,
175 /* Device configuration is irrevocably lost if disabled into D3 */ 175 /* Device configuration is irrevocably lost if disabled into D3 */
176 PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, 176 PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2,
177 /* Provide indication device is assigned by a Virtual Machine Manager */
178 PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4,
177}; 179};
178 180
179enum pci_irq_reroute_variant { 181enum pci_irq_reroute_variant {
@@ -251,7 +253,8 @@ struct pci_dev {
251 u8 revision; /* PCI revision, low byte of class word */ 253 u8 revision; /* PCI revision, low byte of class word */
252 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 254 u8 hdr_type; /* PCI header type (`multi' flag masked out) */
253 u8 pcie_cap; /* PCI-E capability offset */ 255 u8 pcie_cap; /* PCI-E capability offset */
254 u8 pcie_type; /* PCI-E device/port type */ 256 u8 pcie_type:4; /* PCI-E device/port type */
257 u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */
255 u8 rom_base_reg; /* which config register controls the ROM */ 258 u8 rom_base_reg; /* which config register controls the ROM */
256 u8 pin; /* which interrupt pin this device uses */ 259 u8 pin; /* which interrupt pin this device uses */
257 260
@@ -272,6 +275,7 @@ struct pci_dev {
272 unsigned int pme_support:5; /* Bitmask of states from which PME# 275 unsigned int pme_support:5; /* Bitmask of states from which PME#
273 can be generated */ 276 can be generated */
274 unsigned int pme_interrupt:1; 277 unsigned int pme_interrupt:1;
278 unsigned int pme_poll:1; /* Poll device's PME status bit */
275 unsigned int d1_support:1; /* Low power state D1 is supported */ 279 unsigned int d1_support:1; /* Low power state D1 is supported */
276 unsigned int d2_support:1; /* Low power state D2 is supported */ 280 unsigned int d2_support:1; /* Low power state D2 is supported */
277 unsigned int no_d1d2:1; /* Only allow D0 and D3 */ 281 unsigned int no_d1d2:1; /* Only allow D0 and D3 */
@@ -617,6 +621,17 @@ struct pci_driver {
617/* these external functions are only available when PCI support is enabled */ 621/* these external functions are only available when PCI support is enabled */
618#ifdef CONFIG_PCI 622#ifdef CONFIG_PCI
619 623
624extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss);
625
626enum pcie_bus_config_types {
627 PCIE_BUS_TUNE_OFF,
628 PCIE_BUS_SAFE,
629 PCIE_BUS_PERFORMANCE,
630 PCIE_BUS_PEER2PEER,
631};
632
633extern enum pcie_bus_config_types pcie_bus_config;
634
620extern struct bus_type pci_bus_type; 635extern struct bus_type pci_bus_type;
621 636
622/* Do NOT directly access these two variables, unless you are arch specific pci 637/* Do NOT directly access these two variables, unless you are arch specific pci
@@ -796,10 +811,13 @@ int pcix_get_mmrbc(struct pci_dev *dev);
796int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 811int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
797int pcie_get_readrq(struct pci_dev *dev); 812int pcie_get_readrq(struct pci_dev *dev);
798int pcie_set_readrq(struct pci_dev *dev, int rq); 813int pcie_set_readrq(struct pci_dev *dev, int rq);
814int pcie_get_mps(struct pci_dev *dev);
815int pcie_set_mps(struct pci_dev *dev, int mps);
799int __pci_reset_function(struct pci_dev *dev); 816int __pci_reset_function(struct pci_dev *dev);
800int pci_reset_function(struct pci_dev *dev); 817int pci_reset_function(struct pci_dev *dev);
801void pci_update_resource(struct pci_dev *dev, int resno); 818void pci_update_resource(struct pci_dev *dev, int resno);
802int __must_check pci_assign_resource(struct pci_dev *dev, int i); 819int __must_check pci_assign_resource(struct pci_dev *dev, int i);
820int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align);
803int pci_select_bars(struct pci_dev *dev, unsigned long flags); 821int pci_select_bars(struct pci_dev *dev, unsigned long flags);
804 822
805/* ROM control related routines */ 823/* ROM control related routines */
@@ -940,6 +958,7 @@ void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *),
940int pci_cfg_space_size_ext(struct pci_dev *dev); 958int pci_cfg_space_size_ext(struct pci_dev *dev);
941int pci_cfg_space_size(struct pci_dev *dev); 959int pci_cfg_space_size(struct pci_dev *dev);
942unsigned char pci_bus_max_busnr(struct pci_bus *bus); 960unsigned char pci_bus_max_busnr(struct pci_bus *bus);
961void pci_setup_bridge(struct pci_bus *bus);
943 962
944#define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0) 963#define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0)
945#define PCI_VGA_STATE_CHANGE_DECODES (1 << 1) 964#define PCI_VGA_STATE_CHANGE_DECODES (1 << 1)
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 5d09cbafa7db..45fc162cbdc0 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -132,13 +132,9 @@ extern int pci_hp_deregister(struct hotplug_slot *slot);
132extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 132extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot,
133 struct hotplug_slot_info *info); 133 struct hotplug_slot_info *info);
134 134
135static inline int pci_hp_register(struct hotplug_slot *slot, 135/* use a define to avoid include chaining to get THIS_MODULE & friends */
136 struct pci_bus *pbus, 136#define pci_hp_register(slot, pbus, devnr, name) \
137 int devnr, const char *name) 137 __pci_hp_register(slot, pbus, devnr, name, THIS_MODULE, KBUILD_MODNAME)
138{
139 return __pci_hp_register(slot, pbus, devnr, name,
140 THIS_MODULE, KBUILD_MODNAME);
141}
142 138
143/* PCI Setting Record (Type 0) */ 139/* PCI Setting Record (Type 0) */
144struct hpp_type0 { 140struct hpp_type0 {
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index ae96bbe54518..3fdf251389de 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2302,6 +2302,11 @@
2302#define PCI_DEVICE_ID_RENESAS_SH7785 0x0007 2302#define PCI_DEVICE_ID_RENESAS_SH7785 0x0007
2303#define PCI_DEVICE_ID_RENESAS_SH7786 0x0010 2303#define PCI_DEVICE_ID_RENESAS_SH7786 0x0010
2304 2304
2305#define PCI_VENDOR_ID_SOLARFLARE 0x1924
2306#define PCI_DEVICE_ID_SOLARFLARE_SFC4000A_0 0x0703
2307#define PCI_DEVICE_ID_SOLARFLARE_SFC4000A_1 0x6703
2308#define PCI_DEVICE_ID_SOLARFLARE_SFC4000B 0x0710
2309
2305#define PCI_VENDOR_ID_TDI 0x192E 2310#define PCI_VENDOR_ID_TDI 0x192E
2306#define PCI_DEVICE_ID_TDI_EHCI 0x0101 2311#define PCI_DEVICE_ID_TDI_EHCI 0x0101
2307 2312
@@ -2868,3 +2873,5 @@
2868 2873
2869#define PCI_VENDOR_ID_XEN 0x5853 2874#define PCI_VENDOR_ID_XEN 0x5853
2870#define PCI_DEVICE_ID_XEN_PLATFORM 0x0001 2875#define PCI_DEVICE_ID_XEN_PLATFORM 0x0001
2876
2877#define PCI_VENDOR_ID_OCZ 0x1b85
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index e8840964aca1..b5d9657f3100 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -663,6 +663,26 @@
663#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ 663#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */
664#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ 664#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
665 665
666/* Page Request Interface */
667#define PCI_PRI_CAP 0x13 /* PRI capability ID */
668#define PCI_PRI_CONTROL_OFF 0x04 /* Offset of control register */
669#define PCI_PRI_STATUS_OFF 0x06 /* Offset of status register */
670#define PCI_PRI_ENABLE 0x0001 /* Enable mask */
671#define PCI_PRI_RESET 0x0002 /* Reset bit mask */
672#define PCI_PRI_STATUS_RF 0x0001 /* Request Failure */
673#define PCI_PRI_STATUS_UPRGI 0x0002 /* Unexpected PRG index */
674#define PCI_PRI_STATUS_STOPPED 0x0100 /* PRI Stopped */
675#define PCI_PRI_MAX_REQ_OFF 0x08 /* Cap offset for max reqs supported */
676#define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */
677
678/* PASID capability */
679#define PCI_PASID_CAP 0x1b /* PASID capability ID */
680#define PCI_PASID_CAP_OFF 0x04 /* PASID feature register */
681#define PCI_PASID_CONTROL_OFF 0x06 /* PASID control register */
682#define PCI_PASID_ENABLE 0x01 /* Enable/Supported bit */
683#define PCI_PASID_EXEC 0x02 /* Exec permissions Enable/Supported */
684#define PCI_PASID_PRIV 0x04 /* Priviledge Mode Enable/Support */
685
666/* Single Root I/O Virtualization */ 686/* Single Root I/O Virtualization */
667#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ 687#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
668#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ 688#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 5edc9014263a..b9df9ed1adc0 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -16,7 +16,7 @@
16#ifdef CONFIG_SMP 16#ifdef CONFIG_SMP
17 17
18struct percpu_counter { 18struct percpu_counter {
19 spinlock_t lock; 19 raw_spinlock_t lock;
20 s64 count; 20 s64 count;
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 */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 245bafdafd5e..1e9ebe5e0091 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -220,7 +220,10 @@ struct perf_event_attr {
220 mmap_data : 1, /* non-exec mmap data */ 220 mmap_data : 1, /* non-exec mmap data */
221 sample_id_all : 1, /* sample_type all events */ 221 sample_id_all : 1, /* sample_type all events */
222 222
223 __reserved_1 : 45; 223 exclude_host : 1, /* don't count in host */
224 exclude_guest : 1, /* don't count in guest */
225
226 __reserved_1 : 43;
224 227
225 union { 228 union {
226 __u32 wakeup_events; /* wakeup every n events */ 229 __u32 wakeup_events; /* wakeup every n events */
@@ -944,8 +947,10 @@ extern void perf_pmu_unregister(struct pmu *pmu);
944 947
945extern int perf_num_counters(void); 948extern int perf_num_counters(void);
946extern const char *perf_pmu_name(void); 949extern const char *perf_pmu_name(void);
947extern void __perf_event_task_sched_in(struct task_struct *task); 950extern void __perf_event_task_sched_in(struct task_struct *prev,
948extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); 951 struct task_struct *task);
952extern void __perf_event_task_sched_out(struct task_struct *prev,
953 struct task_struct *next);
949extern int perf_event_init_task(struct task_struct *child); 954extern int perf_event_init_task(struct task_struct *child);
950extern void perf_event_exit_task(struct task_struct *child); 955extern void perf_event_exit_task(struct task_struct *child);
951extern void perf_event_free_task(struct task_struct *task); 956extern void perf_event_free_task(struct task_struct *task);
@@ -1059,17 +1064,20 @@ perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
1059 1064
1060extern struct jump_label_key perf_sched_events; 1065extern struct jump_label_key perf_sched_events;
1061 1066
1062static inline void perf_event_task_sched_in(struct task_struct *task) 1067static inline void perf_event_task_sched_in(struct task_struct *prev,
1068 struct task_struct *task)
1063{ 1069{
1064 if (static_branch(&perf_sched_events)) 1070 if (static_branch(&perf_sched_events))
1065 __perf_event_task_sched_in(task); 1071 __perf_event_task_sched_in(prev, task);
1066} 1072}
1067 1073
1068static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) 1074static inline void perf_event_task_sched_out(struct task_struct *prev,
1075 struct task_struct *next)
1069{ 1076{
1070 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); 1077 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0);
1071 1078
1072 __perf_event_task_sched_out(task, next); 1079 if (static_branch(&perf_sched_events))
1080 __perf_event_task_sched_out(prev, next);
1073} 1081}
1074 1082
1075extern void perf_event_mmap(struct vm_area_struct *vma); 1083extern void perf_event_mmap(struct vm_area_struct *vma);
@@ -1139,10 +1147,11 @@ extern void perf_event_disable(struct perf_event *event);
1139extern void perf_event_task_tick(void); 1147extern void perf_event_task_tick(void);
1140#else 1148#else
1141static inline void 1149static inline void
1142perf_event_task_sched_in(struct task_struct *task) { } 1150perf_event_task_sched_in(struct task_struct *prev,
1151 struct task_struct *task) { }
1143static inline void 1152static inline void
1144perf_event_task_sched_out(struct task_struct *task, 1153perf_event_task_sched_out(struct task_struct *prev,
1145 struct task_struct *next) { } 1154 struct task_struct *next) { }
1146static inline int perf_event_init_task(struct task_struct *child) { return 0; } 1155static inline int perf_event_init_task(struct task_struct *child) { return 0; }
1147static inline void perf_event_exit_task(struct task_struct *child) { } 1156static inline void perf_event_exit_task(struct task_struct *child) { }
1148static inline void perf_event_free_task(struct task_struct *task) { } 1157static inline void perf_event_free_task(struct task_struct *task) { }
diff --git a/include/linux/personality.h b/include/linux/personality.h
index eec3bae164d4..8fc7dd1a57ff 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -22,6 +22,7 @@ extern int __set_personality(unsigned int);
22 * These occupy the top three bytes. 22 * These occupy the top three bytes.
23 */ 23 */
24enum { 24enum {
25 UNAME26 = 0x0020000,
25 ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */ 26 ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
26 FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors 27 FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
27 * (signal handling) 28 * (signal handling)
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index 6fb13841db45..f53a4167c5f4 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -24,6 +24,7 @@
24#define LINUX_PHONET_H 24#define LINUX_PHONET_H
25 25
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/socket.h>
27 28
28/* Automatic protocol selection */ 29/* Automatic protocol selection */
29#define PN_PROTO_TRANSPORT 0 30#define PN_PROTO_TRANSPORT 0
@@ -96,11 +97,11 @@ struct phonetmsg {
96 97
97/* Phonet socket address structure */ 98/* Phonet socket address structure */
98struct sockaddr_pn { 99struct sockaddr_pn {
99 sa_family_t spn_family; 100 __kernel_sa_family_t spn_family;
100 __u8 spn_obj; 101 __u8 spn_obj;
101 __u8 spn_dev; 102 __u8 spn_dev;
102 __u8 spn_resource; 103 __u8 spn_resource;
103 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; 104 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3];
104} __attribute__((packed)); 105} __attribute__((packed));
105 106
106/* Well known address */ 107/* Well known address */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 54fc4138955f..79f337c47388 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -420,7 +420,7 @@ struct phy_driver {
420 420
421 /* 421 /*
422 * Requests a Tx timestamp for 'skb'. The phy driver promises 422 * Requests a Tx timestamp for 'skb'. The phy driver promises
423 * to deliver it to the socket's error queue as soon as a 423 * to deliver it using skb_complete_tx_timestamp() as soon as a
424 * timestamp becomes available. One of the PTP_CLASS_ values 424 * timestamp becomes available. One of the PTP_CLASS_ values
425 * is passed in 'type'. 425 * is passed in 'type'.
426 */ 426 */
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h
new file mode 100644
index 000000000000..88863531d862
--- /dev/null
+++ b/include/linux/pinctrl/machine.h
@@ -0,0 +1,107 @@
1/*
2 * Machine interface for the pinctrl subsystem.
3 *
4 * Copyright (C) 2011 ST-Ericsson SA
5 * Written on behalf of Linaro for ST-Ericsson
6 * Based on bits of regulator core, gpio core and clk core
7 *
8 * Author: Linus Walleij <linus.walleij@linaro.org>
9 *
10 * License terms: GNU General Public License (GPL) version 2
11 */
12#ifndef __LINUX_PINMUX_MACHINE_H
13#define __LINUX_PINMUX_MACHINE_H
14
15/**
16 * struct pinmux_map - boards/machines shall provide this map for devices
17 * @name: the name of this specific map entry for the particular machine.
18 * This is the second parameter passed to pinmux_get() when you want
19 * to have several mappings to the same device
20 * @ctrl_dev: the pin control device to be used by this mapping, may be NULL
21 * if you provide .ctrl_dev_name instead (this is more common)
22 * @ctrl_dev_name: the name of the device controlling this specific mapping,
23 * the name must be the same as in your struct device*, may be NULL if
24 * you provide .ctrl_dev instead
25 * @function: a function in the driver to use for this mapping, the driver
26 * will lookup the function referenced by this ID on the specified
27 * pin control device
28 * @group: sometimes a function can map to different pin groups, so this
29 * selects a certain specific pin group to activate for the function, if
30 * left as NULL, the first applicable group will be used
31 * @dev: the device using this specific mapping, may be NULL if you provide
32 * .dev_name instead (this is more common)
33 * @dev_name: the name of the device using this specific mapping, the name
34 * must be the same as in your struct device*, may be NULL if you
35 * provide .dev instead
36 * @hog_on_boot: if this is set to true, the pin control subsystem will itself
37 * hog the mappings as the pinmux device drivers are attached, so this is
38 * typically used with system maps (mux mappings without an assigned
39 * device) that you want to get hogged and enabled by default as soon as
40 * a pinmux device supporting it is registered. These maps will not be
41 * disabled and put until the system shuts down.
42 */
43struct pinmux_map {
44 const char *name;
45 struct device *ctrl_dev;
46 const char *ctrl_dev_name;
47 const char *function;
48 const char *group;
49 struct device *dev;
50 const char *dev_name;
51 const bool hog_on_boot;
52};
53
54/*
55 * Convenience macro to set a simple map from a certain pin controller and a
56 * certain function to a named device
57 */
58#define PINMUX_MAP(a, b, c, d) \
59 { .name = a, .ctrl_dev_name = b, .function = c, .dev_name = d }
60
61/*
62 * Convenience macro to map a system function onto a certain pinctrl device.
63 * System functions are not assigned to a particular device.
64 */
65#define PINMUX_MAP_SYS(a, b, c) \
66 { .name = a, .ctrl_dev_name = b, .function = c }
67
68/*
69 * Convenience macro to map a function onto the primary device pinctrl device
70 * this is especially helpful on systems that have only one pin controller
71 * or need to set up a lot of mappings on the primary controller.
72 */
73#define PINMUX_MAP_PRIMARY(a, b, c) \
74 { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b, \
75 .dev_name = c }
76
77/*
78 * Convenience macro to map a system function onto the primary pinctrl device.
79 * System functions are not assigned to a particular device.
80 */
81#define PINMUX_MAP_PRIMARY_SYS(a, b) \
82 { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b }
83
84/*
85 * Convenience macro to map a system function onto the primary pinctrl device,
86 * to be hogged by the pinmux core until the system shuts down.
87 */
88#define PINMUX_MAP_PRIMARY_SYS_HOG(a, b) \
89 { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b, \
90 .hog_on_boot = true }
91
92
93#ifdef CONFIG_PINMUX
94
95extern int pinmux_register_mappings(struct pinmux_map const *map,
96 unsigned num_maps);
97
98#else
99
100static inline int pinmux_register_mappings(struct pinmux_map const *map,
101 unsigned num_maps)
102{
103 return 0;
104}
105
106#endif /* !CONFIG_PINMUX */
107#endif
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
new file mode 100644
index 000000000000..3605e947fa90
--- /dev/null
+++ b/include/linux/pinctrl/pinctrl.h
@@ -0,0 +1,133 @@
1/*
2 * Interface the pinctrl subsystem
3 *
4 * Copyright (C) 2011 ST-Ericsson SA
5 * Written on behalf of Linaro for ST-Ericsson
6 * This interface is used in the core to keep track of pins.
7 *
8 * Author: Linus Walleij <linus.walleij@linaro.org>
9 *
10 * License terms: GNU General Public License (GPL) version 2
11 */
12#ifndef __LINUX_PINCTRL_PINCTRL_H
13#define __LINUX_PINCTRL_PINCTRL_H
14
15#ifdef CONFIG_PINCTRL
16
17#include <linux/radix-tree.h>
18#include <linux/spinlock.h>
19#include <linux/list.h>
20#include <linux/seq_file.h>
21
22struct pinctrl_dev;
23struct pinmux_ops;
24struct gpio_chip;
25
26/**
27 * struct pinctrl_pin_desc - boards/machines provide information on their
28 * pins, pads or other muxable units in this struct
29 * @number: unique pin number from the global pin number space
30 * @name: a name for this pin
31 */
32struct pinctrl_pin_desc {
33 unsigned number;
34 const char *name;
35};
36
37/* Convenience macro to define a single named or anonymous pin descriptor */
38#define PINCTRL_PIN(a, b) { .number = a, .name = b }
39#define PINCTRL_PIN_ANON(a) { .number = a }
40
41/**
42 * struct pinctrl_gpio_range - each pin controller can provide subranges of
43 * the GPIO number space to be handled by the controller
44 * @node: list node for internal use
45 * @name: a name for the chip in this range
46 * @id: an ID number for the chip in this range
47 * @base: base offset of the GPIO range
48 * @npins: number of pins in the GPIO range, including the base number
49 * @gc: an optional pointer to a gpio_chip
50 */
51struct pinctrl_gpio_range {
52 struct list_head node;
53 const char *name;
54 unsigned int id;
55 unsigned int base;
56 unsigned int npins;
57 struct gpio_chip *gc;
58};
59
60/**
61 * struct pinctrl_ops - global pin control operations, to be implemented by
62 * pin controller drivers.
63 * @list_groups: list the number of selectable named groups available
64 * in this pinmux driver, the core will begin on 0 and call this
65 * repeatedly as long as it returns >= 0 to enumerate the groups
66 * @get_group_name: return the group name of the pin group
67 * @get_group_pins: return an array of pins corresponding to a certain
68 * group selector @pins, and the size of the array in @num_pins
69 * @pin_dbg_show: optional debugfs display hook that will provide per-device
70 * info for a certain pin in debugfs
71 */
72struct pinctrl_ops {
73 int (*list_groups) (struct pinctrl_dev *pctldev, unsigned selector);
74 const char *(*get_group_name) (struct pinctrl_dev *pctldev,
75 unsigned selector);
76 int (*get_group_pins) (struct pinctrl_dev *pctldev,
77 unsigned selector,
78 const unsigned **pins,
79 unsigned *num_pins);
80 void (*pin_dbg_show) (struct pinctrl_dev *pctldev, struct seq_file *s,
81 unsigned offset);
82};
83
84/**
85 * struct pinctrl_desc - pin controller descriptor, register this to pin
86 * control subsystem
87 * @name: name for the pin controller
88 * @pins: an array of pin descriptors describing all the pins handled by
89 * this pin controller
90 * @npins: number of descriptors in the array, usually just ARRAY_SIZE()
91 * of the pins field above
92 * @maxpin: since pin spaces may be sparse, there can he "holes" in the
93 * pin range, this attribute gives the maximum pin number in the
94 * total range. This should not be lower than npins for example,
95 * but may be equal to npins if you have no holes in the pin range.
96 * @pctlops: pin control operation vtable, to support global concepts like
97 * grouping of pins, this is optional.
98 * @pmxops: pinmux operation vtable, if you support pinmuxing in your driver
99 * @owner: module providing the pin controller, used for refcounting
100 */
101struct pinctrl_desc {
102 const char *name;
103 struct pinctrl_pin_desc const *pins;
104 unsigned int npins;
105 unsigned int maxpin;
106 struct pinctrl_ops *pctlops;
107 struct pinmux_ops *pmxops;
108 struct module *owner;
109};
110
111/* External interface to pin controller */
112extern struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
113 struct device *dev, void *driver_data);
114extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
115extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
116extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
117 struct pinctrl_gpio_range *range);
118extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
119 struct pinctrl_gpio_range *range);
120extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
121extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
122#else
123
124
125/* Sufficiently stupid default function when pinctrl is not in use */
126static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin)
127{
128 return pin >= 0;
129}
130
131#endif /* !CONFIG_PINCTRL */
132
133#endif /* __LINUX_PINCTRL_PINCTRL_H */
diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h
new file mode 100644
index 000000000000..3c430e797efc
--- /dev/null
+++ b/include/linux/pinctrl/pinmux.h
@@ -0,0 +1,117 @@
1/*
2 * Interface the pinmux subsystem
3 *
4 * Copyright (C) 2011 ST-Ericsson SA
5 * Written on behalf of Linaro for ST-Ericsson
6 * Based on bits of regulator core, gpio core and clk core
7 *
8 * Author: Linus Walleij <linus.walleij@linaro.org>
9 *
10 * License terms: GNU General Public License (GPL) version 2
11 */
12#ifndef __LINUX_PINCTRL_PINMUX_H
13#define __LINUX_PINCTRL_PINMUX_H
14
15#include <linux/list.h>
16#include <linux/seq_file.h>
17#include "pinctrl.h"
18
19/* This struct is private to the core and should be regarded as a cookie */
20struct pinmux;
21
22#ifdef CONFIG_PINMUX
23
24struct pinctrl_dev;
25
26/**
27 * struct pinmux_ops - pinmux operations, to be implemented by pin controller
28 * drivers that support pinmuxing
29 * @request: called by the core to see if a certain pin can be made available
30 * available for muxing. This is called by the core to acquire the pins
31 * before selecting any actual mux setting across a function. The driver
32 * is allowed to answer "no" by returning a negative error code
33 * @free: the reverse function of the request() callback, frees a pin after
34 * being requested
35 * @list_functions: list the number of selectable named functions available
36 * in this pinmux driver, the core will begin on 0 and call this
37 * repeatedly as long as it returns >= 0 to enumerate mux settings
38 * @get_function_name: return the function name of the muxing selector,
39 * called by the core to figure out which mux setting it shall map a
40 * certain device to
41 * @get_function_groups: return an array of groups names (in turn
42 * referencing pins) connected to a certain function selector. The group
43 * name can be used with the generic @pinctrl_ops to retrieve the
44 * actual pins affected. The applicable groups will be returned in
45 * @groups and the number of groups in @num_groups
46 * @enable: enable a certain muxing function with a certain pin group. The
47 * driver does not need to figure out whether enabling this function
48 * conflicts some other use of the pins in that group, such collisions
49 * are handled by the pinmux subsystem. The @func_selector selects a
50 * certain function whereas @group_selector selects a certain set of pins
51 * to be used. On simple controllers the latter argument may be ignored
52 * @disable: disable a certain muxing selector with a certain pin group
53 * @gpio_request_enable: requests and enables GPIO on a certain pin.
54 * Implement this only if you can mux every pin individually as GPIO. The
55 * affected GPIO range is passed along with an offset into that
56 * specific GPIO range - function selectors and pin groups are orthogonal
57 * to this, the core will however make sure the pins do not collide
58 */
59struct pinmux_ops {
60 int (*request) (struct pinctrl_dev *pctldev, unsigned offset);
61 int (*free) (struct pinctrl_dev *pctldev, unsigned offset);
62 int (*list_functions) (struct pinctrl_dev *pctldev, unsigned selector);
63 const char *(*get_function_name) (struct pinctrl_dev *pctldev,
64 unsigned selector);
65 int (*get_function_groups) (struct pinctrl_dev *pctldev,
66 unsigned selector,
67 const char * const **groups,
68 unsigned * const num_groups);
69 int (*enable) (struct pinctrl_dev *pctldev, unsigned func_selector,
70 unsigned group_selector);
71 void (*disable) (struct pinctrl_dev *pctldev, unsigned func_selector,
72 unsigned group_selector);
73 int (*gpio_request_enable) (struct pinctrl_dev *pctldev,
74 struct pinctrl_gpio_range *range,
75 unsigned offset);
76};
77
78/* External interface to pinmux */
79extern int pinmux_request_gpio(unsigned gpio);
80extern void pinmux_free_gpio(unsigned gpio);
81extern struct pinmux * __must_check pinmux_get(struct device *dev, const char *name);
82extern void pinmux_put(struct pinmux *pmx);
83extern int pinmux_enable(struct pinmux *pmx);
84extern void pinmux_disable(struct pinmux *pmx);
85
86#else /* !CONFIG_PINMUX */
87
88static inline int pinmux_request_gpio(unsigned gpio)
89{
90 return 0;
91}
92
93static inline void pinmux_free_gpio(unsigned gpio)
94{
95}
96
97static inline struct pinmux * __must_check pinmux_get(struct device *dev, const char *name)
98{
99 return NULL;
100}
101
102static inline void pinmux_put(struct pinmux *pmx)
103{
104}
105
106static inline int pinmux_enable(struct pinmux *pmx)
107{
108 return 0;
109}
110
111static inline void pinmux_disable(struct pinmux *pmx)
112{
113}
114
115#endif /* CONFIG_PINMUX */
116
117#endif /* __LINUX_PINCTRL_PINMUX_H */
diff --git a/include/linux/platform_data/dwc3-omap.h b/include/linux/platform_data/dwc3-omap.h
new file mode 100644
index 000000000000..ada401244e0b
--- /dev/null
+++ b/include/linux/platform_data/dwc3-omap.h
@@ -0,0 +1,47 @@
1/**
2 * dwc3-omap.h - OMAP Specific Glue layer, header.
3 *
4 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
5 * All rights reserved.
6 *
7 * Author: Felipe Balbi <balbi@ti.com>
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions, and the following disclaimer,
14 * without modification.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. The names of the above-listed copyright holders may not be used
19 * to endorse or promote products derived from this software without
20 * specific prior written permission.
21 *
22 * ALTERNATIVELY, this software may be distributed under the terms of the
23 * GNU General Public License ("GPL") version 2, as published by the Free
24 * Software Foundation.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
27 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
28 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
30 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 */
38
39enum dwc3_omap_utmi_mode {
40 DWC3_OMAP_UTMI_MODE_UNKNOWN = 0,
41 DWC3_OMAP_UTMI_MODE_HW,
42 DWC3_OMAP_UTMI_MODE_SW,
43};
44
45struct dwc3_omap_data {
46 enum dwc3_omap_utmi_mode utmi_mode;
47};
diff --git a/include/linux/platform_data/exynos4_tmu.h b/include/linux/platform_data/exynos4_tmu.h
new file mode 100644
index 000000000000..39e038cca590
--- /dev/null
+++ b/include/linux/platform_data/exynos4_tmu.h
@@ -0,0 +1,83 @@
1/*
2 * exynos4_tmu.h - Samsung EXYNOS4 TMU (Thermal Management Unit)
3 *
4 * Copyright (C) 2011 Samsung Electronics
5 * Donggeun Kim <dg77.kim@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#ifndef _LINUX_EXYNOS4_TMU_H
23#define _LINUX_EXYNOS4_TMU_H
24
25enum calibration_type {
26 TYPE_ONE_POINT_TRIMMING,
27 TYPE_TWO_POINT_TRIMMING,
28 TYPE_NONE,
29};
30
31/**
32 * struct exynos4_tmu_platform_data
33 * @threshold: basic temperature for generating interrupt
34 * 25 <= threshold <= 125 [unit: degree Celsius]
35 * @trigger_levels: array for each interrupt levels
36 * [unit: degree Celsius]
37 * 0: temperature for trigger_level0 interrupt
38 * condition for trigger_level0 interrupt:
39 * current temperature > threshold + trigger_levels[0]
40 * 1: temperature for trigger_level1 interrupt
41 * condition for trigger_level1 interrupt:
42 * current temperature > threshold + trigger_levels[1]
43 * 2: temperature for trigger_level2 interrupt
44 * condition for trigger_level2 interrupt:
45 * current temperature > threshold + trigger_levels[2]
46 * 3: temperature for trigger_level3 interrupt
47 * condition for trigger_level3 interrupt:
48 * current temperature > threshold + trigger_levels[3]
49 * @trigger_level0_en:
50 * 1 = enable trigger_level0 interrupt,
51 * 0 = disable trigger_level0 interrupt
52 * @trigger_level1_en:
53 * 1 = enable trigger_level1 interrupt,
54 * 0 = disable trigger_level1 interrupt
55 * @trigger_level2_en:
56 * 1 = enable trigger_level2 interrupt,
57 * 0 = disable trigger_level2 interrupt
58 * @trigger_level3_en:
59 * 1 = enable trigger_level3 interrupt,
60 * 0 = disable trigger_level3 interrupt
61 * @gain: gain of amplifier in the positive-TC generator block
62 * 0 <= gain <= 15
63 * @reference_voltage: reference voltage of amplifier
64 * in the positive-TC generator block
65 * 0 <= reference_voltage <= 31
66 * @cal_type: calibration type for temperature
67 *
68 * This structure is required for configuration of exynos4_tmu driver.
69 */
70struct exynos4_tmu_platform_data {
71 u8 threshold;
72 u8 trigger_levels[4];
73 bool trigger_level0_en;
74 bool trigger_level1_en;
75 bool trigger_level2_en;
76 bool trigger_level3_en;
77
78 u8 gain;
79 u8 reference_voltage;
80
81 enum calibration_type cal_type;
82};
83#endif /* _LINUX_EXYNOS4_TMU_H */
diff --git a/include/linux/platform_data/leds-renesas-tpu.h b/include/linux/platform_data/leds-renesas-tpu.h
new file mode 100644
index 000000000000..055387086fc1
--- /dev/null
+++ b/include/linux/platform_data/leds-renesas-tpu.h
@@ -0,0 +1,14 @@
1#ifndef __LEDS_RENESAS_TPU_H__
2#define __LEDS_RENESAS_TPU_H__
3
4struct led_renesas_tpu_config {
5 char *name;
6 unsigned pin_gpio_fn;
7 unsigned pin_gpio;
8 unsigned int channel_offset;
9 unsigned int timer_bit;
10 unsigned int max_brightness;
11 unsigned int refresh_rate;
12};
13
14#endif /* __LEDS_RENESAS_TPU_H__ */
diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h
new file mode 100644
index 000000000000..e9d9149ddf38
--- /dev/null
+++ b/include/linux/platform_data/mv_usb.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) 2011 Marvell International Ltd. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#ifndef __MV_PLATFORM_USB_H
11#define __MV_PLATFORM_USB_H
12
13enum pxa_ehci_type {
14 EHCI_UNDEFINED = 0,
15 PXA_U2OEHCI, /* pxa 168, 9xx */
16 PXA_SPH, /* pxa 168, 9xx SPH */
17 MMP3_HSIC, /* mmp3 hsic */
18 MMP3_FSIC, /* mmp3 fsic */
19};
20
21enum {
22 MV_USB_MODE_OTG,
23 MV_USB_MODE_HOST,
24};
25
26enum {
27 VBUS_LOW = 0,
28 VBUS_HIGH = 1 << 0,
29};
30
31struct mv_usb_addon_irq {
32 unsigned int irq;
33 int (*poll)(void);
34};
35
36struct mv_usb_platform_data {
37 unsigned int clknum;
38 char **clkname;
39 struct mv_usb_addon_irq *id; /* Only valid for OTG. ID pin change*/
40 struct mv_usb_addon_irq *vbus; /* valid for OTG/UDC. VBUS change*/
41
42 /* only valid for HCD. OTG or Host only*/
43 unsigned int mode;
44
45 int (*phy_init)(unsigned int regbase);
46 void (*phy_deinit)(unsigned int regbase);
47 int (*set_vbus)(unsigned int vbus);
48};
49
50#endif
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h
index abd286215279..88734e871e3a 100644
--- a/include/linux/platform_data/ntc_thermistor.h
+++ b/include/linux/platform_data/ntc_thermistor.h
@@ -36,7 +36,7 @@ struct ntc_thermistor_platform_data {
36 * read_uV() 36 * read_uV()
37 * 37 *
38 * How to setup pullup_ohm, pulldown_ohm, and connect is 38 * How to setup pullup_ohm, pulldown_ohm, and connect is
39 * described at Documentation/hwmon/ntc 39 * described at Documentation/hwmon/ntc_thermistor
40 * 40 *
41 * pullup/down_ohm: 0 for infinite / not-connected 41 * pullup/down_ohm: 0 for infinite / not-connected
42 */ 42 */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 27bb05aae70d..2a23f7d1a825 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -49,10 +49,54 @@ extern struct resource *platform_get_resource_byname(struct platform_device *, u
49extern int platform_get_irq_byname(struct platform_device *, const char *); 49extern int platform_get_irq_byname(struct platform_device *, const char *);
50extern int platform_add_devices(struct platform_device **, int); 50extern int platform_add_devices(struct platform_device **, int);
51 51
52extern struct platform_device *platform_device_register_resndata( 52struct platform_device_info {
53 struct device *parent;
54
55 const char *name;
56 int id;
57
58 const struct resource *res;
59 unsigned int num_res;
60
61 const void *data;
62 size_t size_data;
63 u64 dma_mask;
64};
65extern struct platform_device *platform_device_register_full(
66 struct platform_device_info *pdevinfo);
67
68/**
69 * platform_device_register_resndata - add a platform-level device with
70 * resources and platform-specific data
71 *
72 * @parent: parent device for the device we're adding
73 * @name: base name of the device we're adding
74 * @id: instance id
75 * @res: set of resources that needs to be allocated for the device
76 * @num: number of resources
77 * @data: platform specific data for this platform device
78 * @size: size of platform specific data
79 *
80 * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
81 */
82static inline struct platform_device *platform_device_register_resndata(
53 struct device *parent, const char *name, int id, 83 struct device *parent, const char *name, int id,
54 const struct resource *res, unsigned int num, 84 const struct resource *res, unsigned int num,
55 const void *data, size_t size); 85 const void *data, size_t size) {
86
87 struct platform_device_info pdevinfo = {
88 .parent = parent,
89 .name = name,
90 .id = id,
91 .res = res,
92 .num_res = num,
93 .data = data,
94 .size_data = size,
95 .dma_mask = 0,
96 };
97
98 return platform_device_register_full(&pdevinfo);
99}
56 100
57/** 101/**
58 * platform_device_register_simple - add a platform-level device and its resources 102 * platform_device_register_simple - add a platform-level device and its resources
@@ -146,6 +190,23 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data
146 dev_set_drvdata(&pdev->dev, data); 190 dev_set_drvdata(&pdev->dev, data);
147} 191}
148 192
193/* module_platform_driver() - Helper macro for drivers that don't do
194 * anything special in module init/exit. This eliminates a lot of
195 * boilerplate. Each module may only use this macro once, and
196 * calling it replaces module_init() and module_exit()
197 */
198#define module_platform_driver(__platform_driver) \
199static int __init __platform_driver##_init(void) \
200{ \
201 return platform_driver_register(&(__platform_driver)); \
202} \
203module_init(__platform_driver##_init); \
204static void __exit __platform_driver##_exit(void) \
205{ \
206 platform_driver_unregister(&(__platform_driver)); \
207} \
208module_exit(__platform_driver##_exit);
209
149extern struct platform_device *platform_create_bundle(struct platform_driver *driver, 210extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
150 int (*probe)(struct platform_device *), 211 int (*probe)(struct platform_device *),
151 struct resource *res, unsigned int n_res, 212 struct resource *res, unsigned int n_res,
diff --git a/include/linux/pm.h b/include/linux/pm.h
index f7c84c9abd30..f15acb646813 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -326,6 +326,7 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
326 * requested by a driver. 326 * requested by a driver.
327 */ 327 */
328 328
329#define PM_EVENT_INVALID (-1)
329#define PM_EVENT_ON 0x0000 330#define PM_EVENT_ON 0x0000
330#define PM_EVENT_FREEZE 0x0001 331#define PM_EVENT_FREEZE 0x0001
331#define PM_EVENT_SUSPEND 0x0002 332#define PM_EVENT_SUSPEND 0x0002
@@ -346,6 +347,7 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
346#define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) 347#define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND)
347#define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) 348#define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME)
348 349
350#define PMSG_INVALID ((struct pm_message){ .event = PM_EVENT_INVALID, })
349#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) 351#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, })
350#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) 352#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, })
351#define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) 353#define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, })
@@ -366,6 +368,8 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
366#define PMSG_AUTO_RESUME ((struct pm_message) \ 368#define PMSG_AUTO_RESUME ((struct pm_message) \
367 { .event = PM_EVENT_AUTO_RESUME, }) 369 { .event = PM_EVENT_AUTO_RESUME, })
368 370
371#define PMSG_IS_AUTO(msg) (((msg).event & PM_EVENT_AUTO) != 0)
372
369/** 373/**
370 * Device run-time power management status. 374 * Device run-time power management status.
371 * 375 *
@@ -421,6 +425,22 @@ enum rpm_request {
421 425
422struct wakeup_source; 426struct wakeup_source;
423 427
428struct pm_domain_data {
429 struct list_head list_node;
430 struct device *dev;
431};
432
433struct pm_subsys_data {
434 spinlock_t lock;
435 unsigned int refcount;
436#ifdef CONFIG_PM_CLK
437 struct list_head clock_list;
438#endif
439#ifdef CONFIG_PM_GENERIC_DOMAINS
440 struct pm_domain_data *domain_data;
441#endif
442};
443
424struct dev_pm_info { 444struct dev_pm_info {
425 pm_message_t power_state; 445 pm_message_t power_state;
426 unsigned int can_wakeup:1; 446 unsigned int can_wakeup:1;
@@ -432,6 +452,7 @@ struct dev_pm_info {
432 struct list_head entry; 452 struct list_head entry;
433 struct completion completion; 453 struct completion completion;
434 struct wakeup_source *wakeup; 454 struct wakeup_source *wakeup;
455 bool wakeup_path:1;
435#else 456#else
436 unsigned int should_wakeup:1; 457 unsigned int should_wakeup:1;
437#endif 458#endif
@@ -462,10 +483,13 @@ struct dev_pm_info {
462 unsigned long suspended_jiffies; 483 unsigned long suspended_jiffies;
463 unsigned long accounting_timestamp; 484 unsigned long accounting_timestamp;
464#endif 485#endif
465 void *subsys_data; /* Owned by the subsystem. */ 486 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
487 struct pm_qos_constraints *constraints;
466}; 488};
467 489
468extern void update_pm_runtime_accounting(struct device *dev); 490extern void update_pm_runtime_accounting(struct device *dev);
491extern int dev_pm_get_subsys_data(struct device *dev);
492extern int dev_pm_put_subsys_data(struct device *dev);
469 493
470/* 494/*
471 * Power domains provide callbacks that are executed during system suspend, 495 * Power domains provide callbacks that are executed during system suspend,
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
new file mode 100644
index 000000000000..8348866e7b05
--- /dev/null
+++ b/include/linux/pm_clock.h
@@ -0,0 +1,71 @@
1/*
2 * pm_clock.h - Definitions and headers related to device clocks.
3 *
4 * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
5 *
6 * This file is released under the GPLv2.
7 */
8
9#ifndef _LINUX_PM_CLOCK_H
10#define _LINUX_PM_CLOCK_H
11
12#include <linux/device.h>
13#include <linux/notifier.h>
14
15struct pm_clk_notifier_block {
16 struct notifier_block nb;
17 struct dev_pm_domain *pm_domain;
18 char *con_ids[];
19};
20
21#ifdef CONFIG_PM_CLK
22static inline bool pm_clk_no_clocks(struct device *dev)
23{
24 return dev && dev->power.subsys_data
25 && list_empty(&dev->power.subsys_data->clock_list);
26}
27
28extern void pm_clk_init(struct device *dev);
29extern int pm_clk_create(struct device *dev);
30extern void pm_clk_destroy(struct device *dev);
31extern int pm_clk_add(struct device *dev, const char *con_id);
32extern void pm_clk_remove(struct device *dev, const char *con_id);
33extern int pm_clk_suspend(struct device *dev);
34extern int pm_clk_resume(struct device *dev);
35#else
36static inline bool pm_clk_no_clocks(struct device *dev)
37{
38 return true;
39}
40static inline void pm_clk_init(struct device *dev)
41{
42}
43static inline int pm_clk_create(struct device *dev)
44{
45 return -EINVAL;
46}
47static inline void pm_clk_destroy(struct device *dev)
48{
49}
50static inline int pm_clk_add(struct device *dev, const char *con_id)
51{
52 return -EINVAL;
53}
54static inline void pm_clk_remove(struct device *dev, const char *con_id)
55{
56}
57#define pm_clk_suspend NULL
58#define pm_clk_resume NULL
59#endif
60
61#ifdef CONFIG_HAVE_CLK
62extern void pm_clk_add_notifier(struct bus_type *bus,
63 struct pm_clk_notifier_block *clknb);
64#else
65static inline void pm_clk_add_notifier(struct bus_type *bus,
66 struct pm_clk_notifier_block *clknb)
67{
68}
69#endif
70
71#endif
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 21097cb086fe..65633e5a2bc0 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -13,6 +13,7 @@
13 13
14enum gpd_status { 14enum gpd_status {
15 GPD_STATE_ACTIVE = 0, /* PM domain is active */ 15 GPD_STATE_ACTIVE = 0, /* PM domain is active */
16 GPD_STATE_WAIT_MASTER, /* PM domain's master is being waited for */
16 GPD_STATE_BUSY, /* Something is happening to the PM domain */ 17 GPD_STATE_BUSY, /* Something is happening to the PM domain */
17 GPD_STATE_REPEAT, /* Power off in progress, to be repeated */ 18 GPD_STATE_REPEAT, /* Power off in progress, to be repeated */
18 GPD_STATE_POWER_OFF, /* PM domain is off */ 19 GPD_STATE_POWER_OFF, /* PM domain is off */
@@ -25,15 +26,14 @@ struct dev_power_governor {
25struct generic_pm_domain { 26struct generic_pm_domain {
26 struct dev_pm_domain domain; /* PM domain operations */ 27 struct dev_pm_domain domain; /* PM domain operations */
27 struct list_head gpd_list_node; /* Node in the global PM domains list */ 28 struct list_head gpd_list_node; /* Node in the global PM domains list */
28 struct list_head sd_node; /* Node in the parent's subdomain list */ 29 struct list_head master_links; /* Links with PM domain as a master */
29 struct generic_pm_domain *parent; /* Parent PM domain */ 30 struct list_head slave_links; /* Links with PM domain as a slave */
30 struct list_head sd_list; /* List of dubdomains */
31 struct list_head dev_list; /* List of devices */ 31 struct list_head dev_list; /* List of devices */
32 struct mutex lock; 32 struct mutex lock;
33 struct dev_power_governor *gov; 33 struct dev_power_governor *gov;
34 struct work_struct power_off_work; 34 struct work_struct power_off_work;
35 unsigned int in_progress; /* Number of devices being suspended now */ 35 unsigned int in_progress; /* Number of devices being suspended now */
36 unsigned int sd_count; /* Number of subdomains with power "on" */ 36 atomic_t sd_count; /* Number of subdomains with power "on" */
37 enum gpd_status status; /* Current state of the domain */ 37 enum gpd_status status; /* Current state of the domain */
38 wait_queue_head_t status_wait_queue; 38 wait_queue_head_t status_wait_queue;
39 struct task_struct *poweroff_task; /* Powering off task */ 39 struct task_struct *poweroff_task; /* Powering off task */
@@ -42,6 +42,7 @@ struct generic_pm_domain {
42 unsigned int suspended_count; /* System suspend device counter */ 42 unsigned int suspended_count; /* System suspend device counter */
43 unsigned int prepared_count; /* Suspend counter of prepared devices */ 43 unsigned int prepared_count; /* Suspend counter of prepared devices */
44 bool suspend_power_off; /* Power status before system suspend */ 44 bool suspend_power_off; /* Power status before system suspend */
45 bool dev_irq_safe; /* Device callbacks are IRQ-safe */
45 int (*power_off)(struct generic_pm_domain *domain); 46 int (*power_off)(struct generic_pm_domain *domain);
46 int (*power_on)(struct generic_pm_domain *domain); 47 int (*power_on)(struct generic_pm_domain *domain);
47 int (*start_device)(struct device *dev); 48 int (*start_device)(struct device *dev);
@@ -54,12 +55,23 @@ static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
54 return container_of(pd, struct generic_pm_domain, domain); 55 return container_of(pd, struct generic_pm_domain, domain);
55} 56}
56 57
57struct dev_list_entry { 58struct gpd_link {
58 struct list_head node; 59 struct generic_pm_domain *master;
59 struct device *dev; 60 struct list_head master_node;
61 struct generic_pm_domain *slave;
62 struct list_head slave_node;
63};
64
65struct generic_pm_domain_data {
66 struct pm_domain_data base;
60 bool need_restore; 67 bool need_restore;
61}; 68};
62 69
70static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data *pdd)
71{
72 return container_of(pdd, struct generic_pm_domain_data, base);
73}
74
63#ifdef CONFIG_PM_GENERIC_DOMAINS 75#ifdef CONFIG_PM_GENERIC_DOMAINS
64extern int pm_genpd_add_device(struct generic_pm_domain *genpd, 76extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
65 struct device *dev); 77 struct device *dev);
@@ -72,8 +84,6 @@ extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
72extern void pm_genpd_init(struct generic_pm_domain *genpd, 84extern void pm_genpd_init(struct generic_pm_domain *genpd,
73 struct dev_power_governor *gov, bool is_off); 85 struct dev_power_governor *gov, bool is_off);
74extern int pm_genpd_poweron(struct generic_pm_domain *genpd); 86extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
75extern void pm_genpd_poweroff_unused(void);
76extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
77#else 87#else
78static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 88static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
79 struct device *dev) 89 struct device *dev)
@@ -101,8 +111,14 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
101{ 111{
102 return -ENOSYS; 112 return -ENOSYS;
103} 113}
104static inline void pm_genpd_poweroff_unused(void) {} 114#endif
115
116#ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
117extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
118extern void pm_genpd_poweroff_unused(void);
119#else
105static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {} 120static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
121static inline void pm_genpd_poweroff_unused(void) {}
106#endif 122#endif
107 123
108#endif /* _LINUX_PM_DOMAIN_H */ 124#endif /* _LINUX_PM_DOMAIN_H */
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
new file mode 100644
index 000000000000..83b0ea302a80
--- /dev/null
+++ b/include/linux/pm_qos.h
@@ -0,0 +1,155 @@
1#ifndef _LINUX_PM_QOS_H
2#define _LINUX_PM_QOS_H
3/* interface for the pm_qos_power infrastructure of the linux kernel.
4 *
5 * Mark Gross <mgross@linux.intel.com>
6 */
7#include <linux/plist.h>
8#include <linux/notifier.h>
9#include <linux/miscdevice.h>
10#include <linux/device.h>
11
12#define PM_QOS_RESERVED 0
13#define PM_QOS_CPU_DMA_LATENCY 1
14#define PM_QOS_NETWORK_LATENCY 2
15#define PM_QOS_NETWORK_THROUGHPUT 3
16
17#define PM_QOS_NUM_CLASSES 4
18#define PM_QOS_DEFAULT_VALUE -1
19
20#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
21#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
22#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
23#define PM_QOS_DEV_LAT_DEFAULT_VALUE 0
24
25struct pm_qos_request {
26 struct plist_node node;
27 int pm_qos_class;
28};
29
30struct dev_pm_qos_request {
31 struct plist_node node;
32 struct device *dev;
33};
34
35enum pm_qos_type {
36 PM_QOS_UNITIALIZED,
37 PM_QOS_MAX, /* return the largest value */
38 PM_QOS_MIN /* return the smallest value */
39};
40
41/*
42 * Note: The lockless read path depends on the CPU accessing
43 * target_value atomically. Atomic access is only guaranteed on all CPU
44 * types linux supports for 32 bit quantites
45 */
46struct pm_qos_constraints {
47 struct plist_head list;
48 s32 target_value; /* Do not change to 64 bit */
49 s32 default_value;
50 enum pm_qos_type type;
51 struct blocking_notifier_head *notifiers;
52};
53
54/* Action requested to pm_qos_update_target */
55enum pm_qos_req_action {
56 PM_QOS_ADD_REQ, /* Add a new request */
57 PM_QOS_UPDATE_REQ, /* Update an existing request */
58 PM_QOS_REMOVE_REQ /* Remove an existing request */
59};
60
61static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
62{
63 return req->dev != 0;
64}
65
66#ifdef CONFIG_PM
67int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
68 enum pm_qos_req_action action, int value);
69void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
70 s32 value);
71void pm_qos_update_request(struct pm_qos_request *req,
72 s32 new_value);
73void pm_qos_remove_request(struct pm_qos_request *req);
74
75int pm_qos_request(int pm_qos_class);
76int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
77int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
78int pm_qos_request_active(struct pm_qos_request *req);
79s32 pm_qos_read_value(struct pm_qos_constraints *c);
80
81s32 dev_pm_qos_read_value(struct device *dev);
82int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
83 s32 value);
84int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value);
85int dev_pm_qos_remove_request(struct dev_pm_qos_request *req);
86int dev_pm_qos_add_notifier(struct device *dev,
87 struct notifier_block *notifier);
88int dev_pm_qos_remove_notifier(struct device *dev,
89 struct notifier_block *notifier);
90int dev_pm_qos_add_global_notifier(struct notifier_block *notifier);
91int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
92void dev_pm_qos_constraints_init(struct device *dev);
93void dev_pm_qos_constraints_destroy(struct device *dev);
94#else
95static inline int pm_qos_update_target(struct pm_qos_constraints *c,
96 struct plist_node *node,
97 enum pm_qos_req_action action,
98 int value)
99 { return 0; }
100static inline void pm_qos_add_request(struct pm_qos_request *req,
101 int pm_qos_class, s32 value)
102 { return; }
103static inline void pm_qos_update_request(struct pm_qos_request *req,
104 s32 new_value)
105 { return; }
106static inline void pm_qos_remove_request(struct pm_qos_request *req)
107 { return; }
108
109static inline int pm_qos_request(int pm_qos_class)
110 { return 0; }
111static inline int pm_qos_add_notifier(int pm_qos_class,
112 struct notifier_block *notifier)
113 { return 0; }
114static inline int pm_qos_remove_notifier(int pm_qos_class,
115 struct notifier_block *notifier)
116 { return 0; }
117static inline int pm_qos_request_active(struct pm_qos_request *req)
118 { return 0; }
119static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
120 { return 0; }
121
122static inline s32 dev_pm_qos_read_value(struct device *dev)
123 { return 0; }
124static inline int dev_pm_qos_add_request(struct device *dev,
125 struct dev_pm_qos_request *req,
126 s32 value)
127 { return 0; }
128static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
129 s32 new_value)
130 { return 0; }
131static inline int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
132 { return 0; }
133static inline int dev_pm_qos_add_notifier(struct device *dev,
134 struct notifier_block *notifier)
135 { return 0; }
136static inline int dev_pm_qos_remove_notifier(struct device *dev,
137 struct notifier_block *notifier)
138 { return 0; }
139static inline int dev_pm_qos_add_global_notifier(
140 struct notifier_block *notifier)
141 { return 0; }
142static inline int dev_pm_qos_remove_global_notifier(
143 struct notifier_block *notifier)
144 { return 0; }
145static inline void dev_pm_qos_constraints_init(struct device *dev)
146{
147 dev->power.power_state = PMSG_ON;
148}
149static inline void dev_pm_qos_constraints_destroy(struct device *dev)
150{
151 dev->power.power_state = PMSG_INVALID;
152}
153#endif
154
155#endif
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h
deleted file mode 100644
index a7d87f911cab..000000000000
--- a/include/linux/pm_qos_params.h
+++ /dev/null
@@ -1,38 +0,0 @@
1#ifndef _LINUX_PM_QOS_PARAMS_H
2#define _LINUX_PM_QOS_PARAMS_H
3/* interface for the pm_qos_power infrastructure of the linux kernel.
4 *
5 * Mark Gross <mgross@linux.intel.com>
6 */
7#include <linux/plist.h>
8#include <linux/notifier.h>
9#include <linux/miscdevice.h>
10
11#define PM_QOS_RESERVED 0
12#define PM_QOS_CPU_DMA_LATENCY 1
13#define PM_QOS_NETWORK_LATENCY 2
14#define PM_QOS_NETWORK_THROUGHPUT 3
15
16#define PM_QOS_NUM_CLASSES 4
17#define PM_QOS_DEFAULT_VALUE -1
18
19#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
20#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
21#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
22
23struct pm_qos_request_list {
24 struct plist_node list;
25 int pm_qos_class;
26};
27
28void pm_qos_add_request(struct pm_qos_request_list *l, int pm_qos_class, s32 value);
29void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
30 s32 new_value);
31void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req);
32
33int pm_qos_request(int pm_qos_class);
34int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
35int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
36int pm_qos_request_active(struct pm_qos_request_list *req);
37
38#endif
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index daac05d751b2..d8d903619642 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -10,6 +10,7 @@
10#define _LINUX_PM_RUNTIME_H 10#define _LINUX_PM_RUNTIME_H
11 11
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/notifier.h>
13#include <linux/pm.h> 14#include <linux/pm.h>
14 15
15#include <linux/jiffies.h> 16#include <linux/jiffies.h>
@@ -251,46 +252,4 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
251 __pm_runtime_use_autosuspend(dev, false); 252 __pm_runtime_use_autosuspend(dev, false);
252} 253}
253 254
254struct pm_clk_notifier_block {
255 struct notifier_block nb;
256 struct dev_pm_domain *pm_domain;
257 char *con_ids[];
258};
259
260#ifdef CONFIG_PM_CLK
261extern int pm_clk_init(struct device *dev);
262extern void pm_clk_destroy(struct device *dev);
263extern int pm_clk_add(struct device *dev, const char *con_id);
264extern void pm_clk_remove(struct device *dev, const char *con_id);
265extern int pm_clk_suspend(struct device *dev);
266extern int pm_clk_resume(struct device *dev);
267#else
268static inline int pm_clk_init(struct device *dev)
269{
270 return -EINVAL;
271}
272static inline void pm_clk_destroy(struct device *dev)
273{
274}
275static inline int pm_clk_add(struct device *dev, const char *con_id)
276{
277 return -EINVAL;
278}
279static inline void pm_clk_remove(struct device *dev, const char *con_id)
280{
281}
282#define pm_clk_suspend NULL
283#define pm_clk_resume NULL
284#endif
285
286#ifdef CONFIG_HAVE_CLK
287extern void pm_clk_add_notifier(struct bus_type *bus,
288 struct pm_clk_notifier_block *clknb);
289#else
290static inline void pm_clk_add_notifier(struct bus_type *bus,
291 struct pm_clk_notifier_block *clknb)
292{
293}
294#endif
295
296#endif 255#endif
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 959c14132f46..042058fdb0af 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -81,7 +81,10 @@ struct k_itimer {
81 unsigned long incr; 81 unsigned long incr;
82 unsigned long expires; 82 unsigned long expires;
83 } mmtimer; 83 } mmtimer;
84 struct alarm alarmtimer; 84 struct {
85 struct alarm alarmtimer;
86 ktime_t interval;
87 } alarm;
85 struct rcu_head rcu; 88 struct rcu_head rcu;
86 } it; 89 } it;
87}; 90};
diff --git a/include/linux/pps-gpio.h b/include/linux/pps-gpio.h
new file mode 100644
index 000000000000..0035abe41b9a
--- /dev/null
+++ b/include/linux/pps-gpio.h
@@ -0,0 +1,32 @@
1/*
2 * pps-gpio.h -- PPS client for GPIOs
3 *
4 *
5 * Copyright (C) 2011 James Nuss <jamesnuss@nanometrics.ca>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#ifndef _PPS_GPIO_H
23#define _PPS_GPIO_H
24
25struct pps_gpio_platform_data {
26 bool assert_falling_edge;
27 bool capture_clear;
28 unsigned int gpio_pin;
29 const char *gpio_label;
30};
31
32#endif
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 0101d55d9651..f0e22f75143f 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -82,22 +82,22 @@ struct va_format {
82 * Dummy printk for disabled debugging statements to use whilst maintaining 82 * Dummy printk for disabled debugging statements to use whilst maintaining
83 * gcc's format and side-effect checking. 83 * gcc's format and side-effect checking.
84 */ 84 */
85static inline __attribute__ ((format (printf, 1, 2))) 85static inline __printf(1, 2)
86int no_printk(const char *fmt, ...) 86int no_printk(const char *fmt, ...)
87{ 87{
88 return 0; 88 return 0;
89} 89}
90 90
91extern asmlinkage __attribute__ ((format (printf, 1, 2))) 91extern asmlinkage __printf(1, 2)
92void early_printk(const char *fmt, ...); 92void early_printk(const char *fmt, ...);
93 93
94extern int printk_needs_cpu(int cpu); 94extern int printk_needs_cpu(int cpu);
95extern void printk_tick(void); 95extern void printk_tick(void);
96 96
97#ifdef CONFIG_PRINTK 97#ifdef CONFIG_PRINTK
98asmlinkage __attribute__ ((format (printf, 1, 0))) 98asmlinkage __printf(1, 0)
99int vprintk(const char *fmt, va_list args); 99int vprintk(const char *fmt, va_list args);
100asmlinkage __attribute__ ((format (printf, 1, 2))) __cold 100asmlinkage __printf(1, 2) __cold
101int printk(const char *fmt, ...); 101int printk(const char *fmt, ...);
102 102
103/* 103/*
@@ -117,12 +117,12 @@ extern int kptr_restrict;
117void log_buf_kexec_setup(void); 117void log_buf_kexec_setup(void);
118void __init setup_log_buf(int early); 118void __init setup_log_buf(int early);
119#else 119#else
120static inline __attribute__ ((format (printf, 1, 0))) 120static inline __printf(1, 0)
121int vprintk(const char *s, va_list args) 121int vprintk(const char *s, va_list args)
122{ 122{
123 return 0; 123 return 0;
124} 124}
125static inline __attribute__ ((format (printf, 1, 2))) __cold 125static inline __printf(1, 2) __cold
126int printk(const char *s, ...) 126int printk(const char *s, ...)
127{ 127{
128 return 0; 128 return 0;
diff --git a/include/linux/proportions.h b/include/linux/proportions.h
index cf793bbbd05e..ef35bb73f69b 100644
--- a/include/linux/proportions.h
+++ b/include/linux/proportions.h
@@ -58,7 +58,7 @@ struct prop_local_percpu {
58 */ 58 */
59 int shift; 59 int shift;
60 unsigned long period; 60 unsigned long period;
61 spinlock_t lock; /* protect the snapshot state */ 61 raw_spinlock_t lock; /* protect the snapshot state */
62}; 62};
63 63
64int prop_local_init_percpu(struct prop_local_percpu *pl); 64int prop_local_init_percpu(struct prop_local_percpu *pl);
@@ -106,11 +106,11 @@ struct prop_local_single {
106 */ 106 */
107 unsigned long period; 107 unsigned long period;
108 int shift; 108 int shift;
109 spinlock_t lock; /* protect the snapshot state */ 109 raw_spinlock_t lock; /* protect the snapshot state */
110}; 110};
111 111
112#define INIT_PROP_LOCAL_SINGLE(name) \ 112#define INIT_PROP_LOCAL_SINGLE(name) \
113{ .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ 113{ .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
114} 114}
115 115
116int prop_local_init_single(struct prop_local_single *pl); 116int prop_local_init_single(struct prop_local_single *pl);
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index cc03bbf5c4b8..ea567321ae3c 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -32,15 +32,15 @@ enum pstore_type_id {
32struct pstore_info { 32struct pstore_info {
33 struct module *owner; 33 struct module *owner;
34 char *name; 34 char *name;
35 struct mutex buf_mutex; /* serialize access to 'buf' */ 35 spinlock_t buf_lock; /* serialize access to 'buf' */
36 char *buf; 36 char *buf;
37 size_t bufsize; 37 size_t bufsize;
38 int (*open)(struct pstore_info *psi); 38 int (*open)(struct pstore_info *psi);
39 int (*close)(struct pstore_info *psi); 39 int (*close)(struct pstore_info *psi);
40 ssize_t (*read)(u64 *id, enum pstore_type_id *type, 40 ssize_t (*read)(u64 *id, enum pstore_type_id *type,
41 struct timespec *time, struct pstore_info *psi); 41 struct timespec *time, struct pstore_info *psi);
42 u64 (*write)(enum pstore_type_id type, unsigned int part, 42 int (*write)(enum pstore_type_id type, u64 *id,
43 size_t size, struct pstore_info *psi); 43 unsigned int part, size_t size, struct pstore_info *psi);
44 int (*erase)(enum pstore_type_id type, u64 id, 44 int (*erase)(enum pstore_type_id type, u64 id,
45 struct pstore_info *psi); 45 struct pstore_info *psi);
46 void *data; 46 void *data;
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h
index e07e2742a865..1dc420ba213a 100644
--- a/include/linux/ptp_classify.h
+++ b/include/linux/ptp_classify.h
@@ -51,6 +51,7 @@
51#define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN) 51#define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN)
52 52
53#define PTP_EV_PORT 319 53#define PTP_EV_PORT 319
54#define PTP_GEN_BIT 0x08 /* indicates general message, if set in message type */
54 55
55#define OFF_ETYPE 12 56#define OFF_ETYPE 12
56#define OFF_IHL 14 57#define OFF_IHL 14
@@ -116,14 +117,20 @@ static inline int ptp_filter_init(struct sock_filter *f, int len)
116 {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \ 117 {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \
117 {OP_RETA, 0, 0, 0 }, /* */ \ 118 {OP_RETA, 0, 0, 0 }, /* */ \
118/*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \ 119/*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \
119/*L40*/ {OP_JEQ, 0, 6, ETH_P_8021Q }, /* f goto L50 */ \ 120/*L40*/ {OP_JEQ, 0, 9, ETH_P_8021Q }, /* f goto L50 */ \
120 {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \ 121 {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \
121 {OP_JEQ, 0, 9, ETH_P_1588 }, /* f goto L60 */ \ 122 {OP_JEQ, 0, 15, ETH_P_1588 }, /* f goto L60 */ \
123 {OP_LDB, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
124 {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
125 {OP_JEQ, 0, 12, 0 }, /* f goto L6x */ \
122 {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \ 126 {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
123 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ 127 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
124 {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \ 128 {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \
125 {OP_RETA, 0, 0, 0 }, /* */ \ 129 {OP_RETA, 0, 0, 0 }, /* */ \
126/*L50*/ {OP_JEQ, 0, 4, ETH_P_1588 }, /* f goto L61 */ \ 130/*L50*/ {OP_JEQ, 0, 7, ETH_P_1588 }, /* f goto L61 */ \
131 {OP_LDB, 0, 0, ETH_HLEN }, /* */ \
132 {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
133 {OP_JEQ, 0, 4, 0 }, /* f goto L6x */ \
127 {OP_LDH, 0, 0, ETH_HLEN }, /* */ \ 134 {OP_LDH, 0, 0, ETH_HLEN }, /* */ \
128 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ 135 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
129 {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \ 136 {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 5e3e25a3c9c3..63d2df43e61a 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,7 @@ struct platform_pwm_backlight_data {
14 unsigned int pwm_period_ns; 14 unsigned int pwm_period_ns;
15 int (*init)(struct device *dev); 15 int (*init)(struct device *dev);
16 int (*notify)(struct device *dev, int brightness); 16 int (*notify)(struct device *dev, int brightness);
17 void (*notify_after)(struct device *dev, int brightness);
17 void (*exit)(struct device *dev); 18 void (*exit)(struct device *dev);
18 int (*check_fb)(struct device *dev, struct fb_info *info); 19 int (*check_fb)(struct device *dev, struct fb_info *info);
19}; 20};
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 26f9e3612e0f..d93f95e6177c 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -31,7 +31,7 @@ static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
31#define quota_error(sb, fmt, args...) \ 31#define quota_error(sb, fmt, args...) \
32 __quota_error((sb), __func__, fmt , ## args) 32 __quota_error((sb), __func__, fmt , ## args)
33 33
34extern __attribute__((format (printf, 3, 4))) 34extern __printf(3, 4)
35void __quota_error(struct super_block *sb, const char *func, 35void __quota_error(struct super_block *sb, const char *func,
36 const char *fmt, ...); 36 const char *fmt, ...);
37 37
diff --git a/include/linux/random.h b/include/linux/random.h
index d13059f3ea32..8f74538c96db 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -91,6 +91,19 @@ static inline void prandom32_seed(struct rnd_state *state, u64 seed)
91 state->s3 = __seed(i, 15); 91 state->s3 = __seed(i, 15);
92} 92}
93 93
94#ifdef CONFIG_ARCH_RANDOM
95# include <asm/archrandom.h>
96#else
97static inline int arch_get_random_long(unsigned long *v)
98{
99 return 0;
100}
101static inline int arch_get_random_int(unsigned int *v)
102{
103 return 0;
104}
105#endif
106
94#endif /* __KERNEL___ */ 107#endif /* __KERNEL___ */
95 108
96#endif /* _LINUX_RANDOM_H */ 109#endif /* _LINUX_RANDOM_H */
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 2f007157fab9..e11ccb4cf48d 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -8,7 +8,7 @@
8#define DEFAULT_RATELIMIT_BURST 10 8#define DEFAULT_RATELIMIT_BURST 10
9 9
10struct ratelimit_state { 10struct ratelimit_state {
11 spinlock_t lock; /* protect the state */ 11 raw_spinlock_t lock; /* protect the state */
12 12
13 int interval; 13 int interval;
14 int burst; 14 int burst;
@@ -20,7 +20,7 @@ struct ratelimit_state {
20#define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \ 20#define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \
21 \ 21 \
22 struct ratelimit_state name = { \ 22 struct ratelimit_state name = { \
23 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ 23 .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
24 .interval = interval_init, \ 24 .interval = interval_init, \
25 .burst = burst_init, \ 25 .burst = burst_init, \
26 } 26 }
@@ -28,7 +28,7 @@ struct ratelimit_state {
28static inline void ratelimit_state_init(struct ratelimit_state *rs, 28static inline void ratelimit_state_init(struct ratelimit_state *rs,
29 int interval, int burst) 29 int interval, int burst)
30{ 30{
31 spin_lock_init(&rs->lock); 31 raw_spin_lock_init(&rs->lock);
32 rs->interval = interval; 32 rs->interval = interval;
33 rs->burst = burst; 33 rs->burst = burst;
34 rs->printed = 0; 34 rs->printed = 0;
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 8f4f881a0ad8..2cf4226ade7e 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -33,6 +33,7 @@
33#ifndef __LINUX_RCUPDATE_H 33#ifndef __LINUX_RCUPDATE_H
34#define __LINUX_RCUPDATE_H 34#define __LINUX_RCUPDATE_H
35 35
36#include <linux/types.h>
36#include <linux/cache.h> 37#include <linux/cache.h>
37#include <linux/spinlock.h> 38#include <linux/spinlock.h>
38#include <linux/threads.h> 39#include <linux/threads.h>
@@ -64,32 +65,74 @@ static inline void rcutorture_record_progress(unsigned long vernum)
64#define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) 65#define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b))
65#define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) 66#define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b))
66 67
68/* Exported common interfaces */
69
70#ifdef CONFIG_PREEMPT_RCU
71
67/** 72/**
68 * struct rcu_head - callback structure for use with RCU 73 * call_rcu() - Queue an RCU callback for invocation after a grace period.
69 * @next: next update requests in a list 74 * @head: structure to be used for queueing the RCU updates.
70 * @func: actual update function to call after the grace period. 75 * @func: actual callback function to be invoked after the grace period
76 *
77 * The callback function will be invoked some time after a full grace
78 * period elapses, in other words after all pre-existing RCU read-side
79 * critical sections have completed. However, the callback function
80 * might well execute concurrently with RCU read-side critical sections
81 * that started after call_rcu() was invoked. RCU read-side critical
82 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
83 * and may be nested.
71 */ 84 */
72struct rcu_head { 85extern void call_rcu(struct rcu_head *head,
73 struct rcu_head *next; 86 void (*func)(struct rcu_head *head));
74 void (*func)(struct rcu_head *head);
75};
76 87
77/* Exported common interfaces */ 88#else /* #ifdef CONFIG_PREEMPT_RCU */
89
90/* In classic RCU, call_rcu() is just call_rcu_sched(). */
91#define call_rcu call_rcu_sched
92
93#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
94
95/**
96 * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period.
97 * @head: structure to be used for queueing the RCU updates.
98 * @func: actual callback function to be invoked after the grace period
99 *
100 * The callback function will be invoked some time after a full grace
101 * period elapses, in other words after all currently executing RCU
102 * read-side critical sections have completed. call_rcu_bh() assumes
103 * that the read-side critical sections end on completion of a softirq
104 * handler. This means that read-side critical sections in process
105 * context must not be interrupted by softirqs. This interface is to be
106 * used when most of the read-side critical sections are in softirq context.
107 * RCU read-side critical sections are delimited by :
108 * - rcu_read_lock() and rcu_read_unlock(), if in interrupt context.
109 * OR
110 * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context.
111 * These may be nested.
112 */
113extern void call_rcu_bh(struct rcu_head *head,
114 void (*func)(struct rcu_head *head));
115
116/**
117 * call_rcu_sched() - Queue an RCU for invocation after sched grace period.
118 * @head: structure to be used for queueing the RCU updates.
119 * @func: actual callback function to be invoked after the grace period
120 *
121 * The callback function will be invoked some time after a full grace
122 * period elapses, in other words after all currently executing RCU
123 * read-side critical sections have completed. call_rcu_sched() assumes
124 * that the read-side critical sections end on enabling of preemption
125 * or on voluntary preemption.
126 * RCU read-side critical sections are delimited by :
127 * - rcu_read_lock_sched() and rcu_read_unlock_sched(),
128 * OR
129 * anything that disables preemption.
130 * These may be nested.
131 */
78extern void call_rcu_sched(struct rcu_head *head, 132extern void call_rcu_sched(struct rcu_head *head,
79 void (*func)(struct rcu_head *rcu)); 133 void (*func)(struct rcu_head *rcu));
80extern void synchronize_sched(void);
81extern void rcu_barrier_bh(void);
82extern void rcu_barrier_sched(void);
83
84static inline void __rcu_read_lock_bh(void)
85{
86 local_bh_disable();
87}
88 134
89static inline void __rcu_read_unlock_bh(void) 135extern void synchronize_sched(void);
90{
91 local_bh_enable();
92}
93 136
94#ifdef CONFIG_PREEMPT_RCU 137#ifdef CONFIG_PREEMPT_RCU
95 138
@@ -152,6 +195,15 @@ static inline void rcu_exit_nohz(void)
152 195
153#endif /* #else #ifdef CONFIG_NO_HZ */ 196#endif /* #else #ifdef CONFIG_NO_HZ */
154 197
198/*
199 * Infrastructure to implement the synchronize_() primitives in
200 * TREE_RCU and rcu_barrier_() primitives in TINY_RCU.
201 */
202
203typedef void call_rcu_func_t(struct rcu_head *head,
204 void (*func)(struct rcu_head *head));
205void wait_rcu_gp(call_rcu_func_t crf);
206
155#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 207#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
156#include <linux/rcutree.h> 208#include <linux/rcutree.h>
157#elif defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) 209#elif defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU)
@@ -297,19 +349,31 @@ extern int rcu_my_thread_group_empty(void);
297/** 349/**
298 * rcu_lockdep_assert - emit lockdep splat if specified condition not met 350 * rcu_lockdep_assert - emit lockdep splat if specified condition not met
299 * @c: condition to check 351 * @c: condition to check
352 * @s: informative message
300 */ 353 */
301#define rcu_lockdep_assert(c) \ 354#define rcu_lockdep_assert(c, s) \
302 do { \ 355 do { \
303 static bool __warned; \ 356 static bool __warned; \
304 if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \ 357 if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \
305 __warned = true; \ 358 __warned = true; \
306 lockdep_rcu_dereference(__FILE__, __LINE__); \ 359 lockdep_rcu_suspicious(__FILE__, __LINE__, s); \
307 } \ 360 } \
308 } while (0) 361 } while (0)
309 362
363#define rcu_sleep_check() \
364 do { \
365 rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \
366 "Illegal context switch in RCU-bh" \
367 " read-side critical section"); \
368 rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \
369 "Illegal context switch in RCU-sched"\
370 " read-side critical section"); \
371 } while (0)
372
310#else /* #ifdef CONFIG_PROVE_RCU */ 373#else /* #ifdef CONFIG_PROVE_RCU */
311 374
312#define rcu_lockdep_assert(c) do { } while (0) 375#define rcu_lockdep_assert(c, s) do { } while (0)
376#define rcu_sleep_check() do { } while (0)
313 377
314#endif /* #else #ifdef CONFIG_PROVE_RCU */ 378#endif /* #else #ifdef CONFIG_PROVE_RCU */
315 379
@@ -338,14 +402,16 @@ extern int rcu_my_thread_group_empty(void);
338#define __rcu_dereference_check(p, c, space) \ 402#define __rcu_dereference_check(p, c, space) \
339 ({ \ 403 ({ \
340 typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ 404 typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \
341 rcu_lockdep_assert(c); \ 405 rcu_lockdep_assert(c, "suspicious rcu_dereference_check()" \
406 " usage"); \
342 rcu_dereference_sparse(p, space); \ 407 rcu_dereference_sparse(p, space); \
343 smp_read_barrier_depends(); \ 408 smp_read_barrier_depends(); \
344 ((typeof(*p) __force __kernel *)(_________p1)); \ 409 ((typeof(*p) __force __kernel *)(_________p1)); \
345 }) 410 })
346#define __rcu_dereference_protected(p, c, space) \ 411#define __rcu_dereference_protected(p, c, space) \
347 ({ \ 412 ({ \
348 rcu_lockdep_assert(c); \ 413 rcu_lockdep_assert(c, "suspicious rcu_dereference_protected()" \
414 " usage"); \
349 rcu_dereference_sparse(p, space); \ 415 rcu_dereference_sparse(p, space); \
350 ((typeof(*p) __force __kernel *)(p)); \ 416 ((typeof(*p) __force __kernel *)(p)); \
351 }) 417 })
@@ -359,15 +425,15 @@ extern int rcu_my_thread_group_empty(void);
359#define __rcu_dereference_index_check(p, c) \ 425#define __rcu_dereference_index_check(p, c) \
360 ({ \ 426 ({ \
361 typeof(p) _________p1 = ACCESS_ONCE(p); \ 427 typeof(p) _________p1 = ACCESS_ONCE(p); \
362 rcu_lockdep_assert(c); \ 428 rcu_lockdep_assert(c, \
429 "suspicious rcu_dereference_index_check()" \
430 " usage"); \
363 smp_read_barrier_depends(); \ 431 smp_read_barrier_depends(); \
364 (_________p1); \ 432 (_________p1); \
365 }) 433 })
366#define __rcu_assign_pointer(p, v, space) \ 434#define __rcu_assign_pointer(p, v, space) \
367 ({ \ 435 ({ \
368 if (!__builtin_constant_p(v) || \ 436 smp_wmb(); \
369 ((v) != NULL)) \
370 smp_wmb(); \
371 (p) = (typeof(*v) __force space *)(v); \ 437 (p) = (typeof(*v) __force space *)(v); \
372 }) 438 })
373 439
@@ -500,26 +566,6 @@ extern int rcu_my_thread_group_empty(void);
500#define rcu_dereference_protected(p, c) \ 566#define rcu_dereference_protected(p, c) \
501 __rcu_dereference_protected((p), (c), __rcu) 567 __rcu_dereference_protected((p), (c), __rcu)
502 568
503/**
504 * rcu_dereference_bh_protected() - fetch RCU-bh pointer when updates prevented
505 * @p: The pointer to read, prior to dereferencing
506 * @c: The conditions under which the dereference will take place
507 *
508 * This is the RCU-bh counterpart to rcu_dereference_protected().
509 */
510#define rcu_dereference_bh_protected(p, c) \
511 __rcu_dereference_protected((p), (c), __rcu)
512
513/**
514 * rcu_dereference_sched_protected() - fetch RCU-sched pointer when updates prevented
515 * @p: The pointer to read, prior to dereferencing
516 * @c: The conditions under which the dereference will take place
517 *
518 * This is the RCU-sched counterpart to rcu_dereference_protected().
519 */
520#define rcu_dereference_sched_protected(p, c) \
521 __rcu_dereference_protected((p), (c), __rcu)
522
523 569
524/** 570/**
525 * rcu_dereference() - fetch RCU-protected pointer for dereferencing 571 * rcu_dereference() - fetch RCU-protected pointer for dereferencing
@@ -630,7 +676,7 @@ static inline void rcu_read_unlock(void)
630 */ 676 */
631static inline void rcu_read_lock_bh(void) 677static inline void rcu_read_lock_bh(void)
632{ 678{
633 __rcu_read_lock_bh(); 679 local_bh_disable();
634 __acquire(RCU_BH); 680 __acquire(RCU_BH);
635 rcu_read_acquire_bh(); 681 rcu_read_acquire_bh();
636} 682}
@@ -644,7 +690,7 @@ static inline void rcu_read_unlock_bh(void)
644{ 690{
645 rcu_read_release_bh(); 691 rcu_read_release_bh();
646 __release(RCU_BH); 692 __release(RCU_BH);
647 __rcu_read_unlock_bh(); 693 local_bh_enable();
648} 694}
649 695
650/** 696/**
@@ -698,11 +744,18 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
698 * any prior initialization. Returns the value assigned. 744 * any prior initialization. Returns the value assigned.
699 * 745 *
700 * Inserts memory barriers on architectures that require them 746 * Inserts memory barriers on architectures that require them
701 * (pretty much all of them other than x86), and also prevents 747 * (which is most of them), and also prevents the compiler from
702 * the compiler from reordering the code that initializes the 748 * reordering the code that initializes the structure after the pointer
703 * structure after the pointer assignment. More importantly, this 749 * assignment. More importantly, this call documents which pointers
704 * call documents which pointers will be dereferenced by RCU read-side 750 * will be dereferenced by RCU read-side code.
705 * code. 751 *
752 * In some special cases, you may use RCU_INIT_POINTER() instead
753 * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
754 * to the fact that it does not constrain either the CPU or the compiler.
755 * That said, using RCU_INIT_POINTER() when you should have used
756 * rcu_assign_pointer() is a very bad thing that results in
757 * impossible-to-diagnose memory corruption. So please be careful.
758 * See the RCU_INIT_POINTER() comment header for details.
706 */ 759 */
707#define rcu_assign_pointer(p, v) \ 760#define rcu_assign_pointer(p, v) \
708 __rcu_assign_pointer((p), (v), __rcu) 761 __rcu_assign_pointer((p), (v), __rcu)
@@ -710,105 +763,38 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
710/** 763/**
711 * RCU_INIT_POINTER() - initialize an RCU protected pointer 764 * RCU_INIT_POINTER() - initialize an RCU protected pointer
712 * 765 *
713 * Initialize an RCU-protected pointer in such a way to avoid RCU-lockdep 766 * Initialize an RCU-protected pointer in special cases where readers
714 * splats. 767 * do not need ordering constraints on the CPU or the compiler. These
768 * special cases are:
769 *
770 * 1. This use of RCU_INIT_POINTER() is NULLing out the pointer -or-
771 * 2. The caller has taken whatever steps are required to prevent
772 * RCU readers from concurrently accessing this pointer -or-
773 * 3. The referenced data structure has already been exposed to
774 * readers either at compile time or via rcu_assign_pointer() -and-
775 * a. You have not made -any- reader-visible changes to
776 * this structure since then -or-
777 * b. It is OK for readers accessing this structure from its
778 * new location to see the old state of the structure. (For
779 * example, the changes were to statistical counters or to
780 * other state where exact synchronization is not required.)
781 *
782 * Failure to follow these rules governing use of RCU_INIT_POINTER() will
783 * result in impossible-to-diagnose memory corruption. As in the structures
784 * will look OK in crash dumps, but any concurrent RCU readers might
785 * see pre-initialized values of the referenced data structure. So
786 * please be very careful how you use RCU_INIT_POINTER()!!!
787 *
788 * If you are creating an RCU-protected linked structure that is accessed
789 * by a single external-to-structure RCU-protected pointer, then you may
790 * use RCU_INIT_POINTER() to initialize the internal RCU-protected
791 * pointers, but you must use rcu_assign_pointer() to initialize the
792 * external-to-structure pointer -after- you have completely initialized
793 * the reader-accessible portions of the linked structure.
715 */ 794 */
716#define RCU_INIT_POINTER(p, v) \ 795#define RCU_INIT_POINTER(p, v) \
717 p = (typeof(*v) __force __rcu *)(v) 796 p = (typeof(*v) __force __rcu *)(v)
718 797
719/* Infrastructure to implement the synchronize_() primitives. */
720
721struct rcu_synchronize {
722 struct rcu_head head;
723 struct completion completion;
724};
725
726extern void wakeme_after_rcu(struct rcu_head *head);
727
728#ifdef CONFIG_PREEMPT_RCU
729
730/**
731 * call_rcu() - Queue an RCU callback for invocation after a grace period.
732 * @head: structure to be used for queueing the RCU updates.
733 * @func: actual callback function to be invoked after the grace period
734 *
735 * The callback function will be invoked some time after a full grace
736 * period elapses, in other words after all pre-existing RCU read-side
737 * critical sections have completed. However, the callback function
738 * might well execute concurrently with RCU read-side critical sections
739 * that started after call_rcu() was invoked. RCU read-side critical
740 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
741 * and may be nested.
742 */
743extern void call_rcu(struct rcu_head *head,
744 void (*func)(struct rcu_head *head));
745
746#else /* #ifdef CONFIG_PREEMPT_RCU */
747
748/* In classic RCU, call_rcu() is just call_rcu_sched(). */
749#define call_rcu call_rcu_sched
750
751#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
752
753/**
754 * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period.
755 * @head: structure to be used for queueing the RCU updates.
756 * @func: actual callback function to be invoked after the grace period
757 *
758 * The callback function will be invoked some time after a full grace
759 * period elapses, in other words after all currently executing RCU
760 * read-side critical sections have completed. call_rcu_bh() assumes
761 * that the read-side critical sections end on completion of a softirq
762 * handler. This means that read-side critical sections in process
763 * context must not be interrupted by softirqs. This interface is to be
764 * used when most of the read-side critical sections are in softirq context.
765 * RCU read-side critical sections are delimited by :
766 * - rcu_read_lock() and rcu_read_unlock(), if in interrupt context.
767 * OR
768 * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context.
769 * These may be nested.
770 */
771extern void call_rcu_bh(struct rcu_head *head,
772 void (*func)(struct rcu_head *head));
773
774/*
775 * debug_rcu_head_queue()/debug_rcu_head_unqueue() are used internally
776 * by call_rcu() and rcu callback execution, and are therefore not part of the
777 * RCU API. Leaving in rcupdate.h because they are used by all RCU flavors.
778 */
779
780#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
781# define STATE_RCU_HEAD_READY 0
782# define STATE_RCU_HEAD_QUEUED 1
783
784extern struct debug_obj_descr rcuhead_debug_descr;
785
786static inline void debug_rcu_head_queue(struct rcu_head *head)
787{
788 WARN_ON_ONCE((unsigned long)head & 0x3);
789 debug_object_activate(head, &rcuhead_debug_descr);
790 debug_object_active_state(head, &rcuhead_debug_descr,
791 STATE_RCU_HEAD_READY,
792 STATE_RCU_HEAD_QUEUED);
793}
794
795static inline void debug_rcu_head_unqueue(struct rcu_head *head)
796{
797 debug_object_active_state(head, &rcuhead_debug_descr,
798 STATE_RCU_HEAD_QUEUED,
799 STATE_RCU_HEAD_READY);
800 debug_object_deactivate(head, &rcuhead_debug_descr);
801}
802#else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
803static inline void debug_rcu_head_queue(struct rcu_head *head)
804{
805}
806
807static inline void debug_rcu_head_unqueue(struct rcu_head *head)
808{
809}
810#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
811
812static __always_inline bool __is_kfree_rcu_offset(unsigned long offset) 798static __always_inline bool __is_kfree_rcu_offset(unsigned long offset)
813{ 799{
814 return offset < 4096; 800 return offset < 4096;
@@ -827,18 +813,6 @@ void __kfree_rcu(struct rcu_head *head, unsigned long offset)
827 call_rcu(head, (rcu_callback)offset); 813 call_rcu(head, (rcu_callback)offset);
828} 814}
829 815
830extern void kfree(const void *);
831
832static inline void __rcu_reclaim(struct rcu_head *head)
833{
834 unsigned long offset = (unsigned long)head->func;
835
836 if (__is_kfree_rcu_offset(offset))
837 kfree((void *)head - offset);
838 else
839 head->func(head);
840}
841
842/** 816/**
843 * kfree_rcu() - kfree an object after a grace period. 817 * kfree_rcu() - kfree an object after a grace period.
844 * @ptr: pointer to kfree 818 * @ptr: pointer to kfree
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 52b3e0281fd0..00b7a5e493d2 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -27,9 +27,23 @@
27 27
28#include <linux/cache.h> 28#include <linux/cache.h>
29 29
30#ifdef CONFIG_RCU_BOOST
30static inline void rcu_init(void) 31static inline void rcu_init(void)
31{ 32{
32} 33}
34#else /* #ifdef CONFIG_RCU_BOOST */
35void rcu_init(void);
36#endif /* #else #ifdef CONFIG_RCU_BOOST */
37
38static inline void rcu_barrier_bh(void)
39{
40 wait_rcu_gp(call_rcu_bh);
41}
42
43static inline void rcu_barrier_sched(void)
44{
45 wait_rcu_gp(call_rcu_sched);
46}
33 47
34#ifdef CONFIG_TINY_RCU 48#ifdef CONFIG_TINY_RCU
35 49
@@ -45,9 +59,13 @@ static inline void rcu_barrier(void)
45 59
46#else /* #ifdef CONFIG_TINY_RCU */ 60#else /* #ifdef CONFIG_TINY_RCU */
47 61
48void rcu_barrier(void);
49void synchronize_rcu_expedited(void); 62void synchronize_rcu_expedited(void);
50 63
64static inline void rcu_barrier(void)
65{
66 wait_rcu_gp(call_rcu);
67}
68
51#endif /* #else #ifdef CONFIG_TINY_RCU */ 69#endif /* #else #ifdef CONFIG_TINY_RCU */
52 70
53static inline void synchronize_rcu_bh(void) 71static inline void synchronize_rcu_bh(void)
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index e65d06634dd8..67458468f1a8 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -67,6 +67,8 @@ static inline void synchronize_rcu_bh_expedited(void)
67} 67}
68 68
69extern void rcu_barrier(void); 69extern void rcu_barrier(void);
70extern void rcu_barrier_bh(void);
71extern void rcu_barrier_sched(void);
70 72
71extern unsigned long rcutorture_testseq; 73extern unsigned long rcutorture_testseq;
72extern unsigned long rcutorture_vernum; 74extern unsigned long rcutorture_vernum;
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 003c05349ae5..690276a642cf 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -15,11 +15,19 @@
15 15
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/module.h>
19 18
19struct module;
20struct i2c_client; 20struct i2c_client;
21struct spi_device; 21struct spi_device;
22 22
23/* An enum of all the supported cache types */
24enum regcache_type {
25 REGCACHE_NONE,
26 REGCACHE_INDEXED,
27 REGCACHE_RBTREE,
28 REGCACHE_LZO
29};
30
23/** 31/**
24 * Default value for a register. We use an array of structs rather 32 * Default value for a register. We use an array of structs rather
25 * than a simple array as many modern devices have very sparse 33 * than a simple array as many modern devices have very sparse
@@ -59,6 +67,11 @@ struct reg_default {
59 * @write_flag_mask: Mask to be set in the top byte of the register when doing 67 * @write_flag_mask: Mask to be set in the top byte of the register when doing
60 * a write. If both read_flag_mask and write_flag_mask are 68 * a write. If both read_flag_mask and write_flag_mask are
61 * empty the regmap_bus default masks are used. 69 * empty the regmap_bus default masks are used.
70 *
71 * @cache_type: The actual cache type.
72 * @reg_defaults_raw: Power on reset values for registers (for use with
73 * register cache support).
74 * @num_reg_defaults_raw: Number of elements in reg_defaults_raw.
62 */ 75 */
63struct regmap_config { 76struct regmap_config {
64 int reg_bits; 77 int reg_bits;
@@ -71,7 +84,10 @@ struct regmap_config {
71 84
72 unsigned int max_register; 85 unsigned int max_register;
73 struct reg_default *reg_defaults; 86 struct reg_default *reg_defaults;
74 int num_reg_defaults; 87 unsigned int num_reg_defaults;
88 enum regcache_type cache_type;
89 const void *reg_defaults_raw;
90 unsigned int num_reg_defaults_raw;
75 91
76 u8 read_flag_mask; 92 u8 read_flag_mask;
77 u8 write_flag_mask; 93 u8 write_flag_mask;
@@ -89,25 +105,18 @@ typedef int (*regmap_hw_read)(struct device *dev,
89/** 105/**
90 * Description of a hardware bus for the register map infrastructure. 106 * Description of a hardware bus for the register map infrastructure.
91 * 107 *
92 * @list: Internal use.
93 * @type: Bus type, used to identify bus to be used for a device.
94 * @write: Write operation. 108 * @write: Write operation.
95 * @gather_write: Write operation with split register/value, return -ENOTSUPP 109 * @gather_write: Write operation with split register/value, return -ENOTSUPP
96 * if not implemented on a given device. 110 * if not implemented on a given device.
97 * @read: Read operation. Data is returned in the buffer used to transmit 111 * @read: Read operation. Data is returned in the buffer used to transmit
98 * data. 112 * data.
99 * @owner: Module with the bus implementation, used to pin the implementation
100 * in memory.
101 * @read_flag_mask: Mask to be set in the top byte of the register when doing 113 * @read_flag_mask: Mask to be set in the top byte of the register when doing
102 * a read. 114 * a read.
103 */ 115 */
104struct regmap_bus { 116struct regmap_bus {
105 struct list_head list;
106 struct bus_type *type;
107 regmap_hw_write write; 117 regmap_hw_write write;
108 regmap_hw_gather_write gather_write; 118 regmap_hw_gather_write gather_write;
109 regmap_hw_read read; 119 regmap_hw_read read;
110 struct module *owner;
111 u8 read_flag_mask; 120 u8 read_flag_mask;
112}; 121};
113 122
@@ -131,4 +140,8 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
131int regmap_update_bits(struct regmap *map, unsigned int reg, 140int regmap_update_bits(struct regmap *map, unsigned int reg,
132 unsigned int mask, unsigned int val); 141 unsigned int mask, unsigned int val);
133 142
143int regcache_sync(struct regmap *map);
144void regcache_cache_only(struct regmap *map, bool enable);
145void regcache_cache_bypass(struct regmap *map, bool enable);
146
134#endif 147#endif
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 6fae97a6ce7d..f7756d146c61 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -123,7 +123,7 @@ struct regulator_bulk_data {
123 const char *supply; 123 const char *supply;
124 struct regulator *consumer; 124 struct regulator *consumer;
125 125
126 /* Internal use */ 126 /* private: Internal use */
127 int ret; 127 int ret;
128}; 128};
129 129
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 12a1aa04b720..52c89ae32f64 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -16,6 +16,7 @@
16#define __LINUX_REGULATOR_DRIVER_H_ 16#define __LINUX_REGULATOR_DRIVER_H_
17 17
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/notifier.h>
19#include <linux/regulator/consumer.h> 20#include <linux/regulator/consumer.h>
20 21
21struct regulator_dev; 22struct regulator_dev;
diff --git a/include/linux/regulator/gpio-regulator.h b/include/linux/regulator/gpio-regulator.h
new file mode 100644
index 000000000000..19fbd267406d
--- /dev/null
+++ b/include/linux/regulator/gpio-regulator.h
@@ -0,0 +1,87 @@
1/*
2 * gpio-regulator.h
3 *
4 * Copyright 2011 Heiko Stuebner <heiko@sntech.de>
5 *
6 * based on fixed.h
7 *
8 * Copyright 2008 Wolfson Microelectronics PLC.
9 *
10 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
11 *
12 * Copyright (c) 2009 Nokia Corporation
13 * Roger Quadros <ext-roger.quadros@nokia.com>
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of the
18 * License, or (at your option) any later version.
19 */
20
21#ifndef __REGULATOR_GPIO_H
22#define __REGULATOR_GPIO_H
23
24struct regulator_init_data;
25
26enum regulator_type;
27
28/**
29 * struct gpio_regulator_state - state description
30 * @value: microvolts or microamps
31 * @gpios: bitfield of gpio target-states for the value
32 *
33 * This structure describes a supported setting of the regulator
34 * and the necessary gpio-state to achieve it.
35 *
36 * The n-th bit in the bitfield describes the state of the n-th GPIO
37 * from the gpios-array defined in gpio_regulator_config below.
38 */
39struct gpio_regulator_state {
40 int value;
41 int gpios;
42};
43
44/**
45 * struct gpio_regulator_config - config structure
46 * @supply_name: Name of the regulator supply
47 * @enable_gpio: GPIO to use for enable control
48 * set to -EINVAL if not used
49 * @enable_high: Polarity of enable GPIO
50 * 1 = Active high, 0 = Active low
51 * @enabled_at_boot: Whether regulator has been enabled at
52 * boot or not. 1 = Yes, 0 = No
53 * This is used to keep the regulator at
54 * the default state
55 * @startup_delay: Start-up time in microseconds
56 * @gpios: Array containing the gpios needed to control
57 * the setting of the regulator
58 * @nr_gpios: Number of gpios
59 * @states: Array of gpio_regulator_state entries describing
60 * the gpio state for specific voltages
61 * @nr_states: Number of states available
62 * @regulator_type: either REGULATOR_CURRENT or REGULATOR_VOLTAGE
63 * @init_data: regulator_init_data
64 *
65 * This structure contains gpio-voltage regulator configuration
66 * information that must be passed by platform code to the
67 * gpio-voltage regulator driver.
68 */
69struct gpio_regulator_config {
70 const char *supply_name;
71
72 int enable_gpio;
73 unsigned enable_high:1;
74 unsigned enabled_at_boot:1;
75 unsigned startup_delay;
76
77 struct gpio *gpios;
78 int nr_gpios;
79
80 struct gpio_regulator_state *states;
81 int nr_states;
82
83 enum regulator_type type;
84 struct regulator_init_data *init_data;
85};
86
87#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index ce3127a75c88..f3f13fd5868f 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -95,7 +95,7 @@ struct regulator_state {
95 */ 95 */
96struct regulation_constraints { 96struct regulation_constraints {
97 97
98 char *name; 98 const char *name;
99 99
100 /* voltage output range (inclusive) - for voltage control */ 100 /* voltage output range (inclusive) - for voltage control */
101 int min_uV; 101 int min_uV;
diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h
index a175d0598033..4d09f6eab359 100644
--- a/include/linux/rfkill-gpio.h
+++ b/include/linux/rfkill-gpio.h
@@ -30,6 +30,8 @@
30 * @reset_gpio: GPIO which is used for reseting rfkill switch 30 * @reset_gpio: GPIO which is used for reseting rfkill switch
31 * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch 31 * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch
32 * @power_clk_name: [optional] name of clk to turn off while blocked 32 * @power_clk_name: [optional] name of clk to turn off while blocked
33 * @gpio_runtime_close: clean up platform specific gpio configuration
34 * @gpio_runtime_setup: set up platform specific gpio configuration
33 */ 35 */
34 36
35struct rfkill_gpio_platform_data { 37struct rfkill_gpio_platform_data {
@@ -38,6 +40,8 @@ struct rfkill_gpio_platform_data {
38 int shutdown_gpio; 40 int shutdown_gpio;
39 const char *power_clk_name; 41 const char *power_clk_name;
40 enum rfkill_type type; 42 enum rfkill_type type;
43 void (*gpio_runtime_close)(struct platform_device *);
44 int (*gpio_runtime_setup)(struct platform_device *);
41}; 45};
42 46
43#endif /* __RFKILL_GPIO_H */ 47#endif /* __RFKILL_GPIO_H */
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index b891de96000f..67be0376d8e3 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -154,6 +154,8 @@ void ring_buffer_record_enable(struct ring_buffer *buffer);
154void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu); 154void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu);
155void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu); 155void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu);
156 156
157unsigned long ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu);
158unsigned long ring_buffer_bytes_cpu(struct ring_buffer *buffer, int cpu);
157unsigned long ring_buffer_entries(struct ring_buffer *buffer); 159unsigned long ring_buffer_entries(struct ring_buffer *buffer);
158unsigned long ring_buffer_overruns(struct ring_buffer *buffer); 160unsigned long ring_buffer_overruns(struct ring_buffer *buffer);
159unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); 161unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu);
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
index 0cee0152aca9..b66d13d1bdc0 100644
--- a/include/linux/rio_ids.h
+++ b/include/linux/rio_ids.h
@@ -39,5 +39,6 @@
39#define RIO_DID_IDTCPS1616 0x0379 39#define RIO_DID_IDTCPS1616 0x0379
40#define RIO_DID_IDTVPS1616 0x0377 40#define RIO_DID_IDTVPS1616 0x0377
41#define RIO_DID_IDTSPS1616 0x0378 41#define RIO_DID_IDTSPS1616 0x0378
42#define RIO_DID_TSI721 0x80ab
42 43
43#endif /* LINUX_RIO_IDS_H */ 44#endif /* LINUX_RIO_IDS_H */
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
index 9026b30238f3..218168a2b5e9 100644
--- a/include/linux/rio_regs.h
+++ b/include/linux/rio_regs.h
@@ -36,12 +36,12 @@
36#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */ 36#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */
37#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */ 37#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */
38#define RIO_PEF_MULTIPORT 0x08000000 /* [VI, 2.1] Multiport */ 38#define RIO_PEF_MULTIPORT 0x08000000 /* [VI, 2.1] Multiport */
39#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */ 39#define RIO_PEF_INB_MBOX 0x00f00000 /* [II, <= 1.2] Mailboxes */
40#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */ 40#define RIO_PEF_INB_MBOX0 0x00800000 /* [II, <= 1.2] Mailbox 0 */
41#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */ 41#define RIO_PEF_INB_MBOX1 0x00400000 /* [II, <= 1.2] Mailbox 1 */
42#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */ 42#define RIO_PEF_INB_MBOX2 0x00200000 /* [II, <= 1.2] Mailbox 2 */
43#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */ 43#define RIO_PEF_INB_MBOX3 0x00100000 /* [II, <= 1.2] Mailbox 3 */
44#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */ 44#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II, <= 1.2] Doorbells */
45#define RIO_PEF_EXT_RT 0x00000200 /* [III, 1.3] Extended route table support */ 45#define RIO_PEF_EXT_RT 0x00000200 /* [III, 1.3] Extended route table support */
46#define RIO_PEF_STD_RT 0x00000100 /* [III, 1.3] Standard route table support */ 46#define RIO_PEF_STD_RT 0x00000100 /* [III, 1.3] Standard route table support */
47#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */ 47#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */
@@ -102,7 +102,7 @@
102#define RIO_SWITCH_RT_LIMIT 0x34 /* [III, 1.3] Switch Route Table Destination ID Limit CAR */ 102#define RIO_SWITCH_RT_LIMIT 0x34 /* [III, 1.3] Switch Route Table Destination ID Limit CAR */
103#define RIO_RT_MAX_DESTID 0x0000ffff 103#define RIO_RT_MAX_DESTID 0x0000ffff
104 104
105#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */ 105#define RIO_MBOX_CSR 0x40 /* [II, <= 1.2] Mailbox CSR */
106#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */ 106#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */
107#define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */ 107#define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */
108#define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */ 108#define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */
@@ -128,8 +128,8 @@
128#define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */ 128#define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */
129#define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */ 129#define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */
130 130
131#define RIO_WRITE_PORT_CSR 0x44 /* [I] Write Port CSR */ 131#define RIO_WRITE_PORT_CSR 0x44 /* [I, <= 1.2] Write Port CSR */
132#define RIO_DOORBELL_CSR 0x44 /* [II] Doorbell CSR */ 132#define RIO_DOORBELL_CSR 0x44 /* [II, <= 1.2] Doorbell CSR */
133#define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */ 133#define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */
134#define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */ 134#define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */
135#define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */ 135#define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */
diff --git a/include/linux/rose.h b/include/linux/rose.h
index c7b4b184c82e..1fcfe95893b8 100644
--- a/include/linux/rose.h
+++ b/include/linux/rose.h
@@ -7,6 +7,9 @@
7#ifndef ROSE_KERNEL_H 7#ifndef ROSE_KERNEL_H
8#define ROSE_KERNEL_H 8#define ROSE_KERNEL_H
9 9
10#include <linux/socket.h>
11#include <linux/ax25.h>
12
10#define ROSE_MTU 251 13#define ROSE_MTU 251
11 14
12#define ROSE_MAX_DIGIS 6 15#define ROSE_MAX_DIGIS 6
@@ -44,7 +47,7 @@ typedef struct {
44} rose_address; 47} rose_address;
45 48
46struct sockaddr_rose { 49struct sockaddr_rose {
47 sa_family_t srose_family; 50 __kernel_sa_family_t srose_family;
48 rose_address srose_addr; 51 rose_address srose_addr;
49 ax25_address srose_call; 52 ax25_address srose_call;
50 int srose_ndigis; 53 int srose_ndigis;
@@ -52,7 +55,7 @@ struct sockaddr_rose {
52}; 55};
53 56
54struct full_sockaddr_rose { 57struct full_sockaddr_rose {
55 sa_family_t srose_family; 58 __kernel_sa_family_t srose_family;
56 rose_address srose_addr; 59 rose_address srose_addr;
57 ax25_address srose_call; 60 ax25_address srose_call;
58 unsigned int srose_ndigis; 61 unsigned int srose_ndigis;
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index b27ebea25660..93f4d035076b 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -97,6 +97,9 @@ struct rtc_pll_info {
97#define RTC_AF 0x20 /* Alarm interrupt */ 97#define RTC_AF 0x20 /* Alarm interrupt */
98#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */ 98#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */
99 99
100
101#define RTC_MAX_FREQ 8192
102
100#ifdef __KERNEL__ 103#ifdef __KERNEL__
101 104
102#include <linux/types.h> 105#include <linux/types.h>
diff --git a/include/linux/rtc/sirfsoc_rtciobrg.h b/include/linux/rtc/sirfsoc_rtciobrg.h
new file mode 100644
index 000000000000..2c92e1c8e055
--- /dev/null
+++ b/include/linux/rtc/sirfsoc_rtciobrg.h
@@ -0,0 +1,18 @@
1/*
2 * RTC I/O Bridge interfaces for CSR SiRFprimaII
3 * ARM access the registers of SYSRTC, GPSRTC and PWRC through this module
4 *
5 * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
6 *
7 * Licensed under GPLv2 or later.
8 */
9#ifndef _SIRFSOC_RTC_IOBRG_H_
10#define _SIRFSOC_RTC_IOBRG_H_
11
12extern void sirfsoc_rtc_iobrg_besyncing(void);
13
14extern u32 sirfsoc_rtc_iobrg_readl(u32 addr);
15
16extern void sirfsoc_rtc_iobrg_writel(u32 val, u32 addr);
17
18#endif
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h
index 34701241b673..d5b13bc07a0b 100644
--- a/include/linux/rwsem-spinlock.h
+++ b/include/linux/rwsem-spinlock.h
@@ -22,7 +22,7 @@
22 */ 22 */
23struct rw_semaphore { 23struct rw_semaphore {
24 __s32 activity; 24 __s32 activity;
25 spinlock_t wait_lock; 25 raw_spinlock_t wait_lock;
26 struct list_head wait_list; 26 struct list_head wait_list;
27#ifdef CONFIG_DEBUG_LOCK_ALLOC 27#ifdef CONFIG_DEBUG_LOCK_ALLOC
28 struct lockdep_map dep_map; 28 struct lockdep_map dep_map;
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 6a6741440cb7..63d406554391 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -25,7 +25,7 @@ struct rw_semaphore;
25/* All arch specific implementations share the same struct */ 25/* All arch specific implementations share the same struct */
26struct rw_semaphore { 26struct rw_semaphore {
27 long count; 27 long count;
28 spinlock_t wait_lock; 28 raw_spinlock_t wait_lock;
29 struct list_head wait_list; 29 struct list_head wait_list;
30#ifdef CONFIG_DEBUG_LOCK_ALLOC 30#ifdef CONFIG_DEBUG_LOCK_ALLOC
31 struct lockdep_map dep_map; 31 struct lockdep_map dep_map;
@@ -56,9 +56,11 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem)
56# define __RWSEM_DEP_MAP_INIT(lockname) 56# define __RWSEM_DEP_MAP_INIT(lockname)
57#endif 57#endif
58 58
59#define __RWSEM_INITIALIZER(name) \ 59#define __RWSEM_INITIALIZER(name) \
60 { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED(name.wait_lock), \ 60 { RWSEM_UNLOCKED_VALUE, \
61 LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } 61 __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \
62 LIST_HEAD_INIT((name).wait_list) \
63 __RWSEM_DEP_MAP_INIT(name) }
62 64
63#define DECLARE_RWSEM(name) \ 65#define DECLARE_RWSEM(name) \
64 struct rw_semaphore name = __RWSEM_INITIALIZER(name) 66 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 20b03bf94748..68daf4f27e2c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -90,6 +90,7 @@ struct sched_param {
90#include <linux/task_io_accounting.h> 90#include <linux/task_io_accounting.h>
91#include <linux/latencytop.h> 91#include <linux/latencytop.h>
92#include <linux/cred.h> 92#include <linux/cred.h>
93#include <linux/llist.h>
93 94
94#include <asm/processor.h> 95#include <asm/processor.h>
95 96
@@ -270,7 +271,6 @@ extern void init_idle_bootup_task(struct task_struct *idle);
270 271
271extern int runqueue_is_locked(int cpu); 272extern int runqueue_is_locked(int cpu);
272 273
273extern cpumask_var_t nohz_cpu_mask;
274#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 274#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
275extern void select_nohz_load_balancer(int stop_tick); 275extern void select_nohz_load_balancer(int stop_tick);
276extern int get_nohz_timer_target(void); 276extern int get_nohz_timer_target(void);
@@ -510,7 +510,7 @@ struct task_cputime {
510struct thread_group_cputimer { 510struct thread_group_cputimer {
511 struct task_cputime cputime; 511 struct task_cputime cputime;
512 int running; 512 int running;
513 spinlock_t lock; 513 raw_spinlock_t lock;
514}; 514};
515 515
516#include <linux/rwsem.h> 516#include <linux/rwsem.h>
@@ -1225,7 +1225,7 @@ struct task_struct {
1225 unsigned int ptrace; 1225 unsigned int ptrace;
1226 1226
1227#ifdef CONFIG_SMP 1227#ifdef CONFIG_SMP
1228 struct task_struct *wake_entry; 1228 struct llist_node wake_entry;
1229 int on_cpu; 1229 int on_cpu;
1230#endif 1230#endif
1231 int on_rq; 1231 int on_rq;
@@ -1260,9 +1260,6 @@ struct task_struct {
1260#ifdef CONFIG_PREEMPT_RCU 1260#ifdef CONFIG_PREEMPT_RCU
1261 int rcu_read_lock_nesting; 1261 int rcu_read_lock_nesting;
1262 char rcu_read_unlock_special; 1262 char rcu_read_unlock_special;
1263#if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU)
1264 int rcu_boosted;
1265#endif /* #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) */
1266 struct list_head rcu_node_entry; 1263 struct list_head rcu_node_entry;
1267#endif /* #ifdef CONFIG_PREEMPT_RCU */ 1264#endif /* #ifdef CONFIG_PREEMPT_RCU */
1268#ifdef CONFIG_TREE_PREEMPT_RCU 1265#ifdef CONFIG_TREE_PREEMPT_RCU
@@ -1525,6 +1522,13 @@ struct task_struct {
1525 int make_it_fail; 1522 int make_it_fail;
1526#endif 1523#endif
1527 struct prop_local_single dirties; 1524 struct prop_local_single dirties;
1525 /*
1526 * when (nr_dirtied >= nr_dirtied_pause), it's time to call
1527 * balance_dirty_pages() for some dirty throttling pause
1528 */
1529 int nr_dirtied;
1530 int nr_dirtied_pause;
1531
1528#ifdef CONFIG_LATENCYTOP 1532#ifdef CONFIG_LATENCYTOP
1529 int latency_record_count; 1533 int latency_record_count;
1530 struct latency_record latency_record[LT_SAVECOUNT]; 1534 struct latency_record latency_record[LT_SAVECOUNT];
@@ -1767,6 +1771,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1767#define PF_DUMPCORE 0x00000200 /* dumped core */ 1771#define PF_DUMPCORE 0x00000200 /* dumped core */
1768#define PF_SIGNALED 0x00000400 /* killed by a signal */ 1772#define PF_SIGNALED 0x00000400 /* killed by a signal */
1769#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1773#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1774#define PF_NPROC_EXCEEDED 0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */
1770#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1775#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1771#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ 1776#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
1772#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1777#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
@@ -1955,7 +1960,6 @@ static inline void disable_sched_clock_irqtime(void) {}
1955 1960
1956extern unsigned long long 1961extern unsigned long long
1957task_sched_runtime(struct task_struct *task); 1962task_sched_runtime(struct task_struct *task);
1958extern unsigned long long thread_group_sched_runtime(struct task_struct *task);
1959 1963
1960/* sched_exec is called by processes performing an exec */ 1964/* sched_exec is called by processes performing an exec */
1961#ifdef CONFIG_SMP 1965#ifdef CONFIG_SMP
@@ -2039,6 +2043,10 @@ static inline void sched_autogroup_fork(struct signal_struct *sig) { }
2039static inline void sched_autogroup_exit(struct signal_struct *sig) { } 2043static inline void sched_autogroup_exit(struct signal_struct *sig) { }
2040#endif 2044#endif
2041 2045
2046#ifdef CONFIG_CFS_BANDWIDTH
2047extern unsigned int sysctl_sched_cfs_bandwidth_slice;
2048#endif
2049
2042#ifdef CONFIG_RT_MUTEXES 2050#ifdef CONFIG_RT_MUTEXES
2043extern int rt_mutex_getprio(struct task_struct *p); 2051extern int rt_mutex_getprio(struct task_struct *p);
2044extern void rt_mutex_setprio(struct task_struct *p, int prio); 2052extern void rt_mutex_setprio(struct task_struct *p, int prio);
@@ -2165,7 +2173,8 @@ extern int force_sigsegv(int, struct task_struct *);
2165extern int force_sig_info(int, struct siginfo *, struct task_struct *); 2173extern int force_sig_info(int, struct siginfo *, struct task_struct *);
2166extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); 2174extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
2167extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); 2175extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
2168extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); 2176extern int kill_pid_info_as_cred(int, struct siginfo *, struct pid *,
2177 const struct cred *, u32);
2169extern int kill_pgrp(struct pid *pid, int sig, int priv); 2178extern int kill_pgrp(struct pid *pid, int sig, int priv);
2170extern int kill_pid(struct pid *pid, int sig, int priv); 2179extern int kill_pid(struct pid *pid, int sig, int priv);
2171extern int kill_proc_info(int, struct siginfo *, pid_t); 2180extern int kill_proc_info(int, struct siginfo *, pid_t);
@@ -2565,7 +2574,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
2565 2574
2566static inline void thread_group_cputime_init(struct signal_struct *sig) 2575static inline void thread_group_cputime_init(struct signal_struct *sig)
2567{ 2576{
2568 spin_lock_init(&sig->cputimer.lock); 2577 raw_spin_lock_init(&sig->cputimer.lock);
2569} 2578}
2570 2579
2571/* 2580/*
diff --git a/include/linux/security.h b/include/linux/security.h
index ebd2a53a3d07..19d8e04e1688 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -36,6 +36,7 @@
36#include <linux/key.h> 36#include <linux/key.h>
37#include <linux/xfrm.h> 37#include <linux/xfrm.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/xattr.h>
39#include <net/flow.h> 40#include <net/flow.h>
40 41
41/* Maximum number of letters for an LSM name string */ 42/* Maximum number of letters for an LSM name string */
@@ -147,6 +148,10 @@ extern int mmap_min_addr_handler(struct ctl_table *table, int write,
147 void __user *buffer, size_t *lenp, loff_t *ppos); 148 void __user *buffer, size_t *lenp, loff_t *ppos);
148#endif 149#endif
149 150
151/* security_inode_init_security callback function to write xattrs */
152typedef int (*initxattrs) (struct inode *inode,
153 const struct xattr *xattr_array, void *fs_data);
154
150#ifdef CONFIG_SECURITY 155#ifdef CONFIG_SECURITY
151 156
152struct security_mnt_opts { 157struct security_mnt_opts {
@@ -1367,7 +1372,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1367 * @inode_getsecctx: 1372 * @inode_getsecctx:
1368 * Returns a string containing all relavent security context information 1373 * Returns a string containing all relavent security context information
1369 * 1374 *
1370 * @inode we wish to set the security context of. 1375 * @inode we wish to get the security context of.
1371 * @ctx is a pointer in which to place the allocated security context. 1376 * @ctx is a pointer in which to place the allocated security context.
1372 * @ctxlen points to the place to put the length of @ctx. 1377 * @ctxlen points to the place to put the length of @ctx.
1373 * This is the main security structure. 1378 * This is the main security structure.
@@ -1655,6 +1660,8 @@ struct security_operations {
1655extern int security_init(void); 1660extern int security_init(void);
1656extern int security_module_enable(struct security_operations *ops); 1661extern int security_module_enable(struct security_operations *ops);
1657extern int register_security(struct security_operations *ops); 1662extern int register_security(struct security_operations *ops);
1663extern void __init security_fixup_ops(struct security_operations *ops);
1664
1658 1665
1659/* Security operations */ 1666/* Security operations */
1660int security_ptrace_access_check(struct task_struct *child, unsigned int mode); 1667int security_ptrace_access_check(struct task_struct *child, unsigned int mode);
@@ -1704,8 +1711,11 @@ int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts);
1704int security_inode_alloc(struct inode *inode); 1711int security_inode_alloc(struct inode *inode);
1705void security_inode_free(struct inode *inode); 1712void security_inode_free(struct inode *inode);
1706int security_inode_init_security(struct inode *inode, struct inode *dir, 1713int security_inode_init_security(struct inode *inode, struct inode *dir,
1707 const struct qstr *qstr, char **name, 1714 const struct qstr *qstr,
1708 void **value, size_t *len); 1715 initxattrs initxattrs, void *fs_data);
1716int security_old_inode_init_security(struct inode *inode, struct inode *dir,
1717 const struct qstr *qstr, char **name,
1718 void **value, size_t *len);
1709int security_inode_create(struct inode *dir, struct dentry *dentry, int mode); 1719int security_inode_create(struct inode *dir, struct dentry *dentry, int mode);
1710int security_inode_link(struct dentry *old_dentry, struct inode *dir, 1720int security_inode_link(struct dentry *old_dentry, struct inode *dir,
1711 struct dentry *new_dentry); 1721 struct dentry *new_dentry);
@@ -2034,11 +2044,19 @@ static inline void security_inode_free(struct inode *inode)
2034static inline int security_inode_init_security(struct inode *inode, 2044static inline int security_inode_init_security(struct inode *inode,
2035 struct inode *dir, 2045 struct inode *dir,
2036 const struct qstr *qstr, 2046 const struct qstr *qstr,
2037 char **name, 2047 initxattrs initxattrs,
2038 void **value, 2048 void *fs_data)
2039 size_t *len)
2040{ 2049{
2041 return -EOPNOTSUPP; 2050 return 0;
2051}
2052
2053static inline int security_old_inode_init_security(struct inode *inode,
2054 struct inode *dir,
2055 const struct qstr *qstr,
2056 char **name, void **value,
2057 size_t *len)
2058{
2059 return 0;
2042} 2060}
2043 2061
2044static inline int security_inode_create(struct inode *dir, 2062static inline int security_inode_create(struct inode *dir,
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 1feb2de2ee57..10d6b226afc5 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -83,13 +83,6 @@ struct seminfo {
83 83
84struct task_struct; 84struct task_struct;
85 85
86/* One semaphore structure for each semaphore in the system. */
87struct sem {
88 int semval; /* current value */
89 int sempid; /* pid of last operation */
90 struct list_head sem_pending; /* pending single-sop operations */
91};
92
93/* One sem_array data structure for each set of semaphores in the system. */ 86/* One sem_array data structure for each set of semaphores in the system. */
94struct sem_array { 87struct sem_array {
95 struct kern_ipc_perm ____cacheline_aligned_in_smp 88 struct kern_ipc_perm ____cacheline_aligned_in_smp
@@ -103,51 +96,21 @@ struct sem_array {
103 int complex_count; /* pending complex operations */ 96 int complex_count; /* pending complex operations */
104}; 97};
105 98
106/* One queue for each sleeping process in the system. */ 99#ifdef CONFIG_SYSVIPC
107struct sem_queue {
108 struct list_head simple_list; /* queue of pending operations */
109 struct list_head list; /* queue of pending operations */
110 struct task_struct *sleeper; /* this process */
111 struct sem_undo *undo; /* undo structure */
112 int pid; /* process id of requesting process */
113 int status; /* completion status of operation */
114 struct sembuf *sops; /* array of pending operations */
115 int nsops; /* number of operations */
116 int alter; /* does the operation alter the array? */
117};
118
119/* Each task has a list of undo requests. They are executed automatically
120 * when the process exits.
121 */
122struct sem_undo {
123 struct list_head list_proc; /* per-process list: all undos from one process. */
124 /* rcu protected */
125 struct rcu_head rcu; /* rcu struct for sem_undo() */
126 struct sem_undo_list *ulp; /* sem_undo_list for the process */
127 struct list_head list_id; /* per semaphore array list: all undos for one array */
128 int semid; /* semaphore set identifier */
129 short * semadj; /* array of adjustments, one per semaphore */
130};
131
132/* sem_undo_list controls shared access to the list of sem_undo structures
133 * that may be shared among all a CLONE_SYSVSEM task group.
134 */
135struct sem_undo_list {
136 atomic_t refcnt;
137 spinlock_t lock;
138 struct list_head list_proc;
139};
140 100
141struct sysv_sem { 101struct sysv_sem {
142 struct sem_undo_list *undo_list; 102 struct sem_undo_list *undo_list;
143}; 103};
144 104
145#ifdef CONFIG_SYSVIPC
146
147extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk); 105extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
148extern void exit_sem(struct task_struct *tsk); 106extern void exit_sem(struct task_struct *tsk);
149 107
150#else 108#else
109
110struct sysv_sem {
111 /* empty */
112};
113
151static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) 114static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
152{ 115{
153 return 0; 116 return 0;
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h
index 39fa04966aa8..dc368b8ce215 100644
--- a/include/linux/semaphore.h
+++ b/include/linux/semaphore.h
@@ -14,14 +14,14 @@
14 14
15/* Please don't access any members of this structure directly */ 15/* Please don't access any members of this structure directly */
16struct semaphore { 16struct semaphore {
17 spinlock_t lock; 17 raw_spinlock_t lock;
18 unsigned int count; 18 unsigned int count;
19 struct list_head wait_list; 19 struct list_head wait_list;
20}; 20};
21 21
22#define __SEMAPHORE_INITIALIZER(name, n) \ 22#define __SEMAPHORE_INITIALIZER(name, n) \
23{ \ 23{ \
24 .lock = __SPIN_LOCK_UNLOCKED((name).lock), \ 24 .lock = __RAW_SPIN_LOCK_UNLOCKED((name).lock), \
25 .count = n, \ 25 .count = n, \
26 .wait_list = LIST_HEAD_INIT((name).wait_list), \ 26 .wait_list = LIST_HEAD_INIT((name).wait_list), \
27} 27}
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index be720cd2038d..0b69a4684216 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -84,8 +84,7 @@ int seq_putc(struct seq_file *m, char c);
84int seq_puts(struct seq_file *m, const char *s); 84int seq_puts(struct seq_file *m, const char *s);
85int seq_write(struct seq_file *seq, const void *data, size_t len); 85int seq_write(struct seq_file *seq, const void *data, size_t len);
86 86
87int seq_printf(struct seq_file *, const char *, ...) 87__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...);
88 __attribute__ ((format (printf,2,3)));
89 88
90int seq_path(struct seq_file *, struct path *, char *); 89int seq_path(struct seq_file *, struct path *, char *);
91int seq_dentry(struct seq_file *, struct dentry *, char *); 90int seq_dentry(struct seq_file *, struct dentry *, char *);
diff --git a/include/linux/serial.h b/include/linux/serial.h
index ef914061511e..97ff8e27a6cc 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -211,6 +211,7 @@ struct serial_rs485 {
211#define SER_RS485_RTS_ON_SEND (1 << 1) 211#define SER_RS485_RTS_ON_SEND (1 << 1)
212#define SER_RS485_RTS_AFTER_SEND (1 << 2) 212#define SER_RS485_RTS_AFTER_SEND (1 << 2)
213#define SER_RS485_RTS_BEFORE_SEND (1 << 3) 213#define SER_RS485_RTS_BEFORE_SEND (1 << 3)
214#define SER_RS485_RX_DURING_TX (1 << 4)
214 __u32 delay_rts_before_send; /* Milliseconds */ 215 __u32 delay_rts_before_send; /* Milliseconds */
215 __u32 delay_rts_after_send; /* Milliseconds */ 216 __u32 delay_rts_after_send; /* Milliseconds */
216 __u32 padding[5]; /* Memory is cheap, new structs 217 __u32 padding[5]; /* Memory is cheap, new structs
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 97f5b45bbc07..1f05bbeac01e 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -35,6 +35,7 @@ struct plat_serial8250_port {
35 void (*set_termios)(struct uart_port *, 35 void (*set_termios)(struct uart_port *,
36 struct ktermios *new, 36 struct ktermios *new,
37 struct ktermios *old); 37 struct ktermios *old);
38 int (*handle_irq)(struct uart_port *);
38 void (*pm)(struct uart_port *, unsigned int state, 39 void (*pm)(struct uart_port *, unsigned int state,
39 unsigned old); 40 unsigned old);
40}; 41};
@@ -80,6 +81,7 @@ extern void serial8250_do_set_termios(struct uart_port *port,
80 struct ktermios *termios, struct ktermios *old); 81 struct ktermios *termios, struct ktermios *old);
81extern void serial8250_do_pm(struct uart_port *port, unsigned int state, 82extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
82 unsigned int oldstate); 83 unsigned int oldstate);
84int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
83 85
84extern void serial8250_set_isa_configurator(void (*v) 86extern void serial8250_set_isa_configurator(void (*v)
85 (int port, struct uart_port *up, 87 (int port, struct uart_port *up,
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index a5c31146a337..eadf33d0abba 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -46,7 +46,8 @@
46#define PORT_AR7 18 /* Texas Instruments AR7 internal UART */ 46#define PORT_AR7 18 /* Texas Instruments AR7 internal UART */
47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */ 47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */
48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */ 48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */
49#define PORT_MAX_8250 20 /* max port ID */ 49#define PORT_XR17D15X 21 /* Exar XR17D15x UART */
50#define PORT_MAX_8250 21 /* max port ID */
50 51
51/* 52/*
52 * ARM specific type numbers. These are not currently guaranteed 53 * ARM specific type numbers. These are not currently guaranteed
@@ -300,6 +301,7 @@ struct uart_port {
300 void (*set_termios)(struct uart_port *, 301 void (*set_termios)(struct uart_port *,
301 struct ktermios *new, 302 struct ktermios *new,
302 struct ktermios *old); 303 struct ktermios *old);
304 int (*handle_irq)(struct uart_port *);
303 void (*pm)(struct uart_port *, unsigned int state, 305 void (*pm)(struct uart_port *, unsigned int state,
304 unsigned int old); 306 unsigned int old);
305 unsigned int irq; /* irq number */ 307 unsigned int irq; /* irq number */
@@ -317,9 +319,7 @@ struct uart_port {
317#define UPIO_MEM32 (3) 319#define UPIO_MEM32 (3)
318#define UPIO_AU (4) /* Au1x00 type IO */ 320#define UPIO_AU (4) /* Au1x00 type IO */
319#define UPIO_TSI (5) /* Tsi108/109 type IO */ 321#define UPIO_TSI (5) /* Tsi108/109 type IO */
320#define UPIO_DWAPB (6) /* DesignWare APB UART */ 322#define UPIO_RM9000 (6) /* RM9000 type IO */
321#define UPIO_RM9000 (7) /* RM9000 type IO */
322#define UPIO_DWAPB32 (8) /* DesignWare APB UART (32 bit accesses) */
323 323
324 unsigned int read_status_mask; /* driver specific */ 324 unsigned int read_status_mask; /* driver specific */
325 unsigned int ignore_status_mask; /* driver specific */ 325 unsigned int ignore_status_mask; /* driver specific */
@@ -350,6 +350,7 @@ struct uart_port {
350#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) 350#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
351#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 351#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
352#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 352#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
353#define UPF_EXAR_EFR ((__force upf_t) (1 << 25))
353/* The exact UART type is known and should not be probed. */ 354/* The exact UART type is known and should not be probed. */
354#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27)) 355#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
355#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 356#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
@@ -384,7 +385,6 @@ struct uart_state {
384 int pm_state; 385 int pm_state;
385 struct circ_buf xmit; 386 struct circ_buf xmit;
386 387
387 struct tasklet_struct tlet;
388 struct uart_port *uart_port; 388 struct uart_port *uart_port;
389}; 389};
390 390
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index c75bda37c18e..8ce70d76f836 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -152,6 +152,7 @@
152 * LCR=0xBF (or DLAB=1 for 16C660) 152 * LCR=0xBF (or DLAB=1 for 16C660)
153 */ 153 */
154#define UART_EFR 2 /* I/O: Extended Features Register */ 154#define UART_EFR 2 /* I/O: Extended Features Register */
155#define UART_XR_EFR 9 /* I/O: Extended Features Register (XR17D15x) */
155#define UART_EFR_CTS 0x80 /* CTS flow control */ 156#define UART_EFR_CTS 0x80 /* CTS flow control */
156#define UART_EFR_RTS 0x40 /* RTS flow control */ 157#define UART_EFR_RTS 0x40 /* RTS flow control */
157#define UART_EFR_SCD 0x20 /* Special character detect */ 158#define UART_EFR_SCD 0x20 /* Special character detect */
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 8bffe9ae2ca0..0efa1f10bc2b 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -131,8 +131,6 @@ struct plat_sci_port {
131 131
132 struct plat_sci_port_ops *ops; 132 struct plat_sci_port_ops *ops;
133 133
134 struct device *dma_dev;
135
136 unsigned int dma_slave_tx; 134 unsigned int dma_slave_tx;
137 unsigned int dma_slave_rx; 135 unsigned int dma_slave_rx;
138}; 136};
diff --git a/include/linux/serio.h b/include/linux/serio.h
index e26f4788845f..ca82861b0e46 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -79,19 +79,21 @@ void serio_reconnect(struct serio *serio);
79irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags); 79irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags);
80 80
81void __serio_register_port(struct serio *serio, struct module *owner); 81void __serio_register_port(struct serio *serio, struct module *owner);
82static inline void serio_register_port(struct serio *serio) 82
83{ 83/* use a define to avoid include chaining to get THIS_MODULE */
84 __serio_register_port(serio, THIS_MODULE); 84#define serio_register_port(serio) \
85} 85 __serio_register_port(serio, THIS_MODULE)
86 86
87void serio_unregister_port(struct serio *serio); 87void serio_unregister_port(struct serio *serio);
88void serio_unregister_child_port(struct serio *serio); 88void serio_unregister_child_port(struct serio *serio);
89 89
90int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name); 90int __must_check __serio_register_driver(struct serio_driver *drv,
91static inline int __must_check serio_register_driver(struct serio_driver *drv) 91 struct module *owner, const char *mod_name);
92{ 92
93 return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); 93/* use a define to avoid include chaining to get THIS_MODULE & friends */
94} 94#define serio_register_driver(drv) \
95 __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
96
95void serio_unregister_driver(struct serio_driver *drv); 97void serio_unregister_driver(struct serio_driver *drv);
96 98
97static inline int serio_write(struct serio *serio, unsigned char data) 99static inline int serio_write(struct serio *serio, unsigned char data)
@@ -199,5 +201,6 @@ static inline void serio_continue_rx(struct serio *serio)
199#define SERIO_DYNAPRO 0x3a 201#define SERIO_DYNAPRO 0x3a
200#define SERIO_HAMPSHIRE 0x3b 202#define SERIO_HAMPSHIRE 0x3b
201#define SERIO_PS2MULT 0x3c 203#define SERIO_PS2MULT 0x3c
204#define SERIO_TSC40 0x3d
202 205
203#endif 206#endif
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
new file mode 100644
index 000000000000..2076acf8294d
--- /dev/null
+++ b/include/linux/sh_eth.h
@@ -0,0 +1,25 @@
1#ifndef __ASM_SH_ETH_H__
2#define __ASM_SH_ETH_H__
3
4#include <linux/phy.h>
5
6enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
7enum {
8 SH_ETH_REG_GIGABIT,
9 SH_ETH_REG_FAST_SH4,
10 SH_ETH_REG_FAST_SH3_SH2
11};
12
13struct sh_eth_plat_data {
14 int phy;
15 int edmac_endian;
16 int register_type;
17 phy_interface_t phy_interface;
18 void (*set_mdio_gate)(void *addr);
19
20 unsigned char mac_addr[6];
21 unsigned no_ether_link:1;
22 unsigned ether_link_active_low:1;
23};
24
25#endif
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h
index 30cae70874f4..bc8c9208f7e2 100644
--- a/include/linux/sh_pfc.h
+++ b/include/linux/sh_pfc.h
@@ -61,6 +61,14 @@ struct pinmux_data_reg {
61 .reg = r, .reg_width = r_width, \ 61 .reg = r, .reg_width = r_width, \
62 .enum_ids = (pinmux_enum_t [r_width]) \ 62 .enum_ids = (pinmux_enum_t [r_width]) \
63 63
64struct pinmux_irq {
65 int irq;
66 pinmux_enum_t *enum_ids;
67};
68
69#define PINMUX_IRQ(irq_nr, ids...) \
70 { .irq = irq_nr, .enum_ids = (pinmux_enum_t []) { ids, 0 } } \
71
64struct pinmux_range { 72struct pinmux_range {
65 pinmux_enum_t begin; 73 pinmux_enum_t begin;
66 pinmux_enum_t end; 74 pinmux_enum_t end;
@@ -87,7 +95,9 @@ struct pinmux_info {
87 pinmux_enum_t *gpio_data; 95 pinmux_enum_t *gpio_data;
88 unsigned int gpio_data_size; 96 unsigned int gpio_data_size;
89 97
90 unsigned long *gpio_in_use; 98 struct pinmux_irq *gpio_irq;
99 unsigned int gpio_irq_size;
100
91 struct gpio_chip chip; 101 struct gpio_chip chip;
92}; 102};
93 103
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 790651b4e5ba..a83833a1f7a2 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -20,6 +20,7 @@ struct shrink_control {
20 * 'nr_to_scan' entries and attempt to free them up. It should return 20 * 'nr_to_scan' entries and attempt to free them up. It should return
21 * the number of objects which remain in the cache. If it returns -1, it means 21 * the number of objects which remain in the cache. If it returns -1, it means
22 * it cannot do any scanning at this time (eg. there is a risk of deadlock). 22 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
23 * The callback must not return -1 if nr_to_scan is zero.
23 * 24 *
24 * The 'gfpmask' refers to the allocation we are currently trying to 25 * The 'gfpmask' refers to the allocation we are currently trying to
25 * fulfil. 26 * fulfil.
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 7b996ed86d5b..fe864885c1ed 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -29,6 +29,7 @@
29#include <linux/rcupdate.h> 29#include <linux/rcupdate.h>
30#include <linux/dmaengine.h> 30#include <linux/dmaengine.h>
31#include <linux/hrtimer.h> 31#include <linux/hrtimer.h>
32#include <linux/dma-mapping.h>
32 33
33/* Don't change this without changing skb_csum_unnecessary! */ 34/* Don't change this without changing skb_csum_unnecessary! */
34#define CHECKSUM_NONE 0 35#define CHECKSUM_NONE 0
@@ -45,6 +46,11 @@
45#define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0)) 46#define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0))
46#define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2)) 47#define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2))
47 48
49/* return minimum truesize of one skb containing X bytes of data */
50#define SKB_TRUESIZE(X) ((X) + \
51 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \
52 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
53
48/* A. Checksumming of received packets by device. 54/* A. Checksumming of received packets by device.
49 * 55 *
50 * NONE: device failed to checksum this packet. 56 * NONE: device failed to checksum this packet.
@@ -134,7 +140,9 @@ struct sk_buff;
134typedef struct skb_frag_struct skb_frag_t; 140typedef struct skb_frag_struct skb_frag_t;
135 141
136struct skb_frag_struct { 142struct skb_frag_struct {
137 struct page *page; 143 struct {
144 struct page *p;
145 } page;
138#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536) 146#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
139 __u32 page_offset; 147 __u32 page_offset;
140 __u32 size; 148 __u32 size;
@@ -144,6 +152,26 @@ struct skb_frag_struct {
144#endif 152#endif
145}; 153};
146 154
155static inline unsigned int skb_frag_size(const skb_frag_t *frag)
156{
157 return frag->size;
158}
159
160static inline void skb_frag_size_set(skb_frag_t *frag, unsigned int size)
161{
162 frag->size = size;
163}
164
165static inline void skb_frag_size_add(skb_frag_t *frag, int delta)
166{
167 frag->size += delta;
168}
169
170static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
171{
172 frag->size -= delta;
173}
174
147#define HAVE_HW_TIME_STAMP 175#define HAVE_HW_TIME_STAMP
148 176
149/** 177/**
@@ -322,6 +350,8 @@ typedef unsigned char *sk_buff_data_t;
322 * @queue_mapping: Queue mapping for multiqueue devices 350 * @queue_mapping: Queue mapping for multiqueue devices
323 * @ndisc_nodetype: router type (from link layer) 351 * @ndisc_nodetype: router type (from link layer)
324 * @ooo_okay: allow the mapping of a socket to a queue to be changed 352 * @ooo_okay: allow the mapping of a socket to a queue to be changed
353 * @l4_rxhash: indicate rxhash is a canonical 4-tuple hash over transport
354 * ports.
325 * @dma_cookie: a cookie to one of several possible DMA operations 355 * @dma_cookie: a cookie to one of several possible DMA operations
326 * done by skb DMA functions 356 * done by skb DMA functions
327 * @secmark: security marking 357 * @secmark: security marking
@@ -414,6 +444,7 @@ struct sk_buff {
414 __u8 ndisc_nodetype:2; 444 __u8 ndisc_nodetype:2;
415#endif 445#endif
416 __u8 ooo_okay:1; 446 __u8 ooo_okay:1;
447 __u8 l4_rxhash:1;
417 kmemcheck_bitfield_end(flags2); 448 kmemcheck_bitfield_end(flags2);
418 449
419 /* 0/13 bit hole */ 450 /* 0/13 bit hole */
@@ -521,9 +552,11 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
521 return __alloc_skb(size, priority, 1, NUMA_NO_NODE); 552 return __alloc_skb(size, priority, 1, NUMA_NO_NODE);
522} 553}
523 554
555extern void skb_recycle(struct sk_buff *skb);
524extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); 556extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);
525 557
526extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); 558extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
559extern int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask);
527extern struct sk_buff *skb_clone(struct sk_buff *skb, 560extern struct sk_buff *skb_clone(struct sk_buff *skb,
528 gfp_t priority); 561 gfp_t priority);
529extern struct sk_buff *skb_copy(const struct sk_buff *skb, 562extern struct sk_buff *skb_copy(const struct sk_buff *skb,
@@ -572,11 +605,11 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
572 unsigned int to, struct ts_config *config, 605 unsigned int to, struct ts_config *config,
573 struct ts_state *state); 606 struct ts_state *state);
574 607
575extern __u32 __skb_get_rxhash(struct sk_buff *skb); 608extern void __skb_get_rxhash(struct sk_buff *skb);
576static inline __u32 skb_get_rxhash(struct sk_buff *skb) 609static inline __u32 skb_get_rxhash(struct sk_buff *skb)
577{ 610{
578 if (!skb->rxhash) 611 if (!skb->rxhash)
579 skb->rxhash = __skb_get_rxhash(skb); 612 __skb_get_rxhash(skb);
580 613
581 return skb->rxhash; 614 return skb->rxhash;
582} 615}
@@ -822,9 +855,9 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
822 * The reference count is not incremented and the reference is therefore 855 * The reference count is not incremented and the reference is therefore
823 * volatile. Use with caution. 856 * volatile. Use with caution.
824 */ 857 */
825static inline struct sk_buff *skb_peek(struct sk_buff_head *list_) 858static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_)
826{ 859{
827 struct sk_buff *list = ((struct sk_buff *)list_)->next; 860 struct sk_buff *list = ((const struct sk_buff *)list_)->next;
828 if (list == (struct sk_buff *)list_) 861 if (list == (struct sk_buff *)list_)
829 list = NULL; 862 list = NULL;
830 return list; 863 return list;
@@ -843,9 +876,9 @@ static inline struct sk_buff *skb_peek(struct sk_buff_head *list_)
843 * The reference count is not incremented and the reference is therefore 876 * The reference count is not incremented and the reference is therefore
844 * volatile. Use with caution. 877 * volatile. Use with caution.
845 */ 878 */
846static inline struct sk_buff *skb_peek_tail(struct sk_buff_head *list_) 879static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_)
847{ 880{
848 struct sk_buff *list = ((struct sk_buff *)list_)->prev; 881 struct sk_buff *list = ((const struct sk_buff *)list_)->prev;
849 if (list == (struct sk_buff *)list_) 882 if (list == (struct sk_buff *)list_)
850 list = NULL; 883 list = NULL;
851 return list; 884 return list;
@@ -1122,18 +1155,51 @@ static inline int skb_pagelen(const struct sk_buff *skb)
1122 int i, len = 0; 1155 int i, len = 0;
1123 1156
1124 for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) 1157 for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--)
1125 len += skb_shinfo(skb)->frags[i].size; 1158 len += skb_frag_size(&skb_shinfo(skb)->frags[i]);
1126 return len + skb_headlen(skb); 1159 return len + skb_headlen(skb);
1127} 1160}
1128 1161
1129static inline void skb_fill_page_desc(struct sk_buff *skb, int i, 1162/**
1130 struct page *page, int off, int size) 1163 * __skb_fill_page_desc - initialise a paged fragment in an skb
1164 * @skb: buffer containing fragment to be initialised
1165 * @i: paged fragment index to initialise
1166 * @page: the page to use for this fragment
1167 * @off: the offset to the data with @page
1168 * @size: the length of the data
1169 *
1170 * Initialises the @i'th fragment of @skb to point to &size bytes at
1171 * offset @off within @page.
1172 *
1173 * Does not take any additional reference on the fragment.
1174 */
1175static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,
1176 struct page *page, int off, int size)
1131{ 1177{
1132 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1178 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1133 1179
1134 frag->page = page; 1180 frag->page.p = page;
1135 frag->page_offset = off; 1181 frag->page_offset = off;
1136 frag->size = size; 1182 skb_frag_size_set(frag, size);
1183}
1184
1185/**
1186 * skb_fill_page_desc - initialise a paged fragment in an skb
1187 * @skb: buffer containing fragment to be initialised
1188 * @i: paged fragment index to initialise
1189 * @page: the page to use for this fragment
1190 * @off: the offset to the data with @page
1191 * @size: the length of the data
1192 *
1193 * As per __skb_fill_page_desc() -- initialises the @i'th fragment of
1194 * @skb to point to &size bytes at offset @off within @page. In
1195 * addition updates @skb such that @i is the last fragment.
1196 *
1197 * Does not take any additional reference on the fragment.
1198 */
1199static inline void skb_fill_page_desc(struct sk_buff *skb, int i,
1200 struct page *page, int off, int size)
1201{
1202 __skb_fill_page_desc(skb, i, page, off, size);
1137 skb_shinfo(skb)->nr_frags = i + 1; 1203 skb_shinfo(skb)->nr_frags = i + 1;
1138} 1204}
1139 1205
@@ -1628,6 +1694,137 @@ static inline void netdev_free_page(struct net_device *dev, struct page *page)
1628} 1694}
1629 1695
1630/** 1696/**
1697 * skb_frag_page - retrieve the page refered to by a paged fragment
1698 * @frag: the paged fragment
1699 *
1700 * Returns the &struct page associated with @frag.
1701 */
1702static inline struct page *skb_frag_page(const skb_frag_t *frag)
1703{
1704 return frag->page.p;
1705}
1706
1707/**
1708 * __skb_frag_ref - take an addition reference on a paged fragment.
1709 * @frag: the paged fragment
1710 *
1711 * Takes an additional reference on the paged fragment @frag.
1712 */
1713static inline void __skb_frag_ref(skb_frag_t *frag)
1714{
1715 get_page(skb_frag_page(frag));
1716}
1717
1718/**
1719 * skb_frag_ref - take an addition reference on a paged fragment of an skb.
1720 * @skb: the buffer
1721 * @f: the fragment offset.
1722 *
1723 * Takes an additional reference on the @f'th paged fragment of @skb.
1724 */
1725static inline void skb_frag_ref(struct sk_buff *skb, int f)
1726{
1727 __skb_frag_ref(&skb_shinfo(skb)->frags[f]);
1728}
1729
1730/**
1731 * __skb_frag_unref - release a reference on a paged fragment.
1732 * @frag: the paged fragment
1733 *
1734 * Releases a reference on the paged fragment @frag.
1735 */
1736static inline void __skb_frag_unref(skb_frag_t *frag)
1737{
1738 put_page(skb_frag_page(frag));
1739}
1740
1741/**
1742 * skb_frag_unref - release a reference on a paged fragment of an skb.
1743 * @skb: the buffer
1744 * @f: the fragment offset
1745 *
1746 * Releases a reference on the @f'th paged fragment of @skb.
1747 */
1748static inline void skb_frag_unref(struct sk_buff *skb, int f)
1749{
1750 __skb_frag_unref(&skb_shinfo(skb)->frags[f]);
1751}
1752
1753/**
1754 * skb_frag_address - gets the address of the data contained in a paged fragment
1755 * @frag: the paged fragment buffer
1756 *
1757 * Returns the address of the data within @frag. The page must already
1758 * be mapped.
1759 */
1760static inline void *skb_frag_address(const skb_frag_t *frag)
1761{
1762 return page_address(skb_frag_page(frag)) + frag->page_offset;
1763}
1764
1765/**
1766 * skb_frag_address_safe - gets the address of the data contained in a paged fragment
1767 * @frag: the paged fragment buffer
1768 *
1769 * Returns the address of the data within @frag. Checks that the page
1770 * is mapped and returns %NULL otherwise.
1771 */
1772static inline void *skb_frag_address_safe(const skb_frag_t *frag)
1773{
1774 void *ptr = page_address(skb_frag_page(frag));
1775 if (unlikely(!ptr))
1776 return NULL;
1777
1778 return ptr + frag->page_offset;
1779}
1780
1781/**
1782 * __skb_frag_set_page - sets the page contained in a paged fragment
1783 * @frag: the paged fragment
1784 * @page: the page to set
1785 *
1786 * Sets the fragment @frag to contain @page.
1787 */
1788static inline void __skb_frag_set_page(skb_frag_t *frag, struct page *page)
1789{
1790 frag->page.p = page;
1791}
1792
1793/**
1794 * skb_frag_set_page - sets the page contained in a paged fragment of an skb
1795 * @skb: the buffer
1796 * @f: the fragment offset
1797 * @page: the page to set
1798 *
1799 * Sets the @f'th fragment of @skb to contain @page.
1800 */
1801static inline void skb_frag_set_page(struct sk_buff *skb, int f,
1802 struct page *page)
1803{
1804 __skb_frag_set_page(&skb_shinfo(skb)->frags[f], page);
1805}
1806
1807/**
1808 * skb_frag_dma_map - maps a paged fragment via the DMA API
1809 * @dev: the device to map the fragment to
1810 * @frag: the paged fragment to map
1811 * @offset: the offset within the fragment (starting at the
1812 * fragment's own offset)
1813 * @size: the number of bytes to map
1814 * @dir: the direction of the mapping (%PCI_DMA_*)
1815 *
1816 * Maps the page associated with @frag to @device.
1817 */
1818static inline dma_addr_t skb_frag_dma_map(struct device *dev,
1819 const skb_frag_t *frag,
1820 size_t offset, size_t size,
1821 enum dma_data_direction dir)
1822{
1823 return dma_map_page(dev, skb_frag_page(frag),
1824 frag->page_offset + offset, size, dir);
1825}
1826
1827/**
1631 * skb_clone_writable - is the header of a clone writable 1828 * skb_clone_writable - is the header of a clone writable
1632 * @skb: buffer to check 1829 * @skb: buffer to check
1633 * @len: length up to which to write 1830 * @len: length up to which to write
@@ -1635,7 +1832,7 @@ static inline void netdev_free_page(struct net_device *dev, struct page *page)
1635 * Returns true if modifying the header part of the cloned buffer 1832 * Returns true if modifying the header part of the cloned buffer
1636 * does not requires the data to be copied. 1833 * does not requires the data to be copied.
1637 */ 1834 */
1638static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len) 1835static inline int skb_clone_writable(const struct sk_buff *skb, unsigned int len)
1639{ 1836{
1640 return !skb_header_cloned(skb) && 1837 return !skb_header_cloned(skb) &&
1641 skb_headroom(skb) + len <= skb->hdr_len; 1838 skb_headroom(skb) + len <= skb->hdr_len;
@@ -1729,13 +1926,13 @@ static inline int skb_add_data(struct sk_buff *skb,
1729} 1926}
1730 1927
1731static inline int skb_can_coalesce(struct sk_buff *skb, int i, 1928static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1732 struct page *page, int off) 1929 const struct page *page, int off)
1733{ 1930{
1734 if (i) { 1931 if (i) {
1735 struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; 1932 const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1];
1736 1933
1737 return page == frag->page && 1934 return page == skb_frag_page(frag) &&
1738 off == frag->page_offset + frag->size; 1935 off == frag->page_offset + skb_frag_size(frag);
1739 } 1936 }
1740 return 0; 1937 return 0;
1741} 1938}
@@ -2019,8 +2216,13 @@ static inline bool skb_defer_rx_timestamp(struct sk_buff *skb)
2019/** 2216/**
2020 * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps 2217 * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps
2021 * 2218 *
2219 * PHY drivers may accept clones of transmitted packets for
2220 * timestamping via their phy_driver.txtstamp method. These drivers
2221 * must call this function to return the skb back to the stack, with
2222 * or without a timestamp.
2223 *
2022 * @skb: clone of the the original outgoing packet 2224 * @skb: clone of the the original outgoing packet
2023 * @hwtstamps: hardware time stamps 2225 * @hwtstamps: hardware time stamps, may be NULL if not available
2024 * 2226 *
2025 */ 2227 */
2026void skb_complete_tx_timestamp(struct sk_buff *skb, 2228void skb_complete_tx_timestamp(struct sk_buff *skb,
@@ -2256,7 +2458,8 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb)
2256{ 2458{
2257 /* LRO sets gso_size but not gso_type, whereas if GSO is really 2459 /* LRO sets gso_size but not gso_type, whereas if GSO is really
2258 * wanted then gso_type will be set. */ 2460 * wanted then gso_type will be set. */
2259 struct skb_shared_info *shinfo = skb_shinfo(skb); 2461 const struct skb_shared_info *shinfo = skb_shinfo(skb);
2462
2260 if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 && 2463 if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 &&
2261 unlikely(shinfo->gso_type == 0)) { 2464 unlikely(shinfo->gso_type == 0)) {
2262 __skb_warn_lro_forwarding(skb); 2465 __skb_warn_lro_forwarding(skb);
@@ -2280,7 +2483,7 @@ static inline void skb_forward_csum(struct sk_buff *skb)
2280 * Instead of forcing ip_summed to CHECKSUM_NONE, we can 2483 * Instead of forcing ip_summed to CHECKSUM_NONE, we can
2281 * use this helper, to document places where we make this assertion. 2484 * use this helper, to document places where we make this assertion.
2282 */ 2485 */
2283static inline void skb_checksum_none_assert(struct sk_buff *skb) 2486static inline void skb_checksum_none_assert(const struct sk_buff *skb)
2284{ 2487{
2285#ifdef DEBUG 2488#ifdef DEBUG
2286 BUG_ON(skb->ip_summed != CHECKSUM_NONE); 2489 BUG_ON(skb->ip_summed != CHECKSUM_NONE);
@@ -2289,5 +2492,25 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
2289 2492
2290bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2493bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2291 2494
2495static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size)
2496{
2497 if (irqs_disabled())
2498 return false;
2499
2500 if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY)
2501 return false;
2502
2503 if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE)
2504 return false;
2505
2506 skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD);
2507 if (skb_end_pointer(skb) - skb->head < skb_size)
2508 return false;
2509
2510 if (skb_shared(skb) || skb_cloned(skb))
2511 return false;
2512
2513 return true;
2514}
2292#endif /* __KERNEL__ */ 2515#endif /* __KERNEL__ */
2293#endif /* _LINUX_SKBUFF_H */ 2516#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index f58d6413d230..a32bcfdc7834 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -36,12 +36,15 @@ enum stat_item {
36 ORDER_FALLBACK, /* Number of times fallback was necessary */ 36 ORDER_FALLBACK, /* Number of times fallback was necessary */
37 CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */ 37 CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */
38 CMPXCHG_DOUBLE_FAIL, /* Number of times that cmpxchg double did not match */ 38 CMPXCHG_DOUBLE_FAIL, /* Number of times that cmpxchg double did not match */
39 CPU_PARTIAL_ALLOC, /* Used cpu partial on alloc */
40 CPU_PARTIAL_FREE, /* USed cpu partial on free */
39 NR_SLUB_STAT_ITEMS }; 41 NR_SLUB_STAT_ITEMS };
40 42
41struct kmem_cache_cpu { 43struct kmem_cache_cpu {
42 void **freelist; /* Pointer to next available object */ 44 void **freelist; /* Pointer to next available object */
43 unsigned long tid; /* Globally unique transaction id */ 45 unsigned long tid; /* Globally unique transaction id */
44 struct page *page; /* The slab from which we are allocating */ 46 struct page *page; /* The slab from which we are allocating */
47 struct page *partial; /* Partially allocated frozen slabs */
45 int node; /* The node of the page (or -1 for debug) */ 48 int node; /* The node of the page (or -1 for debug) */
46#ifdef CONFIG_SLUB_STATS 49#ifdef CONFIG_SLUB_STATS
47 unsigned stat[NR_SLUB_STAT_ITEMS]; 50 unsigned stat[NR_SLUB_STAT_ITEMS];
@@ -79,6 +82,7 @@ struct kmem_cache {
79 int size; /* The size of an object including meta data */ 82 int size; /* The size of an object including meta data */
80 int objsize; /* The size of an object without meta data */ 83 int objsize; /* The size of an object without meta data */
81 int offset; /* Free pointer offset. */ 84 int offset; /* Free pointer offset. */
85 int cpu_partial; /* Number of per cpu partial objects to keep around */
82 struct kmem_cache_order_objects oo; 86 struct kmem_cache_order_objects oo;
83 87
84 /* Allocation and freeing of slabs */ 88 /* Allocation and freeing of slabs */
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 12b2b18e50c1..e16557a357e5 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -231,6 +231,8 @@ enum
231 LINUX_MIB_TCPDEFERACCEPTDROP, 231 LINUX_MIB_TCPDEFERACCEPTDROP,
232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ 232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */
233 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */ 233 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */
234 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
235 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
234 __LINUX_MIB_MAX 236 __LINUX_MIB_MAX
235}; 237};
236 238
diff --git a/include/linux/socket.h b/include/linux/socket.h
index e17f82266639..d0e77f607a79 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -8,8 +8,10 @@
8#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) 8#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
9 /* Implementation specific desired alignment */ 9 /* Implementation specific desired alignment */
10 10
11typedef unsigned short __kernel_sa_family_t;
12
11struct __kernel_sockaddr_storage { 13struct __kernel_sockaddr_storage {
12 unsigned short ss_family; /* address family */ 14 __kernel_sa_family_t ss_family; /* address family */
13 /* Following field(s) are implementation specific */ 15 /* Following field(s) are implementation specific */
14 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; 16 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
15 /* space to achieve desired size, */ 17 /* space to achieve desired size, */
@@ -35,7 +37,7 @@ struct seq_file;
35extern void socket_seq_show(struct seq_file *seq); 37extern void socket_seq_show(struct seq_file *seq);
36#endif 38#endif
37 39
38typedef unsigned short sa_family_t; 40typedef __kernel_sa_family_t sa_family_t;
39 41
40/* 42/*
41 * 1003.1g requires sa_family_t and that sa_data is char. 43 * 1003.1g requires sa_family_t and that sa_data is char.
diff --git a/include/linux/spi/l4f00242t03.h b/include/linux/spi/l4f00242t03.h
index aee1dbda4edc..bc8677c8eba9 100644
--- a/include/linux/spi/l4f00242t03.h
+++ b/include/linux/spi/l4f00242t03.h
@@ -24,8 +24,6 @@
24struct l4f00242t03_pdata { 24struct l4f00242t03_pdata {
25 unsigned int reset_gpio; 25 unsigned int reset_gpio;
26 unsigned int data_enable_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}; 27};
30 28
31#endif /* _INCLUDE_LINUX_SPI_L4F00242T03_H_ */ 29#endif /* _INCLUDE_LINUX_SPI_L4F00242T03_H_ */
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 8623217f84d0..061e560251b4 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -25,7 +25,7 @@ struct ssb_sprom {
25 u8 et1phyaddr; /* MII address for enet1 */ 25 u8 et1phyaddr; /* MII address for enet1 */
26 u8 et0mdcport; /* MDIO for enet0 */ 26 u8 et0mdcport; /* MDIO for enet0 */
27 u8 et1mdcport; /* MDIO for enet1 */ 27 u8 et1mdcport; /* MDIO for enet1 */
28 u8 board_rev; /* Board revision number from SPROM. */ 28 u16 board_rev; /* Board revision number from SPROM. */
29 u8 country_code; /* Country Code */ 29 u8 country_code; /* Country Code */
30 u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */ 30 u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */
31 u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */ 31 u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */
@@ -231,10 +231,9 @@ struct ssb_driver {
231#define drv_to_ssb_drv(_drv) container_of(_drv, struct ssb_driver, drv) 231#define drv_to_ssb_drv(_drv) container_of(_drv, struct ssb_driver, drv)
232 232
233extern int __ssb_driver_register(struct ssb_driver *drv, struct module *owner); 233extern int __ssb_driver_register(struct ssb_driver *drv, struct module *owner);
234static inline int ssb_driver_register(struct ssb_driver *drv) 234#define ssb_driver_register(drv) \
235{ 235 __ssb_driver_register(drv, THIS_MODULE)
236 return __ssb_driver_register(drv, THIS_MODULE); 236
237}
238extern void ssb_driver_unregister(struct ssb_driver *drv); 237extern void ssb_driver_unregister(struct ssb_driver *drv);
239 238
240 239
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index efbf459d571c..98941203a27f 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -462,6 +462,46 @@
462#define SSB_SPROM8_OFDM5GLPO 0x014A /* 5.2GHz OFDM power offset */ 462#define SSB_SPROM8_OFDM5GLPO 0x014A /* 5.2GHz OFDM power offset */
463#define SSB_SPROM8_OFDM5GHPO 0x014E /* 5.8GHz OFDM power offset */ 463#define SSB_SPROM8_OFDM5GHPO 0x014E /* 5.8GHz OFDM power offset */
464 464
465/* Values for boardflags_lo read from SPROM */
466#define SSB_BFL_BTCOEXIST 0x0001 /* implements Bluetooth coexistance */
467#define SSB_BFL_PACTRL 0x0002 /* GPIO 9 controlling the PA */
468#define SSB_BFL_AIRLINEMODE 0x0004 /* implements GPIO 13 radio disable indication */
469#define SSB_BFL_RSSI 0x0008 /* software calculates nrssi slope. */
470#define SSB_BFL_ENETSPI 0x0010 /* has ephy roboswitch spi */
471#define SSB_BFL_XTAL_NOSLOW 0x0020 /* no slow clock available */
472#define SSB_BFL_CCKHIPWR 0x0040 /* can do high power CCK transmission */
473#define SSB_BFL_ENETADM 0x0080 /* has ADMtek switch */
474#define SSB_BFL_ENETVLAN 0x0100 /* can do vlan */
475#define SSB_BFL_AFTERBURNER 0x0200 /* supports Afterburner mode */
476#define SSB_BFL_NOPCI 0x0400 /* board leaves PCI floating */
477#define SSB_BFL_FEM 0x0800 /* supports the Front End Module */
478#define SSB_BFL_EXTLNA 0x1000 /* has an external LNA */
479#define SSB_BFL_HGPA 0x2000 /* had high gain PA */
480#define SSB_BFL_BTCMOD 0x4000 /* BFL_BTCOEXIST is given in alternate GPIOs */
481#define SSB_BFL_ALTIQ 0x8000 /* alternate I/Q settings */
482
483/* Values for boardflags_hi read from SPROM */
484#define SSB_BFH_NOPA 0x0001 /* has no PA */
485#define SSB_BFH_RSSIINV 0x0002 /* RSSI uses positive slope (not TSSI) */
486#define SSB_BFH_PAREF 0x0004 /* uses the PARef LDO */
487#define SSB_BFH_3TSWITCH 0x0008 /* uses a triple throw switch shared with bluetooth */
488#define SSB_BFH_PHASESHIFT 0x0010 /* can support phase shifter */
489#define SSB_BFH_BUCKBOOST 0x0020 /* has buck/booster */
490#define SSB_BFH_FEM_BT 0x0040 /* has FEM and switch to share antenna with bluetooth */
491
492/* Values for boardflags2_lo read from SPROM */
493#define SSB_BFL2_RXBB_INT_REG_DIS 0x0001 /* external RX BB regulator present */
494#define SSB_BFL2_APLL_WAR 0x0002 /* alternative A-band PLL settings implemented */
495#define SSB_BFL2_TXPWRCTRL_EN 0x0004 /* permits enabling TX Power Control */
496#define SSB_BFL2_2X4_DIV 0x0008 /* 2x4 diversity switch */
497#define SSB_BFL2_5G_PWRGAIN 0x0010 /* supports 5G band power gain */
498#define SSB_BFL2_PCIEWAR_OVR 0x0020 /* overrides ASPM and Clkreq settings */
499#define SSB_BFL2_CAESERS_BRD 0x0040 /* is Caesers board (unused) */
500#define SSB_BFL2_BTC3WIRE 0x0080 /* used 3-wire bluetooth coexist */
501#define SSB_BFL2_SKWRKFEM_BRD 0x0100 /* 4321mcm93 uses Skyworks FEM */
502#define SSB_BFL2_SPUR_WAR 0x0200 /* has a workaround for clock-harmonic spurs */
503#define SSB_BFL2_GPLL_WAR 0x0400 /* altenative G-band PLL settings implemented */
504
465/* Values for SSB_SPROM1_BINF_CCODE */ 505/* Values for SSB_SPROM1_BINF_CCODE */
466enum { 506enum {
467 SSB_SPROM1CCODE_WORLD = 0, 507 SSB_SPROM1CCODE_WORLD = 0,
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 2d04ea916760..c170edc3bf5f 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/cpu.h> 4#include <linux/cpu.h>
5#include <linux/cpumask.h> 5#include <linux/cpumask.h>
6#include <linux/smp.h>
6#include <linux/list.h> 7#include <linux/list.h>
7#include <asm/system.h> 8#include <asm/system.h>
8 9
diff --git a/include/linux/string.h b/include/linux/string.h
index a176db2f2c85..e033564f10ba 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -114,6 +114,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t);
114#ifndef __HAVE_ARCH_MEMCHR 114#ifndef __HAVE_ARCH_MEMCHR
115extern void * memchr(const void *,int,__kernel_size_t); 115extern void * memchr(const void *,int,__kernel_size_t);
116#endif 116#endif
117void *memchr_inv(const void *s, int c, size_t n);
117 118
118extern char *kstrdup(const char *s, gfp_t gfp); 119extern char *kstrdup(const char *s, gfp_t gfp);
119extern char *kstrndup(const char *s, size_t len, gfp_t gfp); 120extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
diff --git a/include/linux/sungem_phy.h b/include/linux/sungem_phy.h
new file mode 100644
index 000000000000..bd9be9f59d3a
--- /dev/null
+++ b/include/linux/sungem_phy.h
@@ -0,0 +1,132 @@
1#ifndef __SUNGEM_PHY_H__
2#define __SUNGEM_PHY_H__
3
4struct mii_phy;
5
6/* Operations supported by any kind of PHY */
7struct mii_phy_ops
8{
9 int (*init)(struct mii_phy *phy);
10 int (*suspend)(struct mii_phy *phy);
11 int (*setup_aneg)(struct mii_phy *phy, u32 advertise);
12 int (*setup_forced)(struct mii_phy *phy, int speed, int fd);
13 int (*poll_link)(struct mii_phy *phy);
14 int (*read_link)(struct mii_phy *phy);
15 int (*enable_fiber)(struct mii_phy *phy, int autoneg);
16};
17
18/* Structure used to statically define an mii/gii based PHY */
19struct mii_phy_def
20{
21 u32 phy_id; /* Concatenated ID1 << 16 | ID2 */
22 u32 phy_id_mask; /* Significant bits */
23 u32 features; /* Ethtool SUPPORTED_* defines */
24 int magic_aneg; /* Autoneg does all speed test for us */
25 const char* name;
26 const struct mii_phy_ops* ops;
27};
28
29enum {
30 BCM54XX_COPPER,
31 BCM54XX_FIBER,
32 BCM54XX_GBIC,
33 BCM54XX_SGMII,
34 BCM54XX_UNKNOWN,
35};
36
37/* An instance of a PHY, partially borrowed from mii_if_info */
38struct mii_phy
39{
40 struct mii_phy_def* def;
41 u32 advertising;
42 int mii_id;
43
44 /* 1: autoneg enabled, 0: disabled */
45 int autoneg;
46
47 /* forced speed & duplex (no autoneg)
48 * partner speed & duplex & pause (autoneg)
49 */
50 int speed;
51 int duplex;
52 int pause;
53
54 /* Provided by host chip */
55 struct net_device *dev;
56 int (*mdio_read) (struct net_device *dev, int mii_id, int reg);
57 void (*mdio_write) (struct net_device *dev, int mii_id, int reg, int val);
58 void *platform_data;
59};
60
61/* Pass in a struct mii_phy with dev, mdio_read and mdio_write
62 * filled, the remaining fields will be filled on return
63 */
64extern int sungem_phy_probe(struct mii_phy *phy, int mii_id);
65
66
67/* MII definitions missing from mii.h */
68
69#define BMCR_SPD2 0x0040 /* Gigabit enable (bcm54xx) */
70#define LPA_PAUSE 0x0400
71
72/* More PHY registers (model specific) */
73
74/* MII BCM5201 MULTIPHY interrupt register */
75#define MII_BCM5201_INTERRUPT 0x1A
76#define MII_BCM5201_INTERRUPT_INTENABLE 0x4000
77
78#define MII_BCM5201_AUXMODE2 0x1B
79#define MII_BCM5201_AUXMODE2_LOWPOWER 0x0008
80
81#define MII_BCM5201_MULTIPHY 0x1E
82
83/* MII BCM5201 MULTIPHY register bits */
84#define MII_BCM5201_MULTIPHY_SERIALMODE 0x0002
85#define MII_BCM5201_MULTIPHY_SUPERISOLATE 0x0008
86
87/* MII BCM5221 Additional registers */
88#define MII_BCM5221_TEST 0x1f
89#define MII_BCM5221_TEST_ENABLE_SHADOWS 0x0080
90#define MII_BCM5221_SHDOW_AUX_STAT2 0x1b
91#define MII_BCM5221_SHDOW_AUX_STAT2_APD 0x0020
92#define MII_BCM5221_SHDOW_AUX_MODE4 0x1a
93#define MII_BCM5221_SHDOW_AUX_MODE4_IDDQMODE 0x0001
94#define MII_BCM5221_SHDOW_AUX_MODE4_CLKLOPWR 0x0004
95
96/* MII BCM5241 Additional registers */
97#define MII_BCM5241_SHDOW_AUX_MODE4_STANDBYPWR 0x0008
98
99/* MII BCM5400 1000-BASET Control register */
100#define MII_BCM5400_GB_CONTROL 0x09
101#define MII_BCM5400_GB_CONTROL_FULLDUPLEXCAP 0x0200
102
103/* MII BCM5400 AUXCONTROL register */
104#define MII_BCM5400_AUXCONTROL 0x18
105#define MII_BCM5400_AUXCONTROL_PWR10BASET 0x0004
106
107/* MII BCM5400 AUXSTATUS register */
108#define MII_BCM5400_AUXSTATUS 0x19
109#define MII_BCM5400_AUXSTATUS_LINKMODE_MASK 0x0700
110#define MII_BCM5400_AUXSTATUS_LINKMODE_SHIFT 8
111
112/* 1000BT control (Marvell & BCM54xx at least) */
113#define MII_1000BASETCONTROL 0x09
114#define MII_1000BASETCONTROL_FULLDUPLEXCAP 0x0200
115#define MII_1000BASETCONTROL_HALFDUPLEXCAP 0x0100
116
117/* Marvell 88E1011 PHY control */
118#define MII_M1011_PHY_SPEC_CONTROL 0x10
119#define MII_M1011_PHY_SPEC_CONTROL_MANUAL_MDIX 0x20
120#define MII_M1011_PHY_SPEC_CONTROL_AUTO_MDIX 0x40
121
122/* Marvell 88E1011 PHY status */
123#define MII_M1011_PHY_SPEC_STATUS 0x11
124#define MII_M1011_PHY_SPEC_STATUS_1000 0x8000
125#define MII_M1011_PHY_SPEC_STATUS_100 0x4000
126#define MII_M1011_PHY_SPEC_STATUS_SPD_MASK 0xc000
127#define MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX 0x2000
128#define MII_M1011_PHY_SPEC_STATUS_RESOLVED 0x0800
129#define MII_M1011_PHY_SPEC_STATUS_TX_PAUSE 0x0008
130#define MII_M1011_PHY_SPEC_STATUS_RX_PAUSE 0x0004
131
132#endif /* __SUNGEM_PHY_H__ */
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index db7bcaf7c5bd..3d8f9c44e27d 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -9,6 +9,7 @@
9#ifndef _LINUX_SUNRPC_CLNT_H 9#ifndef _LINUX_SUNRPC_CLNT_H
10#define _LINUX_SUNRPC_CLNT_H 10#define _LINUX_SUNRPC_CLNT_H
11 11
12#include <linux/types.h>
12#include <linux/socket.h> 13#include <linux/socket.h>
13#include <linux/in.h> 14#include <linux/in.h>
14#include <linux/in6.h> 15#include <linux/in6.h>
@@ -135,6 +136,8 @@ void rpc_shutdown_client(struct rpc_clnt *);
135void rpc_release_client(struct rpc_clnt *); 136void rpc_release_client(struct rpc_clnt *);
136void rpc_task_release_client(struct rpc_task *); 137void rpc_task_release_client(struct rpc_task *);
137 138
139int rpcb_create_local(void);
140void rpcb_put_local(void);
138int rpcb_register(u32, u32, int, unsigned short); 141int rpcb_register(u32, u32, int, unsigned short);
139int rpcb_v4_register(const u32 program, const u32 version, 142int rpcb_v4_register(const u32 program, const u32 version,
140 const struct sockaddr *address, 143 const struct sockaddr *address,
@@ -161,7 +164,7 @@ const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
161size_t rpc_ntop(const struct sockaddr *, char *, const size_t); 164size_t rpc_ntop(const struct sockaddr *, char *, const size_t);
162size_t rpc_pton(const char *, const size_t, 165size_t rpc_pton(const char *, const size_t,
163 struct sockaddr *, const size_t); 166 struct sockaddr *, const size_t);
164char * rpc_sockaddr2uaddr(const struct sockaddr *); 167char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t);
165size_t rpc_uaddr2sockaddr(const char *, const size_t, 168size_t rpc_uaddr2sockaddr(const char *, const size_t,
166 struct sockaddr *, const size_t); 169 struct sockaddr *, const size_t);
167 170
@@ -218,7 +221,13 @@ static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1,
218{ 221{
219 const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; 222 const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1;
220 const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; 223 const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2;
221 return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); 224
225 if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr))
226 return false;
227 else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL)
228 return sin1->sin6_scope_id == sin2->sin6_scope_id;
229
230 return true;
222} 231}
223 232
224static inline bool __rpc_copy_addr6(struct sockaddr *dst, 233static inline bool __rpc_copy_addr6(struct sockaddr *dst,
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index cf14db975da0..e4ea43058d8f 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -44,6 +44,8 @@ RPC_I(struct inode *inode)
44 return container_of(inode, struct rpc_inode, vfs_inode); 44 return container_of(inode, struct rpc_inode, vfs_inode);
45} 45}
46 46
47extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *,
48 char __user *, size_t);
47extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); 49extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
48 50
49struct rpc_clnt; 51struct rpc_clnt;
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 223588a976a0..35b37b1e9299 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -212,11 +212,6 @@ static inline void svc_putu32(struct kvec *iov, __be32 val)
212 iov->iov_len += sizeof(__be32); 212 iov->iov_len += sizeof(__be32);
213} 213}
214 214
215union svc_addr_u {
216 struct in_addr addr;
217 struct in6_addr addr6;
218};
219
220/* 215/*
221 * The context of a single thread, including the request currently being 216 * The context of a single thread, including the request currently being
222 * processed. 217 * processed.
@@ -225,8 +220,12 @@ struct svc_rqst {
225 struct list_head rq_list; /* idle list */ 220 struct list_head rq_list; /* idle list */
226 struct list_head rq_all; /* all threads list */ 221 struct list_head rq_all; /* all threads list */
227 struct svc_xprt * rq_xprt; /* transport ptr */ 222 struct svc_xprt * rq_xprt; /* transport ptr */
223
228 struct sockaddr_storage rq_addr; /* peer address */ 224 struct sockaddr_storage rq_addr; /* peer address */
229 size_t rq_addrlen; 225 size_t rq_addrlen;
226 struct sockaddr_storage rq_daddr; /* dest addr of request
227 * - reply from here */
228 size_t rq_daddrlen;
230 229
231 struct svc_serv * rq_server; /* RPC service definition */ 230 struct svc_serv * rq_server; /* RPC service definition */
232 struct svc_pool * rq_pool; /* thread pool */ 231 struct svc_pool * rq_pool; /* thread pool */
@@ -255,9 +254,6 @@ struct svc_rqst {
255 unsigned short 254 unsigned short
256 rq_secure : 1; /* secure port */ 255 rq_secure : 1; /* secure port */
257 256
258 union svc_addr_u rq_daddr; /* dest addr of request
259 * - reply from here */
260
261 void * rq_argp; /* decoded arguments */ 257 void * rq_argp; /* decoded arguments */
262 void * rq_resp; /* xdr'd results */ 258 void * rq_resp; /* xdr'd results */
263 void * rq_auth_data; /* flavor-specific data */ 259 void * rq_auth_data; /* flavor-specific data */
@@ -300,6 +296,21 @@ static inline struct sockaddr *svc_addr(const struct svc_rqst *rqst)
300 return (struct sockaddr *) &rqst->rq_addr; 296 return (struct sockaddr *) &rqst->rq_addr;
301} 297}
302 298
299static inline struct sockaddr_in *svc_daddr_in(const struct svc_rqst *rqst)
300{
301 return (struct sockaddr_in *) &rqst->rq_daddr;
302}
303
304static inline struct sockaddr_in6 *svc_daddr_in6(const struct svc_rqst *rqst)
305{
306 return (struct sockaddr_in6 *) &rqst->rq_daddr;
307}
308
309static inline struct sockaddr *svc_daddr(const struct svc_rqst *rqst)
310{
311 return (struct sockaddr *) &rqst->rq_daddr;
312}
313
303/* 314/*
304 * Check buffer bounds after decoding arguments 315 * Check buffer bounds after decoding arguments
305 */ 316 */
@@ -340,7 +351,8 @@ struct svc_deferred_req {
340 struct svc_xprt *xprt; 351 struct svc_xprt *xprt;
341 struct sockaddr_storage addr; /* where reply must go */ 352 struct sockaddr_storage addr; /* where reply must go */
342 size_t addrlen; 353 size_t addrlen;
343 union svc_addr_u daddr; /* where reply must come from */ 354 struct sockaddr_storage daddr; /* where reply must come from */
355 size_t daddrlen;
344 struct cache_deferred_req handle; 356 struct cache_deferred_req handle;
345 size_t xprt_hlen; 357 size_t xprt_hlen;
346 int argslen; 358 int argslen;
@@ -401,10 +413,11 @@ struct svc_procedure {
401/* 413/*
402 * Function prototypes. 414 * Function prototypes.
403 */ 415 */
416void svc_rpcb_cleanup(struct svc_serv *serv);
404struct svc_serv *svc_create(struct svc_program *, unsigned int, 417struct svc_serv *svc_create(struct svc_program *, unsigned int,
405 void (*shutdown)(struct svc_serv *)); 418 void (*shutdown)(struct svc_serv *));
406struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, 419struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
407 struct svc_pool *pool); 420 struct svc_pool *pool, int node);
408void svc_exit_thread(struct svc_rqst *); 421void svc_exit_thread(struct svc_rqst *);
409struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, 422struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
410 void (*shutdown)(struct svc_serv *), 423 void (*shutdown)(struct svc_serv *),
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 7ad9751a0d87..8620f79658d4 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -8,7 +8,8 @@
8#define SUNRPC_SVC_XPRT_H 8#define SUNRPC_SVC_XPRT_H
9 9
10#include <linux/sunrpc/svc.h> 10#include <linux/sunrpc/svc.h>
11#include <linux/module.h> 11
12struct module;
12 13
13struct svc_xprt_ops { 14struct svc_xprt_ops {
14 struct svc_xprt *(*xpo_create)(struct svc_serv *, 15 struct svc_xprt *(*xpo_create)(struct svc_serv *,
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 6bbcef22e105..57a692432f8a 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -8,15 +8,18 @@
8#include <linux/mm.h> 8#include <linux/mm.h>
9#include <asm/errno.h> 9#include <asm/errno.h>
10 10
11#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) 11#ifdef CONFIG_VT
12extern void pm_set_vt_switch(int); 12extern void pm_set_vt_switch(int);
13extern int pm_prepare_console(void);
14extern void pm_restore_console(void);
15#else 13#else
16static inline void pm_set_vt_switch(int do_switch) 14static inline void pm_set_vt_switch(int do_switch)
17{ 15{
18} 16}
17#endif
19 18
19#ifdef CONFIG_VT_CONSOLE_SLEEP
20extern int pm_prepare_console(void);
21extern void pm_restore_console(void);
22#else
20static inline int pm_prepare_console(void) 23static inline int pm_prepare_console(void)
21{ 24{
22 return 0; 25 return 0;
@@ -34,6 +37,58 @@ typedef int __bitwise suspend_state_t;
34#define PM_SUSPEND_MEM ((__force suspend_state_t) 3) 37#define PM_SUSPEND_MEM ((__force suspend_state_t) 3)
35#define PM_SUSPEND_MAX ((__force suspend_state_t) 4) 38#define PM_SUSPEND_MAX ((__force suspend_state_t) 4)
36 39
40enum suspend_stat_step {
41 SUSPEND_FREEZE = 1,
42 SUSPEND_PREPARE,
43 SUSPEND_SUSPEND,
44 SUSPEND_SUSPEND_NOIRQ,
45 SUSPEND_RESUME_NOIRQ,
46 SUSPEND_RESUME
47};
48
49struct suspend_stats {
50 int success;
51 int fail;
52 int failed_freeze;
53 int failed_prepare;
54 int failed_suspend;
55 int failed_suspend_noirq;
56 int failed_resume;
57 int failed_resume_noirq;
58#define REC_FAILED_NUM 2
59 int last_failed_dev;
60 char failed_devs[REC_FAILED_NUM][40];
61 int last_failed_errno;
62 int errno[REC_FAILED_NUM];
63 int last_failed_step;
64 enum suspend_stat_step failed_steps[REC_FAILED_NUM];
65};
66
67extern struct suspend_stats suspend_stats;
68
69static inline void dpm_save_failed_dev(const char *name)
70{
71 strlcpy(suspend_stats.failed_devs[suspend_stats.last_failed_dev],
72 name,
73 sizeof(suspend_stats.failed_devs[0]));
74 suspend_stats.last_failed_dev++;
75 suspend_stats.last_failed_dev %= REC_FAILED_NUM;
76}
77
78static inline void dpm_save_failed_errno(int err)
79{
80 suspend_stats.errno[suspend_stats.last_failed_errno] = err;
81 suspend_stats.last_failed_errno++;
82 suspend_stats.last_failed_errno %= REC_FAILED_NUM;
83}
84
85static inline void dpm_save_failed_step(enum suspend_stat_step step)
86{
87 suspend_stats.failed_steps[suspend_stats.last_failed_step] = step;
88 suspend_stats.last_failed_step++;
89 suspend_stats.last_failed_step %= REC_FAILED_NUM;
90}
91
37/** 92/**
38 * struct platform_suspend_ops - Callbacks for managing platform dependent 93 * struct platform_suspend_ops - Callbacks for managing platform dependent
39 * system sleep states. 94 * system sleep states.
@@ -334,4 +389,38 @@ static inline void unlock_system_sleep(void)
334} 389}
335#endif 390#endif
336 391
392#ifdef CONFIG_ARCH_SAVE_PAGE_KEYS
393/*
394 * The ARCH_SAVE_PAGE_KEYS functions can be used by an architecture
395 * to save/restore additional information to/from the array of page
396 * frame numbers in the hibernation image. For s390 this is used to
397 * save and restore the storage key for each page that is included
398 * in the hibernation image.
399 */
400unsigned long page_key_additional_pages(unsigned long pages);
401int page_key_alloc(unsigned long pages);
402void page_key_free(void);
403void page_key_read(unsigned long *pfn);
404void page_key_memorize(unsigned long *pfn);
405void page_key_write(void *address);
406
407#else /* !CONFIG_ARCH_SAVE_PAGE_KEYS */
408
409static inline unsigned long page_key_additional_pages(unsigned long pages)
410{
411 return 0;
412}
413
414static inline int page_key_alloc(unsigned long pages)
415{
416 return 0;
417}
418
419static inline void page_key_free(void) {}
420static inline void page_key_read(unsigned long *pfn) {}
421static inline void page_key_memorize(unsigned long *pfn) {}
422static inline void page_key_write(void *address) {}
423
424#endif /* !CONFIG_ARCH_SAVE_PAGE_KEYS */
425
337#endif /* _LINUX_SUSPEND_H */ 426#endif /* _LINUX_SUSPEND_H */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 14d62490922e..1e22e126d2ac 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -243,15 +243,16 @@ static inline void lru_cache_add_file(struct page *page)
243 __lru_cache_add(page, LRU_INACTIVE_FILE); 243 __lru_cache_add(page, LRU_INACTIVE_FILE);
244} 244}
245 245
246/* LRU Isolation modes. */
247#define ISOLATE_INACTIVE 0 /* Isolate inactive pages. */
248#define ISOLATE_ACTIVE 1 /* Isolate active pages. */
249#define ISOLATE_BOTH 2 /* Isolate both active and inactive pages. */
250
251/* linux/mm/vmscan.c */ 246/* linux/mm/vmscan.c */
252extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, 247extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
253 gfp_t gfp_mask, nodemask_t *mask); 248 gfp_t gfp_mask, nodemask_t *mask);
254extern int __isolate_lru_page(struct page *page, int mode, int file); 249extern int __isolate_lru_page(struct page *page, isolate_mode_t mode, int file);
250extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
251 gfp_t gfp_mask, bool noswap);
252extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
253 gfp_t gfp_mask, bool noswap,
254 struct zone *zone,
255 unsigned long *nr_scanned);
255extern unsigned long shrink_all_memory(unsigned long nr_pages); 256extern unsigned long shrink_all_memory(unsigned long nr_pages);
256extern int vm_swappiness; 257extern int vm_swappiness;
257extern int remove_mapping(struct address_space *mapping, struct page *page); 258extern int remove_mapping(struct address_space *mapping, struct page *page);
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 8c03b98df5f9..86a24b1166d1 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -702,9 +702,6 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args);
702asmlinkage long sys_sysinfo(struct sysinfo __user *info); 702asmlinkage long sys_sysinfo(struct sysinfo __user *info);
703asmlinkage long sys_sysfs(int option, 703asmlinkage long sys_sysfs(int option,
704 unsigned long arg1, unsigned long arg2); 704 unsigned long arg1, unsigned long arg2);
705asmlinkage long sys_nfsservctl(int cmd,
706 struct nfsctl_arg __user *arg,
707 void __user *res);
708asmlinkage long sys_syslog(int type, char __user *buf, int len); 705asmlinkage long sys_syslog(int type, char __user *buf, int len);
709asmlinkage long sys_uselib(const char __user *library); 706asmlinkage long sys_uselib(const char __user *library);
710asmlinkage long sys_ni_syscall(void); 707asmlinkage long sys_ni_syscall(void);
@@ -847,4 +844,17 @@ asmlinkage long sys_open_by_handle_at(int mountdirfd,
847 struct file_handle __user *handle, 844 struct file_handle __user *handle,
848 int flags); 845 int flags);
849asmlinkage long sys_setns(int fd, int nstype); 846asmlinkage long sys_setns(int fd, int nstype);
847asmlinkage long sys_process_vm_readv(pid_t pid,
848 const struct iovec __user *lvec,
849 unsigned long liovcnt,
850 const struct iovec __user *rvec,
851 unsigned long riovcnt,
852 unsigned long flags);
853asmlinkage long sys_process_vm_writev(pid_t pid,
854 const struct iovec __user *lvec,
855 unsigned long liovcnt,
856 const struct iovec __user *rvec,
857 unsigned long riovcnt,
858 unsigned long flags);
859
850#endif 860#endif
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 11684d9e6bd2..703cfa33a3ca 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -435,7 +435,7 @@ enum {
435 NET_IPV4_ROUTE_MAX_SIZE=5, 435 NET_IPV4_ROUTE_MAX_SIZE=5,
436 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6, 436 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
437 NET_IPV4_ROUTE_GC_TIMEOUT=7, 437 NET_IPV4_ROUTE_GC_TIMEOUT=7,
438 NET_IPV4_ROUTE_GC_INTERVAL=8, 438 NET_IPV4_ROUTE_GC_INTERVAL=8, /* obsolete since 2.6.38 */
439 NET_IPV4_ROUTE_REDIRECT_LOAD=9, 439 NET_IPV4_ROUTE_REDIRECT_LOAD=9,
440 NET_IPV4_ROUTE_REDIRECT_NUMBER=10, 440 NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
441 NET_IPV4_ROUTE_REDIRECT_SILENCE=11, 441 NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
@@ -931,6 +931,7 @@ enum
931#ifdef __KERNEL__ 931#ifdef __KERNEL__
932#include <linux/list.h> 932#include <linux/list.h>
933#include <linux/rcupdate.h> 933#include <linux/rcupdate.h>
934#include <linux/wait.h>
934 935
935/* For the /proc/sys support */ 936/* For the /proc/sys support */
936struct ctl_table; 937struct ctl_table;
@@ -1011,6 +1012,26 @@ extern int proc_do_large_bitmap(struct ctl_table *, int,
1011 * cover common cases. 1012 * cover common cases.
1012 */ 1013 */
1013 1014
1015/* Support for userspace poll() to watch for changes */
1016struct ctl_table_poll {
1017 atomic_t event;
1018 wait_queue_head_t wait;
1019};
1020
1021static inline void *proc_sys_poll_event(struct ctl_table_poll *poll)
1022{
1023 return (void *)(unsigned long)atomic_read(&poll->event);
1024}
1025
1026void proc_sys_poll_notify(struct ctl_table_poll *poll);
1027
1028#define __CTL_TABLE_POLL_INITIALIZER(name) { \
1029 .event = ATOMIC_INIT(0), \
1030 .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait) }
1031
1032#define DEFINE_CTL_TABLE_POLL(name) \
1033 struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name)
1034
1014/* A sysctl table is an array of struct ctl_table: */ 1035/* A sysctl table is an array of struct ctl_table: */
1015struct ctl_table 1036struct ctl_table
1016{ 1037{
@@ -1021,6 +1042,7 @@ struct ctl_table
1021 struct ctl_table *child; 1042 struct ctl_table *child;
1022 struct ctl_table *parent; /* Automatically set */ 1043 struct ctl_table *parent; /* Automatically set */
1023 proc_handler *proc_handler; /* Callback for text formatting */ 1044 proc_handler *proc_handler; /* Callback for text formatting */
1045 struct ctl_table_poll *poll;
1024 void *extra1; 1046 void *extra1;
1025 void *extra2; 1047 void *extra2;
1026}; 1048};
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index d35e783a598c..20f63d3e6144 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -22,7 +22,6 @@
22#define _SYSDEV_H_ 22#define _SYSDEV_H_
23 23
24#include <linux/kobject.h> 24#include <linux/kobject.h>
25#include <linux/module.h>
26#include <linux/pm.h> 25#include <linux/pm.h>
27 26
28 27
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index d7d2f2158142..dac0859e6440 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -112,6 +112,7 @@ struct bin_attribute {
112struct sysfs_ops { 112struct sysfs_ops {
113 ssize_t (*show)(struct kobject *, struct attribute *,char *); 113 ssize_t (*show)(struct kobject *, struct attribute *,char *);
114 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 114 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
115 const void *(*namespace)(struct kobject *, const struct attribute *);
115}; 116};
116 117
117struct sysfs_dirent; 118struct sysfs_dirent;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 531ede8006d9..7f59ee946983 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -111,7 +111,8 @@ enum {
111#define TCPI_OPT_TIMESTAMPS 1 111#define TCPI_OPT_TIMESTAMPS 1
112#define TCPI_OPT_SACK 2 112#define TCPI_OPT_SACK 2
113#define TCPI_OPT_WSCALE 4 113#define TCPI_OPT_WSCALE 4
114#define TCPI_OPT_ECN 8 114#define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */
115#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
115 116
116enum tcp_ca_state { 117enum tcp_ca_state {
117 TCP_CA_Open = 0, 118 TCP_CA_Open = 0,
@@ -379,6 +380,10 @@ struct tcp_sock {
379 u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ 380 u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
380 u32 snd_cwnd_used; 381 u32 snd_cwnd_used;
381 u32 snd_cwnd_stamp; 382 u32 snd_cwnd_stamp;
383 u32 prior_cwnd; /* Congestion window at start of Recovery. */
384 u32 prr_delivered; /* Number of newly delivered packets to
385 * receiver in Recovery. */
386 u32 prr_out; /* Total number of pkts sent during Recovery. */
382 387
383 u32 rcv_wnd; /* Current receiver window */ 388 u32 rcv_wnd; /* Current receiver window */
384 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 389 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index d9a85d616385..cfaee869146f 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -4,10 +4,11 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/module.h>
8#include <linux/err.h> 7#include <linux/err.h>
9#include <linux/slab.h> 8#include <linux/slab.h>
10 9
10struct module;
11
11struct ts_config; 12struct ts_config;
12 13
13#define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */ 14#define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
index b004e557caa9..2ef4385da6bf 100644
--- a/include/linux/ti_wilink_st.h
+++ b/include/linux/ti_wilink_st.h
@@ -410,7 +410,28 @@ struct gps_event_hdr {
410 u16 plen; 410 u16 plen;
411} __attribute__ ((packed)); 411} __attribute__ ((packed));
412 412
413/* platform data */ 413/**
414 * struct ti_st_plat_data - platform data shared between ST driver and
415 * platform specific board file which adds the ST device.
416 * @nshutdown_gpio: Host's GPIO line to which chip's BT_EN is connected.
417 * @dev_name: The UART/TTY name to which chip is interfaced. (eg: /dev/ttyS1)
418 * @flow_cntrl: Should always be 1, since UART's CTS/RTS is used for PM
419 * purposes.
420 * @baud_rate: The baud rate supported by the Host UART controller, this will
421 * be shared across with the chip via a HCI VS command from User-Space Init
422 * Mgr application.
423 * @suspend:
424 * @resume: legacy PM routines hooked to platform specific board file, so as
425 * to take chip-host interface specific action.
426 * @chip_enable:
427 * @chip_disable: Platform/Interface specific mux mode setting, GPIO
428 * configuring, Host side PM disabling etc.. can be done here.
429 * @chip_asleep:
430 * @chip_awake: Chip specific deep sleep states is communicated to Host
431 * specific board-xx.c to take actions such as cut UART clocks when chip
432 * asleep or run host faster when chip awake etc..
433 *
434 */
414struct ti_st_plat_data { 435struct ti_st_plat_data {
415 long nshutdown_gpio; 436 long nshutdown_gpio;
416 unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */ 437 unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */
@@ -418,6 +439,10 @@ struct ti_st_plat_data {
418 unsigned long baud_rate; 439 unsigned long baud_rate;
419 int (*suspend)(struct platform_device *, pm_message_t); 440 int (*suspend)(struct platform_device *, pm_message_t);
420 int (*resume)(struct platform_device *); 441 int (*resume)(struct platform_device *);
442 int (*chip_enable) (struct kim_data_s *);
443 int (*chip_disable) (struct kim_data_s *);
444 int (*chip_asleep) (struct kim_data_s *);
445 int (*chip_awake) (struct kim_data_s *);
421}; 446};
422 447
423#endif /* TI_WILINK_ST_H */ 448#endif /* TI_WILINK_ST_H */
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 0db239590b4d..9730b0e51e46 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -41,6 +41,10 @@
41#include <linux/string.h> 41#include <linux/string.h>
42#include <asm/byteorder.h> 42#include <asm/byteorder.h>
43 43
44#ifndef __KERNEL__
45#include <arpa/inet.h> /* for ntohs etc. */
46#endif
47
44/* 48/*
45 * Configuration 49 * Configuration
46 * 50 *
diff --git a/include/linux/topology.h b/include/linux/topology.h
index fc839bfa7935..e26db031303b 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -201,6 +201,10 @@ int arch_update_cpu_topology(void);
201 .balance_interval = 64, \ 201 .balance_interval = 64, \
202} 202}
203 203
204#ifndef SD_NODES_PER_DOMAIN
205#define SD_NODES_PER_DOMAIN 16
206#endif
207
204#ifdef CONFIG_SCHED_BOOK 208#ifdef CONFIG_SCHED_BOOK
205#ifndef SD_BOOK_INIT 209#ifndef SD_BOOK_INIT
206#error Please define an appropriate SD_BOOK_INIT in include/asm/topology.h!!! 210#error Please define an appropriate SD_BOOK_INIT in include/asm/topology.h!!!
diff --git a/include/linux/trace_clock.h b/include/linux/trace_clock.h
index 7a8130384087..4eb490237d4c 100644
--- a/include/linux/trace_clock.h
+++ b/include/linux/trace_clock.h
@@ -15,5 +15,6 @@
15extern u64 notrace trace_clock_local(void); 15extern u64 notrace trace_clock_local(void);
16extern u64 notrace trace_clock(void); 16extern u64 notrace trace_clock(void);
17extern u64 notrace trace_clock_global(void); 17extern u64 notrace trace_clock_global(void);
18extern u64 notrace trace_clock_counter(void);
18 19
19#endif /* _LINUX_TRACE_CLOCK_H */ 20#endif /* _LINUX_TRACE_CLOCK_H */
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h
index 5cf397ceb726..7dadc3df0c77 100644
--- a/include/linux/trace_seq.h
+++ b/include/linux/trace_seq.h
@@ -29,10 +29,10 @@ trace_seq_init(struct trace_seq *s)
29 * Currently only defined when tracing is enabled. 29 * Currently only defined when tracing is enabled.
30 */ 30 */
31#ifdef CONFIG_TRACING 31#ifdef CONFIG_TRACING
32extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...) 32extern __printf(2, 3)
33 __attribute__ ((format (printf, 2, 3))); 33int trace_seq_printf(struct trace_seq *s, const char *fmt, ...);
34extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args) 34extern __printf(2, 0)
35 __attribute__ ((format (printf, 2, 0))); 35int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args);
36extern int 36extern int
37trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary); 37trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary);
38extern int trace_print_seq(struct seq_file *m, struct trace_seq *s); 38extern int trace_print_seq(struct seq_file *m, struct trace_seq *s);
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index d530a4460a0b..df0a779c1bbd 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -54,8 +54,18 @@ extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe,
54 void *data); 54 void *data);
55extern void tracepoint_probe_update_all(void); 55extern void tracepoint_probe_update_all(void);
56 56
57#ifdef CONFIG_MODULES
58struct tp_module {
59 struct list_head list;
60 unsigned int num_tracepoints;
61 struct tracepoint * const *tracepoints_ptrs;
62};
63#endif /* CONFIG_MODULES */
64
57struct tracepoint_iter { 65struct tracepoint_iter {
58 struct module *module; 66#ifdef CONFIG_MODULES
67 struct tp_module *module;
68#endif /* CONFIG_MODULES */
59 struct tracepoint * const *tracepoint; 69 struct tracepoint * const *tracepoint;
60}; 70};
61 71
@@ -63,8 +73,6 @@ extern void tracepoint_iter_start(struct tracepoint_iter *iter);
63extern void tracepoint_iter_next(struct tracepoint_iter *iter); 73extern void tracepoint_iter_next(struct tracepoint_iter *iter);
64extern void tracepoint_iter_stop(struct tracepoint_iter *iter); 74extern void tracepoint_iter_stop(struct tracepoint_iter *iter);
65extern void tracepoint_iter_reset(struct tracepoint_iter *iter); 75extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
66extern int tracepoint_get_iter_range(struct tracepoint * const **tracepoint,
67 struct tracepoint * const *begin, struct tracepoint * const *end);
68 76
69/* 77/*
70 * tracepoint_synchronize_unregister must be called between the last tracepoint 78 * tracepoint_synchronize_unregister must be called between the last tracepoint
@@ -78,17 +86,6 @@ static inline void tracepoint_synchronize_unregister(void)
78 86
79#define PARAMS(args...) args 87#define PARAMS(args...) args
80 88
81#ifdef CONFIG_TRACEPOINTS
82extern
83void tracepoint_update_probe_range(struct tracepoint * const *begin,
84 struct tracepoint * const *end);
85#else
86static inline
87void tracepoint_update_probe_range(struct tracepoint * const *begin,
88 struct tracepoint * const *end)
89{ }
90#endif /* CONFIG_TRACEPOINTS */
91
92#endif /* _LINUX_TRACEPOINT_H */ 89#endif /* _LINUX_TRACEPOINT_H */
93 90
94/* 91/*
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 44bc0c5617e1..5dbb3cb05a82 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -421,6 +421,8 @@ extern void tty_driver_flush_buffer(struct tty_struct *tty);
421extern void tty_throttle(struct tty_struct *tty); 421extern void tty_throttle(struct tty_struct *tty);
422extern void tty_unthrottle(struct tty_struct *tty); 422extern void tty_unthrottle(struct tty_struct *tty);
423extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); 423extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws);
424extern void tty_driver_remove_tty(struct tty_driver *driver,
425 struct tty_struct *tty);
424extern void tty_shutdown(struct tty_struct *tty); 426extern void tty_shutdown(struct tty_struct *tty);
425extern void tty_free_termios(struct tty_struct *tty); 427extern void tty_free_termios(struct tty_struct *tty);
426extern int is_current_pgrp_orphaned(void); 428extern int is_current_pgrp_orphaned(void);
@@ -471,7 +473,9 @@ extern void proc_clear_tty(struct task_struct *p);
471extern struct tty_struct *get_current_tty(void); 473extern struct tty_struct *get_current_tty(void);
472extern void tty_default_fops(struct file_operations *fops); 474extern void tty_default_fops(struct file_operations *fops);
473extern struct tty_struct *alloc_tty_struct(void); 475extern struct tty_struct *alloc_tty_struct(void);
474extern int tty_add_file(struct tty_struct *tty, struct file *file); 476extern int tty_alloc_file(struct file *file);
477extern void tty_add_file(struct tty_struct *tty, struct file *file);
478extern void tty_free_file(struct file *file);
475extern void free_tty_struct(struct tty_struct *tty); 479extern void free_tty_struct(struct tty_struct *tty);
476extern void initialize_tty_struct(struct tty_struct *tty, 480extern void initialize_tty_struct(struct tty_struct *tty,
477 struct tty_driver *driver, int idx); 481 struct tty_driver *driver, int idx);
@@ -579,6 +583,8 @@ extern int __init tty_init(void);
579/* tty_ioctl.c */ 583/* tty_ioctl.c */
580extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, 584extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
581 unsigned int cmd, unsigned long arg); 585 unsigned int cmd, unsigned long arg);
586extern long n_tty_compat_ioctl_helper(struct tty_struct *tty, struct file *file,
587 unsigned int cmd, unsigned long arg);
582 588
583/* serial.c */ 589/* serial.c */
584 590
@@ -600,8 +606,24 @@ extern long vt_compat_ioctl(struct tty_struct *tty,
600/* functions for preparation of BKL removal */ 606/* functions for preparation of BKL removal */
601extern void __lockfunc tty_lock(void) __acquires(tty_lock); 607extern void __lockfunc tty_lock(void) __acquires(tty_lock);
602extern void __lockfunc tty_unlock(void) __releases(tty_lock); 608extern void __lockfunc tty_unlock(void) __releases(tty_lock);
603extern struct task_struct *__big_tty_mutex_owner; 609
604#define tty_locked() (current == __big_tty_mutex_owner) 610/*
611 * this shall be called only from where BTM is held (like close)
612 *
613 * We need this to ensure nobody waits for us to finish while we are waiting.
614 * Without this we were encountering system stalls.
615 *
616 * This should be indeed removed with BTM removal later.
617 *
618 * Locking: BTM required. Nobody is allowed to hold port->mutex.
619 */
620static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
621 long timeout)
622{
623 tty_unlock(); /* tty->ops->close holds the BTM, drop it while waiting */
624 tty_wait_until_sent(tty, timeout);
625 tty_lock();
626}
605 627
606/* 628/*
607 * wait_event_interruptible_tty -- wait for a condition with the tty lock held 629 * wait_event_interruptible_tty -- wait for a condition with the tty lock held
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 9deeac855240..ecdaeb98b293 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -47,6 +47,9 @@
47 * 47 *
48 * This routine is called synchronously when a particular tty device 48 * This routine is called synchronously when a particular tty device
49 * is closed for the last time freeing up the resources. 49 * is closed for the last time freeing up the resources.
50 * Note that tty_shutdown() is not called if ops->shutdown is defined.
51 * This means one is responsible to take care of calling ops->remove (e.g.
52 * via tty_driver_remove_tty) and releasing tty->termios.
50 * 53 *
51 * 54 *
52 * void (*cleanup)(struct tty_struct * tty); 55 * void (*cleanup)(struct tty_struct * tty);
diff --git a/include/linux/types.h b/include/linux/types.h
index 176da8c1fbb1..57a97234bec1 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -238,6 +238,16 @@ struct ustat {
238 char f_fpack[6]; 238 char f_fpack[6];
239}; 239};
240 240
241/**
242 * struct rcu_head - callback structure for use with RCU
243 * @next: next update requests in a list
244 * @func: actual update function to call after the grace period.
245 */
246struct rcu_head {
247 struct rcu_head *next;
248 void (*func)(struct rcu_head *head);
249};
250
241#endif /* __KERNEL__ */ 251#endif /* __KERNEL__ */
242#endif /* __ASSEMBLY__ */ 252#endif /* __ASSEMBLY__ */
243#endif /* _LINUX_TYPES_H */ 253#endif /* _LINUX_TYPES_H */
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index d28c726ede4f..2aa2881b0df9 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -68,7 +68,7 @@ struct uinput_device {
68 unsigned char head; 68 unsigned char head;
69 unsigned char tail; 69 unsigned char tail;
70 struct input_event buff[UINPUT_BUFFER_SIZE]; 70 struct input_event buff[UINPUT_BUFFER_SIZE];
71 int ff_effects_max; 71 unsigned int ff_effects_max;
72 72
73 struct uinput_request *requests[UINPUT_NUM_REQUESTS]; 73 struct uinput_request *requests[UINPUT_NUM_REQUESTS];
74 wait_queue_head_t requests_waitq; 74 wait_queue_head_t requests_waitq;
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 665517c05eaf..1ad4724458de 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -14,16 +14,19 @@
14#ifndef _UIO_DRIVER_H_ 14#ifndef _UIO_DRIVER_H_
15#define _UIO_DRIVER_H_ 15#define _UIO_DRIVER_H_
16 16
17#include <linux/module.h>
18#include <linux/fs.h> 17#include <linux/fs.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20 19
20struct module;
21struct uio_map; 21struct uio_map;
22 22
23/** 23/**
24 * struct uio_mem - description of a UIO memory region 24 * struct uio_mem - description of a UIO memory region
25 * @name: name of the memory region for identification 25 * @name: name of the memory region for identification
26 * @addr: address of the device's memory 26 * @addr: address of the device's memory (phys_addr is used since
27 * addr can be logical, virtual, or physical & phys_addr_t
28 * should always be large enough to handle any of the
29 * address types)
27 * @size: size of IO 30 * @size: size of IO
28 * @memtype: type of memory addr points to 31 * @memtype: type of memory addr points to
29 * @internal_addr: ioremap-ped version of addr, for driver internal use 32 * @internal_addr: ioremap-ped version of addr, for driver internal use
@@ -31,7 +34,7 @@ struct uio_map;
31 */ 34 */
32struct uio_mem { 35struct uio_mem {
33 const char *name; 36 const char *name;
34 unsigned long addr; 37 phys_addr_t addr;
35 unsigned long size; 38 unsigned long size;
36 int memtype; 39 int memtype;
37 void __iomem *internal_addr; 40 void __iomem *internal_addr;
@@ -98,11 +101,11 @@ extern int __must_check
98 __uio_register_device(struct module *owner, 101 __uio_register_device(struct module *owner,
99 struct device *parent, 102 struct device *parent,
100 struct uio_info *info); 103 struct uio_info *info);
101static inline int __must_check 104
102 uio_register_device(struct device *parent, struct uio_info *info) 105/* use a define to avoid include chaining to get THIS_MODULE */
103{ 106#define uio_register_device(parent, info) \
104 return __uio_register_device(THIS_MODULE, parent, info); 107 __uio_register_device(THIS_MODULE, parent, info)
105} 108
106extern void uio_unregister_device(struct uio_info *info); 109extern void uio_unregister_device(struct uio_info *info);
107extern void uio_event_notify(struct uio_info *info); 110extern void uio_event_notify(struct uio_info *info);
108 111
diff --git a/include/linux/un.h b/include/linux/un.h
index 45561c564b8e..3ed3e46c1b1f 100644
--- a/include/linux/un.h
+++ b/include/linux/un.h
@@ -1,10 +1,12 @@
1#ifndef _LINUX_UN_H 1#ifndef _LINUX_UN_H
2#define _LINUX_UN_H 2#define _LINUX_UN_H
3 3
4#include <linux/socket.h>
5
4#define UNIX_PATH_MAX 108 6#define UNIX_PATH_MAX 108
5 7
6struct sockaddr_un { 8struct sockaddr_un {
7 sa_family_t sun_family; /* AF_UNIX */ 9 __kernel_sa_family_t sun_family; /* AF_UNIX */
8 char sun_path[UNIX_PATH_MAX]; /* pathname */ 10 char sun_path[UNIX_PATH_MAX]; /* pathname */
9}; 11};
10 12
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 73c7df489607..d3d0c1374334 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -292,6 +292,16 @@ struct usb_host_config {
292 int extralen; 292 int extralen;
293}; 293};
294 294
295/* USB2.0 and USB3.0 device BOS descriptor set */
296struct usb_host_bos {
297 struct usb_bos_descriptor *desc;
298
299 /* wireless cap descriptor is handled by wusb */
300 struct usb_ext_cap_descriptor *ext_cap;
301 struct usb_ss_cap_descriptor *ss_cap;
302 struct usb_ss_container_id_descriptor *ss_id;
303};
304
295int __usb_get_extra_descriptor(char *buffer, unsigned size, 305int __usb_get_extra_descriptor(char *buffer, unsigned size,
296 unsigned char type, void **ptr); 306 unsigned char type, void **ptr);
297#define usb_get_extra_descriptor(ifpoint, type, ptr) \ 307#define usb_get_extra_descriptor(ifpoint, type, ptr) \
@@ -381,6 +391,7 @@ struct usb_tt;
381 * @ep0: endpoint 0 data (default control pipe) 391 * @ep0: endpoint 0 data (default control pipe)
382 * @dev: generic device interface 392 * @dev: generic device interface
383 * @descriptor: USB device descriptor 393 * @descriptor: USB device descriptor
394 * @bos: USB device BOS descriptor set
384 * @config: all of the device's configs 395 * @config: all of the device's configs
385 * @actconfig: the active configuration 396 * @actconfig: the active configuration
386 * @ep_in: array of IN endpoints 397 * @ep_in: array of IN endpoints
@@ -399,6 +410,9 @@ struct usb_tt;
399 * FIXME -- complete doc 410 * FIXME -- complete doc
400 * @authenticated: Crypto authentication passed 411 * @authenticated: Crypto authentication passed
401 * @wusb: device is Wireless USB 412 * @wusb: device is Wireless USB
413 * @lpm_capable: device supports LPM
414 * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM
415 * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled
402 * @string_langid: language ID for strings 416 * @string_langid: language ID for strings
403 * @product: iProduct string, if present (static) 417 * @product: iProduct string, if present (static)
404 * @manufacturer: iManufacturer string, if present (static) 418 * @manufacturer: iManufacturer string, if present (static)
@@ -442,6 +456,7 @@ struct usb_device {
442 struct device dev; 456 struct device dev;
443 457
444 struct usb_device_descriptor descriptor; 458 struct usb_device_descriptor descriptor;
459 struct usb_host_bos *bos;
445 struct usb_host_config *config; 460 struct usb_host_config *config;
446 461
447 struct usb_host_config *actconfig; 462 struct usb_host_config *actconfig;
@@ -460,6 +475,9 @@ struct usb_device {
460 unsigned authorized:1; 475 unsigned authorized:1;
461 unsigned authenticated:1; 476 unsigned authenticated:1;
462 unsigned wusb:1; 477 unsigned wusb:1;
478 unsigned lpm_capable:1;
479 unsigned usb2_hw_lpm_capable:1;
480 unsigned usb2_hw_lpm_enabled:1;
463 int string_langid; 481 int string_langid;
464 482
465 /* static strings from the device */ 483 /* static strings from the device */
@@ -928,10 +946,11 @@ struct usb_class_driver {
928 */ 946 */
929extern int usb_register_driver(struct usb_driver *, struct module *, 947extern int usb_register_driver(struct usb_driver *, struct module *,
930 const char *); 948 const char *);
931static inline int usb_register(struct usb_driver *driver) 949
932{ 950/* use a define to avoid include chaining to get THIS_MODULE & friends */
933 return usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME); 951#define usb_register(driver) \
934} 952 usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
953
935extern void usb_deregister(struct usb_driver *); 954extern void usb_deregister(struct usb_driver *);
936 955
937extern int usb_register_device_driver(struct usb_device_driver *, 956extern int usb_register_device_driver(struct usb_device_driver *,
@@ -1574,7 +1593,7 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
1574 return 0; 1593 return 0;
1575 1594
1576 /* NOTE: only 0x07ff bits are for packet size... */ 1595 /* NOTE: only 0x07ff bits are for packet size... */
1577 return le16_to_cpu(ep->desc.wMaxPacketSize); 1596 return usb_endpoint_maxp(&ep->desc);
1578} 1597}
1579 1598
1580/* ----------------------------------------------------------------------- */ 1599/* ----------------------------------------------------------------------- */
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild
index ed91fb62674b..b607f3532e88 100644
--- a/include/linux/usb/Kbuild
+++ b/include/linux/usb/Kbuild
@@ -7,3 +7,4 @@ header-y += gadgetfs.h
7header-y += midi.h 7header-y += midi.h
8header-y += g_printer.h 8header-y += g_printer.h
9header-y += tmc.h 9header-y += tmc.h
10header-y += video.h
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 0fd3fbdd8283..d5da6c68c250 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -34,6 +34,7 @@
34#define __LINUX_USB_CH9_H 34#define __LINUX_USB_CH9_H
35 35
36#include <linux/types.h> /* __u8 etc */ 36#include <linux/types.h> /* __u8 etc */
37#include <asm/byteorder.h> /* le16_to_cpu */
37 38
38/*-------------------------------------------------------------------------*/ 39/*-------------------------------------------------------------------------*/
39 40
@@ -143,6 +144,11 @@
143#define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */ 144#define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */
144 145
145#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00 146#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00
147/*
148 * Suspend Options, Table 9-7 USB 3.0 spec
149 */
150#define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0))
151#define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1))
146 152
147#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ 153#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
148 154
@@ -377,12 +383,6 @@ struct usb_endpoint_descriptor {
377#define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ 383#define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */
378#define USB_ENDPOINT_DIR_MASK 0x80 384#define USB_ENDPOINT_DIR_MASK 0x80
379 385
380#define USB_ENDPOINT_SYNCTYPE 0x0c
381#define USB_ENDPOINT_SYNC_NONE (0 << 2)
382#define USB_ENDPOINT_SYNC_ASYNC (1 << 2)
383#define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2)
384#define USB_ENDPOINT_SYNC_SYNC (3 << 2)
385
386#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ 386#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */
387#define USB_ENDPOINT_XFER_CONTROL 0 387#define USB_ENDPOINT_XFER_CONTROL 0
388#define USB_ENDPOINT_XFER_ISOC 1 388#define USB_ENDPOINT_XFER_ISOC 1
@@ -390,6 +390,17 @@ struct usb_endpoint_descriptor {
390#define USB_ENDPOINT_XFER_INT 3 390#define USB_ENDPOINT_XFER_INT 3
391#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 391#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
392 392
393#define USB_ENDPOINT_SYNCTYPE 0x0c
394#define USB_ENDPOINT_SYNC_NONE (0 << 2)
395#define USB_ENDPOINT_SYNC_ASYNC (1 << 2)
396#define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2)
397#define USB_ENDPOINT_SYNC_SYNC (3 << 2)
398
399#define USB_ENDPOINT_USAGE_MASK 0x30
400#define USB_ENDPOINT_USAGE_DATA 0x00
401#define USB_ENDPOINT_USAGE_FEEDBACK 0x10
402#define USB_ENDPOINT_USAGE_IMPLICIT_FB 0x20 /* Implicit feedback Data endpoint */
403
393/*-------------------------------------------------------------------------*/ 404/*-------------------------------------------------------------------------*/
394 405
395/** 406/**
@@ -570,6 +581,17 @@ static inline int usb_endpoint_is_isoc_out(
570 return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); 581 return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
571} 582}
572 583
584/**
585 * usb_endpoint_maxp - get endpoint's max packet size
586 * @epd: endpoint to be checked
587 *
588 * Returns @epd's max packet
589 */
590static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
591{
592 return le16_to_cpu(epd->wMaxPacketSize);
593}
594
573/*-------------------------------------------------------------------------*/ 595/*-------------------------------------------------------------------------*/
574 596
575/* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ 597/* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */
@@ -851,6 +873,18 @@ enum usb_device_speed {
851 USB_SPEED_SUPER, /* usb 3.0 */ 873 USB_SPEED_SUPER, /* usb 3.0 */
852}; 874};
853 875
876#ifdef __KERNEL__
877
878/**
879 * usb_speed_string() - Returns human readable-name of the speed.
880 * @speed: The speed to return human-readable name for. If it's not
881 * any of the speeds defined in usb_device_speed enum, string for
882 * USB_SPEED_UNKNOWN will be returned.
883 */
884extern const char *usb_speed_string(enum usb_device_speed speed);
885
886#endif
887
854enum usb_device_state { 888enum usb_device_state {
855 /* NOTATTACHED isn't in the USB spec, and this state acts 889 /* NOTATTACHED isn't in the USB spec, and this state acts
856 * the same as ATTACHED ... but it's clearer this way. 890 * the same as ATTACHED ... but it's clearer this way.
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 087f4b931833..1d3a67523ffc 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -437,9 +437,9 @@ static inline void usb_ep_fifo_flush(struct usb_ep *ep)
437 437
438struct usb_dcd_config_params { 438struct usb_dcd_config_params {
439 __u8 bU1devExitLat; /* U1 Device exit Latency */ 439 __u8 bU1devExitLat; /* U1 Device exit Latency */
440#define USB_DEFULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */ 440#define USB_DEFAULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */
441 __le16 bU2DevExitLat; /* U2 Device exit Latency */ 441 __le16 bU2DevExitLat; /* U2 Device exit Latency */
442#define USB_DEFULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */ 442#define USB_DEFAULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */
443}; 443};
444 444
445 445
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 0097136ba45d..03354d557b79 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -178,7 +178,7 @@ struct usb_hcd {
178 * this structure. 178 * this structure.
179 */ 179 */
180 unsigned long hcd_priv[0] 180 unsigned long hcd_priv[0]
181 __attribute__ ((aligned(sizeof(unsigned long)))); 181 __attribute__ ((aligned(sizeof(s64))));
182}; 182};
183 183
184/* 2.4 does this a bit differently ... */ 184/* 2.4 does this a bit differently ... */
@@ -343,6 +343,7 @@ struct hc_driver {
343 * address is set 343 * address is set
344 */ 344 */
345 int (*update_device)(struct usb_hcd *, struct usb_device *); 345 int (*update_device)(struct usb_hcd *, struct usb_device *);
346 int (*set_usb2_hw_lpm)(struct usb_hcd *, struct usb_device *, int);
346}; 347};
347 348
348extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); 349extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
diff --git a/include/linux/usb/r8a66597.h b/include/linux/usb/r8a66597.h
index b6b8660d0c68..55805f9dcf21 100644
--- a/include/linux/usb/r8a66597.h
+++ b/include/linux/usb/r8a66597.h
@@ -48,6 +48,9 @@ struct r8a66597_platdata {
48 48
49 /* (external controller only) set one = WR0_N shorted to WR1_N */ 49 /* (external controller only) set one = WR0_N shorted to WR1_N */
50 unsigned wr0_shorted_to_wr1:1; 50 unsigned wr0_shorted_to_wr1:1;
51
52 /* set one = using SUDMAC */
53 unsigned sudmac:1;
51}; 54};
52 55
53/* Register definitions */ 56/* Register definitions */
@@ -417,5 +420,62 @@ struct r8a66597_platdata {
417#define USBSPD 0x00C0 420#define USBSPD 0x00C0
418#define RTPORT 0x0001 421#define RTPORT 0x0001
419 422
423/* SUDMAC registers */
424#define CH0CFG 0x00
425#define CH1CFG 0x04
426#define CH0BA 0x10
427#define CH1BA 0x14
428#define CH0BBC 0x18
429#define CH1BBC 0x1C
430#define CH0CA 0x20
431#define CH1CA 0x24
432#define CH0CBC 0x28
433#define CH1CBC 0x2C
434#define CH0DEN 0x30
435#define CH1DEN 0x34
436#define DSTSCLR 0x38
437#define DBUFCTRL 0x3C
438#define DINTCTRL 0x40
439#define DINTSTS 0x44
440#define DINTSTSCLR 0x48
441#define CH0SHCTRL 0x50
442#define CH1SHCTRL 0x54
443
444/* SUDMAC Configuration Registers */
445#define SENDBUFM 0x1000 /* b12: Transmit Buffer Mode */
446#define RCVENDM 0x0100 /* b8: Receive Data Transfer End Mode */
447#define LBA_WAIT 0x0030 /* b5-4: Local Bus Access Wait */
448
449/* DMA Enable Registers */
450#define DEN 0x0001 /* b1: DMA Transfer Enable */
451
452/* DMA Status Clear Register */
453#define CH1STCLR 0x0002 /* b2: Ch1 DMA Status Clear */
454#define CH0STCLR 0x0001 /* b1: Ch0 DMA Status Clear */
455
456/* DMA Buffer Control Register */
457#define CH1BUFW 0x0200 /* b9: Ch1 DMA Buffer Data Transfer Enable */
458#define CH0BUFW 0x0100 /* b8: Ch0 DMA Buffer Data Transfer Enable */
459#define CH1BUFS 0x0002 /* b2: Ch1 DMA Buffer Data Status */
460#define CH0BUFS 0x0001 /* b1: Ch0 DMA Buffer Data Status */
461
462/* DMA Interrupt Control Register */
463#define CH1ERRE 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Enable */
464#define CH0ERRE 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Enable */
465#define CH1ENDE 0x0002 /* b2: Ch1 DMA Transfer End Int Enable */
466#define CH0ENDE 0x0001 /* b1: Ch0 DMA Transfer End Int Enable */
467
468/* DMA Interrupt Status Register */
469#define CH1ERRS 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Status */
470#define CH0ERRS 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Status */
471#define CH1ENDS 0x0002 /* b2: Ch1 DMA Transfer End Int Status */
472#define CH0ENDS 0x0001 /* b1: Ch0 DMA Transfer End Int Status */
473
474/* DMA Interrupt Status Clear Register */
475#define CH1ERRC 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Stat Clear */
476#define CH0ERRC 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Stat Clear */
477#define CH1ENDC 0x0002 /* b2: Ch1 DMA Transfer End Int Stat Clear */
478#define CH0ENDC 0x0001 /* b1: Ch0 DMA Transfer End Int Stat Clear */
479
420#endif /* __LINUX_USB_R8A66597_H */ 480#endif /* __LINUX_USB_R8A66597_H */
421 481
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 8977431259c6..e5a40c318548 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -82,6 +82,13 @@ struct renesas_usbhs_platform_callback {
82 * get VBUS status function. 82 * get VBUS status function.
83 */ 83 */
84 int (*get_vbus)(struct platform_device *pdev); 84 int (*get_vbus)(struct platform_device *pdev);
85
86 /*
87 * option:
88 *
89 * VBUS control is needed for Host
90 */
91 int (*set_vbus)(struct platform_device *pdev, int enable);
85}; 92};
86 93
87/* 94/*
@@ -101,6 +108,8 @@ struct renesas_usbhs_driver_param {
101 * option: 108 * option:
102 * 109 *
103 * for BUSWAIT :: BWAIT 110 * for BUSWAIT :: BWAIT
111 * see
112 * renesas_usbhs/common.c :: usbhsc_set_buswait()
104 * */ 113 * */
105 int buswait_bwait; 114 int buswait_bwait;
106 115
@@ -127,6 +136,11 @@ struct renesas_usbhs_driver_param {
127 * pio <--> dma border. 136 * pio <--> dma border.
128 */ 137 */
129 int pio_dma_border; /* default is 64byte */ 138 int pio_dma_border; /* default is 64byte */
139
140 /*
141 * option:
142 */
143 u32 has_otg:1; /* for controlling PWEN/EXTLP */
130}; 144};
131 145
132/* 146/*
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index 4e5b0213fdc1..c714ed75eae2 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -37,6 +37,14 @@ struct new_utsname {
37#include <linux/nsproxy.h> 37#include <linux/nsproxy.h>
38#include <linux/err.h> 38#include <linux/err.h>
39 39
40enum uts_proc {
41 UTS_PROC_OSTYPE,
42 UTS_PROC_OSRELEASE,
43 UTS_PROC_VERSION,
44 UTS_PROC_HOSTNAME,
45 UTS_PROC_DOMAINNAME,
46};
47
40struct user_namespace; 48struct user_namespace;
41extern struct user_namespace init_user_ns; 49extern struct user_namespace init_user_ns;
42 50
@@ -80,6 +88,14 @@ static inline struct uts_namespace *copy_utsname(unsigned long flags,
80} 88}
81#endif 89#endif
82 90
91#ifdef CONFIG_PROC_SYSCTL
92extern void uts_proc_notify(enum uts_proc proc);
93#else
94static inline void uts_proc_notify(enum uts_proc proc)
95{
96}
97#endif
98
83static inline struct new_utsname *utsname(void) 99static inline struct new_utsname *utsname(void)
84{ 100{
85 return &current->nsproxy->uts_ns->name; 101 return &current->nsproxy->uts_ns->name;
diff --git a/include/linux/uwb.h b/include/linux/uwb.h
index b0c564ec2160..7dbbee9741b7 100644
--- a/include/linux/uwb.h
+++ b/include/linux/uwb.h
@@ -33,6 +33,7 @@
33#include <linux/wait.h> 33#include <linux/wait.h>
34#include <linux/workqueue.h> 34#include <linux/workqueue.h>
35#include <linux/uwb/spec.h> 35#include <linux/uwb/spec.h>
36#include <asm/page.h>
36 37
37struct uwb_dev; 38struct uwb_dev;
38struct uwb_beca_e; 39struct uwb_beca_e;
diff --git a/include/linux/uwb/umc.h b/include/linux/uwb/umc.h
index 7b4842028ca7..891d1d5f3947 100644
--- a/include/linux/uwb/umc.h
+++ b/include/linux/uwb/umc.h
@@ -111,10 +111,9 @@ int __must_check __umc_driver_register(struct umc_driver *umc_drv,
111 * umc_driver_register - register a UMC capabiltity driver. 111 * umc_driver_register - register a UMC capabiltity driver.
112 * @umc_drv: pointer to the driver. 112 * @umc_drv: pointer to the driver.
113 */ 113 */
114static inline int __must_check umc_driver_register(struct umc_driver *umc_drv) 114#define umc_driver_register(umc_drv) \
115{ 115 __umc_driver_register(umc_drv, THIS_MODULE, KBUILD_MODNAME)
116 return __umc_driver_register(umc_drv, THIS_MODULE, KBUILD_MODNAME); 116
117}
118void umc_driver_unregister(struct umc_driver *umc_drv); 117void umc_driver_unregister(struct umc_driver *umc_drv);
119 118
120/* 119/*
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h
index cf97b5b9d1fe..6f8fbcf10dfb 100644
--- a/include/linux/vermagic.h
+++ b/include/linux/vermagic.h
@@ -1,5 +1,4 @@
1#include <generated/utsrelease.h> 1#include <generated/utsrelease.h>
2#include <linux/module.h>
3 2
4/* Simply sanity version stamp for modules. */ 3/* Simply sanity version stamp for modules. */
5#ifdef CONFIG_SMP 4#ifdef CONFIG_SMP
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index fca24cc50436..4b752d5ee80e 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -653,6 +653,10 @@ struct v4l2_buffer {
653#define V4L2_BUF_FLAG_ERROR 0x0040 653#define V4L2_BUF_FLAG_ERROR 0x0040
654#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ 654#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
655#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ 655#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
656#define V4L2_BUF_FLAG_PREPARED 0x0400 /* Buffer is prepared for queuing */
657/* Cache handling flags */
658#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
659#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
656 660
657/* 661/*
658 * O V E R L A Y P R E V I E W 662 * O V E R L A Y P R E V I E W
@@ -759,10 +763,10 @@ typedef __u64 v4l2_std_id;
759#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400) 763#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
760#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800) 764#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
761 765
762#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) 766#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) /* BTSC */
763#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) 767#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) /* EIA-J */
764#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) 768#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
765#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) 769#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) /* FM A2 */
766 770
767#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) 771#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
768#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) 772#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
@@ -786,47 +790,86 @@ typedef __u64 v4l2_std_id;
786 v4l2-common.c should be fixed. 790 v4l2-common.c should be fixed.
787 */ 791 */
788 792
789/* some merged standards */ 793/*
790#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) 794 * Some macros to merge video standards in order to make live easier for the
791#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) 795 * drivers and V4L2 applications
792#define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H) 796 */
793#define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK)
794 797
795/* some common needed stuff */ 798/*
796#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ 799 * "Common" NTSC/M - It should be noticed that V4L2_STD_NTSC_443 is
797 V4L2_STD_PAL_B1 |\ 800 * Missing here.
798 V4L2_STD_PAL_G) 801 */
799#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
800 V4L2_STD_PAL_D1 |\
801 V4L2_STD_PAL_K)
802#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
803 V4L2_STD_PAL_DK |\
804 V4L2_STD_PAL_H |\
805 V4L2_STD_PAL_I)
806#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ 802#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
807 V4L2_STD_NTSC_M_JP |\ 803 V4L2_STD_NTSC_M_JP |\
808 V4L2_STD_NTSC_M_KR) 804 V4L2_STD_NTSC_M_KR)
805/* Secam macros */
809#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ 806#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
810 V4L2_STD_SECAM_K |\ 807 V4L2_STD_SECAM_K |\
811 V4L2_STD_SECAM_K1) 808 V4L2_STD_SECAM_K1)
809/* All Secam Standards */
812#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\ 810#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
813 V4L2_STD_SECAM_G |\ 811 V4L2_STD_SECAM_G |\
814 V4L2_STD_SECAM_H |\ 812 V4L2_STD_SECAM_H |\
815 V4L2_STD_SECAM_DK |\ 813 V4L2_STD_SECAM_DK |\
816 V4L2_STD_SECAM_L |\ 814 V4L2_STD_SECAM_L |\
817 V4L2_STD_SECAM_LC) 815 V4L2_STD_SECAM_LC)
816/* PAL macros */
817#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
818 V4L2_STD_PAL_B1 |\
819 V4L2_STD_PAL_G)
820#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
821 V4L2_STD_PAL_D1 |\
822 V4L2_STD_PAL_K)
823/*
824 * "Common" PAL - This macro is there to be compatible with the old
825 * V4L1 concept of "PAL": /BGDKHI.
826 * Several PAL standards are mising here: /M, /N and /Nc
827 */
828#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
829 V4L2_STD_PAL_DK |\
830 V4L2_STD_PAL_H |\
831 V4L2_STD_PAL_I)
832/* Chroma "agnostic" standards */
833#define V4L2_STD_B (V4L2_STD_PAL_B |\
834 V4L2_STD_PAL_B1 |\
835 V4L2_STD_SECAM_B)
836#define V4L2_STD_G (V4L2_STD_PAL_G |\
837 V4L2_STD_SECAM_G)
838#define V4L2_STD_H (V4L2_STD_PAL_H |\
839 V4L2_STD_SECAM_H)
840#define V4L2_STD_L (V4L2_STD_SECAM_L |\
841 V4L2_STD_SECAM_LC)
842#define V4L2_STD_GH (V4L2_STD_G |\
843 V4L2_STD_H)
844#define V4L2_STD_DK (V4L2_STD_PAL_DK |\
845 V4L2_STD_SECAM_DK)
846#define V4L2_STD_BG (V4L2_STD_B |\
847 V4L2_STD_G)
848#define V4L2_STD_MN (V4L2_STD_PAL_M |\
849 V4L2_STD_PAL_N |\
850 V4L2_STD_PAL_Nc |\
851 V4L2_STD_NTSC)
818 852
853/* Standards where MTS/BTSC stereo could be found */
854#define V4L2_STD_MTS (V4L2_STD_NTSC_M |\
855 V4L2_STD_PAL_M |\
856 V4L2_STD_PAL_N |\
857 V4L2_STD_PAL_Nc)
858
859/* Standards for Countries with 60Hz Line frequency */
819#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ 860#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
820 V4L2_STD_PAL_60 |\ 861 V4L2_STD_PAL_60 |\
821 V4L2_STD_NTSC |\ 862 V4L2_STD_NTSC |\
822 V4L2_STD_NTSC_443) 863 V4L2_STD_NTSC_443)
864/* Standards for Countries with 50Hz Line frequency */
823#define V4L2_STD_625_50 (V4L2_STD_PAL |\ 865#define V4L2_STD_625_50 (V4L2_STD_PAL |\
824 V4L2_STD_PAL_N |\ 866 V4L2_STD_PAL_N |\
825 V4L2_STD_PAL_Nc |\ 867 V4L2_STD_PAL_Nc |\
826 V4L2_STD_SECAM) 868 V4L2_STD_SECAM)
869
827#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ 870#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
828 V4L2_STD_ATSC_16_VSB) 871 V4L2_STD_ATSC_16_VSB)
829 872/* Macros with none and all analog standards */
830#define V4L2_STD_UNKNOWN 0 873#define V4L2_STD_UNKNOWN 0
831#define V4L2_STD_ALL (V4L2_STD_525_60 |\ 874#define V4L2_STD_ALL (V4L2_STD_525_60 |\
832 V4L2_STD_625_50) 875 V4L2_STD_625_50)
@@ -1082,6 +1125,7 @@ struct v4l2_querymenu {
1082#define V4L2_CTRL_FLAG_INACTIVE 0x0010 1125#define V4L2_CTRL_FLAG_INACTIVE 0x0010
1083#define V4L2_CTRL_FLAG_SLIDER 0x0020 1126#define V4L2_CTRL_FLAG_SLIDER 0x0020
1084#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 1127#define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
1128#define V4L2_CTRL_FLAG_VOLATILE 0x0080
1085 1129
1086/* Query flag, to be ORed with the control ID */ 1130/* Query flag, to be ORed with the control ID */
1087#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 1131#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
@@ -1125,6 +1169,7 @@ enum v4l2_power_line_frequency {
1125 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, 1169 V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0,
1126 V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1, 1170 V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1,
1127 V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2, 1171 V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2,
1172 V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3,
1128}; 1173};
1129#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25) 1174#define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
1130#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26) 1175#define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
@@ -2006,6 +2051,7 @@ struct v4l2_streamparm {
2006#define V4L2_EVENT_VSYNC 1 2051#define V4L2_EVENT_VSYNC 1
2007#define V4L2_EVENT_EOS 2 2052#define V4L2_EVENT_EOS 2
2008#define V4L2_EVENT_CTRL 3 2053#define V4L2_EVENT_CTRL 3
2054#define V4L2_EVENT_FRAME_SYNC 4
2009#define V4L2_EVENT_PRIVATE_START 0x08000000 2055#define V4L2_EVENT_PRIVATE_START 0x08000000
2010 2056
2011/* Payload for V4L2_EVENT_VSYNC */ 2057/* Payload for V4L2_EVENT_VSYNC */
@@ -2032,12 +2078,17 @@ struct v4l2_event_ctrl {
2032 __s32 default_value; 2078 __s32 default_value;
2033}; 2079};
2034 2080
2081struct v4l2_event_frame_sync {
2082 __u32 frame_sequence;
2083};
2084
2035struct v4l2_event { 2085struct v4l2_event {
2036 __u32 type; 2086 __u32 type;
2037 union { 2087 union {
2038 struct v4l2_event_vsync vsync; 2088 struct v4l2_event_vsync vsync;
2039 struct v4l2_event_ctrl ctrl; 2089 struct v4l2_event_ctrl ctrl;
2040 __u8 data[64]; 2090 struct v4l2_event_frame_sync frame_sync;
2091 __u8 data[64];
2041 } u; 2092 } u;
2042 __u32 pending; 2093 __u32 pending;
2043 __u32 sequence; 2094 __u32 sequence;
@@ -2092,6 +2143,23 @@ struct v4l2_dbg_chip_ident {
2092 __u32 revision; /* chip revision, chip specific */ 2143 __u32 revision; /* chip revision, chip specific */
2093} __attribute__ ((packed)); 2144} __attribute__ ((packed));
2094 2145
2146/**
2147 * struct v4l2_create_buffers - VIDIOC_CREATE_BUFS argument
2148 * @index: on return, index of the first created buffer
2149 * @count: entry: number of requested buffers,
2150 * return: number of created buffers
2151 * @memory: buffer memory type
2152 * @format: frame format, for which buffers are requested
2153 * @reserved: future extensions
2154 */
2155struct v4l2_create_buffers {
2156 __u32 index;
2157 __u32 count;
2158 enum v4l2_memory memory;
2159 struct v4l2_format format;
2160 __u32 reserved[8];
2161};
2162
2095/* 2163/*
2096 * I O C T L C O D E S F O R V I D E O D E V I C E S 2164 * I O C T L C O D E S F O R V I D E O D E V I C E S
2097 * 2165 *
@@ -2182,6 +2250,11 @@ struct v4l2_dbg_chip_ident {
2182#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription) 2250#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
2183#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription) 2251#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
2184 2252
2253/* Experimental, the below two ioctls may change over the next couple of kernel
2254 versions */
2255#define VIDIOC_CREATE_BUFS _IOWR('V', 92, struct v4l2_create_buffers)
2256#define VIDIOC_PREPARE_BUF _IOWR('V', 93, struct v4l2_buffer)
2257
2185/* Reminder: when adding new ioctls please add support for them to 2258/* Reminder: when adding new ioctls please add support for them to
2186 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 2259 drivers/media/video/v4l2-compat-ioctl32.c as well! */
2187 2260
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 710885749605..4c069d8bd740 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -61,6 +61,9 @@ struct virtqueue {
61 * virtqueue_detach_unused_buf: detach first unused buffer 61 * virtqueue_detach_unused_buf: detach first unused buffer
62 * vq: the struct virtqueue we're talking about. 62 * vq: the struct virtqueue we're talking about.
63 * Returns NULL or the "data" token handed to add_buf 63 * Returns NULL or the "data" token handed to add_buf
64 * virtqueue_get_vring_size: return the size of the virtqueue's vring
65 * vq: the struct virtqueue containing the vring of interest.
66 * Returns the size of the vring.
64 * 67 *
65 * Locking rules are straightforward: the driver is responsible for 68 * Locking rules are straightforward: the driver is responsible for
66 * locking. No two operations may be invoked simultaneously, with the exception 69 * locking. No two operations may be invoked simultaneously, with the exception
@@ -97,6 +100,8 @@ bool virtqueue_enable_cb_delayed(struct virtqueue *vq);
97 100
98void *virtqueue_detach_unused_buf(struct virtqueue *vq); 101void *virtqueue_detach_unused_buf(struct virtqueue *vq);
99 102
103unsigned int virtqueue_get_vring_size(struct virtqueue *vq);
104
100/** 105/**
101 * virtio_device - representation of a device using virtio 106 * virtio_device - representation of a device using virtio
102 * @index: unique position on the virtio bus 107 * @index: unique position on the virtio bus
@@ -126,10 +131,10 @@ void unregister_virtio_device(struct virtio_device *dev);
126 * virtio_driver - operations for a virtio I/O driver 131 * virtio_driver - operations for a virtio I/O driver
127 * @driver: underlying device driver (populate name and owner). 132 * @driver: underlying device driver (populate name and owner).
128 * @id_table: the ids serviced by this driver. 133 * @id_table: the ids serviced by this driver.
129 * @feature_table: an array of feature numbers supported by this device. 134 * @feature_table: an array of feature numbers supported by this driver.
130 * @feature_table_size: number of entries in the feature table array. 135 * @feature_table_size: number of entries in the feature table array.
131 * @probe: the function to call when a device is found. Returns 0 or -errno. 136 * @probe: the function to call when a device is found. Returns 0 or -errno.
132 * @remove: the function when a device is removed. 137 * @remove: the function to call when a device is removed.
133 * @config_changed: optional function to call when the device configuration 138 * @config_changed: optional function to call when the device configuration
134 * changes; may be called in interrupt context. 139 * changes; may be called in interrupt context.
135 */ 140 */
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 39c88c5ad19d..add4790b21fe 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -155,6 +155,9 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev,
155#define virtio_config_val(vdev, fbit, offset, v) \ 155#define virtio_config_val(vdev, fbit, offset, v) \
156 virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v)) 156 virtio_config_buf((vdev), (fbit), (offset), (v), sizeof(*v))
157 157
158#define virtio_config_val_len(vdev, fbit, offset, v, len) \
159 virtio_config_buf((vdev), (fbit), (offset), (v), (len))
160
158static inline int virtio_config_buf(struct virtio_device *vdev, 161static inline int virtio_config_buf(struct virtio_device *vdev,
159 unsigned int fbit, 162 unsigned int fbit,
160 unsigned int offset, 163 unsigned int offset,
diff --git a/include/linux/virtio_mmio.h b/include/linux/virtio_mmio.h
new file mode 100644
index 000000000000..27c7edefbc86
--- /dev/null
+++ b/include/linux/virtio_mmio.h
@@ -0,0 +1,111 @@
1/*
2 * Virtio platform device driver
3 *
4 * Copyright 2011, ARM Ltd.
5 *
6 * Based on Virtio PCI driver by Anthony Liguori, copyright IBM Corp. 2007
7 *
8 * This header is BSD licensed so anyone can use the definitions to implement
9 * compatible drivers/servers.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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 IBM nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35#ifndef _LINUX_VIRTIO_MMIO_H
36#define _LINUX_VIRTIO_MMIO_H
37
38/*
39 * Control registers
40 */
41
42/* Magic value ("virt" string) - Read Only */
43#define VIRTIO_MMIO_MAGIC_VALUE 0x000
44
45/* Virtio device version - Read Only */
46#define VIRTIO_MMIO_VERSION 0x004
47
48/* Virtio device ID - Read Only */
49#define VIRTIO_MMIO_DEVICE_ID 0x008
50
51/* Virtio vendor ID - Read Only */
52#define VIRTIO_MMIO_VENDOR_ID 0x00c
53
54/* Bitmask of the features supported by the host
55 * (32 bits per set) - Read Only */
56#define VIRTIO_MMIO_HOST_FEATURES 0x010
57
58/* Host features set selector - Write Only */
59#define VIRTIO_MMIO_HOST_FEATURES_SEL 0x014
60
61/* Bitmask of features activated by the guest
62 * (32 bits per set) - Write Only */
63#define VIRTIO_MMIO_GUEST_FEATURES 0x020
64
65/* Activated features set selector - Write Only */
66#define VIRTIO_MMIO_GUEST_FEATURES_SET 0x024
67
68/* Guest's memory page size in bytes - Write Only */
69#define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028
70
71/* Queue selector - Write Only */
72#define VIRTIO_MMIO_QUEUE_SEL 0x030
73
74/* Maximum size of the currently selected queue - Read Only */
75#define VIRTIO_MMIO_QUEUE_NUM_MAX 0x034
76
77/* Queue size for the currently selected queue - Write Only */
78#define VIRTIO_MMIO_QUEUE_NUM 0x038
79
80/* Used Ring alignment for the currently selected queue - Write Only */
81#define VIRTIO_MMIO_QUEUE_ALIGN 0x03c
82
83/* Guest's PFN for the currently selected queue - Read Write */
84#define VIRTIO_MMIO_QUEUE_PFN 0x040
85
86/* Queue notifier - Write Only */
87#define VIRTIO_MMIO_QUEUE_NOTIFY 0x050
88
89/* Interrupt status - Read Only */
90#define VIRTIO_MMIO_INTERRUPT_STATUS 0x060
91
92/* Interrupt acknowledge - Write Only */
93#define VIRTIO_MMIO_INTERRUPT_ACK 0x064
94
95/* Device status register - Read Write */
96#define VIRTIO_MMIO_STATUS 0x070
97
98/* The config space is defined by each driver as
99 * the per-driver configuration space - Read Write */
100#define VIRTIO_MMIO_CONFIG 0x100
101
102
103
104/*
105 * Interrupt flags (re: interrupt status & acknowledge registers)
106 */
107
108#define VIRTIO_MMIO_INT_VRING (1 << 0)
109#define VIRTIO_MMIO_INT_CONFIG (1 << 1)
110
111#endif
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index 4a32cb6da425..36be0f6e18a9 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -135,13 +135,13 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p,
135 vr->num = num; 135 vr->num = num;
136 vr->desc = p; 136 vr->desc = p;
137 vr->avail = p + num*sizeof(struct vring_desc); 137 vr->avail = p + num*sizeof(struct vring_desc);
138 vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + align-1) 138 vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + sizeof(__u16)
139 & ~(align - 1)); 139 + align-1) & ~(align - 1));
140} 140}
141 141
142static inline unsigned vring_size(unsigned int num, unsigned long align) 142static inline unsigned vring_size(unsigned int num, unsigned long align)
143{ 143{
144 return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) 144 return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (3 + num)
145 + align - 1) & ~(align - 1)) 145 + align - 1) & ~(align - 1))
146 + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num; 146 + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num;
147} 147}
diff --git a/include/linux/vlynq.h b/include/linux/vlynq.h
index 8f6a95882b09..017d4a53d55e 100644
--- a/include/linux/vlynq.h
+++ b/include/linux/vlynq.h
@@ -20,9 +20,10 @@
20#define __VLYNQ_H__ 20#define __VLYNQ_H__
21 21
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/module.h>
24#include <linux/types.h> 23#include <linux/types.h>
25 24
25struct module;
26
26#define VLYNQ_NUM_IRQS 32 27#define VLYNQ_NUM_IRQS 32
27 28
28struct vlynq_mapping { 29struct vlynq_mapping {
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 9332e52ea8c2..687fb11e2010 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -13,6 +13,7 @@ struct vm_area_struct; /* vma defining user mapping in mm_types.h */
13#define VM_MAP 0x00000004 /* vmap()ed pages */ 13#define VM_MAP 0x00000004 /* vmap()ed pages */
14#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ 14#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */
15#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ 15#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */
16#define VM_UNLIST 0x00000020 /* vm_struct is not listed in vmlist */
16/* bits [20..32] reserved for arch specific ioremap internals */ 17/* bits [20..32] reserved for arch specific ioremap internals */
17 18
18/* 19/*
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index f1bfa12ea246..a378c295851f 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -12,15 +12,6 @@
12 * 12 *
13 * (thresh - thresh/DIRTY_FULL_SCOPE, thresh) 13 * (thresh - thresh/DIRTY_FULL_SCOPE, thresh)
14 * 14 *
15 * The 1/16 region above the global dirty limit will be put to maximum pauses:
16 *
17 * (limit, limit + limit/DIRTY_MAXPAUSE_AREA)
18 *
19 * The 1/16 region above the max-pause region, dirty exceeded bdi's will be put
20 * to loops:
21 *
22 * (limit + limit/DIRTY_MAXPAUSE_AREA, limit + limit/DIRTY_PASSGOOD_AREA)
23 *
24 * Further beyond, all dirtier tasks will enter a loop waiting (possibly long 15 * Further beyond, all dirtier tasks will enter a loop waiting (possibly long
25 * time) for the dirty pages to drop, unless written enough pages. 16 * time) for the dirty pages to drop, unless written enough pages.
26 * 17 *
@@ -31,8 +22,6 @@
31 */ 22 */
32#define DIRTY_SCOPE 8 23#define DIRTY_SCOPE 8
33#define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2) 24#define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2)
34#define DIRTY_MAXPAUSE_AREA 16
35#define DIRTY_PASSGOOD_AREA 8
36 25
37/* 26/*
38 * 4MB minimal write chunk size 27 * 4MB minimal write chunk size
@@ -50,6 +39,23 @@ enum writeback_sync_modes {
50}; 39};
51 40
52/* 41/*
42 * why some writeback work was initiated
43 */
44enum wb_reason {
45 WB_REASON_BACKGROUND,
46 WB_REASON_TRY_TO_FREE_PAGES,
47 WB_REASON_SYNC,
48 WB_REASON_PERIODIC,
49 WB_REASON_LAPTOP_TIMER,
50 WB_REASON_FREE_MORE_MEM,
51 WB_REASON_FS_FREE_SPACE,
52 WB_REASON_FORKER_THREAD,
53
54 WB_REASON_MAX,
55};
56extern const char *wb_reason_name[];
57
58/*
53 * A control structure which tells the writeback code what to do. These are 59 * A control structure which tells the writeback code what to do. These are
54 * always on the stack, and hence need no locking. They are always initialised 60 * always on the stack, and hence need no locking. They are always initialised
55 * in a manner such that unspecified fields are set to zero. 61 * in a manner such that unspecified fields are set to zero.
@@ -80,14 +86,17 @@ struct writeback_control {
80 */ 86 */
81struct bdi_writeback; 87struct bdi_writeback;
82int inode_wait(void *); 88int inode_wait(void *);
83void writeback_inodes_sb(struct super_block *); 89void writeback_inodes_sb(struct super_block *, enum wb_reason reason);
84void writeback_inodes_sb_nr(struct super_block *, unsigned long nr); 90void writeback_inodes_sb_nr(struct super_block *, unsigned long nr,
85int writeback_inodes_sb_if_idle(struct super_block *); 91 enum wb_reason reason);
86int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); 92int writeback_inodes_sb_if_idle(struct super_block *, enum wb_reason reason);
93int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr,
94 enum wb_reason reason);
87void sync_inodes_sb(struct super_block *); 95void sync_inodes_sb(struct super_block *);
88long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages); 96long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages,
97 enum wb_reason reason);
89long wb_do_writeback(struct bdi_writeback *wb, int force_wait); 98long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
90void wakeup_flusher_threads(long nr_pages); 99void wakeup_flusher_threads(long nr_pages, enum wb_reason reason);
91 100
92/* writeback.h requires fs.h; it, too, is not included from here. */ 101/* writeback.h requires fs.h; it, too, is not included from here. */
93static inline void wait_on_inode(struct inode *inode) 102static inline void wait_on_inode(struct inode *inode)
@@ -154,6 +163,7 @@ unsigned long bdi_dirty_limit(struct backing_dev_info *bdi,
154 163
155void __bdi_update_bandwidth(struct backing_dev_info *bdi, 164void __bdi_update_bandwidth(struct backing_dev_info *bdi,
156 unsigned long thresh, 165 unsigned long thresh,
166 unsigned long bg_thresh,
157 unsigned long dirty, 167 unsigned long dirty,
158 unsigned long bdi_thresh, 168 unsigned long bdi_thresh,
159 unsigned long bdi_dirty, 169 unsigned long bdi_dirty,
diff --git a/include/linux/x25.h b/include/linux/x25.h
index 6450a7f12074..810cce6737ea 100644
--- a/include/linux/x25.h
+++ b/include/linux/x25.h
@@ -12,6 +12,7 @@
12#define X25_KERNEL_H 12#define X25_KERNEL_H
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/socket.h>
15 16
16#define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) 17#define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
17#define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) 18#define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
@@ -57,7 +58,7 @@ struct x25_address {
57 * Linux X.25 Address structure, used for bind, and connect mostly. 58 * Linux X.25 Address structure, used for bind, and connect mostly.
58 */ 59 */
59struct sockaddr_x25 { 60struct sockaddr_x25 {
60 sa_family_t sx25_family; /* Must be AF_X25 */ 61 __kernel_sa_family_t sx25_family; /* Must be AF_X25 */
61 struct x25_address sx25_addr; /* X.121 Address */ 62 struct x25_address sx25_addr; /* X.121 Address */
62}; 63};
63 64
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index aed54c50aa66..e5d122031542 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -30,6 +30,9 @@
30#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) 30#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
31 31
32/* Security namespace */ 32/* Security namespace */
33#define XATTR_EVM_SUFFIX "evm"
34#define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX
35
33#define XATTR_SELINUX_SUFFIX "selinux" 36#define XATTR_SELINUX_SUFFIX "selinux"
34#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX 37#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
35 38
@@ -49,6 +52,11 @@
49#define XATTR_CAPS_SUFFIX "capability" 52#define XATTR_CAPS_SUFFIX "capability"
50#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX 53#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
51 54
55#define XATTR_POSIX_ACL_ACCESS "posix_acl_access"
56#define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
57#define XATTR_POSIX_ACL_DEFAULT "posix_acl_default"
58#define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
59
52#ifdef __KERNEL__ 60#ifdef __KERNEL__
53 61
54#include <linux/types.h> 62#include <linux/types.h>
@@ -67,6 +75,12 @@ struct xattr_handler {
67 size_t size, int flags, int handler_flags); 75 size_t size, int flags, int handler_flags);
68}; 76};
69 77
78struct xattr {
79 char *name;
80 void *value;
81 size_t value_len;
82};
83
70ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); 84ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t);
71ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t); 85ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t);
72ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); 86ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
@@ -78,7 +92,10 @@ ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer,
78ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size); 92ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);
79int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags); 93int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags);
80int generic_removexattr(struct dentry *dentry, const char *name); 94int generic_removexattr(struct dentry *dentry, const char *name);
81 95ssize_t vfs_getxattr_alloc(struct dentry *dentry, const char *name,
96 char **xattr_value, size_t size, gfp_t flags);
97int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name,
98 const char *value, size_t size, gfp_t flags);
82#endif /* __KERNEL__ */ 99#endif /* __KERNEL__ */
83 100
84#endif /* _LINUX_XATTR_H */ 101#endif /* _LINUX_XATTR_H */
diff --git a/include/media/m5mols.h b/include/media/m5mols.h
index aac2c0e06d5e..4a825ae5c6c8 100644
--- a/include/media/m5mols.h
+++ b/include/media/m5mols.h
@@ -18,15 +18,13 @@
18 18
19/** 19/**
20 * struct m5mols_platform_data - platform data for M-5MOLS driver 20 * struct m5mols_platform_data - platform data for M-5MOLS driver
21 * @irq: GPIO getting the irq pin of M-5MOLS
22 * @gpio_reset: GPIO driving the reset pin of M-5MOLS 21 * @gpio_reset: GPIO driving the reset pin of M-5MOLS
23 * @reset_polarity: active state for gpio_rst pin, 0 or 1 22 * @reset_polarity: active state for gpio_reset pin, 0 or 1
24 * @set_power: an additional callback to the board setup code 23 * @set_power: an additional callback to the board setup code
25 * to be called after enabling and before disabling 24 * to be called after enabling and before disabling
26 * the sensor's supply regulators 25 * the sensor's supply regulators
27 */ 26 */
28struct m5mols_platform_data { 27struct m5mols_platform_data {
29 int irq;
30 int gpio_reset; 28 int gpio_reset;
31 u8 reset_polarity; 29 u8 reset_polarity;
32 int (*set_power)(struct device *dev, int on); 30 int (*set_power)(struct device *dev, int on);
diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h
new file mode 100644
index 000000000000..96448c7a318b
--- /dev/null
+++ b/include/media/mt9p031.h
@@ -0,0 +1,19 @@
1#ifndef MT9P031_H
2#define MT9P031_H
3
4struct v4l2_subdev;
5
6enum {
7 MT9P031_COLOR_VERSION,
8 MT9P031_MONOCHROME_VERSION,
9};
10
11struct mt9p031_platform_data {
12 int (*set_xclk)(struct v4l2_subdev *subdev, int hz);
13 int (*reset)(struct v4l2_subdev *subdev, int active);
14 int ext_freq; /* input frequency to the mt9p031 for PLL dividers */
15 int target_freq; /* frequency target for the PLL */
16 int version; /* MT9P031_COLOR_VERSION or MT9P031_MONOCHROME_VERSION */
17};
18
19#endif
diff --git a/include/media/mt9t001.h b/include/media/mt9t001.h
new file mode 100644
index 000000000000..e839a78bb9c5
--- /dev/null
+++ b/include/media/mt9t001.h
@@ -0,0 +1,8 @@
1#ifndef _MEDIA_MT9T001_H
2#define _MEDIA_MT9T001_H
3
4struct mt9t001_platform_data {
5 unsigned int clk_pol:1;
6};
7
8#endif
diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h
new file mode 100644
index 000000000000..e917b1da6577
--- /dev/null
+++ b/include/media/omap3isp.h
@@ -0,0 +1,140 @@
1/*
2 * omap3isp.h
3 *
4 * TI OMAP3 ISP - Platform data
5 *
6 * Copyright (C) 2011 Nokia Corporation
7 *
8 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 * Sakari Ailus <sakari.ailus@iki.fi>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 * 02110-1301 USA
24 */
25
26#ifndef __MEDIA_OMAP3ISP_H__
27#define __MEDIA_OMAP3ISP_H__
28
29struct i2c_board_info;
30struct isp_device;
31
32enum isp_interface_type {
33 ISP_INTERFACE_PARALLEL,
34 ISP_INTERFACE_CSI2A_PHY2,
35 ISP_INTERFACE_CCP2B_PHY1,
36 ISP_INTERFACE_CCP2B_PHY2,
37 ISP_INTERFACE_CSI2C_PHY1,
38};
39
40enum {
41 ISP_BRIDGE_DISABLE = 0,
42 ISP_BRIDGE_LITTLE_ENDIAN = 2,
43 ISP_BRIDGE_BIG_ENDIAN = 3,
44};
45
46enum {
47 ISP_LANE_SHIFT_0 = 0,
48 ISP_LANE_SHIFT_2 = 1,
49 ISP_LANE_SHIFT_4 = 2,
50 ISP_LANE_SHIFT_6 = 3,
51};
52
53/**
54 * struct isp_parallel_platform_data - Parallel interface platform data
55 * @data_lane_shift: Data lane shifter
56 * ISP_LANE_SHIFT_0 - CAMEXT[13:0] -> CAM[13:0]
57 * ISP_LANE_SHIFT_2 - CAMEXT[13:2] -> CAM[11:0]
58 * ISP_LANE_SHIFT_4 - CAMEXT[13:4] -> CAM[9:0]
59 * ISP_LANE_SHIFT_6 - CAMEXT[13:6] -> CAM[7:0]
60 * @clk_pol: Pixel clock polarity
61 * 0 - Non Inverted, 1 - Inverted
62 * @hs_pol: Horizontal synchronization polarity
63 * 0 - Active high, 1 - Active low
64 * @vs_pol: Vertical synchronization polarity
65 * 0 - Active high, 1 - Active low
66 * @bridge: CCDC Bridge input control
67 * ISP_BRIDGE_DISABLE - Disable
68 * ISP_BRIDGE_LITTLE_ENDIAN - Little endian
69 * ISP_BRIDGE_BIG_ENDIAN - Big endian
70 */
71struct isp_parallel_platform_data {
72 unsigned int data_lane_shift:2;
73 unsigned int clk_pol:1;
74 unsigned int hs_pol:1;
75 unsigned int vs_pol:1;
76 unsigned int bridge:2;
77};
78
79enum {
80 ISP_CCP2_PHY_DATA_CLOCK = 0,
81 ISP_CCP2_PHY_DATA_STROBE = 1,
82};
83
84enum {
85 ISP_CCP2_MODE_MIPI = 0,
86 ISP_CCP2_MODE_CCP2 = 1,
87};
88
89/**
90 * struct isp_ccp2_platform_data - CCP2 interface platform data
91 * @strobe_clk_pol: Strobe/clock polarity
92 * 0 - Non Inverted, 1 - Inverted
93 * @crc: Enable the cyclic redundancy check
94 * @ccp2_mode: Enable CCP2 compatibility mode
95 * ISP_CCP2_MODE_MIPI - MIPI-CSI1 mode
96 * ISP_CCP2_MODE_CCP2 - CCP2 mode
97 * @phy_layer: Physical layer selection
98 * ISP_CCP2_PHY_DATA_CLOCK - Data/clock physical layer
99 * ISP_CCP2_PHY_DATA_STROBE - Data/strobe physical layer
100 * @vpclk_div: Video port output clock control
101 */
102struct isp_ccp2_platform_data {
103 unsigned int strobe_clk_pol:1;
104 unsigned int crc:1;
105 unsigned int ccp2_mode:1;
106 unsigned int phy_layer:1;
107 unsigned int vpclk_div:2;
108};
109
110/**
111 * struct isp_csi2_platform_data - CSI2 interface platform data
112 * @crc: Enable the cyclic redundancy check
113 * @vpclk_div: Video port output clock control
114 */
115struct isp_csi2_platform_data {
116 unsigned crc:1;
117 unsigned vpclk_div:2;
118};
119
120struct isp_subdev_i2c_board_info {
121 struct i2c_board_info *board_info;
122 int i2c_adapter_id;
123};
124
125struct isp_v4l2_subdevs_group {
126 struct isp_subdev_i2c_board_info *subdevs;
127 enum isp_interface_type interface;
128 union {
129 struct isp_parallel_platform_data parallel;
130 struct isp_ccp2_platform_data ccp2;
131 struct isp_csi2_platform_data csi2;
132 } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
133};
134
135struct isp_platform_data {
136 struct isp_v4l2_subdevs_group *subdevs;
137 void (*set_constraints)(struct isp_device *isp, bool enable);
138};
139
140#endif /* __MEDIA_OMAP3ISP_H__ */
diff --git a/include/media/ov772x.h b/include/media/ov772x.h
index 548bf1155c83..00dbb7c4feae 100644
--- a/include/media/ov772x.h
+++ b/include/media/ov772x.h
@@ -12,12 +12,9 @@
12#ifndef __OV772X_H__ 12#ifndef __OV772X_H__
13#define __OV772X_H__ 13#define __OV772X_H__
14 14
15#include <media/soc_camera.h>
16
17/* for flags */ 15/* for flags */
18#define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */ 16#define OV772X_FLAG_VFLIP (1 << 0) /* Vertical flip image */
19#define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */ 17#define OV772X_FLAG_HFLIP (1 << 1) /* Horizontal flip image */
20#define OV772X_FLAG_8BIT (1 << 2) /* default 10 bit */
21 18
22/* 19/*
23 * for Edge ctrl 20 * for Edge ctrl
@@ -32,22 +29,23 @@ struct ov772x_edge_ctrl {
32 unsigned char lower; 29 unsigned char lower;
33}; 30};
34 31
35#define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */ 32#define OV772X_MANUAL_EDGE_CTRL 0x80 /* un-used bit of strength */
36#define EDGE_STRENGTH_MASK 0x1F 33#define OV772X_EDGE_STRENGTH_MASK 0x1F
37#define EDGE_THRESHOLD_MASK 0x0F 34#define OV772X_EDGE_THRESHOLD_MASK 0x0F
38#define EDGE_UPPER_MASK 0xFF 35#define OV772X_EDGE_UPPER_MASK 0xFF
39#define EDGE_LOWER_MASK 0xFF 36#define OV772X_EDGE_LOWER_MASK 0xFF
40 37
41#define OV772X_AUTO_EDGECTRL(u, l) \ 38#define OV772X_AUTO_EDGECTRL(u, l) \
42{ \ 39{ \
43 .upper = (u & EDGE_UPPER_MASK), \ 40 .upper = (u & OV772X_EDGE_UPPER_MASK), \
44 .lower = (l & EDGE_LOWER_MASK), \ 41 .lower = (l & OV772X_EDGE_LOWER_MASK), \
45} 42}
46 43
47#define OV772X_MANUAL_EDGECTRL(s, t) \ 44#define OV772X_MANUAL_EDGECTRL(s, t) \
48{ \ 45{ \
49 .strength = (s & EDGE_STRENGTH_MASK) | OV772X_MANUAL_EDGE_CTRL,\ 46 .strength = (s & OV772X_EDGE_STRENGTH_MASK) | \
50 .threshold = (t & EDGE_THRESHOLD_MASK), \ 47 OV772X_MANUAL_EDGE_CTRL, \
48 .threshold = (t & OV772X_EDGE_THRESHOLD_MASK), \
51} 49}
52 50
53/* 51/*
diff --git a/include/media/pwc-ioctl.h b/include/media/pwc-ioctl.h
index 0f19779c4634..1ed1e616fe33 100644
--- a/include/media/pwc-ioctl.h
+++ b/include/media/pwc-ioctl.h
@@ -53,7 +53,6 @@
53 */ 53 */
54 54
55#include <linux/types.h> 55#include <linux/types.h>
56#include <linux/version.h>
57 56
58/* Enumeration of image sizes */ 57/* Enumeration of image sizes */
59#define PSZ_SQCIF 0x00 58#define PSZ_SQCIF 0x00
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index b1f19b77ecd4..b0c494a69079 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -23,8 +23,11 @@
23#include <media/rc-map.h> 23#include <media/rc-map.h>
24 24
25extern int rc_core_debug; 25extern int rc_core_debug;
26#define IR_dprintk(level, fmt, arg...) if (rc_core_debug >= level) \ 26#define IR_dprintk(level, fmt, ...) \
27 printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) 27do { \
28 if (rc_core_debug >= level) \
29 pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \
30} while (0)
28 31
29enum rc_driver_type { 32enum rc_driver_type {
30 RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ 33 RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 17c9759ae77b..26a3bd0fe57c 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -61,6 +61,7 @@ void rc_map_init(void);
61#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" 61#define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp"
62#define RC_MAP_ASUS_PC39 "rc-asus-pc39" 62#define RC_MAP_ASUS_PC39 "rc-asus-pc39"
63#define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" 63#define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600"
64#define RC_MAP_ATI_X10 "rc-ati-x10"
64#define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" 65#define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d"
65#define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus" 66#define RC_MAP_AVERMEDIA_CARDBUS "rc-avermedia-cardbus"
66#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt" 67#define RC_MAP_AVERMEDIA_DVBT "rc-avermedia-dvbt"
@@ -106,6 +107,7 @@ void rc_map_init(void);
106#define RC_MAP_LIRC "rc-lirc" 107#define RC_MAP_LIRC "rc-lirc"
107#define RC_MAP_LME2510 "rc-lme2510" 108#define RC_MAP_LME2510 "rc-lme2510"
108#define RC_MAP_MANLI "rc-manli" 109#define RC_MAP_MANLI "rc-manli"
110#define RC_MAP_MEDION_X10 "rc-medion-x10"
109#define RC_MAP_MSI_DIGIVOX_II "rc-msi-digivox-ii" 111#define RC_MAP_MSI_DIGIVOX_II "rc-msi-digivox-ii"
110#define RC_MAP_MSI_DIGIVOX_III "rc-msi-digivox-iii" 112#define RC_MAP_MSI_DIGIVOX_III "rc-msi-digivox-iii"
111#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" 113#define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus"
@@ -130,6 +132,7 @@ void rc_map_init(void);
130#define RC_MAP_RC5_TV "rc-rc5-tv" 132#define RC_MAP_RC5_TV "rc-rc5-tv"
131#define RC_MAP_RC6_MCE "rc-rc6-mce" 133#define RC_MAP_RC6_MCE "rc-rc6-mce"
132#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys" 134#define RC_MAP_REAL_AUDIO_220_32_KEYS "rc-real-audio-220-32-keys"
135#define RC_MAP_SNAPSTREAM_FIREFLY "rc-snapstream-firefly"
133#define RC_MAP_STREAMZAP "rc-streamzap" 136#define RC_MAP_STREAMZAP "rc-streamzap"
134#define RC_MAP_TBS_NEC "rc-tbs-nec" 137#define RC_MAP_TBS_NEC "rc-tbs-nec"
135#define RC_MAP_TECHNISAT_USB2 "rc-technisat-usb2" 138#define RC_MAP_TECHNISAT_USB2 "rc-technisat-usb2"
diff --git a/include/media/s5k6aa.h b/include/media/s5k6aa.h
new file mode 100644
index 000000000000..ba34f7055e55
--- /dev/null
+++ b/include/media/s5k6aa.h
@@ -0,0 +1,51 @@
1/*
2 * S5K6AAFX camera sensor driver header
3 *
4 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef S5K6AA_H
13#define S5K6AA_H
14
15#include <media/v4l2-mediabus.h>
16
17/**
18 * struct s5k6aa_gpio - data structure describing a GPIO
19 * @gpio: GPIO number
20 * @level: indicates active state of the @gpio
21 */
22struct s5k6aa_gpio {
23 int gpio;
24 int level;
25};
26
27/**
28 * struct s5k6aa_platform_data - s5k6aa driver platform data
29 * @set_power: an additional callback to the board code, called
30 * after enabling the regulators and before switching
31 * the sensor off
32 * @mclk_frequency: sensor's master clock frequency in Hz
33 * @gpio_reset: GPIO driving RESET pin
34 * @gpio_stby: GPIO driving STBY pin
35 * @nlanes: maximum number of MIPI-CSI lanes used
36 * @horiz_flip: default horizontal image flip value, non zero to enable
37 * @vert_flip: default vertical image flip value, non zero to enable
38 */
39
40struct s5k6aa_platform_data {
41 int (*set_power)(int enable);
42 unsigned long mclk_frequency;
43 struct s5k6aa_gpio gpio_reset;
44 struct s5k6aa_gpio gpio_stby;
45 enum v4l2_mbus_type bus_type;
46 u8 nlanes;
47 u8 horiz_flip;
48 u8 vert_flip;
49};
50
51#endif /* S5K6AA_H */
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h
index 9fdff8a4ed26..688fb3f1dc35 100644
--- a/include/media/s5p_fimc.h
+++ b/include/media/s5p_fimc.h
@@ -19,11 +19,6 @@ enum cam_bus_type {
19 FIMC_LCD_WB, /* FIFO link from LCD mixer */ 19 FIMC_LCD_WB, /* FIFO link from LCD mixer */
20}; 20};
21 21
22#define FIMC_CLK_INV_PCLK (1 << 0)
23#define FIMC_CLK_INV_VSYNC (1 << 1)
24#define FIMC_CLK_INV_HREF (1 << 2)
25#define FIMC_CLK_INV_HSYNC (1 << 3)
26
27struct i2c_board_info; 22struct i2c_board_info;
28 23
29/** 24/**
@@ -36,7 +31,8 @@ struct i2c_board_info;
36 * @csi_data_align: MIPI-CSI interface data alignment in bits 31 * @csi_data_align: MIPI-CSI interface data alignment in bits
37 * @i2c_bus_num: i2c control bus id the sensor is attached to 32 * @i2c_bus_num: i2c control bus id the sensor is attached to
38 * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU) 33 * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
39 * @flags: flags defining bus signals polarity inversion (High by default) 34 * @clk_id: index of the SoC peripheral clock for sensors
35 * @flags: the parallel bus flags defining signals polarity (V4L2_MBUS_*)
40 */ 36 */
41struct s5p_fimc_isp_info { 37struct s5p_fimc_isp_info {
42 struct i2c_board_info *board_info; 38 struct i2c_board_info *board_info;
@@ -46,6 +42,7 @@ struct s5p_fimc_isp_info {
46 u16 i2c_bus_num; 42 u16 i2c_bus_num;
47 u16 mux_id; 43 u16 mux_id;
48 u16 flags; 44 u16 flags;
45 u8 clk_id;
49}; 46};
50 47
51/** 48/**
@@ -58,4 +55,13 @@ struct s5p_platform_fimc {
58 struct s5p_fimc_isp_info *isp_info; 55 struct s5p_fimc_isp_info *isp_info;
59 int num_clients; 56 int num_clients;
60}; 57};
58
59/*
60 * v4l2_device notification id. This is only for internal use in the kernel.
61 * Sensor subdevs should issue S5P_FIMC_TX_END_NOTIFY notification in single
62 * frame capture mode when there is only one VSYNC pulse issued by the sensor
63 * at begining of the frame transmission.
64 */
65#define S5P_FIMC_TX_END_NOTIFY _IO('e', 0)
66
61#endif /* S5P_FIMC_H_ */ 67#endif /* S5P_FIMC_H_ */
diff --git a/include/media/saa7146.h b/include/media/saa7146.h
index 79827143d5ac..0f037e8edf9a 100644
--- a/include/media/saa7146.h
+++ b/include/media/saa7146.h
@@ -1,7 +1,6 @@
1#ifndef __SAA7146__ 1#ifndef __SAA7146__
2#define __SAA7146__ 2#define __SAA7146__
3 3
4#include <linux/module.h> /* for module-version */
5#include <linux/delay.h> /* for delay-stuff */ 4#include <linux/delay.h> /* for delay-stuff */
6#include <linux/slab.h> /* for kmalloc/kfree */ 5#include <linux/slab.h> /* for kmalloc/kfree */
7#include <linux/pci.h> /* for pci-config-stuff, vendor ids etc. */ 6#include <linux/pci.h> /* for pci-config-stuff, vendor ids etc. */
@@ -25,28 +24,38 @@
25 24
26extern unsigned int saa7146_debug; 25extern unsigned int saa7146_debug;
27 26
28//#define DEBUG_PROLOG printk("(0x%08x)(0x%08x) %s: %s(): ",(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,RPS_ADDR0))),(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,IER))),KBUILD_MODNAME,__func__)
29
30#ifndef DEBUG_VARIABLE 27#ifndef DEBUG_VARIABLE
31 #define DEBUG_VARIABLE saa7146_debug 28 #define DEBUG_VARIABLE saa7146_debug
32#endif 29#endif
33 30
34#define DEBUG_PROLOG printk("%s: %s(): ",KBUILD_MODNAME, __func__) 31#define ERR(fmt, ...) pr_err("%s: " fmt, __func__, ##__VA_ARGS__)
35#define INFO(x) { printk("%s: ",KBUILD_MODNAME); printk x; } 32
36 33#define _DBG(mask, fmt, ...) \
37#define ERR(x) { DEBUG_PROLOG; printk x; } 34do { \
38 35 if (DEBUG_VARIABLE & mask) \
39#define DEB_S(x) if (0!=(DEBUG_VARIABLE&0x01)) { DEBUG_PROLOG; printk x; } /* simple debug messages */ 36 pr_debug("%s(): " fmt, __func__, ##__VA_ARGS__); \
40#define DEB_D(x) if (0!=(DEBUG_VARIABLE&0x02)) { DEBUG_PROLOG; printk x; } /* more detailed debug messages */ 37} while (0)
41#define DEB_EE(x) if (0!=(DEBUG_VARIABLE&0x04)) { DEBUG_PROLOG; printk x; } /* print enter and exit of functions */ 38
42#define DEB_I2C(x) if (0!=(DEBUG_VARIABLE&0x08)) { DEBUG_PROLOG; printk x; } /* i2c debug messages */ 39/* simple debug messages */
43#define DEB_VBI(x) if (0!=(DEBUG_VARIABLE&0x10)) { DEBUG_PROLOG; printk x; } /* vbi debug messages */ 40#define DEB_S(fmt, ...) _DBG(0x01, fmt, ##__VA_ARGS__)
44#define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ 41/* more detailed debug messages */
45#define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ 42#define DEB_D(fmt, ...) _DBG(0x02, fmt, ##__VA_ARGS__)
43/* print enter and exit of functions */
44#define DEB_EE(fmt, ...) _DBG(0x04, fmt, ##__VA_ARGS__)
45/* i2c debug messages */
46#define DEB_I2C(fmt, ...) _DBG(0x08, fmt, ##__VA_ARGS__)
47/* vbi debug messages */
48#define DEB_VBI(fmt, ...) _DBG(0x10, fmt, ##__VA_ARGS__)
49/* interrupt debug messages */
50#define DEB_INT(fmt, ...) _DBG(0x20, fmt, ##__VA_ARGS__)
51/* capture debug messages */
52#define DEB_CAP(fmt, ...) _DBG(0x40, fmt, ##__VA_ARGS__)
46 53
47#define SAA7146_ISR_CLEAR(x,y) \ 54#define SAA7146_ISR_CLEAR(x,y) \
48 saa7146_write(x, ISR, (y)); 55 saa7146_write(x, ISR, (y));
49 56
57struct module;
58
50struct saa7146_dev; 59struct saa7146_dev;
51struct saa7146_extension; 60struct saa7146_extension;
52struct saa7146_vv; 61struct saa7146_vv;
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 7582952dceae..b1377b931eb7 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -12,12 +12,14 @@
12#ifndef SOC_CAMERA_H 12#ifndef SOC_CAMERA_H
13#define SOC_CAMERA_H 13#define SOC_CAMERA_H
14 14
15#include <linux/bitops.h>
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/mutex.h> 17#include <linux/mutex.h>
17#include <linux/pm.h> 18#include <linux/pm.h>
18#include <linux/videodev2.h> 19#include <linux/videodev2.h>
19#include <media/videobuf-core.h> 20#include <media/videobuf-core.h>
20#include <media/videobuf2-core.h> 21#include <media/videobuf2-core.h>
22#include <media/v4l2-ctrls.h>
21#include <media/v4l2-device.h> 23#include <media/v4l2-device.h>
22 24
23struct file; 25struct file;
@@ -37,8 +39,8 @@ struct soc_camera_device {
37 unsigned char iface; /* Host number */ 39 unsigned char iface; /* Host number */
38 unsigned char devnum; /* Device number per host */ 40 unsigned char devnum; /* Device number per host */
39 struct soc_camera_sense *sense; /* See comment in struct definition */ 41 struct soc_camera_sense *sense; /* See comment in struct definition */
40 struct soc_camera_ops *ops;
41 struct video_device *vdev; 42 struct video_device *vdev;
43 struct v4l2_ctrl_handler ctrl_handler;
42 const struct soc_camera_format_xlate *current_fmt; 44 const struct soc_camera_format_xlate *current_fmt;
43 struct soc_camera_format_xlate *user_formats; 45 struct soc_camera_format_xlate *user_formats;
44 int num_user_formats; 46 int num_user_formats;
@@ -93,14 +95,10 @@ struct soc_camera_host_ops {
93 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *); 95 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *);
94 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); 96 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
95 int (*set_bus_param)(struct soc_camera_device *, __u32); 97 int (*set_bus_param)(struct soc_camera_device *, __u32);
96 int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *);
97 int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *);
98 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 98 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
99 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 99 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
100 int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *); 100 int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *);
101 unsigned int (*poll)(struct file *, poll_table *); 101 unsigned int (*poll)(struct file *, poll_table *);
102 const struct v4l2_queryctrl *controls;
103 int num_controls;
104}; 102};
105 103
106#define SOCAM_SENSOR_INVERT_PCLK (1 << 0) 104#define SOCAM_SENSOR_INVERT_PCLK (1 << 0)
@@ -193,13 +191,6 @@ struct soc_camera_format_xlate {
193 const struct soc_mbus_pixelfmt *host_fmt; 191 const struct soc_mbus_pixelfmt *host_fmt;
194}; 192};
195 193
196struct soc_camera_ops {
197 unsigned long (*query_bus_param)(struct soc_camera_device *);
198 int (*set_bus_param)(struct soc_camera_device *, unsigned long);
199 const struct v4l2_queryctrl *controls;
200 int num_controls;
201};
202
203#define SOCAM_SENSE_PCLK_CHANGED (1 << 0) 194#define SOCAM_SENSE_PCLK_CHANGED (1 << 0)
204 195
205/** 196/**
@@ -226,65 +217,18 @@ struct soc_camera_sense {
226 unsigned long pixel_clock; 217 unsigned long pixel_clock;
227}; 218};
228 219
229static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( 220#define SOCAM_DATAWIDTH(x) BIT((x) - 1)
230 struct soc_camera_ops *ops, int id) 221#define SOCAM_DATAWIDTH_4 SOCAM_DATAWIDTH(4)
231{ 222#define SOCAM_DATAWIDTH_8 SOCAM_DATAWIDTH(8)
232 int i; 223#define SOCAM_DATAWIDTH_9 SOCAM_DATAWIDTH(9)
233 224#define SOCAM_DATAWIDTH_10 SOCAM_DATAWIDTH(10)
234 for (i = 0; i < ops->num_controls; i++) 225#define SOCAM_DATAWIDTH_15 SOCAM_DATAWIDTH(15)
235 if (ops->controls[i].id == id) 226#define SOCAM_DATAWIDTH_16 SOCAM_DATAWIDTH(16)
236 return &ops->controls[i];
237
238 return NULL;
239}
240
241#define SOCAM_MASTER (1 << 0)
242#define SOCAM_SLAVE (1 << 1)
243#define SOCAM_HSYNC_ACTIVE_HIGH (1 << 2)
244#define SOCAM_HSYNC_ACTIVE_LOW (1 << 3)
245#define SOCAM_VSYNC_ACTIVE_HIGH (1 << 4)
246#define SOCAM_VSYNC_ACTIVE_LOW (1 << 5)
247#define SOCAM_DATAWIDTH_4 (1 << 6)
248#define SOCAM_DATAWIDTH_8 (1 << 7)
249#define SOCAM_DATAWIDTH_9 (1 << 8)
250#define SOCAM_DATAWIDTH_10 (1 << 9)
251#define SOCAM_DATAWIDTH_15 (1 << 10)
252#define SOCAM_DATAWIDTH_16 (1 << 11)
253#define SOCAM_PCLK_SAMPLE_RISING (1 << 12)
254#define SOCAM_PCLK_SAMPLE_FALLING (1 << 13)
255#define SOCAM_DATA_ACTIVE_HIGH (1 << 14)
256#define SOCAM_DATA_ACTIVE_LOW (1 << 15)
257#define SOCAM_MIPI_1LANE (1 << 16)
258#define SOCAM_MIPI_2LANE (1 << 17)
259#define SOCAM_MIPI_3LANE (1 << 18)
260#define SOCAM_MIPI_4LANE (1 << 19)
261#define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \
262 SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE)
263 227
264#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ 228#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \
265 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ 229 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \
266 SOCAM_DATAWIDTH_15 | SOCAM_DATAWIDTH_16) 230 SOCAM_DATAWIDTH_15 | SOCAM_DATAWIDTH_16)
267 231
268static inline unsigned long soc_camera_bus_param_compatible(
269 unsigned long camera_flags, unsigned long bus_flags)
270{
271 unsigned long common_flags, hsync, vsync, pclk, data, buswidth, mode;
272 unsigned long mipi;
273
274 common_flags = camera_flags & bus_flags;
275
276 hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW);
277 vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW);
278 pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING);
279 data = common_flags & (SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_LOW);
280 mode = common_flags & (SOCAM_MASTER | SOCAM_SLAVE);
281 buswidth = common_flags & SOCAM_DATAWIDTH_MASK;
282 mipi = common_flags & SOCAM_MIPI;
283
284 return ((!hsync || !vsync || !pclk || !data || !mode || !buswidth) && !mipi) ? 0 :
285 common_flags;
286}
287
288static inline void soc_camera_limit_side(int *start, int *length, 232static inline void soc_camera_limit_side(int *start, int *length,
289 unsigned int start_min, 233 unsigned int start_min,
290 unsigned int length_min, unsigned int length_max) 234 unsigned int length_min, unsigned int length_max)
@@ -300,23 +244,37 @@ static inline void soc_camera_limit_side(int *start, int *length,
300 *start = start_min + length_max - *length; 244 *start = start_min + length_max - *length;
301} 245}
302 246
303extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, 247unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl,
304 unsigned long flags); 248 unsigned long flags);
249unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl,
250 const struct v4l2_mbus_config *cfg);
305 251
306/* This is only temporary here - until v4l2-subdev begins to link to video_device */ 252/* This is only temporary here - until v4l2-subdev begins to link to video_device */
307#include <linux/i2c.h> 253#include <linux/i2c.h>
308static inline struct video_device *soc_camera_i2c_to_vdev(struct i2c_client *client) 254static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_client *client)
255{
256 struct v4l2_subdev *sd = i2c_get_clientdata(client);
257 struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id;
258 return icd ? icd->vdev : NULL;
259}
260
261static inline struct soc_camera_link *soc_camera_i2c_to_link(const struct i2c_client *client)
262{
263 return client->dev.platform_data;
264}
265
266static inline struct v4l2_subdev *soc_camera_vdev_to_subdev(const struct video_device *vdev)
309{ 267{
310 struct soc_camera_device *icd = client->dev.platform_data; 268 struct soc_camera_device *icd = dev_get_drvdata(vdev->parent);
311 return icd->vdev; 269 return soc_camera_to_subdev(icd);
312} 270}
313 271
314static inline struct soc_camera_device *soc_camera_from_vb2q(struct vb2_queue *vq) 272static inline struct soc_camera_device *soc_camera_from_vb2q(const struct vb2_queue *vq)
315{ 273{
316 return container_of(vq, struct soc_camera_device, vb2_vidq); 274 return container_of(vq, struct soc_camera_device, vb2_vidq);
317} 275}
318 276
319static inline struct soc_camera_device *soc_camera_from_vbq(struct videobuf_queue *vq) 277static inline struct soc_camera_device *soc_camera_from_vbq(const struct videobuf_queue *vq)
320{ 278{
321 return container_of(vq, struct soc_camera_device, vb_vidq); 279 return container_of(vq, struct soc_camera_device, vb_vidq);
322} 280}
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index 74f0fa15ca47..8aa4200a0b1d 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/videodev2.h> 14#include <linux/videodev2.h>
15#include <media/soc_camera.h> 15#include <media/soc_camera.h>
16#include <media/v4l2-mediabus.h>
16 17
17struct device; 18struct device;
18 19
@@ -20,7 +21,8 @@ struct soc_camera_platform_info {
20 const char *format_name; 21 const char *format_name;
21 unsigned long format_depth; 22 unsigned long format_depth;
22 struct v4l2_mbus_framefmt format; 23 struct v4l2_mbus_framefmt format;
23 unsigned long bus_param; 24 unsigned long mbus_param;
25 enum v4l2_mbus_type mbus_type;
24 struct soc_camera_device *icd; 26 struct soc_camera_device *icd;
25 int (*set_capture)(struct soc_camera_platform_info *info, int enable); 27 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
26}; 28};
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h
index fae432544b41..73f1e7eb60f3 100644
--- a/include/media/soc_mediabus.h
+++ b/include/media/soc_mediabus.h
@@ -82,5 +82,7 @@ const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc(
82s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); 82s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf);
83int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf, 83int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf,
84 unsigned int *numerator, unsigned int *denominator); 84 unsigned int *numerator, unsigned int *denominator);
85unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg,
86 unsigned int flags);
85 87
86#endif 88#endif
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index 63fd9d3db296..810a20928a21 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -212,9 +212,6 @@ enum {
212 /* module sn9c20x: just ident 10000 */ 212 /* module sn9c20x: just ident 10000 */
213 V4L2_IDENT_SN9C20X = 10000, 213 V4L2_IDENT_SN9C20X = 10000,
214 214
215 /* Siliconfile sensors: reserved range 10100 - 10199 */
216 V4L2_IDENT_NOON010PC30 = 10100,
217
218 /* module cx231xx and cx25840 */ 215 /* module cx231xx and cx25840 */
219 V4L2_IDENT_CX2310X_AV = 23099, /* Integrated A/V decoder; not in '100 */ 216 V4L2_IDENT_CX2310X_AV = 23099, /* Integrated A/V decoder; not in '100 */
220 V4L2_IDENT_CX23100 = 23100, 217 V4L2_IDENT_CX23100 = 23100,
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 13fe4d744aba..eeb3df637144 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -65,14 +65,12 @@ struct v4l2_ctrl_ops {
65 * @is_private: If set, then this control is private to its handler and it 65 * @is_private: If set, then this control is private to its handler and it
66 * will not be added to any other handlers. Drivers can set 66 * will not be added to any other handlers. Drivers can set
67 * this flag. 67 * this flag.
68 * @is_volatile: If set, then this control is volatile. This means that the
69 * control's current value cannot be cached and needs to be
70 * retrieved through the g_volatile_ctrl op. Drivers can set
71 * this flag.
72 * @is_auto: If set, then this control selects whether the other cluster 68 * @is_auto: If set, then this control selects whether the other cluster
73 * members are in 'automatic' mode or 'manual' mode. This is 69 * members are in 'automatic' mode or 'manual' mode. This is
74 * used for autogain/gain type clusters. Drivers should never 70 * used for autogain/gain type clusters. Drivers should never
75 * set this flag directly. 71 * set this flag directly.
72 * @has_volatiles: If set, then one or more members of the cluster are volatile.
73 * Drivers should never touch this flag.
76 * @manual_mode_value: If the is_auto flag is set, then this is the value 74 * @manual_mode_value: If the is_auto flag is set, then this is the value
77 * of the auto control that determines if that control is in 75 * of the auto control that determines if that control is in
78 * manual mode. So if the value of the auto control equals this 76 * manual mode. So if the value of the auto control equals this
@@ -118,8 +116,8 @@ struct v4l2_ctrl {
118 116
119 unsigned int is_new:1; 117 unsigned int is_new:1;
120 unsigned int is_private:1; 118 unsigned int is_private:1;
121 unsigned int is_volatile:1;
122 unsigned int is_auto:1; 119 unsigned int is_auto:1;
120 unsigned int has_volatiles:1;
123 unsigned int manual_mode_value:8; 121 unsigned int manual_mode_value:8;
124 122
125 const struct v4l2_ctrl_ops *ops; 123 const struct v4l2_ctrl_ops *ops;
@@ -208,9 +206,6 @@ struct v4l2_ctrl_handler {
208 * must be NULL. 206 * must be NULL.
209 * @is_private: If set, then this control is private to its handler and it 207 * @is_private: If set, then this control is private to its handler and it
210 * will not be added to any other handlers. 208 * will not be added to any other handlers.
211 * @is_volatile: If set, then this control is volatile. This means that the
212 * control's current value cannot be cached and needs to be
213 * retrieved through the g_volatile_ctrl op.
214 */ 209 */
215struct v4l2_ctrl_config { 210struct v4l2_ctrl_config {
216 const struct v4l2_ctrl_ops *ops; 211 const struct v4l2_ctrl_ops *ops;
@@ -225,7 +220,6 @@ struct v4l2_ctrl_config {
225 u32 menu_skip_mask; 220 u32 menu_skip_mask;
226 const char * const *qmenu; 221 const char * const *qmenu;
227 unsigned int is_private:1; 222 unsigned int is_private:1;
228 unsigned int is_volatile:1;
229}; 223};
230 224
231/** v4l2_ctrl_fill() - Fill in the control fields based on the control ID. 225/** v4l2_ctrl_fill() - Fill in the control fields based on the control ID.
@@ -389,8 +383,7 @@ void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls);
389 * @manual_val: The value for the first control in the cluster that equals the 383 * @manual_val: The value for the first control in the cluster that equals the
390 * manual setting. 384 * manual setting.
391 * @set_volatile: If true, then all controls except the first auto control will 385 * @set_volatile: If true, then all controls except the first auto control will
392 * have is_volatile set to true. If false, then is_volatile will not 386 * be volatile.
393 * be touched.
394 * 387 *
395 * Use for control groups where one control selects some automatic feature and 388 * Use for control groups where one control selects some automatic feature and
396 * the other controls are only active whenever the automatic feature is turned 389 * the other controls are only active whenever the automatic feature is turned
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index fbf585561570..e6aa2318367b 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -25,7 +25,6 @@
25#ifndef V4L2_INT_DEVICE_H 25#ifndef V4L2_INT_DEVICE_H
26#define V4L2_INT_DEVICE_H 26#define V4L2_INT_DEVICE_H
27 27
28#include <linux/module.h>
29#include <media/v4l2-common.h> 28#include <media/v4l2-common.h>
30 29
31#define V4L2NAMESIZE 32 30#define V4L2NAMESIZE 32
@@ -41,6 +40,8 @@ enum v4l2_int_type {
41 v4l2_int_type_slave 40 v4l2_int_type_slave
42}; 41};
43 42
43struct module;
44
44struct v4l2_int_device; 45struct v4l2_int_device;
45 46
46struct v4l2_int_master { 47struct v4l2_int_master {
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index dd9f1e7b8ff7..4d1c74ad4c84 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -122,6 +122,8 @@ struct v4l2_ioctl_ops {
122 int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b); 122 int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
123 int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b); 123 int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
124 124
125 int (*vidioc_create_bufs)(struct file *file, void *fh, struct v4l2_create_buffers *b);
126 int (*vidioc_prepare_buf)(struct file *file, void *fh, struct v4l2_buffer *b);
125 127
126 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); 128 int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i);
127 int (*vidioc_g_fbuf) (struct file *file, void *fh, 129 int (*vidioc_g_fbuf) (struct file *file, void *fh,
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 6114007c8c74..83ae07e53350 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -22,8 +22,12 @@
22 */ 22 */
23#define V4L2_MBUS_MASTER (1 << 0) 23#define V4L2_MBUS_MASTER (1 << 0)
24#define V4L2_MBUS_SLAVE (1 << 1) 24#define V4L2_MBUS_SLAVE (1 << 1)
25/* Which signal polarities it supports */ 25/*
26/* Note: in BT.656 mode HSYNC and VSYNC are unused */ 26 * Signal polarity flags
27 * Note: in BT.656 mode HSYNC, FIELD, and VSYNC are unused
28 * V4L2_MBUS_[HV]SYNC* flags should be also used for specifying
29 * configuration of hardware that uses [HV]REF signals
30 */
27#define V4L2_MBUS_HSYNC_ACTIVE_HIGH (1 << 2) 31#define V4L2_MBUS_HSYNC_ACTIVE_HIGH (1 << 2)
28#define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 3) 32#define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 3)
29#define V4L2_MBUS_VSYNC_ACTIVE_HIGH (1 << 4) 33#define V4L2_MBUS_VSYNC_ACTIVE_HIGH (1 << 4)
@@ -32,6 +36,10 @@
32#define V4L2_MBUS_PCLK_SAMPLE_FALLING (1 << 7) 36#define V4L2_MBUS_PCLK_SAMPLE_FALLING (1 << 7)
33#define V4L2_MBUS_DATA_ACTIVE_HIGH (1 << 8) 37#define V4L2_MBUS_DATA_ACTIVE_HIGH (1 << 8)
34#define V4L2_MBUS_DATA_ACTIVE_LOW (1 << 9) 38#define V4L2_MBUS_DATA_ACTIVE_LOW (1 << 9)
39/* FIELD = 0/1 - Field1 (odd)/Field2 (even) */
40#define V4L2_MBUS_FIELD_EVEN_HIGH (1 << 10)
41/* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
42#define V4L2_MBUS_FIELD_EVEN_LOW (1 << 11)
35 43
36/* Serial flags */ 44/* Serial flags */
37/* How many lanes the client can use */ 45/* How many lanes the client can use */
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 257da1a30f66..f0f3358d1b1b 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -158,6 +158,7 @@ struct v4l2_subdev_core_ops {
158 int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); 158 int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls);
159 int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); 159 int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls);
160 int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); 160 int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm);
161 int (*g_std)(struct v4l2_subdev *sd, v4l2_std_id *norm);
161 int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm); 162 int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm);
162 long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg); 163 long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
163#ifdef CONFIG_VIDEO_ADV_DEBUG 164#ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -534,13 +535,13 @@ struct v4l2_subdev {
534 void *dev_priv; 535 void *dev_priv;
535 void *host_priv; 536 void *host_priv;
536 /* subdev device node */ 537 /* subdev device node */
537 struct video_device devnode; 538 struct video_device *devnode;
538}; 539};
539 540
540#define media_entity_to_v4l2_subdev(ent) \ 541#define media_entity_to_v4l2_subdev(ent) \
541 container_of(ent, struct v4l2_subdev, entity) 542 container_of(ent, struct v4l2_subdev, entity)
542#define vdev_to_v4l2_subdev(vdev) \ 543#define vdev_to_v4l2_subdev(vdev) \
543 container_of(vdev, struct v4l2_subdev, devnode) 544 video_get_drvdata(vdev)
544 545
545/* 546/*
546 * Used for storing subdev information per file handle 547 * Used for storing subdev information per file handle
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index 1c647e8148c4..d8fb6012c10d 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -34,7 +34,7 @@
34 * does memory allocation too using vmalloc_32(). 34 * does memory allocation too using vmalloc_32().
35 * 35 *
36 * videobuf_dma_*() 36 * videobuf_dma_*()
37 * see Documentation/PCI/PCI-DMA-mapping.txt, these functions to 37 * see Documentation/DMA-API-HOWTO.txt, these functions to
38 * basically the same. The map function does also build a 38 * basically the same. The map function does also build a
39 * scatterlist for the buffer (and unmap frees it ...) 39 * scatterlist for the buffer (and unmap frees it ...)
40 * 40 *
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index f87472acbc51..a15d1f1b319e 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -75,7 +75,6 @@ struct vb2_mem_ops {
75 75
76struct vb2_plane { 76struct vb2_plane {
77 void *mem_priv; 77 void *mem_priv;
78 int mapped:1;
79}; 78};
80 79
81/** 80/**
@@ -106,6 +105,7 @@ enum vb2_fileio_flags {
106/** 105/**
107 * enum vb2_buffer_state - current video buffer state 106 * enum vb2_buffer_state - current video buffer state
108 * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control 107 * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control
108 * @VB2_BUF_STATE_PREPARED: buffer prepared in videobuf and by the driver
109 * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver 109 * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver
110 * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used 110 * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used
111 * in a hardware operation 111 * in a hardware operation
@@ -117,6 +117,7 @@ enum vb2_fileio_flags {
117 */ 117 */
118enum vb2_buffer_state { 118enum vb2_buffer_state {
119 VB2_BUF_STATE_DEQUEUED, 119 VB2_BUF_STATE_DEQUEUED,
120 VB2_BUF_STATE_PREPARED,
120 VB2_BUF_STATE_QUEUED, 121 VB2_BUF_STATE_QUEUED,
121 VB2_BUF_STATE_ACTIVE, 122 VB2_BUF_STATE_ACTIVE,
122 VB2_BUF_STATE_DONE, 123 VB2_BUF_STATE_DONE,
@@ -147,7 +148,6 @@ struct vb2_queue;
147 * @done_entry: entry on the list that stores all buffers ready to 148 * @done_entry: entry on the list that stores all buffers ready to
148 * be dequeued to userspace 149 * be dequeued to userspace
149 * @planes: private per-plane information; do not change 150 * @planes: private per-plane information; do not change
150 * @num_planes_mapped: number of mapped planes; do not change
151 */ 151 */
152struct vb2_buffer { 152struct vb2_buffer {
153 struct v4l2_buffer v4l2_buf; 153 struct v4l2_buffer v4l2_buf;
@@ -164,19 +164,26 @@ struct vb2_buffer {
164 struct list_head done_entry; 164 struct list_head done_entry;
165 165
166 struct vb2_plane planes[VIDEO_MAX_PLANES]; 166 struct vb2_plane planes[VIDEO_MAX_PLANES];
167 unsigned int num_planes_mapped;
168}; 167};
169 168
170/** 169/**
171 * struct vb2_ops - driver-specific callbacks 170 * struct vb2_ops - driver-specific callbacks
172 * 171 *
173 * @queue_setup: called from a VIDIOC_REQBUFS handler, before 172 * @queue_setup: called from VIDIOC_REQBUFS and VIDIOC_CREATE_BUFS
174 * memory allocation; driver should return the required 173 * handlers before memory allocation, or, if
175 * number of buffers in num_buffers, the required number 174 * *num_planes != 0, after the allocation to verify a
176 * of planes per buffer in num_planes; the size of each 175 * smaller number of buffers. Driver should return
177 * plane should be set in the sizes[] array and optional 176 * the required number of buffers in *num_buffers, the
178 * per-plane allocator specific context in alloc_ctxs[] 177 * required number of planes per buffer in *num_planes; the
179 * array 178 * size of each plane should be set in the sizes[] array
179 * and optional per-plane allocator specific context in the
180 * alloc_ctxs[] array. When called from VIDIOC_REQBUFS,
181 * fmt == NULL, the driver has to use the currently
182 * configured format and *num_buffers is the total number
183 * of buffers, that are being allocated. When called from
184 * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the
185 * target frame format. In this case *num_buffers are being
186 * allocated additionally to q->num_buffers.
180 * @wait_prepare: release any locks taken while calling vb2 functions; 187 * @wait_prepare: release any locks taken while calling vb2 functions;
181 * it is called before an ioctl needs to wait for a new 188 * it is called before an ioctl needs to wait for a new
182 * buffer to arrive; required to avoid a deadlock in 189 * buffer to arrive; required to avoid a deadlock in
@@ -189,30 +196,39 @@ struct vb2_buffer {
189 * perform additional buffer-related initialization; 196 * perform additional buffer-related initialization;
190 * initialization failure (return != 0) will prevent 197 * initialization failure (return != 0) will prevent
191 * queue setup from completing successfully; optional 198 * queue setup from completing successfully; optional
192 * @buf_prepare: called every time the buffer is queued from userspace; 199 * @buf_prepare: called every time the buffer is queued from userspace
193 * drivers may perform any initialization required before 200 * and from the VIDIOC_PREPARE_BUF ioctl; drivers may
194 * each hardware operation in this callback; 201 * perform any initialization required before each hardware
195 * if an error is returned, the buffer will not be queued 202 * operation in this callback; if an error is returned, the
196 * in driver; optional 203 * buffer will not be queued in driver; optional
197 * @buf_finish: called before every dequeue of the buffer back to 204 * @buf_finish: called before every dequeue of the buffer back to
198 * userspace; drivers may perform any operations required 205 * userspace; drivers may perform any operations required
199 * before userspace accesses the buffer; optional 206 * before userspace accesses the buffer; optional
200 * @buf_cleanup: called once before the buffer is freed; drivers may 207 * @buf_cleanup: called once before the buffer is freed; drivers may
201 * perform any additional cleanup; optional 208 * perform any additional cleanup; optional
202 * @start_streaming: called once before entering 'streaming' state; enables 209 * @start_streaming: called once to enter 'streaming' state; the driver may
203 * driver to receive buffers over buf_queue() callback 210 * receive buffers with @buf_queue callback before
211 * @start_streaming is called; the driver gets the number
212 * of already queued buffers in count parameter; driver
213 * can return an error if hardware fails or not enough
214 * buffers has been queued, in such case all buffers that
215 * have been already given by the @buf_queue callback are
216 * invalidated.
204 * @stop_streaming: called when 'streaming' state must be disabled; driver 217 * @stop_streaming: called when 'streaming' state must be disabled; driver
205 * should stop any DMA transactions or wait until they 218 * should stop any DMA transactions or wait until they
206 * finish and give back all buffers it got from buf_queue() 219 * finish and give back all buffers it got from buf_queue()
207 * callback; may use vb2_wait_for_all_buffers() function 220 * callback; may use vb2_wait_for_all_buffers() function
208 * @buf_queue: passes buffer vb to the driver; driver may start 221 * @buf_queue: passes buffer vb to the driver; driver may start
209 * hardware operation on this buffer; driver should give 222 * hardware operation on this buffer; driver should give
210 * the buffer back by calling vb2_buffer_done() function 223 * the buffer back by calling vb2_buffer_done() function;
224 * it is allways called after calling STREAMON ioctl;
225 * might be called before start_streaming callback if user
226 * pre-queued buffers before calling STREAMON
211 */ 227 */
212struct vb2_ops { 228struct vb2_ops {
213 int (*queue_setup)(struct vb2_queue *q, unsigned int *num_buffers, 229 int (*queue_setup)(struct vb2_queue *q, const struct v4l2_format *fmt,
214 unsigned int *num_planes, unsigned long sizes[], 230 unsigned int *num_buffers, unsigned int *num_planes,
215 void *alloc_ctxs[]); 231 unsigned int sizes[], void *alloc_ctxs[]);
216 232
217 void (*wait_prepare)(struct vb2_queue *q); 233 void (*wait_prepare)(struct vb2_queue *q);
218 void (*wait_finish)(struct vb2_queue *q); 234 void (*wait_finish)(struct vb2_queue *q);
@@ -222,7 +238,7 @@ struct vb2_ops {
222 int (*buf_finish)(struct vb2_buffer *vb); 238 int (*buf_finish)(struct vb2_buffer *vb);
223 void (*buf_cleanup)(struct vb2_buffer *vb); 239 void (*buf_cleanup)(struct vb2_buffer *vb);
224 240
225 int (*start_streaming)(struct vb2_queue *q); 241 int (*start_streaming)(struct vb2_queue *q, unsigned int count);
226 int (*stop_streaming)(struct vb2_queue *q); 242 int (*stop_streaming)(struct vb2_queue *q);
227 243
228 void (*buf_queue)(struct vb2_buffer *vb); 244 void (*buf_queue)(struct vb2_buffer *vb);
@@ -276,6 +292,7 @@ struct vb2_queue {
276 wait_queue_head_t done_wq; 292 wait_queue_head_t done_wq;
277 293
278 void *alloc_ctx[VIDEO_MAX_PLANES]; 294 void *alloc_ctx[VIDEO_MAX_PLANES];
295 unsigned int plane_sizes[VIDEO_MAX_PLANES];
279 296
280 unsigned int streaming:1; 297 unsigned int streaming:1;
281 298
@@ -291,6 +308,9 @@ int vb2_wait_for_all_buffers(struct vb2_queue *q);
291int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b); 308int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b);
292int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req); 309int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req);
293 310
311int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create);
312int vb2_prepare_buf(struct vb2_queue *q, struct v4l2_buffer *b);
313
294int vb2_queue_init(struct vb2_queue *q); 314int vb2_queue_init(struct vb2_queue *q);
295 315
296void vb2_queue_release(struct vb2_queue *q); 316void vb2_queue_release(struct vb2_queue *q);
@@ -302,6 +322,13 @@ int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type);
302int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type); 322int vb2_streamoff(struct vb2_queue *q, enum v4l2_buf_type type);
303 323
304int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma); 324int vb2_mmap(struct vb2_queue *q, struct vm_area_struct *vma);
325#ifndef CONFIG_MMU
326unsigned long vb2_get_unmapped_area(struct vb2_queue *q,
327 unsigned long addr,
328 unsigned long len,
329 unsigned long pgoff,
330 unsigned long flags);
331#endif
305unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait); 332unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait);
306size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count, 333size_t vb2_read(struct vb2_queue *q, char __user *data, size_t count,
307 loff_t *ppos, int nonblock); 334 loff_t *ppos, int nonblock);
diff --git a/include/media/videobuf2-dma-contig.h b/include/media/videobuf2-dma-contig.h
index 7e6c68b23773..19ae1e350567 100644
--- a/include/media/videobuf2-dma-contig.h
+++ b/include/media/videobuf2-dma-contig.h
@@ -17,11 +17,11 @@
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18 18
19static inline dma_addr_t 19static inline dma_addr_t
20vb2_dma_contig_plane_paddr(struct vb2_buffer *vb, unsigned int plane_no) 20vb2_dma_contig_plane_dma_addr(struct vb2_buffer *vb, unsigned int plane_no)
21{ 21{
22 dma_addr_t *paddr = vb2_plane_cookie(vb, plane_no); 22 dma_addr_t *addr = vb2_plane_cookie(vb, plane_no);
23 23
24 return *paddr; 24 return *addr;
25} 25}
26 26
27void *vb2_dma_contig_init_ctx(struct device *dev); 27void *vb2_dma_contig_init_ctx(struct device *dev);
diff --git a/include/misc/altera.h b/include/misc/altera.h
new file mode 100644
index 000000000000..94c0c6181daf
--- /dev/null
+++ b/include/misc/altera.h
@@ -0,0 +1,49 @@
1/*
2 * altera.h
3 *
4 * altera FPGA driver
5 *
6 * Copyright (C) Altera Corporation 1998-2001
7 * Copyright (C) 2010 NetUP Inc.
8 * Copyright (C) 2010 Igor M. Liplianin <liplianin@netup.ru>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 *
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#ifndef _ALTERA_H_
27#define _ALTERA_H_
28
29struct altera_config {
30 void *dev;
31 u8 *action;
32 int (*jtag_io) (void *dev, int tms, int tdi, int tdo);
33};
34
35#if defined(CONFIG_ALTERA_STAPL) || \
36 (defined(CONFIG_ALTERA_STAPL_MODULE) && defined(MODULE))
37
38extern int altera_init(struct altera_config *config, const struct firmware *fw);
39#else
40
41static inline int altera_init(struct altera_config *config,
42 const struct firmware *fw)
43{
44 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
45 return 0;
46}
47#endif /* CONFIG_ALTERA_STAPL */
48
49#endif /* _ALTERA_H_ */
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index 2f7d45bcbd24..1a7e1d20adf9 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -45,6 +45,51 @@ struct mtd_oob_buf64 {
45 __u64 usr_ptr; 45 __u64 usr_ptr;
46}; 46};
47 47
48/**
49 * MTD operation modes
50 *
51 * @MTD_OPS_PLACE_OOB: OOB data are placed at the given offset (default)
52 * @MTD_OPS_AUTO_OOB: OOB data are automatically placed at the free areas
53 * which are defined by the internal ecclayout
54 * @MTD_OPS_RAW: data are transferred as-is, with no error correction;
55 * this mode implies %MTD_OPS_PLACE_OOB
56 *
57 * These modes can be passed to ioctl(MEMWRITE) and are also used internally.
58 * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs.
59 * %MTD_FILE_MODE_RAW.
60 */
61enum {
62 MTD_OPS_PLACE_OOB = 0,
63 MTD_OPS_AUTO_OOB = 1,
64 MTD_OPS_RAW = 2,
65};
66
67/**
68 * struct mtd_write_req - data structure for requesting a write operation
69 *
70 * @start: start address
71 * @len: length of data buffer
72 * @ooblen: length of OOB buffer
73 * @usr_data: user-provided data buffer
74 * @usr_oob: user-provided OOB buffer
75 * @mode: MTD mode (see "MTD operation modes")
76 * @padding: reserved, must be set to 0
77 *
78 * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB
79 * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to
80 * write data-only, set @usr_oob == NULL. However, setting both @usr_data and
81 * @usr_oob to NULL is not allowed.
82 */
83struct mtd_write_req {
84 __u64 start;
85 __u64 len;
86 __u64 ooblen;
87 __u64 usr_data;
88 __u64 usr_oob;
89 __u8 mode;
90 __u8 padding[7];
91};
92
48#define MTD_ABSENT 0 93#define MTD_ABSENT 0
49#define MTD_RAM 1 94#define MTD_RAM 1
50#define MTD_ROM 2 95#define MTD_ROM 2
@@ -59,13 +104,13 @@ struct mtd_oob_buf64 {
59#define MTD_NO_ERASE 0x1000 /* No erase necessary */ 104#define MTD_NO_ERASE 0x1000 /* No erase necessary */
60#define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */ 105#define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */
61 106
62// Some common devices / combinations of capabilities 107/* Some common devices / combinations of capabilities */
63#define MTD_CAP_ROM 0 108#define MTD_CAP_ROM 0
64#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) 109#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
65#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) 110#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
66#define MTD_CAP_NANDFLASH (MTD_WRITEABLE) 111#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
67 112
68/* ECC byte placement */ 113/* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */
69#define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended) 114#define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended)
70#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode) 115#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode)
71#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme 116#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme
@@ -80,21 +125,18 @@ struct mtd_oob_buf64 {
80struct mtd_info_user { 125struct mtd_info_user {
81 __u8 type; 126 __u8 type;
82 __u32 flags; 127 __u32 flags;
83 __u32 size; // Total size of the MTD 128 __u32 size; /* Total size of the MTD */
84 __u32 erasesize; 129 __u32 erasesize;
85 __u32 writesize; 130 __u32 writesize;
86 __u32 oobsize; // Amount of OOB data per block (e.g. 16) 131 __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */
87 /* The below two fields are obsolete and broken, do not use them 132 __u64 padding; /* Old obsolete field; do not use */
88 * (TODO: remove at some point) */
89 __u32 ecctype;
90 __u32 eccsize;
91}; 133};
92 134
93struct region_info_user { 135struct region_info_user {
94 __u32 offset; /* At which this region starts, 136 __u32 offset; /* At which this region starts,
95 * from the beginning of the MTD */ 137 * from the beginning of the MTD */
96 __u32 erasesize; /* For this region */ 138 __u32 erasesize; /* For this region */
97 __u32 numblocks; /* Number of blocks in this region */ 139 __u32 numblocks; /* Number of blocks in this region */
98 __u32 regionindex; 140 __u32 regionindex;
99}; 141};
100 142
@@ -104,29 +146,61 @@ struct otp_info {
104 __u32 locked; 146 __u32 locked;
105}; 147};
106 148
149/*
150 * Note, the following ioctl existed in the past and was removed:
151 * #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
152 * Try to avoid adding a new ioctl with the same ioctl number.
153 */
154
155/* Get basic MTD characteristics info (better to use sysfs) */
107#define MEMGETINFO _IOR('M', 1, struct mtd_info_user) 156#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
157/* Erase segment of MTD */
108#define MEMERASE _IOW('M', 2, struct erase_info_user) 158#define MEMERASE _IOW('M', 2, struct erase_info_user)
159/* Write out-of-band data from MTD */
109#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) 160#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
161/* Read out-of-band data from MTD */
110#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) 162#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
163/* Lock a chip (for MTD that supports it) */
111#define MEMLOCK _IOW('M', 5, struct erase_info_user) 164#define MEMLOCK _IOW('M', 5, struct erase_info_user)
165/* Unlock a chip (for MTD that supports it) */
112#define MEMUNLOCK _IOW('M', 6, struct erase_info_user) 166#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
167/* Get the number of different erase regions */
113#define MEMGETREGIONCOUNT _IOR('M', 7, int) 168#define MEMGETREGIONCOUNT _IOR('M', 7, int)
169/* Get information about the erase region for a specific index */
114#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) 170#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
115#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) 171/* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */
116#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) 172#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
173/* Check if an eraseblock is bad */
117#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t) 174#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t)
175/* Mark an eraseblock as bad */
118#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t) 176#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t)
177/* Set OTP (One-Time Programmable) mode (factory vs. user) */
119#define OTPSELECT _IOR('M', 13, int) 178#define OTPSELECT _IOR('M', 13, int)
179/* Get number of OTP (One-Time Programmable) regions */
120#define OTPGETREGIONCOUNT _IOW('M', 14, int) 180#define OTPGETREGIONCOUNT _IOW('M', 14, int)
181/* Get all OTP (One-Time Programmable) info about MTD */
121#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) 182#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
183/* Lock a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */
122#define OTPLOCK _IOR('M', 16, struct otp_info) 184#define OTPLOCK _IOR('M', 16, struct otp_info)
185/* Get ECC layout (deprecated) */
123#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user) 186#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user)
187/* Get statistics about corrected/uncorrected errors */
124#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) 188#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
189/* Set MTD mode on a per-file-descriptor basis (see "MTD file modes") */
125#define MTDFILEMODE _IO('M', 19) 190#define MTDFILEMODE _IO('M', 19)
191/* Erase segment of MTD (supports 64-bit address) */
126#define MEMERASE64 _IOW('M', 20, struct erase_info_user64) 192#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
193/* Write data to OOB (64-bit version) */
127#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64) 194#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
195/* Read data from OOB (64-bit version) */
128#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64) 196#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)
197/* Check if chip is locked (for MTD that supports it) */
129#define MEMISLOCKED _IOR('M', 23, struct erase_info_user) 198#define MEMISLOCKED _IOR('M', 23, struct erase_info_user)
199/*
200 * Most generic write interface; can write in-band and/or out-of-band in various
201 * modes (see "struct mtd_write_req")
202 */
203#define MEMWRITE _IOWR('M', 24, struct mtd_write_req)
130 204
131/* 205/*
132 * Obsolete legacy interface. Keep it in order not to break userspace 206 * Obsolete legacy interface. Keep it in order not to break userspace
@@ -177,13 +251,27 @@ struct mtd_ecc_stats {
177}; 251};
178 252
179/* 253/*
180 * Read/write file modes for access to MTD 254 * MTD file modes - for read/write access to MTD
255 *
256 * @MTD_FILE_MODE_NORMAL: OTP disabled, ECC enabled
257 * @MTD_FILE_MODE_OTP_FACTORY: OTP enabled in factory mode
258 * @MTD_FILE_MODE_OTP_USER: OTP enabled in user mode
259 * @MTD_FILE_MODE_RAW: OTP disabled, ECC disabled
260 *
261 * These modes can be set via ioctl(MTDFILEMODE). The mode mode will be retained
262 * separately for each open file descriptor.
263 *
264 * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW -
265 * raw access to the flash, without error correction or autoplacement schemes.
266 * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode
267 * (e.g., when using ioctl(MEMWRITE)), but in some cases, the MTD_FILE_MODE is
268 * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)).
181 */ 269 */
182enum mtd_file_modes { 270enum mtd_file_modes {
183 MTD_MODE_NORMAL = MTD_OTP_OFF, 271 MTD_FILE_MODE_NORMAL = MTD_OTP_OFF,
184 MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY, 272 MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
185 MTD_MODE_OTP_USER = MTD_OTP_USER, 273 MTD_FILE_MODE_OTP_USER = MTD_OTP_USER,
186 MTD_MODE_RAW, 274 MTD_FILE_MODE_RAW,
187}; 275};
188 276
189#endif /* __MTD_ABI_H__ */ 277#endif /* __MTD_ABI_H__ */
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 342dcf13d039..2d70b95b3b55 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -76,11 +76,8 @@ do { \
76 } \ 76 } \
77} while (0) 77} while (0)
78 78
79#define P9_DUMP_PKT(way, pdu) p9pdu_dump(way, pdu)
80
81#else 79#else
82#define P9_DPRINTK(level, format, arg...) do { } while (0) 80#define P9_DPRINTK(level, format, arg...) do { } while (0)
83#define P9_DUMP_PKT(way, pdu) do { } while (0)
84#endif 81#endif
85 82
86 83
@@ -288,6 +285,35 @@ enum p9_perm_t {
288 P9_DMSETVTX = 0x00010000, 285 P9_DMSETVTX = 0x00010000,
289}; 286};
290 287
288/* 9p2000.L open flags */
289#define P9_DOTL_RDONLY 00000000
290#define P9_DOTL_WRONLY 00000001
291#define P9_DOTL_RDWR 00000002
292#define P9_DOTL_NOACCESS 00000003
293#define P9_DOTL_CREATE 00000100
294#define P9_DOTL_EXCL 00000200
295#define P9_DOTL_NOCTTY 00000400
296#define P9_DOTL_TRUNC 00001000
297#define P9_DOTL_APPEND 00002000
298#define P9_DOTL_NONBLOCK 00004000
299#define P9_DOTL_DSYNC 00010000
300#define P9_DOTL_FASYNC 00020000
301#define P9_DOTL_DIRECT 00040000
302#define P9_DOTL_LARGEFILE 00100000
303#define P9_DOTL_DIRECTORY 00200000
304#define P9_DOTL_NOFOLLOW 00400000
305#define P9_DOTL_NOATIME 01000000
306#define P9_DOTL_CLOEXEC 02000000
307#define P9_DOTL_SYNC 04000000
308
309/* 9p2000.L at flags */
310#define P9_DOTL_AT_REMOVEDIR 0x200
311
312/* 9p2000.L lock type */
313#define P9_LOCK_TYPE_RDLCK 0
314#define P9_LOCK_TYPE_WRLCK 1
315#define P9_LOCK_TYPE_UNLCK 2
316
291/** 317/**
292 * enum p9_qid_t - QID types 318 * enum p9_qid_t - QID types
293 * @P9_QTDIR: directory 319 * @P9_QTDIR: directory
@@ -330,6 +356,9 @@ enum p9_qid_t {
330/* Room for readdir header */ 356/* Room for readdir header */
331#define P9_READDIRHDRSZ 24 357#define P9_READDIRHDRSZ 24
332 358
359/* size of header for zero copy read/write */
360#define P9_ZC_HDR_SZ 4096
361
333/** 362/**
334 * struct p9_qid - file system entity information 363 * struct p9_qid - file system entity information
335 * @type: 8-bit type &p9_qid_t 364 * @type: 8-bit type &p9_qid_t
@@ -526,10 +555,6 @@ struct p9_rstatfs {
526 * @tag: transaction id of the request 555 * @tag: transaction id of the request
527 * @offset: used by marshalling routines to track current position in buffer 556 * @offset: used by marshalling routines to track current position in buffer
528 * @capacity: used by marshalling routines to track total malloc'd capacity 557 * @capacity: used by marshalling routines to track total malloc'd capacity
529 * @pubuf: Payload user buffer given by the caller
530 * @pkbuf: Payload kernel buffer given by the caller
531 * @pbuf_size: pubuf/pkbuf(only one will be !NULL) size to be read/write.
532 * @private: For transport layer's use.
533 * @sdata: payload 558 * @sdata: payload
534 * 559 *
535 * &p9_fcall represents the structure for all 9P RPC 560 * &p9_fcall represents the structure for all 9P RPC
@@ -546,10 +571,6 @@ struct p9_fcall {
546 571
547 size_t offset; 572 size_t offset;
548 size_t capacity; 573 size_t capacity;
549 char __user *pubuf;
550 char *pkbuf;
551 size_t pbuf_size;
552 void *private;
553 574
554 u8 *sdata; 575 u8 *sdata;
555}; 576};
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 55ce72ce9861..fc9b90b0c052 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -151,7 +151,7 @@ struct p9_req_t {
151 151
152struct p9_client { 152struct p9_client {
153 spinlock_t lock; /* protect client structure */ 153 spinlock_t lock; /* protect client structure */
154 int msize; 154 unsigned int msize;
155 unsigned char proto_version; 155 unsigned char proto_version;
156 struct p9_trans_module *trans_mod; 156 struct p9_trans_module *trans_mod;
157 enum p9_trans_status status; 157 enum p9_trans_status status;
@@ -240,8 +240,8 @@ int p9_client_read(struct p9_fid *fid, char *data, char __user *udata,
240int p9_client_write(struct p9_fid *fid, char *data, const char __user *udata, 240int p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
241 u64 offset, u32 count); 241 u64 offset, u32 count);
242int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset); 242int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset);
243int p9dirent_read(char *buf, int len, struct p9_dirent *dirent, 243int p9dirent_read(struct p9_client *clnt, char *buf, int len,
244 int proto_version); 244 struct p9_dirent *dirent);
245struct p9_wstat *p9_client_stat(struct p9_fid *fid); 245struct p9_wstat *p9_client_stat(struct p9_fid *fid);
246int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst); 246int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst);
247int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *attr); 247int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *attr);
@@ -259,7 +259,7 @@ struct p9_req_t *p9_tag_lookup(struct p9_client *, u16);
259void p9_client_cb(struct p9_client *c, struct p9_req_t *req); 259void p9_client_cb(struct p9_client *c, struct p9_req_t *req);
260 260
261int p9_parse_header(struct p9_fcall *, int32_t *, int8_t *, int16_t *, int); 261int p9_parse_header(struct p9_fcall *, int32_t *, int8_t *, int16_t *, int);
262int p9stat_read(char *, int, struct p9_wstat *, int); 262int p9stat_read(struct p9_client *, char *, int, struct p9_wstat *);
263void p9stat_free(struct p9_wstat *); 263void p9stat_free(struct p9_wstat *);
264 264
265int p9_is_proto_dotu(struct p9_client *clnt); 265int p9_is_proto_dotu(struct p9_client *clnt);
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index 83531ebeee99..adcbb20f6511 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -26,13 +26,6 @@
26#ifndef NET_9P_TRANSPORT_H 26#ifndef NET_9P_TRANSPORT_H
27#define NET_9P_TRANSPORT_H 27#define NET_9P_TRANSPORT_H
28 28
29#define P9_TRANS_PREF_PAYLOAD_MASK 0x1
30
31/* Default. Add Payload to PDU before sending it down to transport layer */
32#define P9_TRANS_PREF_PAYLOAD_DEF 0x0
33/* Send pay load separately to transport layer along with PDU.*/
34#define P9_TRANS_PREF_PAYLOAD_SEP 0x1
35
36/** 29/**
37 * struct p9_trans_module - transport module interface 30 * struct p9_trans_module - transport module interface
38 * @list: used to maintain a list of currently available transports 31 * @list: used to maintain a list of currently available transports
@@ -56,13 +49,14 @@ struct p9_trans_module {
56 struct list_head list; 49 struct list_head list;
57 char *name; /* name of transport */ 50 char *name; /* name of transport */
58 int maxsize; /* max message size of transport */ 51 int maxsize; /* max message size of transport */
59 int pref; /* Preferences of this transport */
60 int def; /* this transport should be default */ 52 int def; /* this transport should be default */
61 struct module *owner; 53 struct module *owner;
62 int (*create)(struct p9_client *, const char *, char *); 54 int (*create)(struct p9_client *, const char *, char *);
63 void (*close) (struct p9_client *); 55 void (*close) (struct p9_client *);
64 int (*request) (struct p9_client *, struct p9_req_t *req); 56 int (*request) (struct p9_client *, struct p9_req_t *req);
65 int (*cancel) (struct p9_client *, struct p9_req_t *req); 57 int (*cancel) (struct p9_client *, struct p9_req_t *req);
58 int (*zc_request)(struct p9_client *, struct p9_req_t *,
59 char *, char *, int , int, int, int);
66}; 60};
67 61
68void v9fs_register_trans(struct p9_trans_module *m); 62void v9fs_register_trans(struct p9_trans_module *m);
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 582e4ae70753..cbc6bb0a6838 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -8,7 +8,7 @@
8 8
9#define TEMP_VALID_LIFETIME (7*86400) 9#define TEMP_VALID_LIFETIME (7*86400)
10#define TEMP_PREFERRED_LIFETIME (86400) 10#define TEMP_PREFERRED_LIFETIME (86400)
11#define REGEN_MAX_RETRY (5) 11#define REGEN_MAX_RETRY (3)
12#define MAX_DESYNC_FACTOR (600) 12#define MAX_DESYNC_FACTOR (600)
13 13
14#define ADDR_CHECK_FREQUENCY (120*HZ) 14#define ADDR_CHECK_FREQUENCY (120*HZ)
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index e727555d4ee9..e86af08293a8 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -77,7 +77,7 @@ struct bt_power {
77#define BT_POWER_FORCE_ACTIVE_OFF 0 77#define BT_POWER_FORCE_ACTIVE_OFF 0
78#define BT_POWER_FORCE_ACTIVE_ON 1 78#define BT_POWER_FORCE_ACTIVE_ON 1
79 79
80__attribute__((format (printf, 2, 3))) 80__printf(2, 3)
81int bt_printk(const char *level, const char *fmt, ...); 81int bt_printk(const char *level, const char *fmt, ...);
82 82
83#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg) 83#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index be30aabe7b88..aaf79af72432 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -716,6 +716,16 @@ struct hci_rp_read_bd_addr {
716 bdaddr_t bdaddr; 716 bdaddr_t bdaddr;
717} __packed; 717} __packed;
718 718
719#define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c
720struct hci_cp_write_page_scan_activity {
721 __le16 interval;
722 __le16 window;
723} __packed;
724
725#define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47
726 #define PAGE_SCAN_TYPE_STANDARD 0x00
727 #define PAGE_SCAN_TYPE_INTERLACED 0x01
728
719#define HCI_OP_LE_SET_EVENT_MASK 0x2001 729#define HCI_OP_LE_SET_EVENT_MASK 0x2001
720struct hci_cp_le_set_event_mask { 730struct hci_cp_le_set_event_mask {
721 __u8 mask[8]; 731 __u8 mask[8];
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 8f441b8b2963..3779ea362257 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -195,8 +195,6 @@ struct hci_dev {
195 195
196 __u16 init_last_cmd; 196 __u16 init_last_cmd;
197 197
198 struct crypto_blkcipher *tfm;
199
200 struct inquiry_cache inq_cache; 198 struct inquiry_cache inq_cache;
201 struct hci_conn_hash conn_hash; 199 struct hci_conn_hash conn_hash;
202 struct list_head blacklist; 200 struct list_head blacklist;
@@ -348,6 +346,7 @@ enum {
348 HCI_CONN_RSWITCH_PEND, 346 HCI_CONN_RSWITCH_PEND,
349 HCI_CONN_MODE_CHANGE_PEND, 347 HCI_CONN_MODE_CHANGE_PEND,
350 HCI_CONN_SCO_SETUP_PEND, 348 HCI_CONN_SCO_SETUP_PEND,
349 HCI_CONN_LE_SMP_PEND,
351}; 350};
352 351
353static inline void hci_conn_hash_init(struct hci_dev *hdev) 352static inline void hci_conn_hash_init(struct hci_dev *hdev)
@@ -395,6 +394,22 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
395 } 394 }
396} 395}
397 396
397static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type)
398{
399 struct hci_conn_hash *h = &hdev->conn_hash;
400 switch (type) {
401 case ACL_LINK:
402 return h->acl_num;
403 case LE_LINK:
404 return h->le_num;
405 case SCO_LINK:
406 case ESCO_LINK:
407 return h->sco_num;
408 default:
409 return 0;
410 }
411}
412
398static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev, 413static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
399 __u16 handle) 414 __u16 handle)
400{ 415{
@@ -475,7 +490,7 @@ static inline void hci_conn_put(struct hci_conn *conn)
475{ 490{
476 if (atomic_dec_and_test(&conn->refcnt)) { 491 if (atomic_dec_and_test(&conn->refcnt)) {
477 unsigned long timeo; 492 unsigned long timeo;
478 if (conn->type == ACL_LINK) { 493 if (conn->type == ACL_LINK || conn->type == LE_LINK) {
479 del_timer(&conn->idle_timer); 494 del_timer(&conn->idle_timer);
480 if (conn->state == BT_CONNECTED) { 495 if (conn->state == BT_CONNECTED) {
481 timeo = msecs_to_jiffies(conn->disc_timeout); 496 timeo = msecs_to_jiffies(conn->disc_timeout);
@@ -498,11 +513,15 @@ static inline void __hci_dev_put(struct hci_dev *d)
498 d->destruct(d); 513 d->destruct(d);
499} 514}
500 515
501static inline void hci_dev_put(struct hci_dev *d) 516/*
502{ 517 * hci_dev_put and hci_dev_hold are macros to avoid dragging all the
503 __hci_dev_put(d); 518 * overhead of all the modular infrastructure into this header.
504 module_put(d->owner); 519 */
505} 520#define hci_dev_put(d) \
521do { \
522 __hci_dev_put(d); \
523 module_put(d->owner); \
524} while (0)
506 525
507static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d) 526static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
508{ 527{
@@ -510,12 +529,10 @@ static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
510 return d; 529 return d;
511} 530}
512 531
513static inline struct hci_dev *hci_dev_hold(struct hci_dev *d) 532#define hci_dev_hold(d) \
514{ 533({ \
515 if (try_module_get(d->owner)) 534 try_module_get(d->owner) ? __hci_dev_hold(d) : NULL; \
516 return __hci_dev_hold(d); 535})
517 return NULL;
518}
519 536
520#define hci_dev_lock(d) spin_lock(&d->lock) 537#define hci_dev_lock(d) spin_lock(&d->lock)
521#define hci_dev_unlock(d) spin_unlock(&d->lock) 538#define hci_dev_unlock(d) spin_unlock(&d->lock)
@@ -838,7 +855,7 @@ int mgmt_powered(u16 index, u8 powered);
838int mgmt_discoverable(u16 index, u8 discoverable); 855int mgmt_discoverable(u16 index, u8 discoverable);
839int mgmt_connectable(u16 index, u8 connectable); 856int mgmt_connectable(u16 index, u8 connectable);
840int mgmt_new_key(u16 index, struct link_key *key, u8 persistent); 857int mgmt_new_key(u16 index, struct link_key *key, u8 persistent);
841int mgmt_connected(u16 index, bdaddr_t *bdaddr); 858int mgmt_connected(u16 index, bdaddr_t *bdaddr, u8 link_type);
842int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); 859int mgmt_disconnected(u16 index, bdaddr_t *bdaddr);
843int mgmt_disconnect_failed(u16 index); 860int mgmt_disconnect_failed(u16 index);
844int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status); 861int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status);
@@ -858,6 +875,8 @@ int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi,
858 u8 *eir); 875 u8 *eir);
859int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name); 876int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name);
860int mgmt_discovering(u16 index, u8 discovering); 877int mgmt_discovering(u16 index, u8 discovering);
878int mgmt_device_blocked(u16 index, bdaddr_t *bdaddr);
879int mgmt_device_unblocked(u16 index, bdaddr_t *bdaddr);
861 880
862/* HCI info for socket */ 881/* HCI info for socket */
863#define hci_pi(sk) ((struct hci_pinfo *) sk) 882#define hci_pi(sk) ((struct hci_pinfo *) sk)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 4f34ad25e75c..ab90ae0970a6 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -354,8 +354,8 @@ struct l2cap_chan {
354 __u8 retry_count; 354 __u8 retry_count;
355 __u8 num_acked; 355 __u8 num_acked;
356 __u16 sdu_len; 356 __u16 sdu_len;
357 __u16 partial_sdu_len;
358 struct sk_buff *sdu; 357 struct sk_buff *sdu;
358 struct sk_buff *sdu_last_frag;
359 359
360 __u8 remote_tx_win; 360 __u8 remote_tx_win;
361 __u8 remote_max_tx; 361 __u8 remote_max_tx;
@@ -409,14 +409,8 @@ struct l2cap_conn {
409 409
410 __u8 disc_reason; 410 __u8 disc_reason;
411 411
412 __u8 preq[7]; /* SMP Pairing Request */
413 __u8 prsp[7]; /* SMP Pairing Response */
414 __u8 prnd[16]; /* SMP Pairing Random */
415 __u8 pcnf[16]; /* SMP Pairing Confirm */
416 __u8 tk[16]; /* SMP Temporary Key */
417 __u8 smp_key_size;
418
419 struct timer_list security_timer; 412 struct timer_list security_timer;
413 struct smp_chan *smp_chan;
420 414
421 struct list_head chan_l; 415 struct list_head chan_l;
422 rwlock_t chan_lock; 416 rwlock_t chan_lock;
@@ -454,7 +448,6 @@ enum {
454#define L2CAP_CONF_MAX_CONF_RSP 2 448#define L2CAP_CONF_MAX_CONF_RSP 2
455 449
456enum { 450enum {
457 CONN_SAR_SDU,
458 CONN_SREJ_SENT, 451 CONN_SREJ_SENT,
459 CONN_WAIT_F, 452 CONN_WAIT_F,
460 CONN_SREJ_ACT, 453 CONN_SREJ_ACT,
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 5428fd32ccec..d66da0f94f95 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -211,6 +211,11 @@ struct mgmt_cp_unblock_device {
211 bdaddr_t bdaddr; 211 bdaddr_t bdaddr;
212} __packed; 212} __packed;
213 213
214#define MGMT_OP_SET_FAST_CONNECTABLE 0x001F
215struct mgmt_cp_set_fast_connectable {
216 __u8 enable;
217} __packed;
218
214#define MGMT_EV_CMD_COMPLETE 0x0001 219#define MGMT_EV_CMD_COMPLETE 0x0001
215struct mgmt_ev_cmd_complete { 220struct mgmt_ev_cmd_complete {
216 __le16 opcode; 221 __le16 opcode;
@@ -249,6 +254,7 @@ struct mgmt_ev_new_key {
249#define MGMT_EV_CONNECTED 0x000B 254#define MGMT_EV_CONNECTED 0x000B
250struct mgmt_ev_connected { 255struct mgmt_ev_connected {
251 bdaddr_t bdaddr; 256 bdaddr_t bdaddr;
257 __u8 link_type;
252} __packed; 258} __packed;
253 259
254#define MGMT_EV_DISCONNECTED 0x000C 260#define MGMT_EV_DISCONNECTED 0x000C
@@ -301,3 +307,13 @@ struct mgmt_ev_remote_name {
301} __packed; 307} __packed;
302 308
303#define MGMT_EV_DISCOVERING 0x0014 309#define MGMT_EV_DISCOVERING 0x0014
310
311#define MGMT_EV_DEVICE_BLOCKED 0x0015
312struct mgmt_ev_device_blocked {
313 bdaddr_t bdaddr;
314} __packed;
315
316#define MGMT_EV_DEVICE_UNBLOCKED 0x0016
317struct mgmt_ev_device_unblocked {
318 bdaddr_t bdaddr;
319} __packed;
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index d5eee2093b1e..e2e3ecad1008 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -211,6 +211,7 @@ struct rfcomm_dlc {
211#define RFCOMM_AUTH_ACCEPT 6 211#define RFCOMM_AUTH_ACCEPT 6
212#define RFCOMM_AUTH_REJECT 7 212#define RFCOMM_AUTH_REJECT 7
213#define RFCOMM_DEFER_SETUP 8 213#define RFCOMM_DEFER_SETUP 8
214#define RFCOMM_ENC_DROP 9
214 215
215/* Scheduling flags and events */ 216/* Scheduling flags and events */
216#define RFCOMM_SCHED_WAKEUP 31 217#define RFCOMM_SCHED_WAKEUP 31
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h
index 46c457612300..15b97d549441 100644
--- a/include/net/bluetooth/smp.h
+++ b/include/net/bluetooth/smp.h
@@ -115,9 +115,26 @@ struct smp_cmd_security_req {
115#define SMP_MIN_ENC_KEY_SIZE 7 115#define SMP_MIN_ENC_KEY_SIZE 7
116#define SMP_MAX_ENC_KEY_SIZE 16 116#define SMP_MAX_ENC_KEY_SIZE 16
117 117
118struct smp_chan {
119 struct l2cap_conn *conn;
120 u8 preq[7]; /* SMP Pairing Request */
121 u8 prsp[7]; /* SMP Pairing Response */
122 u8 prnd[16]; /* SMP Pairing Random (local) */
123 u8 rrnd[16]; /* SMP Pairing Random (remote) */
124 u8 pcnf[16]; /* SMP Pairing Confirm */
125 u8 tk[16]; /* SMP Temporary Key */
126 u8 smp_key_size;
127 struct crypto_blkcipher *tfm;
128 struct work_struct confirm;
129 struct work_struct random;
130
131};
132
118/* SMP Commands */ 133/* SMP Commands */
119int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); 134int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level);
120int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); 135int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb);
121int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); 136int smp_distribute_keys(struct l2cap_conn *conn, __u8 force);
122 137
138void smp_chan_destroy(struct l2cap_conn *conn);
139
123#endif /* __SMP_H */ 140#endif /* __SMP_H */
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h
index c5dedd87b4cb..8d552519ff67 100644
--- a/include/net/caif/caif_hsi.h
+++ b/include/net/caif/caif_hsi.h
@@ -52,8 +52,9 @@ struct cfhsi_desc {
52/* 52/*
53 * Maximum bytes transferred in one transfer. 53 * Maximum bytes transferred in one transfer.
54 */ 54 */
55/* TODO: 4096 is temporary... */ 55#define CFHSI_MAX_CAIF_FRAME_SZ 4096
56#define CFHSI_MAX_PAYLOAD_SZ (CFHSI_MAX_PKTS * 4096) 56
57#define CFHSI_MAX_PAYLOAD_SZ (CFHSI_MAX_PKTS * CFHSI_MAX_CAIF_FRAME_SZ)
57 58
58/* Size of the complete HSI TX buffer. */ 59/* Size of the complete HSI TX buffer. */
59#define CFHSI_BUF_SZ_TX (CFHSI_DESC_SZ + CFHSI_MAX_PAYLOAD_SZ) 60#define CFHSI_BUF_SZ_TX (CFHSI_DESC_SZ + CFHSI_MAX_PAYLOAD_SZ)
@@ -75,18 +76,21 @@ struct cfhsi_desc {
75#define CFHSI_WAKE_UP_ACK 1 76#define CFHSI_WAKE_UP_ACK 1
76#define CFHSI_WAKE_DOWN_ACK 2 77#define CFHSI_WAKE_DOWN_ACK 2
77#define CFHSI_AWAKE 3 78#define CFHSI_AWAKE 3
78#define CFHSI_PENDING_RX 4 79#define CFHSI_WAKELOCK_HELD 4
79#define CFHSI_SHUTDOWN 6 80#define CFHSI_SHUTDOWN 5
80#define CFHSI_FLUSH_FIFO 7 81#define CFHSI_FLUSH_FIFO 6
81 82
82#ifndef CFHSI_INACTIVITY_TOUT 83#ifndef CFHSI_INACTIVITY_TOUT
83#define CFHSI_INACTIVITY_TOUT (1 * HZ) 84#define CFHSI_INACTIVITY_TOUT (1 * HZ)
84#endif /* CFHSI_INACTIVITY_TOUT */ 85#endif /* CFHSI_INACTIVITY_TOUT */
85 86
86#ifndef CFHSI_WAKEUP_TOUT 87#ifndef CFHSI_WAKE_TOUT
87#define CFHSI_WAKEUP_TOUT (3 * HZ) 88#define CFHSI_WAKE_TOUT (3 * HZ)
88#endif /* CFHSI_WAKEUP_TOUT */ 89#endif /* CFHSI_WAKE_TOUT */
89 90
91#ifndef CFHSI_MAX_RX_RETRIES
92#define CFHSI_MAX_RX_RETRIES (10 * HZ)
93#endif
90 94
91/* Structure implemented by the CAIF HSI driver. */ 95/* Structure implemented by the CAIF HSI driver. */
92struct cfhsi_drv { 96struct cfhsi_drv {
@@ -104,11 +108,21 @@ struct cfhsi_dev {
104 int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev); 108 int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev);
105 int (*cfhsi_wake_up) (struct cfhsi_dev *dev); 109 int (*cfhsi_wake_up) (struct cfhsi_dev *dev);
106 int (*cfhsi_wake_down) (struct cfhsi_dev *dev); 110 int (*cfhsi_wake_down) (struct cfhsi_dev *dev);
111 int (*cfhsi_get_peer_wake) (struct cfhsi_dev *dev, bool *status);
107 int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy); 112 int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy);
108 int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev); 113 int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev);
109 struct cfhsi_drv *drv; 114 struct cfhsi_drv *drv;
110}; 115};
111 116
117/* Structure holds status of received CAIF frames processing */
118struct cfhsi_rx_state {
119 int state;
120 int nfrms;
121 int pld_len;
122 int retries;
123 bool piggy_desc;
124};
125
112/* Structure implemented by CAIF HSI drivers. */ 126/* Structure implemented by CAIF HSI drivers. */
113struct cfhsi { 127struct cfhsi {
114 struct caif_dev_common cfdev; 128 struct caif_dev_common cfdev;
@@ -118,7 +132,8 @@ struct cfhsi {
118 struct cfhsi_drv drv; 132 struct cfhsi_drv drv;
119 struct cfhsi_dev *dev; 133 struct cfhsi_dev *dev;
120 int tx_state; 134 int tx_state;
121 int rx_state; 135 struct cfhsi_rx_state rx_state;
136 unsigned long inactivity_timeout;
122 int rx_len; 137 int rx_len;
123 u8 *rx_ptr; 138 u8 *rx_ptr;
124 u8 *tx_buf; 139 u8 *tx_buf;
@@ -130,13 +145,13 @@ struct cfhsi {
130 struct list_head list; 145 struct list_head list;
131 struct work_struct wake_up_work; 146 struct work_struct wake_up_work;
132 struct work_struct wake_down_work; 147 struct work_struct wake_down_work;
133 struct work_struct rx_done_work; 148 struct work_struct out_of_sync_work;
134 struct work_struct tx_done_work;
135 struct workqueue_struct *wq; 149 struct workqueue_struct *wq;
136 wait_queue_head_t wake_up_wait; 150 wait_queue_head_t wake_up_wait;
137 wait_queue_head_t wake_down_wait; 151 wait_queue_head_t wake_down_wait;
138 wait_queue_head_t flush_fifo_wait; 152 wait_queue_head_t flush_fifo_wait;
139 struct timer_list timer; 153 struct timer_list timer;
154 struct timer_list rx_slowpath_timer;
140 unsigned long bits; 155 unsigned long bits;
141}; 156};
142 157
diff --git a/include/net/cfg80211-wext.h b/include/net/cfg80211-wext.h
new file mode 100644
index 000000000000..25baddc4fbed
--- /dev/null
+++ b/include/net/cfg80211-wext.h
@@ -0,0 +1,55 @@
1#ifndef __NET_CFG80211_WEXT_H
2#define __NET_CFG80211_WEXT_H
3/*
4 * 802.11 device and configuration interface -- wext handlers
5 *
6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/netdevice.h>
14#include <linux/wireless.h>
15#include <net/iw_handler.h>
16
17/*
18 * Temporary wext handlers & helper functions
19 *
20 * These are used only by drivers that aren't yet fully
21 * converted to cfg80211.
22 */
23int cfg80211_wext_giwname(struct net_device *dev,
24 struct iw_request_info *info,
25 char *name, char *extra);
26int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
27 u32 *mode, char *extra);
28int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
29 u32 *mode, char *extra);
30int cfg80211_wext_siwscan(struct net_device *dev,
31 struct iw_request_info *info,
32 union iwreq_data *wrqu, char *extra);
33int cfg80211_wext_giwscan(struct net_device *dev,
34 struct iw_request_info *info,
35 struct iw_point *data, char *extra);
36int cfg80211_wext_giwrange(struct net_device *dev,
37 struct iw_request_info *info,
38 struct iw_point *data, char *extra);
39int cfg80211_wext_siwrts(struct net_device *dev,
40 struct iw_request_info *info,
41 struct iw_param *rts, char *extra);
42int cfg80211_wext_giwrts(struct net_device *dev,
43 struct iw_request_info *info,
44 struct iw_param *rts, char *extra);
45int cfg80211_wext_siwfrag(struct net_device *dev,
46 struct iw_request_info *info,
47 struct iw_param *frag, char *extra);
48int cfg80211_wext_giwfrag(struct net_device *dev,
49 struct iw_request_info *info,
50 struct iw_param *frag, char *extra);
51int cfg80211_wext_giwretry(struct net_device *dev,
52 struct iw_request_info *info,
53 struct iw_param *retry, char *extra);
54
55#endif /* __NET_CFG80211_WEXT_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d17f47fc9e31..92cf1c2c30c9 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -20,11 +20,6 @@
20#include <linux/ieee80211.h> 20#include <linux/ieee80211.h>
21#include <net/regulatory.h> 21#include <net/regulatory.h>
22 22
23/* remove once we remove the wext stuff */
24#include <net/iw_handler.h>
25#include <linux/wireless.h>
26
27
28/** 23/**
29 * DOC: Introduction 24 * DOC: Introduction
30 * 25 *
@@ -339,6 +334,36 @@ struct survey_info {
339}; 334};
340 335
341/** 336/**
337 * struct cfg80211_crypto_settings - Crypto settings
338 * @wpa_versions: indicates which, if any, WPA versions are enabled
339 * (from enum nl80211_wpa_versions)
340 * @cipher_group: group key cipher suite (or 0 if unset)
341 * @n_ciphers_pairwise: number of AP supported unicast ciphers
342 * @ciphers_pairwise: unicast key cipher suites
343 * @n_akm_suites: number of AKM suites
344 * @akm_suites: AKM suites
345 * @control_port: Whether user space controls IEEE 802.1X port, i.e.,
346 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
347 * required to assume that the port is unauthorized until authorized by
348 * user space. Otherwise, port is marked authorized by default.
349 * @control_port_ethertype: the control port protocol that should be
350 * allowed through even on unauthorized ports
351 * @control_port_no_encrypt: TRUE to prevent encryption of control port
352 * protocol frames.
353 */
354struct cfg80211_crypto_settings {
355 u32 wpa_versions;
356 u32 cipher_group;
357 int n_ciphers_pairwise;
358 u32 ciphers_pairwise[NL80211_MAX_NR_CIPHER_SUITES];
359 int n_akm_suites;
360 u32 akm_suites[NL80211_MAX_NR_AKM_SUITES];
361 bool control_port;
362 __be16 control_port_ethertype;
363 bool control_port_no_encrypt;
364};
365
366/**
342 * struct beacon_parameters - beacon parameters 367 * struct beacon_parameters - beacon parameters
343 * 368 *
344 * Used to configure the beacon for an interface. 369 * Used to configure the beacon for an interface.
@@ -351,11 +376,38 @@ struct survey_info {
351 * @dtim_period: DTIM period or zero if not changed 376 * @dtim_period: DTIM period or zero if not changed
352 * @head_len: length of @head 377 * @head_len: length of @head
353 * @tail_len: length of @tail 378 * @tail_len: length of @tail
379 * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from
380 * user space)
381 * @ssid_len: length of @ssid
382 * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames
383 * @crypto: crypto settings
384 * @privacy: the BSS uses privacy
385 * @auth_type: Authentication type (algorithm)
386 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
387 * @beacon_ies_len: length of beacon_ies in octets
388 * @proberesp_ies: extra information element(s) to add into Probe Response
389 * frames or %NULL
390 * @proberesp_ies_len: length of proberesp_ies in octets
391 * @assocresp_ies: extra information element(s) to add into (Re)Association
392 * Response frames or %NULL
393 * @assocresp_ies_len: length of assocresp_ies in octets
354 */ 394 */
355struct beacon_parameters { 395struct beacon_parameters {
356 u8 *head, *tail; 396 u8 *head, *tail;
357 int interval, dtim_period; 397 int interval, dtim_period;
358 int head_len, tail_len; 398 int head_len, tail_len;
399 const u8 *ssid;
400 size_t ssid_len;
401 enum nl80211_hidden_ssid hidden_ssid;
402 struct cfg80211_crypto_settings crypto;
403 bool privacy;
404 enum nl80211_auth_type auth_type;
405 const u8 *beacon_ies;
406 size_t beacon_ies_len;
407 const u8 *proberesp_ies;
408 size_t proberesp_ies_len;
409 const u8 *assocresp_ies;
410 size_t assocresp_ies_len;
359}; 411};
360 412
361/** 413/**
@@ -372,6 +424,17 @@ enum plink_actions {
372}; 424};
373 425
374/** 426/**
427 * enum station_parameters_apply_mask - station parameter values to apply
428 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
429 *
430 * Not all station parameters have in-band "no change" signalling,
431 * for those that don't these flags will are used.
432 */
433enum station_parameters_apply_mask {
434 STATION_PARAM_APPLY_UAPSD = BIT(0),
435};
436
437/**
375 * struct station_parameters - station parameters 438 * struct station_parameters - station parameters
376 * 439 *
377 * Used to change and create a new station. 440 * Used to change and create a new station.
@@ -389,17 +452,24 @@ enum plink_actions {
389 * @plink_action: plink action to take 452 * @plink_action: plink action to take
390 * @plink_state: set the peer link state for a station 453 * @plink_state: set the peer link state for a station
391 * @ht_capa: HT capabilities of station 454 * @ht_capa: HT capabilities of station
455 * @uapsd_queues: bitmap of queues configured for uapsd. same format
456 * as the AC bitmap in the QoS info field
457 * @max_sp: max Service Period. same format as the MAX_SP in the
458 * QoS info field (but already shifted down)
392 */ 459 */
393struct station_parameters { 460struct station_parameters {
394 u8 *supported_rates; 461 u8 *supported_rates;
395 struct net_device *vlan; 462 struct net_device *vlan;
396 u32 sta_flags_mask, sta_flags_set; 463 u32 sta_flags_mask, sta_flags_set;
464 u32 sta_modify_mask;
397 int listen_interval; 465 int listen_interval;
398 u16 aid; 466 u16 aid;
399 u8 supported_rates_len; 467 u8 supported_rates_len;
400 u8 plink_action; 468 u8 plink_action;
401 u8 plink_state; 469 u8 plink_state;
402 struct ieee80211_ht_cap *ht_capa; 470 struct ieee80211_ht_cap *ht_capa;
471 u8 uapsd_queues;
472 u8 max_sp;
403}; 473};
404 474
405/** 475/**
@@ -426,6 +496,8 @@ struct station_parameters {
426 * @STATION_INFO_RX_BITRATE: @rxrate fields are filled 496 * @STATION_INFO_RX_BITRATE: @rxrate fields are filled
427 * @STATION_INFO_BSS_PARAM: @bss_param filled 497 * @STATION_INFO_BSS_PARAM: @bss_param filled
428 * @STATION_INFO_CONNECTED_TIME: @connected_time filled 498 * @STATION_INFO_CONNECTED_TIME: @connected_time filled
499 * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled
500 * @STATION_INFO_STA_FLAGS: @sta_flags filled
429 */ 501 */
430enum station_info_flags { 502enum station_info_flags {
431 STATION_INFO_INACTIVE_TIME = 1<<0, 503 STATION_INFO_INACTIVE_TIME = 1<<0,
@@ -444,7 +516,9 @@ enum station_info_flags {
444 STATION_INFO_SIGNAL_AVG = 1<<13, 516 STATION_INFO_SIGNAL_AVG = 1<<13,
445 STATION_INFO_RX_BITRATE = 1<<14, 517 STATION_INFO_RX_BITRATE = 1<<14,
446 STATION_INFO_BSS_PARAM = 1<<15, 518 STATION_INFO_BSS_PARAM = 1<<15,
447 STATION_INFO_CONNECTED_TIME = 1<<16 519 STATION_INFO_CONNECTED_TIME = 1<<16,
520 STATION_INFO_ASSOC_REQ_IES = 1<<17,
521 STATION_INFO_STA_FLAGS = 1<<18
448}; 522};
449 523
450/** 524/**
@@ -536,6 +610,11 @@ struct sta_bss_parameters {
536 * This number should increase every time the list of stations 610 * This number should increase every time the list of stations
537 * changes, i.e. when a station is added or removed, so that 611 * changes, i.e. when a station is added or removed, so that
538 * userspace can tell whether it got a consistent snapshot. 612 * userspace can tell whether it got a consistent snapshot.
613 * @assoc_req_ies: IEs from (Re)Association Request.
614 * This is used only when in AP mode with drivers that do not use
615 * user space MLME/SME implementation. The information is provided for
616 * the cfg80211_new_sta() calls to notify user space of the IEs.
617 * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets.
539 */ 618 */
540struct station_info { 619struct station_info {
541 u32 filled; 620 u32 filled;
@@ -556,8 +635,17 @@ struct station_info {
556 u32 tx_failed; 635 u32 tx_failed;
557 u32 rx_dropped_misc; 636 u32 rx_dropped_misc;
558 struct sta_bss_parameters bss_param; 637 struct sta_bss_parameters bss_param;
638 struct nl80211_sta_flag_update sta_flags;
559 639
560 int generation; 640 int generation;
641
642 const u8 *assoc_req_ies;
643 size_t assoc_req_ies_len;
644
645 /*
646 * Note: Add a new enum station_info_flags value for each new field and
647 * use it to check which fields are initialized.
648 */
561}; 649};
562 650
563/** 651/**
@@ -688,6 +776,12 @@ struct mesh_config {
688 u16 dot11MeshHWMPpreqMinInterval; 776 u16 dot11MeshHWMPpreqMinInterval;
689 u16 dot11MeshHWMPnetDiameterTraversalTime; 777 u16 dot11MeshHWMPnetDiameterTraversalTime;
690 u8 dot11MeshHWMPRootMode; 778 u8 dot11MeshHWMPRootMode;
779 u16 dot11MeshHWMPRannInterval;
780 /* This is missnamed in draft 12.0: dot11MeshGateAnnouncementProtocol
781 * set to true only means that the station will announce others it's a
782 * mesh gate, but not necessarily using the gate announcement protocol.
783 * Still keeping the same nomenclature to be in sync with the spec. */
784 bool dot11MeshGateAnnouncementProtocol;
691}; 785};
692 786
693/** 787/**
@@ -781,6 +875,7 @@ struct cfg80211_ssid {
781 * @wiphy: the wiphy this was for 875 * @wiphy: the wiphy this was for
782 * @dev: the interface 876 * @dev: the interface
783 * @aborted: (internal) scan request was notified as aborted 877 * @aborted: (internal) scan request was notified as aborted
878 * @no_cck: used to send probe requests at non CCK rate in 2GHz band
784 */ 879 */
785struct cfg80211_scan_request { 880struct cfg80211_scan_request {
786 struct cfg80211_ssid *ssids; 881 struct cfg80211_ssid *ssids;
@@ -795,12 +890,22 @@ struct cfg80211_scan_request {
795 struct wiphy *wiphy; 890 struct wiphy *wiphy;
796 struct net_device *dev; 891 struct net_device *dev;
797 bool aborted; 892 bool aborted;
893 bool no_cck;
798 894
799 /* keep last */ 895 /* keep last */
800 struct ieee80211_channel *channels[0]; 896 struct ieee80211_channel *channels[0];
801}; 897};
802 898
803/** 899/**
900 * struct cfg80211_match_set - sets of attributes to match
901 *
902 * @ssid: SSID to be matched
903 */
904struct cfg80211_match_set {
905 struct cfg80211_ssid ssid;
906};
907
908/**
804 * struct cfg80211_sched_scan_request - scheduled scan request description 909 * struct cfg80211_sched_scan_request - scheduled scan request description
805 * 910 *
806 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans) 911 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
@@ -809,6 +914,11 @@ struct cfg80211_scan_request {
809 * @interval: interval between each scheduled scan cycle 914 * @interval: interval between each scheduled scan cycle
810 * @ie: optional information element(s) to add into Probe Request or %NULL 915 * @ie: optional information element(s) to add into Probe Request or %NULL
811 * @ie_len: length of ie in octets 916 * @ie_len: length of ie in octets
917 * @match_sets: sets of parameters to be matched for a scan result
918 * entry to be considered valid and to be passed to the host
919 * (others are filtered out).
920 * If ommited, all results are passed.
921 * @n_match_sets: number of match sets
812 * @wiphy: the wiphy this was for 922 * @wiphy: the wiphy this was for
813 * @dev: the interface 923 * @dev: the interface
814 * @channels: channels to scan 924 * @channels: channels to scan
@@ -820,6 +930,8 @@ struct cfg80211_sched_scan_request {
820 u32 interval; 930 u32 interval;
821 const u8 *ie; 931 const u8 *ie;
822 size_t ie_len; 932 size_t ie_len;
933 struct cfg80211_match_set *match_sets;
934 int n_match_sets;
823 935
824 /* internal */ 936 /* internal */
825 struct wiphy *wiphy; 937 struct wiphy *wiphy;
@@ -896,36 +1008,6 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
896 1008
897 1009
898/** 1010/**
899 * struct cfg80211_crypto_settings - Crypto settings
900 * @wpa_versions: indicates which, if any, WPA versions are enabled
901 * (from enum nl80211_wpa_versions)
902 * @cipher_group: group key cipher suite (or 0 if unset)
903 * @n_ciphers_pairwise: number of AP supported unicast ciphers
904 * @ciphers_pairwise: unicast key cipher suites
905 * @n_akm_suites: number of AKM suites
906 * @akm_suites: AKM suites
907 * @control_port: Whether user space controls IEEE 802.1X port, i.e.,
908 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
909 * required to assume that the port is unauthorized until authorized by
910 * user space. Otherwise, port is marked authorized by default.
911 * @control_port_ethertype: the control port protocol that should be
912 * allowed through even on unauthorized ports
913 * @control_port_no_encrypt: TRUE to prevent encryption of control port
914 * protocol frames.
915 */
916struct cfg80211_crypto_settings {
917 u32 wpa_versions;
918 u32 cipher_group;
919 int n_ciphers_pairwise;
920 u32 ciphers_pairwise[NL80211_MAX_NR_CIPHER_SUITES];
921 int n_akm_suites;
922 u32 akm_suites[NL80211_MAX_NR_AKM_SUITES];
923 bool control_port;
924 __be16 control_port_ethertype;
925 bool control_port_no_encrypt;
926};
927
928/**
929 * struct cfg80211_auth_request - Authentication request data 1011 * struct cfg80211_auth_request - Authentication request data
930 * 1012 *
931 * This structure provides information needed to complete IEEE 802.11 1013 * This structure provides information needed to complete IEEE 802.11
@@ -1343,6 +1425,9 @@ struct cfg80211_gtk_rekey_data {
1343 * @set_ringparam: Set tx and rx ring sizes. 1425 * @set_ringparam: Set tx and rx ring sizes.
1344 * 1426 *
1345 * @get_ringparam: Get tx and rx ring current and maximum sizes. 1427 * @get_ringparam: Get tx and rx ring current and maximum sizes.
1428 *
1429 * @tdls_mgmt: Transmit a TDLS management frame.
1430 * @tdls_oper: Perform a high-level TDLS operation (e.g. TDLS link setup).
1346 */ 1431 */
1347struct cfg80211_ops { 1432struct cfg80211_ops {
1348 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 1433 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -1419,7 +1504,7 @@ struct cfg80211_ops {
1419 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, 1504 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
1420 struct bss_parameters *params); 1505 struct bss_parameters *params);
1421 1506
1422 int (*set_txq_params)(struct wiphy *wiphy, 1507 int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev,
1423 struct ieee80211_txq_params *params); 1508 struct ieee80211_txq_params *params);
1424 1509
1425 int (*set_channel)(struct wiphy *wiphy, struct net_device *dev, 1510 int (*set_channel)(struct wiphy *wiphy, struct net_device *dev,
@@ -1495,7 +1580,8 @@ struct cfg80211_ops {
1495 struct ieee80211_channel *chan, bool offchan, 1580 struct ieee80211_channel *chan, bool offchan,
1496 enum nl80211_channel_type channel_type, 1581 enum nl80211_channel_type channel_type,
1497 bool channel_type_valid, unsigned int wait, 1582 bool channel_type_valid, unsigned int wait,
1498 const u8 *buf, size_t len, u64 *cookie); 1583 const u8 *buf, size_t len, bool no_cck,
1584 u64 *cookie);
1499 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 1585 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
1500 struct net_device *dev, 1586 struct net_device *dev,
1501 u64 cookie); 1587 u64 cookie);
@@ -1525,6 +1611,12 @@ struct cfg80211_ops {
1525 1611
1526 int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev, 1612 int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
1527 struct cfg80211_gtk_rekey_data *data); 1613 struct cfg80211_gtk_rekey_data *data);
1614
1615 int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1616 u8 *peer, u8 action_code, u8 dialog_token,
1617 u16 status_code, const u8 *buf, size_t len);
1618 int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev,
1619 u8 *peer, enum nl80211_tdls_operation oper);
1528}; 1620};
1529 1621
1530/* 1622/*
@@ -1574,6 +1666,15 @@ struct cfg80211_ops {
1574 * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing 1666 * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing
1575 * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH. 1667 * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH.
1576 * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans. 1668 * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans.
1669 * @WIPHY_FLAG_SUPPORTS_FW_ROAM: The device supports roaming feature in the
1670 * firmware.
1671 * @WIPHY_FLAG_AP_UAPSD: The device supports uapsd on AP.
1672 * @WIPHY_FLAG_SUPPORTS_TDLS: The device supports TDLS (802.11z) operation.
1673 * @WIPHY_FLAG_TDLS_EXTERNAL_SETUP: The device does not handle TDLS (802.11z)
1674 * link setup/discovery operations internally. Setup, discovery and
1675 * teardown packets should be sent through the @NL80211_CMD_TDLS_MGMT
1676 * command. When this flag is not set, @NL80211_CMD_TDLS_OPER should be
1677 * used for asking the driver/firmware to perform a TDLS operation.
1577 */ 1678 */
1578enum wiphy_flags { 1679enum wiphy_flags {
1579 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 1680 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -1588,6 +1689,10 @@ enum wiphy_flags {
1588 WIPHY_FLAG_MESH_AUTH = BIT(10), 1689 WIPHY_FLAG_MESH_AUTH = BIT(10),
1589 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11), 1690 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11),
1590 WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12), 1691 WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12),
1692 WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13),
1693 WIPHY_FLAG_AP_UAPSD = BIT(14),
1694 WIPHY_FLAG_SUPPORTS_TDLS = BIT(15),
1695 WIPHY_FLAG_TDLS_EXTERNAL_SETUP = BIT(16),
1591}; 1696};
1592 1697
1593/** 1698/**
@@ -1744,9 +1849,12 @@ struct wiphy_wowlan_support {
1744 * by default for perm_addr. In this case, the mask should be set to 1849 * by default for perm_addr. In this case, the mask should be set to
1745 * all-zeroes. In this case it is assumed that the device can handle 1850 * all-zeroes. In this case it is assumed that the device can handle
1746 * the same number of arbitrary MAC addresses. 1851 * the same number of arbitrary MAC addresses.
1852 * @registered: protects ->resume and ->suspend sysfs callbacks against
1853 * unregister hardware
1747 * @debugfsdir: debugfs directory used for this wiphy, will be renamed 1854 * @debugfsdir: debugfs directory used for this wiphy, will be renamed
1748 * automatically on wiphy renames 1855 * automatically on wiphy renames
1749 * @dev: (virtual) struct device for this wiphy 1856 * @dev: (virtual) struct device for this wiphy
1857 * @registered: helps synchronize suspend/resume with wiphy unregister
1750 * @wext: wireless extension handlers 1858 * @wext: wireless extension handlers
1751 * @priv: driver private data (sized according to wiphy_new() parameter) 1859 * @priv: driver private data (sized according to wiphy_new() parameter)
1752 * @interface_modes: bitmask of interfaces types valid for this wiphy, 1860 * @interface_modes: bitmask of interfaces types valid for this wiphy,
@@ -1763,6 +1871,9 @@ struct wiphy_wowlan_support {
1763 * any given scan 1871 * any given scan
1764 * @max_sched_scan_ssids: maximum number of SSIDs the device can scan 1872 * @max_sched_scan_ssids: maximum number of SSIDs the device can scan
1765 * for in any given scheduled scan 1873 * for in any given scheduled scan
1874 * @max_match_sets: maximum number of match sets the device can handle
1875 * when performing a scheduled scan, 0 if filtering is not
1876 * supported.
1766 * @max_scan_ie_len: maximum length of user-controlled IEs device can 1877 * @max_scan_ie_len: maximum length of user-controlled IEs device can
1767 * add to probe request frames transmitted during a scan, must not 1878 * add to probe request frames transmitted during a scan, must not
1768 * include fixed IEs like supported rates 1879 * include fixed IEs like supported rates
@@ -1820,6 +1931,7 @@ struct wiphy {
1820 int bss_priv_size; 1931 int bss_priv_size;
1821 u8 max_scan_ssids; 1932 u8 max_scan_ssids;
1822 u8 max_sched_scan_ssids; 1933 u8 max_sched_scan_ssids;
1934 u8 max_match_sets;
1823 u16 max_scan_ie_len; 1935 u16 max_scan_ie_len;
1824 u16 max_sched_scan_ie_len; 1936 u16 max_sched_scan_ie_len;
1825 1937
@@ -1865,6 +1977,9 @@ struct wiphy {
1865 * you need use set_wiphy_dev() (see below) */ 1977 * you need use set_wiphy_dev() (see below) */
1866 struct device dev; 1978 struct device dev;
1867 1979
1980 /* protects ->resume, ->suspend sysfs callbacks against unregister hw */
1981 bool registered;
1982
1868 /* dir in debugfs: ieee80211/<wiphyname> */ 1983 /* dir in debugfs: ieee80211/<wiphyname> */
1869 struct dentry *debugfsdir; 1984 struct dentry *debugfsdir;
1870 1985
@@ -2230,6 +2345,69 @@ extern int ieee80211_radiotap_iterator_next(
2230extern const unsigned char rfc1042_header[6]; 2345extern const unsigned char rfc1042_header[6];
2231extern const unsigned char bridge_tunnel_header[6]; 2346extern const unsigned char bridge_tunnel_header[6];
2232 2347
2348/* Parsed Information Elements */
2349struct ieee802_11_elems {
2350 u8 *ie_start;
2351 size_t total_len;
2352
2353 /* pointers to IEs */
2354 u8 *ssid;
2355 u8 *supp_rates;
2356 u8 *fh_params;
2357 u8 *ds_params;
2358 u8 *cf_params;
2359 struct ieee80211_tim_ie *tim;
2360 u8 *ibss_params;
2361 u8 *challenge;
2362 u8 *wpa;
2363 u8 *rsn;
2364 u8 *erp_info;
2365 u8 *ext_supp_rates;
2366 u8 *wmm_info;
2367 u8 *wmm_param;
2368 struct ieee80211_ht_cap *ht_cap_elem;
2369 struct ieee80211_ht_info *ht_info_elem;
2370 struct ieee80211_meshconf_ie *mesh_config;
2371 u8 *mesh_id;
2372 u8 *peering;
2373 u8 *preq;
2374 u8 *prep;
2375 u8 *perr;
2376 struct ieee80211_rann_ie *rann;
2377 u8 *ch_switch_elem;
2378 u8 *country_elem;
2379 u8 *pwr_constr_elem;
2380 u8 *quiet_elem; /* first quite element */
2381 u8 *timeout_int;
2382
2383 /* length of them, respectively */
2384 u8 ssid_len;
2385 u8 supp_rates_len;
2386 u8 fh_params_len;
2387 u8 ds_params_len;
2388 u8 cf_params_len;
2389 u8 tim_len;
2390 u8 ibss_params_len;
2391 u8 challenge_len;
2392 u8 wpa_len;
2393 u8 rsn_len;
2394 u8 erp_info_len;
2395 u8 ext_supp_rates_len;
2396 u8 wmm_info_len;
2397 u8 wmm_param_len;
2398 u8 mesh_id_len;
2399 u8 peering_len;
2400 u8 preq_len;
2401 u8 prep_len;
2402 u8 perr_len;
2403 u8 ch_switch_elem_len;
2404 u8 country_elem_len;
2405 u8 pwr_constr_elem_len;
2406 u8 quiet_elem_len;
2407 u8 num_of_quiet_elem; /* can be more the one */
2408 u8 timeout_int_len;
2409};
2410
2233/** 2411/**
2234 * ieee80211_get_hdrlen_from_skb - get header length from data 2412 * ieee80211_get_hdrlen_from_skb - get header length from data
2235 * 2413 *
@@ -2319,6 +2497,24 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb);
2319const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); 2497const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len);
2320 2498
2321/** 2499/**
2500 * cfg80211_find_vendor_ie - find vendor specific information element in data
2501 *
2502 * @oui: vendor OUI
2503 * @oui_type: vendor-specific OUI type
2504 * @ies: data consisting of IEs
2505 * @len: length of data
2506 *
2507 * This function will return %NULL if the vendor specific element ID
2508 * could not be found or if the element is invalid (claims to be
2509 * longer than the given data), or a pointer to the first byte
2510 * of the requested element, that is the byte containing the
2511 * element ID. There are no checks on the element length
2512 * other than having to fit into the given data.
2513 */
2514const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
2515 const u8 *ies, int len);
2516
2517/**
2322 * DOC: Regulatory enforcement infrastructure 2518 * DOC: Regulatory enforcement infrastructure
2323 * 2519 *
2324 * TODO 2520 * TODO
@@ -2393,113 +2589,6 @@ extern int freq_reg_info(struct wiphy *wiphy,
2393 const struct ieee80211_reg_rule **reg_rule); 2589 const struct ieee80211_reg_rule **reg_rule);
2394 2590
2395/* 2591/*
2396 * Temporary wext handlers & helper functions
2397 *
2398 * In the future cfg80211 will simply assign the entire wext handler
2399 * structure to netdevs it manages, but we're not there yet.
2400 */
2401int cfg80211_wext_giwname(struct net_device *dev,
2402 struct iw_request_info *info,
2403 char *name, char *extra);
2404int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
2405 u32 *mode, char *extra);
2406int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
2407 u32 *mode, char *extra);
2408int cfg80211_wext_siwscan(struct net_device *dev,
2409 struct iw_request_info *info,
2410 union iwreq_data *wrqu, char *extra);
2411int cfg80211_wext_giwscan(struct net_device *dev,
2412 struct iw_request_info *info,
2413 struct iw_point *data, char *extra);
2414int cfg80211_wext_siwmlme(struct net_device *dev,
2415 struct iw_request_info *info,
2416 struct iw_point *data, char *extra);
2417int cfg80211_wext_giwrange(struct net_device *dev,
2418 struct iw_request_info *info,
2419 struct iw_point *data, char *extra);
2420int cfg80211_wext_siwgenie(struct net_device *dev,
2421 struct iw_request_info *info,
2422 struct iw_point *data, char *extra);
2423int cfg80211_wext_siwauth(struct net_device *dev,
2424 struct iw_request_info *info,
2425 struct iw_param *data, char *extra);
2426int cfg80211_wext_giwauth(struct net_device *dev,
2427 struct iw_request_info *info,
2428 struct iw_param *data, char *extra);
2429
2430int cfg80211_wext_siwfreq(struct net_device *dev,
2431 struct iw_request_info *info,
2432 struct iw_freq *freq, char *extra);
2433int cfg80211_wext_giwfreq(struct net_device *dev,
2434 struct iw_request_info *info,
2435 struct iw_freq *freq, char *extra);
2436int cfg80211_wext_siwessid(struct net_device *dev,
2437 struct iw_request_info *info,
2438 struct iw_point *data, char *ssid);
2439int cfg80211_wext_giwessid(struct net_device *dev,
2440 struct iw_request_info *info,
2441 struct iw_point *data, char *ssid);
2442int cfg80211_wext_siwrate(struct net_device *dev,
2443 struct iw_request_info *info,
2444 struct iw_param *rate, char *extra);
2445int cfg80211_wext_giwrate(struct net_device *dev,
2446 struct iw_request_info *info,
2447 struct iw_param *rate, char *extra);
2448
2449int cfg80211_wext_siwrts(struct net_device *dev,
2450 struct iw_request_info *info,
2451 struct iw_param *rts, char *extra);
2452int cfg80211_wext_giwrts(struct net_device *dev,
2453 struct iw_request_info *info,
2454 struct iw_param *rts, char *extra);
2455int cfg80211_wext_siwfrag(struct net_device *dev,
2456 struct iw_request_info *info,
2457 struct iw_param *frag, char *extra);
2458int cfg80211_wext_giwfrag(struct net_device *dev,
2459 struct iw_request_info *info,
2460 struct iw_param *frag, char *extra);
2461int cfg80211_wext_siwretry(struct net_device *dev,
2462 struct iw_request_info *info,
2463 struct iw_param *retry, char *extra);
2464int cfg80211_wext_giwretry(struct net_device *dev,
2465 struct iw_request_info *info,
2466 struct iw_param *retry, char *extra);
2467int cfg80211_wext_siwencodeext(struct net_device *dev,
2468 struct iw_request_info *info,
2469 struct iw_point *erq, char *extra);
2470int cfg80211_wext_siwencode(struct net_device *dev,
2471 struct iw_request_info *info,
2472 struct iw_point *erq, char *keybuf);
2473int cfg80211_wext_giwencode(struct net_device *dev,
2474 struct iw_request_info *info,
2475 struct iw_point *erq, char *keybuf);
2476int cfg80211_wext_siwtxpower(struct net_device *dev,
2477 struct iw_request_info *info,
2478 union iwreq_data *data, char *keybuf);
2479int cfg80211_wext_giwtxpower(struct net_device *dev,
2480 struct iw_request_info *info,
2481 union iwreq_data *data, char *keybuf);
2482struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev);
2483
2484int cfg80211_wext_siwpower(struct net_device *dev,
2485 struct iw_request_info *info,
2486 struct iw_param *wrq, char *extra);
2487int cfg80211_wext_giwpower(struct net_device *dev,
2488 struct iw_request_info *info,
2489 struct iw_param *wrq, char *extra);
2490
2491int cfg80211_wext_siwap(struct net_device *dev,
2492 struct iw_request_info *info,
2493 struct sockaddr *ap_addr, char *extra);
2494int cfg80211_wext_giwap(struct net_device *dev,
2495 struct iw_request_info *info,
2496 struct sockaddr *ap_addr, char *extra);
2497
2498int cfg80211_wext_siwpmksa(struct net_device *dev,
2499 struct iw_request_info *info,
2500 struct iw_point *data, char *extra);
2501
2502/*
2503 * callbacks for asynchronous cfg80211 methods, notification 2592 * callbacks for asynchronous cfg80211 methods, notification
2504 * functions and BSS handling helpers 2593 * functions and BSS handling helpers
2505 */ 2594 */
@@ -3085,6 +3174,17 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev,
3085void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid, 3174void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid,
3086 const u8 *replay_ctr, gfp_t gfp); 3175 const u8 *replay_ctr, gfp_t gfp);
3087 3176
3177/**
3178 * cfg80211_pmksa_candidate_notify - notify about PMKSA caching candidate
3179 * @dev: network device
3180 * @index: candidate index (the smaller the index, the higher the priority)
3181 * @bssid: BSSID of AP
3182 * @preauth: Whether AP advertises support for RSN pre-authentication
3183 * @gfp: allocation flags
3184 */
3185void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index,
3186 const u8 *bssid, bool preauth, gfp_t gfp);
3187
3088/* Logging, debugging and troubleshooting/diagnostic helpers. */ 3188/* Logging, debugging and troubleshooting/diagnostic helpers. */
3089 3189
3090/* wiphy_printk helpers, similar to dev_printk */ 3190/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h
index bc1e7ef40171..443626ed4cbc 100644
--- a/include/net/dcbevent.h
+++ b/include/net/dcbevent.h
@@ -24,8 +24,26 @@ enum dcbevent_notif_type {
24 DCB_APP_EVENT = 1, 24 DCB_APP_EVENT = 1,
25}; 25};
26 26
27#ifdef CONFIG_DCB
27extern int register_dcbevent_notifier(struct notifier_block *nb); 28extern int register_dcbevent_notifier(struct notifier_block *nb);
28extern int unregister_dcbevent_notifier(struct notifier_block *nb); 29extern int unregister_dcbevent_notifier(struct notifier_block *nb);
29extern int call_dcbevent_notifiers(unsigned long val, void *v); 30extern int call_dcbevent_notifiers(unsigned long val, void *v);
31#else
32static inline int
33register_dcbevent_notifier(struct notifier_block *nb)
34{
35 return 0;
36}
37
38static inline int unregister_dcbevent_notifier(struct notifier_block *nb)
39{
40 return 0;
41}
42
43static inline int call_dcbevent_notifiers(unsigned long val, void *v)
44{
45 return 0;
46}
47#endif /* CONFIG_DCB */
30 48
31#endif 49#endif
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index f5aa39997f0b..2cd66d0be348 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -23,9 +23,10 @@
23#include <linux/dcbnl.h> 23#include <linux/dcbnl.h>
24 24
25struct dcb_app_type { 25struct dcb_app_type {
26 char name[IFNAMSIZ]; 26 int ifindex;
27 struct dcb_app app; 27 struct dcb_app app;
28 struct list_head list; 28 struct list_head list;
29 u8 dcbx;
29}; 30};
30 31
31int dcb_setapp(struct net_device *, struct dcb_app *); 32int dcb_setapp(struct net_device *, struct dcb_app *);
diff --git a/include/net/dst.h b/include/net/dst.h
index 13d507d69ddb..4fb6c4381791 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -325,7 +325,14 @@ static inline void skb_dst_force(struct sk_buff *skb)
325static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 325static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
326{ 326{
327 skb->dev = dev; 327 skb->dev = dev;
328 skb->rxhash = 0; 328
329 /*
330 * Clear rxhash so that we can recalulate the hash for the
331 * encapsulated packet, unless we have already determine the hash
332 * over the L4 4-tuple.
333 */
334 if (!skb->l4_rxhash)
335 skb->rxhash = 0;
329 skb_set_queue_mapping(skb, 0); 336 skb_set_queue_mapping(skb, 0);
330 skb_dst_drop(skb); 337 skb_dst_drop(skb);
331 nf_reset(skb); 338 nf_reset(skb);
diff --git a/include/net/flow.h b/include/net/flow.h
index 78113daadd63..a09447749e2d 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -7,6 +7,7 @@
7#ifndef _NET_FLOW_H 7#ifndef _NET_FLOW_H
8#define _NET_FLOW_H 8#define _NET_FLOW_H
9 9
10#include <linux/socket.h>
10#include <linux/in6.h> 11#include <linux/in6.h>
11#include <linux/atomic.h> 12#include <linux/atomic.h>
12 13
@@ -68,7 +69,7 @@ struct flowi4 {
68#define fl4_ipsec_spi uli.spi 69#define fl4_ipsec_spi uli.spi
69#define fl4_mh_type uli.mht.type 70#define fl4_mh_type uli.mht.type
70#define fl4_gre_key uli.gre_key 71#define fl4_gre_key uli.gre_key
71}; 72} __attribute__((__aligned__(BITS_PER_LONG/8)));
72 73
73static inline void flowi4_init_output(struct flowi4 *fl4, int oif, 74static inline void flowi4_init_output(struct flowi4 *fl4, int oif,
74 __u32 mark, __u8 tos, __u8 scope, 75 __u32 mark, __u8 tos, __u8 scope,
@@ -112,7 +113,7 @@ struct flowi6 {
112#define fl6_ipsec_spi uli.spi 113#define fl6_ipsec_spi uli.spi
113#define fl6_mh_type uli.mht.type 114#define fl6_mh_type uli.mht.type
114#define fl6_gre_key uli.gre_key 115#define fl6_gre_key uli.gre_key
115}; 116} __attribute__((__aligned__(BITS_PER_LONG/8)));
116 117
117struct flowidn { 118struct flowidn {
118 struct flowi_common __fl_common; 119 struct flowi_common __fl_common;
@@ -127,7 +128,7 @@ struct flowidn {
127 union flowi_uli uli; 128 union flowi_uli uli;
128#define fld_sport uli.ports.sport 129#define fld_sport uli.ports.sport
129#define fld_dport uli.ports.dport 130#define fld_dport uli.ports.dport
130}; 131} __attribute__((__aligned__(BITS_PER_LONG/8)));
131 132
132struct flowi { 133struct flowi {
133 union { 134 union {
@@ -161,6 +162,24 @@ static inline struct flowi *flowidn_to_flowi(struct flowidn *fldn)
161 return container_of(fldn, struct flowi, u.dn); 162 return container_of(fldn, struct flowi, u.dn);
162} 163}
163 164
165typedef unsigned long flow_compare_t;
166
167static inline size_t flow_key_size(u16 family)
168{
169 switch (family) {
170 case AF_INET:
171 BUILD_BUG_ON(sizeof(struct flowi4) % sizeof(flow_compare_t));
172 return sizeof(struct flowi4) / sizeof(flow_compare_t);
173 case AF_INET6:
174 BUILD_BUG_ON(sizeof(struct flowi6) % sizeof(flow_compare_t));
175 return sizeof(struct flowi6) / sizeof(flow_compare_t);
176 case AF_DECnet:
177 BUILD_BUG_ON(sizeof(struct flowidn) % sizeof(flow_compare_t));
178 return sizeof(struct flowidn) / sizeof(flow_compare_t);
179 }
180 return 0;
181}
182
164#define FLOW_DIR_IN 0 183#define FLOW_DIR_IN 0
165#define FLOW_DIR_OUT 1 184#define FLOW_DIR_OUT 1
166#define FLOW_DIR_FWD 2 185#define FLOW_DIR_FWD 2
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index b0be5fb9de19..7e2c4d483ad0 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -251,6 +251,7 @@ enum ieee80211_radiotap_type {
251 * retries */ 251 * retries */
252#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */ 252#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */
253#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */ 253#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */
254#define IEEE80211_RADIOTAP_F_TX_NOACK 0x0008 /* don't expect an ack */
254 255
255 256
256/* For IEEE80211_RADIOTAP_MCS */ 257/* For IEEE80211_RADIOTAP_MCS */
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 11cf373970a9..51a7031b4aa3 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -41,6 +41,7 @@ struct inet6_ifaddr {
41 struct in6_addr addr; 41 struct in6_addr addr;
42 __u32 prefix_len; 42 __u32 prefix_len;
43 43
44 /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */
44 __u32 valid_lft; 45 __u32 valid_lft;
45 __u32 prefered_lft; 46 __u32 prefered_lft;
46 atomic_t refcnt; 47 atomic_t refcnt;
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 2fa8d1341a0a..2fa14691869c 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -30,6 +30,14 @@ static inline int INET_ECN_is_capable(__u8 dsfield)
30 return dsfield & INET_ECN_ECT_0; 30 return dsfield & INET_ECN_ECT_0;
31} 31}
32 32
33/*
34 * RFC 3168 9.1.1
35 * The full-functionality option for ECN encapsulation is to copy the
36 * ECN codepoint of the inside header to the outside header on
37 * encapsulation if the inside header is not-ECT or ECT, and to set the
38 * ECN codepoint of the outside header to ECT(0) if the ECN codepoint of
39 * the inside header is CE.
40 */
33static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) 41static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
34{ 42{
35 outer &= ~INET_ECN_MASK; 43 outer &= ~INET_ECN_MASK;
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index caaff5f5f39f..b897d6e6d0a5 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -238,7 +238,7 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk)
238{ 238{
239 __u8 flags = 0; 239 __u8 flags = 0;
240 240
241 if (inet_sk(sk)->transparent) 241 if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl)
242 flags |= FLOWI_FLAG_ANYSRC; 242 flags |= FLOWI_FLAG_ANYSRC;
243 if (sk->sk_protocol == IPPROTO_TCP) 243 if (sk->sk_protocol == IPPROTO_TCP)
244 flags |= FLOWI_FLAG_PRECOW_METRICS; 244 flags |= FLOWI_FLAG_PRECOW_METRICS;
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index f1a770977c4f..e8c25b981205 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -18,7 +18,6 @@
18 18
19#include <linux/kmemcheck.h> 19#include <linux/kmemcheck.h>
20#include <linux/list.h> 20#include <linux/list.h>
21#include <linux/module.h>
22#include <linux/timer.h> 21#include <linux/timer.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/workqueue.h> 23#include <linux/workqueue.h>
@@ -126,13 +125,15 @@ struct inet_timewait_sock {
126 /* And these are ours. */ 125 /* And these are ours. */
127 unsigned int tw_ipv6only : 1, 126 unsigned int tw_ipv6only : 1,
128 tw_transparent : 1, 127 tw_transparent : 1,
129 tw_pad : 14, /* 14 bits hole */ 128 tw_pad : 6, /* 6 bits hole */
129 tw_tos : 8,
130 tw_ipv6_offset : 16; 130 tw_ipv6_offset : 16;
131 kmemcheck_bitfield_end(flags); 131 kmemcheck_bitfield_end(flags);
132 unsigned long tw_ttd; 132 unsigned long tw_ttd;
133 struct inet_bind_bucket *tw_tb; 133 struct inet_bind_bucket *tw_tb;
134 struct hlist_node tw_death_node; 134 struct hlist_node tw_death_node;
135}; 135};
136#define tw_tclass tw_tos
136 137
137static inline void inet_twsk_add_node_rcu(struct inet_timewait_sock *tw, 138static inline void inet_twsk_add_node_rcu(struct inet_timewait_sock *tw,
138 struct hlist_nulls_head *list) 139 struct hlist_nulls_head *list)
diff --git a/include/net/ip.h b/include/net/ip.h
index aa76c7a4d9c3..eca0ef7a495e 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -165,6 +165,7 @@ struct ip_reply_arg {
165 int csumoffset; /* u16 offset of csum in iov[0].iov_base */ 165 int csumoffset; /* u16 offset of csum in iov[0].iov_base */
166 /* -1 if not needed */ 166 /* -1 if not needed */
167 int bound_dev_if; 167 int bound_dev_if;
168 u8 tos;
168}; 169};
169 170
170#define IP_REPLY_ARG_NOSRCCHECK 1 171#define IP_REPLY_ARG_NOSRCCHECK 1
@@ -175,7 +176,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg)
175} 176}
176 177
177void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, 178void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr,
178 struct ip_reply_arg *arg, unsigned int len); 179 const struct ip_reply_arg *arg, unsigned int len);
179 180
180struct ipv4_config { 181struct ipv4_config {
181 int log_martians; 182 int log_martians;
@@ -406,9 +407,18 @@ enum ip_defrag_users {
406 IP_DEFRAG_VS_OUT, 407 IP_DEFRAG_VS_OUT,
407 IP_DEFRAG_VS_FWD, 408 IP_DEFRAG_VS_FWD,
408 IP_DEFRAG_AF_PACKET, 409 IP_DEFRAG_AF_PACKET,
410 IP_DEFRAG_MACVLAN,
409}; 411};
410 412
411int ip_defrag(struct sk_buff *skb, u32 user); 413int ip_defrag(struct sk_buff *skb, u32 user);
414#ifdef CONFIG_INET
415struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user);
416#else
417static inline struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user)
418{
419 return skb;
420}
421#endif
412int ip_frag_mem(struct net *net); 422int ip_frag_mem(struct net *net);
413int ip_frag_nqueues(struct net *net); 423int ip_frag_nqueues(struct net *net);
414 424
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 1aaf915656f3..873d5be7926c 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -425,9 +425,9 @@ struct ip_vs_protocol {
425 425
426 const char *(*state_name)(int state); 426 const char *(*state_name)(int state);
427 427
428 int (*state_transition)(struct ip_vs_conn *cp, int direction, 428 void (*state_transition)(struct ip_vs_conn *cp, int direction,
429 const struct sk_buff *skb, 429 const struct sk_buff *skb,
430 struct ip_vs_proto_data *pd); 430 struct ip_vs_proto_data *pd);
431 431
432 int (*register_app)(struct net *net, struct ip_vs_app *inc); 432 int (*register_app)(struct net *net, struct ip_vs_app *inc);
433 433
@@ -900,6 +900,7 @@ struct netns_ipvs {
900 volatile int sync_state; 900 volatile int sync_state;
901 volatile int master_syncid; 901 volatile int master_syncid;
902 volatile int backup_syncid; 902 volatile int backup_syncid;
903 struct mutex sync_mutex;
903 /* multicast interface name */ 904 /* multicast interface name */
904 char master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; 905 char master_mcast_ifn[IP_VS_IFNAME_MAXLEN];
905 char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; 906 char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN];
@@ -1125,17 +1126,16 @@ int unregister_ip_vs_pe(struct ip_vs_pe *pe);
1125struct ip_vs_pe *ip_vs_pe_getbyname(const char *name); 1126struct ip_vs_pe *ip_vs_pe_getbyname(const char *name);
1126struct ip_vs_pe *__ip_vs_pe_getbyname(const char *pe_name); 1127struct ip_vs_pe *__ip_vs_pe_getbyname(const char *pe_name);
1127 1128
1128static inline void ip_vs_pe_get(const struct ip_vs_pe *pe) 1129/*
1129{ 1130 * Use a #define to avoid all of module.h just for these trivial ops
1130 if (pe && pe->module) 1131 */
1132#define ip_vs_pe_get(pe) \
1133 if (pe && pe->module) \
1131 __module_get(pe->module); 1134 __module_get(pe->module);
1132}
1133 1135
1134static inline void ip_vs_pe_put(const struct ip_vs_pe *pe) 1136#define ip_vs_pe_put(pe) \
1135{ 1137 if (pe && pe->module) \
1136 if (pe && pe->module)
1137 module_put(pe->module); 1138 module_put(pe->module);
1138}
1139 1139
1140/* 1140/*
1141 * IPVS protocol functions (from ip_vs_proto.c) 1141 * IPVS protocol functions (from ip_vs_proto.c)
@@ -1377,7 +1377,7 @@ static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs)
1377 1377
1378extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, 1378extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp,
1379 int outin); 1379 int outin);
1380extern int ip_vs_confirm_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp); 1380extern int ip_vs_confirm_conntrack(struct sk_buff *skb);
1381extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, 1381extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct,
1382 struct ip_vs_conn *cp, u_int8_t proto, 1382 struct ip_vs_conn *cp, u_int8_t proto,
1383 const __be16 port, int from_rs); 1383 const __be16 port, int from_rs);
@@ -1395,8 +1395,7 @@ static inline void ip_vs_update_conntrack(struct sk_buff *skb,
1395{ 1395{
1396} 1396}
1397 1397
1398static inline int ip_vs_confirm_conntrack(struct sk_buff *skb, 1398static inline int ip_vs_confirm_conntrack(struct sk_buff *skb)
1399 struct ip_vs_conn *cp)
1400{ 1399{
1401 return NF_ACCEPT; 1400 return NF_ACCEPT;
1402} 1401}
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 3b5ac1fbff39..a366a8a1fe23 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -486,7 +486,8 @@ extern int ip6_rcv_finish(struct sk_buff *skb);
486extern int ip6_xmit(struct sock *sk, 486extern int ip6_xmit(struct sock *sk,
487 struct sk_buff *skb, 487 struct sk_buff *skb,
488 struct flowi6 *fl6, 488 struct flowi6 *fl6,
489 struct ipv6_txoptions *opt); 489 struct ipv6_txoptions *opt,
490 int tclass);
490 491
491extern int ip6_nd_hdr(struct sock *sk, 492extern int ip6_nd_hdr(struct sock *sk,
492 struct sk_buff *skb, 493 struct sk_buff *skb,
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
index f82a1e877372..f2419cf44cef 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
@@ -14,6 +14,7 @@
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/poll.h> 15#include <linux/poll.h>
16#include <linux/socket.h> 16#include <linux/socket.h>
17#include <net/iucv/iucv.h>
17 18
18#ifndef AF_IUCV 19#ifndef AF_IUCV
19#define AF_IUCV 32 20#define AF_IUCV 32
@@ -33,6 +34,7 @@ enum {
33}; 34};
34 35
35#define IUCV_QUEUELEN_DEFAULT 65535 36#define IUCV_QUEUELEN_DEFAULT 65535
37#define IUCV_HIPER_MSGLIM_DEFAULT 128
36#define IUCV_CONN_TIMEOUT (HZ * 40) 38#define IUCV_CONN_TIMEOUT (HZ * 40)
37#define IUCV_DISCONN_TIMEOUT (HZ * 2) 39#define IUCV_DISCONN_TIMEOUT (HZ * 2)
38#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) 40#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60)
@@ -57,8 +59,51 @@ struct sock_msg_q {
57 spinlock_t lock; 59 spinlock_t lock;
58}; 60};
59 61
62#define AF_IUCV_FLAG_ACK 0x1
63#define AF_IUCV_FLAG_SYN 0x2
64#define AF_IUCV_FLAG_FIN 0x4
65#define AF_IUCV_FLAG_WIN 0x8
66
67struct af_iucv_trans_hdr {
68 u16 magic;
69 u8 version;
70 u8 flags;
71 u16 window;
72 char destNodeID[8];
73 char destUserID[8];
74 char destAppName[16];
75 char srcNodeID[8];
76 char srcUserID[8];
77 char srcAppName[16]; /* => 70 bytes */
78 struct iucv_message iucv_hdr; /* => 33 bytes */
79 u8 pad; /* total 104 bytes */
80} __packed;
81
82enum iucv_tx_notify {
83 /* transmission of skb is completed and was successful */
84 TX_NOTIFY_OK = 0,
85 /* target is unreachable */
86 TX_NOTIFY_UNREACHABLE = 1,
87 /* transfer pending queue full */
88 TX_NOTIFY_TPQFULL = 2,
89 /* general error */
90 TX_NOTIFY_GENERALERROR = 3,
91 /* transmission of skb is pending - may interleave
92 * with TX_NOTIFY_DELAYED_* */
93 TX_NOTIFY_PENDING = 4,
94 /* transmission of skb was done successfully (delayed) */
95 TX_NOTIFY_DELAYED_OK = 5,
96 /* target unreachable (detected delayed) */
97 TX_NOTIFY_DELAYED_UNREACHABLE = 6,
98 /* general error (detected delayed) */
99 TX_NOTIFY_DELAYED_GENERALERROR = 7,
100};
101
60#define iucv_sk(__sk) ((struct iucv_sock *) __sk) 102#define iucv_sk(__sk) ((struct iucv_sock *) __sk)
61 103
104#define AF_IUCV_TRANS_IUCV 0
105#define AF_IUCV_TRANS_HIPER 1
106
62struct iucv_sock { 107struct iucv_sock {
63 struct sock sk; 108 struct sock sk;
64 char src_user_id[8]; 109 char src_user_id[8];
@@ -75,6 +120,13 @@ struct iucv_sock {
75 unsigned int send_tag; 120 unsigned int send_tag;
76 u8 flags; 121 u8 flags;
77 u16 msglimit; 122 u16 msglimit;
123 u16 msglimit_peer;
124 atomic_t msg_sent;
125 atomic_t msg_recv;
126 atomic_t pendings;
127 int transport;
128 void (*sk_txnotify)(struct sk_buff *skb,
129 enum iucv_tx_notify n);
78}; 130};
79 131
80/* iucv socket options (SOL_IUCV) */ 132/* iucv socket options (SOL_IUCV) */
diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h
index 1121baa9f695..0894ced31957 100644
--- a/include/net/iucv/iucv.h
+++ b/include/net/iucv/iucv.h
@@ -120,7 +120,7 @@ struct iucv_message {
120 u32 reply_size; 120 u32 reply_size;
121 u8 rmmsg[8]; 121 u8 rmmsg[8];
122 u8 flags; 122 u8 flags;
123}; 123} __packed;
124 124
125/* 125/*
126 * struct iucv_handler 126 * struct iucv_handler
@@ -459,3 +459,37 @@ int __iucv_message_send(struct iucv_path *path, struct iucv_message *msg,
459int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg, 459int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg,
460 u8 flags, u32 srccls, void *buffer, size_t size, 460 u8 flags, u32 srccls, void *buffer, size_t size,
461 void *answer, size_t asize, size_t *residual); 461 void *answer, size_t asize, size_t *residual);
462
463struct iucv_interface {
464 int (*message_receive)(struct iucv_path *path, struct iucv_message *msg,
465 u8 flags, void *buffer, size_t size, size_t *residual);
466 int (*__message_receive)(struct iucv_path *path,
467 struct iucv_message *msg, u8 flags, void *buffer, size_t size,
468 size_t *residual);
469 int (*message_reply)(struct iucv_path *path, struct iucv_message *msg,
470 u8 flags, void *reply, size_t size);
471 int (*message_reject)(struct iucv_path *path, struct iucv_message *msg);
472 int (*message_send)(struct iucv_path *path, struct iucv_message *msg,
473 u8 flags, u32 srccls, void *buffer, size_t size);
474 int (*__message_send)(struct iucv_path *path, struct iucv_message *msg,
475 u8 flags, u32 srccls, void *buffer, size_t size);
476 int (*message_send2way)(struct iucv_path *path,
477 struct iucv_message *msg, u8 flags, u32 srccls, void *buffer,
478 size_t size, void *answer, size_t asize, size_t *residual);
479 int (*message_purge)(struct iucv_path *path, struct iucv_message *msg,
480 u32 srccls);
481 int (*path_accept)(struct iucv_path *path, struct iucv_handler *handler,
482 u8 userdata[16], void *private);
483 int (*path_connect)(struct iucv_path *path,
484 struct iucv_handler *handler,
485 u8 userid[8], u8 system[8], u8 userdata[16], void *private);
486 int (*path_quiesce)(struct iucv_path *path, u8 userdata[16]);
487 int (*path_resume)(struct iucv_path *path, u8 userdata[16]);
488 int (*path_sever)(struct iucv_path *path, u8 userdata[16]);
489 int (*iucv_register)(struct iucv_handler *handler, int smp);
490 void (*iucv_unregister)(struct iucv_handler *handler, int smp);
491 struct bus_type *bus;
492 struct device *root;
493};
494
495extern struct iucv_interface iucv_if;
diff --git a/include/net/lapb.h b/include/net/lapb.h
index 96cb5ddaa9f1..fd2bf572ee1d 100644
--- a/include/net/lapb.h
+++ b/include/net/lapb.h
@@ -95,7 +95,7 @@ struct lapb_cb {
95 struct sk_buff_head write_queue; 95 struct sk_buff_head write_queue;
96 struct sk_buff_head ack_queue; 96 struct sk_buff_head ack_queue;
97 unsigned char window; 97 unsigned char window;
98 struct lapb_register_struct callbacks; 98 const struct lapb_register_struct *callbacks;
99 99
100 /* FRMR control information */ 100 /* FRMR control information */
101 struct lapb_frame frmr_data; 101 struct lapb_frame frmr_data;
diff --git a/include/net/lib80211.h b/include/net/lib80211.h
index b95bbb083ee8..d178c26a5558 100644
--- a/include/net/lib80211.h
+++ b/include/net/lib80211.h
@@ -25,7 +25,6 @@
25 25
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/module.h>
29#include <linux/atomic.h> 28#include <linux/atomic.h>
30#include <linux/if.h> 29#include <linux/if.h>
31#include <linux/skbuff.h> 30#include <linux/skbuff.h>
@@ -42,6 +41,8 @@ enum {
42 IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0), 41 IEEE80211_CRYPTO_TKIP_COUNTERMEASURES = (1 << 0),
43}; 42};
44 43
44struct module;
45
45struct lib80211_crypto_ops { 46struct lib80211_crypto_ops {
46 const char *name; 47 const char *name;
47 struct list_head list; 48 struct list_head list;
@@ -117,10 +118,7 @@ void lib80211_crypt_info_free(struct lib80211_crypt_info *info);
117int lib80211_register_crypto_ops(struct lib80211_crypto_ops *ops); 118int lib80211_register_crypto_ops(struct lib80211_crypto_ops *ops);
118int lib80211_unregister_crypto_ops(struct lib80211_crypto_ops *ops); 119int lib80211_unregister_crypto_ops(struct lib80211_crypto_ops *ops);
119struct lib80211_crypto_ops *lib80211_get_crypto_ops(const char *name); 120struct lib80211_crypto_ops *lib80211_get_crypto_ops(const char *name);
120void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *, int);
121void lib80211_crypt_deinit_handler(unsigned long);
122void lib80211_crypt_delayed_deinit(struct lib80211_crypt_info *info, 121void lib80211_crypt_delayed_deinit(struct lib80211_crypt_info *info,
123 struct lib80211_crypt_data **crypt); 122 struct lib80211_crypt_data **crypt);
124void lib80211_crypt_quiescing(struct lib80211_crypt_info *info);
125 123
126#endif /* LIB80211_H */ 124#endif /* LIB80211_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9259e97864d7..72eddd1b410b 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -16,7 +16,6 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/if_ether.h> 17#include <linux/if_ether.h>
18#include <linux/skbuff.h> 18#include <linux/skbuff.h>
19#include <linux/wireless.h>
20#include <linux/device.h> 19#include <linux/device.h>
21#include <linux/ieee80211.h> 20#include <linux/ieee80211.h>
22#include <net/cfg80211.h> 21#include <net/cfg80211.h>
@@ -110,6 +109,7 @@ enum ieee80211_ac_numbers {
110 IEEE80211_AC_BE = 2, 109 IEEE80211_AC_BE = 2,
111 IEEE80211_AC_BK = 3, 110 IEEE80211_AC_BK = 3,
112}; 111};
112#define IEEE80211_NUM_ACS 4
113 113
114/** 114/**
115 * struct ieee80211_tx_queue_params - transmit queue configuration 115 * struct ieee80211_tx_queue_params - transmit queue configuration
@@ -165,13 +165,14 @@ struct ieee80211_low_level_stats {
165 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note 165 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note
166 * that it is only ever disabled for station mode. 166 * that it is only ever disabled for station mode.
167 * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. 167 * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface.
168 * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode)
168 */ 169 */
169enum ieee80211_bss_change { 170enum ieee80211_bss_change {
170 BSS_CHANGED_ASSOC = 1<<0, 171 BSS_CHANGED_ASSOC = 1<<0,
171 BSS_CHANGED_ERP_CTS_PROT = 1<<1, 172 BSS_CHANGED_ERP_CTS_PROT = 1<<1,
172 BSS_CHANGED_ERP_PREAMBLE = 1<<2, 173 BSS_CHANGED_ERP_PREAMBLE = 1<<2,
173 BSS_CHANGED_ERP_SLOT = 1<<3, 174 BSS_CHANGED_ERP_SLOT = 1<<3,
174 BSS_CHANGED_HT = 1<<4, 175 BSS_CHANGED_HT = 1<<4,
175 BSS_CHANGED_BASIC_RATES = 1<<5, 176 BSS_CHANGED_BASIC_RATES = 1<<5,
176 BSS_CHANGED_BEACON_INT = 1<<6, 177 BSS_CHANGED_BEACON_INT = 1<<6,
177 BSS_CHANGED_BSSID = 1<<7, 178 BSS_CHANGED_BSSID = 1<<7,
@@ -182,6 +183,7 @@ enum ieee80211_bss_change {
182 BSS_CHANGED_ARP_FILTER = 1<<12, 183 BSS_CHANGED_ARP_FILTER = 1<<12,
183 BSS_CHANGED_QOS = 1<<13, 184 BSS_CHANGED_QOS = 1<<13,
184 BSS_CHANGED_IDLE = 1<<14, 185 BSS_CHANGED_IDLE = 1<<14,
186 BSS_CHANGED_SSID = 1<<15,
185 187
186 /* when adding here, make sure to change ieee80211_reconfig */ 188 /* when adding here, make sure to change ieee80211_reconfig */
187}; 189};
@@ -255,6 +257,9 @@ enum ieee80211_rssi_event {
255 * @idle: This interface is idle. There's also a global idle flag in the 257 * @idle: This interface is idle. There's also a global idle flag in the
256 * hardware config which may be more appropriate depending on what 258 * hardware config which may be more appropriate depending on what
257 * your driver/device needs to do. 259 * your driver/device needs to do.
260 * @ssid: The SSID of the current vif. Only valid in AP-mode.
261 * @ssid_len: Length of SSID given in @ssid.
262 * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode.
258 */ 263 */
259struct ieee80211_bss_conf { 264struct ieee80211_bss_conf {
260 const u8 *bssid; 265 const u8 *bssid;
@@ -281,6 +286,9 @@ struct ieee80211_bss_conf {
281 bool arp_filter_enabled; 286 bool arp_filter_enabled;
282 bool qos; 287 bool qos;
283 bool idle; 288 bool idle;
289 u8 ssid[IEEE80211_MAX_SSID_LEN];
290 size_t ssid_len;
291 bool hidden_ssid;
284}; 292};
285 293
286/** 294/**
@@ -331,9 +339,9 @@ struct ieee80211_bss_conf {
331 * used to indicate that a frame was already retried due to PS 339 * used to indicate that a frame was already retried due to PS
332 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211, 340 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
333 * used to indicate frame should not be encrypted 341 * used to indicate frame should not be encrypted
334 * @IEEE80211_TX_CTL_PSPOLL_RESPONSE: (internal?) 342 * @IEEE80211_TX_CTL_POLL_RESPONSE: This frame is a response to a poll
335 * This frame is a response to a PS-poll frame and should be sent 343 * frame (PS-Poll or uAPSD) and should be sent although the station
336 * although the station is in powersave mode. 344 * is in powersave mode.
337 * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the 345 * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the
338 * transmit function after the current frame, this can be used 346 * transmit function after the current frame, this can be used
339 * by drivers to kick the DMA queue only if unset or when the 347 * by drivers to kick the DMA queue only if unset or when the
@@ -341,8 +349,6 @@ struct ieee80211_bss_conf {
341 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted 349 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted
342 * after TX status because the destination was asleep, it must not 350 * after TX status because the destination was asleep, it must not
343 * be modified again (no seqno assignment, crypto, etc.) 351 * be modified again (no seqno assignment, crypto, etc.)
344 * @IEEE80211_TX_INTFL_HAS_RADIOTAP: This frame was injected and still
345 * has a radiotap header at skb->data.
346 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 352 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211
347 * MLME command (internal to mac80211 to figure out whether to send TX 353 * MLME command (internal to mac80211 to figure out whether to send TX
348 * status to user space) 354 * status to user space)
@@ -356,6 +362,20 @@ struct ieee80211_bss_conf {
356 * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP 362 * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP
357 * testing. It will be sent out with incorrect Michael MIC key to allow 363 * testing. It will be sent out with incorrect Michael MIC key to allow
358 * TKIP countermeasures to be tested. 364 * TKIP countermeasures to be tested.
365 * @IEEE80211_TX_CTL_NO_CCK_RATE: This frame will be sent at non CCK rate.
366 * This flag is actually used for management frame especially for P2P
367 * frames not being sent at CCK rate in 2GHz band.
368 * @IEEE80211_TX_STATUS_EOSP: This packet marks the end of service period,
369 * when its status is reported the service period ends. For frames in
370 * an SP that mac80211 transmits, it is already set; for driver frames
371 * the driver may set this flag. It is also used to do the same for
372 * PS-Poll responses.
373 * @IEEE80211_TX_CTL_USE_MINRATE: This frame will be sent at lowest rate.
374 * This flag is used to send nullfunc frame at minimum rate when
375 * the nullfunc is used for connection monitoring purpose.
376 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it
377 * would be fragmented by size (this is optional, only used for
378 * monitor injection).
359 * 379 *
360 * Note: If you have to add new flags to the enumeration, then don't 380 * Note: If you have to add new flags to the enumeration, then don't
361 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 381 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
@@ -377,15 +397,19 @@ enum mac80211_tx_control_flags {
377 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 397 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
378 IEEE80211_TX_INTFL_RETRIED = BIT(15), 398 IEEE80211_TX_INTFL_RETRIED = BIT(15),
379 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), 399 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
380 IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17), 400 IEEE80211_TX_CTL_POLL_RESPONSE = BIT(17),
381 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), 401 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
382 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), 402 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19),
383 IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), 403 /* hole at 20, use later */
384 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), 404 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
385 IEEE80211_TX_CTL_LDPC = BIT(22), 405 IEEE80211_TX_CTL_LDPC = BIT(22),
386 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), 406 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24),
387 IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), 407 IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25),
388 IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26), 408 IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26),
409 IEEE80211_TX_CTL_NO_CCK_RATE = BIT(27),
410 IEEE80211_TX_STATUS_EOSP = BIT(28),
411 IEEE80211_TX_CTL_USE_MINRATE = BIT(29),
412 IEEE80211_TX_CTL_DONTFRAG = BIT(30),
389}; 413};
390 414
391#define IEEE80211_TX_CTL_STBC_SHIFT 23 415#define IEEE80211_TX_CTL_STBC_SHIFT 23
@@ -399,9 +423,9 @@ enum mac80211_tx_control_flags {
399 IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ 423 IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \
400 IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ 424 IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \
401 IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ 425 IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \
402 IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_PSPOLL_RESPONSE | \ 426 IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_POLL_RESPONSE | \
403 IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ 427 IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \
404 IEEE80211_TX_CTL_STBC) 428 IEEE80211_TX_CTL_STBC | IEEE80211_TX_STATUS_EOSP)
405 429
406/** 430/**
407 * enum mac80211_rate_control_flags - per-rate flags set by the 431 * enum mac80211_rate_control_flags - per-rate flags set by the
@@ -948,6 +972,9 @@ enum set_key_cmd {
948 * @wme: indicates whether the STA supports WME. Only valid during AP-mode. 972 * @wme: indicates whether the STA supports WME. Only valid during AP-mode.
949 * @drv_priv: data area for driver use, will always be aligned to 973 * @drv_priv: data area for driver use, will always be aligned to
950 * sizeof(void *), size is determined in hw information. 974 * sizeof(void *), size is determined in hw information.
975 * @uapsd_queues: bitmap of queues configured for uapsd. Only valid
976 * if wme is supported.
977 * @max_sp: max Service Period. Only valid if wme is supported.
951 */ 978 */
952struct ieee80211_sta { 979struct ieee80211_sta {
953 u32 supp_rates[IEEE80211_NUM_BANDS]; 980 u32 supp_rates[IEEE80211_NUM_BANDS];
@@ -955,6 +982,8 @@ struct ieee80211_sta {
955 u16 aid; 982 u16 aid;
956 struct ieee80211_sta_ht_cap ht_cap; 983 struct ieee80211_sta_ht_cap ht_cap;
957 bool wme; 984 bool wme;
985 u8 uapsd_queues;
986 u8 max_sp;
958 987
959 /* must be last */ 988 /* must be last */
960 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 989 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
@@ -1095,6 +1124,10 @@ enum sta_notify_cmd {
1095 * stations based on the PM bit of incoming frames. 1124 * stations based on the PM bit of incoming frames.
1096 * Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure 1125 * Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure
1097 * the PS mode of connected stations. 1126 * the PS mode of connected stations.
1127 *
1128 * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session
1129 * setup strictly in HW. mac80211 should not attempt to do this in
1130 * software.
1098 */ 1131 */
1099enum ieee80211_hw_flags { 1132enum ieee80211_hw_flags {
1100 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1133 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1120,6 +1153,7 @@ enum ieee80211_hw_flags {
1120 IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, 1153 IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20,
1121 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, 1154 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1122 IEEE80211_HW_AP_LINK_PS = 1<<22, 1155 IEEE80211_HW_AP_LINK_PS = 1<<22,
1156 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
1123}; 1157};
1124 1158
1125/** 1159/**
@@ -1511,6 +1545,95 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1511 */ 1545 */
1512 1546
1513/** 1547/**
1548 * DOC: AP support for powersaving clients
1549 *
1550 * In order to implement AP and P2P GO modes, mac80211 has support for
1551 * client powersaving, both "legacy" PS (PS-Poll/null data) and uAPSD.
1552 * There currently is no support for sAPSD.
1553 *
1554 * There is one assumption that mac80211 makes, namely that a client
1555 * will not poll with PS-Poll and trigger with uAPSD at the same time.
1556 * Both are supported, and both can be used by the same client, but
1557 * they can't be used concurrently by the same client. This simplifies
1558 * the driver code.
1559 *
1560 * The first thing to keep in mind is that there is a flag for complete
1561 * driver implementation: %IEEE80211_HW_AP_LINK_PS. If this flag is set,
1562 * mac80211 expects the driver to handle most of the state machine for
1563 * powersaving clients and will ignore the PM bit in incoming frames.
1564 * Drivers then use ieee80211_sta_ps_transition() to inform mac80211 of
1565 * stations' powersave transitions. In this mode, mac80211 also doesn't
1566 * handle PS-Poll/uAPSD.
1567 *
1568 * In the mode without %IEEE80211_HW_AP_LINK_PS, mac80211 will check the
1569 * PM bit in incoming frames for client powersave transitions. When a
1570 * station goes to sleep, we will stop transmitting to it. There is,
1571 * however, a race condition: a station might go to sleep while there is
1572 * data buffered on hardware queues. If the device has support for this
1573 * it will reject frames, and the driver should give the frames back to
1574 * mac80211 with the %IEEE80211_TX_STAT_TX_FILTERED flag set which will
1575 * cause mac80211 to retry the frame when the station wakes up. The
1576 * driver is also notified of powersave transitions by calling its
1577 * @sta_notify callback.
1578 *
1579 * When the station is asleep, it has three choices: it can wake up,
1580 * it can PS-Poll, or it can possibly start a uAPSD service period.
1581 * Waking up is implemented by simply transmitting all buffered (and
1582 * filtered) frames to the station. This is the easiest case. When
1583 * the station sends a PS-Poll or a uAPSD trigger frame, mac80211
1584 * will inform the driver of this with the @allow_buffered_frames
1585 * callback; this callback is optional. mac80211 will then transmit
1586 * the frames as usual and set the %IEEE80211_TX_CTL_POLL_RESPONSE
1587 * on each frame. The last frame in the service period (or the only
1588 * response to a PS-Poll) also has %IEEE80211_TX_STATUS_EOSP set to
1589 * indicate that it ends the service period; as this frame must have
1590 * TX status report it also sets %IEEE80211_TX_CTL_REQ_TX_STATUS.
1591 * When TX status is reported for this frame, the service period is
1592 * marked has having ended and a new one can be started by the peer.
1593 *
1594 * Another race condition can happen on some devices like iwlwifi
1595 * when there are frames queued for the station and it wakes up
1596 * or polls; the frames that are already queued could end up being
1597 * transmitted first instead, causing reordering and/or wrong
1598 * processing of the EOSP. The cause is that allowing frames to be
1599 * transmitted to a certain station is out-of-band communication to
1600 * the device. To allow this problem to be solved, the driver can
1601 * call ieee80211_sta_block_awake() if frames are buffered when it
1602 * is notified that the station went to sleep. When all these frames
1603 * have been filtered (see above), it must call the function again
1604 * to indicate that the station is no longer blocked.
1605 *
1606 * If the driver buffers frames in the driver for aggregation in any
1607 * way, it must use the ieee80211_sta_set_buffered() call when it is
1608 * notified of the station going to sleep to inform mac80211 of any
1609 * TIDs that have frames buffered. Note that when a station wakes up
1610 * this information is reset (hence the requirement to call it when
1611 * informed of the station going to sleep). Then, when a service
1612 * period starts for any reason, @release_buffered_frames is called
1613 * with the number of frames to be released and which TIDs they are
1614 * to come from. In this case, the driver is responsible for setting
1615 * the EOSP (for uAPSD) and MORE_DATA bits in the released frames,
1616 * to help the @more_data paramter is passed to tell the driver if
1617 * there is more data on other TIDs -- the TIDs to release frames
1618 * from are ignored since mac80211 doesn't know how many frames the
1619 * buffers for those TIDs contain.
1620 *
1621 * If the driver also implement GO mode, where absence periods may
1622 * shorten service periods (or abort PS-Poll responses), it must
1623 * filter those response frames except in the case of frames that
1624 * are buffered in the driver -- those must remain buffered to avoid
1625 * reordering. Because it is possible that no frames are released
1626 * in this case, the driver must call ieee80211_sta_eosp_irqsafe()
1627 * to indicate to mac80211 that the service period ended anyway.
1628 *
1629 * Finally, if frames from multiple TIDs are released from mac80211
1630 * but the driver might reorder them, it must clear & set the flags
1631 * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP)
1632 * and also take care of the EOSP and MORE_DATA bits in the frame.
1633 * The driver may also use ieee80211_sta_eosp_irqsafe() in this case.
1634 */
1635
1636/**
1514 * enum ieee80211_filter_flags - hardware filter flags 1637 * enum ieee80211_filter_flags - hardware filter flags
1515 * 1638 *
1516 * These flags determine what the filter in hardware should be 1639 * These flags determine what the filter in hardware should be
@@ -1600,6 +1723,17 @@ enum ieee80211_tx_sync_type {
1600}; 1723};
1601 1724
1602/** 1725/**
1726 * enum ieee80211_frame_release_type - frame release reason
1727 * @IEEE80211_FRAME_RELEASE_PSPOLL: frame released for PS-Poll
1728 * @IEEE80211_FRAME_RELEASE_UAPSD: frame(s) released due to
1729 * frame received on trigger-enabled AC
1730 */
1731enum ieee80211_frame_release_type {
1732 IEEE80211_FRAME_RELEASE_PSPOLL,
1733 IEEE80211_FRAME_RELEASE_UAPSD,
1734};
1735
1736/**
1603 * struct ieee80211_ops - callbacks from mac80211 to the driver 1737 * struct ieee80211_ops - callbacks from mac80211 to the driver
1604 * 1738 *
1605 * This structure contains various callbacks that the driver may 1739 * This structure contains various callbacks that the driver may
@@ -1896,11 +2030,6 @@ enum ieee80211_tx_sync_type {
1896 * ieee80211_remain_on_channel_expired(). This callback may sleep. 2030 * ieee80211_remain_on_channel_expired(). This callback may sleep.
1897 * @cancel_remain_on_channel: Requests that an ongoing off-channel period is 2031 * @cancel_remain_on_channel: Requests that an ongoing off-channel period is
1898 * aborted before it expires. This callback may sleep. 2032 * aborted before it expires. This callback may sleep.
1899 * @offchannel_tx: Transmit frame on another channel, wait for a response
1900 * and return. Reliable TX status must be reported for the frame. If the
1901 * return value is 1, then the @remain_on_channel will be used with a
1902 * regular transmission (if supported.)
1903 * @offchannel_tx_cancel_wait: cancel wait associated with offchannel TX
1904 * 2033 *
1905 * @set_ringparam: Set tx and rx ring sizes. 2034 * @set_ringparam: Set tx and rx ring sizes.
1906 * 2035 *
@@ -1914,6 +2043,45 @@ enum ieee80211_tx_sync_type {
1914 * The callback can sleep. 2043 * The callback can sleep.
1915 * @rssi_callback: Notify driver when the average RSSI goes above/below 2044 * @rssi_callback: Notify driver when the average RSSI goes above/below
1916 * thresholds that were registered previously. The callback can sleep. 2045 * thresholds that were registered previously. The callback can sleep.
2046 *
2047 * @release_buffered_frames: Release buffered frames according to the given
2048 * parameters. In the case where the driver buffers some frames for
2049 * sleeping stations mac80211 will use this callback to tell the driver
2050 * to release some frames, either for PS-poll or uAPSD.
2051 * Note that if the @more_data paramter is %false the driver must check
2052 * if there are more frames on the given TIDs, and if there are more than
2053 * the frames being released then it must still set the more-data bit in
2054 * the frame. If the @more_data parameter is %true, then of course the
2055 * more-data bit must always be set.
2056 * The @tids parameter tells the driver which TIDs to release frames
2057 * from, for PS-poll it will always have only a single bit set.
2058 * In the case this is used for a PS-poll initiated release, the
2059 * @num_frames parameter will always be 1 so code can be shared. In
2060 * this case the driver must also set %IEEE80211_TX_STATUS_EOSP flag
2061 * on the TX status (and must report TX status) so that the PS-poll
2062 * period is properly ended. This is used to avoid sending multiple
2063 * responses for a retried PS-poll frame.
2064 * In the case this is used for uAPSD, the @num_frames parameter may be
2065 * bigger than one, but the driver may send fewer frames (it must send
2066 * at least one, however). In this case it is also responsible for
2067 * setting the EOSP flag in the QoS header of the frames. Also, when the
2068 * service period ends, the driver must set %IEEE80211_TX_STATUS_EOSP
2069 * on the last frame in the SP. Alternatively, it may call the function
2070 * ieee80211_sta_eosp_irqsafe() to inform mac80211 of the end of the SP.
2071 * This callback must be atomic.
2072 * @allow_buffered_frames: Prepare device to allow the given number of frames
2073 * to go out to the given station. The frames will be sent by mac80211
2074 * via the usual TX path after this call. The TX information for frames
2075 * released will also have the %IEEE80211_TX_CTL_POLL_RESPONSE flag set
2076 * and the last one will also have %IEEE80211_TX_STATUS_EOSP set. In case
2077 * frames from multiple TIDs are released and the driver might reorder
2078 * them between the TIDs, it must set the %IEEE80211_TX_STATUS_EOSP flag
2079 * on the last frame and clear it on all others and also handle the EOSP
2080 * bit in the QoS header correctly. Alternatively, it can also call the
2081 * ieee80211_sta_eosp_irqsafe() function.
2082 * The @tids parameter is a bitmap and tells the driver which TIDs the
2083 * frames will be on; it will at most have two bits set.
2084 * This callback must be atomic.
1917 */ 2085 */
1918struct ieee80211_ops { 2086struct ieee80211_ops {
1919 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 2087 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1986,11 +2154,13 @@ struct ieee80211_ops {
1986 struct ieee80211_sta *sta); 2154 struct ieee80211_sta *sta);
1987 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2155 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1988 enum sta_notify_cmd, struct ieee80211_sta *sta); 2156 enum sta_notify_cmd, struct ieee80211_sta *sta);
1989 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 2157 int (*conf_tx)(struct ieee80211_hw *hw,
2158 struct ieee80211_vif *vif, u16 queue,
1990 const struct ieee80211_tx_queue_params *params); 2159 const struct ieee80211_tx_queue_params *params);
1991 u64 (*get_tsf)(struct ieee80211_hw *hw); 2160 u64 (*get_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1992 void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf); 2161 void (*set_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1993 void (*reset_tsf)(struct ieee80211_hw *hw); 2162 u64 tsf);
2163 void (*reset_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1994 int (*tx_last_beacon)(struct ieee80211_hw *hw); 2164 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1995 int (*ampdu_action)(struct ieee80211_hw *hw, 2165 int (*ampdu_action)(struct ieee80211_hw *hw,
1996 struct ieee80211_vif *vif, 2166 struct ieee80211_vif *vif,
@@ -2019,11 +2189,6 @@ struct ieee80211_ops {
2019 enum nl80211_channel_type channel_type, 2189 enum nl80211_channel_type channel_type,
2020 int duration); 2190 int duration);
2021 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); 2191 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
2022 int (*offchannel_tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
2023 struct ieee80211_channel *chan,
2024 enum nl80211_channel_type channel_type,
2025 unsigned int wait);
2026 int (*offchannel_tx_cancel_wait)(struct ieee80211_hw *hw);
2027 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); 2192 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
2028 void (*get_ringparam)(struct ieee80211_hw *hw, 2193 void (*get_ringparam)(struct ieee80211_hw *hw,
2029 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); 2194 u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
@@ -2032,6 +2197,17 @@ struct ieee80211_ops {
2032 const struct cfg80211_bitrate_mask *mask); 2197 const struct cfg80211_bitrate_mask *mask);
2033 void (*rssi_callback)(struct ieee80211_hw *hw, 2198 void (*rssi_callback)(struct ieee80211_hw *hw,
2034 enum ieee80211_rssi_event rssi_event); 2199 enum ieee80211_rssi_event rssi_event);
2200
2201 void (*allow_buffered_frames)(struct ieee80211_hw *hw,
2202 struct ieee80211_sta *sta,
2203 u16 tids, int num_frames,
2204 enum ieee80211_frame_release_type reason,
2205 bool more_data);
2206 void (*release_buffered_frames)(struct ieee80211_hw *hw,
2207 struct ieee80211_sta *sta,
2208 u16 tids, int num_frames,
2209 enum ieee80211_frame_release_type reason,
2210 bool more_data);
2035}; 2211};
2036 2212
2037/** 2213/**
@@ -2346,20 +2522,38 @@ static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta,
2346 * The TX headroom reserved by mac80211 for its own tx_status functions. 2522 * The TX headroom reserved by mac80211 for its own tx_status functions.
2347 * This is enough for the radiotap header. 2523 * This is enough for the radiotap header.
2348 */ 2524 */
2349#define IEEE80211_TX_STATUS_HEADROOM 13 2525#define IEEE80211_TX_STATUS_HEADROOM 14
2350 2526
2351/** 2527/**
2352 * ieee80211_sta_set_tim - set the TIM bit for a sleeping station 2528 * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames
2353 * @sta: &struct ieee80211_sta pointer for the sleeping station 2529 * @sta: &struct ieee80211_sta pointer for the sleeping station
2530 * @tid: the TID that has buffered frames
2531 * @buffered: indicates whether or not frames are buffered for this TID
2354 * 2532 *
2355 * If a driver buffers frames for a powersave station instead of passing 2533 * If a driver buffers frames for a powersave station instead of passing
2356 * them back to mac80211 for retransmission, the station needs to be told 2534 * them back to mac80211 for retransmission, the station may still need
2357 * to wake up using the TIM bitmap in the beacon. 2535 * to be told that there are buffered frames via the TIM bit.
2358 * 2536 *
2359 * This function sets the station's TIM bit - it will be cleared when the 2537 * This function informs mac80211 whether or not there are frames that are
2360 * station wakes up. 2538 * buffered in the driver for a given TID; mac80211 can then use this data
2539 * to set the TIM bit (NOTE: This may call back into the driver's set_tim
2540 * call! Beware of the locking!)
2541 *
2542 * If all frames are released to the station (due to PS-poll or uAPSD)
2543 * then the driver needs to inform mac80211 that there no longer are
2544 * frames buffered. However, when the station wakes up mac80211 assumes
2545 * that all buffered frames will be transmitted and clears this data,
2546 * drivers need to make sure they inform mac80211 about all buffered
2547 * frames on the sleep transition (sta_notify() with %STA_NOTIFY_SLEEP).
2548 *
2549 * Note that technically mac80211 only needs to know this per AC, not per
2550 * TID, but since driver buffering will inevitably happen per TID (since
2551 * it is related to aggregation) it is easier to make mac80211 map the
2552 * TID to the AC as required instead of keeping track in all drivers that
2553 * use this API.
2361 */ 2554 */
2362void ieee80211_sta_set_tim(struct ieee80211_sta *sta); 2555void ieee80211_sta_set_buffered(struct ieee80211_sta *sta,
2556 u8 tid, bool buffered);
2363 2557
2364/** 2558/**
2365 * ieee80211_tx_status - transmit status callback 2559 * ieee80211_tx_status - transmit status callback
@@ -3017,6 +3211,24 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
3017 struct ieee80211_sta *pubsta, bool block); 3211 struct ieee80211_sta *pubsta, bool block);
3018 3212
3019/** 3213/**
3214 * ieee80211_sta_eosp - notify mac80211 about end of SP
3215 * @pubsta: the station
3216 *
3217 * When a device transmits frames in a way that it can't tell
3218 * mac80211 in the TX status about the EOSP, it must clear the
3219 * %IEEE80211_TX_STATUS_EOSP bit and call this function instead.
3220 * This applies for PS-Poll as well as uAPSD.
3221 *
3222 * Note that there is no non-_irqsafe version right now as
3223 * it wasn't needed, but just like _tx_status() and _rx()
3224 * must not be mixed in irqsafe/non-irqsafe versions, this
3225 * function must not be mixed with those either. Use the
3226 * all irqsafe, or all non-irqsafe, don't mix! If you need
3227 * the non-irqsafe version of this, you need to add it.
3228 */
3229void ieee80211_sta_eosp_irqsafe(struct ieee80211_sta *pubsta);
3230
3231/**
3020 * ieee80211_iter_keys - iterate keys programmed into the device 3232 * ieee80211_iter_keys - iterate keys programmed into the device
3021 * @hw: pointer obtained from ieee80211_alloc_hw() 3233 * @hw: pointer obtained from ieee80211_alloc_hw()
3022 * @vif: virtual interface to iterate, may be %NULL for all 3234 * @vif: virtual interface to iterate, may be %NULL for all
@@ -3229,6 +3441,19 @@ void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw);
3229void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap, 3441void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
3230 const u8 *addr); 3442 const u8 *addr);
3231 3443
3444/**
3445 * ieee80211_send_bar - send a BlockAckReq frame
3446 *
3447 * can be used to flush pending frames from the peer's aggregation reorder
3448 * buffer.
3449 *
3450 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3451 * @ra: the peer's destination address
3452 * @tid: the TID of the aggregation session
3453 * @ssn: the new starting sequence number for the receiver
3454 */
3455void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn);
3456
3232/* Rate control API */ 3457/* Rate control API */
3233 3458
3234/** 3459/**
@@ -3342,8 +3567,9 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
3342 return i; 3567 return i;
3343 3568
3344 /* warn when we cannot find a rate. */ 3569 /* warn when we cannot find a rate. */
3345 WARN_ON(1); 3570 WARN_ON_ONCE(1);
3346 3571
3572 /* and return 0 (the lowest index) */
3347 return 0; 3573 return 0;
3348} 3574}
3349 3575
@@ -3419,4 +3645,9 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
3419 int rssi_max_thold); 3645 int rssi_max_thold);
3420 3646
3421void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); 3647void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
3648
3649int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb);
3650
3651int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif,
3652 struct sk_buff *skb);
3422#endif /* MAC80211_H */ 3653#endif /* MAC80211_H */
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 0b7f05e4a927..8a2b0ae7dbd2 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -313,6 +313,8 @@ static inline bool nf_is_loopback_packet(const struct sk_buff *skb)
313 return skb->dev && skb->skb_iif && skb->dev->flags & IFF_LOOPBACK; 313 return skb->dev && skb->skb_iif && skb->dev->flags & IFF_LOOPBACK;
314} 314}
315 315
316struct kernel_param;
317
316extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); 318extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
317extern unsigned int nf_conntrack_htable_size; 319extern unsigned int nf_conntrack_htable_size;
318extern unsigned int nf_conntrack_max; 320extern unsigned int nf_conntrack_max;
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index 7ca6bdd5bae6..2f8fb77bfdd1 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -12,6 +12,7 @@
12 12
13#include <linux/netfilter/x_tables.h> 13#include <linux/netfilter/x_tables.h>
14#include <linux/netfilter/nf_conntrack_tuple_common.h> 14#include <linux/netfilter/nf_conntrack_tuple_common.h>
15#include <linux/netfilter_ipv4/nf_nat.h>
15#include <linux/list_nulls.h> 16#include <linux/list_nulls.h>
16 17
17/* A `tuple' is a structure containing the information to uniquely 18/* A `tuple' is a structure containing the information to uniquely
@@ -24,32 +25,6 @@
24 25
25#define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all) 26#define NF_CT_TUPLE_L3SIZE ARRAY_SIZE(((union nf_inet_addr *)NULL)->all)
26 27
27/* The protocol-specific manipulable parts of the tuple: always in
28 network order! */
29union nf_conntrack_man_proto {
30 /* Add other protocols here. */
31 __be16 all;
32
33 struct {
34 __be16 port;
35 } tcp;
36 struct {
37 __be16 port;
38 } udp;
39 struct {
40 __be16 id;
41 } icmp;
42 struct {
43 __be16 port;
44 } dccp;
45 struct {
46 __be16 port;
47 } sctp;
48 struct {
49 __be16 key; /* GRE key is 32bit, PPtP only uses 16bit */
50 } gre;
51};
52
53/* The manipulable part of the tuple. */ 28/* The manipulable part of the tuple. */
54struct nf_conntrack_man { 29struct nf_conntrack_man {
55 union nf_inet_addr u3; 30 union nf_inet_addr u3;
diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h
index 920997f1aff0..e991bd0a27af 100644
--- a/include/net/netfilter/nf_log.h
+++ b/include/net/netfilter/nf_log.h
@@ -53,12 +53,13 @@ int nf_log_bind_pf(u_int8_t pf, const struct nf_logger *logger);
53void nf_log_unbind_pf(u_int8_t pf); 53void nf_log_unbind_pf(u_int8_t pf);
54 54
55/* Calls the registered backend logging function */ 55/* Calls the registered backend logging function */
56__printf(7, 8)
56void nf_log_packet(u_int8_t pf, 57void nf_log_packet(u_int8_t pf,
57 unsigned int hooknum, 58 unsigned int hooknum,
58 const struct sk_buff *skb, 59 const struct sk_buff *skb,
59 const struct net_device *in, 60 const struct net_device *in,
60 const struct net_device *out, 61 const struct net_device *out,
61 const struct nf_loginfo *li, 62 const struct nf_loginfo *li,
62 const char *fmt, ...) __attribute__ ((format(printf,7,8))); 63 const char *fmt, ...);
63 64
64#endif /* _NF_LOG_H */ 65#endif /* _NF_LOG_H */
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index 0346b0070864..b8872df7285f 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -1,6 +1,7 @@
1#ifndef _NF_NAT_H 1#ifndef _NF_NAT_H
2#define _NF_NAT_H 2#define _NF_NAT_H
3#include <linux/netfilter_ipv4.h> 3#include <linux/netfilter_ipv4.h>
4#include <linux/netfilter_ipv4/nf_nat.h>
4#include <net/netfilter/nf_conntrack_tuple.h> 5#include <net/netfilter/nf_conntrack_tuple.h>
5 6
6#define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 7#define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16
@@ -14,11 +15,6 @@ enum nf_nat_manip_type {
14#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \ 15#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \
15 (hooknum) != NF_INET_LOCAL_IN) 16 (hooknum) != NF_INET_LOCAL_IN)
16 17
17#define IP_NAT_RANGE_MAP_IPS 1
18#define IP_NAT_RANGE_PROTO_SPECIFIED 2
19#define IP_NAT_RANGE_PROTO_RANDOM 4
20#define IP_NAT_RANGE_PERSISTENT 8
21
22/* NAT sequence number modifications */ 18/* NAT sequence number modifications */
23struct nf_nat_seq { 19struct nf_nat_seq {
24 /* position of the last TCP sequence number modification (if any) */ 20 /* position of the last TCP sequence number modification (if any) */
@@ -28,26 +24,6 @@ struct nf_nat_seq {
28 int16_t offset_before, offset_after; 24 int16_t offset_before, offset_after;
29}; 25};
30 26
31/* Single range specification. */
32struct nf_nat_range {
33 /* Set to OR of flags above. */
34 unsigned int flags;
35
36 /* Inclusive: network order. */
37 __be32 min_ip, max_ip;
38
39 /* Inclusive: network order */
40 union nf_conntrack_man_proto min, max;
41};
42
43/* For backwards compat: don't use in modern code. */
44struct nf_nat_multi_range_compat {
45 unsigned int rangesize; /* Must be 1. */
46
47 /* hangs off end. */
48 struct nf_nat_range range[1];
49};
50
51#include <linux/list.h> 27#include <linux/list.h>
52#include <linux/netfilter/nf_conntrack_pptp.h> 28#include <linux/netfilter/nf_conntrack_pptp.h>
53#include <net/netfilter/nf_conntrack_extend.h> 29#include <net/netfilter/nf_conntrack_extend.h>
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 98c185441bee..cb1f3504687f 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -192,8 +192,15 @@ enum {
192 * NLA_NUL_STRING Maximum length of string (excluding NUL) 192 * NLA_NUL_STRING Maximum length of string (excluding NUL)
193 * NLA_FLAG Unused 193 * NLA_FLAG Unused
194 * NLA_BINARY Maximum length of attribute payload 194 * NLA_BINARY Maximum length of attribute payload
195 * NLA_NESTED_COMPAT Exact length of structure payload 195 * NLA_NESTED Don't use `len' field -- length verification is
196 * All other Exact length of attribute payload 196 * done by checking len of nested header (or empty)
197 * NLA_NESTED_COMPAT Minimum length of structure payload
198 * NLA_U8, NLA_U16,
199 * NLA_U32, NLA_U64,
200 * NLA_MSECS Leaving the length field zero will verify the
201 * given type fits, using it verifies minimum length
202 * just like "All other"
203 * All other Minimum length of attribute payload
197 * 204 *
198 * Example: 205 * Example:
199 * static const struct nla_policy my_policy[ATTR_MAX+1] = { 206 * static const struct nla_policy my_policy[ATTR_MAX+1] = {
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
new file mode 100644
index 000000000000..39b85bc0804f
--- /dev/null
+++ b/include/net/nfc/nci.h
@@ -0,0 +1,313 @@
1/*
2 * The NFC Controller Interface is the communication protocol between an
3 * NFC Controller (NFCC) and a Device Host (DH).
4 *
5 * Copyright (C) 2011 Texas Instruments, Inc.
6 *
7 * Written by Ilan Elias <ilane@ti.com>
8 *
9 * Acknowledgements:
10 * This file is based on hci.h, which was written
11 * by Maxim Krasnyansky.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2
15 * as published by the Free Software Foundation
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28#ifndef __NCI_H
29#define __NCI_H
30
31/* NCI constants */
32#define NCI_MAX_NUM_MAPPING_CONFIGS 10
33#define NCI_MAX_NUM_RF_CONFIGS 10
34#define NCI_MAX_NUM_CONN 10
35
36/* NCI Status Codes */
37#define NCI_STATUS_OK 0x00
38#define NCI_STATUS_REJECTED 0x01
39#define NCI_STATUS_MESSAGE_CORRUPTED 0x02
40#define NCI_STATUS_BUFFER_FULL 0x03
41#define NCI_STATUS_FAILED 0x04
42#define NCI_STATUS_NOT_INITIALIZED 0x05
43#define NCI_STATUS_SYNTAX_ERROR 0x06
44#define NCI_STATUS_SEMANTIC_ERROR 0x07
45#define NCI_STATUS_UNKNOWN_GID 0x08
46#define NCI_STATUS_UNKNOWN_OID 0x09
47#define NCI_STATUS_INVALID_PARAM 0x0a
48#define NCI_STATUS_MESSAGE_SIZE_EXCEEDED 0x0b
49/* Discovery Specific Status Codes */
50#define NCI_STATUS_DISCOVERY_ALREADY_STARTED 0xa0
51#define NCI_STATUS_DISCOVERY_TARGET_ACTIVATION_FAILED 0xa1
52/* RF Interface Specific Status Codes */
53#define NCI_STATUS_RF_TRANSMISSION_ERROR 0xb0
54#define NCI_STATUS_RF_PROTOCOL_ERROR 0xb1
55#define NCI_STATUS_RF_TIMEOUT_ERROR 0xb2
56#define NCI_STATUS_RF_LINK_LOSS_ERROR 0xb3
57/* NFCEE Interface Specific Status Codes */
58#define NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED 0xc0
59#define NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED 0xc1
60#define NCI_STATUS_NFCEE_TRANSMISSION_ERROR 0xc2
61#define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc3
62#define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc4
63
64/* NCI RF Technology and Mode */
65#define NCI_NFC_A_PASSIVE_POLL_MODE 0x00
66#define NCI_NFC_B_PASSIVE_POLL_MODE 0x01
67#define NCI_NFC_F_PASSIVE_POLL_MODE 0x02
68#define NCI_NFC_A_ACTIVE_POLL_MODE 0x03
69#define NCI_NFC_F_ACTIVE_POLL_MODE 0x05
70#define NCI_NFC_A_PASSIVE_LISTEN_MODE 0x80
71#define NCI_NFC_B_PASSIVE_LISTEN_MODE 0x81
72#define NCI_NFC_F_PASSIVE_LISTEN_MODE 0x82
73#define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83
74#define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85
75
76/* NCI RF Protocols */
77#define NCI_RF_PROTOCOL_UNKNOWN 0x00
78#define NCI_RF_PROTOCOL_T1T 0x01
79#define NCI_RF_PROTOCOL_T2T 0x02
80#define NCI_RF_PROTOCOL_T3T 0x03
81#define NCI_RF_PROTOCOL_ISO_DEP 0x04
82#define NCI_RF_PROTOCOL_NFC_DEP 0x05
83
84/* NCI RF Interfaces */
85#define NCI_RF_INTERFACE_RFU 0x00
86#define NCI_RF_INTERFACE_FRAME 0x01
87#define NCI_RF_INTERFACE_ISO_DEP 0x02
88#define NCI_RF_INTERFACE_NFC_DEP 0x03
89
90/* NCI RF_DISCOVER_MAP_CMD modes */
91#define NCI_DISC_MAP_MODE_POLL 0x01
92#define NCI_DISC_MAP_MODE_LISTEN 0x02
93#define NCI_DISC_MAP_MODE_BOTH 0x03
94
95/* NCI Discovery Types */
96#define NCI_DISCOVERY_TYPE_POLL_A_PASSIVE 0x00
97#define NCI_DISCOVERY_TYPE_POLL_B_PASSIVE 0x01
98#define NCI_DISCOVERY_TYPE_POLL_F_PASSIVE 0x02
99#define NCI_DISCOVERY_TYPE_POLL_A_ACTIVE 0x03
100#define NCI_DISCOVERY_TYPE_POLL_F_ACTIVE 0x05
101#define NCI_DISCOVERY_TYPE_WAKEUP_A_PASSIVE 0x06
102#define NCI_DISCOVERY_TYPE_WAKEUP_B_PASSIVE 0x07
103#define NCI_DISCOVERY_TYPE_WAKEUP_A_ACTIVE 0x09
104#define NCI_DISCOVERY_TYPE_LISTEN_A_PASSIVE 0x80
105#define NCI_DISCOVERY_TYPE_LISTEN_B_PASSIVE 0x81
106#define NCI_DISCOVERY_TYPE_LISTEN_F_PASSIVE 0x82
107#define NCI_DISCOVERY_TYPE_LISTEN_A_ACTIVE 0x83
108#define NCI_DISCOVERY_TYPE_LISTEN_F_ACTIVE 0x85
109
110/* NCI Deactivation Type */
111#define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00
112#define NCI_DEACTIVATE_TYPE_SLEEP_MODE 0x01
113#define NCI_DEACTIVATE_TYPE_SLEEP_AF_MODE 0x02
114#define NCI_DEACTIVATE_TYPE_RF_LINK_LOSS 0x03
115#define NCI_DEACTIVATE_TYPE_DISCOVERY_ERROR 0x04
116
117/* Message Type (MT) */
118#define NCI_MT_DATA_PKT 0x00
119#define NCI_MT_CMD_PKT 0x01
120#define NCI_MT_RSP_PKT 0x02
121#define NCI_MT_NTF_PKT 0x03
122
123#define nci_mt(hdr) (((hdr)[0]>>5)&0x07)
124#define nci_mt_set(hdr, mt) ((hdr)[0] |= (__u8)(((mt)&0x07)<<5))
125
126/* Packet Boundary Flag (PBF) */
127#define NCI_PBF_LAST 0x00
128#define NCI_PBF_CONT 0x01
129
130#define nci_pbf(hdr) (__u8)(((hdr)[0]>>4)&0x01)
131#define nci_pbf_set(hdr, pbf) ((hdr)[0] |= (__u8)(((pbf)&0x01)<<4))
132
133/* Control Opcode manipulation */
134#define nci_opcode_pack(gid, oid) (__u16)((((__u16)((gid)&0x0f))<<8)|\
135 ((__u16)((oid)&0x3f)))
136#define nci_opcode(hdr) nci_opcode_pack(hdr[0], hdr[1])
137#define nci_opcode_gid(op) (__u8)(((op)&0x0f00)>>8)
138#define nci_opcode_oid(op) (__u8)((op)&0x003f)
139
140/* Payload Length */
141#define nci_plen(hdr) (__u8)((hdr)[2])
142
143/* Connection ID */
144#define nci_conn_id(hdr) (__u8)(((hdr)[0])&0x0f)
145
146/* GID values */
147#define NCI_GID_CORE 0x0
148#define NCI_GID_RF_MGMT 0x1
149#define NCI_GID_NFCEE_MGMT 0x2
150#define NCI_GID_PROPRIETARY 0xf
151
152/* ---- NCI Packet structures ---- */
153#define NCI_CTRL_HDR_SIZE 3
154#define NCI_DATA_HDR_SIZE 3
155
156struct nci_ctrl_hdr {
157 __u8 gid; /* MT & PBF & GID */
158 __u8 oid;
159 __u8 plen;
160} __packed;
161
162struct nci_data_hdr {
163 __u8 conn_id; /* MT & PBF & ConnID */
164 __u8 rfu;
165 __u8 plen;
166} __packed;
167
168/* ------------------------ */
169/* ----- NCI Commands ---- */
170/* ------------------------ */
171#define NCI_OP_CORE_RESET_CMD nci_opcode_pack(NCI_GID_CORE, 0x00)
172
173#define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01)
174
175#define NCI_OP_CORE_SET_CONFIG_CMD nci_opcode_pack(NCI_GID_CORE, 0x02)
176
177#define NCI_OP_CORE_CONN_CREATE_CMD nci_opcode_pack(NCI_GID_CORE, 0x04)
178struct nci_core_conn_create_cmd {
179 __u8 target_handle;
180 __u8 num_target_specific_params;
181} __packed;
182
183#define NCI_OP_CORE_CONN_CLOSE_CMD nci_opcode_pack(NCI_GID_CORE, 0x06)
184
185#define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
186struct disc_map_config {
187 __u8 rf_protocol;
188 __u8 mode;
189 __u8 rf_interface_type;
190} __packed;
191
192struct nci_rf_disc_map_cmd {
193 __u8 num_mapping_configs;
194 struct disc_map_config mapping_configs
195 [NCI_MAX_NUM_MAPPING_CONFIGS];
196} __packed;
197
198#define NCI_OP_RF_DISCOVER_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
199struct disc_config {
200 __u8 type;
201 __u8 frequency;
202} __packed;
203
204struct nci_rf_disc_cmd {
205 __u8 num_disc_configs;
206 struct disc_config disc_configs[NCI_MAX_NUM_RF_CONFIGS];
207} __packed;
208
209#define NCI_OP_RF_DEACTIVATE_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
210struct nci_rf_deactivate_cmd {
211 __u8 type;
212} __packed;
213
214/* ----------------------- */
215/* ---- NCI Responses ---- */
216/* ----------------------- */
217#define NCI_OP_CORE_RESET_RSP nci_opcode_pack(NCI_GID_CORE, 0x00)
218struct nci_core_reset_rsp {
219 __u8 status;
220 __u8 nci_ver;
221} __packed;
222
223#define NCI_OP_CORE_INIT_RSP nci_opcode_pack(NCI_GID_CORE, 0x01)
224struct nci_core_init_rsp_1 {
225 __u8 status;
226 __le32 nfcc_features;
227 __u8 num_supported_rf_interfaces;
228 __u8 supported_rf_interfaces[0]; /* variable size array */
229 /* continuted in nci_core_init_rsp_2 */
230} __packed;
231
232struct nci_core_init_rsp_2 {
233 __u8 max_logical_connections;
234 __le16 max_routing_table_size;
235 __u8 max_control_packet_payload_length;
236 __le16 rf_sending_buffer_size;
237 __le16 rf_receiving_buffer_size;
238 __le16 manufacturer_id;
239} __packed;
240
241#define NCI_OP_CORE_SET_CONFIG_RSP nci_opcode_pack(NCI_GID_CORE, 0x02)
242
243#define NCI_OP_CORE_CONN_CREATE_RSP nci_opcode_pack(NCI_GID_CORE, 0x04)
244struct nci_core_conn_create_rsp {
245 __u8 status;
246 __u8 max_pkt_payload_size;
247 __u8 initial_num_credits;
248 __u8 conn_id;
249} __packed;
250
251#define NCI_OP_CORE_CONN_CLOSE_RSP nci_opcode_pack(NCI_GID_CORE, 0x06)
252
253#define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
254
255#define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
256
257#define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
258
259/* --------------------------- */
260/* ---- NCI Notifications ---- */
261/* --------------------------- */
262#define NCI_OP_CORE_CONN_CREDITS_NTF nci_opcode_pack(NCI_GID_CORE, 0x07)
263struct conn_credit_entry {
264 __u8 conn_id;
265 __u8 credits;
266} __packed;
267
268struct nci_core_conn_credit_ntf {
269 __u8 num_entries;
270 struct conn_credit_entry conn_entries[NCI_MAX_NUM_CONN];
271} __packed;
272
273#define NCI_OP_RF_FIELD_INFO_NTF nci_opcode_pack(NCI_GID_CORE, 0x08)
274struct nci_rf_field_info_ntf {
275 __u8 rf_field_status;
276} __packed;
277
278#define NCI_OP_RF_ACTIVATE_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
279struct rf_tech_specific_params_nfca_poll {
280 __u16 sens_res;
281 __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */
282 __u8 nfcid1[10];
283 __u8 sel_res_len; /* 0 or 1 Bytes */
284 __u8 sel_res;
285} __packed;
286
287struct activation_params_nfca_poll_iso_dep {
288 __u8 rats_res_len;
289 __u8 rats_res[20];
290};
291
292struct nci_rf_activate_ntf {
293 __u8 target_handle;
294 __u8 rf_protocol;
295 __u8 rf_tech_and_mode;
296 __u8 rf_tech_specific_params_len;
297
298 union {
299 struct rf_tech_specific_params_nfca_poll nfca_poll;
300 } rf_tech_specific_params;
301
302 __u8 rf_interface_type;
303 __u8 activation_params_len;
304
305 union {
306 struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep;
307 } activation_params;
308
309} __packed;
310
311#define NCI_OP_RF_DEACTIVATE_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x06)
312
313#endif /* __NCI_H */
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
new file mode 100644
index 000000000000..b8b4bbd7e0fc
--- /dev/null
+++ b/include/net/nfc/nci_core.h
@@ -0,0 +1,184 @@
1/*
2 * The NFC Controller Interface is the communication protocol between an
3 * NFC Controller (NFCC) and a Device Host (DH).
4 *
5 * Copyright (C) 2011 Texas Instruments, Inc.
6 *
7 * Written by Ilan Elias <ilane@ti.com>
8 *
9 * Acknowledgements:
10 * This file is based on hci_core.h, which was written
11 * by Maxim Krasnyansky.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2
15 * as published by the Free Software Foundation
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28#ifndef __NCI_CORE_H
29#define __NCI_CORE_H
30
31#include <linux/interrupt.h>
32#include <linux/skbuff.h>
33
34#include <net/nfc/nfc.h>
35#include <net/nfc/nci.h>
36
37/* NCI device state */
38enum {
39 NCI_INIT,
40 NCI_UP,
41 NCI_DISCOVERY,
42 NCI_POLL_ACTIVE,
43 NCI_DATA_EXCHANGE,
44};
45
46/* NCI timeouts */
47#define NCI_RESET_TIMEOUT 5000
48#define NCI_INIT_TIMEOUT 5000
49#define NCI_RF_DISC_TIMEOUT 5000
50#define NCI_RF_DEACTIVATE_TIMEOUT 5000
51#define NCI_CMD_TIMEOUT 5000
52
53struct nci_dev;
54
55struct nci_ops {
56 int (*open)(struct nci_dev *ndev);
57 int (*close)(struct nci_dev *ndev);
58 int (*send)(struct sk_buff *skb);
59};
60
61#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
62
63/* NCI Core structures */
64struct nci_dev {
65 struct nfc_dev *nfc_dev;
66 struct nci_ops *ops;
67
68 int tx_headroom;
69 int tx_tailroom;
70
71 unsigned long flags;
72
73 atomic_t cmd_cnt;
74 atomic_t credits_cnt;
75
76 struct timer_list cmd_timer;
77
78 struct workqueue_struct *cmd_wq;
79 struct work_struct cmd_work;
80
81 struct workqueue_struct *rx_wq;
82 struct work_struct rx_work;
83
84 struct workqueue_struct *tx_wq;
85 struct work_struct tx_work;
86
87 struct sk_buff_head cmd_q;
88 struct sk_buff_head rx_q;
89 struct sk_buff_head tx_q;
90
91 struct mutex req_lock;
92 struct completion req_completion;
93 __u32 req_status;
94 __u32 req_result;
95
96 void *driver_data;
97
98 __u32 poll_prots;
99 __u32 target_available_prots;
100 __u32 target_active_prot;
101
102 /* received during NCI_OP_CORE_RESET_RSP */
103 __u8 nci_ver;
104
105 /* received during NCI_OP_CORE_INIT_RSP */
106 __u32 nfcc_features;
107 __u8 num_supported_rf_interfaces;
108 __u8 supported_rf_interfaces
109 [NCI_MAX_SUPPORTED_RF_INTERFACES];
110 __u8 max_logical_connections;
111 __u16 max_routing_table_size;
112 __u8 max_control_packet_payload_length;
113 __u16 rf_sending_buffer_size;
114 __u16 rf_receiving_buffer_size;
115 __u16 manufacturer_id;
116
117 /* received during NCI_OP_CORE_CONN_CREATE_RSP for static conn 0 */
118 __u8 max_pkt_payload_size;
119 __u8 initial_num_credits;
120 __u8 conn_id;
121
122 /* stored during nci_data_exchange */
123 data_exchange_cb_t data_exchange_cb;
124 void *data_exchange_cb_context;
125 struct sk_buff *rx_data_reassembly;
126};
127
128/* ----- NCI Devices ----- */
129struct nci_dev *nci_allocate_device(struct nci_ops *ops,
130 __u32 supported_protocols,
131 int tx_headroom,
132 int tx_tailroom);
133void nci_free_device(struct nci_dev *ndev);
134int nci_register_device(struct nci_dev *ndev);
135void nci_unregister_device(struct nci_dev *ndev);
136int nci_recv_frame(struct sk_buff *skb);
137
138static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev,
139 unsigned int len,
140 gfp_t how)
141{
142 struct sk_buff *skb;
143
144 skb = alloc_skb(len + ndev->tx_headroom + ndev->tx_tailroom, how);
145 if (skb)
146 skb_reserve(skb, ndev->tx_headroom);
147
148 return skb;
149}
150
151static inline void nci_set_parent_dev(struct nci_dev *ndev, struct device *dev)
152{
153 nfc_set_parent_dev(ndev->nfc_dev, dev);
154}
155
156static inline void nci_set_drvdata(struct nci_dev *ndev, void *data)
157{
158 ndev->driver_data = data;
159}
160
161static inline void *nci_get_drvdata(struct nci_dev *ndev)
162{
163 return ndev->driver_data;
164}
165
166void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb);
167void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb);
168void nci_rx_data_packet(struct nci_dev *ndev, struct sk_buff *skb);
169int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload);
170int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb);
171void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
172 int err);
173
174/* ----- NCI requests ----- */
175#define NCI_REQ_DONE 0
176#define NCI_REQ_PEND 1
177#define NCI_REQ_CANCELED 2
178
179void nci_req_complete(struct nci_dev *ndev, int result);
180
181/* ----- NCI status code ----- */
182int nci_to_errno(__u8 code);
183
184#endif /* __NCI_CORE_H */
diff --git a/include/net/nfc.h b/include/net/nfc/nfc.h
index cc0130312f70..6a7f602aa841 100644
--- a/include/net/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -48,6 +48,8 @@ typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb,
48 int err); 48 int err);
49 49
50struct nfc_ops { 50struct nfc_ops {
51 int (*dev_up)(struct nfc_dev *dev);
52 int (*dev_down)(struct nfc_dev *dev);
51 int (*start_poll)(struct nfc_dev *dev, u32 protocols); 53 int (*start_poll)(struct nfc_dev *dev, u32 protocols);
52 void (*stop_poll)(struct nfc_dev *dev); 54 void (*stop_poll)(struct nfc_dev *dev);
53 int (*activate_target)(struct nfc_dev *dev, u32 target_idx, 55 int (*activate_target)(struct nfc_dev *dev, u32 target_idx,
@@ -78,10 +80,15 @@ struct nfc_dev {
78 int targets_generation; 80 int targets_generation;
79 spinlock_t targets_lock; 81 spinlock_t targets_lock;
80 struct device dev; 82 struct device dev;
83 bool dev_up;
81 bool polling; 84 bool polling;
85 bool remote_activated;
82 struct nfc_genl_data genl_data; 86 struct nfc_genl_data genl_data;
83 u32 supported_protocols; 87 u32 supported_protocols;
84 88
89 int tx_headroom;
90 int tx_tailroom;
91
85 struct nfc_ops *ops; 92 struct nfc_ops *ops;
86}; 93};
87#define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) 94#define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev)
@@ -89,7 +96,9 @@ struct nfc_dev {
89extern struct class nfc_class; 96extern struct class nfc_class;
90 97
91struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, 98struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
92 u32 supported_protocols); 99 u32 supported_protocols,
100 int tx_headroom,
101 int tx_tailroom);
93 102
94/** 103/**
95 * nfc_free_device - free nfc device 104 * nfc_free_device - free nfc device
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index 356d6e3dc20a..eb7d3c2d4274 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -3,11 +3,19 @@
3/* 3/*
4 * regulatory support structures 4 * regulatory support structures
5 * 5 *
6 * Copyright 2008-2009 Luis R. Rodriguez <lrodriguez@atheros.com> 6 * Copyright 2008-2009 Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * Permission to use, copy, modify, and/or distribute this software for any
9 * it under the terms of the GNU General Public License version 2 as 9 * purpose with or without fee is hereby granted, provided that the above
10 * published by the Free Software Foundation. 10 * copyright notice and this permission notice appear in all copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
11 */ 19 */
12 20
13 21
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index 99e6e19b57c2..4c0766e201e3 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -96,7 +96,8 @@ extern int sysctl_max_syn_backlog;
96 */ 96 */
97struct listen_sock { 97struct listen_sock {
98 u8 max_qlen_log; 98 u8 max_qlen_log;
99 /* 3 bytes hole, try to use */ 99 u8 synflood_warned;
100 /* 2 bytes hole, try to use */
100 int qlen; 101 int qlen;
101 int qlen_young; 102 int qlen_young;
102 int clock_hand; 103 int clock_hand;
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 4fc88f3ccd5f..f6bb08b73ca4 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -4,7 +4,6 @@
4#include <linux/netdevice.h> 4#include <linux/netdevice.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/rcupdate.h> 6#include <linux/rcupdate.h>
7#include <linux/module.h>
8#include <linux/pkt_sched.h> 7#include <linux/pkt_sched.h>
9#include <linux/pkt_cls.h> 8#include <linux/pkt_cls.h>
10#include <net/gen_stats.h> 9#include <net/gen_stats.h>
@@ -46,14 +45,14 @@ struct qdisc_size_table {
46struct Qdisc { 45struct Qdisc {
47 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); 46 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev);
48 struct sk_buff * (*dequeue)(struct Qdisc *dev); 47 struct sk_buff * (*dequeue)(struct Qdisc *dev);
49 unsigned flags; 48 unsigned int flags;
50#define TCQ_F_BUILTIN 1 49#define TCQ_F_BUILTIN 1
51#define TCQ_F_INGRESS 2 50#define TCQ_F_INGRESS 2
52#define TCQ_F_CAN_BYPASS 4 51#define TCQ_F_CAN_BYPASS 4
53#define TCQ_F_MQROOT 8 52#define TCQ_F_MQROOT 8
54#define TCQ_F_WARN_NONWC (1 << 16) 53#define TCQ_F_WARN_NONWC (1 << 16)
55 int padded; 54 int padded;
56 struct Qdisc_ops *ops; 55 const struct Qdisc_ops *ops;
57 struct qdisc_size_table __rcu *stab; 56 struct qdisc_size_table __rcu *stab;
58 struct list_head list; 57 struct list_head list;
59 u32 handle; 58 u32 handle;
@@ -224,7 +223,7 @@ struct qdisc_skb_cb {
224 long data[]; 223 long data[];
225}; 224};
226 225
227static inline int qdisc_qlen(struct Qdisc *q) 226static inline int qdisc_qlen(const struct Qdisc *q)
228{ 227{
229 return q->q.qlen; 228 return q->q.qlen;
230} 229}
@@ -239,12 +238,12 @@ static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc)
239 return &qdisc->q.lock; 238 return &qdisc->q.lock;
240} 239}
241 240
242static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc) 241static inline struct Qdisc *qdisc_root(const struct Qdisc *qdisc)
243{ 242{
244 return qdisc->dev_queue->qdisc; 243 return qdisc->dev_queue->qdisc;
245} 244}
246 245
247static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc) 246static inline struct Qdisc *qdisc_root_sleeping(const struct Qdisc *qdisc)
248{ 247{
249 return qdisc->dev_queue->qdisc_sleeping; 248 return qdisc->dev_queue->qdisc_sleeping;
250} 249}
@@ -260,7 +259,7 @@ static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc)
260 * root. This is enforced by holding the RTNL semaphore, which 259 * root. This is enforced by holding the RTNL semaphore, which
261 * all users of this lock accessor must do. 260 * all users of this lock accessor must do.
262 */ 261 */
263static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) 262static inline spinlock_t *qdisc_root_lock(const struct Qdisc *qdisc)
264{ 263{
265 struct Qdisc *root = qdisc_root(qdisc); 264 struct Qdisc *root = qdisc_root(qdisc);
266 265
@@ -268,7 +267,7 @@ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc)
268 return qdisc_lock(root); 267 return qdisc_lock(root);
269} 268}
270 269
271static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc) 270static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc)
272{ 271{
273 struct Qdisc *root = qdisc_root_sleeping(qdisc); 272 struct Qdisc *root = qdisc_root_sleeping(qdisc);
274 273
@@ -276,17 +275,17 @@ static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc)
276 return qdisc_lock(root); 275 return qdisc_lock(root);
277} 276}
278 277
279static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) 278static inline struct net_device *qdisc_dev(const struct Qdisc *qdisc)
280{ 279{
281 return qdisc->dev_queue->dev; 280 return qdisc->dev_queue->dev;
282} 281}
283 282
284static inline void sch_tree_lock(struct Qdisc *q) 283static inline void sch_tree_lock(const struct Qdisc *q)
285{ 284{
286 spin_lock_bh(qdisc_root_sleeping_lock(q)); 285 spin_lock_bh(qdisc_root_sleeping_lock(q));
287} 286}
288 287
289static inline void sch_tree_unlock(struct Qdisc *q) 288static inline void sch_tree_unlock(const struct Qdisc *q)
290{ 289{
291 spin_unlock_bh(qdisc_root_sleeping_lock(q)); 290 spin_unlock_bh(qdisc_root_sleeping_lock(q));
292} 291}
@@ -319,7 +318,7 @@ static inline unsigned int qdisc_class_hash(u32 id, u32 mask)
319} 318}
320 319
321static inline struct Qdisc_class_common * 320static inline struct Qdisc_class_common *
322qdisc_class_find(struct Qdisc_class_hash *hash, u32 id) 321qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
323{ 322{
324 struct Qdisc_class_common *cl; 323 struct Qdisc_class_common *cl;
325 struct hlist_node *n; 324 struct hlist_node *n;
@@ -393,7 +392,7 @@ static inline bool qdisc_all_tx_empty(const struct net_device *dev)
393} 392}
394 393
395/* Are any of the TX qdiscs changing? */ 394/* Are any of the TX qdiscs changing? */
396static inline bool qdisc_tx_changing(struct net_device *dev) 395static inline bool qdisc_tx_changing(const struct net_device *dev)
397{ 396{
398 unsigned int i; 397 unsigned int i;
399 for (i = 0; i < dev->num_tx_queues; i++) { 398 for (i = 0; i < dev->num_tx_queues; i++) {
diff --git a/include/net/scm.h b/include/net/scm.h
index 745460fa2f02..d456f4c71a32 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -49,7 +49,7 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm,
49 struct pid *pid, const struct cred *cred) 49 struct pid *pid, const struct cred *cred)
50{ 50{
51 scm->pid = get_pid(pid); 51 scm->pid = get_pid(pid);
52 scm->cred = get_cred(cred); 52 scm->cred = cred ? get_cred(cred) : NULL;
53 cred_to_ucred(pid, cred, &scm->creds); 53 cred_to_ucred(pid, cred, &scm->creds);
54} 54}
55 55
@@ -73,8 +73,7 @@ static __inline__ void scm_destroy(struct scm_cookie *scm)
73static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, 73static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
74 struct scm_cookie *scm) 74 struct scm_cookie *scm)
75{ 75{
76 scm_set_cred(scm, task_tgid(current), current_cred()); 76 memset(scm, 0, sizeof(*scm));
77 scm->fp = NULL;
78 unix_get_peersec_dgram(sock, scm); 77 unix_get_peersec_dgram(sock, scm);
79 if (msg->msg_controllen <= 0) 78 if (msg->msg_controllen <= 0)
80 return 0; 79 return 0;
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 6506458ccd33..712b3bebeda7 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -109,6 +109,7 @@ typedef enum {
109 SCTP_CMD_SEND_MSG, /* Send the whole use message */ 109 SCTP_CMD_SEND_MSG, /* Send the whole use message */
110 SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */ 110 SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */
111 SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/ 111 SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/
112 SCTP_CMD_SET_ASOC, /* Restore association context */
112 SCTP_CMD_LAST 113 SCTP_CMD_LAST
113} sctp_verb_t; 114} sctp_verb_t;
114 115
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index f7d9c3fc06fd..e90e7a9935dd 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1915,6 +1915,7 @@ struct sctp_association {
1915 __u32 addip_serial; 1915 __u32 addip_serial;
1916 union sctp_addr *asconf_addr_del_pending; 1916 union sctp_addr *asconf_addr_del_pending;
1917 int src_out_of_asoc_ok; 1917 int src_out_of_asoc_ok;
1918 struct sctp_transport *new_transport;
1918 1919
1919 /* SCTP AUTH: list of the endpoint shared keys. These 1920 /* SCTP AUTH: list of the endpoint shared keys. These
1920 * keys are provided out of band by the user applicaton 1921 * keys are provided out of band by the user applicaton
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h
index d97f6892c019..c2e542b27a5a 100644
--- a/include/net/secure_seq.h
+++ b/include/net/secure_seq.h
@@ -10,7 +10,7 @@ extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
10 __be16 dport); 10 __be16 dport);
11extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, 11extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
12 __be16 sport, __be16 dport); 12 __be16 sport, __be16 dport);
13extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, 13extern __u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr,
14 __be16 sport, __be16 dport); 14 __be16 sport, __be16 dport);
15extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, 15extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
16 __be16 sport, __be16 dport); 16 __be16 sport, __be16 dport);
diff --git a/include/net/sock.h b/include/net/sock.h
index 8e4062f165b8..abb6e0f0c3c3 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -46,7 +46,6 @@
46#include <linux/list_nulls.h> 46#include <linux/list_nulls.h>
47#include <linux/timer.h> 47#include <linux/timer.h>
48#include <linux/cache.h> 48#include <linux/cache.h>
49#include <linux/module.h>
50#include <linux/lockdep.h> 49#include <linux/lockdep.h>
51#include <linux/netdevice.h> 50#include <linux/netdevice.h>
52#include <linux/skbuff.h> /* struct sk_buff */ 51#include <linux/skbuff.h> /* struct sk_buff */
@@ -76,8 +75,8 @@
76 printk(KERN_DEBUG msg); } while (0) 75 printk(KERN_DEBUG msg); } while (0)
77#else 76#else
78/* Validate arguments and do nothing */ 77/* Validate arguments and do nothing */
79static inline void __attribute__ ((format (printf, 2, 3))) 78static inline __printf(2, 3)
80SOCK_DEBUG(struct sock *sk, const char *msg, ...) 79void SOCK_DEBUG(struct sock *sk, const char *msg, ...)
81{ 80{
82} 81}
83#endif 82#endif
@@ -686,16 +685,25 @@ static inline void sock_rps_reset_flow(const struct sock *sk)
686#endif 685#endif
687} 686}
688 687
689static inline void sock_rps_save_rxhash(struct sock *sk, u32 rxhash) 688static inline void sock_rps_save_rxhash(struct sock *sk,
689 const struct sk_buff *skb)
690{ 690{
691#ifdef CONFIG_RPS 691#ifdef CONFIG_RPS
692 if (unlikely(sk->sk_rxhash != rxhash)) { 692 if (unlikely(sk->sk_rxhash != skb->rxhash)) {
693 sock_rps_reset_flow(sk); 693 sock_rps_reset_flow(sk);
694 sk->sk_rxhash = rxhash; 694 sk->sk_rxhash = skb->rxhash;
695 } 695 }
696#endif 696#endif
697} 697}
698 698
699static inline void sock_rps_reset_rxhash(struct sock *sk)
700{
701#ifdef CONFIG_RPS
702 sock_rps_reset_flow(sk);
703 sk->sk_rxhash = 0;
704#endif
705}
706
699#define sk_wait_event(__sk, __timeo, __condition) \ 707#define sk_wait_event(__sk, __timeo, __condition) \
700 ({ int __rc; \ 708 ({ int __rc; \
701 release_sock(__sk); \ 709 release_sock(__sk); \
@@ -720,6 +728,7 @@ struct request_sock_ops;
720struct timewait_sock_ops; 728struct timewait_sock_ops;
721struct inet_hashinfo; 729struct inet_hashinfo;
722struct raw_hashinfo; 730struct raw_hashinfo;
731struct module;
723 732
724/* Networking protocol blocks we attach to sockets. 733/* Networking protocol blocks we attach to sockets.
725 * socket layer -> transport layer interface 734 * socket layer -> transport layer interface
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 149a415d1e0a..bb18c4d69aba 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -18,7 +18,6 @@
18#ifndef _TCP_H 18#ifndef _TCP_H
19#define _TCP_H 19#define _TCP_H
20 20
21#define TCP_DEBUG 1
22#define FASTRETRANS_DEBUG 1 21#define FASTRETRANS_DEBUG 1
23 22
24#include <linux/list.h> 23#include <linux/list.h>
@@ -327,9 +326,9 @@ extern int tcp_sendpage(struct sock *sk, struct page *page, int offset,
327 size_t size, int flags); 326 size_t size, int flags);
328extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); 327extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
329extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, 328extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
330 struct tcphdr *th, unsigned len); 329 const struct tcphdr *th, unsigned int len);
331extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, 330extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
332 struct tcphdr *th, unsigned len); 331 const struct tcphdr *th, unsigned int len);
333extern void tcp_rcv_space_adjust(struct sock *sk); 332extern void tcp_rcv_space_adjust(struct sock *sk);
334extern void tcp_cleanup_rbuf(struct sock *sk, int copied); 333extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
335extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); 334extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
@@ -356,6 +355,7 @@ static inline void tcp_dec_quickack_mode(struct sock *sk,
356#define TCP_ECN_OK 1 355#define TCP_ECN_OK 1
357#define TCP_ECN_QUEUE_CWR 2 356#define TCP_ECN_QUEUE_CWR 2
358#define TCP_ECN_DEMAND_CWR 4 357#define TCP_ECN_DEMAND_CWR 4
358#define TCP_ECN_SEEN 8
359 359
360static __inline__ void 360static __inline__ void
361TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) 361TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th)
@@ -400,10 +400,10 @@ extern void tcp_set_keepalive(struct sock *sk, int val);
400extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req); 400extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req);
401extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 401extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
402 size_t len, int nonblock, int flags, int *addr_len); 402 size_t len, int nonblock, int flags, int *addr_len);
403extern void tcp_parse_options(struct sk_buff *skb, 403extern void tcp_parse_options(const struct sk_buff *skb,
404 struct tcp_options_received *opt_rx, u8 **hvpp, 404 struct tcp_options_received *opt_rx, const u8 **hvpp,
405 int estab); 405 int estab);
406extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); 406extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th);
407 407
408/* 408/*
409 * TCP v4 functions exported for the inet6 API 409 * TCP v4 functions exported for the inet6 API
@@ -431,17 +431,34 @@ extern int tcp_disconnect(struct sock *sk, int flags);
431extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; 431extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
432extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 432extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
433 struct ip_options *opt); 433 struct ip_options *opt);
434#ifdef CONFIG_SYN_COOKIES
434extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 435extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
435 __u16 *mss); 436 __u16 *mss);
437#else
438static inline __u32 cookie_v4_init_sequence(struct sock *sk,
439 struct sk_buff *skb,
440 __u16 *mss)
441{
442 return 0;
443}
444#endif
436 445
437extern __u32 cookie_init_timestamp(struct request_sock *req); 446extern __u32 cookie_init_timestamp(struct request_sock *req);
438extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); 447extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *);
439 448
440/* From net/ipv6/syncookies.c */ 449/* From net/ipv6/syncookies.c */
441extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); 450extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
442extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb, 451#ifdef CONFIG_SYN_COOKIES
452extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb,
443 __u16 *mss); 453 __u16 *mss);
444 454#else
455static inline __u32 cookie_v6_init_sequence(struct sock *sk,
456 struct sk_buff *skb,
457 __u16 *mss)
458{
459 return 0;
460}
461#endif
445/* tcp_output.c */ 462/* tcp_output.c */
446 463
447extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, 464extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
@@ -460,6 +477,9 @@ extern int tcp_write_wakeup(struct sock *);
460extern void tcp_send_fin(struct sock *sk); 477extern void tcp_send_fin(struct sock *sk);
461extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); 478extern void tcp_send_active_reset(struct sock *sk, gfp_t priority);
462extern int tcp_send_synack(struct sock *); 479extern int tcp_send_synack(struct sock *);
480extern int tcp_syn_flood_action(struct sock *sk,
481 const struct sk_buff *skb,
482 const char *proto);
463extern void tcp_push_one(struct sock *, unsigned int mss_now); 483extern void tcp_push_one(struct sock *, unsigned int mss_now);
464extern void tcp_send_ack(struct sock *sk); 484extern void tcp_send_ack(struct sock *sk);
465extern void tcp_send_delayed_ack(struct sock *sk); 485extern void tcp_send_delayed_ack(struct sock *sk);
@@ -501,7 +521,7 @@ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
501} 521}
502 522
503/* tcp.c */ 523/* tcp.c */
504extern void tcp_get_info(struct sock *, struct tcp_info *); 524extern void tcp_get_info(const struct sock *, struct tcp_info *);
505 525
506/* Read 'sendfile()'-style from a TCP socket */ 526/* Read 'sendfile()'-style from a TCP socket */
507typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, 527typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *,
@@ -511,8 +531,8 @@ extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
511 531
512extern void tcp_initialize_rcv_mss(struct sock *sk); 532extern void tcp_initialize_rcv_mss(struct sock *sk);
513 533
514extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); 534extern int tcp_mtu_to_mss(const struct sock *sk, int pmtu);
515extern int tcp_mss_to_mtu(struct sock *sk, int mss); 535extern int tcp_mss_to_mtu(const struct sock *sk, int mss);
516extern void tcp_mtup_init(struct sock *sk); 536extern void tcp_mtup_init(struct sock *sk);
517extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); 537extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt);
518 538
@@ -553,7 +573,7 @@ static inline void tcp_fast_path_check(struct sock *sk)
553/* Compute the actual rto_min value */ 573/* Compute the actual rto_min value */
554static inline u32 tcp_rto_min(struct sock *sk) 574static inline u32 tcp_rto_min(struct sock *sk)
555{ 575{
556 struct dst_entry *dst = __sk_dst_get(sk); 576 const struct dst_entry *dst = __sk_dst_get(sk);
557 u32 rto_min = TCP_RTO_MIN; 577 u32 rto_min = TCP_RTO_MIN;
558 578
559 if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) 579 if (dst && dst_metric_locked(dst, RTAX_RTO_MIN))
@@ -615,13 +635,14 @@ struct tcp_skb_cb {
615 __u32 seq; /* Starting sequence number */ 635 __u32 seq; /* Starting sequence number */
616 __u32 end_seq; /* SEQ + FIN + SYN + datalen */ 636 __u32 end_seq; /* SEQ + FIN + SYN + datalen */
617 __u32 when; /* used to compute rtt's */ 637 __u32 when; /* used to compute rtt's */
618 __u8 flags; /* TCP header flags. */ 638 __u8 tcp_flags; /* TCP header flags. (tcp[13]) */
619 __u8 sacked; /* State flags for SACK/FACK. */ 639 __u8 sacked; /* State flags for SACK/FACK. */
620#define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */ 640#define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */
621#define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ 641#define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */
622#define TCPCB_LOST 0x04 /* SKB is lost */ 642#define TCPCB_LOST 0x04 /* SKB is lost */
623#define TCPCB_TAGBITS 0x07 /* All tag bits */ 643#define TCPCB_TAGBITS 0x07 /* All tag bits */
624 644 __u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */
645 /* 1 byte hole */
625#define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ 646#define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */
626#define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) 647#define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS)
627 648
@@ -798,6 +819,7 @@ static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp)
798static inline __u32 tcp_current_ssthresh(const struct sock *sk) 819static inline __u32 tcp_current_ssthresh(const struct sock *sk)
799{ 820{
800 const struct tcp_sock *tp = tcp_sk(sk); 821 const struct tcp_sock *tp = tcp_sk(sk);
822
801 if ((1 << inet_csk(sk)->icsk_ca_state) & (TCPF_CA_CWR | TCPF_CA_Recovery)) 823 if ((1 << inet_csk(sk)->icsk_ca_state) & (TCPF_CA_CWR | TCPF_CA_Recovery))
802 return tp->snd_ssthresh; 824 return tp->snd_ssthresh;
803 else 825 else
@@ -810,7 +832,7 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk)
810#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) 832#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out)
811 833
812extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); 834extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
813extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); 835extern __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst);
814 836
815/* Slow start with delack produces 3 packets of burst, so that 837/* Slow start with delack produces 3 packets of burst, so that
816 * it is safe "de facto". This will be the default - same as 838 * it is safe "de facto". This will be the default - same as
@@ -839,7 +861,7 @@ static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss,
839 861
840static inline void tcp_check_probe_timer(struct sock *sk) 862static inline void tcp_check_probe_timer(struct sock *sk)
841{ 863{
842 struct tcp_sock *tp = tcp_sk(sk); 864 const struct tcp_sock *tp = tcp_sk(sk);
843 const struct inet_connection_sock *icsk = inet_csk(sk); 865 const struct inet_connection_sock *icsk = inet_csk(sk);
844 866
845 if (!tp->packets_out && !icsk->icsk_pending) 867 if (!tp->packets_out && !icsk->icsk_pending)
@@ -1162,8 +1184,9 @@ struct tcp_md5sig_pool {
1162 1184
1163/* - functions */ 1185/* - functions */
1164extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, 1186extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key,
1165 struct sock *sk, struct request_sock *req, 1187 const struct sock *sk,
1166 struct sk_buff *skb); 1188 const struct request_sock *req,
1189 const struct sk_buff *skb);
1167extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk, 1190extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk,
1168 struct sock *addr_sk); 1191 struct sock *addr_sk);
1169extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey, 1192extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey,
@@ -1180,17 +1203,17 @@ extern int tcp_v4_md5_do_del(struct sock *sk, __be32 addr);
1180#define tcp_twsk_md5_key(twsk) NULL 1203#define tcp_twsk_md5_key(twsk) NULL
1181#endif 1204#endif
1182 1205
1183extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); 1206extern struct tcp_md5sig_pool __percpu *tcp_alloc_md5sig_pool(struct sock *);
1184extern void tcp_free_md5sig_pool(void); 1207extern void tcp_free_md5sig_pool(void);
1185 1208
1186extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); 1209extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void);
1187extern void tcp_put_md5sig_pool(void); 1210extern void tcp_put_md5sig_pool(void);
1188 1211
1189extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); 1212extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *);
1190extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, 1213extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *,
1191 unsigned header_len); 1214 unsigned header_len);
1192extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, 1215extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp,
1193 struct tcp_md5sig_key *key); 1216 const struct tcp_md5sig_key *key);
1194 1217
1195/* write queue abstraction */ 1218/* write queue abstraction */
1196static inline void tcp_write_queue_purge(struct sock *sk) 1219static inline void tcp_write_queue_purge(struct sock *sk)
@@ -1203,22 +1226,24 @@ static inline void tcp_write_queue_purge(struct sock *sk)
1203 tcp_clear_all_retrans_hints(tcp_sk(sk)); 1226 tcp_clear_all_retrans_hints(tcp_sk(sk));
1204} 1227}
1205 1228
1206static inline struct sk_buff *tcp_write_queue_head(struct sock *sk) 1229static inline struct sk_buff *tcp_write_queue_head(const struct sock *sk)
1207{ 1230{
1208 return skb_peek(&sk->sk_write_queue); 1231 return skb_peek(&sk->sk_write_queue);
1209} 1232}
1210 1233
1211static inline struct sk_buff *tcp_write_queue_tail(struct sock *sk) 1234static inline struct sk_buff *tcp_write_queue_tail(const struct sock *sk)
1212{ 1235{
1213 return skb_peek_tail(&sk->sk_write_queue); 1236 return skb_peek_tail(&sk->sk_write_queue);
1214} 1237}
1215 1238
1216static inline struct sk_buff *tcp_write_queue_next(struct sock *sk, struct sk_buff *skb) 1239static inline struct sk_buff *tcp_write_queue_next(const struct sock *sk,
1240 const struct sk_buff *skb)
1217{ 1241{
1218 return skb_queue_next(&sk->sk_write_queue, skb); 1242 return skb_queue_next(&sk->sk_write_queue, skb);
1219} 1243}
1220 1244
1221static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_buff *skb) 1245static inline struct sk_buff *tcp_write_queue_prev(const struct sock *sk,
1246 const struct sk_buff *skb)
1222{ 1247{
1223 return skb_queue_prev(&sk->sk_write_queue, skb); 1248 return skb_queue_prev(&sk->sk_write_queue, skb);
1224} 1249}
@@ -1232,7 +1257,7 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu
1232#define tcp_for_write_queue_from_safe(skb, tmp, sk) \ 1257#define tcp_for_write_queue_from_safe(skb, tmp, sk) \
1233 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) 1258 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp)
1234 1259
1235static inline struct sk_buff *tcp_send_head(struct sock *sk) 1260static inline struct sk_buff *tcp_send_head(const struct sock *sk)
1236{ 1261{
1237 return sk->sk_send_head; 1262 return sk->sk_send_head;
1238} 1263}
@@ -1243,7 +1268,7 @@ static inline bool tcp_skb_is_last(const struct sock *sk,
1243 return skb_queue_is_last(&sk->sk_write_queue, skb); 1268 return skb_queue_is_last(&sk->sk_write_queue, skb);
1244} 1269}
1245 1270
1246static inline void tcp_advance_send_head(struct sock *sk, struct sk_buff *skb) 1271static inline void tcp_advance_send_head(struct sock *sk, const struct sk_buff *skb)
1247{ 1272{
1248 if (tcp_skb_is_last(sk, skb)) 1273 if (tcp_skb_is_last(sk, skb))
1249 sk->sk_send_head = NULL; 1274 sk->sk_send_head = NULL;
@@ -1378,11 +1403,13 @@ enum tcp_seq_states {
1378 TCP_SEQ_STATE_TIME_WAIT, 1403 TCP_SEQ_STATE_TIME_WAIT,
1379}; 1404};
1380 1405
1406int tcp_seq_open(struct inode *inode, struct file *file);
1407
1381struct tcp_seq_afinfo { 1408struct tcp_seq_afinfo {
1382 char *name; 1409 char *name;
1383 sa_family_t family; 1410 sa_family_t family;
1384 struct file_operations seq_fops; 1411 const struct file_operations *seq_fops;
1385 struct seq_operations seq_ops; 1412 struct seq_operations seq_ops;
1386}; 1413};
1387 1414
1388struct tcp_iter_state { 1415struct tcp_iter_state {
@@ -1423,9 +1450,9 @@ struct tcp_sock_af_ops {
1423 struct sock *addr_sk); 1450 struct sock *addr_sk);
1424 int (*calc_md5_hash) (char *location, 1451 int (*calc_md5_hash) (char *location,
1425 struct tcp_md5sig_key *md5, 1452 struct tcp_md5sig_key *md5,
1426 struct sock *sk, 1453 const struct sock *sk,
1427 struct request_sock *req, 1454 const struct request_sock *req,
1428 struct sk_buff *skb); 1455 const struct sk_buff *skb);
1429 int (*md5_add) (struct sock *sk, 1456 int (*md5_add) (struct sock *sk,
1430 struct sock *addr_sk, 1457 struct sock *addr_sk,
1431 u8 *newkey, 1458 u8 *newkey,
@@ -1442,9 +1469,9 @@ struct tcp_request_sock_ops {
1442 struct request_sock *req); 1469 struct request_sock *req);
1443 int (*calc_md5_hash) (char *location, 1470 int (*calc_md5_hash) (char *location,
1444 struct tcp_md5sig_key *md5, 1471 struct tcp_md5sig_key *md5,
1445 struct sock *sk, 1472 const struct sock *sk,
1446 struct request_sock *req, 1473 const struct request_sock *req,
1447 struct sk_buff *skb); 1474 const struct sk_buff *skb);
1448#endif 1475#endif
1449}; 1476};
1450 1477
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 5271a741c3a3..498433dd067d 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -39,6 +39,7 @@ extern int datagram_recv_ctl(struct sock *sk,
39 struct sk_buff *skb); 39 struct sk_buff *skb);
40 40
41extern int datagram_send_ctl(struct net *net, 41extern int datagram_send_ctl(struct net *net,
42 struct sock *sk,
42 struct msghdr *msg, 43 struct msghdr *msg,
43 struct flowi6 *fl6, 44 struct flowi6 *fl6,
44 struct ipv6_txoptions *opt, 45 struct ipv6_txoptions *opt,
diff --git a/include/net/udp.h b/include/net/udp.h
index 67ea6fcb3ec0..3b285f402f48 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -230,12 +230,14 @@ extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *sadd
230#endif 230#endif
231 231
232/* /proc */ 232/* /proc */
233int udp_seq_open(struct inode *inode, struct file *file);
234
233struct udp_seq_afinfo { 235struct udp_seq_afinfo {
234 char *name; 236 char *name;
235 sa_family_t family; 237 sa_family_t family;
236 struct udp_table *udp_table; 238 struct udp_table *udp_table;
237 struct file_operations seq_fops; 239 const struct file_operations *seq_fops;
238 struct seq_operations seq_ops; 240 struct seq_operations seq_ops;
239}; 241};
240 242
241struct udp_iter_state { 243struct udp_iter_state {
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 673a024c6b2a..5f097ca7d5c5 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -66,40 +66,34 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
66 return 0; 66 return 0;
67} 67}
68 68
69static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) 69/* Slow-path computation of checksum. Socket is locked. */
70static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
70{ 71{
72 const struct udp_sock *up = udp_sk(skb->sk);
71 int cscov = up->len; 73 int cscov = up->len;
74 __wsum csum = 0;
72 75
73 /* 76 if (up->pcflag & UDPLITE_SEND_CC) {
74 * Sender has set `partial coverage' option on UDP-Lite socket 77 /*
75 */ 78 * Sender has set `partial coverage' option on UDP-Lite socket.
76 if (up->pcflag & UDPLITE_SEND_CC) { 79 * The special case "up->pcslen == 0" signifies full coverage.
80 */
77 if (up->pcslen < up->len) { 81 if (up->pcslen < up->len) {
78 /* up->pcslen == 0 means that full coverage is required, 82 if (0 < up->pcslen)
79 * partial coverage only if 0 < up->pcslen < up->len */ 83 cscov = up->pcslen;
80 if (0 < up->pcslen) { 84 udp_hdr(skb)->len = htons(up->pcslen);
81 cscov = up->pcslen;
82 }
83 uh->len = htons(up->pcslen);
84 } 85 }
85 /* 86 /*
86 * NOTE: Causes for the error case `up->pcslen > up->len': 87 * NOTE: Causes for the error case `up->pcslen > up->len':
87 * (i) Application error (will not be penalized). 88 * (i) Application error (will not be penalized).
88 * (ii) Payload too big for send buffer: data is split 89 * (ii) Payload too big for send buffer: data is split
89 * into several packets, each with its own header. 90 * into several packets, each with its own header.
90 * In this case (e.g. last segment), coverage may 91 * In this case (e.g. last segment), coverage may
91 * exceed packet length. 92 * exceed packet length.
92 * Since packets with coverage length > packet length are 93 * Since packets with coverage length > packet length are
93 * illegal, we fall back to the defaults here. 94 * illegal, we fall back to the defaults here.
94 */ 95 */
95 } 96 }
96 return cscov;
97}
98
99static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
100{
101 int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
102 __wsum csum = 0;
103 97
104 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ 98 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
105 99
@@ -115,16 +109,21 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
115 return csum; 109 return csum;
116} 110}
117 111
112/* Fast-path computation of checksum. Socket may not be locked. */
118static inline __wsum udplite_csum(struct sk_buff *skb) 113static inline __wsum udplite_csum(struct sk_buff *skb)
119{ 114{
120 struct sock *sk = skb->sk; 115 const struct udp_sock *up = udp_sk(skb->sk);
121 int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
122 const int off = skb_transport_offset(skb); 116 const int off = skb_transport_offset(skb);
123 const int len = skb->len - off; 117 int len = skb->len - off;
124 118
119 if ((up->pcflag & UDPLITE_SEND_CC) && up->pcslen < len) {
120 if (0 < up->pcslen)
121 len = up->pcslen;
122 udp_hdr(skb)->len = htons(up->pcslen);
123 }
125 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ 124 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
126 125
127 return skb_checksum(skb, off, min(cscov, len), 0); 126 return skb_checksum(skb, off, len, 0);
128} 127}
129 128
130extern void udplite4_register(void); 129extern void udplite4_register(void);
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index ae8c68f30f1b..639a4491fc0d 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -218,8 +218,12 @@ static inline int iboe_get_rate(struct net_device *dev)
218{ 218{
219 struct ethtool_cmd cmd; 219 struct ethtool_cmd cmd;
220 u32 speed; 220 u32 speed;
221 int err;
221 222
222 if (dev_ethtool_get_settings(dev, &cmd)) 223 rtnl_lock();
224 err = __ethtool_get_settings(dev, &cmd);
225 rtnl_unlock();
226 if (err)
223 return IB_RATE_PORT_CURRENT; 227 return IB_RATE_PORT_CURRENT;
224 228
225 speed = ethtool_cmd_speed(&cmd); 229 speed = ethtool_cmd_speed(&cmd);
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h
index fe5b05177a2c..81aba3a73aa3 100644
--- a/include/rdma/ib_user_verbs.h
+++ b/include/rdma/ib_user_verbs.h
@@ -81,7 +81,11 @@ enum {
81 IB_USER_VERBS_CMD_MODIFY_SRQ, 81 IB_USER_VERBS_CMD_MODIFY_SRQ,
82 IB_USER_VERBS_CMD_QUERY_SRQ, 82 IB_USER_VERBS_CMD_QUERY_SRQ,
83 IB_USER_VERBS_CMD_DESTROY_SRQ, 83 IB_USER_VERBS_CMD_DESTROY_SRQ,
84 IB_USER_VERBS_CMD_POST_SRQ_RECV 84 IB_USER_VERBS_CMD_POST_SRQ_RECV,
85 IB_USER_VERBS_CMD_OPEN_XRCD,
86 IB_USER_VERBS_CMD_CLOSE_XRCD,
87 IB_USER_VERBS_CMD_CREATE_XSRQ,
88 IB_USER_VERBS_CMD_OPEN_QP
85}; 89};
86 90
87/* 91/*
@@ -222,6 +226,21 @@ struct ib_uverbs_dealloc_pd {
222 __u32 pd_handle; 226 __u32 pd_handle;
223}; 227};
224 228
229struct ib_uverbs_open_xrcd {
230 __u64 response;
231 __u32 fd;
232 __u32 oflags;
233 __u64 driver_data[0];
234};
235
236struct ib_uverbs_open_xrcd_resp {
237 __u32 xrcd_handle;
238};
239
240struct ib_uverbs_close_xrcd {
241 __u32 xrcd_handle;
242};
243
225struct ib_uverbs_reg_mr { 244struct ib_uverbs_reg_mr {
226 __u64 response; 245 __u64 response;
227 __u64 start; 246 __u64 start;
@@ -404,6 +423,17 @@ struct ib_uverbs_create_qp {
404 __u64 driver_data[0]; 423 __u64 driver_data[0];
405}; 424};
406 425
426struct ib_uverbs_open_qp {
427 __u64 response;
428 __u64 user_handle;
429 __u32 pd_handle;
430 __u32 qpn;
431 __u8 qp_type;
432 __u8 reserved[7];
433 __u64 driver_data[0];
434};
435
436/* also used for open response */
407struct ib_uverbs_create_qp_resp { 437struct ib_uverbs_create_qp_resp {
408 __u32 qp_handle; 438 __u32 qp_handle;
409 __u32 qpn; 439 __u32 qpn;
@@ -648,11 +678,25 @@ struct ib_uverbs_create_srq {
648 __u64 driver_data[0]; 678 __u64 driver_data[0];
649}; 679};
650 680
681struct ib_uverbs_create_xsrq {
682 __u64 response;
683 __u64 user_handle;
684 __u32 srq_type;
685 __u32 pd_handle;
686 __u32 max_wr;
687 __u32 max_sge;
688 __u32 srq_limit;
689 __u32 reserved;
690 __u32 xrcd_handle;
691 __u32 cq_handle;
692 __u64 driver_data[0];
693};
694
651struct ib_uverbs_create_srq_resp { 695struct ib_uverbs_create_srq_resp {
652 __u32 srq_handle; 696 __u32 srq_handle;
653 __u32 max_wr; 697 __u32 max_wr;
654 __u32 max_sge; 698 __u32 max_sge;
655 __u32 reserved; 699 __u32 srqn;
656}; 700};
657 701
658struct ib_uverbs_modify_srq { 702struct ib_uverbs_modify_srq {
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 228be3e220d9..bf5daafe8ecc 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -112,6 +112,7 @@ enum ib_device_cap_flags {
112 */ 112 */
113 IB_DEVICE_UD_IP_CSUM = (1<<18), 113 IB_DEVICE_UD_IP_CSUM = (1<<18),
114 IB_DEVICE_UD_TSO = (1<<19), 114 IB_DEVICE_UD_TSO = (1<<19),
115 IB_DEVICE_XRC = (1<<20),
115 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), 116 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21),
116 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), 117 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22),
117}; 118};
@@ -207,6 +208,7 @@ enum ib_port_cap_flags {
207 IB_PORT_SM_DISABLED = 1 << 10, 208 IB_PORT_SM_DISABLED = 1 << 10,
208 IB_PORT_SYS_IMAGE_GUID_SUP = 1 << 11, 209 IB_PORT_SYS_IMAGE_GUID_SUP = 1 << 11,
209 IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12, 210 IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12,
211 IB_PORT_EXTENDED_SPEEDS_SUP = 1 << 14,
210 IB_PORT_CM_SUP = 1 << 16, 212 IB_PORT_CM_SUP = 1 << 16,
211 IB_PORT_SNMP_TUNNEL_SUP = 1 << 17, 213 IB_PORT_SNMP_TUNNEL_SUP = 1 << 17,
212 IB_PORT_REINIT_SUP = 1 << 18, 214 IB_PORT_REINIT_SUP = 1 << 18,
@@ -415,7 +417,15 @@ enum ib_rate {
415 IB_RATE_40_GBPS = 7, 417 IB_RATE_40_GBPS = 7,
416 IB_RATE_60_GBPS = 8, 418 IB_RATE_60_GBPS = 8,
417 IB_RATE_80_GBPS = 9, 419 IB_RATE_80_GBPS = 9,
418 IB_RATE_120_GBPS = 10 420 IB_RATE_120_GBPS = 10,
421 IB_RATE_14_GBPS = 11,
422 IB_RATE_56_GBPS = 12,
423 IB_RATE_112_GBPS = 13,
424 IB_RATE_168_GBPS = 14,
425 IB_RATE_25_GBPS = 15,
426 IB_RATE_100_GBPS = 16,
427 IB_RATE_200_GBPS = 17,
428 IB_RATE_300_GBPS = 18
419}; 429};
420 430
421/** 431/**
@@ -427,6 +437,13 @@ enum ib_rate {
427int ib_rate_to_mult(enum ib_rate rate) __attribute_const__; 437int ib_rate_to_mult(enum ib_rate rate) __attribute_const__;
428 438
429/** 439/**
440 * ib_rate_to_mbps - Convert the IB rate enum to Mbps.
441 * For example, IB_RATE_2_5_GBPS will be converted to 2500.
442 * @rate: rate to convert.
443 */
444int ib_rate_to_mbps(enum ib_rate rate) __attribute_const__;
445
446/**
430 * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate 447 * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate
431 * enum. 448 * enum.
432 * @mult: multiple to convert. 449 * @mult: multiple to convert.
@@ -522,6 +539,11 @@ enum ib_cq_notify_flags {
522 IB_CQ_REPORT_MISSED_EVENTS = 1 << 2, 539 IB_CQ_REPORT_MISSED_EVENTS = 1 << 2,
523}; 540};
524 541
542enum ib_srq_type {
543 IB_SRQT_BASIC,
544 IB_SRQT_XRC
545};
546
525enum ib_srq_attr_mask { 547enum ib_srq_attr_mask {
526 IB_SRQ_MAX_WR = 1 << 0, 548 IB_SRQ_MAX_WR = 1 << 0,
527 IB_SRQ_LIMIT = 1 << 1, 549 IB_SRQ_LIMIT = 1 << 1,
@@ -537,6 +559,14 @@ struct ib_srq_init_attr {
537 void (*event_handler)(struct ib_event *, void *); 559 void (*event_handler)(struct ib_event *, void *);
538 void *srq_context; 560 void *srq_context;
539 struct ib_srq_attr attr; 561 struct ib_srq_attr attr;
562 enum ib_srq_type srq_type;
563
564 union {
565 struct {
566 struct ib_xrcd *xrcd;
567 struct ib_cq *cq;
568 } xrc;
569 } ext;
540}; 570};
541 571
542struct ib_qp_cap { 572struct ib_qp_cap {
@@ -565,7 +595,11 @@ enum ib_qp_type {
565 IB_QPT_UC, 595 IB_QPT_UC,
566 IB_QPT_UD, 596 IB_QPT_UD,
567 IB_QPT_RAW_IPV6, 597 IB_QPT_RAW_IPV6,
568 IB_QPT_RAW_ETHERTYPE 598 IB_QPT_RAW_ETHERTYPE,
599 /* Save 8 for RAW_PACKET */
600 IB_QPT_XRC_INI = 9,
601 IB_QPT_XRC_TGT,
602 IB_QPT_MAX
569}; 603};
570 604
571enum ib_qp_create_flags { 605enum ib_qp_create_flags {
@@ -579,6 +613,7 @@ struct ib_qp_init_attr {
579 struct ib_cq *send_cq; 613 struct ib_cq *send_cq;
580 struct ib_cq *recv_cq; 614 struct ib_cq *recv_cq;
581 struct ib_srq *srq; 615 struct ib_srq *srq;
616 struct ib_xrcd *xrcd; /* XRC TGT QPs only */
582 struct ib_qp_cap cap; 617 struct ib_qp_cap cap;
583 enum ib_sig_type sq_sig_type; 618 enum ib_sig_type sq_sig_type;
584 enum ib_qp_type qp_type; 619 enum ib_qp_type qp_type;
@@ -586,6 +621,13 @@ struct ib_qp_init_attr {
586 u8 port_num; /* special QP types only */ 621 u8 port_num; /* special QP types only */
587}; 622};
588 623
624struct ib_qp_open_attr {
625 void (*event_handler)(struct ib_event *, void *);
626 void *qp_context;
627 u32 qp_num;
628 enum ib_qp_type qp_type;
629};
630
589enum ib_rnr_timeout { 631enum ib_rnr_timeout {
590 IB_RNR_TIMER_655_36 = 0, 632 IB_RNR_TIMER_655_36 = 0,
591 IB_RNR_TIMER_000_01 = 1, 633 IB_RNR_TIMER_000_01 = 1,
@@ -770,6 +812,7 @@ struct ib_send_wr {
770 u32 rkey; 812 u32 rkey;
771 } fast_reg; 813 } fast_reg;
772 } wr; 814 } wr;
815 u32 xrc_remote_srq_num; /* XRC TGT QPs only */
773}; 816};
774 817
775struct ib_recv_wr { 818struct ib_recv_wr {
@@ -831,6 +874,7 @@ struct ib_ucontext {
831 struct list_head qp_list; 874 struct list_head qp_list;
832 struct list_head srq_list; 875 struct list_head srq_list;
833 struct list_head ah_list; 876 struct list_head ah_list;
877 struct list_head xrcd_list;
834 int closing; 878 int closing;
835}; 879};
836 880
@@ -858,6 +902,15 @@ struct ib_pd {
858 atomic_t usecnt; /* count all resources */ 902 atomic_t usecnt; /* count all resources */
859}; 903};
860 904
905struct ib_xrcd {
906 struct ib_device *device;
907 atomic_t usecnt; /* count all exposed resources */
908 struct inode *inode;
909
910 struct mutex tgt_qp_mutex;
911 struct list_head tgt_qp_list;
912};
913
861struct ib_ah { 914struct ib_ah {
862 struct ib_device *device; 915 struct ib_device *device;
863 struct ib_pd *pd; 916 struct ib_pd *pd;
@@ -882,7 +935,16 @@ struct ib_srq {
882 struct ib_uobject *uobject; 935 struct ib_uobject *uobject;
883 void (*event_handler)(struct ib_event *, void *); 936 void (*event_handler)(struct ib_event *, void *);
884 void *srq_context; 937 void *srq_context;
938 enum ib_srq_type srq_type;
885 atomic_t usecnt; 939 atomic_t usecnt;
940
941 union {
942 struct {
943 struct ib_xrcd *xrcd;
944 struct ib_cq *cq;
945 u32 srq_num;
946 } xrc;
947 } ext;
886}; 948};
887 949
888struct ib_qp { 950struct ib_qp {
@@ -891,6 +953,11 @@ struct ib_qp {
891 struct ib_cq *send_cq; 953 struct ib_cq *send_cq;
892 struct ib_cq *recv_cq; 954 struct ib_cq *recv_cq;
893 struct ib_srq *srq; 955 struct ib_srq *srq;
956 struct ib_xrcd *xrcd; /* XRC TGT QPs only */
957 struct list_head xrcd_list;
958 atomic_t usecnt; /* count times opened */
959 struct list_head open_list;
960 struct ib_qp *real_qp;
894 struct ib_uobject *uobject; 961 struct ib_uobject *uobject;
895 void (*event_handler)(struct ib_event *, void *); 962 void (*event_handler)(struct ib_event *, void *);
896 void *qp_context; 963 void *qp_context;
@@ -1149,6 +1216,10 @@ struct ib_device {
1149 struct ib_grh *in_grh, 1216 struct ib_grh *in_grh,
1150 struct ib_mad *in_mad, 1217 struct ib_mad *in_mad,
1151 struct ib_mad *out_mad); 1218 struct ib_mad *out_mad);
1219 struct ib_xrcd * (*alloc_xrcd)(struct ib_device *device,
1220 struct ib_ucontext *ucontext,
1221 struct ib_udata *udata);
1222 int (*dealloc_xrcd)(struct ib_xrcd *xrcd);
1152 1223
1153 struct ib_dma_mapping_ops *dma_ops; 1224 struct ib_dma_mapping_ops *dma_ops;
1154 1225
@@ -1443,6 +1514,25 @@ int ib_query_qp(struct ib_qp *qp,
1443int ib_destroy_qp(struct ib_qp *qp); 1514int ib_destroy_qp(struct ib_qp *qp);
1444 1515
1445/** 1516/**
1517 * ib_open_qp - Obtain a reference to an existing sharable QP.
1518 * @xrcd - XRC domain
1519 * @qp_open_attr: Attributes identifying the QP to open.
1520 *
1521 * Returns a reference to a sharable QP.
1522 */
1523struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd,
1524 struct ib_qp_open_attr *qp_open_attr);
1525
1526/**
1527 * ib_close_qp - Release an external reference to a QP.
1528 * @qp: The QP handle to release
1529 *
1530 * The opened QP handle is released by the caller. The underlying
1531 * shared QP is not destroyed until all internal references are released.
1532 */
1533int ib_close_qp(struct ib_qp *qp);
1534
1535/**
1446 * ib_post_send - Posts a list of work requests to the send queue of 1536 * ib_post_send - Posts a list of work requests to the send queue of
1447 * the specified QP. 1537 * the specified QP.
1448 * @qp: The QP to post the work request on. 1538 * @qp: The QP to post the work request on.
@@ -2060,4 +2150,16 @@ int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
2060 */ 2150 */
2061int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid); 2151int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid);
2062 2152
2153/**
2154 * ib_alloc_xrcd - Allocates an XRC domain.
2155 * @device: The device on which to allocate the XRC domain.
2156 */
2157struct ib_xrcd *ib_alloc_xrcd(struct ib_device *device);
2158
2159/**
2160 * ib_dealloc_xrcd - Deallocates an XRC domain.
2161 * @xrcd: The XRC domain to deallocate.
2162 */
2163int ib_dealloc_xrcd(struct ib_xrcd *xrcd);
2164
2063#endif /* IB_VERBS_H */ 2165#endif /* IB_VERBS_H */
diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h
index 2d0191c90f9e..1a046b1595cc 100644
--- a/include/rdma/iw_cm.h
+++ b/include/rdma/iw_cm.h
@@ -52,8 +52,10 @@ struct iw_cm_event {
52 struct sockaddr_in local_addr; 52 struct sockaddr_in local_addr;
53 struct sockaddr_in remote_addr; 53 struct sockaddr_in remote_addr;
54 void *private_data; 54 void *private_data;
55 u8 private_data_len;
56 void *provider_data; 55 void *provider_data;
56 u8 private_data_len;
57 u8 ord;
58 u8 ird;
57}; 59};
58 60
59/** 61/**
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
index 26977c149c41..51988f808181 100644
--- a/include/rdma/rdma_cm.h
+++ b/include/rdma/rdma_cm.h
@@ -65,6 +65,7 @@ enum rdma_cm_event_type {
65enum rdma_port_space { 65enum rdma_port_space {
66 RDMA_PS_SDP = 0x0001, 66 RDMA_PS_SDP = 0x0001,
67 RDMA_PS_IPOIB = 0x0002, 67 RDMA_PS_IPOIB = 0x0002,
68 RDMA_PS_IB = 0x013F,
68 RDMA_PS_TCP = 0x0106, 69 RDMA_PS_TCP = 0x0106,
69 RDMA_PS_UDP = 0x0111, 70 RDMA_PS_UDP = 0x0111,
70}; 71};
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h
index fc82c1896f75..5348a000c8f3 100644
--- a/include/rdma/rdma_user_cm.h
+++ b/include/rdma/rdma_user_cm.h
@@ -77,7 +77,8 @@ struct rdma_ucm_create_id {
77 __u64 uid; 77 __u64 uid;
78 __u64 response; 78 __u64 response;
79 __u16 ps; 79 __u16 ps;
80 __u8 reserved[6]; 80 __u8 qp_type;
81 __u8 reserved[5];
81}; 82};
82 83
83struct rdma_ucm_create_id_resp { 84struct rdma_ucm_create_id_resp {
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index ddb04568a509..2703e3bedbf5 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -59,6 +59,7 @@ enum iscsi_uevent_e {
59 ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, 59 ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19,
60 60
61 ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, 61 ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20,
62 ISCSI_UEVENT_SET_IFACE_PARAMS = UEVENT_BASE + 21,
62 63
63 /* up events */ 64 /* up events */
64 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, 65 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
@@ -70,6 +71,7 @@ enum iscsi_uevent_e {
70 71
71 ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, 72 ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7,
72 ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, 73 ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8,
74 ISCSI_KEVENT_CONN_LOGIN_STATE = KEVENT_BASE + 9,
73}; 75};
74 76
75enum iscsi_tgt_dscvr { 77enum iscsi_tgt_dscvr {
@@ -172,6 +174,10 @@ struct iscsi_uevent {
172 struct msg_set_path { 174 struct msg_set_path {
173 uint32_t host_no; 175 uint32_t host_no;
174 } set_path; 176 } set_path;
177 struct msg_set_iface_params {
178 uint32_t host_no;
179 uint32_t count;
180 } set_iface_params;
175 } u; 181 } u;
176 union { 182 union {
177 /* messages k -> u */ 183 /* messages k -> u */
@@ -193,6 +199,11 @@ struct iscsi_uevent {
193 uint32_t cid; 199 uint32_t cid;
194 uint64_t recv_handle; 200 uint64_t recv_handle;
195 } recv_req; 201 } recv_req;
202 struct msg_conn_login {
203 uint32_t sid;
204 uint32_t cid;
205 uint32_t state; /* enum iscsi_conn_state */
206 } conn_login;
196 struct msg_conn_error { 207 struct msg_conn_error {
197 uint32_t sid; 208 uint32_t sid;
198 uint32_t cid; 209 uint32_t cid;
@@ -214,6 +225,21 @@ struct iscsi_uevent {
214 } r; 225 } r;
215} __attribute__ ((aligned (sizeof(uint64_t)))); 226} __attribute__ ((aligned (sizeof(uint64_t))));
216 227
228enum iscsi_param_type {
229 ISCSI_PARAM, /* iscsi_param (session, conn, target, LU) */
230 ISCSI_HOST_PARAM, /* iscsi_host_param */
231 ISCSI_NET_PARAM, /* iscsi_net_param */
232};
233
234struct iscsi_iface_param_info {
235 uint32_t iface_num; /* iface number, 0 - n */
236 uint32_t len; /* Actual length of the param */
237 uint16_t param; /* iscsi param value */
238 uint8_t iface_type; /* IPv4 or IPv6 */
239 uint8_t param_type; /* iscsi_param_type */
240 uint8_t value[0]; /* length sized value follows */
241} __packed;
242
217/* 243/*
218 * To keep the struct iscsi_uevent size the same for userspace code 244 * To keep the struct iscsi_uevent size the same for userspace code
219 * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and 245 * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and
@@ -237,6 +263,71 @@ struct iscsi_path {
237 uint16_t pmtu; 263 uint16_t pmtu;
238} __attribute__ ((aligned (sizeof(uint64_t)))); 264} __attribute__ ((aligned (sizeof(uint64_t))));
239 265
266/* iscsi iface enabled/disabled setting */
267#define ISCSI_IFACE_DISABLE 0x01
268#define ISCSI_IFACE_ENABLE 0x02
269
270/* ipv4 bootproto */
271#define ISCSI_BOOTPROTO_STATIC 0x01
272#define ISCSI_BOOTPROTO_DHCP 0x02
273
274/* ipv6 addr autoconfig type */
275#define ISCSI_IPV6_AUTOCFG_DISABLE 0x01
276#define ISCSI_IPV6_AUTOCFG_ND_ENABLE 0x02
277#define ISCSI_IPV6_AUTOCFG_DHCPV6_ENABLE 0x03
278
279/* ipv6 link local addr type */
280#define ISCSI_IPV6_LINKLOCAL_AUTOCFG_ENABLE 0x01
281#define ISCSI_IPV6_LINKLOCAL_AUTOCFG_DISABLE 0x02
282
283/* ipv6 router addr type */
284#define ISCSI_IPV6_ROUTER_AUTOCFG_ENABLE 0x01
285#define ISCSI_IPV6_ROUTER_AUTOCFG_DISABLE 0x02
286
287#define ISCSI_IFACE_TYPE_IPV4 0x01
288#define ISCSI_IFACE_TYPE_IPV6 0x02
289
290#define ISCSI_MAX_VLAN_ID 4095
291#define ISCSI_MAX_VLAN_PRIORITY 7
292
293/* iscsi vlan enable/disabled setting */
294#define ISCSI_VLAN_DISABLE 0x01
295#define ISCSI_VLAN_ENABLE 0x02
296
297/* iSCSI network params */
298enum iscsi_net_param {
299 ISCSI_NET_PARAM_IPV4_ADDR = 1,
300 ISCSI_NET_PARAM_IPV4_SUBNET = 2,
301 ISCSI_NET_PARAM_IPV4_GW = 3,
302 ISCSI_NET_PARAM_IPV4_BOOTPROTO = 4,
303 ISCSI_NET_PARAM_MAC = 5,
304 ISCSI_NET_PARAM_IPV6_LINKLOCAL = 6,
305 ISCSI_NET_PARAM_IPV6_ADDR = 7,
306 ISCSI_NET_PARAM_IPV6_ROUTER = 8,
307 ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG = 9,
308 ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG = 10,
309 ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11,
310 ISCSI_NET_PARAM_IFACE_ENABLE = 12,
311 ISCSI_NET_PARAM_VLAN_ID = 13,
312 ISCSI_NET_PARAM_VLAN_PRIORITY = 14,
313 ISCSI_NET_PARAM_VLAN_ENABLED = 15,
314 ISCSI_NET_PARAM_VLAN_TAG = 16,
315 ISCSI_NET_PARAM_IFACE_TYPE = 17,
316 ISCSI_NET_PARAM_IFACE_NAME = 18,
317 ISCSI_NET_PARAM_MTU = 19,
318 ISCSI_NET_PARAM_PORT = 20,
319};
320
321enum iscsi_conn_state {
322 ISCSI_CONN_STATE_FREE,
323 ISCSI_CONN_STATE_XPT_WAIT,
324 ISCSI_CONN_STATE_IN_LOGIN,
325 ISCSI_CONN_STATE_LOGGED_IN,
326 ISCSI_CONN_STATE_IN_LOGOUT,
327 ISCSI_CONN_STATE_LOGOUT_REQUESTED,
328 ISCSI_CONN_STATE_CLEANUP_WAIT,
329};
330
240/* 331/*
241 * Common error codes 332 * Common error codes
242 */ 333 */
@@ -319,44 +410,6 @@ enum iscsi_param {
319 ISCSI_PARAM_MAX, 410 ISCSI_PARAM_MAX,
320}; 411};
321 412
322#define ISCSI_MAX_RECV_DLENGTH (1ULL << ISCSI_PARAM_MAX_RECV_DLENGTH)
323#define ISCSI_MAX_XMIT_DLENGTH (1ULL << ISCSI_PARAM_MAX_XMIT_DLENGTH)
324#define ISCSI_HDRDGST_EN (1ULL << ISCSI_PARAM_HDRDGST_EN)
325#define ISCSI_DATADGST_EN (1ULL << ISCSI_PARAM_DATADGST_EN)
326#define ISCSI_INITIAL_R2T_EN (1ULL << ISCSI_PARAM_INITIAL_R2T_EN)
327#define ISCSI_MAX_R2T (1ULL << ISCSI_PARAM_MAX_R2T)
328#define ISCSI_IMM_DATA_EN (1ULL << ISCSI_PARAM_IMM_DATA_EN)
329#define ISCSI_FIRST_BURST (1ULL << ISCSI_PARAM_FIRST_BURST)
330#define ISCSI_MAX_BURST (1ULL << ISCSI_PARAM_MAX_BURST)
331#define ISCSI_PDU_INORDER_EN (1ULL << ISCSI_PARAM_PDU_INORDER_EN)
332#define ISCSI_DATASEQ_INORDER_EN (1ULL << ISCSI_PARAM_DATASEQ_INORDER_EN)
333#define ISCSI_ERL (1ULL << ISCSI_PARAM_ERL)
334#define ISCSI_IFMARKER_EN (1ULL << ISCSI_PARAM_IFMARKER_EN)
335#define ISCSI_OFMARKER_EN (1ULL << ISCSI_PARAM_OFMARKER_EN)
336#define ISCSI_EXP_STATSN (1ULL << ISCSI_PARAM_EXP_STATSN)
337#define ISCSI_TARGET_NAME (1ULL << ISCSI_PARAM_TARGET_NAME)
338#define ISCSI_TPGT (1ULL << ISCSI_PARAM_TPGT)
339#define ISCSI_PERSISTENT_ADDRESS (1ULL << ISCSI_PARAM_PERSISTENT_ADDRESS)
340#define ISCSI_PERSISTENT_PORT (1ULL << ISCSI_PARAM_PERSISTENT_PORT)
341#define ISCSI_SESS_RECOVERY_TMO (1ULL << ISCSI_PARAM_SESS_RECOVERY_TMO)
342#define ISCSI_CONN_PORT (1ULL << ISCSI_PARAM_CONN_PORT)
343#define ISCSI_CONN_ADDRESS (1ULL << ISCSI_PARAM_CONN_ADDRESS)
344#define ISCSI_USERNAME (1ULL << ISCSI_PARAM_USERNAME)
345#define ISCSI_USERNAME_IN (1ULL << ISCSI_PARAM_USERNAME_IN)
346#define ISCSI_PASSWORD (1ULL << ISCSI_PARAM_PASSWORD)
347#define ISCSI_PASSWORD_IN (1ULL << ISCSI_PARAM_PASSWORD_IN)
348#define ISCSI_FAST_ABORT (1ULL << ISCSI_PARAM_FAST_ABORT)
349#define ISCSI_ABORT_TMO (1ULL << ISCSI_PARAM_ABORT_TMO)
350#define ISCSI_LU_RESET_TMO (1ULL << ISCSI_PARAM_LU_RESET_TMO)
351#define ISCSI_HOST_RESET_TMO (1ULL << ISCSI_PARAM_HOST_RESET_TMO)
352#define ISCSI_PING_TMO (1ULL << ISCSI_PARAM_PING_TMO)
353#define ISCSI_RECV_TMO (1ULL << ISCSI_PARAM_RECV_TMO)
354#define ISCSI_IFACE_NAME (1ULL << ISCSI_PARAM_IFACE_NAME)
355#define ISCSI_ISID (1ULL << ISCSI_PARAM_ISID)
356#define ISCSI_INITIATOR_NAME (1ULL << ISCSI_PARAM_INITIATOR_NAME)
357#define ISCSI_TGT_RESET_TMO (1ULL << ISCSI_PARAM_TGT_RESET_TMO)
358#define ISCSI_TARGET_ALIAS (1ULL << ISCSI_PARAM_TARGET_ALIAS)
359
360/* iSCSI HBA params */ 413/* iSCSI HBA params */
361enum iscsi_host_param { 414enum iscsi_host_param {
362 ISCSI_HOST_PARAM_HWADDRESS, 415 ISCSI_HOST_PARAM_HWADDRESS,
@@ -366,11 +419,6 @@ enum iscsi_host_param {
366 ISCSI_HOST_PARAM_MAX, 419 ISCSI_HOST_PARAM_MAX,
367}; 420};
368 421
369#define ISCSI_HOST_HWADDRESS (1ULL << ISCSI_HOST_PARAM_HWADDRESS)
370#define ISCSI_HOST_INITIATOR_NAME (1ULL << ISCSI_HOST_PARAM_INITIATOR_NAME)
371#define ISCSI_HOST_NETDEV_NAME (1ULL << ISCSI_HOST_PARAM_NETDEV_NAME)
372#define ISCSI_HOST_IPADDRESS (1ULL << ISCSI_HOST_PARAM_IPADDRESS)
373
374#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle) 422#define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
375#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr) 423#define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
376 424
@@ -392,6 +440,7 @@ enum iscsi_host_param {
392#define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */ 440#define CAP_DIGEST_OFFLOAD 0x1000 /* offload hdr and data digests */
393#define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal, 441#define CAP_PADDING_OFFLOAD 0x2000 /* offload padding insertion, removal,
394 and verification */ 442 and verification */
443#define CAP_LOGIN_OFFLOAD 0x4000 /* offload session login */
395 444
396/* 445/*
397 * These flags describes reason of stop_conn() call 446 * These flags describes reason of stop_conn() call
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 7d96829b0c00..5d1a758e0595 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -281,9 +281,6 @@ struct fc_seq_els_data {
281 * @timer: The command timer 281 * @timer: The command timer
282 * @tm_done: Completion indicator 282 * @tm_done: Completion indicator
283 * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) 283 * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies)
284 * @start_time: Timestamp indicating the start of the I/O (in jiffies)
285 * @end_time: Timestamp indicating the end of the I/O (in jiffies)
286 * @last_pkt_time: Timestamp of the last frame received (in jiffies)
287 * @data_len: The length of the data 284 * @data_len: The length of the data
288 * @cdb_cmd: The CDB command 285 * @cdb_cmd: The CDB command
289 * @xfer_len: The transfer length 286 * @xfer_len: The transfer length
@@ -304,50 +301,46 @@ struct fc_seq_els_data {
304 * @recov_seq: The sequence for REC or SRR 301 * @recov_seq: The sequence for REC or SRR
305 */ 302 */
306struct fc_fcp_pkt { 303struct fc_fcp_pkt {
307 /* Housekeeping information */
308 struct fc_lport *lp;
309 u16 state;
310 atomic_t ref_cnt;
311 spinlock_t scsi_pkt_lock; 304 spinlock_t scsi_pkt_lock;
305 atomic_t ref_cnt;
306
307 /* SCSI command and data transfer information */
308 u32 data_len;
312 309
313 /* SCSI I/O related information */ 310 /* SCSI I/O related information */
314 struct scsi_cmnd *cmd; 311 struct scsi_cmnd *cmd;
315 struct list_head list; 312 struct list_head list;
316 313
317 /* Timeout related information */ 314 /* Housekeeping information */
318 struct timer_list timer; 315 struct fc_lport *lp;
319 struct completion tm_done; 316 u8 state;
320 int wait_for_comp;
321 unsigned long start_time;
322 unsigned long end_time;
323 unsigned long last_pkt_time;
324
325 /* SCSI command and data transfer information */
326 u32 data_len;
327
328 /* Transport related veriables */
329 struct fcp_cmnd cdb_cmd;
330 size_t xfer_len;
331 u16 xfer_ddp;
332 u32 xfer_contig_end;
333 u16 max_payload;
334 317
335 /* SCSI/FCP return status */ 318 /* SCSI/FCP return status */
336 u32 io_status;
337 u8 cdb_status; 319 u8 cdb_status;
338 u8 status_code; 320 u8 status_code;
339 u8 scsi_comp_flags; 321 u8 scsi_comp_flags;
322 u32 io_status;
340 u32 req_flags; 323 u32 req_flags;
341 u32 scsi_resid; 324 u32 scsi_resid;
342 325
326 /* Transport related veriables */
327 size_t xfer_len;
328 struct fcp_cmnd cdb_cmd;
329 u32 xfer_contig_end;
330 u16 max_payload;
331 u16 xfer_ddp;
332
343 /* Associated structures */ 333 /* Associated structures */
344 struct fc_rport *rport; 334 struct fc_rport *rport;
345 struct fc_seq *seq_ptr; 335 struct fc_seq *seq_ptr;
346 336
347 /* Error Processing information */ 337 /* Timeout/error related information */
348 u8 recov_retry; 338 struct timer_list timer;
339 int wait_for_comp;
340 u32 recov_retry;
349 struct fc_seq *recov_seq; 341 struct fc_seq *recov_seq;
350}; 342 struct completion tm_done;
343} ____cacheline_aligned_in_smp;
351 344
352/* 345/*
353 * Structure and function definitions for managing Fibre Channel Exchanges 346 * Structure and function definitions for managing Fibre Channel Exchanges
@@ -413,35 +406,32 @@ struct fc_seq {
413 * sequence allocation 406 * sequence allocation
414 */ 407 */
415struct fc_exch { 408struct fc_exch {
409 spinlock_t ex_lock;
410 atomic_t ex_refcnt;
411 enum fc_class class;
416 struct fc_exch_mgr *em; 412 struct fc_exch_mgr *em;
417 struct fc_exch_pool *pool; 413 struct fc_exch_pool *pool;
418 u32 state;
419 u16 xid;
420 struct list_head ex_list; 414 struct list_head ex_list;
421 spinlock_t ex_lock;
422 atomic_t ex_refcnt;
423 struct delayed_work timeout_work;
424 struct fc_lport *lp; 415 struct fc_lport *lp;
416 u32 esb_stat;
417 u8 state;
418 u8 fh_type;
419 u8 seq_id;
420 u8 encaps;
421 u16 xid;
425 u16 oxid; 422 u16 oxid;
426 u16 rxid; 423 u16 rxid;
427 u32 oid; 424 u32 oid;
428 u32 sid; 425 u32 sid;
429 u32 did; 426 u32 did;
430 u32 esb_stat;
431 u32 r_a_tov; 427 u32 r_a_tov;
432 u8 seq_id;
433 u8 encaps;
434 u32 f_ctl; 428 u32 f_ctl;
435 u8 fh_type; 429 struct fc_seq seq;
436 enum fc_class class;
437 struct fc_seq seq;
438
439 void (*resp)(struct fc_seq *, struct fc_frame *, void *); 430 void (*resp)(struct fc_seq *, struct fc_frame *, void *);
440 void *arg; 431 void *arg;
441
442 void (*destructor)(struct fc_seq *, void *); 432 void (*destructor)(struct fc_seq *, void *);
443 433 struct delayed_work timeout_work;
444}; 434} ____cacheline_aligned_in_smp;
445#define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) 435#define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq)
446 436
447 437
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h
index 8c1638b8c28e..d1e95c6ac776 100644
--- a/include/scsi/libfcoe.h
+++ b/include/scsi/libfcoe.h
@@ -229,6 +229,11 @@ int fcoe_libfc_config(struct fc_lport *, struct fcoe_ctlr *,
229 const struct libfc_function_template *, int init_fcp); 229 const struct libfc_function_template *, int init_fcp);
230u32 fcoe_fc_crc(struct fc_frame *fp); 230u32 fcoe_fc_crc(struct fc_frame *fp);
231int fcoe_start_io(struct sk_buff *skb); 231int fcoe_start_io(struct sk_buff *skb);
232int fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type);
233void __fcoe_get_lesb(struct fc_lport *lport, struct fc_els_lesb *fc_lesb,
234 struct net_device *netdev);
235void fcoe_wwn_to_str(u64 wwn, char *buf, int len);
236int fcoe_validate_vport_create(struct fc_vport *vport);
232 237
233/** 238/**
234 * is_fip_mode() - returns true if FIP mode selected. 239 * is_fip_mode() - returns true if FIP mode selected.
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index ee866060f8a4..6a308d42d98f 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -142,8 +142,11 @@ struct expander_device {
142 u16 ex_change_count; 142 u16 ex_change_count;
143 u16 max_route_indexes; 143 u16 max_route_indexes;
144 u8 num_phys; 144 u8 num_phys;
145
146 u8 t2t_supp:1;
145 u8 configuring:1; 147 u8 configuring:1;
146 u8 conf_route_table:1; 148 u8 conf_route_table:1;
149
147 u8 enclosure_logical_id[8]; 150 u8 enclosure_logical_id[8];
148 151
149 struct ex_phy *ex_phy; 152 struct ex_phy *ex_phy;
@@ -386,6 +389,11 @@ sdev_to_domain_dev(struct scsi_device *sdev) {
386 return starget_to_domain_dev(sdev->sdev_target); 389 return starget_to_domain_dev(sdev->sdev_target);
387} 390}
388 391
392static inline struct ata_device *sas_to_ata_dev(struct domain_device *dev)
393{
394 return &dev->sata_dev.ap->link.device[0];
395}
396
389static inline struct domain_device * 397static inline struct domain_device *
390cmd_to_domain_dev(struct scsi_cmnd *cmd) 398cmd_to_domain_dev(struct scsi_cmnd *cmd)
391{ 399{
@@ -405,6 +413,20 @@ static inline void sas_phy_disconnected(struct asd_sas_phy *phy)
405 phy->linkrate = SAS_LINK_RATE_UNKNOWN; 413 phy->linkrate = SAS_LINK_RATE_UNKNOWN;
406} 414}
407 415
416static inline unsigned int to_sas_gpio_od(int device, int bit)
417{
418 return 3 * device + bit;
419}
420
421#ifdef CONFIG_SCSI_SAS_HOST_SMP
422int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count);
423#else
424static inline int try_test_sas_gpio_gp_bit(unsigned int od, u8 *data, u8 index, u8 count)
425{
426 return -1;
427}
428#endif
429
408/* ---------- Tasks ---------- */ 430/* ---------- Tasks ---------- */
409/* 431/*
410 service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED | 432 service_response | SAS_TASK_COMPLETE | SAS_TASK_UNDELIVERED |
@@ -555,36 +577,14 @@ struct sas_task {
555 struct work_struct abort_work; 577 struct work_struct abort_work;
556}; 578};
557 579
558extern struct kmem_cache *sas_task_cache;
559
560#define SAS_TASK_STATE_PENDING 1 580#define SAS_TASK_STATE_PENDING 1
561#define SAS_TASK_STATE_DONE 2 581#define SAS_TASK_STATE_DONE 2
562#define SAS_TASK_STATE_ABORTED 4 582#define SAS_TASK_STATE_ABORTED 4
563#define SAS_TASK_NEED_DEV_RESET 8 583#define SAS_TASK_NEED_DEV_RESET 8
564#define SAS_TASK_AT_INITIATOR 16 584#define SAS_TASK_AT_INITIATOR 16
565 585
566static inline struct sas_task *sas_alloc_task(gfp_t flags) 586extern struct sas_task *sas_alloc_task(gfp_t flags);
567{ 587extern void sas_free_task(struct sas_task *task);
568 struct sas_task *task = kmem_cache_zalloc(sas_task_cache, flags);
569
570 if (task) {
571 INIT_LIST_HEAD(&task->list);
572 spin_lock_init(&task->task_state_lock);
573 task->task_state_flags = SAS_TASK_STATE_PENDING;
574 init_timer(&task->timer);
575 init_completion(&task->completion);
576 }
577
578 return task;
579}
580
581static inline void sas_free_task(struct sas_task *task)
582{
583 if (task) {
584 BUG_ON(!list_empty(&task->list));
585 kmem_cache_free(sas_task_cache, task);
586 }
587}
588 588
589struct sas_domain_function_template { 589struct sas_domain_function_template {
590 /* The class calls these to notify the LLDD of an event. */ 590 /* The class calls these to notify the LLDD of an event. */
@@ -614,6 +614,10 @@ struct sas_domain_function_template {
614 614
615 /* Phy management */ 615 /* Phy management */
616 int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *); 616 int (*lldd_control_phy)(struct asd_sas_phy *, enum phy_func, void *);
617
618 /* GPIO support */
619 int (*lldd_write_gpio)(struct sas_ha_struct *, u8 reg_type,
620 u8 reg_index, u8 reg_count, u8 *write_data);
617}; 621};
618 622
619extern int sas_register_ha(struct sas_ha_struct *); 623extern int sas_register_ha(struct sas_ha_struct *);
@@ -652,7 +656,7 @@ int sas_discover_event(struct asd_sas_port *, enum discover_event ev);
652int sas_discover_sata(struct domain_device *); 656int sas_discover_sata(struct domain_device *);
653int sas_discover_end_dev(struct domain_device *); 657int sas_discover_end_dev(struct domain_device *);
654 658
655void sas_unregister_dev(struct domain_device *); 659void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *);
656 660
657void sas_init_dev(struct domain_device *); 661void sas_init_dev(struct domain_device *);
658 662
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h
index c5c5e008e6de..f05fa826f89e 100644
--- a/include/scsi/osd_ore.h
+++ b/include/scsi/osd_ore.h
@@ -34,15 +34,30 @@ struct ore_comp {
34 34
35struct ore_layout { 35struct ore_layout {
36 /* Our way of looking at the data_map */ 36 /* Our way of looking at the data_map */
37 enum pnfs_osd_raid_algorithm4
38 raid_algorithm;
37 unsigned stripe_unit; 39 unsigned stripe_unit;
38 unsigned mirrors_p1; 40 unsigned mirrors_p1;
39 41
40 unsigned group_width; 42 unsigned group_width;
43 unsigned parity;
41 u64 group_depth; 44 u64 group_depth;
42 unsigned group_count; 45 unsigned group_count;
46
47 /* Cached often needed calculations filled in by
48 * ore_verify_layout
49 */
50 unsigned long max_io_length; /* Max length that should be passed to
51 * ore_get_rw_state
52 */
53};
54
55struct ore_dev {
56 struct osd_dev *od;
43}; 57};
44 58
45struct ore_components { 59struct ore_components {
60 unsigned first_dev; /* First logical device no */
46 unsigned numdevs; /* Num of devices in array */ 61 unsigned numdevs; /* Num of devices in array */
47 /* If @single_comp == EC_SINGLE_COMP, @comps points to a single 62 /* If @single_comp == EC_SINGLE_COMP, @comps points to a single
48 * component. else there are @numdevs components 63 * component. else there are @numdevs components
@@ -51,20 +66,60 @@ struct ore_components {
51 EC_SINGLE_COMP = 0, EC_MULTPLE_COMPS = 0xffffffff 66 EC_SINGLE_COMP = 0, EC_MULTPLE_COMPS = 0xffffffff
52 } single_comp; 67 } single_comp;
53 struct ore_comp *comps; 68 struct ore_comp *comps;
54 struct osd_dev **ods; /* osd_dev array */ 69
70 /* Array of pointers to ore_dev-* . User will usually have these pointed
71 * too a bigger struct which contain an "ore_dev ored" member and use
72 * container_of(oc->ods[i], struct foo_dev, ored) to access the bigger
73 * structure.
74 */
75 struct ore_dev **ods;
76};
77
78/* ore_comp_dev Recievies a logical device index */
79static inline struct osd_dev *ore_comp_dev(
80 const struct ore_components *oc, unsigned i)
81{
82 BUG_ON((i < oc->first_dev) || (oc->first_dev + oc->numdevs <= i));
83 return oc->ods[i - oc->first_dev]->od;
84}
85
86static inline void ore_comp_set_dev(
87 struct ore_components *oc, unsigned i, struct osd_dev *od)
88{
89 oc->ods[i - oc->first_dev]->od = od;
90}
91
92struct ore_striping_info {
93 u64 offset;
94 u64 obj_offset;
95 u64 length;
96 u64 first_stripe_start; /* only used in raid writes */
97 u64 M; /* for truncate */
98 unsigned bytes_in_stripe;
99 unsigned dev;
100 unsigned par_dev;
101 unsigned unit_off;
102 unsigned cur_pg;
103 unsigned cur_comp;
55}; 104};
56 105
57struct ore_io_state; 106struct ore_io_state;
58typedef void (*ore_io_done_fn)(struct ore_io_state *ios, void *private); 107typedef void (*ore_io_done_fn)(struct ore_io_state *ios, void *private);
108struct _ore_r4w_op {
109 /* @Priv given here is passed ios->private */
110 struct page * (*get_page)(void *priv, u64 page_index, bool *uptodate);
111 void (*put_page)(void *priv, struct page *page);
112};
59 113
60struct ore_io_state { 114struct ore_io_state {
61 struct kref kref; 115 struct kref kref;
116 struct ore_striping_info si;
62 117
63 void *private; 118 void *private;
64 ore_io_done_fn done; 119 ore_io_done_fn done;
65 120
66 struct ore_layout *layout; 121 struct ore_layout *layout;
67 struct ore_components *comps; 122 struct ore_components *oc;
68 123
69 /* Global read/write IO*/ 124 /* Global read/write IO*/
70 loff_t offset; 125 loff_t offset;
@@ -84,6 +139,16 @@ struct ore_io_state {
84 139
85 bool reading; 140 bool reading;
86 141
142 /* House keeping of Parity pages */
143 bool extra_part_alloc;
144 struct page **parity_pages;
145 unsigned max_par_pages;
146 unsigned cur_par_page;
147 unsigned sgs_per_dev;
148 struct __stripe_pages_2d *sp2d;
149 struct ore_io_state *ios_read_4_write;
150 const struct _ore_r4w_op *r4w;
151
87 /* Variable array of size numdevs */ 152 /* Variable array of size numdevs */
88 unsigned numdevs; 153 unsigned numdevs;
89 struct ore_per_dev_state { 154 struct ore_per_dev_state {
@@ -91,7 +156,10 @@ struct ore_io_state {
91 struct bio *bio; 156 struct bio *bio;
92 loff_t offset; 157 loff_t offset;
93 unsigned length; 158 unsigned length;
159 unsigned last_sgs_total;
94 unsigned dev; 160 unsigned dev;
161 struct osd_sg_entry *sglist;
162 unsigned cur_sg;
95 } per_dev[]; 163 } per_dev[];
96}; 164};
97 165
@@ -102,6 +170,9 @@ static inline unsigned ore_io_state_size(unsigned numdevs)
102} 170}
103 171
104/* ore.c */ 172/* ore.c */
173int ore_verify_layout(unsigned total_comps, struct ore_layout *layout);
174void ore_calc_stripe_info(struct ore_layout *layout, u64 file_offset,
175 u64 length, struct ore_striping_info *si);
105int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps, 176int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps,
106 bool is_reading, u64 offset, u64 length, 177 bool is_reading, u64 offset, u64 length,
107 struct ore_io_state **ios); 178 struct ore_io_state **ios);
@@ -109,7 +180,10 @@ int ore_get_io_state(struct ore_layout *layout, struct ore_components *comps,
109 struct ore_io_state **ios); 180 struct ore_io_state **ios);
110void ore_put_io_state(struct ore_io_state *ios); 181void ore_put_io_state(struct ore_io_state *ios);
111 182
112int ore_check_io(struct ore_io_state *ios, u64 *resid); 183typedef void (*ore_on_dev_error)(struct ore_io_state *ios, struct ore_dev *od,
184 unsigned dev_index, enum osd_err_priority oep,
185 u64 dev_offset, u64 dev_len);
186int ore_check_io(struct ore_io_state *ios, ore_on_dev_error rep);
113 187
114int ore_create(struct ore_io_state *ios); 188int ore_create(struct ore_io_state *ios);
115int ore_remove(struct ore_io_state *ios); 189int ore_remove(struct ore_io_state *ios);
diff --git a/include/scsi/sas.h b/include/scsi/sas.h
index e9fd02281381..3673d685e6ad 100644
--- a/include/scsi/sas.h
+++ b/include/scsi/sas.h
@@ -108,6 +108,7 @@ enum sas_protocol {
108 SAS_PROTOCOL_STP = 0x04, 108 SAS_PROTOCOL_STP = 0x04,
109 SAS_PROTOCOL_SSP = 0x08, 109 SAS_PROTOCOL_SSP = 0x08,
110 SAS_PROTOCOL_ALL = 0x0E, 110 SAS_PROTOCOL_ALL = 0x0E,
111 SAS_PROTOCOL_STP_ALL = SAS_PROTOCOL_STP|SAS_PROTOCOL_SATA,
111}; 112};
112 113
113/* From the spec; local phys only */ 114/* From the spec; local phys only */
@@ -121,6 +122,7 @@ enum phy_func {
121 PHY_FUNC_TX_SATA_PS_SIGNAL, 122 PHY_FUNC_TX_SATA_PS_SIGNAL,
122 PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */ 123 PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */
123 PHY_FUNC_SET_LINK_RATE, 124 PHY_FUNC_SET_LINK_RATE,
125 PHY_FUNC_GET_EVENTS,
124}; 126};
125 127
126/* SAS LLDD would need to report only _very_few_ of those, like BROADCAST. 128/* SAS LLDD would need to report only _very_few_ of those, like BROADCAST.
@@ -195,6 +197,14 @@ enum sas_open_rej_reason {
195 SAS_OREJ_RSVD_RETRY = 18, 197 SAS_OREJ_RSVD_RETRY = 18,
196}; 198};
197 199
200enum sas_gpio_reg_type {
201 SAS_GPIO_REG_CFG = 0,
202 SAS_GPIO_REG_RX = 1,
203 SAS_GPIO_REG_RX_GP = 2,
204 SAS_GPIO_REG_TX = 3,
205 SAS_GPIO_REG_TX_GP = 4,
206};
207
198struct dev_to_host_fis { 208struct dev_to_host_fis {
199 u8 fis_type; /* 0x34 */ 209 u8 fis_type; /* 0x34 */
200 u8 flags; 210 u8 flags;
@@ -341,7 +351,12 @@ struct report_general_resp {
341 351
342 u8 conf_route_table:1; 352 u8 conf_route_table:1;
343 u8 configuring:1; 353 u8 configuring:1;
344 u8 _r_b:6; 354 u8 config_others:1;
355 u8 orej_retry_supp:1;
356 u8 stp_cont_awt:1;
357 u8 self_config:1;
358 u8 zone_config:1;
359 u8 t2t_supp:1;
345 360
346 u8 _r_c; 361 u8 _r_c;
347 362
@@ -528,7 +543,12 @@ struct report_general_resp {
528 u8 _r_a; 543 u8 _r_a;
529 u8 num_phys; 544 u8 num_phys;
530 545
531 u8 _r_b:6; 546 u8 t2t_supp:1;
547 u8 zone_config:1;
548 u8 self_config:1;
549 u8 stp_cont_awt:1;
550 u8 orej_retry_supp:1;
551 u8 config_others:1;
532 u8 configuring:1; 552 u8 configuring:1;
533 u8 conf_route_table:1; 553 u8 conf_route_table:1;
534 554
diff --git a/include/scsi/scsi_bsg_iscsi.h b/include/scsi/scsi_bsg_iscsi.h
new file mode 100644
index 000000000000..fd5689d4c052
--- /dev/null
+++ b/include/scsi/scsi_bsg_iscsi.h
@@ -0,0 +1,110 @@
1/*
2 * iSCSI Transport BSG Interface
3 *
4 * Copyright (C) 2009 James Smart, Emulex Corporation
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22#ifndef SCSI_BSG_ISCSI_H
23#define SCSI_BSG_ISCSI_H
24
25/*
26 * This file intended to be included by both kernel and user space
27 */
28
29#include <scsi/scsi.h>
30
31/*
32 * iSCSI Transport SGIO v4 BSG Message Support
33 */
34
35/* Default BSG request timeout (in seconds) */
36#define ISCSI_DEFAULT_BSG_TIMEOUT (10 * HZ)
37
38
39/*
40 * Request Message Codes supported by the iSCSI Transport
41 */
42
43/* define the class masks for the message codes */
44#define ISCSI_BSG_CLS_MASK 0xF0000000 /* find object class */
45#define ISCSI_BSG_HST_MASK 0x80000000 /* iscsi host class */
46
47/* iscsi host Message Codes */
48#define ISCSI_BSG_HST_VENDOR (ISCSI_BSG_HST_MASK | 0x000000FF)
49
50
51/*
52 * iSCSI Host Messages
53 */
54
55/* ISCSI_BSG_HST_VENDOR : */
56
57/* Request:
58 * Note: When specifying vendor_id, be sure to read the Vendor Type and ID
59 * formatting requirements specified in scsi_netlink.h
60 */
61struct iscsi_bsg_host_vendor {
62 /*
63 * Identifies the vendor that the message is formatted for. This
64 * should be the recipient of the message.
65 */
66 uint64_t vendor_id;
67
68 /* start of vendor command area */
69 uint32_t vendor_cmd[0];
70};
71
72/* Response:
73 */
74struct iscsi_bsg_host_vendor_reply {
75 /* start of vendor response area */
76 uint32_t vendor_rsp[0];
77};
78
79
80/* request (CDB) structure of the sg_io_v4 */
81struct iscsi_bsg_request {
82 uint32_t msgcode;
83 union {
84 struct iscsi_bsg_host_vendor h_vendor;
85 } rqst_data;
86} __attribute__((packed));
87
88
89/* response (request sense data) structure of the sg_io_v4 */
90struct iscsi_bsg_reply {
91 /*
92 * The completion result. Result exists in two forms:
93 * if negative, it is an -Exxx system errno value. There will
94 * be no further reply information supplied.
95 * else, it's the 4-byte scsi error result, with driver, host,
96 * msg and status fields. The per-msgcode reply structure
97 * will contain valid data.
98 */
99 uint32_t result;
100
101 /* If there was reply_payload, how much was recevied ? */
102 uint32_t reply_payload_rcv_len;
103
104 union {
105 struct iscsi_bsg_host_vendor_reply vendor_reply;
106 } reply_data;
107};
108
109
110#endif /* SCSI_BSG_ISCSI_H */
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index d371c3ca90c3..5591ed54dc93 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -197,6 +197,7 @@ struct scsi_device_handler {
197 int (*activate)(struct scsi_device *, activate_complete, void *); 197 int (*activate)(struct scsi_device *, activate_complete, void *);
198 int (*prep_fn)(struct scsi_device *, struct request *); 198 int (*prep_fn)(struct scsi_device *, struct request *);
199 int (*set_params)(struct scsi_device *, const char *); 199 int (*set_params)(struct scsi_device *, const char *);
200 bool (*match)(struct scsi_device *);
200}; 201};
201 202
202struct scsi_dh_data { 203struct scsi_dh_data {
@@ -471,6 +472,11 @@ static inline int scsi_device_protection(struct scsi_device *sdev)
471 return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0); 472 return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0);
472} 473}
473 474
475static inline int scsi_device_tpgs(struct scsi_device *sdev)
476{
477 return sdev->inquiry ? (sdev->inquiry[5] >> 4) & 0x3 : 0;
478}
479
474#define MODULE_ALIAS_SCSI_DEVICE(type) \ 480#define MODULE_ALIAS_SCSI_DEVICE(type) \
475 MODULE_ALIAS("scsi:t-" __stringify(type) "*") 481 MODULE_ALIAS("scsi:t-" __stringify(type) "*")
476#define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x" 482#define SCSI_DEVICE_MODALIAS_FMT "scsi:t-0x%02x"
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index f1f2644137b8..50266c9405fc 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -355,6 +355,19 @@ struct scsi_host_template {
355 */ 355 */
356 enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *); 356 enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *);
357 357
358 /* This is an optional routine that allows transport to initiate
359 * LLD adapter or firmware reset using sysfs attribute.
360 *
361 * Return values: 0 on success, -ve value on failure.
362 *
363 * Status: OPTIONAL
364 */
365
366 int (*host_reset)(struct Scsi_Host *shost, int reset_type);
367#define SCSI_ADAPTER_RESET 1
368#define SCSI_FIRMWARE_RESET 2
369
370
358 /* 371 /*
359 * Name of proc directory 372 * Name of proc directory
360 */ 373 */
@@ -791,7 +804,8 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost)
791 **/ 804 **/
792static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) 805static inline int scsi_host_scan_allowed(struct Scsi_Host *shost)
793{ 806{
794 return shost->shost_state == SHOST_RUNNING; 807 return shost->shost_state == SHOST_RUNNING ||
808 shost->shost_state == SHOST_RECOVERY;
795} 809}
796 810
797extern void scsi_unblock_requests(struct Scsi_Host *); 811extern void scsi_unblock_requests(struct Scsi_Host *);
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index bf8f52965675..5994bcc1b017 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -37,6 +37,8 @@ struct iscsi_cls_conn;
37struct iscsi_conn; 37struct iscsi_conn;
38struct iscsi_task; 38struct iscsi_task;
39struct sockaddr; 39struct sockaddr;
40struct iscsi_iface;
41struct bsg_job;
40 42
41/** 43/**
42 * struct iscsi_transport - iSCSI Transport template 44 * struct iscsi_transport - iSCSI Transport template
@@ -84,9 +86,7 @@ struct iscsi_transport {
84 struct module *owner; 86 struct module *owner;
85 char *name; 87 char *name;
86 unsigned int caps; 88 unsigned int caps;
87 /* LLD sets this to indicate what values it can export to sysfs */ 89
88 uint64_t param_mask;
89 uint64_t host_param_mask;
90 struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep, 90 struct iscsi_cls_session *(*create_session) (struct iscsi_endpoint *ep,
91 uint16_t cmds_max, uint16_t qdepth, 91 uint16_t cmds_max, uint16_t qdepth,
92 uint32_t sn); 92 uint32_t sn);
@@ -137,6 +137,13 @@ struct iscsi_transport {
137 int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, 137 int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type,
138 uint32_t enable, struct sockaddr *dst_addr); 138 uint32_t enable, struct sockaddr *dst_addr);
139 int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); 139 int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params);
140 int (*set_iface_param) (struct Scsi_Host *shost, void *data,
141 uint32_t len);
142 int (*get_iface_param) (struct iscsi_iface *iface,
143 enum iscsi_param_type param_type,
144 int param, char *buf);
145 mode_t (*attr_is_visible)(int param_type, int param);
146 int (*bsg_request)(struct bsg_job *job);
140}; 147};
141 148
142/* 149/*
@@ -150,6 +157,8 @@ extern int iscsi_unregister_transport(struct iscsi_transport *tt);
150 */ 157 */
151extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, 158extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn,
152 enum iscsi_err error); 159 enum iscsi_err error);
160extern void iscsi_conn_login_event(struct iscsi_cls_conn *conn,
161 enum iscsi_conn_state state);
153extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, 162extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr,
154 char *data, uint32_t data_size); 163 char *data, uint32_t data_size);
155 164
@@ -171,6 +180,9 @@ struct iscsi_cls_conn {
171#define iscsi_dev_to_conn(_dev) \ 180#define iscsi_dev_to_conn(_dev) \
172 container_of(_dev, struct iscsi_cls_conn, dev) 181 container_of(_dev, struct iscsi_cls_conn, dev)
173 182
183#define transport_class_to_conn(_cdev) \
184 iscsi_dev_to_conn(_cdev->parent)
185
174#define iscsi_conn_to_session(_conn) \ 186#define iscsi_conn_to_session(_conn) \
175 iscsi_dev_to_session(_conn->dev.parent) 187 iscsi_dev_to_session(_conn->dev.parent)
176 188
@@ -197,6 +209,7 @@ struct iscsi_cls_session {
197 struct delayed_work recovery_work; 209 struct delayed_work recovery_work;
198 210
199 unsigned int target_id; 211 unsigned int target_id;
212 bool ida_used;
200 213
201 int state; 214 int state;
202 int sid; /* session id */ 215 int sid; /* session id */
@@ -207,6 +220,9 @@ struct iscsi_cls_session {
207#define iscsi_dev_to_session(_dev) \ 220#define iscsi_dev_to_session(_dev) \
208 container_of(_dev, struct iscsi_cls_session, dev) 221 container_of(_dev, struct iscsi_cls_session, dev)
209 222
223#define transport_class_to_session(_cdev) \
224 iscsi_dev_to_session(_cdev->parent)
225
210#define iscsi_session_to_shost(_session) \ 226#define iscsi_session_to_shost(_session) \
211 dev_to_shost(_session->dev.parent) 227 dev_to_shost(_session->dev.parent)
212 228
@@ -216,8 +232,12 @@ struct iscsi_cls_session {
216struct iscsi_cls_host { 232struct iscsi_cls_host {
217 atomic_t nr_scans; 233 atomic_t nr_scans;
218 struct mutex mutex; 234 struct mutex mutex;
235 struct request_queue *bsg_q;
219}; 236};
220 237
238#define iscsi_job_to_shost(_job) \
239 dev_to_shost(_job->dev)
240
221extern void iscsi_host_for_each_session(struct Scsi_Host *shost, 241extern void iscsi_host_for_each_session(struct Scsi_Host *shost,
222 void (*fn)(struct iscsi_cls_session *)); 242 void (*fn)(struct iscsi_cls_session *));
223 243
@@ -228,6 +248,20 @@ struct iscsi_endpoint {
228 struct iscsi_cls_conn *conn; 248 struct iscsi_cls_conn *conn;
229}; 249};
230 250
251struct iscsi_iface {
252 struct device dev;
253 struct iscsi_transport *transport;
254 uint32_t iface_type; /* IPv4 or IPv6 */
255 uint32_t iface_num; /* iface number, 0 - n */
256 void *dd_data; /* LLD private data */
257};
258
259#define iscsi_dev_to_iface(_dev) \
260 container_of(_dev, struct iscsi_iface, dev)
261
262#define iscsi_iface_to_shost(_iface) \
263 dev_to_shost(_iface->dev.parent)
264
231/* 265/*
232 * session and connection functions that can be used by HW iSCSI LLDs 266 * session and connection functions that can be used by HW iSCSI LLDs
233 */ 267 */
@@ -238,6 +272,7 @@ struct iscsi_endpoint {
238 dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a) 272 dev_printk(prefix, &(_cls_conn)->dev, fmt, ##a)
239 273
240extern int iscsi_session_chkready(struct iscsi_cls_session *session); 274extern int iscsi_session_chkready(struct iscsi_cls_session *session);
275extern int iscsi_is_session_online(struct iscsi_cls_session *session);
241extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost, 276extern struct iscsi_cls_session *iscsi_alloc_session(struct Scsi_Host *shost,
242 struct iscsi_transport *transport, int dd_size); 277 struct iscsi_transport *transport, int dd_size);
243extern int iscsi_add_session(struct iscsi_cls_session *session, 278extern int iscsi_add_session(struct iscsi_cls_session *session,
@@ -261,5 +296,11 @@ extern struct iscsi_endpoint *iscsi_create_endpoint(int dd_size);
261extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep); 296extern void iscsi_destroy_endpoint(struct iscsi_endpoint *ep);
262extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle); 297extern struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle);
263extern int iscsi_block_scsi_eh(struct scsi_cmnd *cmd); 298extern int iscsi_block_scsi_eh(struct scsi_cmnd *cmd);
299extern struct iscsi_iface *iscsi_create_iface(struct Scsi_Host *shost,
300 struct iscsi_transport *t,
301 uint32_t iface_type,
302 uint32_t iface_num, int dd_size);
303extern void iscsi_destroy_iface(struct iscsi_iface *iface);
304extern struct iscsi_iface *iscsi_lookup_iface(int handle);
264 305
265#endif 306#endif
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 5d6074faa279..a2e4ff5ba9e9 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -706,7 +706,7 @@ struct snd_timer_tread {
706 * * 706 * *
707 ****************************************************************************/ 707 ****************************************************************************/
708 708
709#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) 709#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
710 710
711struct snd_ctl_card_info { 711struct snd_ctl_card_info {
712 int card; /* card number */ 712 int card; /* card number */
@@ -803,6 +803,8 @@ struct snd_ctl_elem_info {
803 unsigned int items; /* R: number of items */ 803 unsigned int items; /* R: number of items */
804 unsigned int item; /* W: item number */ 804 unsigned int item; /* W: item number */
805 char name[64]; /* R: value name */ 805 char name[64]; /* R: value name */
806 __u64 names_ptr; /* W: names list (ELEM_ADD only) */
807 unsigned int names_length;
806 } enumerated; 808 } enumerated;
807 unsigned char reserved[128]; 809 unsigned char reserved[128];
808 } value; 810 } value;
diff --git a/include/sound/core.h b/include/sound/core.h
index 1fa2407c966f..3be5ab782b99 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/module.h>
26#include <linux/sched.h> /* wake_up() */ 25#include <linux/sched.h> /* wake_up() */
27#include <linux/mutex.h> /* struct mutex */ 26#include <linux/mutex.h> /* struct mutex */
28#include <linux/rwsem.h> /* struct rw_semaphore */ 27#include <linux/rwsem.h> /* struct rw_semaphore */
@@ -43,6 +42,7 @@
43#ifdef CONFIG_PCI 42#ifdef CONFIG_PCI
44struct pci_dev; 43struct pci_dev;
45#endif 44#endif
45struct module;
46 46
47/* device allocation stuff */ 47/* device allocation stuff */
48 48
@@ -326,9 +326,9 @@ void release_and_free_resource(struct resource *res);
326/* --- */ 326/* --- */
327 327
328#if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) 328#if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
329__printf(4, 5)
329void __snd_printk(unsigned int level, const char *file, int line, 330void __snd_printk(unsigned int level, const char *file, int line,
330 const char *format, ...) 331 const char *format, ...);
331 __attribute__ ((format (printf, 4, 5)));
332#else 332#else
333#define __snd_printk(level, file, line, format, args...) \ 333#define __snd_printk(level, file, line, format, args...) \
334 printk(format, ##args) 334 printk(format, ##args)
diff --git a/include/sound/info.h b/include/sound/info.h
index 4e94cf1ff762..5492cc40dc57 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -110,8 +110,8 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer);
110static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} 110static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {}
111#endif 111#endif
112 112
113int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) \ 113__printf(2, 3)
114 __attribute__ ((format (printf, 2, 3))); 114int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...);
115int snd_info_init(void); 115int snd_info_init(void);
116int snd_info_done(void); 116int snd_info_done(void);
117 117
diff --git a/include/sound/initval.h b/include/sound/initval.h
index 1daa6dff8297..f99a0d2ddfe7 100644
--- a/include/sound/initval.h
+++ b/include/sound/initval.h
@@ -62,7 +62,7 @@ static int snd_legacy_find_free_irq(int *irq_table)
62{ 62{
63 while (*irq_table != -1) { 63 while (*irq_table != -1) {
64 if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, 64 if (!request_irq(*irq_table, snd_legacy_empty_irq_handler,
65 IRQF_DISABLED | IRQF_PROBE_SHARED, "ALSA Test IRQ", 65 IRQF_PROBE_SHARED, "ALSA Test IRQ",
66 (void *) irq_table)) { 66 (void *) irq_table)) {
67 free_irq(*irq_table, (void *) irq_table); 67 free_irq(*irq_table, (void *) irq_table);
68 return *irq_table; 68 return *irq_table;
diff --git a/include/sound/jack.h b/include/sound/jack.h
index c140fc7cbd3f..63c790742db4 100644
--- a/include/sound/jack.h
+++ b/include/sound/jack.h
@@ -42,6 +42,7 @@ enum snd_jack_types {
42 SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ 42 SND_JACK_MECHANICAL = 0x0008, /* If detected separately */
43 SND_JACK_VIDEOOUT = 0x0010, 43 SND_JACK_VIDEOOUT = 0x0010,
44 SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, 44 SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT,
45 SND_JACK_LINEIN = 0x0020,
45 46
46 /* Kept separate from switches to facilitate implementation */ 47 /* Kept separate from switches to facilitate implementation */
47 SND_JACK_BTN_0 = 0x4000, 48 SND_JACK_BTN_0 = 0x4000,
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h
index 1f1d53f8830b..20230db00ef1 100644
--- a/include/sound/mpu401.h
+++ b/include/sound/mpu401.h
@@ -50,7 +50,10 @@
50#define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ 50#define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */
51#define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ 51#define MPU401_INFO_MMIO (1 << 3) /* MMIO access */
52#define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ 52#define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */
53#define MPU401_INFO_IRQ_HOOK (1 << 5) /* mpu401 irq handler is called
54 from driver irq handler */
53#define MPU401_INFO_NO_ACK (1 << 6) /* No ACK cmd needed */ 55#define MPU401_INFO_NO_ACK (1 << 6) /* No ACK cmd needed */
56#define MPU401_INFO_USE_TIMER (1 << 15) /* internal */
54 57
55#define MPU401_MODE_BIT_INPUT 0 58#define MPU401_MODE_BIT_INPUT 0
56#define MPU401_MODE_BIT_OUTPUT 1 59#define MPU401_MODE_BIT_OUTPUT 1
@@ -73,8 +76,7 @@ struct snd_mpu401 {
73 unsigned long port; /* base port of MPU-401 chip */ 76 unsigned long port; /* base port of MPU-401 chip */
74 unsigned long cport; /* port + 1 (usually) */ 77 unsigned long cport; /* port + 1 (usually) */
75 struct resource *res; /* port resource */ 78 struct resource *res; /* port resource */
76 int irq; /* IRQ number of MPU-401 chip (-1 = poll) */ 79 int irq; /* IRQ number of MPU-401 chip */
77 int irq_flags;
78 80
79 unsigned long mode; /* MPU401_MODE_XXXX */ 81 unsigned long mode; /* MPU401_MODE_XXXX */
80 int timer_invoked; 82 int timer_invoked;
@@ -131,7 +133,6 @@ int snd_mpu401_uart_new(struct snd_card *card,
131 unsigned long port, 133 unsigned long port,
132 unsigned int info_flags, 134 unsigned int info_flags,
133 int irq, 135 int irq,
134 int irq_flags,
135 struct snd_rawmidi ** rrawmidi); 136 struct snd_rawmidi ** rrawmidi);
136 137
137#endif /* __SOUND_MPU401_H */ 138#endif /* __SOUND_MPU401_H */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 57e71fa33f7c..0cf91b2f08ca 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -29,7 +29,7 @@
29#include <linux/poll.h> 29#include <linux/poll.h>
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/bitops.h> 31#include <linux/bitops.h>
32#include <linux/pm_qos_params.h> 32#include <linux/pm_qos.h>
33 33
34#define snd_pcm_substream_chip(substream) ((substream)->private_data) 34#define snd_pcm_substream_chip(substream) ((substream)->private_data)
35#define snd_pcm_chip(pcm) ((pcm)->private_data) 35#define snd_pcm_chip(pcm) ((pcm)->private_data)
@@ -373,7 +373,7 @@ struct snd_pcm_substream {
373 int number; 373 int number;
374 char name[32]; /* substream name */ 374 char name[32]; /* substream name */
375 int stream; /* stream (direction) */ 375 int stream; /* stream (direction) */
376 struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */ 376 struct pm_qos_request latency_pm_qos_req; /* pm_qos request */
377 size_t buffer_bytes_max; /* limit ring buffer size */ 377 size_t buffer_bytes_max; /* limit ring buffer size */
378 struct snd_dma_buffer dma_buffer; 378 struct snd_dma_buffer dma_buffer;
379 unsigned int dma_buf_id; 379 unsigned int dma_buf_id;
@@ -825,6 +825,8 @@ int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
825int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, 825int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
826 unsigned int cond, 826 unsigned int cond,
827 snd_pcm_hw_param_t var); 827 snd_pcm_hw_param_t var);
828int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime,
829 unsigned int base_rate);
828int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, 830int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
829 unsigned int cond, 831 unsigned int cond,
830 int var, 832 int var,
@@ -1035,6 +1037,8 @@ static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area)
1035 atomic_dec(&substream->mmap_count); 1037 atomic_dec(&substream->mmap_count);
1036} 1038}
1037 1039
1040int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
1041 struct vm_area_struct *area);
1038/* mmap for io-memory area */ 1042/* mmap for io-memory area */
1039#if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) 1043#if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA)
1040#define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP 1044#define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
index 3d9afb6a8c9c..f352a98ce4f4 100644
--- a/include/sound/seq_kernel.h
+++ b/include/sound/seq_kernel.h
@@ -75,9 +75,9 @@ struct snd_seq_port_callback {
75}; 75};
76 76
77/* interface for kernel client */ 77/* interface for kernel client */
78__printf(3, 4)
78int snd_seq_create_kernel_client(struct snd_card *card, int client_index, 79int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
79 const char *name_fmt, ...) 80 const char *name_fmt, ...);
80 __attribute__ ((format (printf, 3, 4)));
81int snd_seq_delete_kernel_client(int client); 81int snd_seq_delete_kernel_client(int client);
82int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); 82int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
83int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop); 83int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
diff --git a/include/target/configfs_macros.h b/include/target/configfs_macros.h
index 7fe74608b437..a0fc85bbe2da 100644
--- a/include/target/configfs_macros.h
+++ b/include/target/configfs_macros.h
@@ -30,8 +30,8 @@
30 * Added CONFIGFS_EATTR() macros from original configfs.h macros 30 * Added CONFIGFS_EATTR() macros from original configfs.h macros
31 * Copright (C) 2008-2009 Nicholas A. Bellinger <nab@linux-iscsi.org> 31 * Copright (C) 2008-2009 Nicholas A. Bellinger <nab@linux-iscsi.org>
32 * 32 *
33 * Please read Documentation/filesystems/configfs.txt before using the 33 * Please read Documentation/filesystems/configfs/configfs.txt before using
34 * configfs interface, ESPECIALLY the parts about reference counts and 34 * the configfs interface, ESPECIALLY the parts about reference counts and
35 * item destructors. 35 * item destructors.
36 */ 36 */
37 37
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 27040653005e..7f5fed3c89e1 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -10,10 +10,7 @@
10#include <net/tcp.h> 10#include <net/tcp.h>
11 11
12#define TARGET_CORE_MOD_VERSION "v4.1.0-rc1-ml" 12#define TARGET_CORE_MOD_VERSION "v4.1.0-rc1-ml"
13#define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT))
14 13
15/* Used by transport_generic_allocate_iovecs() */
16#define TRANSPORT_IOV_DATA_BUFFER 5
17/* Maximum Number of LUNs per Target Portal Group */ 14/* Maximum Number of LUNs per Target Portal Group */
18/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */ 15/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */
19#define TRANSPORT_MAX_LUNS_PER_TPG 256 16#define TRANSPORT_MAX_LUNS_PER_TPG 256
@@ -75,32 +72,25 @@ enum transport_tpg_type_table {
75}; 72};
76 73
77/* Used for generate timer flags */ 74/* Used for generate timer flags */
78enum timer_flags_table { 75enum se_task_flags {
79 TF_RUNNING = 0x01, 76 TF_ACTIVE = (1 << 0),
80 TF_STOP = 0x02, 77 TF_SENT = (1 << 1),
78 TF_REQUEST_STOP = (1 << 2),
81}; 79};
82 80
83/* Special transport agnostic struct se_cmd->t_states */ 81/* Special transport agnostic struct se_cmd->t_states */
84enum transport_state_table { 82enum transport_state_table {
85 TRANSPORT_NO_STATE = 0, 83 TRANSPORT_NO_STATE = 0,
86 TRANSPORT_NEW_CMD = 1, 84 TRANSPORT_NEW_CMD = 1,
87 TRANSPORT_DEFERRED_CMD = 2,
88 TRANSPORT_WRITE_PENDING = 3, 85 TRANSPORT_WRITE_PENDING = 3,
89 TRANSPORT_PROCESS_WRITE = 4, 86 TRANSPORT_PROCESS_WRITE = 4,
90 TRANSPORT_PROCESSING = 5, 87 TRANSPORT_PROCESSING = 5,
91 TRANSPORT_COMPLETE_OK = 6, 88 TRANSPORT_COMPLETE = 6,
92 TRANSPORT_COMPLETE_FAILURE = 7,
93 TRANSPORT_COMPLETE_TIMEOUT = 8,
94 TRANSPORT_PROCESS_TMR = 9, 89 TRANSPORT_PROCESS_TMR = 9,
95 TRANSPORT_TMR_COMPLETE = 10,
96 TRANSPORT_ISTATE_PROCESSING = 11, 90 TRANSPORT_ISTATE_PROCESSING = 11,
97 TRANSPORT_ISTATE_PROCESSED = 12,
98 TRANSPORT_KILL = 13,
99 TRANSPORT_REMOVE = 14,
100 TRANSPORT_FREE = 15,
101 TRANSPORT_NEW_CMD_MAP = 16, 91 TRANSPORT_NEW_CMD_MAP = 16,
102 TRANSPORT_FREE_CMD_INTR = 17,
103 TRANSPORT_COMPLETE_QF_WP = 18, 92 TRANSPORT_COMPLETE_QF_WP = 18,
93 TRANSPORT_COMPLETE_QF_OK = 19,
104}; 94};
105 95
106/* Used for struct se_cmd->se_cmd_flags */ 96/* Used for struct se_cmd->se_cmd_flags */
@@ -124,8 +114,6 @@ enum se_cmd_flags_table {
124 SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, 114 SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000,
125 SCF_UNUSED = 0x00100000, 115 SCF_UNUSED = 0x00100000,
126 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, 116 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000,
127 SCF_EMULATE_CDB_ASYNC = 0x01000000,
128 SCF_EMULATE_QUEUE_FULL = 0x02000000,
129}; 117};
130 118
131/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ 119/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
@@ -401,34 +389,22 @@ struct se_queue_obj {
401} ____cacheline_aligned; 389} ____cacheline_aligned;
402 390
403struct se_task { 391struct se_task {
404 unsigned char task_sense;
405 struct scatterlist *task_sg;
406 u32 task_sg_nents;
407 struct scatterlist *task_sg_bidi;
408 u8 task_scsi_status;
409 u8 task_flags;
410 int task_error_status;
411 int task_state_flags;
412 bool task_padded_sg;
413 unsigned long long task_lba; 392 unsigned long long task_lba;
414 u32 task_no; 393 u32 task_sectors;
415 u32 task_sectors; 394 u32 task_size;
416 u32 task_size; 395 struct se_cmd *task_se_cmd;
396 struct scatterlist *task_sg;
397 u32 task_sg_nents;
398 u16 task_flags;
399 u8 task_sense;
400 u8 task_scsi_status;
401 int task_error_status;
417 enum dma_data_direction task_data_direction; 402 enum dma_data_direction task_data_direction;
418 struct se_cmd *task_se_cmd; 403 atomic_t task_state_active;
419 struct se_device *se_dev; 404 struct list_head t_list;
405 struct list_head t_execute_list;
406 struct list_head t_state_list;
420 struct completion task_stop_comp; 407 struct completion task_stop_comp;
421 atomic_t task_active;
422 atomic_t task_execute_queue;
423 atomic_t task_timeout;
424 atomic_t task_sent;
425 atomic_t task_stop;
426 atomic_t task_state_active;
427 struct timer_list task_timer;
428 struct se_device *se_obj_ptr;
429 struct list_head t_list;
430 struct list_head t_execute_list;
431 struct list_head t_state_list;
432} ____cacheline_aligned; 408} ____cacheline_aligned;
433 409
434struct se_cmd { 410struct se_cmd {
@@ -446,10 +422,11 @@ struct se_cmd {
446 int sam_task_attr; 422 int sam_task_attr;
447 /* Transport protocol dependent state, see transport_state_table */ 423 /* Transport protocol dependent state, see transport_state_table */
448 enum transport_state_table t_state; 424 enum transport_state_table t_state;
449 /* Transport protocol dependent state for out of order CmdSNs */
450 int deferred_t_state;
451 /* Transport specific error status */ 425 /* Transport specific error status */
452 int transport_error_status; 426 int transport_error_status;
427 /* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */
428 int check_release:1;
429 int cmd_wait_set:1;
453 /* See se_cmd_flags_table */ 430 /* See se_cmd_flags_table */
454 u32 se_cmd_flags; 431 u32 se_cmd_flags;
455 u32 se_ordered_id; 432 u32 se_ordered_id;
@@ -461,7 +438,6 @@ struct se_cmd {
461 u32 orig_fe_lun; 438 u32 orig_fe_lun;
462 /* Persistent Reservation key */ 439 /* Persistent Reservation key */
463 u64 pr_res_key; 440 u64 pr_res_key;
464 atomic_t transport_sent;
465 /* Used for sense data */ 441 /* Used for sense data */
466 void *sense_buffer; 442 void *sense_buffer;
467 struct list_head se_delayed_node; 443 struct list_head se_delayed_node;
@@ -477,12 +453,11 @@ struct se_cmd {
477 struct se_session *se_sess; 453 struct se_session *se_sess;
478 struct se_tmr_req *se_tmr_req; 454 struct se_tmr_req *se_tmr_req;
479 struct list_head se_queue_node; 455 struct list_head se_queue_node;
456 struct list_head se_cmd_list;
457 struct completion cmd_wait_comp;
480 struct target_core_fabric_ops *se_tfo; 458 struct target_core_fabric_ops *se_tfo;
481 int (*transport_emulate_cdb)(struct se_cmd *); 459 int (*execute_task)(struct se_task *);
482 void (*transport_split_cdb)(unsigned long long, u32, unsigned char *);
483 void (*transport_wait_for_tasks)(struct se_cmd *, int, int);
484 void (*transport_complete_callback)(struct se_cmd *); 460 void (*transport_complete_callback)(struct se_cmd *);
485 int (*transport_qf_callback)(struct se_cmd *);
486 461
487 unsigned char *t_task_cdb; 462 unsigned char *t_task_cdb;
488 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; 463 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
@@ -495,7 +470,6 @@ struct se_cmd {
495 atomic_t t_se_count; 470 atomic_t t_se_count;
496 atomic_t t_task_cdbs_left; 471 atomic_t t_task_cdbs_left;
497 atomic_t t_task_cdbs_ex_left; 472 atomic_t t_task_cdbs_ex_left;
498 atomic_t t_task_cdbs_timeout_left;
499 atomic_t t_task_cdbs_sent; 473 atomic_t t_task_cdbs_sent;
500 atomic_t t_transport_aborted; 474 atomic_t t_transport_aborted;
501 atomic_t t_transport_active; 475 atomic_t t_transport_active;
@@ -503,7 +477,6 @@ struct se_cmd {
503 atomic_t t_transport_queue_active; 477 atomic_t t_transport_queue_active;
504 atomic_t t_transport_sent; 478 atomic_t t_transport_sent;
505 atomic_t t_transport_stop; 479 atomic_t t_transport_stop;
506 atomic_t t_transport_timeout;
507 atomic_t transport_dev_active; 480 atomic_t transport_dev_active;
508 atomic_t transport_lun_active; 481 atomic_t transport_lun_active;
509 atomic_t transport_lun_fe_stop; 482 atomic_t transport_lun_fe_stop;
@@ -514,6 +487,8 @@ struct se_cmd {
514 struct completion transport_lun_stop_comp; 487 struct completion transport_lun_stop_comp;
515 struct scatterlist *t_tasks_sg_chained; 488 struct scatterlist *t_tasks_sg_chained;
516 489
490 struct work_struct work;
491
517 /* 492 /*
518 * Used for pre-registered fabric SGL passthrough WRITE and READ 493 * Used for pre-registered fabric SGL passthrough WRITE and READ
519 * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop 494 * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop
@@ -587,12 +562,16 @@ struct se_node_acl {
587} ____cacheline_aligned; 562} ____cacheline_aligned;
588 563
589struct se_session { 564struct se_session {
565 int sess_tearing_down:1;
590 u64 sess_bin_isid; 566 u64 sess_bin_isid;
591 struct se_node_acl *se_node_acl; 567 struct se_node_acl *se_node_acl;
592 struct se_portal_group *se_tpg; 568 struct se_portal_group *se_tpg;
593 void *fabric_sess_ptr; 569 void *fabric_sess_ptr;
594 struct list_head sess_list; 570 struct list_head sess_list;
595 struct list_head sess_acl_list; 571 struct list_head sess_acl_list;
572 struct list_head sess_cmd_list;
573 struct list_head sess_wait_list;
574 spinlock_t sess_cmd_lock;
596} ____cacheline_aligned; 575} ____cacheline_aligned;
597 576
598struct se_device; 577struct se_device;
@@ -670,7 +649,6 @@ struct se_dev_attrib {
670 u32 optimal_sectors; 649 u32 optimal_sectors;
671 u32 hw_queue_depth; 650 u32 hw_queue_depth;
672 u32 queue_depth; 651 u32 queue_depth;
673 u32 task_timeout;
674 u32 max_unmap_lba_count; 652 u32 max_unmap_lba_count;
675 u32 max_unmap_block_desc_count; 653 u32 max_unmap_block_desc_count;
676 u32 unmap_granularity; 654 u32 unmap_granularity;
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h
index 46571912086c..2be31ff8763b 100644
--- a/include/target/target_core_device.h
+++ b/include/target/target_core_device.h
@@ -17,7 +17,7 @@ extern int core_dev_export(struct se_device *, struct se_portal_group *,
17 struct se_lun *); 17 struct se_lun *);
18extern void core_dev_unexport(struct se_device *, struct se_portal_group *, 18extern void core_dev_unexport(struct se_device *, struct se_portal_group *,
19 struct se_lun *); 19 struct se_lun *);
20extern int transport_core_report_lun_response(struct se_cmd *); 20extern int target_report_luns(struct se_task *);
21extern void se_release_device_for_hba(struct se_device *); 21extern void se_release_device_for_hba(struct se_device *);
22extern void se_release_vpd_for_dev(struct se_device *); 22extern void se_release_vpd_for_dev(struct se_device *);
23extern void se_clear_dev_ports(struct se_device *); 23extern void se_clear_dev_ports(struct se_device *);
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h
index 2de8fe907596..0256825f923d 100644
--- a/include/target/target_core_fabric_ops.h
+++ b/include/target/target_core_fabric_ops.h
@@ -27,6 +27,12 @@ struct target_core_fabric_ops {
27 int (*tpg_check_demo_mode_cache)(struct se_portal_group *); 27 int (*tpg_check_demo_mode_cache)(struct se_portal_group *);
28 int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *); 28 int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *);
29 int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *); 29 int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *);
30 /*
31 * Optionally used by fabrics to allow demo-mode login, but not
32 * expose any TPG LUNs, and return 'not connected' in standard
33 * inquiry response
34 */
35 int (*tpg_check_demo_mode_login_only)(struct se_portal_group *);
30 struct se_node_acl *(*tpg_alloc_fabric_acl)( 36 struct se_node_acl *(*tpg_alloc_fabric_acl)(
31 struct se_portal_group *); 37 struct se_portal_group *);
32 void (*tpg_release_fabric_acl)(struct se_portal_group *, 38 void (*tpg_release_fabric_acl)(struct se_portal_group *,
@@ -40,9 +46,16 @@ struct target_core_fabric_ops {
40 int (*new_cmd_map)(struct se_cmd *); 46 int (*new_cmd_map)(struct se_cmd *);
41 /* 47 /*
42 * Optional to release struct se_cmd and fabric dependent allocated 48 * Optional to release struct se_cmd and fabric dependent allocated
43 * I/O descriptor in transport_cmd_check_stop() 49 * I/O descriptor in transport_cmd_check_stop().
50 *
51 * Returning 1 will signal a descriptor has been released.
52 * Returning 0 will signal a descriptor has not been released.
53 */
54 int (*check_stop_free)(struct se_cmd *);
55 /*
56 * Optional check for active I/O shutdown
44 */ 57 */
45 void (*check_stop_free)(struct se_cmd *); 58 int (*check_release_cmd)(struct se_cmd *);
46 void (*release_cmd)(struct se_cmd *); 59 void (*release_cmd)(struct se_cmd *);
47 /* 60 /*
48 * Called with spin_lock_bh(struct se_portal_group->session_lock held. 61 * Called with spin_lock_bh(struct se_portal_group->session_lock held.
diff --git a/include/target/target_core_tmr.h b/include/target/target_core_tmr.h
index bd5596807478..d5876e17d3fb 100644
--- a/include/target/target_core_tmr.h
+++ b/include/target/target_core_tmr.h
@@ -27,7 +27,7 @@ enum tcm_tmrsp_table {
27 27
28extern struct kmem_cache *se_tmr_req_cache; 28extern struct kmem_cache *se_tmr_req_cache;
29 29
30extern struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8); 30extern struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
31extern void core_tmr_release_req(struct se_tmr_req *); 31extern void core_tmr_release_req(struct se_tmr_req *);
32extern int core_tmr_lun_reset(struct se_device *, struct se_tmr_req *, 32extern int core_tmr_lun_reset(struct se_device *, struct se_tmr_req *,
33 struct list_head *, struct se_cmd *); 33 struct list_head *, struct se_cmd *);
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h
index 46aae4f94ede..c16e9431dd01 100644
--- a/include/target/target_core_transport.h
+++ b/include/target/target_core_transport.h
@@ -22,10 +22,9 @@
22#define PYX_TRANSPORT_LU_COMM_FAILURE -7 22#define PYX_TRANSPORT_LU_COMM_FAILURE -7
23#define PYX_TRANSPORT_UNKNOWN_MODE_PAGE -8 23#define PYX_TRANSPORT_UNKNOWN_MODE_PAGE -8
24#define PYX_TRANSPORT_WRITE_PROTECTED -9 24#define PYX_TRANSPORT_WRITE_PROTECTED -9
25#define PYX_TRANSPORT_TASK_TIMEOUT -10 25#define PYX_TRANSPORT_RESERVATION_CONFLICT -10
26#define PYX_TRANSPORT_RESERVATION_CONFLICT -11 26#define PYX_TRANSPORT_ILLEGAL_REQUEST -11
27#define PYX_TRANSPORT_ILLEGAL_REQUEST -12 27#define PYX_TRANSPORT_USE_SENSE_REASON -12
28#define PYX_TRANSPORT_USE_SENSE_REASON -13
29 28
30#ifndef SAM_STAT_RESERVATION_CONFLICT 29#ifndef SAM_STAT_RESERVATION_CONFLICT
31#define SAM_STAT_RESERVATION_CONFLICT 0x18 30#define SAM_STAT_RESERVATION_CONFLICT 0x18
@@ -38,16 +37,6 @@
38#define TRANSPORT_PLUGIN_VHBA_PDEV 2 37#define TRANSPORT_PLUGIN_VHBA_PDEV 2
39#define TRANSPORT_PLUGIN_VHBA_VDEV 3 38#define TRANSPORT_PLUGIN_VHBA_VDEV 3
40 39
41/* For SE OBJ Plugins, in seconds */
42#define TRANSPORT_TIMEOUT_TUR 10
43#define TRANSPORT_TIMEOUT_TYPE_DISK 60
44#define TRANSPORT_TIMEOUT_TYPE_ROM 120
45#define TRANSPORT_TIMEOUT_TYPE_TAPE 600
46#define TRANSPORT_TIMEOUT_TYPE_OTHER 300
47
48/* For se_task->task_state_flags */
49#define TSF_EXCEPTION_CLEARED 0x01
50
51/* 40/*
52 * struct se_subsystem_dev->su_dev_flags 41 * struct se_subsystem_dev->su_dev_flags
53*/ 42*/
@@ -64,8 +53,6 @@
64#define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000004 53#define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000004
65 54
66/* struct se_dev_attrib sanity values */ 55/* struct se_dev_attrib sanity values */
67/* 10 Minutes */
68#define DA_TASK_TIMEOUT_MAX 600
69/* Default max_unmap_lba_count */ 56/* Default max_unmap_lba_count */
70#define DA_MAX_UNMAP_LBA_COUNT 0 57#define DA_MAX_UNMAP_LBA_COUNT 0
71/* Default max_unmap_block_desc_count */ 58/* Default max_unmap_block_desc_count */
@@ -110,16 +97,13 @@
110 97
111#define MOD_MAX_SECTORS(ms, bs) (ms % (PAGE_SIZE / bs)) 98#define MOD_MAX_SECTORS(ms, bs) (ms % (PAGE_SIZE / bs))
112 99
113struct se_mem;
114struct se_subsystem_api; 100struct se_subsystem_api;
115 101
116extern struct kmem_cache *se_mem_cache;
117
118extern int init_se_kmem_caches(void); 102extern int init_se_kmem_caches(void);
119extern void release_se_kmem_caches(void); 103extern void release_se_kmem_caches(void);
120extern u32 scsi_get_new_index(scsi_index_t); 104extern u32 scsi_get_new_index(scsi_index_t);
121extern void transport_init_queue_obj(struct se_queue_obj *); 105extern void transport_init_queue_obj(struct se_queue_obj *);
122extern int transport_subsystem_check_init(void); 106extern void transport_subsystem_check_init(void);
123extern int transport_subsystem_register(struct se_subsystem_api *); 107extern int transport_subsystem_register(struct se_subsystem_api *);
124extern void transport_subsystem_release(struct se_subsystem_api *); 108extern void transport_subsystem_release(struct se_subsystem_api *);
125extern void transport_load_plugins(void); 109extern void transport_load_plugins(void);
@@ -134,7 +118,6 @@ extern void transport_free_session(struct se_session *);
134extern void transport_deregister_session_configfs(struct se_session *); 118extern void transport_deregister_session_configfs(struct se_session *);
135extern void transport_deregister_session(struct se_session *); 119extern void transport_deregister_session(struct se_session *);
136extern void transport_cmd_finish_abort(struct se_cmd *, int); 120extern void transport_cmd_finish_abort(struct se_cmd *, int);
137extern void transport_cmd_finish_abort_tmr(struct se_cmd *);
138extern void transport_complete_sync_cache(struct se_cmd *, int); 121extern void transport_complete_sync_cache(struct se_cmd *, int);
139extern void transport_complete_task(struct se_task *, int); 122extern void transport_complete_task(struct se_task *, int);
140extern void transport_add_task_to_execute_queue(struct se_task *, 123extern void transport_add_task_to_execute_queue(struct se_task *,
@@ -142,6 +125,8 @@ extern void transport_add_task_to_execute_queue(struct se_task *,
142 struct se_device *); 125 struct se_device *);
143extern void transport_remove_task_from_execute_queue(struct se_task *, 126extern void transport_remove_task_from_execute_queue(struct se_task *,
144 struct se_device *); 127 struct se_device *);
128extern void __transport_remove_task_from_execute_queue(struct se_task *,
129 struct se_device *);
145unsigned char *transport_dump_cmd_direction(struct se_cmd *); 130unsigned char *transport_dump_cmd_direction(struct se_cmd *);
146extern void transport_dump_dev_state(struct se_device *, char *, int *); 131extern void transport_dump_dev_state(struct se_device *, char *, int *);
147extern void transport_dump_dev_info(struct se_device *, struct se_lun *, 132extern void transport_dump_dev_info(struct se_device *, struct se_lun *,
@@ -169,29 +154,27 @@ extern void transport_init_se_cmd(struct se_cmd *,
169 unsigned char *); 154 unsigned char *);
170void *transport_kmap_first_data_page(struct se_cmd *cmd); 155void *transport_kmap_first_data_page(struct se_cmd *cmd);
171void transport_kunmap_first_data_page(struct se_cmd *cmd); 156void transport_kunmap_first_data_page(struct se_cmd *cmd);
172extern void transport_free_se_cmd(struct se_cmd *);
173extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); 157extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
174extern int transport_generic_handle_cdb(struct se_cmd *);
175extern int transport_handle_cdb_direct(struct se_cmd *); 158extern int transport_handle_cdb_direct(struct se_cmd *);
176extern int transport_generic_handle_cdb_map(struct se_cmd *); 159extern int transport_generic_handle_cdb_map(struct se_cmd *);
177extern int transport_generic_handle_data(struct se_cmd *); 160extern int transport_generic_handle_data(struct se_cmd *);
178extern void transport_new_cmd_failure(struct se_cmd *); 161extern void transport_new_cmd_failure(struct se_cmd *);
179extern int transport_generic_handle_tmr(struct se_cmd *); 162extern int transport_generic_handle_tmr(struct se_cmd *);
180extern void transport_generic_free_cmd_intr(struct se_cmd *); 163extern bool target_stop_task(struct se_task *task, unsigned long *flags);
181extern void __transport_stop_task_timer(struct se_task *, unsigned long *);
182extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, 164extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32,
183 struct scatterlist *, u32); 165 struct scatterlist *, u32);
184extern int transport_clear_lun_from_sessions(struct se_lun *); 166extern int transport_clear_lun_from_sessions(struct se_lun *);
167extern bool transport_wait_for_tasks(struct se_cmd *);
185extern int transport_check_aborted_status(struct se_cmd *, int); 168extern int transport_check_aborted_status(struct se_cmd *, int);
186extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); 169extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int);
187extern void transport_send_task_abort(struct se_cmd *); 170extern void transport_send_task_abort(struct se_cmd *);
188extern void transport_release_cmd(struct se_cmd *); 171extern void transport_release_cmd(struct se_cmd *);
189extern void transport_generic_free_cmd(struct se_cmd *, int, int); 172extern void transport_generic_free_cmd(struct se_cmd *, int);
173extern void target_get_sess_cmd(struct se_session *, struct se_cmd *);
174extern int target_put_sess_cmd(struct se_session *, struct se_cmd *);
175extern void target_splice_sess_cmd_list(struct se_session *);
176extern void target_wait_for_sess_cmds(struct se_session *, int);
190extern void transport_generic_wait_for_cmds(struct se_cmd *, int); 177extern void transport_generic_wait_for_cmds(struct se_cmd *, int);
191extern int transport_init_task_sg(struct se_task *, struct se_mem *, u32);
192extern int transport_map_mem_to_sg(struct se_task *, struct list_head *,
193 struct scatterlist *, struct se_mem *,
194 struct se_mem **, u32 *, u32 *);
195extern void transport_do_task_sg_chain(struct se_cmd *); 178extern void transport_do_task_sg_chain(struct se_cmd *);
196extern void transport_generic_process_write(struct se_cmd *); 179extern void transport_generic_process_write(struct se_cmd *);
197extern int transport_generic_new_cmd(struct se_cmd *); 180extern int transport_generic_new_cmd(struct se_cmd *);
@@ -200,6 +183,7 @@ extern int transport_generic_do_tmr(struct se_cmd *);
200extern int core_alua_check_nonop_delay(struct se_cmd *); 183extern int core_alua_check_nonop_delay(struct se_cmd *);
201/* From target_core_cdb.c */ 184/* From target_core_cdb.c */
202extern int transport_emulate_control_cdb(struct se_task *); 185extern int transport_emulate_control_cdb(struct se_task *);
186extern void target_get_task_cdb(struct se_task *task, unsigned char *cdb);
203 187
204/* 188/*
205 * Each se_transport_task_t can have N number of possible struct se_task's 189 * Each se_transport_task_t can have N number of possible struct se_task's
@@ -227,6 +211,10 @@ struct se_subsystem_api {
227 * Transport Type. 211 * Transport Type.
228 */ 212 */
229 u8 transport_type; 213 u8 transport_type;
214
215 unsigned int fua_write_emulated : 1;
216 unsigned int write_cache_emulated : 1;
217
230 /* 218 /*
231 * struct module for struct se_hba references 219 * struct module for struct se_hba references
232 */ 220 */
@@ -236,18 +224,6 @@ struct se_subsystem_api {
236 */ 224 */
237 struct list_head sub_api_list; 225 struct list_head sub_api_list;
238 /* 226 /*
239 * For SCF_SCSI_NON_DATA_CDB
240 */
241 int (*cdb_none)(struct se_task *);
242 /*
243 * For SCF_SCSI_DATA_SG_IO_CDB
244 */
245 int (*map_data_SG)(struct se_task *);
246 /*
247 * For SCF_SCSI_CONTROL_SG_IO_CDB
248 */
249 int (*map_control_SG)(struct se_task *);
250 /*
251 * attach_hba(): 227 * attach_hba():
252 */ 228 */
253 int (*attach_hba)(struct se_hba *, u32); 229 int (*attach_hba)(struct se_hba *, u32);
@@ -275,22 +251,6 @@ struct se_subsystem_api {
275 void (*free_device)(void *); 251 void (*free_device)(void *);
276 252
277 /* 253 /*
278 * dpo_emulated():
279 */
280 int (*dpo_emulated)(struct se_device *);
281 /*
282 * fua_write_emulated():
283 */
284 int (*fua_write_emulated)(struct se_device *);
285 /*
286 * fua_read_emulated():
287 */
288 int (*fua_read_emulated)(struct se_device *);
289 /*
290 * write_cache_emulated():
291 */
292 int (*write_cache_emulated)(struct se_device *);
293 /*
294 * transport_complete(): 254 * transport_complete():
295 * 255 *
296 * Use transport_generic_complete() for majority of DAS transport 256 * Use transport_generic_complete() for majority of DAS transport
@@ -331,10 +291,6 @@ struct se_subsystem_api {
331 ssize_t (*show_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *, 291 ssize_t (*show_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *,
332 char *); 292 char *);
333 /* 293 /*
334 * get_cdb():
335 */
336 unsigned char *(*get_cdb)(struct se_task *);
337 /*
338 * get_device_rev(): 294 * get_device_rev():
339 */ 295 */
340 u32 (*get_device_rev)(struct se_device *); 296 u32 (*get_device_rev)(struct se_device *);
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index da39b22636f7..b0b4eb24d592 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -21,16 +21,6 @@
21#undef CREATE_TRACE_POINTS 21#undef CREATE_TRACE_POINTS
22 22
23#include <linux/stringify.h> 23#include <linux/stringify.h>
24/*
25 * module.h includes tracepoints, and because ftrace.h
26 * pulls in module.h:
27 * trace/ftrace.h -> linux/ftrace_event.h -> linux/perf_event.h ->
28 * linux/ftrace.h -> linux/module.h
29 * we must include module.h here before we play with any of
30 * the TRACE_EVENT() macros, otherwise the tracepoints included
31 * by module.h may break the build.
32 */
33#include <linux/module.h>
34 24
35#undef TRACE_EVENT 25#undef TRACE_EVENT
36#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ 26#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
diff --git a/include/trace/events/9p.h b/include/trace/events/9p.h
new file mode 100644
index 000000000000..beeaed8398ec
--- /dev/null
+++ b/include/trace/events/9p.h
@@ -0,0 +1,176 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM 9p
3
4#if !defined(_TRACE_9P_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_9P_H
6
7#include <linux/tracepoint.h>
8
9#define show_9p_op(type) \
10 __print_symbolic(type, \
11 { P9_TLERROR, "P9_TLERROR" }, \
12 { P9_RLERROR, "P9_RLERROR" }, \
13 { P9_TSTATFS, "P9_TSTATFS" }, \
14 { P9_RSTATFS, "P9_RSTATFS" }, \
15 { P9_TLOPEN, "P9_TLOPEN" }, \
16 { P9_RLOPEN, "P9_RLOPEN" }, \
17 { P9_TLCREATE, "P9_TLCREATE" }, \
18 { P9_RLCREATE, "P9_RLCREATE" }, \
19 { P9_TSYMLINK, "P9_TSYMLINK" }, \
20 { P9_RSYMLINK, "P9_RSYMLINK" }, \
21 { P9_TMKNOD, "P9_TMKNOD" }, \
22 { P9_RMKNOD, "P9_RMKNOD" }, \
23 { P9_TRENAME, "P9_TRENAME" }, \
24 { P9_RRENAME, "P9_RRENAME" }, \
25 { P9_TREADLINK, "P9_TREADLINK" }, \
26 { P9_RREADLINK, "P9_RREADLINK" }, \
27 { P9_TGETATTR, "P9_TGETATTR" }, \
28 { P9_RGETATTR, "P9_RGETATTR" }, \
29 { P9_TSETATTR, "P9_TSETATTR" }, \
30 { P9_RSETATTR, "P9_RSETATTR" }, \
31 { P9_TXATTRWALK, "P9_TXATTRWALK" }, \
32 { P9_RXATTRWALK, "P9_RXATTRWALK" }, \
33 { P9_TXATTRCREATE, "P9_TXATTRCREATE" }, \
34 { P9_RXATTRCREATE, "P9_RXATTRCREATE" }, \
35 { P9_TREADDIR, "P9_TREADDIR" }, \
36 { P9_RREADDIR, "P9_RREADDIR" }, \
37 { P9_TFSYNC, "P9_TFSYNC" }, \
38 { P9_RFSYNC, "P9_RFSYNC" }, \
39 { P9_TLOCK, "P9_TLOCK" }, \
40 { P9_RLOCK, "P9_RLOCK" }, \
41 { P9_TGETLOCK, "P9_TGETLOCK" }, \
42 { P9_RGETLOCK, "P9_RGETLOCK" }, \
43 { P9_TLINK, "P9_TLINK" }, \
44 { P9_RLINK, "P9_RLINK" }, \
45 { P9_TMKDIR, "P9_TMKDIR" }, \
46 { P9_RMKDIR, "P9_RMKDIR" }, \
47 { P9_TRENAMEAT, "P9_TRENAMEAT" }, \
48 { P9_RRENAMEAT, "P9_RRENAMEAT" }, \
49 { P9_TUNLINKAT, "P9_TUNLINKAT" }, \
50 { P9_RUNLINKAT, "P9_RUNLINKAT" }, \
51 { P9_TVERSION, "P9_TVERSION" }, \
52 { P9_RVERSION, "P9_RVERSION" }, \
53 { P9_TAUTH, "P9_TAUTH" }, \
54 { P9_RAUTH, "P9_RAUTH" }, \
55 { P9_TATTACH, "P9_TATTACH" }, \
56 { P9_RATTACH, "P9_RATTACH" }, \
57 { P9_TERROR, "P9_TERROR" }, \
58 { P9_RERROR, "P9_RERROR" }, \
59 { P9_TFLUSH, "P9_TFLUSH" }, \
60 { P9_RFLUSH, "P9_RFLUSH" }, \
61 { P9_TWALK, "P9_TWALK" }, \
62 { P9_RWALK, "P9_RWALK" }, \
63 { P9_TOPEN, "P9_TOPEN" }, \
64 { P9_ROPEN, "P9_ROPEN" }, \
65 { P9_TCREATE, "P9_TCREATE" }, \
66 { P9_RCREATE, "P9_RCREATE" }, \
67 { P9_TREAD, "P9_TREAD" }, \
68 { P9_RREAD, "P9_RREAD" }, \
69 { P9_TWRITE, "P9_TWRITE" }, \
70 { P9_RWRITE, "P9_RWRITE" }, \
71 { P9_TCLUNK, "P9_TCLUNK" }, \
72 { P9_RCLUNK, "P9_RCLUNK" }, \
73 { P9_TREMOVE, "P9_TREMOVE" }, \
74 { P9_RREMOVE, "P9_RREMOVE" }, \
75 { P9_TSTAT, "P9_TSTAT" }, \
76 { P9_RSTAT, "P9_RSTAT" }, \
77 { P9_TWSTAT, "P9_TWSTAT" }, \
78 { P9_RWSTAT, "P9_RWSTAT" })
79
80TRACE_EVENT(9p_client_req,
81 TP_PROTO(struct p9_client *clnt, int8_t type, int tag),
82
83 TP_ARGS(clnt, type, tag),
84
85 TP_STRUCT__entry(
86 __field( void *, clnt )
87 __field( __u8, type )
88 __field( __u32, tag )
89 ),
90
91 TP_fast_assign(
92 __entry->clnt = clnt;
93 __entry->type = type;
94 __entry->tag = tag;
95 ),
96
97 TP_printk("client %lu request %s tag %d",
98 (long)__entry->clnt, show_9p_op(__entry->type),
99 __entry->tag)
100 );
101
102TRACE_EVENT(9p_client_res,
103 TP_PROTO(struct p9_client *clnt, int8_t type, int tag, int err),
104
105 TP_ARGS(clnt, type, tag, err),
106
107 TP_STRUCT__entry(
108 __field( void *, clnt )
109 __field( __u8, type )
110 __field( __u32, tag )
111 __field( __u32, err )
112 ),
113
114 TP_fast_assign(
115 __entry->clnt = clnt;
116 __entry->type = type;
117 __entry->tag = tag;
118 __entry->err = err;
119 ),
120
121 TP_printk("client %lu response %s tag %d err %d",
122 (long)__entry->clnt, show_9p_op(__entry->type),
123 __entry->tag, __entry->err)
124);
125
126/* dump 32 bytes of protocol data */
127#define P9_PROTO_DUMP_SZ 32
128TRACE_EVENT(9p_protocol_dump,
129 TP_PROTO(struct p9_client *clnt, struct p9_fcall *pdu),
130
131 TP_ARGS(clnt, pdu),
132
133 TP_STRUCT__entry(
134 __field( void *, clnt )
135 __field( __u8, type )
136 __field( __u16, tag )
137 __array( unsigned char, line, P9_PROTO_DUMP_SZ )
138 ),
139
140 TP_fast_assign(
141 __entry->clnt = clnt;
142 __entry->type = pdu->id;
143 __entry->tag = pdu->tag;
144 memcpy(__entry->line, pdu->sdata, P9_PROTO_DUMP_SZ);
145 ),
146 TP_printk("clnt %lu %s(tag = %d)\n%.3x: "
147 "%02x %02x %02x %02x %02x %02x %02x %02x "
148 "%02x %02x %02x %02x %02x %02x %02x %02x\n"
149 "%.3x: "
150 "%02x %02x %02x %02x %02x %02x %02x %02x "
151 "%02x %02x %02x %02x %02x %02x %02x %02x\n",
152 (long)__entry->clnt, show_9p_op(__entry->type),
153 __entry->tag, 0,
154 __entry->line[0], __entry->line[1],
155 __entry->line[2], __entry->line[3],
156 __entry->line[4], __entry->line[5],
157 __entry->line[6], __entry->line[7],
158 __entry->line[8], __entry->line[9],
159 __entry->line[10], __entry->line[11],
160 __entry->line[12], __entry->line[13],
161 __entry->line[14], __entry->line[15],
162 16,
163 __entry->line[16], __entry->line[17],
164 __entry->line[18], __entry->line[19],
165 __entry->line[20], __entry->line[21],
166 __entry->line[22], __entry->line[23],
167 __entry->line[24], __entry->line[25],
168 __entry->line[26], __entry->line[27],
169 __entry->line[28], __entry->line[29],
170 __entry->line[30], __entry->line[31])
171 );
172
173#endif /* _TRACE_9P_H */
174
175/* This part must be outside protection */
176#include <trace/define_trace.h>
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index bf366547da25..05c5e61f0a7c 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -8,6 +8,8 @@
8#include <linux/blkdev.h> 8#include <linux/blkdev.h>
9#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
10 10
11#define RWBS_LEN 8
12
11DECLARE_EVENT_CLASS(block_rq_with_error, 13DECLARE_EVENT_CLASS(block_rq_with_error,
12 14
13 TP_PROTO(struct request_queue *q, struct request *rq), 15 TP_PROTO(struct request_queue *q, struct request *rq),
@@ -19,7 +21,7 @@ DECLARE_EVENT_CLASS(block_rq_with_error,
19 __field( sector_t, sector ) 21 __field( sector_t, sector )
20 __field( unsigned int, nr_sector ) 22 __field( unsigned int, nr_sector )
21 __field( int, errors ) 23 __field( int, errors )
22 __array( char, rwbs, 6 ) 24 __array( char, rwbs, RWBS_LEN )
23 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 25 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
24 ), 26 ),
25 27
@@ -104,7 +106,7 @@ DECLARE_EVENT_CLASS(block_rq,
104 __field( sector_t, sector ) 106 __field( sector_t, sector )
105 __field( unsigned int, nr_sector ) 107 __field( unsigned int, nr_sector )
106 __field( unsigned int, bytes ) 108 __field( unsigned int, bytes )
107 __array( char, rwbs, 6 ) 109 __array( char, rwbs, RWBS_LEN )
108 __array( char, comm, TASK_COMM_LEN ) 110 __array( char, comm, TASK_COMM_LEN )
109 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 111 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
110 ), 112 ),
@@ -183,7 +185,7 @@ TRACE_EVENT(block_bio_bounce,
183 __field( dev_t, dev ) 185 __field( dev_t, dev )
184 __field( sector_t, sector ) 186 __field( sector_t, sector )
185 __field( unsigned int, nr_sector ) 187 __field( unsigned int, nr_sector )
186 __array( char, rwbs, 6 ) 188 __array( char, rwbs, RWBS_LEN )
187 __array( char, comm, TASK_COMM_LEN ) 189 __array( char, comm, TASK_COMM_LEN )
188 ), 190 ),
189 191
@@ -222,7 +224,7 @@ TRACE_EVENT(block_bio_complete,
222 __field( sector_t, sector ) 224 __field( sector_t, sector )
223 __field( unsigned, nr_sector ) 225 __field( unsigned, nr_sector )
224 __field( int, error ) 226 __field( int, error )
225 __array( char, rwbs, 6 ) 227 __array( char, rwbs, RWBS_LEN)
226 ), 228 ),
227 229
228 TP_fast_assign( 230 TP_fast_assign(
@@ -249,7 +251,7 @@ DECLARE_EVENT_CLASS(block_bio,
249 __field( dev_t, dev ) 251 __field( dev_t, dev )
250 __field( sector_t, sector ) 252 __field( sector_t, sector )
251 __field( unsigned int, nr_sector ) 253 __field( unsigned int, nr_sector )
252 __array( char, rwbs, 6 ) 254 __array( char, rwbs, RWBS_LEN )
253 __array( char, comm, TASK_COMM_LEN ) 255 __array( char, comm, TASK_COMM_LEN )
254 ), 256 ),
255 257
@@ -321,7 +323,7 @@ DECLARE_EVENT_CLASS(block_get_rq,
321 __field( dev_t, dev ) 323 __field( dev_t, dev )
322 __field( sector_t, sector ) 324 __field( sector_t, sector )
323 __field( unsigned int, nr_sector ) 325 __field( unsigned int, nr_sector )
324 __array( char, rwbs, 6 ) 326 __array( char, rwbs, RWBS_LEN )
325 __array( char, comm, TASK_COMM_LEN ) 327 __array( char, comm, TASK_COMM_LEN )
326 ), 328 ),
327 329
@@ -456,7 +458,7 @@ TRACE_EVENT(block_split,
456 __field( dev_t, dev ) 458 __field( dev_t, dev )
457 __field( sector_t, sector ) 459 __field( sector_t, sector )
458 __field( sector_t, new_sector ) 460 __field( sector_t, new_sector )
459 __array( char, rwbs, 6 ) 461 __array( char, rwbs, RWBS_LEN )
460 __array( char, comm, TASK_COMM_LEN ) 462 __array( char, comm, TASK_COMM_LEN )
461 ), 463 ),
462 464
@@ -498,7 +500,7 @@ TRACE_EVENT(block_bio_remap,
498 __field( unsigned int, nr_sector ) 500 __field( unsigned int, nr_sector )
499 __field( dev_t, old_dev ) 501 __field( dev_t, old_dev )
500 __field( sector_t, old_sector ) 502 __field( sector_t, old_sector )
501 __array( char, rwbs, 6 ) 503 __array( char, rwbs, RWBS_LEN)
502 ), 504 ),
503 505
504 TP_fast_assign( 506 TP_fast_assign(
@@ -542,7 +544,7 @@ TRACE_EVENT(block_rq_remap,
542 __field( unsigned int, nr_sector ) 544 __field( unsigned int, nr_sector )
543 __field( dev_t, old_dev ) 545 __field( dev_t, old_dev )
544 __field( sector_t, old_sector ) 546 __field( sector_t, old_sector )
545 __array( char, rwbs, 6 ) 547 __array( char, rwbs, RWBS_LEN)
546 ), 548 ),
547 549
548 TP_fast_assign( 550 TP_fast_assign(
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index b50a54736242..748ff7cbe555 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -9,9 +9,12 @@
9 9
10struct ext4_allocation_context; 10struct ext4_allocation_context;
11struct ext4_allocation_request; 11struct ext4_allocation_request;
12struct ext4_extent;
12struct ext4_prealloc_space; 13struct ext4_prealloc_space;
13struct ext4_inode_info; 14struct ext4_inode_info;
14struct mpage_da_data; 15struct mpage_da_data;
16struct ext4_map_blocks;
17struct ext4_extent;
15 18
16#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) 19#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
17 20
@@ -1032,9 +1035,9 @@ TRACE_EVENT(ext4_forget,
1032); 1035);
1033 1036
1034TRACE_EVENT(ext4_da_update_reserve_space, 1037TRACE_EVENT(ext4_da_update_reserve_space,
1035 TP_PROTO(struct inode *inode, int used_blocks), 1038 TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
1036 1039
1037 TP_ARGS(inode, used_blocks), 1040 TP_ARGS(inode, used_blocks, quota_claim),
1038 1041
1039 TP_STRUCT__entry( 1042 TP_STRUCT__entry(
1040 __field( dev_t, dev ) 1043 __field( dev_t, dev )
@@ -1045,6 +1048,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1045 __field( int, reserved_data_blocks ) 1048 __field( int, reserved_data_blocks )
1046 __field( int, reserved_meta_blocks ) 1049 __field( int, reserved_meta_blocks )
1047 __field( int, allocated_meta_blocks ) 1050 __field( int, allocated_meta_blocks )
1051 __field( int, quota_claim )
1048 ), 1052 ),
1049 1053
1050 TP_fast_assign( 1054 TP_fast_assign(
@@ -1053,19 +1057,24 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1053 __entry->mode = inode->i_mode; 1057 __entry->mode = inode->i_mode;
1054 __entry->i_blocks = inode->i_blocks; 1058 __entry->i_blocks = inode->i_blocks;
1055 __entry->used_blocks = used_blocks; 1059 __entry->used_blocks = used_blocks;
1056 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks; 1060 __entry->reserved_data_blocks =
1057 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks; 1061 EXT4_I(inode)->i_reserved_data_blocks;
1058 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks; 1062 __entry->reserved_meta_blocks =
1063 EXT4_I(inode)->i_reserved_meta_blocks;
1064 __entry->allocated_meta_blocks =
1065 EXT4_I(inode)->i_allocated_meta_blocks;
1066 __entry->quota_claim = quota_claim;
1059 ), 1067 ),
1060 1068
1061 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d " 1069 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1062 "reserved_data_blocks %d reserved_meta_blocks %d " 1070 "reserved_data_blocks %d reserved_meta_blocks %d "
1063 "allocated_meta_blocks %d", 1071 "allocated_meta_blocks %d quota_claim %d",
1064 MAJOR(__entry->dev), MINOR(__entry->dev), 1072 MAJOR(__entry->dev), MINOR(__entry->dev),
1065 (unsigned long) __entry->ino, 1073 (unsigned long) __entry->ino,
1066 __entry->mode, __entry->i_blocks, 1074 __entry->mode, __entry->i_blocks,
1067 __entry->used_blocks, __entry->reserved_data_blocks, 1075 __entry->used_blocks, __entry->reserved_data_blocks,
1068 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1076 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks,
1077 __entry->quota_claim)
1069); 1078);
1070 1079
1071TRACE_EVENT(ext4_da_reserve_space, 1080TRACE_EVENT(ext4_da_reserve_space,
@@ -1386,6 +1395,87 @@ DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1386 TP_ARGS(inode) 1395 TP_ARGS(inode)
1387); 1396);
1388 1397
1398/* 'ux' is the uninitialized extent. */
1399TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
1400 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1401 struct ext4_extent *ux),
1402
1403 TP_ARGS(inode, map, ux),
1404
1405 TP_STRUCT__entry(
1406 __field( ino_t, ino )
1407 __field( dev_t, dev )
1408 __field( ext4_lblk_t, m_lblk )
1409 __field( unsigned, m_len )
1410 __field( ext4_lblk_t, u_lblk )
1411 __field( unsigned, u_len )
1412 __field( ext4_fsblk_t, u_pblk )
1413 ),
1414
1415 TP_fast_assign(
1416 __entry->ino = inode->i_ino;
1417 __entry->dev = inode->i_sb->s_dev;
1418 __entry->m_lblk = map->m_lblk;
1419 __entry->m_len = map->m_len;
1420 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1421 __entry->u_len = ext4_ext_get_actual_len(ux);
1422 __entry->u_pblk = ext4_ext_pblock(ux);
1423 ),
1424
1425 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1426 "u_pblk %llu",
1427 MAJOR(__entry->dev), MINOR(__entry->dev),
1428 (unsigned long) __entry->ino,
1429 __entry->m_lblk, __entry->m_len,
1430 __entry->u_lblk, __entry->u_len, __entry->u_pblk)
1431);
1432
1433/*
1434 * 'ux' is the uninitialized extent.
1435 * 'ix' is the initialized extent to which blocks are transferred.
1436 */
1437TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
1438 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1439 struct ext4_extent *ux, struct ext4_extent *ix),
1440
1441 TP_ARGS(inode, map, ux, ix),
1442
1443 TP_STRUCT__entry(
1444 __field( ino_t, ino )
1445 __field( dev_t, dev )
1446 __field( ext4_lblk_t, m_lblk )
1447 __field( unsigned, m_len )
1448 __field( ext4_lblk_t, u_lblk )
1449 __field( unsigned, u_len )
1450 __field( ext4_fsblk_t, u_pblk )
1451 __field( ext4_lblk_t, i_lblk )
1452 __field( unsigned, i_len )
1453 __field( ext4_fsblk_t, i_pblk )
1454 ),
1455
1456 TP_fast_assign(
1457 __entry->ino = inode->i_ino;
1458 __entry->dev = inode->i_sb->s_dev;
1459 __entry->m_lblk = map->m_lblk;
1460 __entry->m_len = map->m_len;
1461 __entry->u_lblk = le32_to_cpu(ux->ee_block);
1462 __entry->u_len = ext4_ext_get_actual_len(ux);
1463 __entry->u_pblk = ext4_ext_pblock(ux);
1464 __entry->i_lblk = le32_to_cpu(ix->ee_block);
1465 __entry->i_len = ext4_ext_get_actual_len(ix);
1466 __entry->i_pblk = ext4_ext_pblock(ix);
1467 ),
1468
1469 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1470 "u_lblk %u u_len %u u_pblk %llu "
1471 "i_lblk %u i_len %u i_pblk %llu ",
1472 MAJOR(__entry->dev), MINOR(__entry->dev),
1473 (unsigned long) __entry->ino,
1474 __entry->m_lblk, __entry->m_len,
1475 __entry->u_lblk, __entry->u_len, __entry->u_pblk,
1476 __entry->i_lblk, __entry->i_len, __entry->i_pblk)
1477);
1478
1389DECLARE_EVENT_CLASS(ext4__map_blocks_enter, 1479DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1390 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, 1480 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1391 unsigned int len, unsigned int flags), 1481 unsigned int len, unsigned int flags),
@@ -1589,6 +1679,382 @@ DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1589 TP_ARGS(sb, group, start, len) 1679 TP_ARGS(sb, group, start, len)
1590); 1680);
1591 1681
1682TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
1683 TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1684 unsigned int allocated, ext4_fsblk_t newblock),
1685
1686 TP_ARGS(inode, map, allocated, newblock),
1687
1688 TP_STRUCT__entry(
1689 __field( ino_t, ino )
1690 __field( dev_t, dev )
1691 __field( ext4_lblk_t, lblk )
1692 __field( ext4_fsblk_t, pblk )
1693 __field( unsigned int, len )
1694 __field( int, flags )
1695 __field( unsigned int, allocated )
1696 __field( ext4_fsblk_t, newblk )
1697 ),
1698
1699 TP_fast_assign(
1700 __entry->ino = inode->i_ino;
1701 __entry->dev = inode->i_sb->s_dev;
1702 __entry->lblk = map->m_lblk;
1703 __entry->pblk = map->m_pblk;
1704 __entry->len = map->m_len;
1705 __entry->flags = map->m_flags;
1706 __entry->allocated = allocated;
1707 __entry->newblk = newblock;
1708 ),
1709
1710 TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %d"
1711 "allocated %d newblock %llu",
1712 MAJOR(__entry->dev), MINOR(__entry->dev),
1713 (unsigned long) __entry->ino,
1714 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
1715 __entry->len, __entry->flags,
1716 (unsigned int) __entry->allocated,
1717 (unsigned long long) __entry->newblk)
1718);
1719
1720TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1721 TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1722
1723 TP_ARGS(sb, map, ret),
1724
1725 TP_STRUCT__entry(
1726 __field( dev_t, dev )
1727 __field( ext4_lblk_t, lblk )
1728 __field( ext4_fsblk_t, pblk )
1729 __field( unsigned int, len )
1730 __field( unsigned int, flags )
1731 __field( int, ret )
1732 ),
1733
1734 TP_fast_assign(
1735 __entry->dev = sb->s_dev;
1736 __entry->lblk = map->m_lblk;
1737 __entry->pblk = map->m_pblk;
1738 __entry->len = map->m_len;
1739 __entry->flags = map->m_flags;
1740 __entry->ret = ret;
1741 ),
1742
1743 TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %u ret %d",
1744 MAJOR(__entry->dev), MINOR(__entry->dev),
1745 __entry->lblk, (unsigned long long) __entry->pblk,
1746 __entry->len, __entry->flags, __entry->ret)
1747);
1748
1749TRACE_EVENT(ext4_ext_put_in_cache,
1750 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1751 ext4_fsblk_t start),
1752
1753 TP_ARGS(inode, lblk, len, start),
1754
1755 TP_STRUCT__entry(
1756 __field( ino_t, ino )
1757 __field( dev_t, dev )
1758 __field( ext4_lblk_t, lblk )
1759 __field( unsigned int, len )
1760 __field( ext4_fsblk_t, start )
1761 ),
1762
1763 TP_fast_assign(
1764 __entry->ino = inode->i_ino;
1765 __entry->dev = inode->i_sb->s_dev;
1766 __entry->lblk = lblk;
1767 __entry->len = len;
1768 __entry->start = start;
1769 ),
1770
1771 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1772 MAJOR(__entry->dev), MINOR(__entry->dev),
1773 (unsigned long) __entry->ino,
1774 (unsigned) __entry->lblk,
1775 __entry->len,
1776 (unsigned long long) __entry->start)
1777);
1778
1779TRACE_EVENT(ext4_ext_in_cache,
1780 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1781
1782 TP_ARGS(inode, lblk, ret),
1783
1784 TP_STRUCT__entry(
1785 __field( ino_t, ino )
1786 __field( dev_t, dev )
1787 __field( ext4_lblk_t, lblk )
1788 __field( int, ret )
1789 ),
1790
1791 TP_fast_assign(
1792 __entry->ino = inode->i_ino;
1793 __entry->dev = inode->i_sb->s_dev;
1794 __entry->lblk = lblk;
1795 __entry->ret = ret;
1796 ),
1797
1798 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1799 MAJOR(__entry->dev), MINOR(__entry->dev),
1800 (unsigned long) __entry->ino,
1801 (unsigned) __entry->lblk,
1802 __entry->ret)
1803
1804);
1805
1806TRACE_EVENT(ext4_find_delalloc_range,
1807 TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1808 int reverse, int found, ext4_lblk_t found_blk),
1809
1810 TP_ARGS(inode, from, to, reverse, found, found_blk),
1811
1812 TP_STRUCT__entry(
1813 __field( ino_t, ino )
1814 __field( dev_t, dev )
1815 __field( ext4_lblk_t, from )
1816 __field( ext4_lblk_t, to )
1817 __field( int, reverse )
1818 __field( int, found )
1819 __field( ext4_lblk_t, found_blk )
1820 ),
1821
1822 TP_fast_assign(
1823 __entry->ino = inode->i_ino;
1824 __entry->dev = inode->i_sb->s_dev;
1825 __entry->from = from;
1826 __entry->to = to;
1827 __entry->reverse = reverse;
1828 __entry->found = found;
1829 __entry->found_blk = found_blk;
1830 ),
1831
1832 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1833 "(blk = %u)",
1834 MAJOR(__entry->dev), MINOR(__entry->dev),
1835 (unsigned long) __entry->ino,
1836 (unsigned) __entry->from, (unsigned) __entry->to,
1837 __entry->reverse, __entry->found,
1838 (unsigned) __entry->found_blk)
1839);
1840
1841TRACE_EVENT(ext4_get_reserved_cluster_alloc,
1842 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
1843
1844 TP_ARGS(inode, lblk, len),
1845
1846 TP_STRUCT__entry(
1847 __field( ino_t, ino )
1848 __field( dev_t, dev )
1849 __field( ext4_lblk_t, lblk )
1850 __field( unsigned int, len )
1851 ),
1852
1853 TP_fast_assign(
1854 __entry->ino = inode->i_ino;
1855 __entry->dev = inode->i_sb->s_dev;
1856 __entry->lblk = lblk;
1857 __entry->len = len;
1858 ),
1859
1860 TP_printk("dev %d,%d ino %lu lblk %u len %u",
1861 MAJOR(__entry->dev), MINOR(__entry->dev),
1862 (unsigned long) __entry->ino,
1863 (unsigned) __entry->lblk,
1864 __entry->len)
1865);
1866
1867TRACE_EVENT(ext4_ext_show_extent,
1868 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
1869 unsigned short len),
1870
1871 TP_ARGS(inode, lblk, pblk, len),
1872
1873 TP_STRUCT__entry(
1874 __field( ino_t, ino )
1875 __field( dev_t, dev )
1876 __field( ext4_lblk_t, lblk )
1877 __field( ext4_fsblk_t, pblk )
1878 __field( unsigned short, len )
1879 ),
1880
1881 TP_fast_assign(
1882 __entry->ino = inode->i_ino;
1883 __entry->dev = inode->i_sb->s_dev;
1884 __entry->lblk = lblk;
1885 __entry->pblk = pblk;
1886 __entry->len = len;
1887 ),
1888
1889 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
1890 MAJOR(__entry->dev), MINOR(__entry->dev),
1891 (unsigned long) __entry->ino,
1892 (unsigned) __entry->lblk,
1893 (unsigned long long) __entry->pblk,
1894 (unsigned short) __entry->len)
1895);
1896
1897TRACE_EVENT(ext4_remove_blocks,
1898 TP_PROTO(struct inode *inode, struct ext4_extent *ex,
1899 ext4_lblk_t from, ext4_fsblk_t to,
1900 ext4_fsblk_t partial_cluster),
1901
1902 TP_ARGS(inode, ex, from, to, partial_cluster),
1903
1904 TP_STRUCT__entry(
1905 __field( ino_t, ino )
1906 __field( dev_t, dev )
1907 __field( ext4_lblk_t, ee_lblk )
1908 __field( ext4_fsblk_t, ee_pblk )
1909 __field( unsigned short, ee_len )
1910 __field( ext4_lblk_t, from )
1911 __field( ext4_lblk_t, to )
1912 __field( ext4_fsblk_t, partial )
1913 ),
1914
1915 TP_fast_assign(
1916 __entry->ino = inode->i_ino;
1917 __entry->dev = inode->i_sb->s_dev;
1918 __entry->ee_lblk = cpu_to_le32(ex->ee_block);
1919 __entry->ee_pblk = ext4_ext_pblock(ex);
1920 __entry->ee_len = ext4_ext_get_actual_len(ex);
1921 __entry->from = from;
1922 __entry->to = to;
1923 __entry->partial = partial_cluster;
1924 ),
1925
1926 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
1927 "from %u to %u partial_cluster %u",
1928 MAJOR(__entry->dev), MINOR(__entry->dev),
1929 (unsigned long) __entry->ino,
1930 (unsigned) __entry->ee_lblk,
1931 (unsigned long long) __entry->ee_pblk,
1932 (unsigned short) __entry->ee_len,
1933 (unsigned) __entry->from,
1934 (unsigned) __entry->to,
1935 (unsigned) __entry->partial)
1936);
1937
1938TRACE_EVENT(ext4_ext_rm_leaf,
1939 TP_PROTO(struct inode *inode, ext4_lblk_t start,
1940 struct ext4_extent *ex, ext4_fsblk_t partial_cluster),
1941
1942 TP_ARGS(inode, start, ex, partial_cluster),
1943
1944 TP_STRUCT__entry(
1945 __field( ino_t, ino )
1946 __field( dev_t, dev )
1947 __field( ext4_lblk_t, start )
1948 __field( ext4_lblk_t, ee_lblk )
1949 __field( ext4_fsblk_t, ee_pblk )
1950 __field( short, ee_len )
1951 __field( ext4_fsblk_t, partial )
1952 ),
1953
1954 TP_fast_assign(
1955 __entry->ino = inode->i_ino;
1956 __entry->dev = inode->i_sb->s_dev;
1957 __entry->start = start;
1958 __entry->ee_lblk = le32_to_cpu(ex->ee_block);
1959 __entry->ee_pblk = ext4_ext_pblock(ex);
1960 __entry->ee_len = ext4_ext_get_actual_len(ex);
1961 __entry->partial = partial_cluster;
1962 ),
1963
1964 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
1965 "partial_cluster %u",
1966 MAJOR(__entry->dev), MINOR(__entry->dev),
1967 (unsigned long) __entry->ino,
1968 (unsigned) __entry->start,
1969 (unsigned) __entry->ee_lblk,
1970 (unsigned long long) __entry->ee_pblk,
1971 (unsigned short) __entry->ee_len,
1972 (unsigned) __entry->partial)
1973);
1974
1975TRACE_EVENT(ext4_ext_rm_idx,
1976 TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
1977
1978 TP_ARGS(inode, pblk),
1979
1980 TP_STRUCT__entry(
1981 __field( ino_t, ino )
1982 __field( dev_t, dev )
1983 __field( ext4_fsblk_t, pblk )
1984 ),
1985
1986 TP_fast_assign(
1987 __entry->ino = inode->i_ino;
1988 __entry->dev = inode->i_sb->s_dev;
1989 __entry->pblk = pblk;
1990 ),
1991
1992 TP_printk("dev %d,%d ino %lu index_pblk %llu",
1993 MAJOR(__entry->dev), MINOR(__entry->dev),
1994 (unsigned long) __entry->ino,
1995 (unsigned long long) __entry->pblk)
1996);
1997
1998TRACE_EVENT(ext4_ext_remove_space,
1999 TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth),
2000
2001 TP_ARGS(inode, start, depth),
2002
2003 TP_STRUCT__entry(
2004 __field( ino_t, ino )
2005 __field( dev_t, dev )
2006 __field( ext4_lblk_t, start )
2007 __field( int, depth )
2008 ),
2009
2010 TP_fast_assign(
2011 __entry->ino = inode->i_ino;
2012 __entry->dev = inode->i_sb->s_dev;
2013 __entry->start = start;
2014 __entry->depth = depth;
2015 ),
2016
2017 TP_printk("dev %d,%d ino %lu since %u depth %d",
2018 MAJOR(__entry->dev), MINOR(__entry->dev),
2019 (unsigned long) __entry->ino,
2020 (unsigned) __entry->start,
2021 __entry->depth)
2022);
2023
2024TRACE_EVENT(ext4_ext_remove_space_done,
2025 TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth,
2026 ext4_lblk_t partial, unsigned short eh_entries),
2027
2028 TP_ARGS(inode, start, depth, partial, eh_entries),
2029
2030 TP_STRUCT__entry(
2031 __field( ino_t, ino )
2032 __field( dev_t, dev )
2033 __field( ext4_lblk_t, start )
2034 __field( int, depth )
2035 __field( ext4_lblk_t, partial )
2036 __field( unsigned short, eh_entries )
2037 ),
2038
2039 TP_fast_assign(
2040 __entry->ino = inode->i_ino;
2041 __entry->dev = inode->i_sb->s_dev;
2042 __entry->start = start;
2043 __entry->depth = depth;
2044 __entry->partial = partial;
2045 __entry->eh_entries = eh_entries;
2046 ),
2047
2048 TP_printk("dev %d,%d ino %lu since %u depth %d partial %u "
2049 "remaining_entries %u",
2050 MAJOR(__entry->dev), MINOR(__entry->dev),
2051 (unsigned long) __entry->ino,
2052 (unsigned) __entry->start,
2053 __entry->depth,
2054 (unsigned) __entry->partial,
2055 (unsigned short) __entry->eh_entries)
2056);
2057
1592#endif /* _TRACE_EXT4_H */ 2058#endif /* _TRACE_EXT4_H */
1593 2059
1594/* This part must be outside protection */ 2060/* This part must be outside protection */
diff --git a/include/trace/events/module.h b/include/trace/events/module.h
index 21a546d27c0c..161932737416 100644
--- a/include/trace/events/module.h
+++ b/include/trace/events/module.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Because linux/module.h has tracepoints in the header, and ftrace.h 2 * Because linux/module.h has tracepoints in the header, and ftrace.h
3 * eventually includes this file, define_trace.h includes linux/module.h 3 * used to include this file, define_trace.h includes linux/module.h
4 * But we do not want the module.h to override the TRACE_SYSTEM macro 4 * But we do not want the module.h to override the TRACE_SYSTEM macro
5 * variable that define_trace.h is processing, so we only set it 5 * variable that define_trace.h is processing, so we only set it
6 * when module events are being processed, which would happen when 6 * when module events are being processed, which would happen when
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
new file mode 100644
index 000000000000..669fbd62ec25
--- /dev/null
+++ b/include/trace/events/rcu.h
@@ -0,0 +1,459 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM rcu
3
4#if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_RCU_H
6
7#include <linux/tracepoint.h>
8
9/*
10 * Tracepoint for start/end markers used for utilization calculations.
11 * By convention, the string is of the following forms:
12 *
13 * "Start <activity>" -- Mark the start of the specified activity,
14 * such as "context switch". Nesting is permitted.
15 * "End <activity>" -- Mark the end of the specified activity.
16 *
17 * An "@" character within "<activity>" is a comment character: Data
18 * reduction scripts will ignore the "@" and the remainder of the line.
19 */
20TRACE_EVENT(rcu_utilization,
21
22 TP_PROTO(char *s),
23
24 TP_ARGS(s),
25
26 TP_STRUCT__entry(
27 __field(char *, s)
28 ),
29
30 TP_fast_assign(
31 __entry->s = s;
32 ),
33
34 TP_printk("%s", __entry->s)
35);
36
37#ifdef CONFIG_RCU_TRACE
38
39#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
40
41/*
42 * Tracepoint for grace-period events: starting and ending a grace
43 * period ("start" and "end", respectively), a CPU noting the start
44 * of a new grace period or the end of an old grace period ("cpustart"
45 * and "cpuend", respectively), a CPU passing through a quiescent
46 * state ("cpuqs"), a CPU coming online or going offline ("cpuonl"
47 * and "cpuofl", respectively), and a CPU being kicked for being too
48 * long in dyntick-idle mode ("kick").
49 */
50TRACE_EVENT(rcu_grace_period,
51
52 TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent),
53
54 TP_ARGS(rcuname, gpnum, gpevent),
55
56 TP_STRUCT__entry(
57 __field(char *, rcuname)
58 __field(unsigned long, gpnum)
59 __field(char *, gpevent)
60 ),
61
62 TP_fast_assign(
63 __entry->rcuname = rcuname;
64 __entry->gpnum = gpnum;
65 __entry->gpevent = gpevent;
66 ),
67
68 TP_printk("%s %lu %s",
69 __entry->rcuname, __entry->gpnum, __entry->gpevent)
70);
71
72/*
73 * Tracepoint for grace-period-initialization events. These are
74 * distinguished by the type of RCU, the new grace-period number, the
75 * rcu_node structure level, the starting and ending CPU covered by the
76 * rcu_node structure, and the mask of CPUs that will be waited for.
77 * All but the type of RCU are extracted from the rcu_node structure.
78 */
79TRACE_EVENT(rcu_grace_period_init,
80
81 TP_PROTO(char *rcuname, unsigned long gpnum, u8 level,
82 int grplo, int grphi, unsigned long qsmask),
83
84 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
85
86 TP_STRUCT__entry(
87 __field(char *, rcuname)
88 __field(unsigned long, gpnum)
89 __field(u8, level)
90 __field(int, grplo)
91 __field(int, grphi)
92 __field(unsigned long, qsmask)
93 ),
94
95 TP_fast_assign(
96 __entry->rcuname = rcuname;
97 __entry->gpnum = gpnum;
98 __entry->level = level;
99 __entry->grplo = grplo;
100 __entry->grphi = grphi;
101 __entry->qsmask = qsmask;
102 ),
103
104 TP_printk("%s %lu %u %d %d %lx",
105 __entry->rcuname, __entry->gpnum, __entry->level,
106 __entry->grplo, __entry->grphi, __entry->qsmask)
107);
108
109/*
110 * Tracepoint for tasks blocking within preemptible-RCU read-side
111 * critical sections. Track the type of RCU (which one day might
112 * include SRCU), the grace-period number that the task is blocking
113 * (the current or the next), and the task's PID.
114 */
115TRACE_EVENT(rcu_preempt_task,
116
117 TP_PROTO(char *rcuname, int pid, unsigned long gpnum),
118
119 TP_ARGS(rcuname, pid, gpnum),
120
121 TP_STRUCT__entry(
122 __field(char *, rcuname)
123 __field(unsigned long, gpnum)
124 __field(int, pid)
125 ),
126
127 TP_fast_assign(
128 __entry->rcuname = rcuname;
129 __entry->gpnum = gpnum;
130 __entry->pid = pid;
131 ),
132
133 TP_printk("%s %lu %d",
134 __entry->rcuname, __entry->gpnum, __entry->pid)
135);
136
137/*
138 * Tracepoint for tasks that blocked within a given preemptible-RCU
139 * read-side critical section exiting that critical section. Track the
140 * type of RCU (which one day might include SRCU) and the task's PID.
141 */
142TRACE_EVENT(rcu_unlock_preempted_task,
143
144 TP_PROTO(char *rcuname, unsigned long gpnum, int pid),
145
146 TP_ARGS(rcuname, gpnum, pid),
147
148 TP_STRUCT__entry(
149 __field(char *, rcuname)
150 __field(unsigned long, gpnum)
151 __field(int, pid)
152 ),
153
154 TP_fast_assign(
155 __entry->rcuname = rcuname;
156 __entry->gpnum = gpnum;
157 __entry->pid = pid;
158 ),
159
160 TP_printk("%s %lu %d", __entry->rcuname, __entry->gpnum, __entry->pid)
161);
162
163/*
164 * Tracepoint for quiescent-state-reporting events. These are
165 * distinguished by the type of RCU, the grace-period number, the
166 * mask of quiescent lower-level entities, the rcu_node structure level,
167 * the starting and ending CPU covered by the rcu_node structure, and
168 * whether there are any blocked tasks blocking the current grace period.
169 * All but the type of RCU are extracted from the rcu_node structure.
170 */
171TRACE_EVENT(rcu_quiescent_state_report,
172
173 TP_PROTO(char *rcuname, unsigned long gpnum,
174 unsigned long mask, unsigned long qsmask,
175 u8 level, int grplo, int grphi, int gp_tasks),
176
177 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
178
179 TP_STRUCT__entry(
180 __field(char *, rcuname)
181 __field(unsigned long, gpnum)
182 __field(unsigned long, mask)
183 __field(unsigned long, qsmask)
184 __field(u8, level)
185 __field(int, grplo)
186 __field(int, grphi)
187 __field(u8, gp_tasks)
188 ),
189
190 TP_fast_assign(
191 __entry->rcuname = rcuname;
192 __entry->gpnum = gpnum;
193 __entry->mask = mask;
194 __entry->qsmask = qsmask;
195 __entry->level = level;
196 __entry->grplo = grplo;
197 __entry->grphi = grphi;
198 __entry->gp_tasks = gp_tasks;
199 ),
200
201 TP_printk("%s %lu %lx>%lx %u %d %d %u",
202 __entry->rcuname, __entry->gpnum,
203 __entry->mask, __entry->qsmask, __entry->level,
204 __entry->grplo, __entry->grphi, __entry->gp_tasks)
205);
206
207/*
208 * Tracepoint for quiescent states detected by force_quiescent_state().
209 * These trace events include the type of RCU, the grace-period number
210 * that was blocked by the CPU, the CPU itself, and the type of quiescent
211 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
212 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
213 * too long.
214 */
215TRACE_EVENT(rcu_fqs,
216
217 TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent),
218
219 TP_ARGS(rcuname, gpnum, cpu, qsevent),
220
221 TP_STRUCT__entry(
222 __field(char *, rcuname)
223 __field(unsigned long, gpnum)
224 __field(int, cpu)
225 __field(char *, qsevent)
226 ),
227
228 TP_fast_assign(
229 __entry->rcuname = rcuname;
230 __entry->gpnum = gpnum;
231 __entry->cpu = cpu;
232 __entry->qsevent = qsevent;
233 ),
234
235 TP_printk("%s %lu %d %s",
236 __entry->rcuname, __entry->gpnum,
237 __entry->cpu, __entry->qsevent)
238);
239
240#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */
241
242/*
243 * Tracepoint for dyntick-idle entry/exit events. These take a string
244 * as argument: "Start" for entering dyntick-idle mode and "End" for
245 * leaving it.
246 */
247TRACE_EVENT(rcu_dyntick,
248
249 TP_PROTO(char *polarity),
250
251 TP_ARGS(polarity),
252
253 TP_STRUCT__entry(
254 __field(char *, polarity)
255 ),
256
257 TP_fast_assign(
258 __entry->polarity = polarity;
259 ),
260
261 TP_printk("%s", __entry->polarity)
262);
263
264/*
265 * Tracepoint for the registration of a single RCU callback function.
266 * The first argument is the type of RCU, the second argument is
267 * a pointer to the RCU callback itself, and the third element is the
268 * new RCU callback queue length for the current CPU.
269 */
270TRACE_EVENT(rcu_callback,
271
272 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen),
273
274 TP_ARGS(rcuname, rhp, qlen),
275
276 TP_STRUCT__entry(
277 __field(char *, rcuname)
278 __field(void *, rhp)
279 __field(void *, func)
280 __field(long, qlen)
281 ),
282
283 TP_fast_assign(
284 __entry->rcuname = rcuname;
285 __entry->rhp = rhp;
286 __entry->func = rhp->func;
287 __entry->qlen = qlen;
288 ),
289
290 TP_printk("%s rhp=%p func=%pf %ld",
291 __entry->rcuname, __entry->rhp, __entry->func, __entry->qlen)
292);
293
294/*
295 * Tracepoint for the registration of a single RCU callback of the special
296 * kfree() form. The first argument is the RCU type, the second argument
297 * is a pointer to the RCU callback, the third argument is the offset
298 * of the callback within the enclosing RCU-protected data structure,
299 * and the fourth argument is the new RCU callback queue length for the
300 * current CPU.
301 */
302TRACE_EVENT(rcu_kfree_callback,
303
304 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
305 long qlen),
306
307 TP_ARGS(rcuname, rhp, offset, qlen),
308
309 TP_STRUCT__entry(
310 __field(char *, rcuname)
311 __field(void *, rhp)
312 __field(unsigned long, offset)
313 __field(long, qlen)
314 ),
315
316 TP_fast_assign(
317 __entry->rcuname = rcuname;
318 __entry->rhp = rhp;
319 __entry->offset = offset;
320 __entry->qlen = qlen;
321 ),
322
323 TP_printk("%s rhp=%p func=%ld %ld",
324 __entry->rcuname, __entry->rhp, __entry->offset,
325 __entry->qlen)
326);
327
328/*
329 * Tracepoint for marking the beginning rcu_do_batch, performed to start
330 * RCU callback invocation. The first argument is the RCU flavor,
331 * the second is the total number of callbacks (including those that
332 * are not yet ready to be invoked), and the third argument is the
333 * current RCU-callback batch limit.
334 */
335TRACE_EVENT(rcu_batch_start,
336
337 TP_PROTO(char *rcuname, long qlen, int blimit),
338
339 TP_ARGS(rcuname, qlen, blimit),
340
341 TP_STRUCT__entry(
342 __field(char *, rcuname)
343 __field(long, qlen)
344 __field(int, blimit)
345 ),
346
347 TP_fast_assign(
348 __entry->rcuname = rcuname;
349 __entry->qlen = qlen;
350 __entry->blimit = blimit;
351 ),
352
353 TP_printk("%s CBs=%ld bl=%d",
354 __entry->rcuname, __entry->qlen, __entry->blimit)
355);
356
357/*
358 * Tracepoint for the invocation of a single RCU callback function.
359 * The first argument is the type of RCU, and the second argument is
360 * a pointer to the RCU callback itself.
361 */
362TRACE_EVENT(rcu_invoke_callback,
363
364 TP_PROTO(char *rcuname, struct rcu_head *rhp),
365
366 TP_ARGS(rcuname, rhp),
367
368 TP_STRUCT__entry(
369 __field(char *, rcuname)
370 __field(void *, rhp)
371 __field(void *, func)
372 ),
373
374 TP_fast_assign(
375 __entry->rcuname = rcuname;
376 __entry->rhp = rhp;
377 __entry->func = rhp->func;
378 ),
379
380 TP_printk("%s rhp=%p func=%pf",
381 __entry->rcuname, __entry->rhp, __entry->func)
382);
383
384/*
385 * Tracepoint for the invocation of a single RCU callback of the special
386 * kfree() form. The first argument is the RCU flavor, the second
387 * argument is a pointer to the RCU callback, and the third argument
388 * is the offset of the callback within the enclosing RCU-protected
389 * data structure.
390 */
391TRACE_EVENT(rcu_invoke_kfree_callback,
392
393 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset),
394
395 TP_ARGS(rcuname, rhp, offset),
396
397 TP_STRUCT__entry(
398 __field(char *, rcuname)
399 __field(void *, rhp)
400 __field(unsigned long, offset)
401 ),
402
403 TP_fast_assign(
404 __entry->rcuname = rcuname;
405 __entry->rhp = rhp;
406 __entry->offset = offset;
407 ),
408
409 TP_printk("%s rhp=%p func=%ld",
410 __entry->rcuname, __entry->rhp, __entry->offset)
411);
412
413/*
414 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
415 * invoked. The first argument is the name of the RCU flavor and
416 * the second argument is number of callbacks actually invoked.
417 */
418TRACE_EVENT(rcu_batch_end,
419
420 TP_PROTO(char *rcuname, int callbacks_invoked),
421
422 TP_ARGS(rcuname, callbacks_invoked),
423
424 TP_STRUCT__entry(
425 __field(char *, rcuname)
426 __field(int, callbacks_invoked)
427 ),
428
429 TP_fast_assign(
430 __entry->rcuname = rcuname;
431 __entry->callbacks_invoked = callbacks_invoked;
432 ),
433
434 TP_printk("%s CBs-invoked=%d",
435 __entry->rcuname, __entry->callbacks_invoked)
436);
437
438#else /* #ifdef CONFIG_RCU_TRACE */
439
440#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
441#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, qsmask) do { } while (0)
442#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
443#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
444#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks) do { } while (0)
445#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
446#define trace_rcu_dyntick(polarity) do { } while (0)
447#define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
448#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
449#define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
450#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
451#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
452#define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
453
454#endif /* #else #ifdef CONFIG_RCU_TRACE */
455
456#endif /* _TRACE_RCU_H */
457
458/* This part must be outside protection */
459#include <trace/define_trace.h>
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h
new file mode 100644
index 000000000000..1e3193b8fcc8
--- /dev/null
+++ b/include/trace/events/regmap.h
@@ -0,0 +1,136 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM regmap
3
4#if !defined(_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_REGMAP_H
6
7#include <linux/device.h>
8#include <linux/ktime.h>
9#include <linux/tracepoint.h>
10
11struct regmap;
12
13/*
14 * Log register events
15 */
16DECLARE_EVENT_CLASS(regmap_reg,
17
18 TP_PROTO(struct device *dev, unsigned int reg,
19 unsigned int val),
20
21 TP_ARGS(dev, reg, val),
22
23 TP_STRUCT__entry(
24 __string( name, dev_name(dev) )
25 __field( unsigned int, reg )
26 __field( unsigned int, val )
27 ),
28
29 TP_fast_assign(
30 __assign_str(name, dev_name(dev));
31 __entry->reg = reg;
32 __entry->val = val;
33 ),
34
35 TP_printk("%s reg=%x val=%x", __get_str(name),
36 (unsigned int)__entry->reg,
37 (unsigned int)__entry->val)
38);
39
40DEFINE_EVENT(regmap_reg, regmap_reg_write,
41
42 TP_PROTO(struct device *dev, unsigned int reg,
43 unsigned int val),
44
45 TP_ARGS(dev, reg, val)
46
47);
48
49DEFINE_EVENT(regmap_reg, regmap_reg_read,
50
51 TP_PROTO(struct device *dev, unsigned int reg,
52 unsigned int val),
53
54 TP_ARGS(dev, reg, val)
55
56);
57
58DECLARE_EVENT_CLASS(regmap_block,
59
60 TP_PROTO(struct device *dev, unsigned int reg, int count),
61
62 TP_ARGS(dev, reg, count),
63
64 TP_STRUCT__entry(
65 __string( name, dev_name(dev) )
66 __field( unsigned int, reg )
67 __field( int, count )
68 ),
69
70 TP_fast_assign(
71 __assign_str(name, dev_name(dev));
72 __entry->reg = reg;
73 __entry->count = count;
74 ),
75
76 TP_printk("%s reg=%x count=%d", __get_str(name),
77 (unsigned int)__entry->reg,
78 (int)__entry->count)
79);
80
81DEFINE_EVENT(regmap_block, regmap_hw_read_start,
82
83 TP_PROTO(struct device *dev, unsigned int reg, int count),
84
85 TP_ARGS(dev, reg, count)
86);
87
88DEFINE_EVENT(regmap_block, regmap_hw_read_done,
89
90 TP_PROTO(struct device *dev, unsigned int reg, int count),
91
92 TP_ARGS(dev, reg, count)
93);
94
95DEFINE_EVENT(regmap_block, regmap_hw_write_start,
96
97 TP_PROTO(struct device *dev, unsigned int reg, int count),
98
99 TP_ARGS(dev, reg, count)
100);
101
102DEFINE_EVENT(regmap_block, regmap_hw_write_done,
103
104 TP_PROTO(struct device *dev, unsigned int reg, int count),
105
106 TP_ARGS(dev, reg, count)
107);
108
109TRACE_EVENT(regcache_sync,
110
111 TP_PROTO(struct device *dev, const char *type,
112 const char *status),
113
114 TP_ARGS(dev, type, status),
115
116 TP_STRUCT__entry(
117 __string( name, dev_name(dev) )
118 __string( status, status )
119 __string( type, type )
120 __field( int, type )
121 ),
122
123 TP_fast_assign(
124 __assign_str(name, dev_name(dev));
125 __assign_str(status, status);
126 __assign_str(type, type);
127 ),
128
129 TP_printk("%s type=%s status=%s", __get_str(name),
130 __get_str(type), __get_str(status))
131);
132
133#endif /* _TRACE_REGMAP_H */
134
135/* This part must be outside protection */
136#include <trace/define_trace.h>
diff --git a/include/trace/events/rpm.h b/include/trace/events/rpm.h
new file mode 100644
index 000000000000..d62c558bf64b
--- /dev/null
+++ b/include/trace/events/rpm.h
@@ -0,0 +1,99 @@
1
2#undef TRACE_SYSTEM
3#define TRACE_SYSTEM rpm
4
5#if !defined(_TRACE_RUNTIME_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_RUNTIME_POWER_H
7
8#include <linux/ktime.h>
9#include <linux/tracepoint.h>
10#include <linux/device.h>
11
12/*
13 * The rpm_internal events are used for tracing some important
14 * runtime pm internal functions.
15 */
16DECLARE_EVENT_CLASS(rpm_internal,
17
18 TP_PROTO(struct device *dev, int flags),
19
20 TP_ARGS(dev, flags),
21
22 TP_STRUCT__entry(
23 __string( name, dev_name(dev) )
24 __field( int, flags )
25 __field( int , usage_count )
26 __field( int , disable_depth )
27 __field( int , runtime_auto )
28 __field( int , request_pending )
29 __field( int , irq_safe )
30 __field( int , child_count )
31 ),
32
33 TP_fast_assign(
34 __assign_str(name, dev_name(dev));
35 __entry->flags = flags;
36 __entry->usage_count = atomic_read(
37 &dev->power.usage_count);
38 __entry->disable_depth = dev->power.disable_depth;
39 __entry->runtime_auto = dev->power.runtime_auto;
40 __entry->request_pending = dev->power.request_pending;
41 __entry->irq_safe = dev->power.irq_safe;
42 __entry->child_count = atomic_read(
43 &dev->power.child_count);
44 ),
45
46 TP_printk("%s flags-%x cnt-%-2d dep-%-2d auto-%-1d p-%-1d"
47 " irq-%-1d child-%d",
48 __get_str(name), __entry->flags,
49 __entry->usage_count,
50 __entry->disable_depth,
51 __entry->runtime_auto,
52 __entry->request_pending,
53 __entry->irq_safe,
54 __entry->child_count
55 )
56);
57DEFINE_EVENT(rpm_internal, rpm_suspend,
58
59 TP_PROTO(struct device *dev, int flags),
60
61 TP_ARGS(dev, flags)
62);
63DEFINE_EVENT(rpm_internal, rpm_resume,
64
65 TP_PROTO(struct device *dev, int flags),
66
67 TP_ARGS(dev, flags)
68);
69DEFINE_EVENT(rpm_internal, rpm_idle,
70
71 TP_PROTO(struct device *dev, int flags),
72
73 TP_ARGS(dev, flags)
74);
75
76TRACE_EVENT(rpm_return_int,
77 TP_PROTO(struct device *dev, unsigned long ip, int ret),
78 TP_ARGS(dev, ip, ret),
79
80 TP_STRUCT__entry(
81 __string( name, dev_name(dev))
82 __field( unsigned long, ip )
83 __field( int, ret )
84 ),
85
86 TP_fast_assign(
87 __assign_str(name, dev_name(dev));
88 __entry->ip = ip;
89 __entry->ret = ret;
90 ),
91
92 TP_printk("%pS:%s ret=%d", (void *)__entry->ip, __get_str(name),
93 __entry->ret)
94);
95
96#endif /* _TRACE_RUNTIME_POWER_H */
97
98/* This part must be outside protection */
99#include <trace/define_trace.h>
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index f6334782a593..959ff18b63b6 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -100,7 +100,7 @@ static inline long __trace_sched_switch_state(struct task_struct *p)
100 * For all intents and purposes a preempted task is a running task. 100 * For all intents and purposes a preempted task is a running task.
101 */ 101 */
102 if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE) 102 if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE)
103 state = TASK_RUNNING; 103 state = TASK_RUNNING | TASK_STATE_MAX;
104#endif 104#endif
105 105
106 return state; 106 return state;
@@ -137,13 +137,14 @@ TRACE_EVENT(sched_switch,
137 __entry->next_prio = next->prio; 137 __entry->next_prio = next->prio;
138 ), 138 ),
139 139
140 TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s ==> next_comm=%s next_pid=%d next_prio=%d", 140 TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s%s ==> next_comm=%s next_pid=%d next_prio=%d",
141 __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, 141 __entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
142 __entry->prev_state ? 142 __entry->prev_state & (TASK_STATE_MAX-1) ?
143 __print_flags(__entry->prev_state, "|", 143 __print_flags(__entry->prev_state & (TASK_STATE_MAX-1), "|",
144 { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" }, 144 { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" },
145 { 16, "Z" }, { 32, "X" }, { 64, "x" }, 145 { 16, "Z" }, { 32, "X" }, { 64, "x" },
146 { 128, "W" }) : "R", 146 { 128, "W" }) : "R",
147 __entry->prev_state & TASK_STATE_MAX ? "+" : "",
147 __entry->next_comm, __entry->next_pid, __entry->next_prio) 148 __entry->next_comm, __entry->next_pid, __entry->next_prio)
148); 149);
149 150
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index 36851f7f13da..edc4b3d25a2d 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -266,7 +266,7 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
266 unsigned long nr_lumpy_taken, 266 unsigned long nr_lumpy_taken,
267 unsigned long nr_lumpy_dirty, 267 unsigned long nr_lumpy_dirty,
268 unsigned long nr_lumpy_failed, 268 unsigned long nr_lumpy_failed,
269 int isolate_mode), 269 isolate_mode_t isolate_mode),
270 270
271 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode), 271 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode),
272 272
@@ -278,7 +278,7 @@ DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
278 __field(unsigned long, nr_lumpy_taken) 278 __field(unsigned long, nr_lumpy_taken)
279 __field(unsigned long, nr_lumpy_dirty) 279 __field(unsigned long, nr_lumpy_dirty)
280 __field(unsigned long, nr_lumpy_failed) 280 __field(unsigned long, nr_lumpy_failed)
281 __field(int, isolate_mode) 281 __field(isolate_mode_t, isolate_mode)
282 ), 282 ),
283 283
284 TP_fast_assign( 284 TP_fast_assign(
@@ -312,7 +312,7 @@ DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_lru_isolate,
312 unsigned long nr_lumpy_taken, 312 unsigned long nr_lumpy_taken,
313 unsigned long nr_lumpy_dirty, 313 unsigned long nr_lumpy_dirty,
314 unsigned long nr_lumpy_failed, 314 unsigned long nr_lumpy_failed,
315 int isolate_mode), 315 isolate_mode_t isolate_mode),
316 316
317 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode) 317 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode)
318 318
@@ -327,7 +327,7 @@ DEFINE_EVENT(mm_vmscan_lru_isolate_template, mm_vmscan_memcg_isolate,
327 unsigned long nr_lumpy_taken, 327 unsigned long nr_lumpy_taken,
328 unsigned long nr_lumpy_dirty, 328 unsigned long nr_lumpy_dirty,
329 unsigned long nr_lumpy_failed, 329 unsigned long nr_lumpy_failed,
330 int isolate_mode), 330 isolate_mode_t isolate_mode),
331 331
332 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode) 332 TP_ARGS(order, nr_requested, nr_scanned, nr_taken, nr_lumpy_taken, nr_lumpy_dirty, nr_lumpy_failed, isolate_mode)
333 333
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 6bca4cc0063c..b99caa8b780c 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -34,6 +34,7 @@ DECLARE_EVENT_CLASS(writeback_work_class,
34 __field(int, for_kupdate) 34 __field(int, for_kupdate)
35 __field(int, range_cyclic) 35 __field(int, range_cyclic)
36 __field(int, for_background) 36 __field(int, for_background)
37 __field(int, reason)
37 ), 38 ),
38 TP_fast_assign( 39 TP_fast_assign(
39 strncpy(__entry->name, dev_name(bdi->dev), 32); 40 strncpy(__entry->name, dev_name(bdi->dev), 32);
@@ -43,16 +44,18 @@ DECLARE_EVENT_CLASS(writeback_work_class,
43 __entry->for_kupdate = work->for_kupdate; 44 __entry->for_kupdate = work->for_kupdate;
44 __entry->range_cyclic = work->range_cyclic; 45 __entry->range_cyclic = work->range_cyclic;
45 __entry->for_background = work->for_background; 46 __entry->for_background = work->for_background;
47 __entry->reason = work->reason;
46 ), 48 ),
47 TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " 49 TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d "
48 "kupdate=%d range_cyclic=%d background=%d", 50 "kupdate=%d range_cyclic=%d background=%d reason=%s",
49 __entry->name, 51 __entry->name,
50 MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), 52 MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev),
51 __entry->nr_pages, 53 __entry->nr_pages,
52 __entry->sync_mode, 54 __entry->sync_mode,
53 __entry->for_kupdate, 55 __entry->for_kupdate,
54 __entry->range_cyclic, 56 __entry->range_cyclic,
55 __entry->for_background 57 __entry->for_background,
58 wb_reason_name[__entry->reason]
56 ) 59 )
57); 60);
58#define DEFINE_WRITEBACK_WORK_EVENT(name) \ 61#define DEFINE_WRITEBACK_WORK_EVENT(name) \
@@ -104,30 +107,6 @@ DEFINE_WRITEBACK_EVENT(writeback_bdi_register);
104DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); 107DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister);
105DEFINE_WRITEBACK_EVENT(writeback_thread_start); 108DEFINE_WRITEBACK_EVENT(writeback_thread_start);
106DEFINE_WRITEBACK_EVENT(writeback_thread_stop); 109DEFINE_WRITEBACK_EVENT(writeback_thread_stop);
107DEFINE_WRITEBACK_EVENT(balance_dirty_start);
108DEFINE_WRITEBACK_EVENT(balance_dirty_wait);
109
110TRACE_EVENT(balance_dirty_written,
111
112 TP_PROTO(struct backing_dev_info *bdi, int written),
113
114 TP_ARGS(bdi, written),
115
116 TP_STRUCT__entry(
117 __array(char, name, 32)
118 __field(int, written)
119 ),
120
121 TP_fast_assign(
122 strncpy(__entry->name, dev_name(bdi->dev), 32);
123 __entry->written = written;
124 ),
125
126 TP_printk("bdi %s written %d",
127 __entry->name,
128 __entry->written
129 )
130);
131 110
132DECLARE_EVENT_CLASS(wbc_class, 111DECLARE_EVENT_CLASS(wbc_class,
133 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), 112 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi),
@@ -181,27 +160,31 @@ DEFINE_WBC_EVENT(wbc_writepage);
181 160
182TRACE_EVENT(writeback_queue_io, 161TRACE_EVENT(writeback_queue_io,
183 TP_PROTO(struct bdi_writeback *wb, 162 TP_PROTO(struct bdi_writeback *wb,
184 unsigned long *older_than_this, 163 struct wb_writeback_work *work,
185 int moved), 164 int moved),
186 TP_ARGS(wb, older_than_this, moved), 165 TP_ARGS(wb, work, moved),
187 TP_STRUCT__entry( 166 TP_STRUCT__entry(
188 __array(char, name, 32) 167 __array(char, name, 32)
189 __field(unsigned long, older) 168 __field(unsigned long, older)
190 __field(long, age) 169 __field(long, age)
191 __field(int, moved) 170 __field(int, moved)
171 __field(int, reason)
192 ), 172 ),
193 TP_fast_assign( 173 TP_fast_assign(
174 unsigned long *older_than_this = work->older_than_this;
194 strncpy(__entry->name, dev_name(wb->bdi->dev), 32); 175 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
195 __entry->older = older_than_this ? *older_than_this : 0; 176 __entry->older = older_than_this ? *older_than_this : 0;
196 __entry->age = older_than_this ? 177 __entry->age = older_than_this ?
197 (jiffies - *older_than_this) * 1000 / HZ : -1; 178 (jiffies - *older_than_this) * 1000 / HZ : -1;
198 __entry->moved = moved; 179 __entry->moved = moved;
180 __entry->reason = work->reason;
199 ), 181 ),
200 TP_printk("bdi %s: older=%lu age=%ld enqueue=%d", 182 TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s",
201 __entry->name, 183 __entry->name,
202 __entry->older, /* older_than_this in jiffies */ 184 __entry->older, /* older_than_this in jiffies */
203 __entry->age, /* older_than_this in relative milliseconds */ 185 __entry->age, /* older_than_this in relative milliseconds */
204 __entry->moved) 186 __entry->moved,
187 wb_reason_name[__entry->reason])
205); 188);
206 189
207TRACE_EVENT(global_dirty_state, 190TRACE_EVENT(global_dirty_state,
@@ -250,6 +233,124 @@ TRACE_EVENT(global_dirty_state,
250 ) 233 )
251); 234);
252 235
236#define KBps(x) ((x) << (PAGE_SHIFT - 10))
237
238TRACE_EVENT(bdi_dirty_ratelimit,
239
240 TP_PROTO(struct backing_dev_info *bdi,
241 unsigned long dirty_rate,
242 unsigned long task_ratelimit),
243
244 TP_ARGS(bdi, dirty_rate, task_ratelimit),
245
246 TP_STRUCT__entry(
247 __array(char, bdi, 32)
248 __field(unsigned long, write_bw)
249 __field(unsigned long, avg_write_bw)
250 __field(unsigned long, dirty_rate)
251 __field(unsigned long, dirty_ratelimit)
252 __field(unsigned long, task_ratelimit)
253 __field(unsigned long, balanced_dirty_ratelimit)
254 ),
255
256 TP_fast_assign(
257 strlcpy(__entry->bdi, dev_name(bdi->dev), 32);
258 __entry->write_bw = KBps(bdi->write_bandwidth);
259 __entry->avg_write_bw = KBps(bdi->avg_write_bandwidth);
260 __entry->dirty_rate = KBps(dirty_rate);
261 __entry->dirty_ratelimit = KBps(bdi->dirty_ratelimit);
262 __entry->task_ratelimit = KBps(task_ratelimit);
263 __entry->balanced_dirty_ratelimit =
264 KBps(bdi->balanced_dirty_ratelimit);
265 ),
266
267 TP_printk("bdi %s: "
268 "write_bw=%lu awrite_bw=%lu dirty_rate=%lu "
269 "dirty_ratelimit=%lu task_ratelimit=%lu "
270 "balanced_dirty_ratelimit=%lu",
271 __entry->bdi,
272 __entry->write_bw, /* write bandwidth */
273 __entry->avg_write_bw, /* avg write bandwidth */
274 __entry->dirty_rate, /* bdi dirty rate */
275 __entry->dirty_ratelimit, /* base ratelimit */
276 __entry->task_ratelimit, /* ratelimit with position control */
277 __entry->balanced_dirty_ratelimit /* the balanced ratelimit */
278 )
279);
280
281TRACE_EVENT(balance_dirty_pages,
282
283 TP_PROTO(struct backing_dev_info *bdi,
284 unsigned long thresh,
285 unsigned long bg_thresh,
286 unsigned long dirty,
287 unsigned long bdi_thresh,
288 unsigned long bdi_dirty,
289 unsigned long dirty_ratelimit,
290 unsigned long task_ratelimit,
291 unsigned long dirtied,
292 long pause,
293 unsigned long start_time),
294
295 TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty,
296 dirty_ratelimit, task_ratelimit,
297 dirtied, pause, start_time),
298
299 TP_STRUCT__entry(
300 __array( char, bdi, 32)
301 __field(unsigned long, limit)
302 __field(unsigned long, setpoint)
303 __field(unsigned long, dirty)
304 __field(unsigned long, bdi_setpoint)
305 __field(unsigned long, bdi_dirty)
306 __field(unsigned long, dirty_ratelimit)
307 __field(unsigned long, task_ratelimit)
308 __field(unsigned int, dirtied)
309 __field(unsigned int, dirtied_pause)
310 __field(unsigned long, paused)
311 __field( long, pause)
312 ),
313
314 TP_fast_assign(
315 unsigned long freerun = (thresh + bg_thresh) / 2;
316 strlcpy(__entry->bdi, dev_name(bdi->dev), 32);
317
318 __entry->limit = global_dirty_limit;
319 __entry->setpoint = (global_dirty_limit + freerun) / 2;
320 __entry->dirty = dirty;
321 __entry->bdi_setpoint = __entry->setpoint *
322 bdi_thresh / (thresh + 1);
323 __entry->bdi_dirty = bdi_dirty;
324 __entry->dirty_ratelimit = KBps(dirty_ratelimit);
325 __entry->task_ratelimit = KBps(task_ratelimit);
326 __entry->dirtied = dirtied;
327 __entry->dirtied_pause = current->nr_dirtied_pause;
328 __entry->pause = pause * 1000 / HZ;
329 __entry->paused = (jiffies - start_time) * 1000 / HZ;
330 ),
331
332
333 TP_printk("bdi %s: "
334 "limit=%lu setpoint=%lu dirty=%lu "
335 "bdi_setpoint=%lu bdi_dirty=%lu "
336 "dirty_ratelimit=%lu task_ratelimit=%lu "
337 "dirtied=%u dirtied_pause=%u "
338 "paused=%lu pause=%ld",
339 __entry->bdi,
340 __entry->limit,
341 __entry->setpoint,
342 __entry->dirty,
343 __entry->bdi_setpoint,
344 __entry->bdi_dirty,
345 __entry->dirty_ratelimit,
346 __entry->task_ratelimit,
347 __entry->dirtied,
348 __entry->dirtied_pause,
349 __entry->paused, /* ms */
350 __entry->pause /* ms */
351 )
352);
353
253DECLARE_EVENT_CLASS(writeback_congest_waited_template, 354DECLARE_EVENT_CLASS(writeback_congest_waited_template,
254 355
255 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), 356 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
@@ -298,7 +399,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
298 __array(char, name, 32) 399 __array(char, name, 32)
299 __field(unsigned long, ino) 400 __field(unsigned long, ino)
300 __field(unsigned long, state) 401 __field(unsigned long, state)
301 __field(unsigned long, age) 402 __field(unsigned long, dirtied_when)
302 __field(unsigned long, writeback_index) 403 __field(unsigned long, writeback_index)
303 __field(long, nr_to_write) 404 __field(long, nr_to_write)
304 __field(unsigned long, wrote) 405 __field(unsigned long, wrote)
@@ -309,19 +410,19 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
309 dev_name(inode->i_mapping->backing_dev_info->dev), 32); 410 dev_name(inode->i_mapping->backing_dev_info->dev), 32);
310 __entry->ino = inode->i_ino; 411 __entry->ino = inode->i_ino;
311 __entry->state = inode->i_state; 412 __entry->state = inode->i_state;
312 __entry->age = (jiffies - inode->dirtied_when) * 413 __entry->dirtied_when = inode->dirtied_when;
313 1000 / HZ;
314 __entry->writeback_index = inode->i_mapping->writeback_index; 414 __entry->writeback_index = inode->i_mapping->writeback_index;
315 __entry->nr_to_write = nr_to_write; 415 __entry->nr_to_write = nr_to_write;
316 __entry->wrote = nr_to_write - wbc->nr_to_write; 416 __entry->wrote = nr_to_write - wbc->nr_to_write;
317 ), 417 ),
318 418
319 TP_printk("bdi %s: ino=%lu state=%s age=%lu " 419 TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
320 "index=%lu to_write=%ld wrote=%lu", 420 "index=%lu to_write=%ld wrote=%lu",
321 __entry->name, 421 __entry->name,
322 __entry->ino, 422 __entry->ino,
323 show_inode_state(__entry->state), 423 show_inode_state(__entry->state),
324 __entry->age, 424 __entry->dirtied_when,
425 (jiffies - __entry->dirtied_when) / HZ,
325 __entry->writeback_index, 426 __entry->writeback_index,
326 __entry->nr_to_write, 427 __entry->nr_to_write,
327 __entry->wrote 428 __entry->wrote
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 533c49f48047..769724944fc6 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -711,6 +711,9 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
711#undef __perf_count 711#undef __perf_count
712#define __perf_count(c) __count = (c) 712#define __perf_count(c) __count = (c)
713 713
714#undef TP_perf_assign
715#define TP_perf_assign(args...) args
716
714#undef DECLARE_EVENT_CLASS 717#undef DECLARE_EVENT_CLASS
715#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 718#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
716static notrace void \ 719static notrace void \
diff --git a/include/video/omap-panel-dvi.h b/include/video/omap-panel-dvi.h
new file mode 100644
index 000000000000..87ad567b4229
--- /dev/null
+++ b/include/video/omap-panel-dvi.h
@@ -0,0 +1,37 @@
1/*
2 * Header for DVI output driver
3 *
4 * Copyright (C) 2011 Texas Instruments Inc
5 * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that 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, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef __OMAP_PANEL_DVI_H
21#define __OMAP_PANEL_DVI_H
22
23struct omap_dss_device;
24
25/**
26 * struct panel_dvi_platform_data - panel driver configuration data
27 * @platform_enable: platform specific panel enable function
28 * @platform_disable: platform specific panel disable function
29 * @i2c_bus_num: i2c bus id for the panel
30 */
31struct panel_dvi_platform_data {
32 int (*platform_enable)(struct omap_dss_device *dssdev);
33 void (*platform_disable)(struct omap_dss_device *dssdev);
34 u16 i2c_bus_num;
35};
36
37#endif /* __OMAP_PANEL_DVI_H */
diff --git a/include/video/omap-panel-n8x0.h b/include/video/omap-panel-n8x0.h
new file mode 100644
index 000000000000..50a1302e2cfd
--- /dev/null
+++ b/include/video/omap-panel-n8x0.h
@@ -0,0 +1,15 @@
1#ifndef __OMAP_PANEL_N8X0_H
2#define __OMAP_PANEL_N8X0_H
3
4struct omap_dss_device;
5
6struct panel_n8x0_data {
7 int (*platform_enable)(struct omap_dss_device *dssdev);
8 void (*platform_disable)(struct omap_dss_device *dssdev);
9 int panel_reset;
10 int ctrl_pwrdown;
11
12 int (*set_backlight)(struct omap_dss_device *dssdev, int level);
13};
14
15#endif
diff --git a/include/video/omap-panel-nokia-dsi.h b/include/video/omap-panel-nokia-dsi.h
index 921ae9327228..7dc71f9c13e6 100644
--- a/include/video/omap-panel-nokia-dsi.h
+++ b/include/video/omap-panel-nokia-dsi.h
@@ -10,9 +10,7 @@ struct omap_dss_device;
10 * @ext_te_gpio: external TE GPIO 10 * @ext_te_gpio: external TE GPIO
11 * @esd_interval: interval of ESD checks, 0 = disabled (ms) 11 * @esd_interval: interval of ESD checks, 0 = disabled (ms)
12 * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms) 12 * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms)
13 * @max_backlight_level: maximum backlight level 13 * @use_dsi_backlight: true if panel uses DSI command to control backlight
14 * @set_backlight: pointer to backlight set function
15 * @get_backlight: pointer to backlight get function
16 */ 14 */
17struct nokia_dsi_panel_data { 15struct nokia_dsi_panel_data {
18 const char *name; 16 const char *name;
@@ -25,9 +23,7 @@ struct nokia_dsi_panel_data {
25 unsigned esd_interval; 23 unsigned esd_interval;
26 unsigned ulps_timeout; 24 unsigned ulps_timeout;
27 25
28 int max_backlight_level; 26 bool use_dsi_backlight;
29 int (*set_backlight)(struct omap_dss_device *dssdev, int level);
30 int (*get_backlight)(struct omap_dss_device *dssdev);
31}; 27};
32 28
33#endif /* __OMAP_NOKIA_DSI_PANEL_H */ 29#endif /* __OMAP_NOKIA_DSI_PANEL_H */
diff --git a/include/video/omap-panel-picodlp.h b/include/video/omap-panel-picodlp.h
new file mode 100644
index 000000000000..1c342ef6f3a1
--- /dev/null
+++ b/include/video/omap-panel-picodlp.h
@@ -0,0 +1,23 @@
1/*
2 * panel data for picodlp panel
3 *
4 * Copyright (C) 2011 Texas Instruments
5 *
6 * Author: Mayuresh Janorkar <mayur@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __PANEL_PICODLP_H
13#define __PANEL_PICODLP_H
14/**
15 * struct : picodlp panel data
16 * picodlp_adapter_id: i2c_adapter number for picodlp
17 */
18struct picodlp_panel_data {
19 int picodlp_adapter_id;
20 int emu_done_gpio;
21 int pwrgood_gpio;
22};
23#endif /* __PANEL_PICODLP_H */
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 3b55ef22f8db..b66ebb2032c6 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -41,8 +41,13 @@
41#define DISPC_IRQ_WAKEUP (1 << 16) 41#define DISPC_IRQ_WAKEUP (1 << 16)
42#define DISPC_IRQ_SYNC_LOST2 (1 << 17) 42#define DISPC_IRQ_SYNC_LOST2 (1 << 17)
43#define DISPC_IRQ_VSYNC2 (1 << 18) 43#define DISPC_IRQ_VSYNC2 (1 << 18)
44#define DISPC_IRQ_VID3_END_WIN (1 << 19)
45#define DISPC_IRQ_VID3_FIFO_UNDERFLOW (1 << 20)
44#define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21) 46#define DISPC_IRQ_ACBIAS_COUNT_STAT2 (1 << 21)
45#define DISPC_IRQ_FRAMEDONE2 (1 << 22) 47#define DISPC_IRQ_FRAMEDONE2 (1 << 22)
48#define DISPC_IRQ_FRAMEDONEWB (1 << 23)
49#define DISPC_IRQ_FRAMEDONETV (1 << 24)
50#define DISPC_IRQ_WBBUFFEROVERFLOW (1 << 25)
46 51
47struct omap_dss_device; 52struct omap_dss_device;
48struct omap_overlay_manager; 53struct omap_overlay_manager;
@@ -60,7 +65,8 @@ enum omap_display_type {
60enum omap_plane { 65enum omap_plane {
61 OMAP_DSS_GFX = 0, 66 OMAP_DSS_GFX = 0,
62 OMAP_DSS_VIDEO1 = 1, 67 OMAP_DSS_VIDEO1 = 1,
63 OMAP_DSS_VIDEO2 = 2 68 OMAP_DSS_VIDEO2 = 2,
69 OMAP_DSS_VIDEO3 = 3,
64}; 70};
65 71
66enum omap_channel { 72enum omap_channel {
@@ -129,6 +135,18 @@ enum omap_dss_venc_type {
129 OMAP_DSS_VENC_TYPE_SVIDEO, 135 OMAP_DSS_VENC_TYPE_SVIDEO,
130}; 136};
131 137
138enum omap_dss_dsi_pixel_format {
139 OMAP_DSS_DSI_FMT_RGB888,
140 OMAP_DSS_DSI_FMT_RGB666,
141 OMAP_DSS_DSI_FMT_RGB666_PACKED,
142 OMAP_DSS_DSI_FMT_RGB565,
143};
144
145enum omap_dss_dsi_mode {
146 OMAP_DSS_DSI_CMD_MODE = 0,
147 OMAP_DSS_DSI_VIDEO_MODE,
148};
149
132enum omap_display_caps { 150enum omap_display_caps {
133 OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0, 151 OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE = 1 << 0,
134 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, 152 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1,
@@ -162,11 +180,13 @@ enum omap_dss_rotation_angle {
162 180
163enum omap_overlay_caps { 181enum omap_overlay_caps {
164 OMAP_DSS_OVL_CAP_SCALE = 1 << 0, 182 OMAP_DSS_OVL_CAP_SCALE = 1 << 0,
165 OMAP_DSS_OVL_CAP_DISPC = 1 << 1, 183 OMAP_DSS_OVL_CAP_GLOBAL_ALPHA = 1 << 1,
184 OMAP_DSS_OVL_CAP_PRE_MULT_ALPHA = 1 << 2,
185 OMAP_DSS_OVL_CAP_ZORDER = 1 << 3,
166}; 186};
167 187
168enum omap_overlay_manager_caps { 188enum omap_overlay_manager_caps {
169 OMAP_DSS_OVL_MGR_CAP_DISPC = 1 << 0, 189 OMAP_DSS_DUMMY_VALUE, /* add a dummy value to prevent compiler error */
170}; 190};
171 191
172enum omap_dss_clk_source { 192enum omap_dss_clk_source {
@@ -215,26 +235,67 @@ void rfbi_bus_lock(void);
215void rfbi_bus_unlock(void); 235void rfbi_bus_unlock(void);
216 236
217/* DSI */ 237/* DSI */
238
239struct omap_dss_dsi_videomode_data {
240 /* DSI video mode blanking data */
241 /* Unit: byte clock cycles */
242 u16 hsa;
243 u16 hfp;
244 u16 hbp;
245 /* Unit: line clocks */
246 u16 vsa;
247 u16 vfp;
248 u16 vbp;
249
250 /* DSI blanking modes */
251 int blanking_mode;
252 int hsa_blanking_mode;
253 int hbp_blanking_mode;
254 int hfp_blanking_mode;
255
256 /* Video port sync events */
257 int vp_de_pol;
258 int vp_hsync_pol;
259 int vp_vsync_pol;
260 bool vp_vsync_end;
261 bool vp_hsync_end;
262
263 bool ddr_clk_always_on;
264 int window_sync;
265};
266
218void dsi_bus_lock(struct omap_dss_device *dssdev); 267void dsi_bus_lock(struct omap_dss_device *dssdev);
219void dsi_bus_unlock(struct omap_dss_device *dssdev); 268void dsi_bus_unlock(struct omap_dss_device *dssdev);
220int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data, 269int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
221 int len); 270 int len);
222int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, 271int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data,
223 u8 dcs_cmd); 272 int len);
273int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd);
274int dsi_vc_generic_write_0(struct omap_dss_device *dssdev, int channel);
224int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, 275int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
225 u8 param); 276 u8 param);
277int dsi_vc_generic_write_1(struct omap_dss_device *dssdev, int channel,
278 u8 param);
279int dsi_vc_generic_write_2(struct omap_dss_device *dssdev, int channel,
280 u8 param1, u8 param2);
226int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel, 281int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
227 u8 *data, int len); 282 u8 *data, int len);
283int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel,
284 u8 *data, int len);
228int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, 285int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
229 u8 *buf, int buflen); 286 u8 *buf, int buflen);
230int dsi_vc_dcs_read_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, 287int dsi_vc_generic_read_0(struct omap_dss_device *dssdev, int channel, u8 *buf,
231 u8 *data); 288 int buflen);
232int dsi_vc_dcs_read_2(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd, 289int dsi_vc_generic_read_1(struct omap_dss_device *dssdev, int channel, u8 param,
233 u8 *data1, u8 *data2); 290 u8 *buf, int buflen);
291int dsi_vc_generic_read_2(struct omap_dss_device *dssdev, int channel,
292 u8 param1, u8 param2, u8 *buf, int buflen);
234int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel, 293int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
235 u16 len); 294 u16 len);
236int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel); 295int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
237int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); 296int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
297int dsi_video_mode_enable(struct omap_dss_device *dssdev, int channel);
298void dsi_video_mode_disable(struct omap_dss_device *dssdev, int channel);
238 299
239/* Board specific data */ 300/* Board specific data */
240struct omap_dss_board_info { 301struct omap_dss_board_info {
@@ -242,7 +303,8 @@ struct omap_dss_board_info {
242 int num_devices; 303 int num_devices;
243 struct omap_dss_device **devices; 304 struct omap_dss_device **devices;
244 struct omap_dss_device *default_device; 305 struct omap_dss_device *default_device;
245 void (*dsi_mux_pads)(bool enable); 306 int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask);
307 void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask);
246}; 308};
247 309
248#if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS) 310#if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS)
@@ -300,7 +362,6 @@ struct omap_overlay_info {
300 bool enabled; 362 bool enabled;
301 363
302 u32 paddr; 364 u32 paddr;
303 void __iomem *vaddr;
304 u32 p_uv_addr; /* for NV12 format */ 365 u32 p_uv_addr; /* for NV12 format */
305 u16 screen_width; 366 u16 screen_width;
306 u16 width; 367 u16 width;
@@ -316,6 +377,7 @@ struct omap_overlay_info {
316 u16 out_height; /* if 0, out_height == height */ 377 u16 out_height; /* if 0, out_height == height */
317 u8 global_alpha; 378 u8 global_alpha;
318 u8 pre_mult_alpha; 379 u8 pre_mult_alpha;
380 u8 zorder;
319}; 381};
320 382
321struct omap_overlay { 383struct omap_overlay {
@@ -324,7 +386,7 @@ struct omap_overlay {
324 386
325 /* static fields */ 387 /* static fields */
326 const char *name; 388 const char *name;
327 int id; 389 enum omap_plane id;
328 enum omap_color_mode supported_modes; 390 enum omap_color_mode supported_modes;
329 enum omap_overlay_caps caps; 391 enum omap_overlay_caps caps;
330 392
@@ -332,6 +394,7 @@ struct omap_overlay {
332 struct omap_overlay_manager *manager; 394 struct omap_overlay_manager *manager;
333 struct omap_overlay_info info; 395 struct omap_overlay_info info;
334 396
397 bool manager_changed;
335 /* if true, info has been changed, but not applied() yet */ 398 /* if true, info has been changed, but not applied() yet */
336 bool info_dirty; 399 bool info_dirty;
337 400
@@ -354,7 +417,7 @@ struct omap_overlay_manager_info {
354 u32 trans_key; 417 u32 trans_key;
355 bool trans_enabled; 418 bool trans_enabled;
356 419
357 bool alpha_enabled; 420 bool partial_alpha_enabled;
358 421
359 bool cpr_enable; 422 bool cpr_enable;
360 struct omap_dss_cpr_coefs cpr_coefs; 423 struct omap_dss_cpr_coefs cpr_coefs;
@@ -366,7 +429,7 @@ struct omap_overlay_manager {
366 429
367 /* static fields */ 430 /* static fields */
368 const char *name; 431 const char *name;
369 int id; 432 enum omap_channel id;
370 enum omap_overlay_manager_caps caps; 433 enum omap_overlay_manager_caps caps;
371 int num_overlays; 434 int num_overlays;
372 struct omap_overlay **overlays; 435 struct omap_overlay **overlays;
@@ -454,6 +517,7 @@ struct omap_dss_device {
454 } dispc; 517 } dispc;
455 518
456 struct { 519 struct {
520 /* regn is one greater than TRM's REGN value */
457 u16 regn; 521 u16 regn;
458 u16 regm; 522 u16 regm;
459 u16 regm_dispc; 523 u16 regm_dispc;
@@ -464,6 +528,7 @@ struct omap_dss_device {
464 } dsi; 528 } dsi;
465 529
466 struct { 530 struct {
531 /* regn is one greater than TRM's REGN value */
467 u16 regn; 532 u16 regn;
468 u16 regm2; 533 u16 regm2;
469 } hdmi; 534 } hdmi;
@@ -477,6 +542,10 @@ struct omap_dss_device {
477 int acb; /* ac-bias pin frequency */ 542 int acb; /* ac-bias pin frequency */
478 543
479 enum omap_panel_config config; 544 enum omap_panel_config config;
545
546 enum omap_dss_dsi_pixel_format dsi_pix_fmt;
547 enum omap_dss_dsi_mode dsi_mode;
548 struct omap_dss_dsi_videomode_data dsi_vm_data;
480 } panel; 549 } panel;
481 550
482 struct { 551 struct {
@@ -557,6 +626,9 @@ struct omap_dss_driver {
557 626
558 int (*set_wss)(struct omap_dss_device *dssdev, u32 wss); 627 int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
559 u32 (*get_wss)(struct omap_dss_device *dssdev); 628 u32 (*get_wss)(struct omap_dss_device *dssdev);
629
630 int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len);
631 bool (*detect)(struct omap_dss_device *dssdev);
560}; 632};
561 633
562int omap_dss_register_driver(struct omap_dss_driver *); 634int omap_dss_register_driver(struct omap_dss_driver *);
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
index d964e68fc61d..8101b726b48a 100644
--- a/include/video/sh_mobile_lcdc.h
+++ b/include/video/sh_mobile_lcdc.h
@@ -4,26 +4,123 @@
4#include <linux/fb.h> 4#include <linux/fb.h>
5#include <video/sh_mobile_meram.h> 5#include <video/sh_mobile_meram.h>
6 6
7/* Register definitions */
8#define _LDDCKR 0x410
9#define LDDCKR_ICKSEL_BUS (0 << 16)
10#define LDDCKR_ICKSEL_MIPI (1 << 16)
11#define LDDCKR_ICKSEL_HDMI (2 << 16)
12#define LDDCKR_ICKSEL_EXT (3 << 16)
13#define LDDCKR_ICKSEL_MASK (7 << 16)
14#define LDDCKR_MOSEL (1 << 6)
15#define _LDDCKSTPR 0x414
16#define _LDINTR 0x468
17#define LDINTR_FE (1 << 10)
18#define LDINTR_VSE (1 << 9)
19#define LDINTR_VEE (1 << 8)
20#define LDINTR_FS (1 << 2)
21#define LDINTR_VSS (1 << 1)
22#define LDINTR_VES (1 << 0)
23#define LDINTR_STATUS_MASK (0xff << 0)
24#define _LDSR 0x46c
25#define LDSR_MSS (1 << 10)
26#define LDSR_MRS (1 << 8)
27#define LDSR_AS (1 << 1)
28#define _LDCNT1R 0x470
29#define LDCNT1R_DE (1 << 0)
30#define _LDCNT2R 0x474
31#define LDCNT2R_BR (1 << 8)
32#define LDCNT2R_MD (1 << 3)
33#define LDCNT2R_SE (1 << 2)
34#define LDCNT2R_ME (1 << 1)
35#define LDCNT2R_DO (1 << 0)
36#define _LDRCNTR 0x478
37#define LDRCNTR_SRS (1 << 17)
38#define LDRCNTR_SRC (1 << 16)
39#define LDRCNTR_MRS (1 << 1)
40#define LDRCNTR_MRC (1 << 0)
41#define _LDDDSR 0x47c
42#define LDDDSR_LS (1 << 2)
43#define LDDDSR_WS (1 << 1)
44#define LDDDSR_BS (1 << 0)
45
46#define LDMT1R_VPOL (1 << 28)
47#define LDMT1R_HPOL (1 << 27)
48#define LDMT1R_DWPOL (1 << 26)
49#define LDMT1R_DIPOL (1 << 25)
50#define LDMT1R_DAPOL (1 << 24)
51#define LDMT1R_HSCNT (1 << 17)
52#define LDMT1R_DWCNT (1 << 16)
53#define LDMT1R_IFM (1 << 12)
54#define LDMT1R_MIFTYP_RGB8 (0x0 << 0)
55#define LDMT1R_MIFTYP_RGB9 (0x4 << 0)
56#define LDMT1R_MIFTYP_RGB12A (0x5 << 0)
57#define LDMT1R_MIFTYP_RGB12B (0x6 << 0)
58#define LDMT1R_MIFTYP_RGB16 (0x7 << 0)
59#define LDMT1R_MIFTYP_RGB18 (0xa << 0)
60#define LDMT1R_MIFTYP_RGB24 (0xb << 0)
61#define LDMT1R_MIFTYP_YCBCR (0xf << 0)
62#define LDMT1R_MIFTYP_SYS8A (0x0 << 0)
63#define LDMT1R_MIFTYP_SYS8B (0x1 << 0)
64#define LDMT1R_MIFTYP_SYS8C (0x2 << 0)
65#define LDMT1R_MIFTYP_SYS8D (0x3 << 0)
66#define LDMT1R_MIFTYP_SYS9 (0x4 << 0)
67#define LDMT1R_MIFTYP_SYS12 (0x5 << 0)
68#define LDMT1R_MIFTYP_SYS16A (0x7 << 0)
69#define LDMT1R_MIFTYP_SYS16B (0x8 << 0)
70#define LDMT1R_MIFTYP_SYS16C (0x9 << 0)
71#define LDMT1R_MIFTYP_SYS18 (0xa << 0)
72#define LDMT1R_MIFTYP_SYS24 (0xb << 0)
73#define LDMT1R_MIFTYP_MASK (0xf << 0)
74
75#define LDDFR_CF1 (1 << 18)
76#define LDDFR_CF0 (1 << 17)
77#define LDDFR_CC (1 << 16)
78#define LDDFR_YF_420 (0 << 8)
79#define LDDFR_YF_422 (1 << 8)
80#define LDDFR_YF_444 (2 << 8)
81#define LDDFR_YF_MASK (3 << 8)
82#define LDDFR_PKF_ARGB32 (0x00 << 0)
83#define LDDFR_PKF_RGB16 (0x03 << 0)
84#define LDDFR_PKF_RGB24 (0x0b << 0)
85#define LDDFR_PKF_MASK (0x1f << 0)
86
87#define LDSM1R_OS (1 << 0)
88
89#define LDSM2R_OSTRG (1 << 0)
90
91#define LDPMR_LPS (3 << 0)
92
93#define _LDDWD0R 0x800
94#define LDDWDxR_WDACT (1 << 28)
95#define LDDWDxR_RSW (1 << 24)
96#define _LDDRDR 0x840
97#define LDDRDR_RSR (1 << 24)
98#define LDDRDR_DRD_MASK (0x3ffff << 0)
99#define _LDDWAR 0x900
100#define LDDWAR_WA (1 << 0)
101#define _LDDRAR 0x904
102#define LDDRAR_RA (1 << 0)
103
7enum { 104enum {
8 RGB8, /* 24bpp, 8:8:8 */ 105 RGB8 = LDMT1R_MIFTYP_RGB8, /* 24bpp, 8:8:8 */
9 RGB9, /* 18bpp, 9:9 */ 106 RGB9 = LDMT1R_MIFTYP_RGB9, /* 18bpp, 9:9 */
10 RGB12A, /* 24bpp, 12:12 */ 107 RGB12A = LDMT1R_MIFTYP_RGB12A, /* 24bpp, 12:12 */
11 RGB12B, /* 12bpp */ 108 RGB12B = LDMT1R_MIFTYP_RGB12B, /* 12bpp */
12 RGB16, /* 16bpp */ 109 RGB16 = LDMT1R_MIFTYP_RGB16, /* 16bpp */
13 RGB18, /* 18bpp */ 110 RGB18 = LDMT1R_MIFTYP_RGB18, /* 18bpp */
14 RGB24, /* 24bpp */ 111 RGB24 = LDMT1R_MIFTYP_RGB24, /* 24bpp */
15 YUV422, /* 16bpp */ 112 YUV422 = LDMT1R_MIFTYP_YCBCR, /* 16bpp */
16 SYS8A, /* 24bpp, 8:8:8 */ 113 SYS8A = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8A, /* 24bpp, 8:8:8 */
17 SYS8B, /* 18bpp, 8:8:2 */ 114 SYS8B = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8B, /* 18bpp, 8:8:2 */
18 SYS8C, /* 18bpp, 2:8:8 */ 115 SYS8C = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8C, /* 18bpp, 2:8:8 */
19 SYS8D, /* 16bpp, 8:8 */ 116 SYS8D = LDMT1R_IFM | LDMT1R_MIFTYP_SYS8D, /* 16bpp, 8:8 */
20 SYS9, /* 18bpp, 9:9 */ 117 SYS9 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS9, /* 18bpp, 9:9 */
21 SYS12, /* 24bpp, 12:12 */ 118 SYS12 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS12, /* 24bpp, 12:12 */
22 SYS16A, /* 16bpp */ 119 SYS16A = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16A, /* 16bpp */
23 SYS16B, /* 18bpp, 16:2 */ 120 SYS16B = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16B, /* 18bpp, 16:2 */
24 SYS16C, /* 18bpp, 2:16 */ 121 SYS16C = LDMT1R_IFM | LDMT1R_MIFTYP_SYS16C, /* 18bpp, 2:16 */
25 SYS18, /* 18bpp */ 122 SYS18 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS18, /* 18bpp */
26 SYS24, /* 24bpp */ 123 SYS24 = LDMT1R_IFM | LDMT1R_MIFTYP_SYS24, /* 24bpp */
27}; 124};
28 125
29enum { LCDC_CHAN_DISABLED = 0, 126enum { LCDC_CHAN_DISABLED = 0,
diff --git a/include/video/udlfb.h b/include/video/udlfb.h
index 69d485a4a026..c41f308c9636 100644
--- a/include/video/udlfb.h
+++ b/include/video/udlfb.h
@@ -50,6 +50,7 @@ struct dlfb_data {
50 int base16; 50 int base16;
51 int base8; 51 int base8;
52 u32 pseudo_palette[256]; 52 u32 pseudo_palette[256];
53 int blank_mode; /*one of FB_BLANK_ */
53 /* blit-only rendering path metrics, exposed through sysfs */ 54 /* blit-only rendering path metrics, exposed through sysfs */
54 atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */ 55 atomic_t bytes_rendered; /* raw pixel-bytes driver asked to render */
55 atomic_t bytes_identical; /* saved effort with backbuffer comparison */ 56 atomic_t bytes_identical; /* saved effort with backbuffer comparison */
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
index 76f7538bb339..d29c153705bc 100644
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
@@ -25,8 +25,9 @@ extern struct balloon_stats balloon_stats;
25 25
26void balloon_set_new_target(unsigned long target); 26void balloon_set_new_target(unsigned long target);
27 27
28int alloc_xenballooned_pages(int nr_pages, struct page** pages); 28int alloc_xenballooned_pages(int nr_pages, struct page **pages,
29void free_xenballooned_pages(int nr_pages, struct page** pages); 29 bool highmem);
30void free_xenballooned_pages(int nr_pages, struct page **pages);
30 31
31struct sys_device; 32struct sys_device;
32#ifdef CONFIG_XEN_SELFBALLOONING 33#ifdef CONFIG_XEN_SELFBALLOONING
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
index b1fab6b5b3ef..11e2dfce42f8 100644
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -43,7 +43,6 @@
43#include <xen/interface/grant_table.h> 43#include <xen/interface/grant_table.h>
44 44
45#include <asm/xen/hypervisor.h> 45#include <asm/xen/hypervisor.h>
46#include <asm/xen/grant_table.h>
47 46
48#include <xen/features.h> 47#include <xen/features.h>
49 48
@@ -156,6 +155,7 @@ unsigned int gnttab_max_grant_frames(void);
156#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) 155#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
157 156
158int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, 157int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
158 struct gnttab_map_grant_ref *kmap_ops,
159 struct page **pages, unsigned int count); 159 struct page **pages, unsigned int count);
160int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, 160int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
161 struct page **pages, unsigned int count); 161 struct page **pages, unsigned int count);
diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h
index 901724dc528d..b62dfef15f61 100644
--- a/include/xen/hvc-console.h
+++ b/include/xen/hvc-console.h
@@ -6,12 +6,12 @@ extern struct console xenboot_console;
6#ifdef CONFIG_HVC_XEN 6#ifdef CONFIG_HVC_XEN
7void xen_console_resume(void); 7void xen_console_resume(void);
8void xen_raw_console_write(const char *str); 8void xen_raw_console_write(const char *str);
9__attribute__((format(printf, 1, 2))) 9__printf(1, 2)
10void xen_raw_printk(const char *fmt, ...); 10void xen_raw_printk(const char *fmt, ...);
11#else 11#else
12static inline void xen_console_resume(void) { } 12static inline void xen_console_resume(void) { }
13static inline void xen_raw_console_write(const char *str) { } 13static inline void xen_raw_console_write(const char *str) { }
14static inline __attribute__((format(printf, 1, 2))) 14static inline __printf(1, 2)
15void xen_raw_printk(const char *fmt, ...) { } 15void xen_raw_printk(const char *fmt, ...) { }
16#endif 16#endif
17 17
diff --git a/include/xen/interface/io/blkif.h b/include/xen/interface/io/blkif.h
index 3d5d6db864fe..9324488f23f0 100644
--- a/include/xen/interface/io/blkif.h
+++ b/include/xen/interface/io/blkif.h
@@ -57,6 +57,36 @@ typedef uint64_t blkif_sector_t;
57 * "feature-flush-cache" node! 57 * "feature-flush-cache" node!
58 */ 58 */
59#define BLKIF_OP_FLUSH_DISKCACHE 3 59#define BLKIF_OP_FLUSH_DISKCACHE 3
60
61/*
62 * Recognised only if "feature-discard" is present in backend xenbus info.
63 * The "feature-discard" node contains a boolean indicating whether trim
64 * (ATA) or unmap (SCSI) - conviently called discard requests are likely
65 * to succeed or fail. Either way, a discard request
66 * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by
67 * the underlying block-device hardware. The boolean simply indicates whether
68 * or not it is worthwhile for the frontend to attempt discard requests.
69 * If a backend does not recognise BLKIF_OP_DISCARD, it should *not*
70 * create the "feature-discard" node!
71 *
72 * Discard operation is a request for the underlying block device to mark
73 * extents to be erased. However, discard does not guarantee that the blocks
74 * will be erased from the device - it is just a hint to the device
75 * controller that these blocks are no longer in use. What the device
76 * controller does with that information is left to the controller.
77 * Discard operations are passed with sector_number as the
78 * sector index to begin discard operations at and nr_sectors as the number of
79 * sectors to be discarded. The specified sectors should be discarded if the
80 * underlying block device supports trim (ATA) or unmap (SCSI) operations,
81 * or a BLKIF_RSP_EOPNOTSUPP should be returned.
82 * More information about trim/unmap operations at:
83 * http://t13.org/Documents/UploadedDocuments/docs2008/
84 * e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc
85 * http://www.seagate.com/staticfiles/support/disc/manuals/
86 * Interface%20manuals/100293068c.pdf
87 */
88#define BLKIF_OP_DISCARD 5
89
60/* 90/*
61 * Maximum scatter/gather segments per request. 91 * Maximum scatter/gather segments per request.
62 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE. 92 * This is carefully chosen so that sizeof(struct blkif_ring) <= PAGE_SIZE.
@@ -74,6 +104,11 @@ struct blkif_request_rw {
74 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST]; 104 } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
75}; 105};
76 106
107struct blkif_request_discard {
108 blkif_sector_t sector_number;
109 uint64_t nr_sectors;
110};
111
77struct blkif_request { 112struct blkif_request {
78 uint8_t operation; /* BLKIF_OP_??? */ 113 uint8_t operation; /* BLKIF_OP_??? */
79 uint8_t nr_segments; /* number of segments */ 114 uint8_t nr_segments; /* number of segments */
@@ -81,6 +116,7 @@ struct blkif_request {
81 uint64_t id; /* private guest value, echoed in resp */ 116 uint64_t id; /* private guest value, echoed in resp */
82 union { 117 union {
83 struct blkif_request_rw rw; 118 struct blkif_request_rw rw;
119 struct blkif_request_discard discard;
84 } u; 120 } u;
85}; 121};
86 122
diff --git a/include/xen/interface/io/xs_wire.h b/include/xen/interface/io/xs_wire.h
index 99fcffb372d1..f0b6890370be 100644
--- a/include/xen/interface/io/xs_wire.h
+++ b/include/xen/interface/io/xs_wire.h
@@ -26,7 +26,11 @@ enum xsd_sockmsg_type
26 XS_SET_PERMS, 26 XS_SET_PERMS,
27 XS_WATCH_EVENT, 27 XS_WATCH_EVENT,
28 XS_ERROR, 28 XS_ERROR,
29 XS_IS_DOMAIN_INTRODUCED 29 XS_IS_DOMAIN_INTRODUCED,
30 XS_RESUME,
31 XS_SET_TARGET,
32 XS_RESTRICT,
33 XS_RESET_WATCHES
30}; 34};
31 35
32#define XS_WRITE_NONE "NONE" 36#define XS_WRITE_NONE "NONE"
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
index 534cac89a77d..c1080d9c705d 100644
--- a/include/xen/interface/physdev.h
+++ b/include/xen/interface/physdev.h
@@ -109,6 +109,7 @@ struct physdev_irq {
109#define MAP_PIRQ_TYPE_MSI 0x0 109#define MAP_PIRQ_TYPE_MSI 0x0
110#define MAP_PIRQ_TYPE_GSI 0x1 110#define MAP_PIRQ_TYPE_GSI 0x1
111#define MAP_PIRQ_TYPE_UNKNOWN 0x2 111#define MAP_PIRQ_TYPE_UNKNOWN 0x2
112#define MAP_PIRQ_TYPE_MSI_SEG 0x3
112 113
113#define PHYSDEVOP_map_pirq 13 114#define PHYSDEVOP_map_pirq 13
114struct physdev_map_pirq { 115struct physdev_map_pirq {
@@ -119,7 +120,7 @@ struct physdev_map_pirq {
119 int index; 120 int index;
120 /* IN or OUT */ 121 /* IN or OUT */
121 int pirq; 122 int pirq;
122 /* IN */ 123 /* IN - high 16 bits hold segment for MAP_PIRQ_TYPE_MSI_SEG */
123 int bus; 124 int bus;
124 /* IN */ 125 /* IN */
125 int devfn; 126 int devfn;
@@ -198,6 +199,37 @@ struct physdev_get_free_pirq {
198 uint32_t pirq; 199 uint32_t pirq;
199}; 200};
200 201
202#define XEN_PCI_DEV_EXTFN 0x1
203#define XEN_PCI_DEV_VIRTFN 0x2
204#define XEN_PCI_DEV_PXM 0x4
205
206#define PHYSDEVOP_pci_device_add 25
207struct physdev_pci_device_add {
208 /* IN */
209 uint16_t seg;
210 uint8_t bus;
211 uint8_t devfn;
212 uint32_t flags;
213 struct {
214 uint8_t bus;
215 uint8_t devfn;
216 } physfn;
217#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218 uint32_t optarr[];
219#elif defined(__GNUC__)
220 uint32_t optarr[0];
221#endif
222};
223
224#define PHYSDEVOP_pci_device_remove 26
225#define PHYSDEVOP_restore_msi_ext 27
226struct physdev_pci_device {
227 /* IN */
228 uint16_t seg;
229 uint8_t bus;
230 uint8_t devfn;
231};
232
201/* 233/*
202 * Notify that some PIRQ-bound event channels have been unmasked. 234 * Notify that some PIRQ-bound event channels have been unmasked.
203 * ** This command is obsolete since interface version 0x00030202 and is ** 235 * ** This command is obsolete since interface version 0x00030202 and is **
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
new file mode 100644
index 000000000000..c1684680431b
--- /dev/null
+++ b/include/xen/interface/platform.h
@@ -0,0 +1,320 @@
1/******************************************************************************
2 * platform.h
3 *
4 * Hardware platform operations. Intended for use by domain-0 kernel.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 * Copyright (c) 2002-2006, K Fraser
25 */
26
27#ifndef __XEN_PUBLIC_PLATFORM_H__
28#define __XEN_PUBLIC_PLATFORM_H__
29
30#include "xen.h"
31
32#define XENPF_INTERFACE_VERSION 0x03000001
33
34/*
35 * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
36 * 1 January, 1970 if the current system time was <system_time>.
37 */
38#define XENPF_settime 17
39struct xenpf_settime {
40 /* IN variables. */
41 uint32_t secs;
42 uint32_t nsecs;
43 uint64_t system_time;
44};
45DEFINE_GUEST_HANDLE_STRUCT(xenpf_settime_t);
46
47/*
48 * Request memory range (@mfn, @mfn+@nr_mfns-1) to have type @type.
49 * On x86, @type is an architecture-defined MTRR memory type.
50 * On success, returns the MTRR that was used (@reg) and a handle that can
51 * be passed to XENPF_DEL_MEMTYPE to accurately tear down the new setting.
52 * (x86-specific).
53 */
54#define XENPF_add_memtype 31
55struct xenpf_add_memtype {
56 /* IN variables. */
57 unsigned long mfn;
58 uint64_t nr_mfns;
59 uint32_t type;
60 /* OUT variables. */
61 uint32_t handle;
62 uint32_t reg;
63};
64DEFINE_GUEST_HANDLE_STRUCT(xenpf_add_memtype_t);
65
66/*
67 * Tear down an existing memory-range type. If @handle is remembered then it
68 * should be passed in to accurately tear down the correct setting (in case
69 * of overlapping memory regions with differing types). If it is not known
70 * then @handle should be set to zero. In all cases @reg must be set.
71 * (x86-specific).
72 */
73#define XENPF_del_memtype 32
74struct xenpf_del_memtype {
75 /* IN variables. */
76 uint32_t handle;
77 uint32_t reg;
78};
79DEFINE_GUEST_HANDLE_STRUCT(xenpf_del_memtype_t);
80
81/* Read current type of an MTRR (x86-specific). */
82#define XENPF_read_memtype 33
83struct xenpf_read_memtype {
84 /* IN variables. */
85 uint32_t reg;
86 /* OUT variables. */
87 unsigned long mfn;
88 uint64_t nr_mfns;
89 uint32_t type;
90};
91DEFINE_GUEST_HANDLE_STRUCT(xenpf_read_memtype_t);
92
93#define XENPF_microcode_update 35
94struct xenpf_microcode_update {
95 /* IN variables. */
96 GUEST_HANDLE(void) data; /* Pointer to microcode data */
97 uint32_t length; /* Length of microcode data. */
98};
99DEFINE_GUEST_HANDLE_STRUCT(xenpf_microcode_update_t);
100
101#define XENPF_platform_quirk 39
102#define QUIRK_NOIRQBALANCING 1 /* Do not restrict IO-APIC RTE targets */
103#define QUIRK_IOAPIC_BAD_REGSEL 2 /* IO-APIC REGSEL forgets its value */
104#define QUIRK_IOAPIC_GOOD_REGSEL 3 /* IO-APIC REGSEL behaves properly */
105struct xenpf_platform_quirk {
106 /* IN variables. */
107 uint32_t quirk_id;
108};
109DEFINE_GUEST_HANDLE_STRUCT(xenpf_platform_quirk_t);
110
111#define XENPF_firmware_info 50
112#define XEN_FW_DISK_INFO 1 /* from int 13 AH=08/41/48 */
113#define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */
114#define XEN_FW_VBEDDC_INFO 3 /* from int 10 AX=4f15 */
115struct xenpf_firmware_info {
116 /* IN variables. */
117 uint32_t type;
118 uint32_t index;
119 /* OUT variables. */
120 union {
121 struct {
122 /* Int13, Fn48: Check Extensions Present. */
123 uint8_t device; /* %dl: bios device number */
124 uint8_t version; /* %ah: major version */
125 uint16_t interface_support; /* %cx: support bitmap */
126 /* Int13, Fn08: Legacy Get Device Parameters. */
127 uint16_t legacy_max_cylinder; /* %cl[7:6]:%ch: max cyl # */
128 uint8_t legacy_max_head; /* %dh: max head # */
129 uint8_t legacy_sectors_per_track; /* %cl[5:0]: max sector # */
130 /* Int13, Fn41: Get Device Parameters (as filled into %ds:%esi). */
131 /* NB. First uint16_t of buffer must be set to buffer size. */
132 GUEST_HANDLE(void) edd_params;
133 } disk_info; /* XEN_FW_DISK_INFO */
134 struct {
135 uint8_t device; /* bios device number */
136 uint32_t mbr_signature; /* offset 0x1b8 in mbr */
137 } disk_mbr_signature; /* XEN_FW_DISK_MBR_SIGNATURE */
138 struct {
139 /* Int10, AX=4F15: Get EDID info. */
140 uint8_t capabilities;
141 uint8_t edid_transfer_time;
142 /* must refer to 128-byte buffer */
143 GUEST_HANDLE(uchar) edid;
144 } vbeddc_info; /* XEN_FW_VBEDDC_INFO */
145 } u;
146};
147DEFINE_GUEST_HANDLE_STRUCT(xenpf_firmware_info_t);
148
149#define XENPF_enter_acpi_sleep 51
150struct xenpf_enter_acpi_sleep {
151 /* IN variables */
152 uint16_t pm1a_cnt_val; /* PM1a control value. */
153 uint16_t pm1b_cnt_val; /* PM1b control value. */
154 uint32_t sleep_state; /* Which state to enter (Sn). */
155 uint32_t flags; /* Must be zero. */
156};
157DEFINE_GUEST_HANDLE_STRUCT(xenpf_enter_acpi_sleep_t);
158
159#define XENPF_change_freq 52
160struct xenpf_change_freq {
161 /* IN variables */
162 uint32_t flags; /* Must be zero. */
163 uint32_t cpu; /* Physical cpu. */
164 uint64_t freq; /* New frequency (Hz). */
165};
166DEFINE_GUEST_HANDLE_STRUCT(xenpf_change_freq_t);
167
168/*
169 * Get idle times (nanoseconds since boot) for physical CPUs specified in the
170 * @cpumap_bitmap with range [0..@cpumap_nr_cpus-1]. The @idletime array is
171 * indexed by CPU number; only entries with the corresponding @cpumap_bitmap
172 * bit set are written to. On return, @cpumap_bitmap is modified so that any
173 * non-existent CPUs are cleared. Such CPUs have their @idletime array entry
174 * cleared.
175 */
176#define XENPF_getidletime 53
177struct xenpf_getidletime {
178 /* IN/OUT variables */
179 /* IN: CPUs to interrogate; OUT: subset of IN which are present */
180 GUEST_HANDLE(uchar) cpumap_bitmap;
181 /* IN variables */
182 /* Size of cpumap bitmap. */
183 uint32_t cpumap_nr_cpus;
184 /* Must be indexable for every cpu in cpumap_bitmap. */
185 GUEST_HANDLE(uint64_t) idletime;
186 /* OUT variables */
187 /* System time when the idletime snapshots were taken. */
188 uint64_t now;
189};
190DEFINE_GUEST_HANDLE_STRUCT(xenpf_getidletime_t);
191
192#define XENPF_set_processor_pminfo 54
193
194/* ability bits */
195#define XEN_PROCESSOR_PM_CX 1
196#define XEN_PROCESSOR_PM_PX 2
197#define XEN_PROCESSOR_PM_TX 4
198
199/* cmd type */
200#define XEN_PM_CX 0
201#define XEN_PM_PX 1
202#define XEN_PM_TX 2
203
204/* Px sub info type */
205#define XEN_PX_PCT 1
206#define XEN_PX_PSS 2
207#define XEN_PX_PPC 4
208#define XEN_PX_PSD 8
209
210struct xen_power_register {
211 uint32_t space_id;
212 uint32_t bit_width;
213 uint32_t bit_offset;
214 uint32_t access_size;
215 uint64_t address;
216};
217
218struct xen_processor_csd {
219 uint32_t domain; /* domain number of one dependent group */
220 uint32_t coord_type; /* coordination type */
221 uint32_t num; /* number of processors in same domain */
222};
223DEFINE_GUEST_HANDLE_STRUCT(xen_processor_csd);
224
225struct xen_processor_cx {
226 struct xen_power_register reg; /* GAS for Cx trigger register */
227 uint8_t type; /* cstate value, c0: 0, c1: 1, ... */
228 uint32_t latency; /* worst latency (ms) to enter/exit this cstate */
229 uint32_t power; /* average power consumption(mW) */
230 uint32_t dpcnt; /* number of dependency entries */
231 GUEST_HANDLE(xen_processor_csd) dp; /* NULL if no dependency */
232};
233DEFINE_GUEST_HANDLE_STRUCT(xen_processor_cx);
234
235struct xen_processor_flags {
236 uint32_t bm_control:1;
237 uint32_t bm_check:1;
238 uint32_t has_cst:1;
239 uint32_t power_setup_done:1;
240 uint32_t bm_rld_set:1;
241};
242
243struct xen_processor_power {
244 uint32_t count; /* number of C state entries in array below */
245 struct xen_processor_flags flags; /* global flags of this processor */
246 GUEST_HANDLE(xen_processor_cx) states; /* supported c states */
247};
248
249struct xen_pct_register {
250 uint8_t descriptor;
251 uint16_t length;
252 uint8_t space_id;
253 uint8_t bit_width;
254 uint8_t bit_offset;
255 uint8_t reserved;
256 uint64_t address;
257};
258
259struct xen_processor_px {
260 uint64_t core_frequency; /* megahertz */
261 uint64_t power; /* milliWatts */
262 uint64_t transition_latency; /* microseconds */
263 uint64_t bus_master_latency; /* microseconds */
264 uint64_t control; /* control value */
265 uint64_t status; /* success indicator */
266};
267DEFINE_GUEST_HANDLE_STRUCT(xen_processor_px);
268
269struct xen_psd_package {
270 uint64_t num_entries;
271 uint64_t revision;
272 uint64_t domain;
273 uint64_t coord_type;
274 uint64_t num_processors;
275};
276
277struct xen_processor_performance {
278 uint32_t flags; /* flag for Px sub info type */
279 uint32_t platform_limit; /* Platform limitation on freq usage */
280 struct xen_pct_register control_register;
281 struct xen_pct_register status_register;
282 uint32_t state_count; /* total available performance states */
283 GUEST_HANDLE(xen_processor_px) states;
284 struct xen_psd_package domain_info;
285 uint32_t shared_type; /* coordination type of this processor */
286};
287DEFINE_GUEST_HANDLE_STRUCT(xen_processor_performance);
288
289struct xenpf_set_processor_pminfo {
290 /* IN variables */
291 uint32_t id; /* ACPI CPU ID */
292 uint32_t type; /* {XEN_PM_CX, XEN_PM_PX} */
293 union {
294 struct xen_processor_power power;/* Cx: _CST/_CSD */
295 struct xen_processor_performance perf; /* Px: _PPC/_PCT/_PSS/_PSD */
296 };
297};
298DEFINE_GUEST_HANDLE_STRUCT(xenpf_set_processor_pminfo);
299
300struct xen_platform_op {
301 uint32_t cmd;
302 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
303 union {
304 struct xenpf_settime settime;
305 struct xenpf_add_memtype add_memtype;
306 struct xenpf_del_memtype del_memtype;
307 struct xenpf_read_memtype read_memtype;
308 struct xenpf_microcode_update microcode;
309 struct xenpf_platform_quirk platform_quirk;
310 struct xenpf_firmware_info firmware_info;
311 struct xenpf_enter_acpi_sleep enter_acpi_sleep;
312 struct xenpf_change_freq change_freq;
313 struct xenpf_getidletime getidletime;
314 struct xenpf_set_processor_pminfo set_pminfo;
315 uint8_t pad[128];
316 } u;
317};
318DEFINE_GUEST_HANDLE_STRUCT(xen_platform_op_t);
319
320#endif /* __XEN_PUBLIC_PLATFORM_H__ */
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 6acd9cefd517..6a6e91449347 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -492,6 +492,7 @@ struct dom0_vga_console_info {
492/* These flags are passed in the 'flags' field of start_info_t. */ 492/* These flags are passed in the 'flags' field of start_info_t. */
493#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */ 493#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
494#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ 494#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
495#define SIF_PM_MASK (0xFF<<8) /* reserve 1 byte for xen-pm options */
495 496
496typedef uint64_t cpumap_t; 497typedef uint64_t cpumap_t;
497 498
diff --git a/include/xen/page.h b/include/xen/page.h
index 0be36b976f4b..12765b6f9517 100644
--- a/include/xen/page.h
+++ b/include/xen/page.h
@@ -3,6 +3,16 @@
3 3
4#include <asm/xen/page.h> 4#include <asm/xen/page.h>
5 5
6extern phys_addr_t xen_extra_mem_start, xen_extra_mem_size; 6struct xen_memory_region {
7 phys_addr_t start;
8 phys_addr_t size;
9};
10
11#define XEN_EXTRA_MEM_MAX_REGIONS 128 /* == E820MAX */
12
13extern __initdata
14struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS];
15
16extern unsigned long xen_released_pages;
7 17
8#endif /* _XEN_PAGE_H */ 18#endif /* _XEN_PAGE_H */
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index aceeca799fd7..b1b6676c1c43 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -37,6 +37,7 @@
37#include <linux/device.h> 37#include <linux/device.h>
38#include <linux/notifier.h> 38#include <linux/notifier.h>
39#include <linux/mutex.h> 39#include <linux/mutex.h>
40#include <linux/export.h>
40#include <linux/completion.h> 41#include <linux/completion.h>
41#include <linux/init.h> 42#include <linux/init.h>
42#include <linux/slab.h> 43#include <linux/slab.h>
@@ -156,9 +157,9 @@ int xenbus_scanf(struct xenbus_transaction t,
156 __attribute__((format(scanf, 4, 5))); 157 __attribute__((format(scanf, 4, 5)));
157 158
158/* Single printf and write: returns -errno or 0. */ 159/* Single printf and write: returns -errno or 0. */
160__printf(4, 5)
159int xenbus_printf(struct xenbus_transaction t, 161int xenbus_printf(struct xenbus_transaction t,
160 const char *dir, const char *node, const char *fmt, ...) 162 const char *dir, const char *node, const char *fmt, ...);
161 __attribute__((format(printf, 4, 5)));
162 163
163/* Generic read function: NULL-terminated triples of name, 164/* Generic read function: NULL-terminated triples of name,
164 * sprintf-style type string, and pointer. Returns 0 or errno.*/ 165 * sprintf-style type string, and pointer. Returns 0 or errno.*/
@@ -200,11 +201,11 @@ int xenbus_watch_path(struct xenbus_device *dev, const char *path,
200 struct xenbus_watch *watch, 201 struct xenbus_watch *watch,
201 void (*callback)(struct xenbus_watch *, 202 void (*callback)(struct xenbus_watch *,
202 const char **, unsigned int)); 203 const char **, unsigned int));
204__printf(4, 5)
203int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch, 205int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch,
204 void (*callback)(struct xenbus_watch *, 206 void (*callback)(struct xenbus_watch *,
205 const char **, unsigned int), 207 const char **, unsigned int),
206 const char *pathfmt, ...) 208 const char *pathfmt, ...);
207 __attribute__ ((format (printf, 4, 5)));
208 209
209int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state); 210int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state);
210int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn); 211int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn);
@@ -223,9 +224,9 @@ int xenbus_free_evtchn(struct xenbus_device *dev, int port);
223 224
224enum xenbus_state xenbus_read_driver_state(const char *path); 225enum xenbus_state xenbus_read_driver_state(const char *path);
225 226
226__attribute__((format(printf, 3, 4))) 227__printf(3, 4)
227void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...); 228void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...);
228__attribute__((format(printf, 3, 4))) 229__printf(3, 4)
229void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...); 230void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...);
230 231
231const char *xenbus_strstate(enum xenbus_state state); 232const char *xenbus_strstate(enum xenbus_state state);